qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2 06/23] target/arm: Make HSTR_EL2 traps take priority over


From: Richard Henderson
Subject: Re: [PATCH v2 06/23] target/arm: Make HSTR_EL2 traps take priority over UNDEF-at-EL1
Date: Mon, 30 Jan 2023 09:36:54 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 1/30/23 08:24, Peter Maydell wrote:
The semantics of HSTR_EL2 require that it traps cpreg accesses
to EL2 for:
  * EL1 accesses
  * EL0 accesses, if the access is not UNDEFINED when the
    trap bit is 0

(You can see this in the I_ZFGJP priority ordering, where HSTR_EL2
traps from EL1 to EL2 are priority 12, UNDEFs are priority 13, and
HSTR_EL2 traps from EL0 are priority 15.)

However, we don't get this right for EL1 accesses which UNDEF because
the register doesn't exist at all or because its ri->access bits
non-configurably forbid the access.  At EL1, check for the HSTR_EL2
trap early, before either of these UNDEF reasons.

We have to retain the HSTR_EL2 check in access_check_cp_reg(),
because at EL0 any kind of UNDEF-to-EL1 (including "no such
register", "bad ri->access" and "ri->accessfn returns 'trap to EL1'")
takes precedence over the trap to EL2.  But we only need to do that
check for EL0 now.

Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
Message-id:20230127175507.2895013-7-peter.maydell@linaro.org
---
  target/arm/op_helper.c |  6 +++++-
  target/arm/translate.c | 28 +++++++++++++++++++++++++++-
  2 files changed, 32 insertions(+), 2 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]