]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: arm64: Calculate cptr_el2 traps on activating traps
authorFuad Tabba <tabba@google.com>
Fri, 21 Mar 2025 00:12:57 +0000 (00:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Mar 2025 21:03:32 +0000 (22:03 +0100)
commite6cd28bbbf9014ced5f0f712f2bc1b09af0f2511
tree75e519014e470b0a3ee8d743bb8245142c7f6dfd
parent73ef4f6e379b7bcb1693c0c9a2c3ae6dff832549
KVM: arm64: Calculate cptr_el2 traps on activating traps

[ Upstream commit 2fd5b4b0e7b440602455b79977bfa64dea101e6c ]

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>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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