From patchwork Sun Jul 3 08:23:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 586813 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2918866mab; Sun, 3 Jul 2022 01:45:11 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sJjT5AdxNPR6Pkir+gn9Kmjbb1dUbJfbBkoDmGO2ZpTw16h7yrKFkznH0ER1vbeCn+TmTv X-Received: by 2002:a05:6902:2cc:b0:66e:3562:608 with SMTP id w12-20020a05690202cc00b0066e35620608mr2211907ybh.461.1656837911183; Sun, 03 Jul 2022 01:45:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656837911; cv=none; d=google.com; s=arc-20160816; b=xY0kuVAU8Pq2HOLaD2X9tJEpvG0WLRtkSPDh/ElhtYYXnBYOxeVypf4mn/gQbzzmR5 jWMKfmwmo4/eyvustZWMvWjBg5JwWwHQ57hG8k9mDo10I6GPTCGepy9jJt887uxaVk2k jJBDBhbYPXDQ/qa2DQuTg7oF25PaAZNlekdwJI3elY/KnOJFjE+kkOQatlY1I0A4KDXL Gsld/SfjSjMAx6iRYUKSpVPgxqjEcbEg9igVwEJwDYLoJ8QaDal8NwmqUF9RLQ5foOEF 90MLPjPYHb2k1ie20BJxPh6t9HBcNja/tb+XHTXgcLnxI/En5xOnJk+7DQPamlAv8QT/ JoHQ== 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=2QgifQ8/UXpFYLo0AlrMI1Z36M4FSsNZYn7tIgKAL9c=; b=StFIqA6+YtsICBV772FlIWs+LiMWMkKebGO84fPfMD/zOzt94BYy08lWdKtbk4Kt5M WQPZSYrm9LkBFfQM7OUbaqzp2FtfQ80jgYQIWkBEJhyJRAqwAM51RZD3JFH/yM4WEY7D 2OJJG2xdmRY1msezA1a//ZXsx/o5QpC67qFqswCcHQC3rct++hxmRlBTHs+vbiy7eT0u Dj/K1JIfuuNUR9y56fMH4yyg0QG4zpQKsd8aZ6bHqQ1t4lMwufkjCmcDi8Jg/Oq6iuo8 f+JqXZewFUtanR2TvBm+Tm36O3t1wvWno5kcWtcBTS5wenEwDdPyDm3fGbsfEIb/VBFx SKeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=H5v4vily; 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 11-20020a81160b000000b002e62b533f23si33170188yww.432.2022.07.03.01.45.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Jul 2022 01:45:11 -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=H5v4vily; 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]:53434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7vE6-00008k-Hg for patch@linaro.org; Sun, 03 Jul 2022 04:45:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7uv7-0007zi-Ow for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:35 -0400 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]:37815) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7uv6-0006A6-86 for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:33 -0400 Received: by mail-pg1-x533.google.com with SMTP id bh13so308005pgb.4 for ; Sun, 03 Jul 2022 01:25:31 -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=2QgifQ8/UXpFYLo0AlrMI1Z36M4FSsNZYn7tIgKAL9c=; b=H5v4vilyka3BgkgIpqCJt4oYPazHXLTCnBhc1r7rxIGQ1hvKLQ6U7MRvc0RGWAwD4x yKR9MHm15AiGe1TramaB9qh915N0OmNgiv+7NPO+VEHK3TvQWo3HG6T11Mxgyn82nQRt X/5c24FLGA8bt1expR+onIaVkDcjFWQiuaVsMLGqlL7rpNq+5szEBz7Rh3QUhiIklFSf R0I/K9VRsMHUrO2Dq9saIMp3ss9h1d86GtRpUXJG+hoM0sgKFPnP3EC6euweQ7NTtAGa tq6U5yPI0K7cTubDL4JWcePnab2KnnFyxD3w1zEJfLTUiRntWoIbQyIOTMkWSpouuXo/ joGg== 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=2QgifQ8/UXpFYLo0AlrMI1Z36M4FSsNZYn7tIgKAL9c=; b=C9oSXv0m1UjPXKbmp9J7NljVt1oVcR1RoR0XEGUTQDkf0+0TnImTmvqbJ0IrifV3ib adeVSQ9pi0ntotew4xzLORCwfeTPWSPU5FBjYN4Q1sIl+AbNwjzryyNLri50U3y61LXo dGL8ot+whJN242WJk6McCYISKD125yAt3PDve0/UOPrsZP/1948ktzBhhlqo9xBlsPK5 n8xXPR/SugnohuxXPT4EKYG9MfON7hecex5K2INMAV3FRyJTKeNrGXuTVer4bMfykwEe vlEKhiyFT8NqpfL4Cp1yv3GtZUEW3aWF2ckd/TSLP4HE/oSIQqeSzSrqKfHOzVM9YmSb BYBg== X-Gm-Message-State: AJIora9wGksb4+tSuWAhUiuvYl/NggTZf3zl8X3LNQ0kQJM1EpGX4rI/ e4VNWM4ptilDsvKZzx0ZB72mWqqHQJuaFMnZ X-Received: by 2002:a63:5366:0:b0:411:415a:5888 with SMTP id t38-20020a635366000000b00411415a5888mr19769917pgl.286.1656836730864; Sun, 03 Jul 2022 01:25:30 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id im22-20020a170902bb1600b0016a3f9e528asm13569112plb.57.2022.07.03.01.25.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 01:25:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 21/62] target/arm: Add is_secure parameter to get_phys_addr_v6 Date: Sun, 3 Jul 2022 13:53:38 +0530 Message-Id: <20220703082419.770989-22-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::533; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x533.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" Remove the use of regime_is_secure from get_phys_addr_v6. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- target/arm/ptw.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 1bef9c6c60..d424dec729 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -529,7 +529,8 @@ do_fault: static bool get_phys_addr_v6(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - GetPhysAddrResult *result, ARMMMUFaultInfo *fi) + bool is_secure, GetPhysAddrResult *result, + ARMMMUFaultInfo *fi) { ARMCPU *cpu = env_archcpu(env); int level = 1; @@ -552,8 +553,7 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t address, fi->type = ARMFault_Translation; goto do_fault; } - desc = arm_ldl_ptw(env, table, regime_is_secure(env, mmu_idx), - mmu_idx, fi); + desc = arm_ldl_ptw(env, table, is_secure, mmu_idx, fi); if (fi->type != ARMFault_None) { goto do_fault; } @@ -606,8 +606,7 @@ static bool get_phys_addr_v6(CPUARMState *env, uint32_t address, ns = extract32(desc, 3, 1); /* Lookup l2 entry. */ table = (desc & 0xfffffc00) | ((address >> 10) & 0x3fc); - desc = arm_ldl_ptw(env, table, regime_is_secure(env, mmu_idx), - mmu_idx, fi); + desc = arm_ldl_ptw(env, table, is_secure, mmu_idx, fi); if (fi->type != ARMFault_None) { goto do_fault; } @@ -2505,7 +2504,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address, result, fi); } else if (regime_sctlr(env, mmu_idx) & SCTLR_XP) { return get_phys_addr_v6(env, address, access_type, mmu_idx, - result, fi); + is_secure, result, fi); } else { return get_phys_addr_v5(env, address, access_type, mmu_idx, is_secure, result, fi);