From patchwork Tue May 30 19:14:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 686929 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp901047wru; Tue, 30 May 2023 12:20:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Qc2gbJAKFrm/zqxz6ItnQbqNelhH3glRPAtEdbApXtW1Vpt5+kLZ8xQxjcjkOV1J5MsPq X-Received: by 2002:a05:622a:1015:b0:3f3:98b8:3fcb with SMTP id d21-20020a05622a101500b003f398b83fcbmr3211398qte.36.1685474416412; Tue, 30 May 2023 12:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685474416; cv=none; d=google.com; s=arc-20160816; b=mzGcpsuddJjVJFEybpWtqzI4IjkQLLL+GIDlz4/x/CgYftzqpdC4uF37Q/5OAT827t XlO5Hpva6P76YBRQepVPR/ZgrcN873dd9dBYU/U8BsZGr/RJwdHHQl++lJoC2oY4DB9o MdsIzM7XxjkStP452PeTTSt98Lw4+AXBdjg5YThQkyBeijOojR5bBD8pGlbJz0d46uxN Oe8u2brbBU8Rz2ZhHQ5Tb5+oWDHG7YJ5MBvpEX3Z6Nmp7zUg3slOj0dHfmvDNumzKP8Q IpLZwTNloK/DMq+oifzo6Oh4oSXfdxYybk4l8Jj2DeOVkz2gx/t2J2cBeTymbhrZVGvF yJ7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=j3NB0kKMraRNz/f7J34nBSLxO8imEq998u/Uy8JSg1Y=; b=K9YHdvQPXQ5099T6TH5hIQR08WEGX0FQqMkFFvkqZVi5QvVktLh7zyrHp9tKNEzJJs 13Xcqywdqh2eGCc+ONOGKfpVXpAN4DK5mcghGcwfzxwU3xcmsyVAHkS4WQy3U0L3IJKj C17YfQES6KRLtzVxjPxXt1i0l3bx7/8QozFQjXSmMbjp9ycru2fYKjRWe1bUtxcrrVbn HiLRgwHlp56UNmKL8s/f2KRzFfKhQqaSxVGUb3TffwThLHkUgK9/MqfKsB/gCAyKT4he /Q3WreuWCYUPVR9QA0cMHETEmJJMeLyVZVqIL/c9HdnRvcK+/38FBYXpgwIQsEeZAbai Zliw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i+FS+wwS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m4-20020a05622a118400b003f6b59810e7si6989450qtk.755.2023.05.30.12.20.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 30 May 2023 12:20:16 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=i+FS+wwS; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q44ov-0008Cj-7M; Tue, 30 May 2023 15:15:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q44oE-0007Da-4p for qemu-devel@nongnu.org; Tue, 30 May 2023 15:15:06 -0400 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q44o1-0004j0-CH for qemu-devel@nongnu.org; Tue, 30 May 2023 15:15:05 -0400 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-64d2a87b9daso3612876b3a.0 for ; Tue, 30 May 2023 12:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685474092; x=1688066092; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=j3NB0kKMraRNz/f7J34nBSLxO8imEq998u/Uy8JSg1Y=; b=i+FS+wwSqZ94ZWrWpLwSqLy3cUP5VnKQtCENyBC0vuovK9FebwwII6glQvJ1/Ui8Fh Et4ugxMWS7yychhGaT0cq9cjh1V6o7F5Kolh8ld63bQRGB/7zxMTESItgSgsS8WF33qu lJT25vHfHm6UVK/QoK9z+mJS7stXFjQWNVwbip5fjTW2xK552Mi0a9COGlFVRQbFe+35 R6gO1OZW/Tm26dQ6hq2fAt1gSXbUZTao43HV3YjUOeNcW4paKdp0oor5ITidZEc/evzB Z3lroz7ecuEzP1kYC9p/SWB2K+POwCav67CJhnYLG4rRDNhodbIIqBlIGRJLFGmNvMX5 a3WA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685474092; x=1688066092; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=j3NB0kKMraRNz/f7J34nBSLxO8imEq998u/Uy8JSg1Y=; b=EcFWP1W8nE7KqAJ0/P2jiyk9bxInT0n+C6EiQDUJb7SdVVE6VnRhCNKwHO5GAlOoDy iTTOU3W8SU8bWAL60cLJlyCQJqRlbhpvoWZQ8AuBUZXRTlEAa7MPsj7HW+CRtmSg5Yas 2Vy7otFetDqvze0AOkpnumjhfAPY6D+LGp0t7G0sVgswbpylX7TXG92JOuDoD0vrlkO/ oscKhTK++NKGlPwLaNTrmxjIbC3gye6OWXvBXwJrT256qdzaYJhB2U2WTGtNFtuXFoZR yZP2nihbuG2sw3JSECxv/HSbN9MKRPZFBat0r4y1D1m4mYjUlyuvyadWfktibA6WxlCF S8lw== X-Gm-Message-State: AC+VfDxF4gHQCK2vOK9gxBLRvqapOTv44T4v8EReYq4tSYMR28/YjT0t wYvdi6EQiXgOGm2rYK1yi/5a8PVXsNF9Mj3+tgo= X-Received: by 2002:a05:6a00:2444:b0:64a:7723:fe04 with SMTP id d4-20020a056a00244400b0064a7723fe04mr4088630pfj.4.1685474091991; Tue, 30 May 2023 12:14:51 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:35a2:c45d:7485:f488]) by smtp.gmail.com with ESMTPSA id 10-20020a63104a000000b0051806da5cd6sm8926757pgq.60.2023.05.30.12.14.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 May 2023 12:14:51 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell Subject: [PATCH v3 15/20] target/arm: Add SCTLR.nAA to TBFLAG_A64 Date: Tue, 30 May 2023 12:14:33 -0700 Message-Id: <20230530191438.411344-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230530191438.411344-1-richard.henderson@linaro.org> References: <20230530191438.411344-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::431; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Reviewed-by: Peter Maydell Signed-off-by: Richard Henderson --- target/arm/cpu.h | 3 ++- target/arm/tcg/translate.h | 2 ++ target/arm/tcg/hflags.c | 6 ++++++ target/arm/tcg/translate-a64.c | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/target/arm/cpu.h b/target/arm/cpu.h index c1db26b299..36c608f0e6 100644 --- a/target/arm/cpu.h +++ b/target/arm/cpu.h @@ -1248,7 +1248,7 @@ void pmu_init(ARMCPU *cpu); #define SCTLR_D (1U << 5) /* up to v5; RAO in v6 */ #define SCTLR_CP15BEN (1U << 5) /* v7 onward */ #define SCTLR_L (1U << 6) /* up to v5; RAO in v6 and v7; RAZ in v8 */ -#define SCTLR_nAA (1U << 6) /* when v8.4-LSE is implemented */ +#define SCTLR_nAA (1U << 6) /* when FEAT_LSE2 is implemented */ #define SCTLR_B (1U << 7) /* up to v6; RAZ in v7 */ #define SCTLR_ITD (1U << 7) /* v8 onward */ #define SCTLR_S (1U << 8) /* up to v6; RAZ in v7 */ @@ -3044,6 +3044,7 @@ FIELD(TBFLAG_A64, SVL, 24, 4) /* Indicates that SME Streaming mode is active, and SMCR_ELx.FA64 is not. */ FIELD(TBFLAG_A64, SME_TRAP_NONSTREAMING, 28, 1) FIELD(TBFLAG_A64, FGT_ERET, 29, 1) +FIELD(TBFLAG_A64, NAA, 30, 1) /* * Helpers for using the above. diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 626cf07970..38086a23f4 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -137,6 +137,8 @@ typedef struct DisasContext { bool fgt_eret; /* True if fine-grained trap on SVC is enabled */ bool fgt_svc; + /* True if FEAT_LSE2 SCTLR_ELx.nAA is set */ + bool naa; /* * >= 0, a copy of PSTATE.BTYPE, which will be 0 without v8.5-BTI. * < 0, set by the current instruction. diff --git a/target/arm/tcg/hflags.c b/target/arm/tcg/hflags.c index b2ccd77cff..616c5fa723 100644 --- a/target/arm/tcg/hflags.c +++ b/target/arm/tcg/hflags.c @@ -248,6 +248,12 @@ static CPUARMTBFlags rebuild_hflags_a64(CPUARMState *env, int el, int fp_el, } } + if (cpu_isar_feature(aa64_lse2, env_archcpu(env))) { + if (sctlr & SCTLR_nAA) { + DP_TBFLAG_A64(flags, NAA, 1); + } + } + /* Compute the condition for using AccType_UNPRIV for LDTR et al. */ if (!(env->pstate & PSTATE_UAO)) { switch (mmu_idx) { diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 8301d6c8e2..bbcdf31728 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -14163,6 +14163,7 @@ static void aarch64_tr_init_disas_context(DisasContextBase *dcbase, dc->pstate_sm = EX_TBFLAG_A64(tb_flags, PSTATE_SM); dc->pstate_za = EX_TBFLAG_A64(tb_flags, PSTATE_ZA); dc->sme_trap_nonstreaming = EX_TBFLAG_A64(tb_flags, SME_TRAP_NONSTREAMING); + dc->naa = EX_TBFLAG_A64(tb_flags, NAA); dc->vec_len = 0; dc->vec_stride = 0; dc->cp_regs = arm_cpu->cp_regs;