提交 a1f83a74 编写于 作者: A Avi Kivity 提交者: Marcelo Tosatti

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: NAvi Kivity <avi@redhat.com>
上级 4b5c9b7f
...@@ -2997,6 +2997,7 @@ static int handle_cr(struct kvm_vcpu *vcpu) ...@@ -2997,6 +2997,7 @@ static int handle_cr(struct kvm_vcpu *vcpu)
vmx_fpu_deactivate(vcpu); vmx_fpu_deactivate(vcpu);
vcpu->arch.cr0 &= ~X86_CR0_TS; vcpu->arch.cr0 &= ~X86_CR0_TS;
vmcs_writel(CR0_READ_SHADOW, vcpu->arch.cr0); vmcs_writel(CR0_READ_SHADOW, vcpu->arch.cr0);
trace_kvm_cr_write(0, vcpu->arch.cr0);
vmx_fpu_activate(vcpu); vmx_fpu_activate(vcpu);
skip_emulated_instruction(vcpu); skip_emulated_instruction(vcpu);
return 1; return 1;
...@@ -3016,7 +3017,9 @@ static int handle_cr(struct kvm_vcpu *vcpu) ...@@ -3016,7 +3017,9 @@ static int handle_cr(struct kvm_vcpu *vcpu)
} }
break; break;
case 3: /* lmsw */ 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); skip_emulated_instruction(vcpu);
return 1; return 1;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册