[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] [Qemu-devel] [PATCH -V2 1/4] target-ppc: Update slb array
From: |
Andreas Färber |
Subject: |
Re: [Qemu-ppc] [Qemu-devel] [PATCH -V2 1/4] target-ppc: Update slb array with correct index values. |
Date: |
Thu, 22 Aug 2013 19:58:58 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8 |
Am 20.08.2013 12:49, schrieb Aneesh Kumar K.V:
> From: "Aneesh Kumar K.V" <address@hidden>
>
> 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 <address@hidden>
> ---
> 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