From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUKxm-0006ip-JQ for qemu-devel@nongnu.org; Tue, 15 May 2012 12:51:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUKxh-0005p3-MO for qemu-devel@nongnu.org; Tue, 15 May 2012 12:51:05 -0400 Received: from mel.act-europe.fr ([194.98.77.210]:32801) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUKxh-0005oj-Gk for qemu-devel@nongnu.org; Tue, 15 May 2012 12:51:01 -0400 Message-ID: <4FB28972.10800@adacore.com> Date: Tue, 15 May 2012 18:50:58 +0200 From: Fabien Chouteau MIME-Version: 1.0 References: <20110707234405.GC6748@schlenkerla.am.freescale.net> <4FA7EE80.90801@adacore.com> <33FEFA18-85CE-4222-A7EB-50C77E379727@suse.de> <4FAA4CD7.7090705@adacore.com> <4FB27612.3040705@freescale.com> In-Reply-To: <4FB27612.3040705@freescale.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: Scott Wood Cc: Alexander Graf , qemu-devel@nongnu.org On 05/15/2012 05:28 PM, Scott Wood wrote: > On 05/09/2012 05:54 AM, Fabien Chouteau wrote: >> On 05/07/2012 06:28 PM, Alexander Graf wrote: >>> 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. >>> >>> >> >> My bad, >> >> The problem comes from my initialization of tlb entries at board reset. >> I use MAS1_TSIZE_SHIFT: >> >> size = 0x1 << MAS1_TSIZE_SHIFT; /* 4 KBytes */ >> >> but since the definition as changed, the value is incorrect. It should >> be: >> >> size = 0x10 << MAS1_TSIZE_SHIFT; /* 4 KBytes */ > > You should be using booke206_bytes_to_tsize(), or perhaps create some > #defines for the various tsizes. > Do you mean booke206_page_size_to_tlb()? BTW, this function is defined locally twice and with different implementations. hw/ppce500_mpc8544ds.c:176:static inline target_phys_addr_t booke206_page_size_to_tlb(uint64_t size) hw/ppce500_mpc8544ds.c-177-{ hw/ppce500_mpc8544ds.c-178- return ffs(size >> 10) - 1; hw/ppce500_mpc8544ds.c-179-} -- hw/ppce500_spin.c:71:static inline target_phys_addr_t booke206_page_size_to_tlb(uint64_t size) hw/ppce500_spin.c-72-{ hw/ppce500_spin.c-73- return (ffs(size >> 10) - 1) >> 1; hw/ppce500_spin.c-74-} -- Fabien Chouteau