KVM: arm64: Trap access to pVM restricted features
authorFuad Tabba <tabba@google.com>
Sun, 10 Oct 2021 14:56:35 +0000 (15:56 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 11 Oct 2021 13:57:30 +0000 (14:57 +0100)
commit1423afcb411780c7a6a68f801fdcfb6920ad6f06
tree3e66d77adfa2e77e8e90e655fd22d2138aa00990
parent72e1be120eaaf82a58c81fcf173cdb1d7a5dcfbb
KVM: arm64: Trap access to pVM restricted features

Trap accesses to restricted features for VMs running in protected
mode.

Access to feature registers are emulated, and only supported
features are exposed to protected VMs.

Accesses to restricted registers as well as restricted
instructions are trapped, and an undefined exception is injected
into the protected guests, i.e., with EC = 0x0 (unknown reason).
This EC is the one used, according to the Arm Architecture
Reference Manual, for unallocated or undefined system registers
or instructions.

Only affects the functionality of protected VMs. Otherwise,
should not affect non-protected VMs when KVM is running in
protected mode.

Signed-off-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211010145636.1950948-11-tabba@google.com
arch/arm64/kvm/hyp/nvhe/switch.c