From patchwork Mon Feb 27 14:00:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 657069 Delivered-To: patch@linaro.org Received: by 2002:adf:a3c6:0:0:0:0:0 with SMTP id m6csp2380564wrb; Mon, 27 Feb 2023 06:27:09 -0800 (PST) X-Google-Smtp-Source: AK7set+prYwn6zF191wkr5Hmg32GmdgYU/+eNmdTsuIa/FtfRDG9f5uwG/4rSG600JHsqZuKcSmL X-Received: by 2002:a05:622a:5:b0:3bf:ca3d:6757 with SMTP id x5-20020a05622a000500b003bfca3d6757mr12354628qtw.66.1677508028856; Mon, 27 Feb 2023 06:27:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677508028; cv=none; d=google.com; s=arc-20160816; b=FMa4Svu9mAZpO8yVtIJzWE163IflPOE2d6qR/AfnDCrATVHG4vxWrncaL4DUDyuxYZ FrEVD/H7X+i7rrwj4YLblGmJejs/oQh9VxiOQ2afPu15hMF3HjErl7bhIETHo5MnaQmr dlqDD9+wKfVljYo8/tbHcCFi9OYW9q9EYir20eahQJ9nZSiisVLkhQymWWvTgBGtDp7E fm+o6WESZPq2MJAHQsh/+yGEVf8WDdMRhKmoUFhsSRCzEECRLAPPRFoIFh/d2RRyxKjS P9vuXv4S5c0B5OfEW30ORA5wztda4vA2upSB1brdqmCDxb9/PGJ4SADDkHlDvdnHTLGS Hlxw== 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=6hrZpnhPLRDXNa3A83fUHvIa4VTeZDIvb4ThTrNTe+A=; b=OvpgkT0EoIF5ihhwimwZbFM4kdV/2qGG1mcML1hFRGeTxkzYsrCXcDH36qhr02Tw9V Y2l5gkbtWgy5d+UVL0vA/D3pB3pzMm7rbctmbXyBB9XJbYw4da3JEj5M7GcPEbCJK2cW /d8T9mvXc40acPD/yiyuEEdjbj8uIDsnC8B/ssHncGe3gODwKZA+lujoSdJDVbdOuVoA /T58c0pRCyiecxsHOAHDqOzHJ+CS9aCgY7nC1vBDH++0sDSZGUfsKEg2z/TkTFnCmPjY vJRzWgfaW1H4yyvMhEGJQpNBEunrvAx4hRFTQNVnyhYev4UZy15YrFOY+uM4g+YlcN8x 91nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Kj1DMvse; 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 a18-20020a05622a02d200b003ba00b95ffesi7065108qtx.529.2023.02.27.06.27.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Feb 2023 06:27:08 -0800 (PST) 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=Kj1DMvse; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pWe4x-0001PH-Dt; Mon, 27 Feb 2023 09:02:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pWe4A-0000ds-Af for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:01:29 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pWe47-0007Xv-Ox for qemu-devel@nongnu.org; Mon, 27 Feb 2023 09:01:21 -0500 Received: by mail-wm1-x336.google.com with SMTP id d41-20020a05600c4c2900b003e9e066550fso3884554wmp.4 for ; Mon, 27 Feb 2023 06:01:19 -0800 (PST) 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:message-id :reply-to; bh=6hrZpnhPLRDXNa3A83fUHvIa4VTeZDIvb4ThTrNTe+A=; b=Kj1DMvseuh3f0ipPcHG5Sto6W8TOREEnezReAJy1Gu/ST4WQINTz8CivgrRvJ2mAQC UWbIDcW7iIOH0R+bfMK+194dJruazsloVtM02w0SodEKNkA+ndkwaiR27ItciFVoJ2lu zDv4FBoDg42h6KD1y9jhDLhd/n8Bx4QhBY6DZOfMXd9TmCCGvYhGOjLySzRXJhFJHuRn tg6B/Y7wAW+fgs1gEtxBHbx5lHrpcn9ofvEag2PIs1xqVL+KlLALDiLoxUKSq+W9fEDo qGCrXUl6UCDZFcbOEg/v4wYfI6iO9c3Zemjqkx1jYHL8R62YkttoRAMpDkb4qf2JN1hZ TLwg== 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:message-id:reply-to; bh=6hrZpnhPLRDXNa3A83fUHvIa4VTeZDIvb4ThTrNTe+A=; b=UAgAHzO/u+XphMdSUxgOWUAHfRgWL2Qk8OsER8mZHE0mYKNSnuLViEAbUhXlOSA6wF s5+P/Y+C5OjXBNpp6JIf3JHCrZd9shDfjtIT7qj1EBoS15h6prlGcAw6Wzgfksj37Qu9 3L6DD1jVPxGEPqFQiZrcTSiws+d/UygjqND4PxbI3SFm+LKUqFZhPuAH7j7Jw3VfoqIx 8ZBHjRjXM1DI8KTCbc9X1HKv85Xo1T+Uk0oDB5rA+YjtAaX5ip73ad7ZAixgI0APtO/r nrzDVobqAgs7YqvXu57LG03iIWlk0thJ7tA7Hf64V9VLnHijk8feP0SyuXPcI/zcOSH3 rsMQ== X-Gm-Message-State: AO0yUKWJgdC9zxP3ZpT2W8Tfc+uFifdaRnAngYr+vIZbOsrdZanFwRnW eOTjY0x5CELLeG06T3+gh3zds3ktTafF+JQW X-Received: by 2002:a7b:c384:0:b0:3ea:d620:570a with SMTP id s4-20020a7bc384000000b003ead620570amr12963128wmj.38.1677506477153; Mon, 27 Feb 2023 06:01:17 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id s9-20020a5d4249000000b002c5598c14acsm7158514wrr.6.2023.02.27.06.01.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Feb 2023 06:01:16 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 09/25] target/arm: Move regime_using_lpae_format into internal.h Date: Mon, 27 Feb 2023 14:00:46 +0000 Message-Id: <20230227140102.3712344-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230227140102.3712344-1-peter.maydell@linaro.org> References: <20230227140102.3712344-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.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-bounces+patch=linaro.org@nongnu.org From: Fabiano Rosas This function is needed by common code (ptw.c), so move it along with the other regime_* functions in internal.h. When we enable the build without TCG, the tlb_helper.c file will not be present. Signed-off-by: Fabiano Rosas Reviewed-by: Richard Henderson Tested-by: Philippe Mathieu-Daudé Signed-off-by: Peter Maydell --- target/arm/internals.h | 21 ++++++++++++++++++--- target/arm/tcg/tlb_helper.c | 18 ------------------ 2 files changed, 18 insertions(+), 21 deletions(-) diff --git a/target/arm/internals.h b/target/arm/internals.h index ed48f8c9a69..680c5747170 100644 --- a/target/arm/internals.h +++ b/target/arm/internals.h @@ -600,9 +600,6 @@ int arm_mmu_idx_to_el(ARMMMUIdx mmu_idx); /* Return the MMU index for a v7M CPU in the specified security state */ ARMMMUIdx arm_v7m_mmu_idx_for_secstate(CPUARMState *env, bool secstate); -/* Return true if the translation regime is using LPAE format page tables */ -bool regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx); - /* * Return true if the stage 1 translation regime is using LPAE * format page tables @@ -767,6 +764,24 @@ static inline uint64_t regime_tcr(CPUARMState *env, ARMMMUIdx mmu_idx) return env->cp15.tcr_el[regime_el(env, mmu_idx)]; } +/* Return true if the translation regime is using LPAE format page tables */ +static inline bool regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx) +{ + int el = regime_el(env, mmu_idx); + if (el == 2 || arm_el_is_aa64(env, el)) { + return true; + } + if (arm_feature(env, ARM_FEATURE_PMSA) && + arm_feature(env, ARM_FEATURE_V8)) { + return true; + } + if (arm_feature(env, ARM_FEATURE_LPAE) + && (regime_tcr(env, mmu_idx) & TTBCR_EAE)) { + return true; + } + return false; +} + /** * arm_num_brps: Return number of implemented breakpoints. * Note that the ID register BRPS field is "number of bps - 1", diff --git a/target/arm/tcg/tlb_helper.c b/target/arm/tcg/tlb_helper.c index 60abcbebe64..31eb77f7df9 100644 --- a/target/arm/tcg/tlb_helper.c +++ b/target/arm/tcg/tlb_helper.c @@ -12,24 +12,6 @@ #include "exec/helper-proto.h" -/* Return true if the translation regime is using LPAE format page tables */ -bool regime_using_lpae_format(CPUARMState *env, ARMMMUIdx mmu_idx) -{ - int el = regime_el(env, mmu_idx); - if (el == 2 || arm_el_is_aa64(env, el)) { - return true; - } - if (arm_feature(env, ARM_FEATURE_PMSA) && - arm_feature(env, ARM_FEATURE_V8)) { - return true; - } - if (arm_feature(env, ARM_FEATURE_LPAE) - && (regime_tcr(env, mmu_idx) & TTBCR_EAE)) { - return true; - } - return false; -} - /* * Returns true if the stage 1 translation regime is using LPAE format page * tables. Used when raising alignment exceptions, whose FSR changes depending