aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kvm/arm.c
diff options
context:
space:
mode:
authorChristoph Lameter <cl@linux.com>2013-10-21 08:17:08 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-10-29 07:06:27 -0400
commit1436c1aa626d0bc0e35c5c5231127086e80ab24a (patch)
treedf8d5d0f892a502f3a5654745f539f3c6db4fe09 /arch/arm/kvm/arm.c
parent39792c7cf3111d69dc4aa0923859d8b929e9039f (diff)
ARM: 7862/1: pcpu: replace __get_cpu_var_uses
This is the ARM part of Christoph's patchset cleaning up the various uses of __get_cpu_var across the tree. The idea is to convert __get_cpu_var into either an explicit address calculation using this_cpu_ptr() or into a use of this_cpu operations that use the offset. Thereby address calculations are avoided and fewer registers are used when code is generated. [will: fixed debug ref counting checks and pcpu array accesses] Acked-by: Catalin Marinas <catalin.marinas@arm.com> Signed-off-by: Christoph Lameter <cl@linux.com> Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kvm/arm.c')
-rw-r--r--arch/arm/kvm/arm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 9c697db2787e..aea7ccb8d397 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -65,7 +65,7 @@ static bool vgic_present;
65static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu) 65static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu)
66{ 66{
67 BUG_ON(preemptible()); 67 BUG_ON(preemptible());
68 __get_cpu_var(kvm_arm_running_vcpu) = vcpu; 68 __this_cpu_write(kvm_arm_running_vcpu, vcpu);
69} 69}
70 70
71/** 71/**
@@ -75,7 +75,7 @@ static void kvm_arm_set_running_vcpu(struct kvm_vcpu *vcpu)
75struct kvm_vcpu *kvm_arm_get_running_vcpu(void) 75struct kvm_vcpu *kvm_arm_get_running_vcpu(void)
76{ 76{
77 BUG_ON(preemptible()); 77 BUG_ON(preemptible());
78 return __get_cpu_var(kvm_arm_running_vcpu); 78 return __this_cpu_read(kvm_arm_running_vcpu);
79} 79}
80 80
81/** 81/**
@@ -815,7 +815,7 @@ static void cpu_init_hyp_mode(void *dummy)
815 815
816 boot_pgd_ptr = kvm_mmu_get_boot_httbr(); 816 boot_pgd_ptr = kvm_mmu_get_boot_httbr();
817 pgd_ptr = kvm_mmu_get_httbr(); 817 pgd_ptr = kvm_mmu_get_httbr();
818 stack_page = __get_cpu_var(kvm_arm_hyp_stack_page); 818 stack_page = __this_cpu_read(kvm_arm_hyp_stack_page);
819 hyp_stack_ptr = stack_page + PAGE_SIZE; 819 hyp_stack_ptr = stack_page + PAGE_SIZE;
820 vector_ptr = (unsigned long)__kvm_hyp_vector; 820 vector_ptr = (unsigned long)__kvm_hyp_vector;
821 821