lkml.org 
[lkml]   [2022]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH AUTOSEL 5.16 07/28] x86/kvm/fpu: Limit guest user_xfeatures to supported bits of XCR0
From
On 6/3/22 20:40, Peter Xu wrote:
> I'm not really sure whether this is a bug or by design - do we require this
> patch to be applied to all stable branches to make the guest not crash
> after migration, or it is unexpected?

Yes, we do, though the only reported bug was for PKRU.

> However there seems to be something missing at least to me, on why it'll
> fail a migration from 5.15 (without this patch) to 5.18 (with this patch).
> In my test case, user_xfeatures will be 0x7 (FP|SSE|YMM) if without this
> patch, but 0x0 if with it.

What CPU model are you using for the VM? For example, if the source
lacks this patch but the destination has it, the source will transmit
YMM registers, but the destination will fail to set them if they are not
available for the selected CPU model.

See the commit message: "As a bonus, it will also fail if userspace
tries to set fpu features (with the KVM_SET_XSAVE ioctl) that are not
compatible to the guest configuration. Such features will never be
returned by KVM_GET_XSAVE or KVM_GET_XSAVE2."

Paolo

\
 
 \ /
  Last update: 2022-06-06 18:19    [W:1.793 / U:0.992 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site