KVM: arm64: Consolidate allowed and restricted VM feature checks
authorMarc Zyngier <maz@kernel.org>
Fri, 20 Dec 2024 11:33:05 +0000 (11:33 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Dec 2024 13:39:10 +0000 (13:39 +0000)
commit2589dbd72797a4163dd998b05c4663ff98bd0771
tree68476afad21416361b4a0173fd31d68c439e75f0
parent78d4f34e2115b517bcbfe7ec0d018bbbb6f9b0b8
KVM: arm64: Consolidate allowed and restricted VM feature checks

The definitions for features allowed and allowed with
restrictions for protected guests, which are based on feature
registers, were defined and checked for separately, even though
they are handled in the same way. This could result in missing
checks for certain features, e.g., pointer authentication,
causing traps for allowed features.

Consolidate the definitions into one. Use that new definition to
construct the guest view of the feature registers for
consistency.

Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20241216105057.579031-2-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/include/nvhe/fixed_config.h
arch/arm64/kvm/hyp/nvhe/pkvm.c
arch/arm64/kvm/hyp/nvhe/sys_regs.c