[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v7 08/20] target/arm: Move regime_using_lpae_format into internal
From: |
Fabiano Rosas |
Subject: |
[PATCH v7 08/20] target/arm: Move regime_using_lpae_format into internal.h |
Date: |
Thu, 23 Feb 2023 10:08:29 -0300 |
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>
---
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 ed48f8c9a6..680c574717 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 60abcbebe6..31eb77f7df 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.35.3
- [PATCH v7 00/20] target/arm: Allow CONFIG_TCG=n builds, Fabiano Rosas, 2023/02/23
- [PATCH v7 01/20] target/arm: Wrap breakpoint/watchpoint updates with tcg_enabled, Fabiano Rosas, 2023/02/23
- [PATCH v7 02/20] target/arm: Wrap TCG-only code in debug_helper.c, Fabiano Rosas, 2023/02/23
- [PATCH v7 03/20] target/arm: move translate modules to tcg/, Fabiano Rosas, 2023/02/23
- [PATCH v7 04/20] target/arm: move helpers to tcg/, Fabiano Rosas, 2023/02/23
- [PATCH v7 06/20] target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled, Fabiano Rosas, 2023/02/23
- [PATCH v7 05/20] target/arm: Move psci.c into the tcg directory, Fabiano Rosas, 2023/02/23
- [PATCH v7 07/20] target/arm: Move hflags code into the tcg directory, Fabiano Rosas, 2023/02/23
- [PATCH v7 08/20] target/arm: Move regime_using_lpae_format into internal.h,
Fabiano Rosas <=
- [PATCH v7 09/20] target/arm: Don't access TCG code when debugging with KVM, Fabiano Rosas, 2023/02/23
- [PATCH v7 10/20] cpu-defs.h: Expose CPUTLBEntryFull to non-TCG code, Fabiano Rosas, 2023/02/23
- [PATCH v7 11/20] target/arm: Move cortex sysregs into a separate file, Fabiano Rosas, 2023/02/23
- [PATCH v7 12/20] target/arm: Move 64-bit TCG CPUs into tcg/, Fabiano Rosas, 2023/02/23
- [PATCH v7 14/20] target/arm: move cpu_tcg to tcg/cpu32.c, Fabiano Rosas, 2023/02/23
- [PATCH v7 13/20] target/arm: Move aa32_max_features out of cpu_tcg.c, Fabiano Rosas, 2023/02/23
- [PATCH v7 15/20] tests/avocado: Pass parameters to migration test, Fabiano Rosas, 2023/02/23
- [PATCH v7 16/20] tests/avocado: add machine:none tag to version.py, Fabiano Rosas, 2023/02/23
- [PATCH v7 17/20] arm/Kconfig: Always select SEMIHOSTING when TCG is present, Fabiano Rosas, 2023/02/23
- [PATCH v7 20/20] tests/qtest: Fix tests when no KVM or TCG are present, Fabiano Rosas, 2023/02/23