]> www.infradead.org Git - users/hch/misc.git/commit
KVM: arm64: Calculate cptr_el2 traps on activating traps
authorFuad Tabba <tabba@google.com>
Mon, 16 Dec 2024 10:50:52 +0000 (10:50 +0000)
committerMarc Zyngier <maz@kernel.org>
Fri, 20 Dec 2024 13:53:57 +0000 (13:53 +0000)
commit2fd5b4b0e7b440602455b79977bfa64dea101e6c
tree8fed9b564f4c3dc5c16a2a15fa7861d14f4795ca
parent092e7b2c3b1a5591bbabc358f3b709dfa2289b91
KVM: arm64: Calculate cptr_el2 traps on activating traps

Similar to VHE, calculate the value of cptr_el2 from scratch on
activate traps. This removes the need to store cptr_el2 in every
vcpu structure. Moreover, some traps, such as whether the guest
owns the fp registers, need to be set on every vcpu run.

Reported-by: James Clark <james.clark@linaro.org>
Fixes: 5294afdbf45a ("KVM: arm64: Exclude FP ownership from kvm_vcpu_arch")
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20241216105057.579031-13-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c
arch/arm64/kvm/hyp/nvhe/pkvm.c
arch/arm64/kvm/hyp/nvhe/switch.c