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