qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH 13/35] target/arm: Trap sysreg accesses for FEAT_NV


From: Richard Henderson
Subject: Re: [PATCH 13/35] target/arm: Trap sysreg accesses for FEAT_NV
Date: Thu, 28 Dec 2023 09:40:29 +1100
User-agent: Mozilla Thunderbird

On 12/18/23 22:32, Peter Maydell wrote:
For FEAT_NV, accesses to system registers and instructions from EL1
which would normally UNDEF there but which work in EL2 need to
instead be trapped to EL2. Detect this both for "we know this will
UNDEF at translate time" and "we found this UNDEFs at runtime", and
make the affected registers trap to EL2 instead.

The Arm ARM defines the set of registers that should trap in terms
of their names; for our implementation this would be both awkward
and inefficent as a test, so we instead trap based on the opc1
field of the sysreg. The regularity of the architectural choice
of encodings for sysregs means that in practice this captures
exactly the correct set of registers.

Regardless of how we try to define the registers this trapping
applies to, there's going to be a certain possibility of breakage
if new architectural features introduce new registers that don't
follow the current rules (FEAT_MEC is one example already visible
in the released sysreg XML, though not yet in the Arm ARM). This
approach seems to me to be straightforward and likely to require
a minimum of manual overrides.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
  target/arm/cpregs.h            | 34 +++++++++++++++++++++++
  target/arm/cpu.h               |  1 +
  target/arm/tcg/translate.h     |  2 ++
  target/arm/tcg/hflags.c        |  1 +
  target/arm/tcg/translate-a64.c | 49 +++++++++++++++++++++++++++-------
  5 files changed, 77 insertions(+), 10 deletions(-)

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

+             * (This makes a difference only for a couple of registers likee

like



r~



reply via email to

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