[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 6/7] target/arm: Honor the HCR_EL2.TPU bit
From: |
Peter Maydell |
Subject: |
Re: [PATCH v3 6/7] target/arm: Honor the HCR_EL2.TPU bit |
Date: |
Tue, 25 Feb 2020 11:56:33 +0000 |
On Tue, 18 Feb 2020 at 19:10, Richard Henderson
<address@hidden> wrote:
>
> This bit traps EL1 access to cache maintenance insns that operate
> to the point of unification. There are no longer any references to
> plain aa64_cacheop_access, so remove it.
>
> Signed-off-by: Richard Henderson <address@hidden>
> ---
> target/arm/helper.c | 53 +++++++++++++++++++++++++++------------------
> 1 file changed, 32 insertions(+), 21 deletions(-)
>
> diff --git a/target/arm/helper.c b/target/arm/helper.c
> index ed34d4200f..21ee9cf7de 100644
> --- a/target/arm/helper.c
> +++ b/target/arm/helper.c
> @@ -4301,19 +4301,6 @@ static const ARMCPRegInfo uao_reginfo = {
> .readfn = aa64_uao_read, .writefn = aa64_uao_write
> };
>
> -static CPAccessResult aa64_cacheop_access(CPUARMState *env,
> - const ARMCPRegInfo *ri,
> - bool isread)
> -{
> - /* Cache invalidate/clean: NOP, but EL0 must UNDEF unless
> - * SCTLR_EL1.UCI is set.
> - */
> - if (arm_current_el(env) == 0 && !(arm_sctlr(env, 0) & SCTLR_UCI)) {
> - return CP_ACCESS_TRAP;
> - }
> - return CP_ACCESS_OK;
> -}
> -
> static CPAccessResult aa64_cacheop_poc_access(CPUARMState *env,
> const ARMCPRegInfo *ri,
> bool isread)
> @@ -4336,6 +4323,28 @@ static CPAccessResult
> aa64_cacheop_poc_access(CPUARMState *env,
> return CP_ACCESS_OK;
> }
>
> +static CPAccessResult aa64_cacheop_pou_access(CPUARMState *env,
> + const ARMCPRegInfo *ri,
> + bool isread)
> +{
> + /* Cache invalidate/clean to Point of Unification... */
> + switch (arm_current_el(env)) {
> + case 0:
> + /* ... EL0 must UNDEF unless SCTLR_EL1.UCI is set. */
> + if (!(arm_sctlr(env, 0) & SCTLR_UCI)) {
> + return CP_ACCESS_TRAP;
> + }
> + break;
Again, we want to fall through here rather than breaking.
> + case 1:
> + /* ... EL1 must trap to EL2 if HCR_EL2.TPU is set. */
> + if (arm_hcr_el2_eff(env) & HCR_TPU) {
> + return CP_ACCESS_TRAP_EL2;
> + }
> + break;
> + }
> + return CP_ACCESS_OK;
> +}
thanks
-- PMM
- [PATCH v3 0/7] target/arm: Honor more HCR_EL2 traps, Richard Henderson, 2020/02/18
- [PATCH v3 1/7] target/arm: Set ID_MMFR4.HPDS for aarch64_max_initfn, Richard Henderson, 2020/02/18
- [PATCH v3 3/7] target/arm: Honor the HCR_EL2.TSW bit, Richard Henderson, 2020/02/18
- [PATCH v3 2/7] target/arm: Honor the HCR_EL2.{TVM,TRVM} bits, Richard Henderson, 2020/02/18
- [PATCH v3 4/7] target/arm: Honor the HCR_EL2.TACR bit, Richard Henderson, 2020/02/18
- [PATCH v3 6/7] target/arm: Honor the HCR_EL2.TPU bit, Richard Henderson, 2020/02/18
- Re: [PATCH v3 6/7] target/arm: Honor the HCR_EL2.TPU bit,
Peter Maydell <=
- [PATCH v3 5/7] target/arm: Honor the HCR_EL2.TPCP bit, Richard Henderson, 2020/02/18
- [PATCH v3 7/7] target/arm: Honor the HCR_EL2.TTLB bit, Richard Henderson, 2020/02/18
- Re: [PATCH v3 0/7] target/arm: Honor more HCR_EL2 traps, Peter Maydell, 2020/02/25