From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:45456) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlRxS-0001KT-OJ for qemu-devel@nongnu.org; Mon, 25 Jul 2011 16:40:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlRxR-0000o4-Kk for qemu-devel@nongnu.org; Mon, 25 Jul 2011 16:40:58 -0400 Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11]:53601 helo=TX2EHSOBE002.bigfish.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlRxR-0000nz-Bx for qemu-devel@nongnu.org; Mon, 25 Jul 2011 16:40:57 -0400 Date: Mon, 25 Jul 2011 15:40:50 -0500 From: Scott Wood Message-ID: <20110725154050.11f07665@schlenkerla.am.freescale.net> In-Reply-To: <1311418212-13356-22-git-send-email-agraf@suse.de> References: <1311418212-13356-1-git-send-email-agraf@suse.de> <1311418212-13356-22-git-send-email-agraf@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" 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: Alexander Graf Cc: Elie Richa , QEMU-devel Developers 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. Do we support any host ABIs strange enough that __attribute__((packed)) would be needed here? > +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. 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. I know that U-Boot has the same behavior on both counts. U-Boot is wrong. -Scott