From patchwork Sun Jul 3 08:23:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 586799 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2912733mab; Sun, 3 Jul 2022 01:30:47 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tG4i9M2BCJMKsn5HR7of0h1pmbr+vG/d2MP8h4XaM+vl0JMqz8pojBuOVpDh1ceQYBXBgX X-Received: by 2002:a25:34ce:0:b0:66e:332b:e002 with SMTP id b197-20020a2534ce000000b0066e332be002mr2972303yba.477.1656837047533; Sun, 03 Jul 2022 01:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656837047; cv=none; d=google.com; s=arc-20160816; b=Rq7UqOZzxjBhpfxi5CGqb2ZmZG/4vRHZ89izYjX8eYIkAIEE4CgpWwNW4CF5jT50g/ Yg2WUyG+X/DII3CIC8JIuV1zo12kb6zVgz0cCPFdxfdCtMBwqZ2z0TgQ/vzE0gCyzqm7 qvy3plzM2YEVJ6MDzZPcceEdOrVQRMwTs58pNh3AoEAQxJaCx9PENlIKV7IsiPJDOZ4A MIEeEzLYmLn9aMNJ9+/6Jewt6SgZ0ysjpENL3uLt3BCDnCfERzAfTFskrcc8ZBQx/5OU OIEIdxnkAe6i/Ssd1wP8LCG3xBk4f9eoTf9CuEL7MPWVs0a8RsHjuvh/lFoXuJLdXOQI axwA== 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=EUX/T+NgNmJyoR8c7y7Ykrkjzc0XpAd0yqj7+G4mSDc=; b=BjmYSzMes7jA98eX93+f6aHW60qLX+YWSveV92Z617OPCRm04DqivNqka4KoxCOCAL aBsVvH7jrptX4HhQ20MgVBaiVNJuGDA8UEQbkF/QiAMvqpf5zNbz+4DNqqM8drEJe3hZ ZyBDu44nO+cOb9sO9DlC5kZVpd0OYgL9Sp0U8c203n7abIZ+uqH/M9RO54yBoYW27q/h WoWAl9n80S8+ifFLns3Stt3ee3qzvDTdKrp90goqt5YfVeMQQZtqfYAkA29pzWdBT7Bd s6a3fiwu4JVx2oh/KqQ/lnOzwEYUfVBwR1IQlOoeXnG0T5C3b+5vkULAN+7+/I1HhbtE LKYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MLeyEX3b; 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 131-20020a251089000000b0066e43894ba2si138988ybq.603.2022.07.03.01.30.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Jul 2022 01:30: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=MLeyEX3b; 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]:44710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7v0A-0007ol-UY for patch@linaro.org; Sun, 03 Jul 2022 04:30:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52920) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7uug-0007G3-Ut for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:06 -0400 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]:42572) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7uuf-0005vK-Da for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:06 -0400 Received: by mail-pf1-x42f.google.com with SMTP id d17so6333427pfq.9 for ; Sun, 03 Jul 2022 01:25:05 -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=EUX/T+NgNmJyoR8c7y7Ykrkjzc0XpAd0yqj7+G4mSDc=; b=MLeyEX3bvuIRSodVh3W4TXgmS7Xa41t6nbaVA/Zw3/Tv7gCe9kiYOdhpc88Te6jpaB wHGdpu/o60zKjuyJmM3otYt4wqWd25HSfX54jgKURYlMMQglH3GpWhV0aj6F9Cq6WEO5 fjGrCUNN89YGAuCzmIMAgFTUYqMZ+BPYZ8yFpnLjZLJj3EL1vLGCxrHPIEJFUTueZc+d qK5GFaZ+7laH31g5Bx/i6+07/kWg6K9lyUj9Nzz87lvcFWkCh9ecD2hShFryObnTpmLw REzfP8OQlvc/cuacCULLYymeQk9pARfjaDoMmEDUsNS2FHUwpOHehVZ7IdDmwPaWJCBw Fy0g== 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=EUX/T+NgNmJyoR8c7y7Ykrkjzc0XpAd0yqj7+G4mSDc=; b=vUiCi2SEsaF+SVJnkUsQhmAQL1XNwWvKk5fMt3Gfwh/tZbzHJKIP04Sz8eEgHL2GcS gEiHJdR8/pVQc03ShEqw2ZQFMABpYmMcfACZhoYpLlkLtdKe3O+hPVrkk+h+US6bm29J Q1ZJiworSAtc6ix2OfvYiQ9988+MZQxIJVk5izOLpostcWNRJY1sRdARU2VjRYiGhi3w f03vSkoWCBOKyT8Hrh2gOkLscp0DrPu6ZkELFnOO/dT84Q3yHyzHn+e0ARGNwqGvnngh SneDY4DgU5gYOTOGhWQs0tMobV5KwPGnmyP9WL3mxkdYKW8FRV+EXe3HyjmZ8yqBiF27 DY1Q== X-Gm-Message-State: AJIora8vFUbVkLRRJdXakH6qqXbL9a6Ifyi1XH6C2tJ6oTMvuzjNKfsM dQZc73bmti+t919DlIy+0+H0YZBpR01q9744 X-Received: by 2002:a05:6a00:1901:b0:4fa:fa9e:42e6 with SMTP id y1-20020a056a00190100b004fafa9e42e6mr29346784pfi.1.1656836704153; Sun, 03 Jul 2022 01:25:04 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id im22-20020a170902bb1600b0016a3f9e528asm13569112plb.57.2022.07.03.01.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 01:25:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 13/62] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav5 Date: Sun, 3 Jul 2022 13:53:30 +0530 Message-Id: <20220703082419.770989-14-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::42f; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42f.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" Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- target/arm/ptw.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 490a57ec5a..f2e429574d 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1347,7 +1347,7 @@ do_fault: static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - hwaddr *phys_ptr, int *prot, + GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { int n; @@ -1357,12 +1357,12 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address, if (regime_translation_disabled(env, mmu_idx)) { /* MPU disabled. */ - *phys_ptr = address; - *prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; + result->phys = address; + result->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; return false; } - *phys_ptr = address; + result->phys = address; for (n = 7; n >= 0; n--) { base = env->cp15.c6_region[n]; if ((base & 1) == 0) { @@ -1398,16 +1398,16 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address, fi->level = 1; return true; } - *prot = PAGE_READ | PAGE_WRITE; + result->prot = PAGE_READ | PAGE_WRITE; break; case 2: - *prot = PAGE_READ; + result->prot = PAGE_READ; if (!is_user) { - *prot |= PAGE_WRITE; + result->prot |= PAGE_WRITE; } break; case 3: - *prot = PAGE_READ | PAGE_WRITE; + result->prot = PAGE_READ | PAGE_WRITE; break; case 5: if (is_user) { @@ -1415,10 +1415,10 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address, fi->level = 1; return true; } - *prot = PAGE_READ; + result->prot = PAGE_READ; break; case 6: - *prot = PAGE_READ; + result->prot = PAGE_READ; break; default: /* Bad permission. */ @@ -1426,7 +1426,7 @@ static bool get_phys_addr_pmsav5(CPUARMState *env, uint32_t address, fi->level = 1; return true; } - *prot |= PAGE_EXEC; + result->prot |= PAGE_EXEC; return false; } @@ -2421,7 +2421,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address, } else { /* Pre-v7 MPU */ ret = get_phys_addr_pmsav5(env, address, access_type, mmu_idx, - &result->phys, &result->prot, fi); + result, fi); } qemu_log_mask(CPU_LOG_MMU, "PMSA MPU lookup for %s at 0x%08" PRIx32 " mmu_idx %u -> %s (prot %c%c%c)\n",