]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Fold fx_init() into kvm_arch_vcpu_create()
authorSean Christopherson <seanjc@google.com>
Tue, 21 Sep 2021 00:02:59 +0000 (17:02 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 30 Sep 2021 08:27:06 +0000 (04:27 -0400)
commitd14ae94407c5e4c7585a1165cb6e3861503acf7e
treef61b67a626a6ec249a4f295e48547a71d5e1cb44
parent2f2c4e69bcf5aa3a78bc010dcb2566e0ed51b1dd
KVM: x86: Fold fx_init() into kvm_arch_vcpu_create()

Move the few bits of relevant fx_init() code into kvm_arch_vcpu_create(),
dropping the superfluous check on vcpu->arch.guest_fpu that was blindly
and wrongly added by commit a58c76c2a295 ("KVM: SVM: Guest FPU state
save/restore not needed for SEV-ES guest").

Note, KVM currently allocates and then frees FPU state for SEV-ES guests,
rather than avoid the allocation in the first place.  While that approach
is inarguably inefficient and unnecessary, it's a cleanup for the future.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20210921000303.400537-7-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/x86.c