Re: [PATCH 1/2] x86,kvm: move qemu/guest FPU switching out to vcpu_run

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

 



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..




[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