From patchwork Fri Jul 24 15:21:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 51452 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f69.google.com (mail-la0-f69.google.com [209.85.215.69]) by patches.linaro.org (Postfix) with ESMTPS id 28AA822D94 for ; Fri, 24 Jul 2015 15:21:13 +0000 (UTC) Received: by lafd3 with SMTP id d3sf8666998laf.1 for ; Fri, 24 Jul 2015 08:21:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=DjbeAOKwV1EGzhUdCtXCFDKIYXSa25lQ0lmbLit+LnE=; b=GpHYx3LUOhW6MFboht20+BbIygP78B/dOcZyROreUcoXpvASdYjPAqHUsGr6KlB/5E Uj0TccaqoZBt/sIRHdvlws8+Ju7FPw3xk5VpEjSRG/uXeVU5WPzoOXgR95JKCjLhkxwv ruSLR7cst+2ehjbzPpy4V+N2ldnSNjZxATZP/Jbj0ZsNyWuywLvlix5Cd1kz7hW9BktD gV/N8p657N1wIsrdIb+Fs9/TISFwOOBibBAiNZmF+XkgKUFSJr5OQNuOygAwTpzHjZ0J 97bX6jcKAqbWcPVL2BZuDy3Q5XTnwmLcOx2YDOWdgHbtTF/Ly8LIL6Ee/TcKogCJ90WD Hd5g== X-Gm-Message-State: ALoCoQmMB7LMRakG4OuGMLaWXmLxuBCp5Yjv8cyvvdKWaTKVWl1+0vI0ssuOaGgOnAPVBWk+unPR X-Received: by 10.152.182.226 with SMTP id eh2mr6396863lac.0.1437751272111; Fri, 24 Jul 2015 08:21:12 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.6.231 with SMTP id e7ls383799laa.34.gmail; Fri, 24 Jul 2015 08:21:11 -0700 (PDT) X-Received: by 10.112.166.2 with SMTP id zc2mr14161581lbb.29.1437751271915; Fri, 24 Jul 2015 08:21:11 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id dn7si7797231lbb.71.2015.07.24.08.21.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Jul 2015 08:21:11 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by laah7 with SMTP id h7so16210342laa.0 for ; Fri, 24 Jul 2015 08:21:11 -0700 (PDT) X-Received: by 10.112.133.72 with SMTP id pa8mr14100022lbb.117.1437751271670; Fri, 24 Jul 2015 08:21:11 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.7.198 with SMTP id l6csp58154lba; Fri, 24 Jul 2015 08:21:10 -0700 (PDT) X-Received: by 10.60.157.41 with SMTP id wj9mr15449419oeb.72.1437751270157; Fri, 24 Jul 2015 08:21:10 -0700 (PDT) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id fa16si21369763pad.140.2015.07.24.08.21.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 24 Jul 2015 08:21:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of pm215@archaic.org.uk designates 2001:8b0:1d0::1 as permitted sender) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1ZIemV-0005iD-GK; Fri, 24 Jul 2015 16:21:03 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, "Edgar E. Iglesias" Subject: [PATCH 5/5] target-arm: Implement AArch32 ATS1H* operations Date: Fri, 24 Jul 2015 16:21:03 +0100 Message-Id: <1437751263-21913-6-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1437751263-21913-1-git-send-email-peter.maydell@linaro.org> References: <1437751263-21913-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Implement the AArch32 ATS1H* operations which perform Hyp mode stage 1 translations. Signed-off-by: Peter Maydell --- target-arm/helper.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/target-arm/helper.c b/target-arm/helper.c index 67d108e..b9ce965 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -1607,6 +1607,17 @@ static void ats_write(CPUARMState *env, const ARMCPRegInfo *ri, uint64_t value) A32_BANKED_CURRENT_REG_SET(env, par, par64); } +static void ats1h_write(CPUARMState *env, const ARMCPRegInfo *ri, + uint64_t value) +{ + int access_type = ri->opc2 & 1; + uint64_t par64; + + par64 = do_ats_write(env, value, access_type, ARMMMUIdx_S2NS); + + A32_BANKED_CURRENT_REG_SET(env, par, par64); +} + static CPAccessResult at_s1e2_access(CPUARMState *env, const ARMCPRegInfo *ri) { if (arm_current_el(env) == 3 && !(env->cp15.scr_el3 & SCR_NS)) { @@ -2770,6 +2781,17 @@ static const ARMCPRegInfo el2_cp_reginfo[] = { .opc0 = 1, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 1, .access = PL2_W, .accessfn = at_s1e2_access, .type = ARM_CP_NO_RAW, .writefn = ats_write64 }, + /* The AArch32 ATS1H* operations are CONSTRAINED UNPREDICTABLE + * if EL2 is not implemented; we choose to UNDEF. Behaviour at EL3 + * with SCR.NS == 0 outside Monitor mode is UNPREDICTABLE; we choose + * to behave as if SCR.NS was 1. + */ + { .name = "ATS1HR", .cp = 15, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 0, + .access = PL2_W, + .writefn = ats1h_write, .type = ARM_CP_NO_RAW }, + { .name = "ATS1HW", .cp = 15, .opc1 = 4, .crn = 7, .crm = 8, .opc2 = 1, + .access = PL2_W, + .writefn = ats1h_write, .type = ARM_CP_NO_RAW }, #endif REGINFO_SENTINEL };