Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282038
b: refs/heads/master
c: 086c985
h: refs/heads/master
v: v3
  • Loading branch information
Alex,Shi authored and Avi Kivity committed Dec 27, 2011
1 parent 1ea6ed1 commit a3192d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e37fa7853c276403da2fea8792c579e8bfd75042
refs/heads/master: 086c9855019935854311b477b33498a6ea357ef6
14 changes: 7 additions & 7 deletions trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -4664,15 +4664,15 @@ static DEFINE_PER_CPU(struct kvm_vcpu *, current_vcpu);

static int kvm_is_in_guest(void)
{
return percpu_read(current_vcpu) != NULL;
return __this_cpu_read(current_vcpu) != NULL;
}

static int kvm_is_user_mode(void)
{
int user_mode = 3;

if (percpu_read(current_vcpu))
user_mode = kvm_x86_ops->get_cpl(percpu_read(current_vcpu));
if (__this_cpu_read(current_vcpu))
user_mode = kvm_x86_ops->get_cpl(__this_cpu_read(current_vcpu));

return user_mode != 0;
}
Expand All @@ -4681,8 +4681,8 @@ static unsigned long kvm_get_guest_ip(void)
{
unsigned long ip = 0;

if (percpu_read(current_vcpu))
ip = kvm_rip_read(percpu_read(current_vcpu));
if (__this_cpu_read(current_vcpu))
ip = kvm_rip_read(__this_cpu_read(current_vcpu));

return ip;
}
Expand All @@ -4695,13 +4695,13 @@ static struct perf_guest_info_callbacks kvm_guest_cbs = {

void kvm_before_handle_nmi(struct kvm_vcpu *vcpu)
{
percpu_write(current_vcpu, vcpu);
__this_cpu_write(current_vcpu, vcpu);
}
EXPORT_SYMBOL_GPL(kvm_before_handle_nmi);

void kvm_after_handle_nmi(struct kvm_vcpu *vcpu)
{
percpu_write(current_vcpu, NULL);
__this_cpu_write(current_vcpu, NULL);
}
EXPORT_SYMBOL_GPL(kvm_after_handle_nmi);

Expand Down

0 comments on commit a3192d1

Please sign in to comment.