summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/vmx.c
diff options
context:
space:
mode:
authorAvi Kivity2009-12-29 16:33:58 +0100
committerMarcelo Tosatti2010-03-01 16:35:50 +0100
commita1f83a74feaa9718a5c61587256ea6cc1b993d16 (patch)
tree7771695e1ed29849cf1929c4149ab1818e17c3c8 /arch/x86/kvm/vmx.c
parentKVM: PPC: Make large pages work (diff)
downloadkernel-qcow2-linux-a1f83a74feaa9718a5c61587256ea6cc1b993d16.tar.gz
kernel-qcow2-linux-a1f83a74feaa9718a5c61587256ea6cc1b993d16.tar.xz
kernel-qcow2-linux-a1f83a74feaa9718a5c61587256ea6cc1b993d16.zip
KVM: VMX: trace clts and lmsw instructions as cr accesses
clts writes cr0.ts; lmsw writes cr0[0:15] - record that in ftrace. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r--arch/x86/kvm/vmx.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 9b197b25b66d..7c7b2eeea5d0 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2997,6 +2997,7 @@ static int handle_cr(struct kvm_vcpu *vcpu)
vmx_fpu_deactivate(vcpu);
vcpu->arch.cr0 &= ~X86_CR0_TS;
vmcs_writel(CR0_READ_SHADOW, vcpu->arch.cr0);
+ trace_kvm_cr_write(0, vcpu->arch.cr0);
vmx_fpu_activate(vcpu);
skip_emulated_instruction(vcpu);
return 1;
@@ -3016,7 +3017,9 @@ static int handle_cr(struct kvm_vcpu *vcpu)
}
break;
case 3: /* lmsw */
- kvm_lmsw(vcpu, (exit_qualification >> LMSW_SOURCE_DATA_SHIFT) & 0x0f);
+ val = (exit_qualification >> LMSW_SOURCE_DATA_SHIFT) & 0x0f;
+ trace_kvm_cr_write(0, (vcpu->arch.cr0 & ~0xful) | val);
+ kvm_lmsw(vcpu, val);
skip_emulated_instruction(vcpu);
return 1;