lkml.org 
[lkml]   [2021]   [Oct]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [patch 13/31] x86/fpu: Move KVMs FPU swapping to FPU core
From
On 15/10/21 16:24, Liu, Jing2 wrote:
>> fpu_swap_kvm_fpu(bool enter_guest, u64 guest_needs_features) {
>> possibly_reallocate(enter_guest, guest_needs_features);
> When KVM traps guest wrmsr XFD in #NM, I think KVM need allocate
> fpstate buffer for full features.

You mean XCR0 and XFD (not XFD in #NM), but yeah at the point of
fpu_swap_kvm_fpu we are in atomic context.

Still, for now the first pass of AMX implementation doesn't need to do
anything but swap the pointers, and it can simply allocate the full
buffer at vCPU creation.

Paolo

> Because in next vmexit, guest might have dynamic state and KVM
> can be preempted before running fpu_swap_kvm_fpu().
> Thus, here the current->thread.fpu.fpstate already has enough space
> for saving guest.

\
 
 \ /
  Last update: 2021-10-15 17:54    [W:0.127 / U:0.664 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site