From patchwork Thu Sep 22 16:35:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 608252 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp504971pvb; Thu, 22 Sep 2022 11:33:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4rgASJlMC7Exy5eWTSVR/HUWU4eERXSE1g5saqXU8+0oMgfZ33b4WRVfync6xY0z/HljAS X-Received: by 2002:a05:622a:5d1:b0:35d:b68:f735 with SMTP id d17-20020a05622a05d100b0035d0b68f735mr3994142qtb.563.1663871582513; Thu, 22 Sep 2022 11:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663871582; cv=none; d=google.com; s=arc-20160816; b=mpkFJx1LP724Fi7pdtWSxFzLWKRfkTQfIRa5Ef5M0SAoN23HWwFa/WP+HNmqU3xAJs aaERJzbLhLZ3CM/1+o3CBlrGZun+gmEE4oju1QC6MTt1Fv1MOzDDMh3SR+st+d7sXvDs 9b3L3EZbZl0gByGkv3PpGFvnYJ0SxH0w/ooT083fOQm5LfMUm9CvdEj/PaecpLM4hLFO NJRA67SUU8t4qbWmNmzMq20nFITaPubLrTppCSk5DYDI5ik5ZsarG3bBIoCjqRVfdUfZ g4bNofL6dky9mrDJUqTEJq108meTsen/IGlBXqdMo6dSUPeOVsjYFYIVF8nBBsQU5/qz pRMA== 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=lW/oPgeXhT91EvmbPc8n7WToY6I3Ebq62IKaIqyShd4=; b=qL0aYkF/WYltGBjjAyPiuEDzw9A2T9spI4FMB1EqBWX7zk2dZSLUWTBfHK2SFxg14m 892MPe0ZB7wiT1eAVaH7142iyFNXumRPsAhlmkDu8rP4VAoU5eoYiAgWWSYXb3xfr9mU oBo4BsDlx4D9pZW0UHXRJ16DBP+CATVwcoEvhgTiLMzbPOMs9EF/wawNpM6SCXBik82X wTt6ZCKm8Rd1SPOivkzLIJt7l0utaQPWzuEbwED0C7d2yhA1WO2ZvwfobzZ2DWSLmdq6 at/JHBcXIzqlXOdL5yM9LP1y/ZdvANoC5CQ1LvTXJYbb1aamDI+N2uGrFkQUGCiAKxoe fDyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=peDWqQoc; 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 o78-20020a374151000000b006b9975e57e7si3522204qka.251.2022.09.22.11.33.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 22 Sep 2022 11:33:02 -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=peDWqQoc; 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]:33746 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1obR0P-00083B-QH for patch@linaro.org; Thu, 22 Sep 2022 14:33:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1obPAy-0002AR-0g for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:49 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:50851) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1obPAw-0005P1-3L for qemu-devel@nongnu.org; Thu, 22 Sep 2022 12:35:47 -0400 Received: by mail-wm1-x331.google.com with SMTP id ay36so7182404wmb.0 for ; Thu, 22 Sep 2022 09:35:45 -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=lW/oPgeXhT91EvmbPc8n7WToY6I3Ebq62IKaIqyShd4=; b=peDWqQocGLGZep/lcTPq1KX6yj0bbg0iOBdiAiyhuFmh7kkLze7/32YHja7YPGo+Xl /hn5t4SHEPMRAIgt242G2HO4gm99IcTJYhqKbKZSo4I+/KwfgTnPE0BB/aGSLanjjucr rVtvKf5yzOLfObCbs0OKFptV2CXTp1dnMhuR2W7CgBNbFpfy1B/2xNRhL5SajV6Udf5f EkEHZ/QwuIuA+PBiLIMASLZ5EuYjAhqjfD4kbGLNxsqrfeJ3j7Adlh/aSEf1cg/dHeAe cI9PTCbv7YLdyD3cb1uT31l6pfV3LKz3hCd77zvyi+GgEZch7xNzBgXEyM5II0eD6xrq QHyA== 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=lW/oPgeXhT91EvmbPc8n7WToY6I3Ebq62IKaIqyShd4=; b=fJMl0l2Wd8awiGj6Am50lVRe0mQEo9dNd6i5if8RCloZeq9G9nlJt/eySg2Vud/pOX HLMQIRGsWzgj6CyzdnqkW6TIVU7RwpL95dJMkOkC5a4NQZcXQFaKRMZW3ZCEbCNBPiNK IX4aD2oW7f25IBxCyb/wFxoGYNndhOxQzvNCrW31K8S+DqIqBoNjXNuvZQdSjukxRciK zKiE425px9e6XNer47hEYBS3Cz9xIC/J8E+YN/NvrhgVltJcLL80oXMDzDCrGRdvMXBW /ZUGKjIcbnU9ju2TVFEcq89ZYMLik0wPOB5ctpyBjakF85k8xtxh7e1pbV1M7kFCP1oe 5sKg== X-Gm-Message-State: ACrzQf02Rk/VCkLXJVJSk0r7P92QBkRxON/xU3o7mPK16NXsLjO54i5f A8gNWzyrGe+xU38II6eqz/j0/3lQ4OuXww== X-Received: by 2002:a7b:c4c8:0:b0:3b4:76c8:da4f with SMTP id g8-20020a7bc4c8000000b003b476c8da4fmr9699947wmk.63.1663864544604; Thu, 22 Sep 2022 09:35:44 -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.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Sep 2022 09:35:44 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/39] target/arm: Use GetPhysAddrResult in get_phys_addr_pmsav8 Date: Thu, 22 Sep 2022 17:35:06 +0100 Message-Id: <20220922163536.1096175-10-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::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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-9-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- 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 36b108907fc..2286f6e12db 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -1967,8 +1967,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); @@ -2003,9 +2002,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 { @@ -2015,7 +2014,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. @@ -2028,17 +2027,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; } @@ -2416,8 +2417,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,