diff options
author | Eduardo Habkost | 2017-03-09 20:46:34 +0100 |
---|---|---|
committer | Paolo Bonzini | 2017-03-14 13:26:36 +0100 |
commit | c70b11d160c6bca8e994d40639fcb41558c9fa0a (patch) | |
tree | e1ad6f7645afe2fe25943335a31a7248b84f7111 /target | |
parent | exec: add cpu_synchronize_state to cpu_memory_rw_debug (diff) | |
download | qemu-c70b11d160c6bca8e994d40639fcb41558c9fa0a.tar.gz qemu-c70b11d160c6bca8e994d40639fcb41558c9fa0a.tar.xz qemu-c70b11d160c6bca8e994d40639fcb41558c9fa0a.zip |
kvm: Print MSR information if KVM_{GET,SET}_MSRS failed
When a KVM_{GET,SET}_MSRS ioctl() fails, it is difficult to find
out which MSR caused the problem. Print an error message for
debugging, before we trigger the (ret == cpu->kvm_msr_buf->nmsrs)
assert.
Suggested-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20170309194634.28457-1-ehabkost@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target')
-rw-r--r-- | target/i386/kvm.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 472399fb2c..55865dbee0 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -1824,6 +1824,12 @@ static int kvm_put_msrs(X86CPU *cpu, int level) return ret; } + if (ret < cpu->kvm_msr_buf->nmsrs) { + struct kvm_msr_entry *e = &cpu->kvm_msr_buf->entries[ret]; + error_report("error: failed to set MSR 0x%" PRIx32 " to 0x%" PRIx64, + (uint32_t)e->index, (uint64_t)e->data); + } + assert(ret == cpu->kvm_msr_buf->nmsrs); return 0; } @@ -2189,6 +2195,12 @@ static int kvm_get_msrs(X86CPU *cpu) return ret; } + if (ret < cpu->kvm_msr_buf->nmsrs) { + struct kvm_msr_entry *e = &cpu->kvm_msr_buf->entries[ret]; + error_report("error: failed to get MSR 0x%" PRIx32, + (uint32_t)e->index); + } + assert(ret == cpu->kvm_msr_buf->nmsrs); /* * MTRR masks: Each mask consists of 5 parts |