diff options
author | Fuad Tabba <tabba@google.com> | 2024-06-03 14:28:46 +0200 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2024-06-04 16:06:33 +0200 |
commit | e511e08a9f496948b13aac50610f2d17335f56c3 (patch) | |
tree | 62f487e64228537e4c1cdaaa1a34ff873c45607b /arch/arm64/kvm/hyp/nvhe/switch.c | |
parent | KVM: arm64: Abstract set/clear of CPTR_EL2 bits behind helper (diff) | |
download | linux-e511e08a9f496948b13aac50610f2d17335f56c3.tar.xz linux-e511e08a9f496948b13aac50610f2d17335f56c3.zip |
KVM: arm64: Specialize handling of host fpsimd state on trap
In subsequent patches, n/vhe will diverge on saving the host
fpsimd/sve state when taking a guest fpsimd/sve trap. Add a
specialized helper to handle it.
No functional change intended.
Reviewed-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Fuad Tabba <tabba@google.com>
Link: https://lore.kernel.org/r/20240603122852.3923848-5-tabba@google.com
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/hyp/nvhe/switch.c')
-rw-r--r-- | arch/arm64/kvm/hyp/nvhe/switch.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c index 6758cd905570..019f863922fa 100644 --- a/arch/arm64/kvm/hyp/nvhe/switch.c +++ b/arch/arm64/kvm/hyp/nvhe/switch.c @@ -182,6 +182,11 @@ static bool kvm_handle_pvm_sys64(struct kvm_vcpu *vcpu, u64 *exit_code) kvm_handle_pvm_sysreg(vcpu, exit_code)); } +static void kvm_hyp_save_fpsimd_host(struct kvm_vcpu *vcpu) +{ + __fpsimd_save_state(*host_data_ptr(fpsimd_state)); +} + static const exit_handler_fn hyp_exit_handlers[] = { [0 ... ESR_ELx_EC_MAX] = NULL, [ESR_ELx_EC_CP15_32] = kvm_hyp_handle_cp15_32, |