Messages in this thread | | | Date | Mon, 14 Apr 2014 09:20:08 -0700 | From | "H. Peter Anvin" <> | Subject | Re: [PATCH 2/2] x86, MCE: Cleanup macro __get_cpu_var |
| |
On 04/14/2014 01:39 AM, Chen, Gong wrote: > @@ -1287,14 +1287,14 @@ static unsigned long (*mce_adjust_timer)(unsigned long interval) = > > static int cmc_error_seen(void) > { > - unsigned long *v = &__get_cpu_var(mce_polled_error); > + unsigned long *v = this_cpu_ptr(&mce_polled_error); > > - return test_and_clear_bit(0, v); > + return this_cpu_xchg(*v, 0); > } >
Here you produce a pointer and *then* passing it through a this_cpu_ function... this is actively wrong.
It should simply be:
return this_cpu_xchg(mce_polled_error, 0);
-hpa
| |