KVM: arm64: Handle HAFGRTR_EL2 trapping in nested virt
authorFuad Tabba <tabba@google.com>
Thu, 14 Dec 2023 10:01:49 +0000 (10:01 +0000)
committerMarc Zyngier <maz@kernel.org>
Mon, 18 Dec 2023 11:25:50 +0000 (11:25 +0000)
commit676f482354886caa9b0cfa9236f5d20ac78f8c6a
tree5491d08a8d5b8be445a6fda44af7380e3812f084
parentf9d6ed0213021ea00af30efbfa33e9a06c0610f2
KVM: arm64: Handle HAFGRTR_EL2 trapping in nested virt

Add the encodings to fine grain trapping fields for HAFGRTR_EL2
and add the associated handling code in nested virt. Based on
DDI0601 2023-09. Add the missing field definitions as well,
both to generate the correct RES0 mask and to be able to toggle
their FGT bits.

Also add the code for handling FGT trapping, reading of the
register, to nested virt.

Reviewed-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20231214100158.2305400-10-tabba@google.com
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/emulate-nested.c
arch/arm64/kvm/hyp/include/hyp/switch.h
arch/arm64/kvm/sys_regs.c