diff options
author | Marc Zyngier <maz@kernel.org> | 2022-06-08 16:22:31 +0300 |
---|---|---|
committer | Marc Zyngier <maz@kernel.org> | 2022-06-29 12:23:56 +0300 |
commit | b4da91879e98bdd5998ee84f47f02426ac50a729 (patch) | |
tree | 06d85dbc61bb0a5d0cbe0046ac5540cacc55410d /arch/arm64/kvm/arm.c | |
parent | 0fa4a3137e943cd6acab386ff26cd8d5e94e9559 (diff) | |
download | linux-b4da91879e98bdd5998ee84f47f02426ac50a729.tar.xz |
KVM: arm64: Move the handling of !FP outside of the fast path
We currently start by assuming that the host owns the FP unit
at load time, then check again whether this is the case as
we are about to run. Only at this point do we account for the
fact that there is a (vanishingly small) chance that we're running
on a system without a FPSIMD unit (yes, this is madness).
We can actually move this FPSIMD check as early as load-time,
and drop the check at run time.
No intended change in behaviour.
Suggested-by: Reiji Watanabe <reijiw@google.com>
Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Diffstat (limited to 'arch/arm64/kvm/arm.c')
-rw-r--r-- | arch/arm64/kvm/arm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c index 8b9da9d30485..a9dd7ec38f38 100644 --- a/arch/arm64/kvm/arm.c +++ b/arch/arm64/kvm/arm.c @@ -328,6 +328,12 @@ int kvm_arch_vcpu_create(struct kvm_vcpu *vcpu) vcpu->arch.mmu_page_cache.gfp_zero = __GFP_ZERO; + /* + * Default value for the FP state, will be overloaded at load + * time if we support FP (pretty likely) + */ + vcpu->arch.fp_state = FP_STATE_FREE; + /* Set up the timer */ kvm_timer_vcpu_init(vcpu); |