From: Ingo Molnar Date: Mon, 13 Oct 2008 09:05:51 +0000 (+0200) Subject: Merge branch 'linus' into oprofile-v2 X-Git-Tag: v2.6.28-rc1~611^2^2 X-Git-Url: http://pilppa.org/gitweb/?a=commitdiff_plain;h=accba5f3965d6a9d1bf7c1e1a7995d17e9d521b6;p=linux-2.6-omap-h63xx.git Merge branch 'linus' into oprofile-v2 Conflicts: arch/x86/kernel/apic_32.c arch/x86/oprofile/nmi_int.c include/linux/pci_ids.h --- accba5f3965d6a9d1bf7c1e1a7995d17e9d521b6 diff --cc arch/x86/kernel/apic_32.c index 0059e7a8a9e,a91c57cb666..21c831d96af --- a/arch/x86/kernel/apic_32.c +++ b/arch/x86/kernel/apic_32.c @@@ -240,6 -290,36 +290,40 @@@ static void __setup_APIC_LVTT(unsigned apic_write(APIC_TMICT, clocks / APIC_DIVISOR); } + /* + * Setup extended LVT, AMD specific (K8, family 10h) + * + * Vector mappings are hard coded. On K8 only offset 0 (APIC500) and + * MCE interrupts are supported. Thus MCE offset must be set to 0. ++ * ++ * If mask=1, the LVT entry does not generate interrupts while mask=0 ++ * enables the vector. See also the BKDGs. + */ + + #define APIC_EILVT_LVTOFF_MCE 0 + #define APIC_EILVT_LVTOFF_IBS 1 + + static void setup_APIC_eilvt(u8 lvt_off, u8 vector, u8 msg_type, u8 mask) + { + unsigned long reg = (lvt_off << 4) + APIC_EILVT0; + unsigned int v = (mask << 16) | (msg_type << 8) | vector; + + apic_write(reg, v); + } + + u8 setup_APIC_eilvt_mce(u8 vector, u8 msg_type, u8 mask) + { + setup_APIC_eilvt(APIC_EILVT_LVTOFF_MCE, vector, msg_type, mask); + return APIC_EILVT_LVTOFF_MCE; + } + + u8 setup_APIC_eilvt_ibs(u8 vector, u8 msg_type, u8 mask) + { + setup_APIC_eilvt(APIC_EILVT_LVTOFF_IBS, vector, msg_type, mask); + return APIC_EILVT_LVTOFF_IBS; + } ++EXPORT_SYMBOL_GPL(setup_APIC_eilvt_ibs); + /* * Program the next event, relative to now */ diff --cc arch/x86/oprofile/nmi_int.c index 287513a0981,8a5f1614a3d..57f6c908808 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c @@@ -468,7 -490,11 +496,10 @@@ int __init op_nmi_init(struct oprofile_ return -ENODEV; } - init_sysfs(); + #ifdef CONFIG_SMP + register_cpu_notifier(&oprofile_cpu_nb); + #endif - using_nmi = 1; + /* default values, can be overwritten by model */ ops->create_files = nmi_create_files; ops->setup = nmi_setup; ops->shutdown = nmi_shutdown; @@@ -489,8 -507,10 +520,12 @@@ void op_nmi_exit(void) { - if (using_nmi) + if (using_nmi) { exit_sysfs(); + #ifdef CONFIG_SMP + unregister_cpu_notifier(&oprofile_cpu_nb); + #endif + } + if (model->exit) + model->exit(); }