aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/x86.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index d99976e4451e..d55a94f1155a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4664,15 +4664,15 @@ static DEFINE_PER_CPU(struct kvm_vcpu *, current_vcpu);
4664 4664
4665static int kvm_is_in_guest(void) 4665static int kvm_is_in_guest(void)
4666{ 4666{
4667 return percpu_read(current_vcpu) != NULL; 4667 return __this_cpu_read(current_vcpu) != NULL;
4668} 4668}
4669 4669
4670static int kvm_is_user_mode(void) 4670static int kvm_is_user_mode(void)
4671{ 4671{
4672 int user_mode = 3; 4672 int user_mode = 3;
4673 4673
4674 if (percpu_read(current_vcpu)) 4674 if (__this_cpu_read(current_vcpu))
4675 user_mode = kvm_x86_ops->get_cpl(percpu_read(current_vcpu)); 4675 user_mode = kvm_x86_ops->get_cpl(__this_cpu_read(current_vcpu));
4676 4676
4677 return user_mode != 0; 4677 return user_mode != 0;
4678} 4678}
@@ -4681,8 +4681,8 @@ static unsigned long kvm_get_guest_ip(void)
4681{ 4681{
4682 unsigned long ip = 0; 4682 unsigned long ip = 0;
4683 4683
4684 if (percpu_read(current_vcpu)) 4684 if (__this_cpu_read(current_vcpu))
4685 ip = kvm_rip_read(percpu_read(current_vcpu)); 4685 ip = kvm_rip_read(__this_cpu_read(current_vcpu));
4686 4686
4687 return ip; 4687 return ip;
4688} 4688}
@@ -4695,13 +4695,13 @@ static struct perf_guest_info_callbacks kvm_guest_cbs = {
4695 4695
4696void kvm_before_handle_nmi(struct kvm_vcpu *vcpu) 4696void kvm_before_handle_nmi(struct kvm_vcpu *vcpu)
4697{ 4697{
4698 percpu_write(current_vcpu, vcpu); 4698 __this_cpu_write(current_vcpu, vcpu);
4699} 4699}
4700EXPORT_SYMBOL_GPL(kvm_before_handle_nmi); 4700EXPORT_SYMBOL_GPL(kvm_before_handle_nmi);
4701 4701
4702void kvm_after_handle_nmi(struct kvm_vcpu *vcpu) 4702void kvm_after_handle_nmi(struct kvm_vcpu *vcpu)
4703{ 4703{
4704 percpu_write(current_vcpu, NULL); 4704 __this_cpu_write(current_vcpu, NULL);
4705} 4705}
4706EXPORT_SYMBOL_GPL(kvm_after_handle_nmi); 4706EXPORT_SYMBOL_GPL(kvm_after_handle_nmi);
4707 4707