Re: [PATCH v8 04/26] x86/fpu/xstate: Introduce XFEATURE_MASK_KERNEL_DYNAMIC xfeature set

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2024-01-03 at 00:25 +0200, Maxim Levitsky wrote:
> I still think that we should consider adding XFEATURE_MASK_CET_KERNEL
> to
> XFEATURE_MASK_INDEPENDENT or at least have a good conversation on why
> this doesn't make sense,
> but I also don't intend to fight over this, as long as the code
> works.

Hi,

Using XFEATURE_MASK_INDEPENDENT would be pretty close to what we
initially discussed when this series resumed:
https://lore.kernel.org/lkml/20230803042732.88515-10-weijiang.yang@xxxxxxxxx/

Except that it used manual MSR operations instead of xsaves. But the
gist is the same I think - the state is managed manually by KVM.

A XFEATURE_MASK_INDEPENDENT solution seems reasonable to me. I kind of
liked the that the MSR version didn't complicate the overly complex FPU
code. But there was an idea to give XFEATURE_MASK_KERNEL_DYNAMIC a try,
to see if it turned out easy. I think it turned out "ok" complexity
wise. So it doesn't make it clear win one way or the other for me.

I guess it might be slightly more efficient as in this patch because it
gets to use the lazy FPU stuff. It won't need to save/restore if the
exit is handled within KVM, or the kernel switches to a kernel thread
and back. I think that tilts it in favor of
XFEATURE_MASK_KERNEL_DYNAMIC.

Rick






[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux