qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Fabiano Rosas <farosas@suse.de>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, "Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <philmd@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: Re: [RFC PATCH 14/27] target/arm: Move regime_using_lpae_format into internal.h
Date: Wed, 4 Jan 2023 20:48:23 -0800	[thread overview]
Message-ID: <97f2e3db-79f2-c4a2-f48c-70b4617b7e4d@linaro.org> (raw)
In-Reply-To: <20230104215835.24692-15-farosas@suse.de>

On 1/4/23 13:58, Fabiano Rosas wrote:
> 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.

Maybe better to just move to ptw.c?


r~

> 
> Signed-off-by: Fabiano Rosas <farosas@suse.de>
> ---
>   target/arm/internals.h  | 17 ++++++++++++++---
>   target/arm/tlb_helper.c | 14 --------------
>   2 files changed, 14 insertions(+), 17 deletions(-)
> 
> diff --git a/target/arm/internals.h b/target/arm/internals.h
> index 161e42d50f..3493b5cc88 100644
> --- a/target/arm/internals.h
> +++ b/target/arm/internals.h
> @@ -610,9 +610,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
> @@ -777,6 +774,20 @@ 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_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/tlb_helper.c b/target/arm/tlb_helper.c
> index 0f4f4fc809..31eb77f7df 100644
> --- a/target/arm/tlb_helper.c
> +++ b/target/arm/tlb_helper.c
> @@ -12,20 +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_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



  reply	other threads:[~2023-01-05  4:49 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 21:58 [RFC PATCH 00/27] target/arm: Allow CONFIG_TCG=n builds Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 01/27] target/arm: Fix checkpatch comment style warnings in helper.c Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 02/27] target/arm: Fix checkpatch space errors " Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 03/27] target/arm: Fix checkpatch brace " Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 04/27] target/arm: Remove unused includes from m_helper.c Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 05/27] target/arm: Remove unused includes from helper.c Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 06/27] target/arm: cleanup cpu includes Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 07/27] target/arm: rename handle_semihosting to tcg_handle_semihosting Fabiano Rosas
2023-01-04 22:22   ` Philippe Mathieu-Daudé
2023-01-04 21:58 ` [RFC PATCH 08/27] target/arm: wrap psci call with tcg_enabled Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 09/27] target/arm: wrap call to aarch64_sve_change_el in tcg_enabled() Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 10/27] target/arm: Move PC alignment check Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 11/27] target/arm: only perform TCG cpu and machine inits if TCG enabled Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 12/27] target/arm: Add tcg/meson.build Fabiano Rosas
2023-01-04 22:23   ` Philippe Mathieu-Daudé
2023-01-04 21:58 ` [RFC PATCH 13/27] target/arm: move translate modules to tcg/ Fabiano Rosas
2023-01-04 22:24   ` Philippe Mathieu-Daudé
2023-01-04 21:58 ` [RFC PATCH 14/27] target/arm: Move regime_using_lpae_format into internal.h Fabiano Rosas
2023-01-05  4:48   ` Richard Henderson [this message]
2023-01-04 21:58 ` [RFC PATCH 15/27] target/arm: move helpers to tcg/ Fabiano Rosas
2023-01-05  4:49   ` Richard Henderson
2023-01-04 21:58 ` [RFC PATCH 16/27] target/arm: only build psci for TCG Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 17/27] target/arm: Extract cpustate list manipulation to a file Fabiano Rosas
2023-01-05  4:55   ` Richard Henderson
2023-01-04 21:58 ` [RFC PATCH 18/27] target/arm: Move cpregs code out of cpu.h Fabiano Rosas
2023-01-05  4:55   ` Richard Henderson
2023-01-04 21:58 ` [RFC PATCH 19/27] target/arm: Move common cpregs code into a separate file Fabiano Rosas
2023-01-05  4:58   ` Richard Henderson
2023-01-05 13:12     ` Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 20/27] target/arm: Move cpregs definitions into tcg/cpregs.c Fabiano Rosas
2023-01-05  5:02   ` Richard Henderson
2023-01-04 21:58 ` [RFC PATCH 21/27] target/arm: make further preparation for the exception code to move Fabiano Rosas
2023-01-05  5:02   ` Richard Henderson
2023-01-04 21:58 ` [RFC PATCH 22/27] target/arm: Move hflags code into the tcg directory Fabiano Rosas
2023-01-05  5:09   ` Richard Henderson
2023-01-04 21:58 ` [RFC PATCH 23/27] tests: do not run test-hmp on all machines for ARM KVM-only Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 24/27] tests: do not run qom-test " Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 25/27] tests: device-introspect-test: cope with ARM TCG-only devices Fabiano Rosas
2023-01-04 21:58 ` [RFC PATCH 26/27] cpu-defs.h: Expose CPUTLBEntryFull to non-TCG code Fabiano Rosas
2023-01-05  5:12   ` Richard Henderson
2023-01-05  5:16   ` Richard Henderson
2023-01-04 21:58 ` [RFC PATCH 27/27] target/arm: don't access TCG code when debugging with KVM Fabiano Rosas
2023-01-05  5:19   ` Richard Henderson

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=97f2e3db-79f2-c4a2-f48c-70b4617b7e4d@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=agraf@csgraf.de \
    --cc=alex.bennee@linaro.org \
    --cc=cfontana@suse.de \
    --cc=ehabkost@redhat.com \
    --cc=farosas@suse.de \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@linaro.org \
    --cc=qemu-arm@nongnu.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).