From patchwork Sat Jun 4 04:05:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 578738 Delivered-To: patch@linaro.org Received: by 2002:a05:7000:5806:0:0:0:0 with SMTP id j6csp2137304max; Fri, 3 Jun 2022 21:19:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnnfsToz6ioYDF8ye92tf8rmwYjj+qOgoWnm9YkFNmu09yG6CSAVfkqUJC9hVOUL/bNAoQ X-Received: by 2002:ac8:5c96:0:b0:2f9:3077:5cda with SMTP id r22-20020ac85c96000000b002f930775cdamr10782705qta.625.1654316393348; Fri, 03 Jun 2022 21:19:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654316393; cv=none; d=google.com; s=arc-20160816; b=Q+cf/xRkXzlBksX7r4y7RuMKoXpj11aaJigexKdgrZEkMUlO5JgDg++K6DFrffohKh sHk4tCUICzHgF0jlFDmTkpJb928u1M0re8ChzIRZt30nypbCq/SJrBbJuKxuIGGj5usB nSJ74VwzBTQUStzTWlwzJsHoqIuCxdo1ZbHn7CnIPb89vkYPmBI2o/+Qm7eN5Fs0Bazw 0mTGFjk/Q+nYFhQ6PSqU2rT6YfvI+a0Z75h2H61RLaKLbKNT0apGTmLyog6z1uyuUgFw fqqHVKHtEJjqYI/mq46++ot7R24iPwFrGaC/oBjyvEkGO8Xx7gHGps9qBwZADfjMluah ZYuw== 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=e3tM2x5Geh/0C+lNtCDw6ji3/cajAOAo6f5xAef+ZfI=; b=K9NvC3GmriQTVm1P6Uxh/TBQIoVFU9ofxAplFtxznKT4tcrTWeu55rVWtOmZdDD8VG AZqlPFVYtle11Gibu6jNDS38jzOwSy35zClqNHT7qVqxwhU8Z7jw0flcfi7IhLE1jdlx lc2TSeiQQ9/q36avW26glAP4Qb7nky4rHvPJPyHNSryYV//q6l6TXUUlv0YAzF7iZmJC 9984KShBF2BrTzzmdTL5vwyxmQlVBL8HKrybmSVZRlrt0wPRtVgBAdcd4p1rjCxGUCnv cIaegxgcIy4sDa2UX8eVd3bIGTcqpeHwAPk6U6IzWIQNY+aL7lzm5j8B/1E8T1HbK7L3 M2kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pXy8v+mO; 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 m20-20020a05620a291400b006a649805405si4156376qkp.710.2022.06.03.21.19.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 03 Jun 2022 21:19:53 -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=pXy8v+mO; 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]:44974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nxLGS-0003U2-UM for patch@linaro.org; Sat, 04 Jun 2022 00:19:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nxL3P-0007rL-Kx for qemu-devel@nongnu.org; Sat, 04 Jun 2022 00:06:23 -0400 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]:46639) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nxL3N-00007F-MO for qemu-devel@nongnu.org; Sat, 04 Jun 2022 00:06:23 -0400 Received: by mail-pl1-x62c.google.com with SMTP id w3so8084941plp.13 for ; Fri, 03 Jun 2022 21:06:21 -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=e3tM2x5Geh/0C+lNtCDw6ji3/cajAOAo6f5xAef+ZfI=; b=pXy8v+mODdY6WcFaeuftszjQsCRkZfg+JbZHfB+GfwWhU6GaVE4yTRS4fCt06MwQYm /XPK54LIeLckdnQpVokmBuiJSiqZMv2ulSuPDy7el83Equ2vH1WVNw7qWwqaRZGwUduA HMfp+FT0tPALxDBxkowV1FvnsCnim3SJ3yFUw/vkAsMf+zWHBqozf00TWLX2rCBOzJCr drwPYYGaVEjAhjUfbfBBiukFVsNVfzJMAzLZgcaYkMFVyoIi7r4iHYRYf3eJSLGyi54i lFqzt8UkKgwqiphI9uD91sLYgOeCDqWsMRpWjN/LYvMHxqAt++gPnaDgombqMQe44kOU kNNw== 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=e3tM2x5Geh/0C+lNtCDw6ji3/cajAOAo6f5xAef+ZfI=; b=I6DvQRQ+YABycOoY7YNyueehjRsM6ZYg+KvOGYEW+02D9VGyyaJZlPwZZrdXD0JMal qElkixsGVBsFpp3CRVeqK5Mc/aZZcL/ARswFm0z3GQOXBhrSTc71Se7ksNBJdp7L83JV MfchFEcai6mlGWfcd5ONVhUv30AigmhAYwgMACPbRN5tXPDSc6/4rQuhNy8JSrUyAgkJ WfjNyEFblZRvqk49YvQ5IlhJ9v1LU6QWVUckunlwOwwRsb41kL8TpPXwKAHBZb+Zg1vH OlG92Pdl9MshX/zYtuWk0SImyUTlf8FFUD53wljVytTEhXmPDMNu7F35d7N1ctCpoVlL IRUw== X-Gm-Message-State: AOAM530lU8bFkD+y0rxG2bM3udNh2tXBQ7U73utcWo0zdVk1+5pLXBmV vXCQoEGNqLPCtBFS3ZdcIDn/tuP6ywJUvA== X-Received: by 2002:a17:902:b703:b0:158:2667:7447 with SMTP id d3-20020a170902b70300b0015826677447mr12871233pls.92.1654315580425; Fri, 03 Jun 2022 21:06:20 -0700 (PDT) Received: from stoup.. ([2602:ae:1547:e101:3286:cc26:3d5e:3f94]) by smtp.gmail.com with ESMTPSA id a37-20020a631a65000000b003c14af50626sm6093779pgm.62.2022.06.03.21.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 21:06:20 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 12/28] target/arm: Move m_is_{ppb,system}_region to ptw.c Date: Fri, 3 Jun 2022 21:05:51 -0700 Message-Id: <20220604040607.269301-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220604040607.269301-1-richard.henderson@linaro.org> References: <20220604040607.269301-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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 --- target/arm/ptw.h | 3 --- target/arm/helper.c | 15 --------------- target/arm/ptw.c | 16 ++++++++++++++++ 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/target/arm/ptw.h b/target/arm/ptw.h index d2d2711908..6c47a57599 100644 --- a/target/arm/ptw.h +++ b/target/arm/ptw.h @@ -33,9 +33,6 @@ simple_ap_to_rw_prot(CPUARMState *env, ARMMMUIdx mmu_idx, int ap) return simple_ap_to_rw_prot_is_user(ap, regime_is_user(env, mmu_idx)); } -bool m_is_ppb_region(CPUARMState *env, uint32_t address); -bool m_is_system_region(CPUARMState *env, uint32_t address); - bool get_phys_addr_lpae(CPUARMState *env, uint64_t address, MMUAccessType access_type, ARMMMUIdx mmu_idx, bool s1_is_el0, diff --git a/target/arm/helper.c b/target/arm/helper.c index 52655bbdf1..937971730c 100644 --- a/target/arm/helper.c +++ b/target/arm/helper.c @@ -11641,21 +11641,6 @@ do_fault: return true; } -bool m_is_ppb_region(CPUARMState *env, uint32_t address) -{ - /* True if address is in the M profile PPB region 0xe0000000 - 0xe00fffff */ - return arm_feature(env, ARM_FEATURE_M) && - extract32(address, 20, 12) == 0xe00; -} - -bool m_is_system_region(CPUARMState *env, uint32_t address) -{ - /* True if address is in the M profile system region - * 0xe0000000 - 0xffffffff - */ - return arm_feature(env, ARM_FEATURE_M) && extract32(address, 29, 3) == 0x7; -} - /* Combine either inner or outer cacheability attributes for normal * memory, according to table D4-42 and pseudocode procedure * CombineS1S2AttrHints() of ARM DDI 0487B.b (the ARMv8 ARM). diff --git a/target/arm/ptw.c b/target/arm/ptw.c index c15fba43c3..32ba2e5e8b 100644 --- a/target/arm/ptw.c +++ b/target/arm/ptw.c @@ -416,6 +416,22 @@ static void get_phys_addr_pmsav7_default(CPUARMState *env, ARMMMUIdx mmu_idx, } } +static bool m_is_ppb_region(CPUARMState *env, uint32_t address) +{ + /* True if address is in the M profile PPB region 0xe0000000 - 0xe00fffff */ + return arm_feature(env, ARM_FEATURE_M) && + extract32(address, 20, 12) == 0xe00; +} + +static bool m_is_system_region(CPUARMState *env, uint32_t address) +{ + /* + * True if address is in the M profile system region + * 0xe0000000 - 0xffffffff + */ + return arm_feature(env, ARM_FEATURE_M) && extract32(address, 29, 3) == 0x7; +} + static bool pmsav7_use_background_region(ARMCPU *cpu, ARMMMUIdx mmu_idx, bool is_user) {