lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 16 Nov 2017 18:50:41 +0100
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Quan Xu <quan.xu0@...il.com>, Rik van Riel <riel@...hat.com>,
        "quan.xu04@...il.com" <quan.xu04@...il.com>
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        david@...hat.com, borntraeger@...ibm.com, tglx@...utronix.de,
        rkrcmar@...hat.com
Subject: Re: [PATCH 1/2] x86,kvm: move qemu/guest FPU switching out to
 vcpu_run

On 16/11/2017 15:28, Quan Xu wrote:
>  	vcpu->srcu_idx = srcu_read_lock(&kvm->srcu);
>  
> + kvm_load_guest_fpu(vcpu);
> +
>  	for (;;) {
>  		if (kvm_vcpu_running(vcpu)) {
>  			r = vcpu_enter_guest(vcpu);
> 
> <<
> 
> 
> 
>   as Rik dropped  kvm_load_guest_fpu(vcpu) in  vcpu_enter_guest() ..
>   in case still in kvm mode, how to make sure to pkru is always the
> right one before enter guest mode, not be preempted before
> preempt_disable()  after migration? :(

As you know:

1) kvm_load_guest_fpu doesn't load the guest PKRU, it keeps the
userspace PKRU.

2) the guest PKRU is only ever set in a preemption-disabled area

Thus, context switch always sees the userspace PKRU.  The guest PKRU is
only set the next time vmx_vcpu_run executes.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ