Received: from eggs.gnu.org ([208.118.235.92]:47154) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRQnj-0007XR-LO for qemu-devel@nongnu.org; Mon, 07 May 2012 12:28:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRQnh-0004X3-7w for qemu-devel@nongnu.org; Mon, 07 May 2012 12:28:42 -0400 Received: from cantor2.suse.de ([195.135.220.15]:34181 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRQng-0004WM-UH for qemu-devel@nongnu.org; Mon, 07 May 2012 12:28:41 -0400 Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=iso-8859-1 From: Alexander Graf In-Reply-To: <4FA7EE80.90801@adacore.com> Date: Mon, 7 May 2012 18:28:35 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <33FEFA18-85CE-4222-A7EB-50C77E379727@suse.de> References: <20110707234405.GC6748@schlenkerla.am.freescale.net> <4FA7EE80.90801@adacore.com> Subject: Re: [Qemu-devel] [PATCH 3/4] ppc: booke206: use MAV=2.0 TSIZE definition, fix 4G pages List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fabien Chouteau Cc: Scott Wood , qemu-devel@nongnu.org Hi Fabien, Could you please elaborate a bit on the case that broke for you with = these? The patches shouldn't change any guest facing behavior :o. Alex On 07.05.2012, at 17:47, Fabien Chouteau wrote: > Hi Scott, >=20 > I'm a little bit late, but this patch is not compatible with e500. >=20 > In fact all the modification breaks e500v2 MMU support. What kind PPC > core are you working on? >=20 > Regards, >=20 > On 07/08/2011 01:44 AM, Scott Wood wrote: >> This definition is backward compatible with MAV=3D1.0 as long as >> the guest does not set reserved bits in MAS1/MAS4. >>=20 >> Also, fix the shift in booke206_tlb_to_page_size -- it's the base >> that should be able to hold a 4G page size, not the shift count. >>=20 >> Signed-off-by: Scott Wood >> --- >> Unchanged in patchset v2 >>=20 >> hw/ppce500_mpc8544ds.c | 2 +- >> target-ppc/cpu.h | 4 ++-- >> target-ppc/helper.c | 5 +++-- >> 3 files changed, 6 insertions(+), 5 deletions(-) >>=20 >> diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c >> index 3626e26..1aed612 100644 >> --- a/hw/ppce500_mpc8544ds.c >> +++ b/hw/ppce500_mpc8544ds.c >> @@ -187,7 +187,7 @@ out: >> /* Create -kernel TLB entries for BookE, linearly spanning 256MB. */ >> static inline target_phys_addr_t booke206_page_size_to_tlb(uint64_t = size) >> { >> - return (ffs(size >> 10) - 1) >> 1; >> + return ffs(size >> 10) - 1; >> } >>=20 >> static void mmubooke_create_initial_mapping(CPUState *env, >> diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h >> index f8bf2b1..9cf8327 100644 >> --- a/target-ppc/cpu.h >> +++ b/target-ppc/cpu.h >> @@ -654,8 +654,8 @@ enum { >> #define MAS0_ATSEL_TLB 0 >> #define MAS0_ATSEL_LRAT MAS0_ATSEL >>=20 >> -#define MAS1_TSIZE_SHIFT 8 >> -#define MAS1_TSIZE_MASK (0xf << MAS1_TSIZE_SHIFT) >> +#define MAS1_TSIZE_SHIFT 7 >> +#define MAS1_TSIZE_MASK (0x1f << MAS1_TSIZE_SHIFT) >>=20 >> #define MAS1_TS_SHIFT 12 >> #define MAS1_TS (1 << MAS1_TS_SHIFT) >> diff --git a/target-ppc/helper.c b/target-ppc/helper.c >> index 176128a..892c6e3 100644 >> --- a/target-ppc/helper.c >> +++ b/target-ppc/helper.c >> @@ -1293,7 +1293,7 @@ target_phys_addr_t = booke206_tlb_to_page_size(CPUState *env, ppcmas_tlb_t *tlb) >> { >> uint32_t tlbncfg; >> int tlbn =3D booke206_tlbm_to_tlbn(env, tlb); >> - target_phys_addr_t tlbm_size; >> + int tlbm_size; >>=20 >> tlbncfg =3D env->spr[SPR_BOOKE_TLB0CFG + tlbn]; >>=20 >> @@ -1301,9 +1301,10 @@ target_phys_addr_t = booke206_tlb_to_page_size(CPUState *env, ppcmas_tlb_t *tlb) >> tlbm_size =3D (tlb->mas1 & MAS1_TSIZE_MASK) >> = MAS1_TSIZE_SHIFT; >> } else { >> tlbm_size =3D (tlbncfg & TLBnCFG_MINSIZE) >> = TLBnCFG_MINSIZE_SHIFT; >> + tlbm_size <<=3D 1; >> } >>=20 >> - return (1 << (tlbm_size << 1)) << 10; >> + return 1024ULL << tlbm_size; >> } >>=20 >> /* TLB check function for MAS based SoftTLBs */ >=20 >=20 > --=20 > Fabien Chouteau