]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: arm64: Initialize trap register values in hyp in pKVM
authorFuad Tabba <tabba@google.com>
Fri, 18 Oct 2024 07:48:32 +0000 (08:48 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Thu, 31 Oct 2024 18:45:24 +0000 (18:45 +0000)
commitb56680de9c6489f2aed707fad2811e714b52fe4c
tree6002468413adb1194fd6018ff61c63d7da9544a2
parentcb0c272acebdf099431c34972963377f83872a08
KVM: arm64: Initialize trap register values in hyp in pKVM

Handle the initialization of trap registers at the hypervisor in
pKVM, even for non-protected guests. The host is not trusted with
the values of the trap registers, regardless of the VM type.
Therefore, when switching between the host and the guests, only
flush the HCR_EL2 TWI and TWE bits. The host is allowed to
configure these for opportunistic scheduling, as neither affects
the protection of VMs or the hypervisor.

Reported-by: Will Deacon <will@kernel.org>
Fixes: 814ad8f96e92 ("KVM: arm64: Drop trapping of PAuth instructions/keys")
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20241018074833.2563674-5-tabba@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/kvm/hyp/nvhe/hyp-main.c
arch/arm64/kvm/hyp/nvhe/pkvm.c