From: "Andreas Färber" <afaerber@suse.de>
To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
Alexander Graf <agraf@suse.de>
Cc: Alexey Kardashevskiy <aik@ozlabs.ru>,
qemu-ppc@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH -V2 1/4] target-ppc: Update slb array with correct index values.
Date: Thu, 22 Aug 2013 19:58:58 +0200 [thread overview]
Message-ID: <52165162.5060607@suse.de> (raw)
In-Reply-To: <1376995766-16526-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com>
Am 20.08.2013 12:49, schrieb Aneesh Kumar K.V:
> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
>
> Without this, a value of rb=0 and rs=0 results in replacing the 0th
> index. This can be observed when using gdb remote debugging support.
>
> (gdb) x/10i do_fork
> 0xc000000000085330 <do_fork>: Cannot access memory at address 0xc000000000085330
> (gdb)
>
> This is because when we do the slb sync via kvm_cpu_synchronize_state,
> we overwrite the slb entry (0th entry) for 0xc000000000085330
>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
> ---
> target-ppc/kvm.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
> index 30a870e..a629447 100644
> --- a/target-ppc/kvm.c
> +++ b/target-ppc/kvm.c
> @@ -1034,8 +1034,18 @@ int kvm_arch_get_registers(CPUState *cs)
> /* Sync SLB */
> #ifdef TARGET_PPC64
> for (i = 0; i < 64; i++) {
> - ppc_store_slb(env, sregs.u.s.ppc64.slb[i].slbe,
> - sregs.u.s.ppc64.slb[i].slbv);
> + target_ulong rb = sregs.u.s.ppc64.slb[i].slbe;
> + /*
> + * KVM_GET_SREGS doesn't retun slb entry with slot information
Still has the "return" typo - maybe Alex can fix if he applies it.
Andreas
> + * same as index. So don't depend on the slot information in
> + * the returned value.
> + */
> + rb &= ~0xfff;
> + /*
> + * use the array index as the slot
> + */
> + rb |= i;
> + ppc_store_slb(env, rb, sregs.u.s.ppc64.slb[i].slbv);
> }
> #endif
>
>
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-08-22 17:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-20 10:49 [Qemu-devel] [PATCH -V2 0/4] target-ppc: Add support for dumping guest memory using qemu gdb server Aneesh Kumar K.V
2013-08-20 10:49 ` [Qemu-devel] [PATCH -V2 1/4] target-ppc: Update slb array with correct index values Aneesh Kumar K.V
2013-08-22 17:58 ` Andreas Färber [this message]
2013-08-22 22:26 ` Alexander Graf
2013-08-20 10:49 ` [Qemu-devel] [PATCH -V2 2/4] target-ppc: Use #define instead of opencoding SLB valid bit Aneesh Kumar K.V
2013-08-22 17:34 ` Alexander Graf
2013-08-20 10:49 ` [Qemu-devel] [PATCH -V2 3/4] target-ppc: Fix page table lookup with kvm enabled Aneesh Kumar K.V
2013-08-20 10:49 ` [Qemu-devel] [PATCH -V2 4/4] target-ppc: Check for error on address translation in memsave command Aneesh Kumar K.V
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52165162.5060607@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=aik@ozlabs.ru \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.