lkml.org 
[lkml]   [2017]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] x86,kvm: move qemu/guest FPU switching out to vcpu_run
From
Date
On 16/11/2017 14:35, Quan Xu wrote:
> but we introduce another method:
>
>       -- When the VCPU thread is scheduled back in, the context
>          switch code will restore current->thread.fpu to the FPU
>          registers.
>
>
> there is still a window to restore current->thread.fpu to the FPU
> registers before enter guest mode and
>
> preempt_disable().

That will always use the host PKRU. The guest PKRU is _never_ visible
to the context switch code, because it's only ever used in a section
that runs with preemption disabled.

It's actually much simpler than before.

Paolo

> on target machine, after migration, the pkru value is source_host_pkru
> in current->thread.fpu.
>
> in case,
>
>             source_host_pkru_value != guest_pkru_value,
>             target_host_pkru_value == guest_pkru_value..
>
> source_host_pkru_value may be restored to PKRU.. make pkru status
> inconsistent..

\
 
 \ /
  Last update: 2017-11-17 17:17    [W:1.206 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site