--- /dev/null
+From de28f25e8244c7353abed8de0c7792f5f883588c Mon Sep 17 00:00:00 2001
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Fri, 2 Dec 2011 16:02:45 +0100
+Subject: clockevents: Set noop handler in clockevents_exchange_device()
+
+From: Thomas Gleixner <tglx@linutronix.de>
+
+commit de28f25e8244c7353abed8de0c7792f5f883588c upstream.
+
+If a device is shutdown, then there might be a pending interrupt,
+which will be processed after we reenable interrupts, which causes the
+original handler to be run. If the old handler is the (broadcast)
+periodic handler the shutdown state might hang the kernel completely.
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/time/clockevents.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/kernel/time/clockevents.c
++++ b/kernel/time/clockevents.c
+@@ -286,6 +286,7 @@ void clockevents_exchange_device(struct
+ * released list and do a notify add later.
+ */
+ if (old) {
++ old->event_handler = clockevents_handle_noop;
+ clockevents_set_mode(old, CLOCK_EVT_MODE_UNUSED);
+ list_del(&old->list);
+ list_add(&old->list, &clockevents_released);
--- /dev/null
+From b1f919664d04a8d0ba29cb76673c7ca3325a2006 Mon Sep 17 00:00:00 2001
+From: "Yang Honggang (Joseph)" <eagle.rtlinux@gmail.com>
+Date: Thu, 1 Dec 2011 22:22:41 -0500
+Subject: clocksource: Fix bug with max_deferment margin calculation
+
+From: "Yang Honggang (Joseph)" <eagle.rtlinux@gmail.com>
+
+commit b1f919664d04a8d0ba29cb76673c7ca3325a2006 upstream.
+
+In order to leave a margin of 12.5% we should >> 3 not >> 5.
+
+Signed-off-by: Yang Honggang (Joseph) <eagle.rtlinux@gmail.com>
+[jstultz: Modified commit subject]
+Signed-off-by: John Stultz <john.stultz@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/time/clocksource.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/kernel/time/clocksource.c
++++ b/kernel/time/clocksource.c
+@@ -531,7 +531,7 @@ static u64 clocksource_max_deferment(str
+ * note a margin of 12.5% is used because this can be computed with
+ * a shift, versus say 10% which would require division.
+ */
+- return max_nsecs - (max_nsecs >> 5);
++ return max_nsecs - (max_nsecs >> 3);
+ }
+
+ #ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
+@@ -653,7 +653,7 @@ void __clocksource_updatefreq_scale(stru
+ * ~ 0.06ppm granularity for NTP. We apply the same 12.5%
+ * margin as we do in clocksource_max_deferment()
+ */
+- sec = (cs->mask - (cs->mask >> 5));
++ sec = (cs->mask - (cs->mask >> 3));
+ do_div(sec, freq);
+ do_div(sec, scale);
+ if (!sec)
--- /dev/null
+From bbbf7af4bf8fc69bc751818cf30521080fa47dcb Mon Sep 17 00:00:00 2001
+From: Gleb Natapov <gleb@redhat.com>
+Date: Tue, 18 Oct 2011 19:55:51 +0200
+Subject: jump_label: jump_label_inc may return before the code is patched
+
+From: Gleb Natapov <gleb@redhat.com>
+
+commit bbbf7af4bf8fc69bc751818cf30521080fa47dcb upstream.
+
+If cpu A calls jump_label_inc() just after atomic_add_return() is
+called by cpu B, atomic_inc_not_zero() will return value greater then
+zero and jump_label_inc() will return to a caller before jump_label_update()
+finishes its job on cpu B.
+
+Link: http://lkml.kernel.org/r/20111018175551.GH17571@redhat.com
+
+Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
+Acked-by: Jason Baron <jbaron@redhat.com>
+Signed-off-by: Gleb Natapov <gleb@redhat.com>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/jump_label.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/kernel/jump_label.c
++++ b/kernel/jump_label.c
+@@ -66,8 +66,9 @@ void jump_label_inc(struct jump_label_ke
+ return;
+
+ jump_label_lock();
+- if (atomic_add_return(1, &key->enabled) == 1)
++ if (atomic_read(&key->enabled) == 0)
+ jump_label_update(key, JUMP_LABEL_ENABLE);
++ atomic_inc(&key->enabled);
+ jump_label_unlock();
+ }
+
--- /dev/null
+From 87121ca504fd1d963a66b3fb0c72054b0fd9a177 Mon Sep 17 00:00:00 2001
+From: Robert Richter <robert.richter@amd.com>
+Date: Fri, 7 Oct 2011 16:31:46 +0200
+Subject: oprofile: Fix crash when unloading module (hr timer mode)
+
+From: Robert Richter <robert.richter@amd.com>
+
+commit 87121ca504fd1d963a66b3fb0c72054b0fd9a177 upstream.
+
+Oprofile may crash in a KVM guest while unlaoding modules. This
+happens if oprofile_arch_init() fails and oprofile switches to the hr
+timer mode as a fallback. In this case oprofile_arch_exit() is called,
+but it never was initialized properly which causes the crash. This
+patch fixes this.
+
+oprofile: using timer interrupt.
+BUG: unable to handle kernel NULL pointer dereference at 0000000000000008
+IP: [<ffffffff8123c226>] unregister_syscore_ops+0x41/0x58
+PGD 41da3f067 PUD 41d80e067 PMD 0
+Oops: 0002 [#1] PREEMPT SMP
+CPU 5
+Modules linked in: oprofile(-)
+
+Pid: 2382, comm: modprobe Not tainted 3.1.0-rc7-00018-g709a39d #18 Advanced Micro Device Anaheim/Anaheim
+RIP: 0010:[<ffffffff8123c226>] [<ffffffff8123c226>] unregister_syscore_ops+0x41/0x58
+RSP: 0018:ffff88041de1de98 EFLAGS: 00010296
+RAX: 0000000000000000 RBX: ffffffffa00060e0 RCX: dead000000200200
+RDX: 0000000000000000 RSI: dead000000100100 RDI: ffffffff8178c620
+RBP: ffff88041de1dea8 R08: 0000000000000001 R09: 0000000000000082
+R10: 0000000000000000 R11: ffff88041de1dde8 R12: 0000000000000080
+R13: fffffffffffffff5 R14: 0000000000000001 R15: 0000000000610210
+FS: 00007f9ae5bef700(0000) GS:ffff88042fd40000(0000) knlGS:0000000000000000
+CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
+CR2: 0000000000000008 CR3: 000000041ca44000 CR4: 00000000000006e0
+DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
+DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
+Process modprobe (pid: 2382, threadinfo ffff88041de1c000, task ffff88042db6d040)
+Stack:
+ ffff88041de1deb8 ffffffffa0006770 ffff88041de1deb8 ffffffffa000251e
+ ffff88041de1dec8 ffffffffa00022c2 ffff88041de1ded8 ffffffffa0004993
+ ffff88041de1df78 ffffffff81073115 656c69666f72706f 0000000000610200
+Call Trace:
+ [<ffffffffa000251e>] op_nmi_exit+0x15/0x17 [oprofile]
+ [<ffffffffa00022c2>] oprofile_arch_exit+0xe/0x10 [oprofile]
+ [<ffffffffa0004993>] oprofile_exit+0x13/0x15 [oprofile]
+ [<ffffffff81073115>] sys_delete_module+0x1c3/0x22f
+ [<ffffffff811bf09e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
+ [<ffffffff8148070b>] system_call_fastpath+0x16/0x1b
+Code: 20 c6 78 81 e8 c5 cc 23 00 48 8b 13 48 8b 43 08 48 be 00 01 10 00 00 00 ad de 48 b9 00 02 20 00 00 00 ad de 48 c7 c7 20 c6 78 81
+ 89 42 08 48 89 10 48 89 33 48 89 4b 08 e8 a6 c0 23 00 5a 5b
+RIP [<ffffffff8123c226>] unregister_syscore_ops+0x41/0x58
+ RSP <ffff88041de1de98>
+CR2: 0000000000000008
+---[ end trace 06d4e95b6aa3b437 ]---
+
+Signed-off-by: Robert Richter <robert.richter@amd.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/oprofile/oprof.c | 29 ++++++++++++++++++++++++-----
+ drivers/oprofile/timer_int.c | 1 +
+ 2 files changed, 25 insertions(+), 5 deletions(-)
+
+--- a/drivers/oprofile/oprof.c
++++ b/drivers/oprofile/oprof.c
+@@ -239,26 +239,45 @@ int oprofile_set_ulong(unsigned long *ad
+ return err;
+ }
+
++static int timer_mode;
++
+ static int __init oprofile_init(void)
+ {
+ int err;
+
++ /* always init architecture to setup backtrace support */
+ err = oprofile_arch_init(&oprofile_ops);
+- if (err < 0 || timer) {
+- printk(KERN_INFO "oprofile: using timer interrupt.\n");
++
++ timer_mode = err || timer; /* fall back to timer mode on errors */
++ if (timer_mode) {
++ if (!err)
++ oprofile_arch_exit();
+ err = oprofile_timer_init(&oprofile_ops);
+ if (err)
+ return err;
+ }
+- return oprofilefs_register();
++
++ err = oprofilefs_register();
++ if (!err)
++ return 0;
++
++ /* failed */
++ if (timer_mode)
++ oprofile_timer_exit();
++ else
++ oprofile_arch_exit();
++
++ return err;
+ }
+
+
+ static void __exit oprofile_exit(void)
+ {
+- oprofile_timer_exit();
+ oprofilefs_unregister();
+- oprofile_arch_exit();
++ if (timer_mode)
++ oprofile_timer_exit();
++ else
++ oprofile_arch_exit();
+ }
+
+
+--- a/drivers/oprofile/timer_int.c
++++ b/drivers/oprofile/timer_int.c
+@@ -110,6 +110,7 @@ int oprofile_timer_init(struct oprofile_
+ ops->start = oprofile_hrtimer_start;
+ ops->stop = oprofile_hrtimer_stop;
+ ops->cpu_type = "timer";
++ printk(KERN_INFO "oprofile: using timer interrupt.\n");
+ return 0;
+ }
+
--- /dev/null
+From d06c27b22aa66e48e32f03f9387328a9af9b0625 Mon Sep 17 00:00:00 2001
+From: Steven Rostedt <srostedt@redhat.com>
+Date: Fri, 4 Nov 2011 16:32:25 -0400
+Subject: perf: Fix parsing of __print_flags() in TP_printk()
+
+From: Steven Rostedt <srostedt@redhat.com>
+
+commit d06c27b22aa66e48e32f03f9387328a9af9b0625 upstream.
+
+A update is made to the sched:sched_switch event that adds some
+logic to the first parameter of the __print_flags() that shows the
+state of tasks. This change cause perf to fail parsing the flags.
+
+A simple fix is needed to have the parser be able to process ops
+within the argument.
+
+Reported-by: Andrew Vagin <avagin@openvz.org>
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ tools/perf/util/trace-event-parse.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/tools/perf/util/trace-event-parse.c
++++ b/tools/perf/util/trace-event-parse.c
+@@ -1537,6 +1537,8 @@ process_flags(struct event *event, struc
+ field = malloc_or_die(sizeof(*field));
+
+ type = process_arg(event, field, &token);
++ while (type == EVENT_OP)
++ type = process_op(event, field, &token);
+ if (test_type_token(type, token, EVENT_DELIM, ","))
+ goto out_free;
+
xfs-fix-attr2-vs-large-data-fork-assert.patch
trace_events_filter-use-rcu_assign_pointer-when-setting-ftrace_event_call-filter.patch
rtc-disable-the-alarm-in-the-hardware.patch
+tracing-fix-event_subsystem-ref-counting.patch
+tick-broadcast-stop-active-broadcast-device-when-replacing-it.patch
+perf-fix-parsing-of-__print_flags-in-tp_printk.patch
+jump_label-jump_label_inc-may-return-before-the-code-is-patched.patch
+oprofile-fix-crash-when-unloading-module-hr-timer-mode.patch
+clocksource-fix-bug-with-max_deferment-margin-calculation.patch
+clockevents-set-noop-handler-in-clockevents_exchange_device.patch
--- /dev/null
+From c1be84309c58b1e7c6d626e28fba41a22b364c3d Mon Sep 17 00:00:00 2001
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Fri, 2 Dec 2011 12:34:16 +0100
+Subject: tick-broadcast: Stop active broadcast device when replacing it
+
+From: Thomas Gleixner <tglx@linutronix.de>
+
+commit c1be84309c58b1e7c6d626e28fba41a22b364c3d upstream.
+
+When a better rated broadcast device is installed, then the current
+active device is not disabled, which results in two running broadcast
+devices.
+
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/time/tick-broadcast.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/kernel/time/tick-broadcast.c
++++ b/kernel/time/tick-broadcast.c
+@@ -71,7 +71,7 @@ int tick_check_broadcast_device(struct c
+ (dev->features & CLOCK_EVT_FEAT_C3STOP))
+ return 0;
+
+- clockevents_exchange_device(NULL, dev);
++ clockevents_exchange_device(tick_broadcast_device.evtdev, dev);
+ tick_broadcast_device.evtdev = dev;
+ if (!cpumask_empty(tick_get_broadcast_mask()))
+ tick_broadcast_start_periodic(dev);
--- /dev/null
+From cb59974742aea24adf6637eb0c4b8e7b48bca6fb Mon Sep 17 00:00:00 2001
+From: Ilya Dryomov <idryomov@gmail.com>
+Date: Mon, 31 Oct 2011 11:07:42 +0200
+Subject: tracing: fix event_subsystem ref counting
+
+From: Ilya Dryomov <idryomov@gmail.com>
+
+commit cb59974742aea24adf6637eb0c4b8e7b48bca6fb upstream.
+
+Fix a bug introduced by e9dbfae5, which prevents event_subsystem from
+ever being released.
+
+Ref_count was added to keep track of subsystem users, not for counting
+events. Subsystem is created with ref_count = 1, so there is no need to
+increment it for every event, we have nr_events for that. Fix this by
+touching ref_count only when we actually have a new user -
+subsystem_open().
+
+Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
+Link: http://lkml.kernel.org/r/1320052062-7846-1-git-send-email-idryomov@gmail.com
+Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ kernel/trace/trace_events.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+--- a/kernel/trace/trace_events.c
++++ b/kernel/trace/trace_events.c
+@@ -1096,7 +1096,6 @@ event_subsystem_dir(const char *name, st
+ /* First see if we did not already create this dir */
+ list_for_each_entry(system, &event_subsystems, list) {
+ if (strcmp(system->name, name) == 0) {
+- __get_system(system);
+ system->nr_events++;
+ return system->entry;
+ }