From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZJyF-0002Bz-43 for qemu-devel@nongnu.org; Tue, 08 Sep 2015 10:34:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZJyB-0004CN-RJ for qemu-devel@nongnu.org; Tue, 08 Sep 2015 10:34:03 -0400 Received: from mail-yk0-f181.google.com ([209.85.160.181]:36336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZJyB-0004CJ-O0 for qemu-devel@nongnu.org; Tue, 08 Sep 2015 10:33:59 -0400 Received: by ykcf206 with SMTP id f206so121270492ykc.3 for ; Tue, 08 Sep 2015 07:33:59 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1441311266-8644-9-git-send-email-edgar.iglesias@gmail.com> References: <1441311266-8644-1-git-send-email-edgar.iglesias@gmail.com> <1441311266-8644-9-git-send-email-edgar.iglesias@gmail.com> From: Peter Maydell Date: Tue, 8 Sep 2015 15:33:39 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v1 08/10] target-arm: Supress EPD for S2, EL2 and EL3 translations List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Edgar E. Iglesias" Cc: Edgar Iglesias , Sergey Fedorov , =?UTF-8?B?QWxleCBCZW5uw6ll?= , QEMU Developers , Alexander Graf On 3 September 2015 at 21:14, Edgar E. Iglesias wrote: > From: "Edgar E. Iglesias" > > Stage-2 translations, EL2 and EL3 regimes don't have the > EPD control. > > Signed-off-by: Edgar E. Iglesias > --- > target-arm/helper.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/target-arm/helper.c b/target-arm/helper.c > index 66b3fed..a53d713 100644 > --- a/target-arm/helper.c > +++ b/target-arm/helper.c > @@ -6323,7 +6323,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, > /* Read an LPAE long-descriptor translation table. */ > MMUFaultType fault_type = translation_fault; > uint32_t level = 1; > - uint32_t epd; > + uint32_t epd = 0; > int32_t tsz; > uint32_t tg; > uint64_t ttbr; > @@ -6420,7 +6420,9 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, > */ > if (ttbr_select == 0) { > ttbr = regime_ttbr(env, mmu_idx, 0); > - epd = extract32(tcr->raw_tcr, 7, 1); > + if (el < 2 && mmu_idx != ARMMMUIdx_S2NS) { > + epd = extract32(tcr->raw_tcr, 7, 1); > + } Just "if (el < 2)" is sufficient. Also typo in subject again. thanks -- PMM