From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBOuv-0002Vu-OB for qemu-devel@nongnu.org; Mon, 19 Aug 2013 08:50:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBOuo-0001li-4d for qemu-devel@nongnu.org; Mon, 19 Aug 2013 08:50:41 -0400 Message-ID: <52121496.50500@suse.de> Date: Mon, 19 Aug 2013 14:50:30 +0200 From: =?ISO-8859-15?Q?Andreas_F=E4rber?= MIME-Version: 1.0 References: <1376915356-31011-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <1376915356-31011-2-git-send-email-aneesh.kumar@linux.vnet.ibm.com> <521212C6.3070704@suse.de> In-Reply-To: <521212C6.3070704@suse.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 1/3] target-ppc: Update slb array with correct index values. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Aneesh Kumar K.V" Cc: Alexey Kardashevskiy , qemu-ppc@nongnu.org, Alexander Graf , qemu-devel@nongnu.org Am 19.08.2013 14:42, schrieb Andreas F=E4rber: > Am 19.08.2013 14:29, schrieb Aneesh Kumar K.V: >> From: "Aneesh Kumar K.V" >> >> Without this, a value of rb=3D0 and rs=3D0, results in replacing the 0= th >=20 > "... rs=3D0 results in ..." >=20 >> index. This can be observed when using gdb remote debugging support. >> >> (gdb) x/10i do_fork >> 0xc000000000085330 : Cannot access memory at addres= s 0xc000000000085330 >> (gdb) >> >> This is because when we do the slb sync via kvm_cpu_synchronize_state, >> we overwrite the slb entry (0th entry) for 0xc00000000008533 >=20 > Is there a trailing 0 missing here? >=20 >> >> Signed-off-by: Aneesh Kumar K.V >> --- >> 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..5d4e613 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 =3D 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 =3D sregs.u.s.ppc64.slb[i].slbe; >=20 > Double space. >=20 >> + /* >> + * KVM_GET_SREGS doesn't retun slb entry with slot inform= ation "return" >> + * same as index. So don't depend on the slot information= in >> + * the returned value. >> + */ >> + rb &=3D ~0xfff; >> + /* >> + * use the array index as the slot >> + */ >> + rb |=3D i; >> + ppc_store_slb(env, rb, sregs.u.s.ppc64.slb[i].slbv); >> } >> #endif >> =20 >=20 > Regards, > Andreas >=20 --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=FCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=F6rffer; HRB 16746 AG N=FCrnbe= rg