summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm/hyp/vhe
diff options
context:
space:
mode:
authorFuad Tabba <tabba@google.com>2024-04-23 17:05:11 +0200
committerMarc Zyngier <maz@kernel.org>2024-05-01 17:46:58 +0200
commitf11290e0aa6e40e6823f80c7dcdacf033a54aaeb (patch)
tree00581d259e068f1e34b4c3f9c9f81b82be80846b /arch/arm64/kvm/hyp/vhe
parentKVM: arm64: Move guest_owns_fp_regs() to increase its scope (diff)
downloadlinux-f11290e0aa6e40e6823f80c7dcdacf033a54aaeb.tar.xz
linux-f11290e0aa6e40e6823f80c7dcdacf033a54aaeb.zip
KVM: arm64: Refactor checks for FP state ownership
To avoid direct comparison against the fp_owner enum, add a new function that performs the check, host_owns_fp_regs(), to complement the existing guest_owns_fp_regs(). To check for fpsimd state ownership, use the helpers instead of directly using the enums. No functional change intended. Suggested-by: Marc Zyngier <maz@kernel.org> Signed-off-by: Fuad Tabba <tabba@google.com> Reviewed-by: Mark Brown <broonie@kernel.org> Acked-by: Oliver Upton <oliver.upton@linux.dev> Link: https://lore.kernel.org/r/20240423150538.2103045-4-tabba@google.com Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/hyp/vhe')
-rw-r--r--arch/arm64/kvm/hyp/vhe/switch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm64/kvm/hyp/vhe/switch.c b/arch/arm64/kvm/hyp/vhe/switch.c
index 7286db75b8d6..93f78df8b0f6 100644
--- a/arch/arm64/kvm/hyp/vhe/switch.c
+++ b/arch/arm64/kvm/hyp/vhe/switch.c
@@ -258,7 +258,7 @@ static int __kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
sysreg_restore_host_state_vhe(host_ctxt);
- if (*host_data_ptr(fp_owner) == FP_STATE_GUEST_OWNED)
+ if (guest_owns_fp_regs())
__fpsimd_save_fpexc32(vcpu);
__debug_switch_to_host(vcpu);