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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1510756981.21121.291.camel@redhat.com>
Date:   Wed, 15 Nov 2017 09:43:01 -0500
From:   Rik van Riel <riel@...hat.com>
To:     "quan.xu04@...il.com" <quan.xu04@...il.com>, pbonzini@...hat.com
Cc:     kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
        david@...hat.com, borntraeger@...ibm.com, tglx@...utronix.de,
        rkrcmar@...hat.com, Quan Xu <quan.xu0@...il.com>
Subject: Re: [PATCH 1/2] x86,kvm: move qemu/guest FPU switching out to
 vcpu_run

On Wed, 2017-11-15 at 14:53 +0800, quan.xu04@...il.com wrote:
> 
> On 2017/11/15 05:54, riel@...hat.com wrote:
> > From: Rik van Riel <riel@...hat.com>
> > 
> > Currently, every time a VCPU is scheduled out, the host kernel will
> > first save the guest FPU/xstate context, then load the qemu
> > userspace
> > FPU context, only to then immediately save the qemu userspace FPU
> > context back to memory. When scheduling in a VCPU, the same
> > extraneous
> > FPU loads and saves are done.
> 
> Rik, be careful with VM migration. with you patch, I don't think you 
> could load fpu/xstate
>    context accurately after VM migration.

Can you explain why you believe that?

Getting the guest FPU or XSTATE is done under the vcpu->mutex.

This patch switches out guest and userspace FPU/XSTATE under the
vcpu->mutex, and switches it back before releasing the vcpu->mutex.

By the time a KVM_GET_FPU has obtained the vcpu->mutex, the guest
FPU state will be in vcpu->arch.guest_fpu.state, where you expect
it to be.

What am I missing?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ