diff options
author | Avi Kivity <avi@redhat.com> | 2010-01-25 12:47:02 -0500 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-03-01 10:36:06 -0500 |
commit | 59200273c4d07ddf99dd3c8d91b90bb170457fc3 (patch) | |
tree | bd0ecc72152d19f272248c8186b2f412df56bcf2 /arch/x86/kvm/vmx.c | |
parent | 6e7d15296773f7a479072ec7f3248f51d01e1fad (diff) |
KVM: Trace failed msr reads and writes
Record failed msrs reads and writes, and the fact that they failed as well.
Signed-off-by: Avi Kivity <avi@redhat.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/vmx.c')
-rw-r--r-- | arch/x86/kvm/vmx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 7a56879a058c..334b016267a9 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -3158,6 +3158,7 @@ static int handle_rdmsr(struct kvm_vcpu *vcpu) | |||
3158 | u64 data; | 3158 | u64 data; |
3159 | 3159 | ||
3160 | if (vmx_get_msr(vcpu, ecx, &data)) { | 3160 | if (vmx_get_msr(vcpu, ecx, &data)) { |
3161 | trace_kvm_msr_read_ex(ecx); | ||
3161 | kvm_inject_gp(vcpu, 0); | 3162 | kvm_inject_gp(vcpu, 0); |
3162 | return 1; | 3163 | return 1; |
3163 | } | 3164 | } |
@@ -3177,13 +3178,13 @@ static int handle_wrmsr(struct kvm_vcpu *vcpu) | |||
3177 | u64 data = (vcpu->arch.regs[VCPU_REGS_RAX] & -1u) | 3178 | u64 data = (vcpu->arch.regs[VCPU_REGS_RAX] & -1u) |
3178 | | ((u64)(vcpu->arch.regs[VCPU_REGS_RDX] & -1u) << 32); | 3179 | | ((u64)(vcpu->arch.regs[VCPU_REGS_RDX] & -1u) << 32); |
3179 | 3180 | ||
3180 | trace_kvm_msr_write(ecx, data); | ||
3181 | |||
3182 | if (vmx_set_msr(vcpu, ecx, data) != 0) { | 3181 | if (vmx_set_msr(vcpu, ecx, data) != 0) { |
3182 | trace_kvm_msr_write_ex(ecx, data); | ||
3183 | kvm_inject_gp(vcpu, 0); | 3183 | kvm_inject_gp(vcpu, 0); |
3184 | return 1; | 3184 | return 1; |
3185 | } | 3185 | } |
3186 | 3186 | ||
3187 | trace_kvm_msr_write(ecx, data); | ||
3187 | skip_emulated_instruction(vcpu); | 3188 | skip_emulated_instruction(vcpu); |
3188 | return 1; | 3189 | return 1; |
3189 | } | 3190 | } |