diff options
Diffstat (limited to 'arch/x86/oprofile')
-rw-r--r-- | arch/x86/oprofile/op_model_amd.c | 24 |
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 a011bcc0f943..7d90d47655ba 100644 --- a/arch/x86/oprofile/op_model_amd.c +++ b/arch/x86/oprofile/op_model_amd.c | |||
@@ -630,21 +630,29 @@ static int __init_ibs_nmi(void) | |||
630 | return 0; | 630 | return 0; |
631 | } | 631 | } |
632 | 632 | ||
633 | /* initialize the APIC for the IBS interrupts if available */ | 633 | /* |
634 | * check and reserve APIC extended interrupt LVT offset for IBS if | ||
635 | * available | ||
636 | * | ||
637 | * init_ibs() preforms implicitly cpu-local operations, so pin this | ||
638 | * thread to its current CPU | ||
639 | */ | ||
640 | |||
634 | static void init_ibs(void) | 641 | static void init_ibs(void) |
635 | { | 642 | { |
636 | ibs_caps = get_ibs_caps(); | 643 | preempt_disable(); |
637 | 644 | ||
645 | ibs_caps = get_ibs_caps(); | ||
638 | if (!ibs_caps) | 646 | if (!ibs_caps) |
639 | return; | 647 | goto out; |
640 | 648 | ||
641 | if (__init_ibs_nmi()) { | 649 | if (__init_ibs_nmi() < 0) |
642 | ibs_caps = 0; | 650 | ibs_caps = 0; |
643 | return; | 651 | else |
644 | } | 652 | printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", ibs_caps); |
645 | 653 | ||
646 | printk(KERN_INFO "oprofile: AMD IBS detected (0x%08x)\n", | 654 | out: |
647 | (unsigned)ibs_caps); | 655 | preempt_enable(); |
648 | } | 656 | } |
649 | 657 | ||
650 | static int (*create_arch_files)(struct super_block *sb, struct dentry *root); | 658 | static int (*create_arch_files)(struct super_block *sb, struct dentry *root); |