diff options
Diffstat (limited to 'arch/x86/kernel/kvm.c')
-rw-r--r-- | arch/x86/kernel/kvm.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 95c3cb16af3e..f6945bef2cd1 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c | |||
@@ -244,9 +244,9 @@ u32 kvm_read_and_reset_pf_reason(void) | |||
244 | { | 244 | { |
245 | u32 reason = 0; | 245 | u32 reason = 0; |
246 | 246 | ||
247 | if (__get_cpu_var(apf_reason).enabled) { | 247 | if (__this_cpu_read(apf_reason.enabled)) { |
248 | reason = __get_cpu_var(apf_reason).reason; | 248 | reason = __this_cpu_read(apf_reason.reason); |
249 | __get_cpu_var(apf_reason).reason = 0; | 249 | __this_cpu_write(apf_reason.reason, 0); |
250 | } | 250 | } |
251 | 251 | ||
252 | return reason; | 252 | return reason; |
@@ -319,7 +319,7 @@ static void kvm_guest_apic_eoi_write(u32 reg, u32 val) | |||
319 | * there's no need for lock or memory barriers. | 319 | * there's no need for lock or memory barriers. |
320 | * An optimization barrier is implied in apic write. | 320 | * An optimization barrier is implied in apic write. |
321 | */ | 321 | */ |
322 | if (__test_and_clear_bit(KVM_PV_EOI_BIT, &__get_cpu_var(kvm_apic_eoi))) | 322 | if (__test_and_clear_bit(KVM_PV_EOI_BIT, this_cpu_ptr(&kvm_apic_eoi))) |
323 | return; | 323 | return; |
324 | apic_write(APIC_EOI, APIC_EOI_ACK); | 324 | apic_write(APIC_EOI, APIC_EOI_ACK); |
325 | } | 325 | } |
@@ -330,13 +330,13 @@ void kvm_guest_cpu_init(void) | |||
330 | return; | 330 | return; |
331 | 331 | ||
332 | if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) { | 332 | if (kvm_para_has_feature(KVM_FEATURE_ASYNC_PF) && kvmapf) { |
333 | u64 pa = slow_virt_to_phys(&__get_cpu_var(apf_reason)); | 333 | u64 pa = slow_virt_to_phys(this_cpu_ptr(&apf_reason)); |
334 | 334 | ||
335 | #ifdef CONFIG_PREEMPT | 335 | #ifdef CONFIG_PREEMPT |
336 | pa |= KVM_ASYNC_PF_SEND_ALWAYS; | 336 | pa |= KVM_ASYNC_PF_SEND_ALWAYS; |
337 | #endif | 337 | #endif |
338 | wrmsrl(MSR_KVM_ASYNC_PF_EN, pa | KVM_ASYNC_PF_ENABLED); | 338 | wrmsrl(MSR_KVM_ASYNC_PF_EN, pa | KVM_ASYNC_PF_ENABLED); |
339 | __get_cpu_var(apf_reason).enabled = 1; | 339 | __this_cpu_write(apf_reason.enabled, 1); |
340 | printk(KERN_INFO"KVM setup async PF for cpu %d\n", | 340 | printk(KERN_INFO"KVM setup async PF for cpu %d\n", |
341 | smp_processor_id()); | 341 | smp_processor_id()); |
342 | } | 342 | } |
@@ -345,8 +345,8 @@ void kvm_guest_cpu_init(void) | |||
345 | unsigned long pa; | 345 | unsigned long pa; |
346 | /* Size alignment is implied but just to make it explicit. */ | 346 | /* Size alignment is implied but just to make it explicit. */ |
347 | BUILD_BUG_ON(__alignof__(kvm_apic_eoi) < 4); | 347 | BUILD_BUG_ON(__alignof__(kvm_apic_eoi) < 4); |
348 | __get_cpu_var(kvm_apic_eoi) = 0; | 348 | __this_cpu_write(kvm_apic_eoi, 0); |
349 | pa = slow_virt_to_phys(&__get_cpu_var(kvm_apic_eoi)) | 349 | pa = slow_virt_to_phys(this_cpu_ptr(&kvm_apic_eoi)) |
350 | | KVM_MSR_ENABLED; | 350 | | KVM_MSR_ENABLED; |
351 | wrmsrl(MSR_KVM_PV_EOI_EN, pa); | 351 | wrmsrl(MSR_KVM_PV_EOI_EN, pa); |
352 | } | 352 | } |
@@ -357,11 +357,11 @@ void kvm_guest_cpu_init(void) | |||
357 | 357 | ||
358 | static void kvm_pv_disable_apf(void) | 358 | static void kvm_pv_disable_apf(void) |
359 | { | 359 | { |
360 | if (!__get_cpu_var(apf_reason).enabled) | 360 | if (!__this_cpu_read(apf_reason.enabled)) |
361 | return; | 361 | return; |
362 | 362 | ||
363 | wrmsrl(MSR_KVM_ASYNC_PF_EN, 0); | 363 | wrmsrl(MSR_KVM_ASYNC_PF_EN, 0); |
364 | __get_cpu_var(apf_reason).enabled = 0; | 364 | __this_cpu_write(apf_reason.enabled, 0); |
365 | 365 | ||
366 | printk(KERN_INFO"Unregister pv shared memory for cpu %d\n", | 366 | printk(KERN_INFO"Unregister pv shared memory for cpu %d\n", |
367 | smp_processor_id()); | 367 | smp_processor_id()); |
@@ -724,7 +724,7 @@ __visible void kvm_lock_spinning(struct arch_spinlock *lock, __ticket_t want) | |||
724 | if (in_nmi()) | 724 | if (in_nmi()) |
725 | return; | 725 | return; |
726 | 726 | ||
727 | w = &__get_cpu_var(klock_waiting); | 727 | w = this_cpu_ptr(&klock_waiting); |
728 | cpu = smp_processor_id(); | 728 | cpu = smp_processor_id(); |
729 | start = spin_time_start(); | 729 | start = spin_time_start(); |
730 | 730 | ||