From patchwork Sun Jul 3 08:23:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 586807 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5036:0:0:0:0 with SMTP id e22csp2916428mab; Sun, 3 Jul 2022 01:39:24 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vO8hfsoEolGkb0JTKfJf6ldvws1fGCTxCIP4CZk5ytCRu7r7xF2hsxYTFLh8GVtyd0eILc X-Received: by 2002:a81:c5:0:b0:317:6551:94e5 with SMTP id 188-20020a8100c5000000b00317655194e5mr27494025ywa.499.1656837564190; Sun, 03 Jul 2022 01:39:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656837564; cv=none; d=google.com; s=arc-20160816; b=PCs8tHzdDNVrj0SY4yTfnx5LNOlNendtD5lKU835iO/R0nuXTAos088+WaRy1Y9v3y 4OotB5A5cPqa60IFun8Nag1BEGvFUhlz1M6qtC0n1BcWfoBut9wUPzG+sx4eNBZIItNq cwpeNSBxVx0cBAS2enRle2EtSCkIOlVYOLD2IqU/SDdVpW2yRMF/AOD6mAVdm/Cibh50 DBTvcOxxtqe43N+2tLlxx400pHw6kgUGagHvqIrjMYrHuK7IMDH+OMftzBBdGBkooIlI XB0wPBs9xplxxUdVxKRcxIf0nB0pkFj0bBIJ0/1dr2bEmnwXUuRzpwSLEjm59yKd+8T7 bXfQ== 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=dcZqPXo79BDZKicxDVav3BkTqxcrjPA4mDAfxWZ855o=; b=RwMSeHCAxEaZWvhRBlmSOi8T7Z0uhFeopyfjqR9ieWOS/XYpgbBYKRgdmZafCTy3g7 QNjF4MtwRHbkmsAXTq5FdwtmgWnT6ixT8/SJ9MpeU1ylKyY+lYafumtN/R4jvWlVL5QQ QCABS9s1aWumt9qZzOdi3XtE3rw8pWZ/X40K7+FyMp6pqCV/7JfQDiM4u8s5NrCx/5+1 r+KXGbhv9Od6gLLFd5FdYBk7ZCqxkTcdKo4+Y7pawRBFd87Udb6A2kseff+fDC13bUfz foi18V3ZU1wK2cYvqW7yFd17kzroC8D+4P7mFynVPyAdDbzh4eODdzAwTHo+RJxthX+w RAAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BGe+4qSE; 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 78-20020a811651000000b0031c803cf4easi4999900yww.194.2022.07.03.01.39.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 03 Jul 2022 01:39: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=BGe+4qSE; 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]:36618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o7v8V-0005ab-L4 for patch@linaro.org; Sun, 03 Jul 2022 04:39:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7uuo-0007RX-0f for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:15 -0400 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]:35617) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o7uum-0005x6-B0 for qemu-devel@nongnu.org; Sun, 03 Jul 2022 04:25:13 -0400 Received: by mail-pl1-x62a.google.com with SMTP id o18so6042291plg.2 for ; Sun, 03 Jul 2022 01:25:11 -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=dcZqPXo79BDZKicxDVav3BkTqxcrjPA4mDAfxWZ855o=; b=BGe+4qSE7i8Zbp3DI2ganWoIpSDNIuGN32FY74HGCSmvd6A1G5i+TpKCvrRqF2lfzl 3tOAKqNb5vwcBF60GrQqXOKs+pFntxJ7+eV7Lcm5tNB35mpPNn27PDTo1mgMafmo1yw/ O2EkCnoGKIsLwAUmYAOgVzIRSCFHN2SSaWYpb2/75iS+1dMxexJEfbOid7bxDgRgrWyh kPXbkbk2gynHoCJhb73N1kg6HZmUEZfaPeEz94LnB1ZoEmHXz1fxlVjqnIM0VLT/neH9 YiYQABDoP/+t2nxh/oNvnHeAKk3rxPah6Hgwcsq9DNAkPikUFAYuXcd6dn+eLsCxDBSa SmvQ== 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=dcZqPXo79BDZKicxDVav3BkTqxcrjPA4mDAfxWZ855o=; b=nE2GcW9eh5Mrv/a+iXEsvJZ1tQU5x8KRHHV/wY7mhMJ1xGk87s9qhZ7cgdCZN9AiRL lA/WwNotIoE1igeUmOJ3SVky3WFZpvQRBqMjflXWi6vLqUl0dAWxJD+JGfsvO3VhCRL9 1ckXqDODXkf6bcNoQ/aIDJsaL/38M3HvUUFg+sJUlCfxvO5RTSE/v3lkyQjhsGv+TJvb DhKEVhMIkEP01gig7vQJnq/lvX1R90bDTSOq13ZqHzQoMcKwOhGZ/RKShLwP0EGEnvna e6sdhymUpW01+CKJU6WHmJgURj8GBBEMz/+4QLCOcW4BptoL9USxMqIY4/2JjevCiE0m 6Sjg== X-Gm-Message-State: AJIora+Tm8nGCJ7EAbkYxvv+/ZoxxYtKq9fnnrJhN2aSYefXjs3WnyNr 5lurToLOeeHe7KEnKzsY6byDqCrIotXDZ7U2 X-Received: by 2002:a17:902:e541:b0:16b:8f8a:3363 with SMTP id n1-20020a170902e54100b0016b8f8a3363mr28575827plf.66.1656836711050; Sun, 03 Jul 2022 01:25:11 -0700 (PDT) Received: from stoup.. ([122.255.60.245]) by smtp.gmail.com with ESMTPSA id im22-20020a170902bb1600b0016a3f9e528asm13569112plb.57.2022.07.03.01.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Jul 2022 01:25:10 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 15/62] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav8 Date: Sun, 3 Jul 2022 13:53:32 +0530 Message-Id: <20220703082419.770989-16-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::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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" Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée --- target/arm/ptw.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/target/arm/ptw.c b/target/arm/ptw.c index 4b69ecb1b9..ef28258d51 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1963,8 +1963,7 @@ void v8m_security_lookup(CPUARMState *env, uint32_t address, static bool get_phys_addr_pmsav8(CPUARMState *env, uint32_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, - hwaddr *phys_ptr, MemTxAttrs *txattrs, - int *prot, target_ulong *page_size, + GetPhysAddrResult *result, ARMMMUFaultInfo *fi) { uint32_t secure = regime_is_secure(env, mmu_idx); @@ -1999,9 +1998,9 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, uint32_t address, } else { fi->type = ARMFault_QEMU_SFault; } - *page_size = sattrs.subpage ? 1 : TARGET_PAGE_SIZE; - *phys_ptr = address; - *prot = 0; + result->page_size = sattrs.subpage ? 1 : TARGET_PAGE_SIZE; + result->phys = address; + result->prot = 0; return true; } } else { @@ -2011,7 +2010,7 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, uint32_t address, * might downgrade a secure access to nonsecure. */ if (sattrs.ns) { - txattrs->secure = false; + result->attrs.secure = false; } else if (!secure) { /* * NS access to S memory must fault. @@ -2024,17 +2023,19 @@ static bool get_phys_addr_pmsav8(CPUARMState *env, uint32_t address, * for M_FAKE_FSR_SFAULT in arm_v7m_cpu_do_interrupt(). */ fi->type = ARMFault_QEMU_SFault; - *page_size = sattrs.subpage ? 1 : TARGET_PAGE_SIZE; - *phys_ptr = address; - *prot = 0; + result->page_size = sattrs.subpage ? 1 : TARGET_PAGE_SIZE; + result->phys = address; + result->prot = 0; return true; } } } - ret = pmsav8_mpu_lookup(env, address, access_type, mmu_idx, phys_ptr, - txattrs, prot, &mpu_is_subpage, fi, NULL); - *page_size = sattrs.subpage || mpu_is_subpage ? 1 : TARGET_PAGE_SIZE; + ret = pmsav8_mpu_lookup(env, address, access_type, mmu_idx, + &result->phys, &result->attrs, &result->prot, + &mpu_is_subpage, fi, NULL); + result->page_size = + sattrs.subpage || mpu_is_subpage ? 1 : TARGET_PAGE_SIZE; return ret; } @@ -2410,8 +2411,7 @@ bool get_phys_addr(CPUARMState *env, target_ulong address, if (arm_feature(env, ARM_FEATURE_V8)) { /* PMSAv8 */ ret = get_phys_addr_pmsav8(env, address, access_type, mmu_idx, - &result->phys, &result->attrs, - &result->prot, &result->page_size, fi); + result, fi); } else if (arm_feature(env, ARM_FEATURE_V7)) { /* PMSAv7 */ ret = get_phys_addr_pmsav7(env, address, access_type, mmu_idx,