From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:36655) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm4Fv-0004z8-M8 for qemu-devel@nongnu.org; Wed, 27 Jul 2011 09:34:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qm4Ft-00064P-Tq for qemu-devel@nongnu.org; Wed, 27 Jul 2011 09:34:35 -0400 Received: from cantor2.suse.de ([195.135.220.15]:52316 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qm4Ft-00063u-K6 for qemu-devel@nongnu.org; Wed, 27 Jul 2011 09:34:33 -0400 Message-ID: <4E3013E7.7000507@suse.de> Date: Wed, 27 Jul 2011 15:34:31 +0200 From: Alexander Graf MIME-Version: 1.0 References: <1311418212-13356-1-git-send-email-agraf@suse.de> <1311418212-13356-22-git-send-email-agraf@suse.de> <20110725154050.11f07665@schlenkerla.am.freescale.net> In-Reply-To: <20110725154050.11f07665@schlenkerla.am.freescale.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 21/28] PPC: E500: Add PV spinning code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Scott Wood Cc: Elie Richa , QEMU-devel Developers On 07/25/2011 10:40 PM, Scott Wood wrote: > On Sat, 23 Jul 2011 12:50:05 +0200 > Alexander Graf wrote: > >> +typedef struct spin_info { >> + uint64_t addr; >> + uint64_t r3; >> + uint32_t resv; >> + uint32_t pir; >> + uint64_t r6; >> +} __attribute__ ((packed)) SpinInfo; > Note that r6 isn't part of the ePAPR spin table -- I think it may have been > in an early draft and gotten into U-Boot that way. A future ePAPR could > assign another use to that position in the spin table. How is the size defined then? > Do we support any host ABIs strange enough that __attribute__((packed)) > would be needed here? I don't think we do, but in general I prefer to be safe rather than sorry. It doesn't hurt, right? >> +static void mmubooke_create_initial_mapping(CPUState *env, >> + target_ulong va, >> + target_phys_addr_t pa, >> + target_phys_addr_t len) >> +{ >> + ppcmas_tlb_t *tlb = booke206_get_tlbm(env, 1, 0, 0); >> + target_phys_addr_t size; >> + >> + size = (booke206_page_size_to_tlb(len)<< MAS1_TSIZE_SHIFT); >> + tlb->mas1 = MAS1_VALID | size; >> + tlb->mas2 = va& TARGET_PAGE_MASK; >> + tlb->mas7_3 = pa& TARGET_PAGE_MASK; >> + tlb->mas7_3 |= MAS3_UR | MAS3_UW | MAS3_UX | MAS3_SR | MAS3_SW | MAS3_SX; >> +} > [snip] >> + mmubooke_create_initial_mapping(env, env->nip, env->nip, map_size); > ePAPR says: > > The Secondary IMA (SIMA) mapping in the MMU shall map effective address 0 > to the entry_addr field in the spin table, aligned down to the SIMA size. So it jumps to nip & ~64MB? > Note that it's possible for the physical entry point to be> 4GiB on a > 32-bit target. > > Also, MAS2[M] should be set, even if it doesn't affect anything real under > qemu/kvm. Ok :) > I know that U-Boot has the same behavior on both counts. U-Boot is wrong. If you say so, I'll align it with ePAPR then. Alex