summaryrefslogtreecommitdiffstats
path: root/extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch
diff options
context:
space:
mode:
Diffstat (limited to 'extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch')
-rw-r--r--extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch b/extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch
new file mode 100644
index 00000000..dc5522d0
--- /dev/null
+++ b/extras/recipes-kernel/linux/linux-omap/linus/0053-arch-x86-oprofile-op_model_amd.c-Perform-initialisat.patch
@@ -0,0 +1,81 @@
1From b376276870006eabba46427b79a3f3be70b3e3ea Mon Sep 17 00:00:00 2001
2From: Robert Richter <robert.richter@amd.com>
3Date: Mon, 3 Jan 2011 12:15:14 +0100
4Subject: [PATCH 53/65] arch/x86/oprofile/op_model_amd.c: Perform initialisation on a single CPU
5
6Disable preemption in init_ibs(). The function only checks the
7ibs capabilities and sets up pci devices (if necessary). It runs
8only on one cpu but operates with the local APIC and some MSRs,
9thus it is better to disable preemption.
10
11[ 7.034377] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/483
12[ 7.034385] caller is setup_APIC_eilvt+0x155/0x180
13[ 7.034389] Pid: 483, comm: modprobe Not tainted 2.6.37-rc1-20101110+ #1
14[ 7.034392] Call Trace:
15[ 7.034400] [<ffffffff812a2b72>] debug_smp_processor_id+0xd2/0xf0
16[ 7.034404] [<ffffffff8101e985>] setup_APIC_eilvt+0x155/0x180
17[ ... ]
18
19Addresses https://bugzilla.kernel.org/show_bug.cgi?id=22812
20
21Reported-by: <atswartz@gmail.com>
22Signed-off-by: Robert Richter <robert.richter@amd.com>
23Cc: oprofile-list@lists.sourceforge.net <oprofile-list@lists.sourceforge.net>
24Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
25Cc: Frederic Weisbecker <fweisbec@gmail.com>
26Cc: Rafael J. Wysocki <rjw@sisk.pl>
27Cc: Dan Carpenter <error27@gmail.com>
28Cc: Andrew Morton <akpm@linux-foundation.org>
29Cc: <stable@kernel.org> [2.6.37.x]
30LKML-Reference: <20110103111514.GM4739@erda.amd.com>
31[ small cleanups ]
32Signed-off-by: Ingo Molnar <mingo@elte.hu>
33---
34 arch/x86/oprofile/op_model_amd.c | 24 ++++++++++++++++--------
35 1 files changed, 16 insertions(+), 8 deletions(-)
36
37diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c
38index a011bcc..7d90d47 100644
39--- a/arch/x86/oprofile/op_model_amd.c
40+++ b/arch/x86/oprofile/op_model_amd.c
41@@ -630,21 +630,29 @@ static int __init_ibs_nmi(void)
42 return 0;
43 }
44
45-/* initialize the APIC for the IBS interrupts if available */
46+/*
47+ * check and reserve APIC extended interrupt LVT offset for IBS if
48+ * available
49+ *
50+ * init_ibs() preforms implicitly cpu-local operations, so pin this
51+ * thread to its current CPU
52+ */
53+
54 static void init_ibs(void)
55 {
56- ibs_caps = get_ibs_caps();
57+ preempt_disable();
58
59+ ibs_caps = get_ibs_caps();
60 if (!ibs_caps)
61- return;
62+ goto out;
63
64- if (__init_ibs_nmi()) {
65+ if (__init_ibs_nmi() < 0)
66 ibs_caps = 0;
67- return;
68- }
69+ else
70+ printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", ibs_caps);
71
72- printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n",
73- (unsigned)ibs_caps);
74+out:
75+ preempt_enable();
76 }
77
78 static int (*create_arch_files)(struct super_block *sb, struct dentry *root);
79--
801.6.6.1
81