KVM: arm64: nv: Add fine grained trap forwarding infrastructure
authorMarc Zyngier <maz@kernel.org>
Tue, 15 Aug 2023 18:38:53 +0000 (19:38 +0100)
committerMarc Zyngier <maz@kernel.org>
Thu, 17 Aug 2023 09:00:27 +0000 (10:00 +0100)
commit15b4d82d69d7b0e5833b7a023dff3d7bbae5ccfc
tree13d82d1a56a3d4808dbf89ea54348a3f826d8ec6
parente880bd3363237ed8abbe623d1b49d59d5f6fe0d1
KVM: arm64: nv: Add fine grained trap forwarding infrastructure

Fine Grained Traps are fun. Not.

Implement the fine grained trap forwarding, reusing the Coarse Grained
Traps infrastructure previously implemented.

Each sysreg/instruction inserted in the xarray gets a FGT group
(vaguely equivalent to a register number), a bit number in that register,
and a polarity.

It is then pretty easy to check the FGT state at handling time, just
like we do for the coarse version (it is just faster).

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Jing Zhang <jingzhangos@google.com>
Link: https://lore.kernel.org/r/20230815183903.2735724-20-maz@kernel.org
arch/arm64/kvm/emulate-nested.c