* [Qemu-devel] [PATCH] target-ppc: fix sync of SPR_SDR1 with KVM
@ 2016-03-01 18:03 Greg Kurz
2016-03-02 0:06 ` David Gibson
0 siblings, 1 reply; 5+ messages in thread
From: Greg Kurz @ 2016-03-01 18:03 UTC (permalink / raw)
To: David Gibson; +Cc: Alexey Kardashevskiy, qemu-ppc, Alexander Graf, qemu-devel
The gdbstub can't access guest memory with current master. This is what you
get in gdb:
0x00000000100009b8 in main (argc=<error reading variable: Cannot access memory
at address 0x3fffce4d3620>, argv=<error reading variable: Cannot access memory
at address 0x3fffce4d3628>) at fp.c:11
Bisect leads to the following commit:
commit fa48b4328c39b2532e47efcfcba6d4031512f514
Author: David Gibson <david@gibson.dropbear.id.au>
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 <gkurz@linux.vnet.ibm.com>
---
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);
}
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [Qemu-devel] [PATCH] target-ppc: fix sync of SPR_SDR1 with KVM 2016-03-01 18:03 [Qemu-devel] [PATCH] target-ppc: fix sync of SPR_SDR1 with KVM Greg Kurz @ 2016-03-02 0:06 ` David Gibson 2016-03-03 4:35 ` [Qemu-devel] [Qemu-ppc] " David Gibson 0 siblings, 1 reply; 5+ messages in thread From: David Gibson @ 2016-03-02 0:06 UTC (permalink / raw) To: Greg Kurz; +Cc: Alexey Kardashevskiy, qemu-ppc, Alexander Graf, qemu-devel [-- Attachment #1: Type: text/plain, Size: 1722 bytes --] On Tue, Mar 01, 2016 at 07:03:10PM +0100, Greg Kurz wrote: > The gdbstub can't access guest memory with current master. This is what you > get in gdb: > > 0x00000000100009b8 in main (argc=<error reading variable: Cannot access memory > at address 0x3fffce4d3620>, argv=<error reading variable: Cannot access memory > at address 0x3fffce4d3628>) at fp.c:11 > > Bisect leads to the following commit: > > commit fa48b4328c39b2532e47efcfcba6d4031512f514 > Author: David Gibson <david@gibson.dropbear.id.au> > 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 <gkurz@linux.vnet.ibm.com> Mea culpa. Good catch, applied to ppc-for-2.6, thanks. > --- > 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); > } > > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] target-ppc: fix sync of SPR_SDR1 with KVM 2016-03-02 0:06 ` David Gibson @ 2016-03-03 4:35 ` David Gibson 2016-03-03 23:45 ` Greg Kurz 0 siblings, 1 reply; 5+ messages in thread From: David Gibson @ 2016-03-03 4:35 UTC (permalink / raw) To: Greg Kurz; +Cc: qemu-ppc, qemu-devel [-- Attachment #1: Type: text/plain, Size: 1967 bytes --] On Wed, Mar 02, 2016 at 11:06:19AM +1100, David Gibson wrote: > On Tue, Mar 01, 2016 at 07:03:10PM +0100, Greg Kurz wrote: > > The gdbstub can't access guest memory with current master. This is what you > > get in gdb: > > > > 0x00000000100009b8 in main (argc=<error reading variable: Cannot access memory > > at address 0x3fffce4d3620>, argv=<error reading variable: Cannot access memory > > at address 0x3fffce4d3628>) at fp.c:11 > > > > Bisect leads to the following commit: > > > > commit fa48b4328c39b2532e47efcfcba6d4031512f514 > > Author: David Gibson <david@gibson.dropbear.id.au> > > 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 <gkurz@linux.vnet.ibm.com> > > Mea culpa. Good catch, applied to ppc-for-2.6, thanks. Ah.. wait.. this patch breaks compile for the ppc32 target. Can you fix this please. > > --- > > 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); > > } > > > > > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] target-ppc: fix sync of SPR_SDR1 with KVM 2016-03-03 4:35 ` [Qemu-devel] [Qemu-ppc] " David Gibson @ 2016-03-03 23:45 ` Greg Kurz 2016-03-04 2:39 ` David Gibson 0 siblings, 1 reply; 5+ messages in thread From: Greg Kurz @ 2016-03-03 23:45 UTC (permalink / raw) To: David Gibson; +Cc: qemu-ppc, qemu-devel On Thu, 3 Mar 2016 15:35:07 +1100 David Gibson <david@gibson.dropbear.id.au> wrote: > On Wed, Mar 02, 2016 at 11:06:19AM +1100, David Gibson wrote: > > On Tue, Mar 01, 2016 at 07:03:10PM +0100, Greg Kurz wrote: > > > The gdbstub can't access guest memory with current master. This is what you > > > get in gdb: > > > > > > 0x00000000100009b8 in main (argc=<error reading variable: Cannot access memory > > > at address 0x3fffce4d3620>, argv=<error reading variable: Cannot access memory > > > at address 0x3fffce4d3628>) at fp.c:11 > > > > > > Bisect leads to the following commit: > > > > > > commit fa48b4328c39b2532e47efcfcba6d4031512f514 > > > Author: David Gibson <david@gibson.dropbear.id.au> > > > 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 <gkurz@linux.vnet.ibm.com> > > > > Mea culpa. Good catch, applied to ppc-for-2.6, thanks. > > Ah.. wait.. this patch breaks compile for the ppc32 target. Can you > fix this please. > Oops... I'm on vacation this week. Not sure I can find time before next monday... :\ > > > --- > > > 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); > > > } > > > > > > > > > > > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Qemu-devel] [Qemu-ppc] [PATCH] target-ppc: fix sync of SPR_SDR1 with KVM 2016-03-03 23:45 ` Greg Kurz @ 2016-03-04 2:39 ` David Gibson 0 siblings, 0 replies; 5+ messages in thread From: David Gibson @ 2016-03-04 2:39 UTC (permalink / raw) To: Greg Kurz; +Cc: qemu-ppc, qemu-devel [-- Attachment #1: Type: text/plain, Size: 2635 bytes --] On Fri, Mar 04, 2016 at 12:45:29AM +0100, Greg Kurz wrote: > On Thu, 3 Mar 2016 15:35:07 +1100 > David Gibson <david@gibson.dropbear.id.au> wrote: > > > On Wed, Mar 02, 2016 at 11:06:19AM +1100, David Gibson wrote: > > > On Tue, Mar 01, 2016 at 07:03:10PM +0100, Greg Kurz wrote: > > > > The gdbstub can't access guest memory with current master. This is what you > > > > get in gdb: > > > > > > > > 0x00000000100009b8 in main (argc=<error reading variable: Cannot access memory > > > > at address 0x3fffce4d3620>, argv=<error reading variable: Cannot access memory > > > > at address 0x3fffce4d3628>) at fp.c:11 > > > > > > > > Bisect leads to the following commit: > > > > > > > > commit fa48b4328c39b2532e47efcfcba6d4031512f514 > > > > Author: David Gibson <david@gibson.dropbear.id.au> > > > > 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 <gkurz@linux.vnet.ibm.com> > > > > > > Mea culpa. Good catch, applied to ppc-for-2.6, thanks. > > > > Ah.. wait.. this patch breaks compile for the ppc32 target. Can you > > fix this please. > > > > Oops... I'm on vacation this week. Not sure I can find time before > next monday... :\ Ok. I've had a closer look and realized that the earlier commit (fa48b43) was basically a bad idea. I'll shortly post something to accomplish its aims in a different and better way. > > > > > --- > > > > 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); > > > > } > > > > > > > > > > > > > > > > > > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 819 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-03-04 2:40 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2016-03-01 18:03 [Qemu-devel] [PATCH] target-ppc: fix sync of SPR_SDR1 with KVM Greg Kurz 2016-03-02 0:06 ` David Gibson 2016-03-03 4:35 ` [Qemu-devel] [Qemu-ppc] " David Gibson 2016-03-03 23:45 ` Greg Kurz 2016-03-04 2:39 ` David Gibson
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.