[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a76066e2-af2c-1be2-5e3e-1f42557523e6@redhat.com>
Date: Wed, 17 Aug 2022 10:45:14 +0200
From: Paolo Bonzini <pbonzini@...hat.com>
To: Leonardo Brás <leobras@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
"Dr. David Alan Gilbert (git)" <dgilbert@...hat.com>
Cc: kvm@...r.kernel.org, tglx@...utronix.de,
linux-kernel@...r.kernel.org, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org
Subject: Re: [PATCH] KVM: x86: Always enable legacy fp/sse
On 8/17/22 05:29, Leonardo Brás wrote:
>>> QEMU always calls kvm_put_xsave, even on this combination because
>>> KVM_CAP_CHECK_EXTENSION_VM always returns true for KVM_CAP_XSAVE.
> Any particular reason why it always returns true for KVM_CAP_XSAVE, even when
> the CPU does not support it?
>
> IIUC, if it returns false to this capability, kvm_put_xsave() should never be
> called, and thus it can avoid bug reproduction.
Because it allows userspace to have a single path for saving/restoring
FPU state. See for example the "migration" code in
tools/testing/selftests/kvm/lib/x86_64/processor.c (the vcpu_save_state
and vcpu_load_state functions).
In fact, the QEMU code that uses KVM_GET_FPU/KVM_SET_FPU in x86 is
obsolete, because it's not been used since Linux 2.6.36.
Paolo
Powered by blists - more mailing lists