aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/oprofile/op_model_amd.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/oprofile/op_model_amd.c')
-rw-r--r--arch/x86/oprofile/op_model_amd.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/arch/x86/oprofile/op_model_amd.c b/arch/x86/oprofile/op_model_amd.c
index b67a6b5aa8d4..42623310c968 100644
--- a/arch/x86/oprofile/op_model_amd.c
+++ b/arch/x86/oprofile/op_model_amd.c
@@ -484,21 +484,29 @@ static int __init_ibs_nmi(void)
484 return 0; 484 return 0;
485} 485}
486 486
487/* initialize the APIC for the IBS interrupts if available */ 487/*
488 * check and reserve APIC extended interrupt LVT offset for IBS if
489 * available
490 *
491 * init_ibs() preforms implicitly cpu-local operations, so pin this
492 * thread to its current CPU
493 */
494
488static void init_ibs(void) 495static void init_ibs(void)
489{ 496{
490 ibs_caps = get_ibs_caps(); 497 preempt_disable();
491 498
499 ibs_caps = get_ibs_caps();
492 if (!ibs_caps) 500 if (!ibs_caps)
493 return; 501 goto out;
494 502
495 if (__init_ibs_nmi()) { 503 if (__init_ibs_nmi() < 0)
496 ibs_caps = 0; 504 ibs_caps = 0;
497 return; 505 else
498 } 506 printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", ibs_caps);
499 507
500 printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", 508out:
501 (unsigned)ibs_caps); 509 preempt_enable();
502} 510}
503 511
504static int (*create_arch_files)(struct super_block *sb, struct dentry *root); 512static int (*create_arch_files)(struct super_block *sb, struct dentry *root);