[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c331a215-2b7c-3c79-91ce-2b10b1882d36@gmail.com>
Date: Thu, 16 Nov 2017 10:50:32 +0800
From: Quan Xu <quan.xu0@...il.com>
To: Rik van Riel <riel@...hat.com>,
"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
Subject: Re: [PATCH 1/2] x86,kvm: move qemu/guest FPU switching out to
vcpu_run
On 2017-11-15 22:43, Rik van Riel wrote:
> Can you explain why you believe that?
for example, a vcpu thread is running in kvm mode under cretical
condition to stop. QEMU send an IPI to cause a VM-exit to happen
immediately, and this IPI doesn't make vcpu return to QEMU. IIUC
this vcpu thread will still continue to run in kvm mode when is
waked up at targer machine. with your patch, I don't see a chance
to load guest FPU or XSTATE, until return to QEMU and run kvm mode again.
then the FPU or XSTATE status is inconsistent for a small window, what's
even
worse is that the vcpu is running.
Did I misunderstand?
Quan
Alibaba Cloud
> 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