From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaodm-00033w-O9 for qemu-devel@nongnu.org; Tue, 01 Mar 2016 13:03:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aaodh-0006J8-LM for qemu-devel@nongnu.org; Tue, 01 Mar 2016 13:03:22 -0500 Received: from e06smtp07.uk.ibm.com ([195.75.94.103]:59075) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aaodh-0006IF-CT for qemu-devel@nongnu.org; Tue, 01 Mar 2016 13:03:17 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Mar 2016 18:03:15 -0000 From: Greg Kurz Date: Tue, 01 Mar 2016 19:03:10 +0100 Message-ID: <20160301180310.13357.91023.stgit@bahia.huguette.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] target-ppc: fix sync of SPR_SDR1 with KVM List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf , qemu-devel@nongnu.org The gdbstub can't access guest memory with current master. This is what you get in gdb: 0x00000000100009b8 in main (argc=, argv=) at fp.c:11 Bisect leads to the following commit: commit fa48b4328c39b2532e47efcfcba6d4031512f514 Author: David Gibson Date: Tue Feb 9 09:30:21 2016 +1000 target-ppc: Remove hack for ppc_hash64_load_hpte*() with HV KVM Looking at the env->external_htab users, I've spotted a behaviour change in kvm_arch_get_registers(), which now always calls ppc_store_sdr1(). Checking kvmppc_kern_htab, like it is done in the MMU helpers, fixes the issue. Signed-off-by: Greg Kurz --- target-ppc/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index d67c169ba324..dbc37f25af2b 100644 --- a/target-ppc/kvm.c +++ b/target-ppc/kvm.c @@ -1190,7 +1190,7 @@ int kvm_arch_get_registers(CPUState *cs) return ret; } - if (!env->external_htab) { + if (!kvmppc_kern_htab && !env->external_htab) { ppc_store_sdr1(env, sregs.u.s.sdr1); }