|
@@ -400,7 +400,7 @@ static u64 mce_rdmsrl(u32 msr)
|
|
|
|
|
|
if (offset < 0)
|
|
|
return 0;
|
|
|
- return *(u64 *)((char *)&__get_cpu_var(injectm) + offset);
|
|
|
+ return *(u64 *)((char *)this_cpu_ptr(&injectm) + offset);
|
|
|
}
|
|
|
|
|
|
if (rdmsrl_safe(msr, &v)) {
|
|
@@ -422,7 +422,7 @@ static void mce_wrmsrl(u32 msr, u64 v)
|
|
|
int offset = msr_to_offset(msr);
|
|
|
|
|
|
if (offset >= 0)
|
|
|
- *(u64 *)((char *)&__get_cpu_var(injectm) + offset) = v;
|
|
|
+ *(u64 *)((char *)this_cpu_ptr(&injectm) + offset) = v;
|
|
|
return;
|
|
|
}
|
|
|
wrmsrl(msr, v);
|
|
@@ -478,7 +478,7 @@ static DEFINE_PER_CPU(struct mce_ring, mce_ring);
|
|
|
/* Runs with CPU affinity in workqueue */
|
|
|
static int mce_ring_empty(void)
|
|
|
{
|
|
|
- struct mce_ring *r = &__get_cpu_var(mce_ring);
|
|
|
+ struct mce_ring *r = this_cpu_ptr(&mce_ring);
|
|
|
|
|
|
return r->start == r->end;
|
|
|
}
|
|
@@ -490,7 +490,7 @@ static int mce_ring_get(unsigned long *pfn)
|
|
|
|
|
|
*pfn = 0;
|
|
|
get_cpu();
|
|
|
- r = &__get_cpu_var(mce_ring);
|
|
|
+ r = this_cpu_ptr(&mce_ring);
|
|
|
if (r->start == r->end)
|
|
|
goto out;
|
|
|
*pfn = r->ring[r->start];
|
|
@@ -504,7 +504,7 @@ out:
|
|
|
/* Always runs in MCE context with preempt off */
|
|
|
static int mce_ring_add(unsigned long pfn)
|
|
|
{
|
|
|
- struct mce_ring *r = &__get_cpu_var(mce_ring);
|
|
|
+ struct mce_ring *r = this_cpu_ptr(&mce_ring);
|
|
|
unsigned next;
|
|
|
|
|
|
next = (r->end + 1) % MCE_RING_SIZE;
|
|
@@ -526,7 +526,7 @@ int mce_available(struct cpuinfo_x86 *c)
|
|
|
static void mce_schedule_work(void)
|
|
|
{
|
|
|
if (!mce_ring_empty())
|
|
|
- schedule_work(&__get_cpu_var(mce_work));
|
|
|
+ schedule_work(this_cpu_ptr(&mce_work));
|
|
|
}
|
|
|
|
|
|
DEFINE_PER_CPU(struct irq_work, mce_irq_work);
|
|
@@ -551,7 +551,7 @@ static void mce_report_event(struct pt_regs *regs)
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- irq_work_queue(&__get_cpu_var(mce_irq_work));
|
|
|
+ irq_work_queue(this_cpu_ptr(&mce_irq_work));
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -1045,7 +1045,7 @@ void do_machine_check(struct pt_regs *regs, long error_code)
|
|
|
|
|
|
mce_gather_info(&m, regs);
|
|
|
|
|
|
- final = &__get_cpu_var(mces_seen);
|
|
|
+ final = this_cpu_ptr(&mces_seen);
|
|
|
*final = m;
|
|
|
|
|
|
memset(valid_banks, 0, sizeof(valid_banks));
|
|
@@ -1278,22 +1278,22 @@ 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);
|
|
|
}
|
|
|
|
|
|
static void mce_timer_fn(unsigned long data)
|
|
|
{
|
|
|
- struct timer_list *t = &__get_cpu_var(mce_timer);
|
|
|
+ struct timer_list *t = this_cpu_ptr(&mce_timer);
|
|
|
unsigned long iv;
|
|
|
int notify;
|
|
|
|
|
|
WARN_ON(smp_processor_id() != data);
|
|
|
|
|
|
- if (mce_available(__this_cpu_ptr(&cpu_info))) {
|
|
|
+ if (mce_available(this_cpu_ptr(&cpu_info))) {
|
|
|
machine_check_poll(MCP_TIMESTAMP,
|
|
|
- &__get_cpu_var(mce_poll_banks));
|
|
|
+ this_cpu_ptr(&mce_poll_banks));
|
|
|
mce_intel_cmci_poll();
|
|
|
}
|
|
|
|
|
@@ -1323,7 +1323,7 @@ static void mce_timer_fn(unsigned long data)
|
|
|
*/
|
|
|
void mce_timer_kick(unsigned long interval)
|
|
|
{
|
|
|
- struct timer_list *t = &__get_cpu_var(mce_timer);
|
|
|
+ struct timer_list *t = this_cpu_ptr(&mce_timer);
|
|
|
unsigned long when = jiffies + interval;
|
|
|
unsigned long iv = __this_cpu_read(mce_next_interval);
|
|
|
|
|
@@ -1659,7 +1659,7 @@ static void mce_start_timer(unsigned int cpu, struct timer_list *t)
|
|
|
|
|
|
static void __mcheck_cpu_init_timer(void)
|
|
|
{
|
|
|
- struct timer_list *t = &__get_cpu_var(mce_timer);
|
|
|
+ struct timer_list *t = this_cpu_ptr(&mce_timer);
|
|
|
unsigned int cpu = smp_processor_id();
|
|
|
|
|
|
setup_timer(t, mce_timer_fn, cpu);
|
|
@@ -1702,8 +1702,8 @@ void mcheck_cpu_init(struct cpuinfo_x86 *c)
|
|
|
__mcheck_cpu_init_generic();
|
|
|
__mcheck_cpu_init_vendor(c);
|
|
|
__mcheck_cpu_init_timer();
|
|
|
- INIT_WORK(&__get_cpu_var(mce_work), mce_process_work);
|
|
|
- init_irq_work(&__get_cpu_var(mce_irq_work), &mce_irq_work_cb);
|
|
|
+ INIT_WORK(this_cpu_ptr(&mce_work), mce_process_work);
|
|
|
+ init_irq_work(this_cpu_ptr(&mce_irq_work), &mce_irq_work_cb);
|
|
|
}
|
|
|
|
|
|
/*
|
|
@@ -1955,7 +1955,7 @@ static struct miscdevice mce_chrdev_device = {
|
|
|
static void __mce_disable_bank(void *arg)
|
|
|
{
|
|
|
int bank = *((int *)arg);
|
|
|
- __clear_bit(bank, __get_cpu_var(mce_poll_banks));
|
|
|
+ __clear_bit(bank, this_cpu_ptr(mce_poll_banks));
|
|
|
cmci_disable_bank(bank);
|
|
|
}
|
|
|
|
|
@@ -2065,7 +2065,7 @@ static void mce_syscore_shutdown(void)
|
|
|
static void mce_syscore_resume(void)
|
|
|
{
|
|
|
__mcheck_cpu_init_generic();
|
|
|
- __mcheck_cpu_init_vendor(__this_cpu_ptr(&cpu_info));
|
|
|
+ __mcheck_cpu_init_vendor(raw_cpu_ptr(&cpu_info));
|
|
|
}
|
|
|
|
|
|
static struct syscore_ops mce_syscore_ops = {
|
|
@@ -2080,7 +2080,7 @@ static struct syscore_ops mce_syscore_ops = {
|
|
|
|
|
|
static void mce_cpu_restart(void *data)
|
|
|
{
|
|
|
- if (!mce_available(__this_cpu_ptr(&cpu_info)))
|
|
|
+ if (!mce_available(raw_cpu_ptr(&cpu_info)))
|
|
|
return;
|
|
|
__mcheck_cpu_init_generic();
|
|
|
__mcheck_cpu_init_timer();
|
|
@@ -2096,14 +2096,14 @@ static void mce_restart(void)
|
|
|
/* Toggle features for corrected errors */
|
|
|
static void mce_disable_cmci(void *data)
|
|
|
{
|
|
|
- if (!mce_available(__this_cpu_ptr(&cpu_info)))
|
|
|
+ if (!mce_available(raw_cpu_ptr(&cpu_info)))
|
|
|
return;
|
|
|
cmci_clear();
|
|
|
}
|
|
|
|
|
|
static void mce_enable_ce(void *all)
|
|
|
{
|
|
|
- if (!mce_available(__this_cpu_ptr(&cpu_info)))
|
|
|
+ if (!mce_available(raw_cpu_ptr(&cpu_info)))
|
|
|
return;
|
|
|
cmci_reenable();
|
|
|
cmci_recheck();
|
|
@@ -2336,7 +2336,7 @@ static void mce_disable_cpu(void *h)
|
|
|
unsigned long action = *(unsigned long *)h;
|
|
|
int i;
|
|
|
|
|
|
- if (!mce_available(__this_cpu_ptr(&cpu_info)))
|
|
|
+ if (!mce_available(raw_cpu_ptr(&cpu_info)))
|
|
|
return;
|
|
|
|
|
|
if (!(action & CPU_TASKS_FROZEN))
|
|
@@ -2354,7 +2354,7 @@ static void mce_reenable_cpu(void *h)
|
|
|
unsigned long action = *(unsigned long *)h;
|
|
|
int i;
|
|
|
|
|
|
- if (!mce_available(__this_cpu_ptr(&cpu_info)))
|
|
|
+ if (!mce_available(raw_cpu_ptr(&cpu_info)))
|
|
|
return;
|
|
|
|
|
|
if (!(action & CPU_TASKS_FROZEN))
|