diff options
| author | Paul Mundt <lethal@linux-sh.org> | 2011-01-12 00:37:42 -0500 |
|---|---|---|
| committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-12 00:37:42 -0500 |
| commit | 83eb95b852902f952ba594447a796ad8146b9462 (patch) | |
| tree | 33c199aeeae58b69ad8d6d2a33c2d96ba2b98ddf /arch/x86/kernel/cpu | |
| parent | efb3e34b6176d30c4fe8635fa8e1beb6280cc2cd (diff) | |
| parent | 9bbe7b984096ac45586da2adf26c14069ecb79b2 (diff) | |
Merge branch 'sh/sdio' into sh-latest
Diffstat (limited to 'arch/x86/kernel/cpu')
| -rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce-inject.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/perf_event.c | 3 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/perf_event_p4.c | 28 |
3 files changed, 19 insertions, 17 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c index e7dbde7bfedb..a77971979564 100644 --- a/arch/x86/kernel/cpu/mcheck/mce-inject.c +++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | #include <linux/gfp.h> | 25 | #include <linux/gfp.h> |
| 26 | #include <asm/mce.h> | 26 | #include <asm/mce.h> |
| 27 | #include <asm/apic.h> | 27 | #include <asm/apic.h> |
| 28 | #include <asm/nmi.h> | ||
| 28 | 29 | ||
| 29 | /* Update fake mce registers on current CPU. */ | 30 | /* Update fake mce registers on current CPU. */ |
| 30 | static void inject_mce(struct mce *m) | 31 | static void inject_mce(struct mce *m) |
| @@ -83,7 +84,7 @@ static int mce_raise_notify(struct notifier_block *self, | |||
| 83 | struct die_args *args = (struct die_args *)data; | 84 | struct die_args *args = (struct die_args *)data; |
| 84 | int cpu = smp_processor_id(); | 85 | int cpu = smp_processor_id(); |
| 85 | struct mce *m = &__get_cpu_var(injectm); | 86 | struct mce *m = &__get_cpu_var(injectm); |
| 86 | if (val != DIE_NMI_IPI || !cpumask_test_cpu(cpu, mce_inject_cpumask)) | 87 | if (val != DIE_NMI || !cpumask_test_cpu(cpu, mce_inject_cpumask)) |
| 87 | return NOTIFY_DONE; | 88 | return NOTIFY_DONE; |
| 88 | cpumask_clear_cpu(cpu, mce_inject_cpumask); | 89 | cpumask_clear_cpu(cpu, mce_inject_cpumask); |
| 89 | if (m->inject_flags & MCJ_EXCEPTION) | 90 | if (m->inject_flags & MCJ_EXCEPTION) |
| @@ -95,7 +96,7 @@ static int mce_raise_notify(struct notifier_block *self, | |||
| 95 | 96 | ||
| 96 | static struct notifier_block mce_raise_nb = { | 97 | static struct notifier_block mce_raise_nb = { |
| 97 | .notifier_call = mce_raise_notify, | 98 | .notifier_call = mce_raise_notify, |
| 98 | .priority = 1000, | 99 | .priority = NMI_LOCAL_NORMAL_PRIOR, |
| 99 | }; | 100 | }; |
| 100 | 101 | ||
| 101 | /* Inject mce on current CPU */ | 102 | /* Inject mce on current CPU */ |
diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c index 04921017abe0..9d977a2ea693 100644 --- a/arch/x86/kernel/cpu/perf_event.c +++ b/arch/x86/kernel/cpu/perf_event.c | |||
| @@ -1267,7 +1267,6 @@ perf_event_nmi_handler(struct notifier_block *self, | |||
| 1267 | 1267 | ||
| 1268 | switch (cmd) { | 1268 | switch (cmd) { |
| 1269 | case DIE_NMI: | 1269 | case DIE_NMI: |
| 1270 | case DIE_NMI_IPI: | ||
| 1271 | break; | 1270 | break; |
| 1272 | case DIE_NMIUNKNOWN: | 1271 | case DIE_NMIUNKNOWN: |
| 1273 | this_nmi = percpu_read(irq_stat.__nmi_count); | 1272 | this_nmi = percpu_read(irq_stat.__nmi_count); |
| @@ -1317,7 +1316,7 @@ perf_event_nmi_handler(struct notifier_block *self, | |||
| 1317 | static __read_mostly struct notifier_block perf_event_nmi_notifier = { | 1316 | static __read_mostly struct notifier_block perf_event_nmi_notifier = { |
| 1318 | .notifier_call = perf_event_nmi_handler, | 1317 | .notifier_call = perf_event_nmi_handler, |
| 1319 | .next = NULL, | 1318 | .next = NULL, |
| 1320 | .priority = 1 | 1319 | .priority = NMI_LOCAL_LOW_PRIOR, |
| 1321 | }; | 1320 | }; |
| 1322 | 1321 | ||
| 1323 | static struct event_constraint unconstrained; | 1322 | static struct event_constraint unconstrained; |
diff --git a/arch/x86/kernel/cpu/perf_event_p4.c b/arch/x86/kernel/cpu/perf_event_p4.c index 81400b93e694..e56b9bfbabd1 100644 --- a/arch/x86/kernel/cpu/perf_event_p4.c +++ b/arch/x86/kernel/cpu/perf_event_p4.c | |||
| @@ -753,19 +753,21 @@ out: | |||
| 753 | 753 | ||
| 754 | static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc) | 754 | static inline int p4_pmu_clear_cccr_ovf(struct hw_perf_event *hwc) |
| 755 | { | 755 | { |
| 756 | int overflow = 0; | 756 | u64 v; |
| 757 | u32 low, high; | ||
| 758 | 757 | ||
| 759 | rdmsr(hwc->config_base + hwc->idx, low, high); | 758 | /* an official way for overflow indication */ |
| 760 | 759 | rdmsrl(hwc->config_base + hwc->idx, v); | |
| 761 | /* we need to check high bit for unflagged overflows */ | 760 | if (v & P4_CCCR_OVF) { |
| 762 | if ((low & P4_CCCR_OVF) || !(high & (1 << 31))) { | 761 | wrmsrl(hwc->config_base + hwc->idx, v & ~P4_CCCR_OVF); |
| 763 | overflow = 1; | 762 | return 1; |
| 764 | (void)checking_wrmsrl(hwc->config_base + hwc->idx, | ||
| 765 | ((u64)low) & ~P4_CCCR_OVF); | ||
| 766 | } | 763 | } |
| 767 | 764 | ||
| 768 | return overflow; | 765 | /* it might be unflagged overflow */ |
| 766 | rdmsrl(hwc->event_base + hwc->idx, v); | ||
| 767 | if (!(v & ARCH_P4_CNTRVAL_MASK)) | ||
| 768 | return 1; | ||
| 769 | |||
| 770 | return 0; | ||
| 769 | } | 771 | } |
| 770 | 772 | ||
| 771 | static void p4_pmu_disable_pebs(void) | 773 | static void p4_pmu_disable_pebs(void) |
| @@ -1152,9 +1154,9 @@ static __initconst const struct x86_pmu p4_pmu = { | |||
| 1152 | */ | 1154 | */ |
| 1153 | .num_counters = ARCH_P4_MAX_CCCR, | 1155 | .num_counters = ARCH_P4_MAX_CCCR, |
| 1154 | .apic = 1, | 1156 | .apic = 1, |
| 1155 | .cntval_bits = 40, | 1157 | .cntval_bits = ARCH_P4_CNTRVAL_BITS, |
| 1156 | .cntval_mask = (1ULL << 40) - 1, | 1158 | .cntval_mask = ARCH_P4_CNTRVAL_MASK, |
| 1157 | .max_period = (1ULL << 39) - 1, | 1159 | .max_period = (1ULL << (ARCH_P4_CNTRVAL_BITS - 1)) - 1, |
| 1158 | .hw_config = p4_hw_config, | 1160 | .hw_config = p4_hw_config, |
| 1159 | .schedule_events = p4_pmu_schedule_events, | 1161 | .schedule_events = p4_pmu_schedule_events, |
| 1160 | /* | 1162 | /* |
