From de829448357b4c9121d466af4b1c3cafd2a8dd3e Mon Sep 17 00:00:00 2001 From: Ingo Molnar Date: Mon, 3 Jan 2011 19:59:24 +0100 Subject: [PATCH] --- yaml --- r: 223736 b: refs/heads/master c: a0a2b71bb750ffe9b3faa317cb6317f4ad109383 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/oprofile/op_model_amd.c | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 242da332c9d5..1ae4980859ea 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d425de5436a620de506f9e4119bf8daa1cb93718 +refs/heads/master: a0a2b71bb750ffe9b3faa317cb6317f4ad109383 diff --git a/trunk/arch/x86/oprofile/op_model_amd.c b/trunk/arch/x86/oprofile/op_model_amd.c index a011bcc0f943..7d90d47655ba 100644 --- a/trunk/arch/x86/oprofile/op_model_amd.c +++ b/trunk/arch/x86/oprofile/op_model_amd.c @@ -630,21 +630,29 @@ static int __init_ibs_nmi(void) return 0; } -/* initialize the APIC for the IBS interrupts if available */ +/* + * check and reserve APIC extended interrupt LVT offset for IBS if + * available + * + * init_ibs() preforms implicitly cpu-local operations, so pin this + * thread to its current CPU + */ + static void init_ibs(void) { - ibs_caps = get_ibs_caps(); + preempt_disable(); + ibs_caps = get_ibs_caps(); if (!ibs_caps) - return; + goto out; - if (__init_ibs_nmi()) { + if (__init_ibs_nmi() < 0) ibs_caps = 0; - return; - } + else + printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", ibs_caps); - printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", - (unsigned)ibs_caps); +out: + preempt_enable(); } static int (*create_arch_files)(struct super_block *sb, struct dentry *root);