From patchwork Mon Aug 22 15:27:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 599144 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:4388:0:0:0:0 with SMTP id w8csp1794870mae; Mon, 22 Aug 2022 09:28:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR4UQSgmxcRZ+r3YersDS+kA7qzSRCWl0RkKeG2W47nSKKZmDL8c31dNYRypt5e6NWsh+5kB X-Received: by 2002:a05:6214:f24:b0:476:72bb:2473 with SMTP id iw4-20020a0562140f2400b0047672bb2473mr16279149qvb.82.1661185696621; Mon, 22 Aug 2022 09:28:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661185696; cv=none; d=google.com; s=arc-20160816; b=kTCMbA8UI/JzS/iXZSTZG1kUuA68lLxu/KG3JFQkIt/ecL+SYnb04nq9Z7NfqDl+ip M8yYYIhOmjJYzZuVDKai4qbuqnfOHCHRlwZLx88rm8czjkvp48MYkS4kmFVXWUwLac8w ky1PLzRXBGlLkMyB/JXerpuSdwKM1UOsiM/IE+tLHDFC/dWdIViMLJNxmuj9LgeQ7sN2 /jYyA9/9ct+uvXuEcyHattGg3qGr1J04r5EnJuMAFPunggU4kGo8QY+vBH8gplAHo0qV 51cjQMVrxMaUE6kb/08wKzf7l7zPEpKd2lH5IyzkAlQre5HjSH1vex/n0CtYrTUNIILn hJvA== 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=r2s4x+bZJOY5/giT1jRp8us14Aquo3FqXDJ1E/9NmhQ=; b=HN/ZhxGEjY9r5EJ50UyPeAXb8dEEvevxBu6isSx1rg53/6Prk15Zk4SpStp7UOb4ry i4xAsqUwKI7sN3QGBwbNuX1d2itMbgk/3jeQeomQ2f0I0i0ygyv+drcNLLvxyOmlA+mv 2lzVtXFLS4d4qRwT3AYqGaNxkopCBx1I4lEgcb8AbI+IMs0iyYAq5rcEzal39Fk/HIbr 37RhxlEWuwaGMevyP/cM3sDck2cJyrFkHhvJ7E3KueisGYhEMaLk3bgI8lqNG4WybuhP bbol/9M3uB8yctrPBWZYogiXNM6of0mvq5IOCsOccwX+6CMbZ6kj7TbCAJSznCWGSPFX 4KeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ohq2sb2o; 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 x15-20020a05620a258f00b006b97e48a0bcsi5228240qko.267.2022.08.22.09.28.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 22 Aug 2022 09:28: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=ohq2sb2o; 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]:55722 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQAHf-0000Fu-VA for patch@linaro.org; Mon, 22 Aug 2022 12:28:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33522) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQ9Lm-0000Ey-VY for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:28:27 -0400 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]:54228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQ9LW-0000q7-Dd for qemu-devel@nongnu.org; Mon, 22 Aug 2022 11:28:26 -0400 Received: by mail-pj1-x1031.google.com with SMTP id m15so3292023pjj.3 for ; Mon, 22 Aug 2022 08:28:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=r2s4x+bZJOY5/giT1jRp8us14Aquo3FqXDJ1E/9NmhQ=; b=ohq2sb2ouf5s7iCm7STCUZ7jD7GI/JbnAn8Uuar98848AM9CBHWznKj+61xbvnY1G0 UMC4kHp6AicUdlf8UDtGtPq5VUk9gn7LFEvaynedFDe4qGyYXIpu5plgBsOyLM4e2GQP Oa5aNC0+Md4uuLvtyrr3EKXtlfagdFXpLsrfpMtK+FAwPRaOqp+yVPbqoMmELYVG7OTJ EPLu1NzZq1OU7cqhVHmoO5SY2xXI7GbJcZj1KHqooqWl9IublyZ4t8v57svtOrEa/N6X OUvl0bPQEc92zCLfdY70Y1Ac1ymtJWfWvho9Sn6UX6J/nST3XKaOWCqME4NXUQUQmoNU kt3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=r2s4x+bZJOY5/giT1jRp8us14Aquo3FqXDJ1E/9NmhQ=; b=YBgQv/JH2gHKiuIW34O5aCdjYMum4Sd/gUuLBv/aLg0TXSGY3RtQ/8ERoGoC0H1k85 XQ8d8WHoOmYNIMxvFupbtZlpvCOV9CUIiTPev9KCo/YzjKbtanTUt4L3Q3d0An1PvtSb tkoT66jMTIH5+Y6nFYZfVXDoeTJRD7NkUKhHozOZ/f3wCU5JHMdSDsqI3U03oHohqTQD f9RsUIupU1CLpRqNial7/TWbOhFRdoFU7gLILtdoahYcG1QWho0GbdISSkX0kud86Cej qISvWSkAJBkR4S4he34NOuv5AVsQre9m+4EZFfW43HsaF0neh+54QXb1V13BmTDjs448 Rgew== X-Gm-Message-State: ACgBeo21OjO9y0CQnLaZcrsZrQMm/fAhBlJG7NdGCwoJ8C1hhmuRPofR xYr0LQApzZ7cWxd4i4BjxWDHvJsjtWiYjA== X-Received: by 2002:a17:902:dac6:b0:172:e3c6:2b39 with SMTP id q6-20020a170902dac600b00172e3c62b39mr6979175plx.84.1661182088068; Mon, 22 Aug 2022 08:28:08 -0700 (PDT) Received: from stoup.. ([71.212.157.236]) by smtp.gmail.com with ESMTPSA id q7-20020a17090311c700b0016bffc59718sm8665222plh.58.2022.08.22.08.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 08:28:07 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 31/66] target/arm: Fix S2 disabled check in S1_ptw_translate Date: Mon, 22 Aug 2022 08:27:06 -0700 Message-Id: <20220822152741.1617527-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220822152741.1617527-1-richard.henderson@linaro.org> References: <20220822152741.1617527-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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" Pass the correct stage2 mmu_idx to regime_translation_disabled, which we computed afterward. Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/ptw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index dbe5852af6..680139b478 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -211,11 +211,10 @@ static hwaddr S1_ptw_translate(CPUARMState *env, ARMMMUIdx mmu_idx, ARMMMUFaultInfo *fi) { bool is_secure = *is_secure_ptr; + ARMMMUIdx s2_mmu_idx = is_secure ? ARMMMUIdx_Stage2_S : ARMMMUIdx_Stage2; if (arm_mmu_idx_is_stage1_of_2(mmu_idx) && - !regime_translation_disabled(env, ARMMMUIdx_Stage2, is_secure)) { - ARMMMUIdx s2_mmu_idx = is_secure ? ARMMMUIdx_Stage2_S - : ARMMMUIdx_Stage2; + !regime_translation_disabled(env, s2_mmu_idx, is_secure)) { GetPhysAddrResult s2 = {}; int ret;