]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: PPC: Book3S HV: Avoid unbalanced increments of VPA yield count
authorPaul Mackerras <paulus@samba.org>
Fri, 6 Sep 2013 03:24:35 +0000 (13:24 +1000)
committerAlexander Graf <agraf@suse.de>
Thu, 17 Oct 2013 12:45:01 +0000 (14:45 +0200)
commitd4310d4e3128e0f67c0e09175302cb0d27176ae2
treef2ddb353aa55859891e2e4d9a031d27d8974c354
parent8ad4d07c396fce5569aa5607cf91d543cf4e0516
KVM: PPC: Book3S HV: Avoid unbalanced increments of VPA yield count

The yield count in the VPA is supposed to be incremented every time
we enter the guest, and every time we exit the guest, so that its
value is even when the vcpu is running in the guest and odd when it
isn't.  However, it's currently possible that we increment the yield
count on the way into the guest but then find that other CPU threads
are already exiting the guest, so we go back to nap mode via the
secondary_too_late label.  In this situation we don't increment the
yield count again, breaking the relationship between the LSB of the
count and whether the vcpu is in the guest.

To fix this, we move the increment of the yield count to a point
after we have checked whether other CPU threads are exiting.

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
arch/powerpc/kvm/book3s_hv_rmhandlers.S