Messages in this thread | | | From | Wanpeng Li <> | Date | Fri, 10 Nov 2017 14:07:26 +0800 | Subject | Re: [PATCHv3 1/1] locking/qspinlock/x86: Avoid test-and-set when PV_DEDICATED is set |
| |
2017-11-10 0:00 GMT+08:00 Radim Krcmar <rkrcmar@redhat.com>: > 2017-11-09 20:43+0800, Wanpeng Li: >> 2017-11-07 4:26 GMT+08:00 Eduardo Valentin <eduval@amazon.com>: >> > Currently, the existing qspinlock implementation will fallback to >> > test-and-set if the hypervisor has not set the PV_UNHALT flag. >> > >> > This patch gives the opportunity to guest kernels to select >> > between test-and-set and the regular queueu fair lock implementation >> > based on the PV_DEDICATED KVM feature flag. When the PV_DEDICATED >> > flag is not set, the code will still fall back to test-and-set, >> > but when the PV_DEDICATED flag is set, the code will use >> > the regular queue spinlock implementation. >> > >> > With this patch, when in autoselect mode, the guest will >> > use the default spinlock implementation based on host feature >> > flags as follows: >> > >> > PV_DEDICATED = 1, PV_UNHALT = anything: default is qspinlock >> > PV_DEDICATED = 0, PV_UNHALT = 1: default is pvqspinlock >> > PV_DEDICATED = 0, PV_UNHALT = 0: default is tas >> > >> > Cc: Paolo Bonzini <pbonzini@redhat.com> >> > Cc: "Radim Krčmář" <rkrcmar@redhat.com> >> > Cc: Jonathan Corbet <corbet@lwn.net> >> > Cc: Thomas Gleixner <tglx@linutronix.de> >> > Cc: Ingo Molnar <mingo@redhat.com> >> > Cc: "H. Peter Anvin" <hpa@zytor.com> >> > Cc: x86@kernel.org >> > Cc: Peter Zijlstra <peterz@infradead.org> >> > Cc: Waiman Long <longman@redhat.com> >> > Cc: kvm@vger.kernel.org >> > Cc: linux-doc@vger.kernel.org >> > Cc: linux-kernel@vger.kernel.org >> > Cc: Jan H. Schoenherr <jschoenh@amazon.de> >> > Cc: Anthony Liguori <aliguori@amazon.com> >> > Suggested-by: Matt Wilson <msw@amazon.com> >> > Signed-off-by: Eduardo Valentin <eduval@amazon.com> >> > --- >> >> You should also add a cpuid flag in kvm part. > > It is better without that. The flag has no dependency on KVM (kernel > hypervisor) code.
Do you mean -cpu host, +xxxx,I think it will result in "warning: host doesn't support requested feature: CPUID.40000001H:eax.XXXXXX"
Regards, Wanpeng Li
| |