From patchwork Thu Sep 22 16:35:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 608224 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp447754pvb; Thu, 22 Sep 2022 09:41:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4OgpTNLntmxkQ2ALC1zzb94Or06ReLUnB2xV94WGfJ79o9V8jRwlWG8Nog51hYb+yvwrS8 X-Received: by 2002:a05:622a:54f:b0:35c:f68f:44c3 with SMTP id m15-20020a05622a054f00b0035cf68f44c3mr3577011qtx.546.1663864884435; Thu, 22 Sep 2022 09:41:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663864884; cv=none; d=google.com; s=arc-20160816; b=Z510lqn8yfNUp3Xut3nXEfqg5UlIPgLJtyqbeiE0AJJJlatNm/FW9AJ77KuRkCVMjt x8wikUrsJSZKkqj6DLGSV9bWqOFcnQViCRW9bmoyNlUculsp97UbGO9+cXVUt4JCEaRj RyNB7JSAO3PG8XHZwxR1fwF+GR+lMVzN9xPXDSKfx4dEEyH/g0KTR+ePQwrW+VXGpvfT gQMoTjM0NJ/HgkJ6h5zwuVn9FcN0PJRwnDJnjVGffxC3m7WkBNx72k9ohK4u+N3gRDPQ KxiaAjz9h3t449//ZxcBAgo/rfv1c7tKfxFYHi8zRRg6EcS8jA2TaXJa42qtgXIi/LWP i2vA== 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:to:from :dkim-signature; bh=o5zeYSJg5vCaz9F7elm+Lb7yX0lwKPPrfwrGwePP0L0=; b=P33DYj4XE+Fl3RN9txtGYo604OgBIDmIR8TlCNNYsNqtu4sBj+oJK+vAMVDLnSAgg8 JyMM+vTOvSwH7LxdqYcu3ym73ezhI1NBEk8sSjyL2oln1aQioh7tQVFtxLB4a5lwRPmz tdaBJsfa0W11xjjZEqUXFA/7N5rYugj5UHZvEcWjxWqfpVWh2SFUZsffer0j3/61yEz+ 3BKi7VqKP0Y23ZzVCCCzcexZKb5jiKgWkHIEnrkAEWZqJeZ4eFwEvWBbkI+DkYb3cvo2 z6eYA/7toHjCNpiQVjVyjYTF20BkZhRkKfrk9YT8JLsQu+gJKvsxYfmlBvkPTxxf9BRh WDmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pClGnQWn; 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 ay2-20020a05622a228200b00344dbd8760bsi3569612qtb.667.2022.09.22.09.41.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Sep 2022 09:41:24 -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=pClGnQWn; 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]:37496 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obPGN-0004Pn-Co for patch@linaro.org; Thu, 22 Sep 2022 12:41:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAw-0002AN-JZ for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:48 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:35656) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAu-0005Oi-OO for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:46 -0400 Received: by mail-wm1-x32c.google.com with SMTP id r133-20020a1c448b000000b003b494ffc00bso1729065wma.0 for ; Thu, 22 Sep 2022 09:35:44 -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:to:from:from:to:cc:subject:date; bh=o5zeYSJg5vCaz9F7elm+Lb7yX0lwKPPrfwrGwePP0L0=; b=pClGnQWnxKSJRIXzNXziopG1TS2foJc+Ju1mUf4fmsTg7SERjUe7FeBY71TLpSW4T5 +YO+p7Z3xXpxBnluGjylLpWWBmJNtrsXsCxSHeGxpF4iFGAzse7MERf5OJlO3wBvHyTg SAsjiLr6fAU/DcySJHnsTFvWFQb+CXUk/SYarxK5kMd8zoQwCZOi2dpU1peGrayPeLaY AIhPao8WvU3wfMOx5Bq4ST/CGjnkbVL8ccRohzXe1PACoRqRzh8py9rhyDMhxttuY9Wy VtYW9xQUP11Z9acy365btxPXIPlheNMD2XHxFxn8obrEr5jkT/a7u5BL2XhWhnyGZIMu oKXQ== 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:to:from:x-gm-message-state:from:to:cc :subject:date; bh=o5zeYSJg5vCaz9F7elm+Lb7yX0lwKPPrfwrGwePP0L0=; b=SMpGHexryiRKlC+Kqk5BNYkEDM52tCrpnnxFarlGNVHLHaIjfvOzQo9MkJUmg/SGCe nqjyjQhLeHLOJW8NHXRLVIJyKdEL0tYOVAUX2MBmaZxXRMLznIBo345730/Qi9Qo9vqA wKjTIrNt+/Kh49rECoZhw8v/DYmgYmFckdRYBpf1a/vBJUkIf+4gVcJBq2zqcgMbRr5K NCTcgGfKlWuphuB306XyVOEr5U/jvtRSSuSjPYJ79pRvffNz/3y56cp9cwjbW6nTfTEg OMdNS+dSet5Oglc0V034GueF2tuT+zJt5JPvVWa1gYkBKPjVjfRk3aAXOu9KUIlX/gwI BBIw== X-Gm-Message-State: ACrzQf2yhAAoGJBy2JGdiR5mvA+EA93Gk7hFJ9u9ne+hr0lY1ku2wX6c kCKZAR2g1tC7uFu5dfuMQVpz8lRKt0RSyQ== X-Received: by 2002:a05:600c:350f:b0:3b4:c5f2:4295 with SMTP id h15-20020a05600c350f00b003b4c5f24295mr3097609wmq.200.1663864543226; Thu, 22 Sep 2022 09:35:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id iw1-20020a05600c54c100b003b3401f1e24sm6452599wmb.28.2022.09.22.09.35.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:42 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav5 Date: Thu, 22 Sep 2022 17:35:04 +0100 Message-Id: <20220922163536.1096175-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220922163536.1096175-1-peter.maydell@linaro.org> References: <20220922163536.1096175-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32c; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32c.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 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" From: Richard Henderson Reviewed-by: Alex Bennée Signed-off-by: Richard Henderson Message-id: 20220822152741.1617527-7-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- 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 4e2476278e1..70abcce81f9 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1351,7 +1351,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; @@ -1361,12 +1361,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) { @@ -1402,16 +1402,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) { @@ -1419,10 +1419,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. */ @@ -1430,7 +1430,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; } @@ -2427,7 +2427,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",