From: Peter Maydell <peter.maydell@linaro.org>
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 [thread overview]
Message-ID: <20230227140102.3712344-10-peter.maydell@linaro.org> (raw)
In-Reply-To: <20230227140102.3712344-1-peter.maydell@linaro.org>
From: Fabiano Rosas <farosas@suse.de>
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 <farosas@suse.de>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Tested-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
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
--
2.34.1
next prev parent reply other threads:[~2023-02-27 14:27 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-27 14:00 [PULL 00/25] target-arm queue Peter Maydell
2023-02-27 14:00 ` [PULL 01/25] include/hw/arm/allwinner-a10.h: Remove superfluous includes from the header Peter Maydell
2023-02-27 14:00 ` [PULL 02/25] target/arm: Wrap breakpoint/watchpoint updates with tcg_enabled Peter Maydell
2023-02-27 14:00 ` [PULL 03/25] target/arm: Wrap TCG-only code in debug_helper.c Peter Maydell
2023-02-27 14:00 ` [PULL 04/25] target/arm: move translate modules to tcg/ Peter Maydell
2023-02-27 14:00 ` [PULL 05/25] target/arm: move helpers " Peter Maydell
2023-02-27 14:00 ` [PULL 06/25] target/arm: Move psci.c into the tcg directory Peter Maydell
2023-02-27 14:00 ` [PULL 07/25] target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled Peter Maydell
2023-02-27 14:00 ` [PULL 08/25] target/arm: Move hflags code into the tcg directory Peter Maydell
2023-02-27 14:00 ` Peter Maydell [this message]
2023-02-27 14:00 ` [PULL 10/25] target/arm: Don't access TCG code when debugging with KVM Peter Maydell
2023-02-27 14:00 ` [PULL 11/25] cpu-defs.h: Expose CPUTLBEntryFull to non-TCG code Peter Maydell
2023-02-27 14:00 ` [PULL 12/25] tests/avocado: add machine:none tag to version.py Peter Maydell
2023-02-27 14:00 ` [PULL 13/25] hw/gpio/max7310: Simplify max7310_realize() Peter Maydell
2023-02-27 14:00 ` [PULL 14/25] hw/char/pl011: Un-inline pl011_create() Peter Maydell
2023-02-27 14:00 ` [PULL 15/25] hw/char/pl011: Open-code pl011_luminary_create() Peter Maydell
2023-02-27 14:00 ` [PULL 16/25] hw/char/xilinx_uartlite: Expose XILINX_UARTLITE QOM type Peter Maydell
2023-02-27 14:00 ` [PULL 17/25] hw/char/xilinx_uartlite: Open-code xilinx_uartlite_create() Peter Maydell
2023-02-27 14:00 ` [PULL 18/25] hw/char/cmsdk-apb-uart: Open-code cmsdk_apb_uart_create() Peter Maydell
2023-02-27 14:00 ` [PULL 19/25] hw/timer/cmsdk-apb-timer: Remove unused 'qdev-properties.h' header Peter Maydell
2023-02-27 14:00 ` [PULL 20/25] hw/intc/armv7m_nvic: Use QOM cast CPU() macro Peter Maydell
2023-02-27 14:00 ` [PULL 21/25] hw/arm/musicpal: Remove unused dummy MemoryRegion Peter Maydell
2023-02-27 14:00 ` [PULL 22/25] iothread: Remove unused IOThreadClass / IOTHREAD_CLASS Peter Maydell
2023-02-27 14:01 ` [PULL 23/25] hw/irq: Declare QOM macros using OBJECT_DECLARE_SIMPLE_TYPE() Peter Maydell
2023-02-27 14:01 ` [PULL 24/25] hw/or-irq: " Peter Maydell
2023-02-27 14:01 ` [PULL 25/25] hw: Replace qemu_or_irq typedef by OrIRQState Peter Maydell
2023-02-27 16:18 ` [PULL 00/25] target-arm queue Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230227140102.3712344-10-peter.maydell@linaro.org \
--to=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).