lkml.org 
[lkml]   [2021]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 10/19] kvm: x86: Emulate WRMSR of guest IA32_XFD
Date
On Mon, Dec 13 2021 at 16:06, Paolo Bonzini wrote:
> On 12/8/21 01:03, Yang Zhong wrote:
>> + /*
>> + * Update IA32_XFD to the guest value so #NM can be
>> + * raised properly in the guest. Instead of directly
>> + * writing the MSR, call a helper to avoid breaking
>> + * per-cpu cached value in fpu core.
>> + */
>> + fpregs_lock();
>> + current->thread.fpu.fpstate->xfd = data;
>
> This is wrong, it should be written in vcpu->arch.guest_fpu.
>
>> + xfd_update_state(current->thread.fpu.fpstate);
>
> This is okay though, so that KVM_SET_MSR will not write XFD and WRMSR
> will.
>
> That said, I think xfd_update_state should not have an argument.
> current->thread.fpu.fpstate->xfd is the only fpstate that should be
> synced with the xfd_state per-CPU variable.

I'm looking into this right now. The whole restore versus runtime thing
needs to be handled differently.

Thanks,

tglx

\
 
 \ /
  Last update: 2021-12-13 20:47    [W:0.316 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site