qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 09/23] target/arm: Implement FGT trapping infrastructure


From: Richard Henderson
Subject: Re: [PATCH 09/23] target/arm: Implement FGT trapping infrastructure
Date: Fri, 27 Jan 2023 16:36:11 -1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 1/27/23 07:54, Peter Maydell wrote:
Implement the machinery for fine-grained traps on normal sysregs.
Any sysreg with a fine-grained trap will set the new field to
indicate which FGT register bit it should trap on.

FGT traps only happen when an AArch64 EL2 enables them for
an AArch64 EL1. They therefore are only relevant for AArch32
cpregs when the cpreg can be accessed from EL0. The logic
in access_check_cp_reg() will check this, so it is safe to
add a .fgt marking to an ARM_CP_STATE_BOTH ARMCPRegInfo.

The DO_BIT and DO_REV_BIT macros define enum constants FGT_##bitname
which can be used to specify the FGT bit, eg
    .fgt = FGT_AFSR0_EL1
(We assume that there is no bit name duplication across the FGT
registers, for brevity's sake.)

Subsequent commits will add the .fgt fields to the relevant register
definitions and define the FGT_nnn values for them.

Note that some of the FGT traps are for instructions that we don't
handle via the cpregs mechanisms (mostly these are instruction traps).
Those we will have to handle separately.

Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
---
  target/arm/cpregs.h        | 72 ++++++++++++++++++++++++++++++++++++++
  target/arm/cpu.h           |  1 +
  target/arm/internals.h     | 20 +++++++++++
  target/arm/translate.h     |  2 ++
  target/arm/helper.c        |  9 +++++
  target/arm/op_helper.c     | 30 ++++++++++++++++
  target/arm/translate-a64.c |  3 +-
  target/arm/translate.c     |  2 ++
  8 files changed, 138 insertions(+), 1 deletion(-)

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

r~



reply via email to

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