From patchwork Sun Jul 3 08:24:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 586840 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2933993mab; Sun, 3 Jul 2022 02:15:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ulhpMg1vA0r5P7Q0BPBzSl8Vd3Qsr6GOIaVel+ZI/UB5foco/uUwn7GgUMog7rd36wz/Pm X-Received: by 2002:a81:9185:0:b0:31c:7e9b:255b with SMTP id i127-20020a819185000000b0031c7e9b255bmr6874573ywg.2.1656839747238; Sun, 03 Jul 2022 02:15:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656839747; cv=none; d=google.com; s=arc-20160816; b=FOyl+QcNfvCjjjz0awcko3Or8/ULdq6UFHgx2kwemcOBIZy438lmHN9P6RVpPYm0+t xY2BrvuwH1Ju9gA7CyHdBKoAzN75SJX0mEvRizKuUy8zOSlVedi4bZNWKyvtVN76ZAc2 skc5adQafbCU/3yo5VGlgJQ4kaSnfSP2E1nnZagDl1x6MwL5e6KPwCFwJuErigU0Nq9o RAmtmsMFtCc3YQL8CEfPnKhKpUtjQrFQXLuEdE29TBiAhd46Wr+AZkr75YciNqEa6qgD 9Ye0LMsjN1WmzMjV9SfK9j+jsPinfeERKaOGNQvqhCmINzdxPhrNYNHgecg4DnfGGjY/ jF0g== 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=UbIrVuD695ihfGEi7s3Q8RXV9zhlhUlzREnUxvNfINo=; b=Mp/ecxO0smuPtVVF8+g3n/8+8wMkLcv1QySrZ8sYSFarTnYUOOP2/Qga+wimdjZQye SDkkuGjTVfDCVeTJrFRpmSTM0LnPJBJ10z8dsEJW3xuWam5H0hXJogChvszmT2i6eI2B 0MmgPr70F+qB4XOLmRDOogGC7BRIQHGMcrmV/l0v0dnhaAJ3swcd66iywlanBngCyKLa lrqPN588VTgL22LcEnwdgTenWRPThyMk0Dft1Hz5I6XrQ9FT9hOGNXq1zx47+cnaFyxD 7XbMvRd1WBfkqvdNls9XxDLOG++kwte63LMSzfh9pLfJhGbpd8z9mDBEpv1KAp4sqH7A VMww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KIWcNY28; 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 t197-20020a8178ce000000b00317fff762fbsi36175933ywc.143.2022.07.03.02.15.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Jul 2022 02:15:47 -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=KIWcNY28; 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]:34768 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7vhi-0003dR-Kd for patch@linaro.org; Sun, 03 Jul 2022 05:15:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54460) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7uzS-0001O1-OK for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:30:02 -0400 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]:40713) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7uzR-0006it-4h for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:30:02 -0400 Received: by mail-pf1-x42e.google.com with SMTP id y141so6343913pfb.7 for ; Sun, 03 Jul 2022 01:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UbIrVuD695ihfGEi7s3Q8RXV9zhlhUlzREnUxvNfINo=; b=KIWcNY28+3vKor2IVOk2aqpth0VSI+bnjY2HxJ+/8WhEPB7mSOPTdpWv8LWUjBfIc2 GeQclk9nWaVZc1OPV9maH9GTBYR9Cf+o218g1SmVDAgO0nRVyexs4Vu0rM0lgDgT4lPJ n4FT46PigOq2Q4VrsEHgGKwfX4P9Va6bpCDDj6HCIvKOw5XcNLHHBlO2YWUoDXHdT9C2 tfF2q2PC8eC13PzB0FTBi9sTYIDtsdtCMTirS5AR9BxJrS714/xWrd/u/Y9AWVY4MDix Br+u1Io3Wj/c8zDxanx5lqv9psqEd67yjuAMPCHS0itj0CyqXk7nDgf226/Z9p41QZUE 0vgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UbIrVuD695ihfGEi7s3Q8RXV9zhlhUlzREnUxvNfINo=; b=uGRaixYqNo73CqnGE0FnqO1422hOAk0jApml2uGoTJyAfgP5do40YOCVujhVdI2+yP VJM3A2cv9xEzgXnxiOmiB3GCvVzCUuGf+vjdo0FY09UsGsg/nGtfDIEJkZhDqZq8OsSz HyVkMdRviB52mcsz27ISDEk25d4vdi5KQwe5juOOoaqApo/eLDGMkw+FCypwnO07TZm5 9U1wvKt6iiK7DUZKEo2y9LUov3W/qX589BHyPTDaHyUBagh0Is2OFTm34r4NpvtyxcLY zMPMxlsiluatRfsIsLV5VTcg1MNLDya7pCdCZrgvib+7EsJ/2IhFTxXtzcwhAoUoAsL8 hXUg== X-Gm-Message-State: AJIora89yAYtqDL+fcJqIKkGlZGzBMrikGc1UzQG7kkdZERE0uwJlWJc OsVzGuEOlLQCPTcU4vDQgOWTmL0p2WHGoZy3 X-Received: by 2002:a05:6a00:a8b:b0:4cd:6030:4df3 with SMTP id b11-20020a056a000a8b00b004cd60304df3mr29033198pfl.40.1656836999819; Sun, 03 Jul 2022 01:29:59 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id g6-20020a1709026b4600b0016788487357sm18574523plt.132.2022.07.03.01.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 01:29:59 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 50/62] target/arm: Only use ARMMMUIdx_Stage1* for two-stage translation Date: Sun, 3 Jul 2022 13:54:07 +0530 Message-Id: <20220703082419.770989-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220703082419.770989-1-richard.henderson@linaro.org> References: <20220703082419.770989-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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=ham 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" If stage2 is disabled, we do not need to adjust mmu_idx. Below, we'll use get_phys_addr_lpae and not recurse. Adjust regime_is_user so that it can be used for E10_0. Signed-off-by: Richard Henderson --- target/arm/ptw.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index a2c441d947..e42286b4c1 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -90,6 +90,7 @@ static bool regime_translation_big_endian(CPUARMState *env, ARMMMUIdx mmu_idx) static bool regime_is_user(CPUARMState *env, ARMMMUIdx mmu_idx) { switch (mmu_idx) { + case ARMMMUIdx_E10_0: case ARMMMUIdx_E20_0: case ARMMMUIdx_Stage1_E0: case ARMMMUIdx_MUser: @@ -99,10 +100,6 @@ static bool regime_is_user(CPUARMState *env, ARMMMUIdx mmu_idx) return true; default: return false; - case ARMMMUIdx_E10_0: - case ARMMMUIdx_E10_1: - case ARMMMUIdx_E10_1_PAN: - g_assert_not_reached(); } } @@ -2530,10 +2527,6 @@ bool get_phys_addr_with_secure(CPUARMState *env, target_ulong address, s1_mmu_idx, is_secure, result, fi); } - /* - * For non-EL2 CPUs a stage1+stage2 translation is just stage 1. - */ - mmu_idx = s1_mmu_idx; } /*