aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-04-23 06:49:06 -0400
committerAvi Kivity <avi@redhat.com>2010-05-17 05:19:15 -0400
commit8d3b9323095ae977406c7f4e73c9aa0f47682cc2 (patch)
tree43ebc414eb8401e8bde250242c9c5d2572e43e70 /arch/x86/kvm/x86.c
parentd14769377a247d4e7b570592a090474c8a059938 (diff)
parent6eca8cc35b50af1037bc919106dd6dd332c959c2 (diff)
Merge remote branch 'tip/perf/core'
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index cf37ac6644e0..848c814e8c3c 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -3965,16 +3965,20 @@ static int kvm_is_in_guest(void)
3965static int kvm_is_user_mode(void) 3965static int kvm_is_user_mode(void)
3966{ 3966{
3967 int user_mode = 3; 3967 int user_mode = 3;
3968
3968 if (percpu_read(current_vcpu)) 3969 if (percpu_read(current_vcpu))
3969 user_mode = kvm_x86_ops->get_cpl(percpu_read(current_vcpu)); 3970 user_mode = kvm_x86_ops->get_cpl(percpu_read(current_vcpu));
3971
3970 return user_mode != 0; 3972 return user_mode != 0;
3971} 3973}
3972 3974
3973static unsigned long kvm_get_guest_ip(void) 3975static unsigned long kvm_get_guest_ip(void)
3974{ 3976{
3975 unsigned long ip = 0; 3977 unsigned long ip = 0;
3978
3976 if (percpu_read(current_vcpu)) 3979 if (percpu_read(current_vcpu))
3977 ip = kvm_rip_read(percpu_read(current_vcpu)); 3980 ip = kvm_rip_read(percpu_read(current_vcpu));
3981
3978 return ip; 3982 return ip;
3979} 3983}
3980 3984