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/svm.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/svm.c')
-rw-r--r-- | arch/x86/kvm/svm.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 9596cc86d6dd..52f78dd03010 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -2177,9 +2177,10 @@ static int rdmsr_interception(struct vcpu_svm *svm) | |||
2177 | u32 ecx = svm->vcpu.arch.regs[VCPU_REGS_RCX]; | 2177 | u32 ecx = svm->vcpu.arch.regs[VCPU_REGS_RCX]; |
2178 | u64 data; | 2178 | u64 data; |
2179 | 2179 | ||
2180 | if (svm_get_msr(&svm->vcpu, ecx, &data)) | 2180 | if (svm_get_msr(&svm->vcpu, ecx, &data)) { |
2181 | trace_kvm_msr_read_ex(ecx); | ||
2181 | kvm_inject_gp(&svm->vcpu, 0); | 2182 | kvm_inject_gp(&svm->vcpu, 0); |
2182 | else { | 2183 | } else { |
2183 | trace_kvm_msr_read(ecx, data); | 2184 | trace_kvm_msr_read(ecx, data); |
2184 | 2185 | ||
2185 | svm->vcpu.arch.regs[VCPU_REGS_RAX] = data & 0xffffffff; | 2186 | svm->vcpu.arch.regs[VCPU_REGS_RAX] = data & 0xffffffff; |
@@ -2271,13 +2272,15 @@ static int wrmsr_interception(struct vcpu_svm *svm) | |||
2271 | u64 data = (svm->vcpu.arch.regs[VCPU_REGS_RAX] & -1u) | 2272 | u64 data = (svm->vcpu.arch.regs[VCPU_REGS_RAX] & -1u) |
2272 | | ((u64)(svm->vcpu.arch.regs[VCPU_REGS_RDX] & -1u) << 32); | 2273 | | ((u64)(svm->vcpu.arch.regs[VCPU_REGS_RDX] & -1u) << 32); |
2273 | 2274 | ||
2274 | trace_kvm_msr_write(ecx, data); | ||
2275 | 2275 | ||
2276 | svm->next_rip = kvm_rip_read(&svm->vcpu) + 2; | 2276 | svm->next_rip = kvm_rip_read(&svm->vcpu) + 2; |
2277 | if (svm_set_msr(&svm->vcpu, ecx, data)) | 2277 | if (svm_set_msr(&svm->vcpu, ecx, data)) { |
2278 | trace_kvm_msr_write_ex(ecx, data); | ||
2278 | kvm_inject_gp(&svm->vcpu, 0); | 2279 | kvm_inject_gp(&svm->vcpu, 0); |
2279 | else | 2280 | } else { |
2281 | trace_kvm_msr_write(ecx, data); | ||
2280 | skip_emulated_instruction(&svm->vcpu); | 2282 | skip_emulated_instruction(&svm->vcpu); |
2283 | } | ||
2281 | return 1; | 2284 | return 1; |
2282 | } | 2285 | } |
2283 | 2286 | ||