[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 24/28] target/arm: Move regime_ttbr to ptw.c
From: |
Richard Henderson |
Subject: |
[PATCH 24/28] target/arm: Move regime_ttbr to ptw.c |
Date: |
Fri, 3 Jun 2022 21:06:03 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/arm/ptw.h | 1 -
target/arm/helper.c | 16 ----------------
target/arm/ptw.c | 16 ++++++++++++++++
3 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/target/arm/ptw.h b/target/arm/ptw.h
index 3d3061a435..ed152ddaf4 100644
--- a/target/arm/ptw.h
+++ b/target/arm/ptw.h
@@ -12,7 +12,6 @@
#ifndef CONFIG_USER_ONLY
bool regime_translation_disabled(CPUARMState *env, ARMMMUIdx mmu_idx);
-uint64_t regime_ttbr(CPUARMState *env, ARMMMUIdx mmu_idx, int ttbrn);
#endif /* !CONFIG_USER_ONLY */
#endif /* TARGET_ARM_PTW_H */
diff --git a/target/arm/helper.c b/target/arm/helper.c
index 568e02c5dc..07b4f7bcc5 100644
--- a/target/arm/helper.c
+++ b/target/arm/helper.c
@@ -10439,22 +10439,6 @@ bool regime_translation_disabled(CPUARMState *env,
ARMMMUIdx mmu_idx)
return (regime_sctlr(env, mmu_idx) & SCTLR_M) == 0;
}
-/* Return the TTBR associated with this translation regime */
-uint64_t regime_ttbr(CPUARMState *env, ARMMMUIdx mmu_idx, int ttbrn)
-{
- if (mmu_idx == ARMMMUIdx_Stage2) {
- return env->cp15.vttbr_el2;
- }
- if (mmu_idx == ARMMMUIdx_Stage2_S) {
- return env->cp15.vsttbr_el2;
- }
- if (ttbrn == 0) {
- return env->cp15.ttbr0_el[regime_el(env, mmu_idx)];
- } else {
- return env->cp15.ttbr1_el[regime_el(env, mmu_idx)];
- }
-}
-
/* Convert a possible stage1+2 MMU index into the appropriate
* stage 1 MMU index
*/
diff --git a/target/arm/ptw.c b/target/arm/ptw.c
index 8db4b5edf1..dc559e6bdf 100644
--- a/target/arm/ptw.c
+++ b/target/arm/ptw.c
@@ -75,6 +75,22 @@ static bool regime_is_user(CPUARMState *env, ARMMMUIdx
mmu_idx)
}
}
+/* Return the TTBR associated with this translation regime */
+static uint64_t regime_ttbr(CPUARMState *env, ARMMMUIdx mmu_idx, int ttbrn)
+{
+ if (mmu_idx == ARMMMUIdx_Stage2) {
+ return env->cp15.vttbr_el2;
+ }
+ if (mmu_idx == ARMMMUIdx_Stage2_S) {
+ return env->cp15.vsttbr_el2;
+ }
+ if (ttbrn == 0) {
+ return env->cp15.ttbr0_el[regime_el(env, mmu_idx)];
+ } else {
+ return env->cp15.ttbr1_el[regime_el(env, mmu_idx)];
+ }
+}
+
static bool ptw_attrs_are_device(CPUARMState *env, ARMCacheAttrs cacheattrs)
{
/*
--
2.34.1
- [PATCH 12/28] target/arm: Move m_is_{ppb,system}_region to ptw.c, (continued)
- [PATCH 12/28] target/arm: Move m_is_{ppb,system}_region to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 16/28] target/arm: Move arm_{ldl,ldq}_ptw to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 17/28] target/arm: Move {arm_s1_, }regime_using_lpae_format to tlb_helper.c, Richard Henderson, 2022/06/04
- [PATCH 18/28] target/arm: Move arm_pamax, pamax_map into ptw.c, Richard Henderson, 2022/06/04
- [PATCH 20/28] target/arm: Move check_s2_mmu_setup to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 15/28] target/arm: Move get_phys_addr_lpae to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 19/28] target/arm: Move get_S1prot, get_S2prot to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 21/28] target/arm: Move aa32_va_parameters to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 22/28] target/arm: Move ap_to_tw_prot etc to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 23/28] target/arm: Move regime_is_user to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 24/28] target/arm: Move regime_ttbr to ptw.c,
Richard Henderson <=
- [PATCH 25/28] target/arm: Move regime_translation_disabled to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 26/28] target/arm: Move arm_cpu_get_phys_page_attrs_debug to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 27/28] target/arm: Move stage_1_mmu_idx, arm_stage1_mmu_idx to ptw.c, Richard Henderson, 2022/06/04
- [PATCH 28/28] target/arm: Pass CPUARMState to arm_ld[lq]_ptw, Richard Henderson, 2022/06/04
- Re: [PATCH 00/28] target/arm: Split out ptw.c from helper.c, Peter Maydell, 2022/06/07