All of lore.kernel.org
 help / color / mirror / Atom feed
From: Fabiano Rosas <farosas@suse.de>
To: qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Claudio Fontana" <cfontana@suse.de>,
	"Eduardo Habkost" <ehabkost@redhat.com>,
	"Alexander Graf" <agraf@csgraf.de>
Subject: [RFC PATCH v2 17/19] target/arm: Move regime_using_lpae_format into internal.h
Date: Mon,  9 Jan 2023 19:42:30 -0300	[thread overview]
Message-ID: <20230109224232.11661-18-farosas@suse.de> (raw)
In-Reply-To: <20230109224232.11661-1-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>
---
Richard: this cannot into ptw.c because that file is softmmu only
---
 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 865b9e8104..b1fccf13a3 100644
--- a/target/arm/internals.h
+++ b/target/arm/internals.h
@@ -614,9 +614,6 @@ ARMMMUIdx arm_v7m_mmu_idx_for_secstate_and_priv(CPUARMState *env,
 /* 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
@@ -781,6 +778,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



  parent reply	other threads:[~2023-01-09 22:44 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09 22:42 [RFC PATCH v2 00/19] target/arm: Allow CONFIG_TCG=n builds Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 01/19] target/arm: rename handle_semihosting to tcg_handle_semihosting Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 02/19] target/arm: wrap psci call with tcg_enabled Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 03/19] target/arm: wrap call to aarch64_sve_change_el in tcg_enabled() Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 04/19] target/arm: Move PC alignment check Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 05/19] target/arm: Move cpregs code into cpregs.c Fabiano Rosas
2023-01-10  5:37   ` Richard Henderson
2023-01-09 22:42 ` [RFC PATCH v2 06/19] target/arm: Move define_debug_regs() to cpregs.c Fabiano Rosas
2023-01-10  5:41   ` Richard Henderson
2023-01-09 22:42 ` [RFC PATCH v2 07/19] target/arm: Move helper_set_pstate_* into cpregs.c Fabiano Rosas
2023-01-10  5:52   ` Richard Henderson
2023-01-10 13:19     ` Fabiano Rosas
2023-01-10 14:00       ` Peter Maydell
2023-01-11  3:48     ` Richard Henderson
2023-01-09 22:42 ` [RFC PATCH v2 08/19] target/arm: move translate modules to tcg/ Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 09/19] target/arm: move helpers " Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 10/19] target/arm: Move psci.c into the tcg directory Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 11/19] target/arm: Wrap arm_rebuild_hflags calls with tcg_enabled Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 12/19] target/arm: Move hflags code into the tcg directory Fabiano Rosas
2023-01-11 20:29   ` Richard Henderson
2023-01-09 22:42 ` [RFC PATCH v2 13/19] tests: do not run test-hmp on all machines for ARM KVM-only Fabiano Rosas
2023-01-10  8:02   ` Thomas Huth
2023-01-10 13:00     ` Fabiano Rosas
2023-01-10 13:06       ` Peter Maydell
2023-01-10 13:36         ` Fabiano Rosas
2023-01-10 14:02           ` Peter Maydell
2023-01-11 12:08             ` Claudio Fontana
2023-01-11 12:22               ` Thomas Huth
2023-01-11 12:36               ` Fabiano Rosas
2023-01-11 20:30                 ` Richard Henderson
2023-01-12 14:49                   ` Fabiano Rosas
2023-01-12 14:55                 ` Peter Maydell
2023-01-09 22:42 ` [RFC PATCH v2 14/19] tests: do not run qom-test " Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 15/19] tests: device-introspect-test: cope with ARM TCG-only devices Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 16/19] tests/tcg: Do not build/run TCG tests if TCG is disabled Fabiano Rosas
2023-01-09 22:42 ` Fabiano Rosas [this message]
2023-01-11  5:46   ` [RFC PATCH v2 17/19] target/arm: Move regime_using_lpae_format into internal.h Richard Henderson
2023-01-09 22:42 ` [RFC PATCH v2 18/19] cpu-defs.h: Expose CPUTLBEntryFull to non-TCG code Fabiano Rosas
2023-01-09 22:42 ` [RFC PATCH v2 19/19] target/arm: don't access TCG code when debugging with KVM Fabiano Rosas

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=20230109224232.11661-18-farosas@suse.de \
    --to=farosas@suse.de \
    --cc=agraf@csgraf.de \
    --cc=alex.bennee@linaro.org \
    --cc=cfontana@suse.de \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.