From c70b11d160c6bca8e994d40639fcb41558c9fa0a Mon Sep 17 00:00:00 2001 From: Eduardo Habkost Date: Thu, 9 Mar 2017 16:46:34 -0300 Subject: 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 Signed-off-by: Eduardo Habkost Message-Id: <20170309194634.28457-1-ehabkost@redhat.com> Signed-off-by: Paolo Bonzini --- target/i386/kvm.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'target') 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 -- cgit v1.2.3 From c0d24e7f70816c8af51ebe9dc74aa276a81858dd Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Wed, 1 Mar 2017 11:28:04 +0100 Subject: target/nios2: take BQL around interrupt check The interrupt controller does not have its own locking. Signed-off-by: Paolo Bonzini --- target/nios2/op_helper.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'target') diff --git a/target/nios2/op_helper.c b/target/nios2/op_helper.c index 538853cda7..efb1c489c9 100644 --- a/target/nios2/op_helper.c +++ b/target/nios2/op_helper.c @@ -21,6 +21,7 @@ #include "cpu.h" #include "exec/helper-proto.h" #include "exec/cpu_ldst.h" +#include "qemu/main-loop.h" #if !defined(CONFIG_USER_ONLY) void helper_mmu_read_debug(CPUNios2State *env, uint32_t rn) @@ -35,7 +36,9 @@ void helper_mmu_write(CPUNios2State *env, uint32_t rn, uint32_t v) void helper_check_interrupts(CPUNios2State *env) { + qemu_mutex_lock_iothread(); nios2_check_interrupts(env); + qemu_mutex_unlock_iothread(); } #endif /* !CONFIG_USER_ONLY */ -- cgit v1.2.3 From d2528bdc19988db73056be75dd9bf52eeee620f5 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 3 Mar 2017 12:01:16 +0100 Subject: qemu-timer: do not include sysemu/cpus.h from util/qemu-timer.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This dependency is the wrong way, and we will need util/qemu-timer.h from sysemu/cpus.h in the next patch. Reviewed-by: Alex Bennée Reviewed-by: Edgar E. Iglesias Signed-off-by: Paolo Bonzini --- target/alpha/translate.c | 1 + 1 file changed, 1 insertion(+) (limited to 'target') diff --git a/target/alpha/translate.c b/target/alpha/translate.c index 055286a7b8..df5d695344 100644 --- a/target/alpha/translate.c +++ b/target/alpha/translate.c @@ -19,6 +19,7 @@ #include "qemu/osdep.h" #include "cpu.h" +#include "sysemu/cpus.h" #include "disas/disas.h" #include "qemu/host-utils.h" #include "exec/exec-all.h" -- cgit v1.2.3