]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
KVM: VMX: trace clts and lmsw instructions as cr accesses
authorAvi Kivity <avi@redhat.com>
Tue, 29 Dec 2009 15:33:58 +0000 (17:33 +0200)
committerMarcelo Tosatti <mtosatti@redhat.com>
Mon, 1 Mar 2010 15:35:50 +0000 (12:35 -0300)
clts writes cr0.ts; lmsw writes cr0[0:15] - record that in ftrace.

Signed-off-by: Avi Kivity <avi@redhat.com>
arch/x86/kvm/vmx.c

index 9b197b25b66da5456dbad73cafe1614348baf15e..7c7b2eeea5d06c1fcc9e3737d51bff6f8774edca 100644 (file)
@@ -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;