diff options
author | Avi Kivity <avi@redhat.com> | 2009-12-29 10:33:58 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:35:50 -0500 |
commit | a1f83a74feaa9718a5c61587256ea6cc1b993d16 (patch) | |
tree | 7771695e1ed29849cf1929c4149ab1818e17c3c8 /arch/x86 | |
parent | 4b5c9b7f9bdd76a3c860731db08bfc6758e96e29 (diff) |
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')
-rw-r--r-- | arch/x86/kvm/vmx.c | 5 |
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) | |||
2997 | vmx_fpu_deactivate(vcpu); | 2997 | vmx_fpu_deactivate(vcpu); |
2998 | vcpu->arch.cr0 &= ~X86_CR0_TS; | 2998 | vcpu->arch.cr0 &= ~X86_CR0_TS; |
2999 | vmcs_writel(CR0_READ_SHADOW, vcpu->arch.cr0); | 2999 | vmcs_writel(CR0_READ_SHADOW, vcpu->arch.cr0); |
3000 | trace_kvm_cr_write(0, vcpu->arch.cr0); | ||
3000 | vmx_fpu_activate(vcpu); | 3001 | vmx_fpu_activate(vcpu); |
3001 | skip_emulated_instruction(vcpu); | 3002 | skip_emulated_instruction(vcpu); |
3002 | return 1; | 3003 | return 1; |
@@ -3016,7 +3017,9 @@ static int handle_cr(struct kvm_vcpu *vcpu) | |||
3016 | } | 3017 | } |
3017 | break; | 3018 | break; |
3018 | case 3: /* lmsw */ | 3019 | case 3: /* lmsw */ |
3019 | kvm_lmsw(vcpu, (exit_qualification >> LMSW_SOURCE_DATA_SHIFT) & 0x0f); | 3020 | val = (exit_qualification >> LMSW_SOURCE_DATA_SHIFT) & 0x0f; |
3021 | trace_kvm_cr_write(0, (vcpu->arch.cr0 & ~0xful) | val); | ||
3022 | kvm_lmsw(vcpu, val); | ||
3020 | 3023 | ||
3021 | skip_emulated_instruction(vcpu); | 3024 | skip_emulated_instruction(vcpu); |
3022 | return 1; | 3025 | return 1; |