From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:39505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RpNla-0007cE-Fb for qemu-devel@nongnu.org; Mon, 23 Jan 2012 12:33:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RpNlQ-0002U7-B5 for qemu-devel@nongnu.org; Mon, 23 Jan 2012 12:33:13 -0500 Message-ID: <4F1D99CC.90203@suse.de> Date: Mon, 23 Jan 2012 18:33:00 +0100 From: Alexander Graf MIME-Version: 1.0 References: <1327119330-29304-1-git-send-email-agraf@suse.de> <1327119330-29304-7-git-send-email-agraf@suse.de> <4F1D9912.1090803@freescale.com> In-Reply-To: <4F1D9912.1090803@freescale.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 6/8] PPC: booke: add tlbnps handling List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Scott Wood Cc: qemu-ppc@nongnu.org, qemu-devel Developers On 01/23/2012 06:29 PM, Scott Wood wrote: > On 01/20/2012 10:15 PM, Alexander Graf wrote: >> +/* returns bitmap of supported page sizes for a given TLB */ >> +static inline uint32_t booke206_tlbnps(CPUState *env, const int tlbn) >> +{ >> + bool mav2 = false; >> + uint32_t ret = 0; >> + >> + if (mav2) { >> + ret = env->spr[SPR_BOOKE_TLB0PS + tlbn]; >> + } else { >> + uint32_t tlbncfg = env->spr[SPR_BOOKE_TLB0CFG + tlbn]; >> + uint32_t min = (tlbncfg& TLBnCFG_MINSIZE)>> TLBnCFG_MINSIZE_SHIFT; >> + uint32_t max = (tlbncfg& TLBnCFG_MAXSIZE)>> TLBnCFG_MAXSIZE_SHIFT; >> + int i; >> + for (i = min; i<= max; i++) { >> + ret |= (1<< (i<< 1)); >> + } >> + } > For mav1 only the even sizes are supported. Yes, which is why min and max are >> 1 compared to the MAV2 values. Alex