aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:48:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-10-15 01:48:18 -0400
commit0429fbc0bdc297d64188483ba029a23773ae07b0 (patch)
tree67de46978c90f37540dd6ded1db20eb53a569030 /arch/x86/kvm
parent6929c358972facf2999f8768815c40dd88514fc2 (diff)
parent513d1a2884a49654f368b5fa25ef186e976bdada (diff)
Merge branch 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
Pull percpu consistent-ops changes from Tejun Heo: "Way back, before the current percpu allocator was implemented, static and dynamic percpu memory areas were allocated and handled separately and had their own accessors. The distinction has been gone for many years now; however, the now duplicate two sets of accessors remained with the pointer based ones - this_cpu_*() - evolving various other operations over time. During the process, we also accumulated other inconsistent operations. This pull request contains Christoph's patches to clean up the duplicate accessor situation. __get_cpu_var() uses are replaced with with this_cpu_ptr() and __this_cpu_ptr() with raw_cpu_ptr(). Unfortunately, the former sometimes is tricky thanks to C being a bit messy with the distinction between lvalues and pointers, which led to a rather ugly solution for cpumask_var_t involving the introduction of this_cpu_cpumask_var_ptr(). This converts most of the uses but not all. Christoph will follow up with the remaining conversions in this merge window and hopefully remove the obsolete accessors" * 'for-3.18-consistent-ops' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (38 commits) irqchip: Properly fetch the per cpu offset percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t -fix ia64: sn_nodepda cannot be assigned to after this_cpu conversion. Use __this_cpu_write. percpu: Resolve ambiguities in __get_cpu_var/cpumask_var_t Revert "powerpc: Replace __get_cpu_var uses" percpu: Remove __this_cpu_ptr clocksource: Replace __this_cpu_ptr with raw_cpu_ptr sparc: Replace __get_cpu_var uses avr32: Replace __get_cpu_var with __this_cpu_write blackfin: Replace __get_cpu_var uses tile: Use this_cpu_ptr() for hardware counters tile: Replace __get_cpu_var uses powerpc: Replace __get_cpu_var uses alpha: Replace __get_cpu_var ia64: Replace __get_cpu_var uses s390: cio driver &__get_cpu_var replacements s390: Replace __get_cpu_var uses mips: Replace __get_cpu_var uses MIPS: Replace __get_cpu_var uses in FPU emulator. arm: Replace __this_cpu_ptr with raw_cpu_ptr ...
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/svm.c6
-rw-r--r--arch/x86/kvm/vmx.c10
-rw-r--r--arch/x86/kvm/x86.c2
3 files changed, 9 insertions, 9 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index f7f6a4a157a6..65510f624dfe 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -670,7 +670,7 @@ static int svm_hardware_enable(void)
670 670
671 if (static_cpu_has(X86_FEATURE_TSCRATEMSR)) { 671 if (static_cpu_has(X86_FEATURE_TSCRATEMSR)) {
672 wrmsrl(MSR_AMD64_TSC_RATIO, TSC_RATIO_DEFAULT); 672 wrmsrl(MSR_AMD64_TSC_RATIO, TSC_RATIO_DEFAULT);
673 __get_cpu_var(current_tsc_ratio) = TSC_RATIO_DEFAULT; 673 __this_cpu_write(current_tsc_ratio, TSC_RATIO_DEFAULT);
674 } 674 }
675 675
676 676
@@ -1313,8 +1313,8 @@ static void svm_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
1313 rdmsrl(host_save_user_msrs[i], svm->host_user_msrs[i]); 1313 rdmsrl(host_save_user_msrs[i], svm->host_user_msrs[i]);
1314 1314
1315 if (static_cpu_has(X86_FEATURE_TSCRATEMSR) && 1315 if (static_cpu_has(X86_FEATURE_TSCRATEMSR) &&
1316 svm->tsc_ratio != __get_cpu_var(current_tsc_ratio)) { 1316 svm->tsc_ratio != __this_cpu_read(current_tsc_ratio)) {
1317 __get_cpu_var(current_tsc_ratio) = svm->tsc_ratio; 1317 __this_cpu_write(current_tsc_ratio, svm->tsc_ratio);
1318 wrmsrl(MSR_AMD64_TSC_RATIO, svm->tsc_ratio); 1318 wrmsrl(MSR_AMD64_TSC_RATIO, svm->tsc_ratio);
1319 } 1319 }
1320} 1320}
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 04fa1b8298c8..d9dcfa27aa84 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -1626,7 +1626,7 @@ static void reload_tss(void)
1626 /* 1626 /*
1627 * VT restores TR but not its size. Useless. 1627 * VT restores TR but not its size. Useless.
1628 */ 1628 */
1629 struct desc_ptr *gdt = &__get_cpu_var(host_gdt); 1629 struct desc_ptr *gdt = this_cpu_ptr(&host_gdt);
1630 struct desc_struct *descs; 1630 struct desc_struct *descs;
1631 1631
1632 descs = (void *)gdt->address; 1632 descs = (void *)gdt->address;
@@ -1672,7 +1672,7 @@ static bool update_transition_efer(struct vcpu_vmx *vmx, int efer_offset)
1672 1672
1673static unsigned long segment_base(u16 selector) 1673static unsigned long segment_base(u16 selector)
1674{ 1674{
1675 struct desc_ptr *gdt = &__get_cpu_var(host_gdt); 1675 struct desc_ptr *gdt = this_cpu_ptr(&host_gdt);
1676 struct desc_struct *d; 1676 struct desc_struct *d;
1677 unsigned long table_base; 1677 unsigned long table_base;
1678 unsigned long v; 1678 unsigned long v;
@@ -1802,7 +1802,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
1802 */ 1802 */
1803 if (!user_has_fpu() && !vmx->vcpu.guest_fpu_loaded) 1803 if (!user_has_fpu() && !vmx->vcpu.guest_fpu_loaded)
1804 stts(); 1804 stts();
1805 load_gdt(&__get_cpu_var(host_gdt)); 1805 load_gdt(this_cpu_ptr(&host_gdt));
1806} 1806}
1807 1807
1808static void vmx_load_host_state(struct vcpu_vmx *vmx) 1808static void vmx_load_host_state(struct vcpu_vmx *vmx)
@@ -1832,7 +1832,7 @@ static void vmx_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
1832 } 1832 }
1833 1833
1834 if (vmx->loaded_vmcs->cpu != cpu) { 1834 if (vmx->loaded_vmcs->cpu != cpu) {
1835 struct desc_ptr *gdt = &__get_cpu_var(host_gdt); 1835 struct desc_ptr *gdt = this_cpu_ptr(&host_gdt);
1836 unsigned long sysenter_esp; 1836 unsigned long sysenter_esp;
1837 1837
1838 kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu); 1838 kvm_make_request(KVM_REQ_TLB_FLUSH, vcpu);
@@ -2771,7 +2771,7 @@ static int hardware_enable(void)
2771 ept_sync_global(); 2771 ept_sync_global();
2772 } 2772 }
2773 2773
2774 native_store_gdt(&__get_cpu_var(host_gdt)); 2774 native_store_gdt(this_cpu_ptr(&host_gdt));
2775 2775
2776 return 0; 2776 return 0;
2777} 2777}
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 5430e4b0af29..34c8f94331f8 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -1559,7 +1559,7 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)
1559 1559
1560 /* Keep irq disabled to prevent changes to the clock */ 1560 /* Keep irq disabled to prevent changes to the clock */
1561 local_irq_save(flags); 1561 local_irq_save(flags);
1562 this_tsc_khz = __get_cpu_var(cpu_tsc_khz); 1562 this_tsc_khz = __this_cpu_read(cpu_tsc_khz);
1563 if (unlikely(this_tsc_khz == 0)) { 1563 if (unlikely(this_tsc_khz == 0)) {
1564 local_irq_restore(flags); 1564 local_irq_restore(flags);
1565 kvm_make_request(KVM_REQ_CLOCK_UPDATE, v); 1565 kvm_make_request(KVM_REQ_CLOCK_UPDATE, v);