aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2010-04-23 13:49:06 +0300
committerAvi Kivity <avi@redhat.com>2010-05-17 12:19:15 +0300
commit8d3b9323095ae977406c7f4e73c9aa0f47682cc2 (patch)
tree43ebc414eb8401e8bde250242c9c5d2572e43e70 /arch/x86/kvm
parentKVM: Remove test-before-set optimization for dirty bits (diff)
parentperf: Fix perf probe build error (diff)
downloadlinux-dev-8d3b9323095ae977406c7f4e73c9aa0f47682cc2.tar.xz
linux-dev-8d3b9323095ae977406c7f4e73c9aa0f47682cc2.zip
Merge remote branch 'tip/perf/core'
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-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)
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));
+
return user_mode != 0;
}
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));
+
return ip;
}