lkml.org 
[lkml]   [2022]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2022-08-17 10:47    [W:0.059 / U:0.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site