From mboxrd@z Thu Jan 1 00:00:00 1970 From: Waiman Long Subject: Re: [PATCH RFC v5 8/8] pvqspinlock, x86: Enable KVM to use qspinlock's PV support Date: Thu, 27 Feb 2014 13:36:00 -0500 Message-ID: <530F8590.60207@hp.com> References: <1393427668-60228-1-git-send-email-Waiman.Long@hp.com> <1393427668-60228-9-git-send-email-Waiman.Long@hp.com> <530F0607.1020705@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <530F0607.1020705@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org To: Paolo Bonzini Cc: Jeremy Fitzhardinge , Raghavendra K T , Peter Zijlstra , virtualization@lists.linux-foundation.org, Andi Kleen , "H. Peter Anvin" , Michel Lespinasse , Alok Kataria , linux-arch@vger.kernel.org, x86@kernel.org, Ingo Molnar , Scott J Norton , xen-devel@lists.xenproject.org, "Paul E. McKenney" , Alexander Fyodorov , Rik van Riel , Arnd Bergmann , Konrad Rzeszutek Wilk , Daniel J Blueman , Oleg Nesterov , Steven Rostedt , Chris Wright , George Spelvin , Thomas Gleixner List-Id: linux-arch.vger.kernel.org On 02/27/2014 04:31 AM, Paolo Bonzini wrote: > static __init int kvm_spinlock_init_jump(void) > diff --git a/kernel/Kconfig.locks b/kernel/Kconfig.locks > index f185584..a70fdeb 100644 > --- a/kernel/Kconfig.locks > +++ b/kernel/Kconfig.locks > @@ -229,4 +229,4 @@ config ARCH_USE_QUEUE_SPINLOCK > > config QUEUE_SPINLOCK > def_bool y if ARCH_USE_QUEUE_SPINLOCK > - depends on SMP&& !PARAVIRT_SPINLOCKS > + depends on SMP&& (!PARAVIRT_SPINLOCKS || !XEN) > > Should this rather be > > def_bool y if ARCH_USE_QUEUE_SPINLOCK&& (!PARAVIRT_SPINLOCKS || !XEN) > > ? > > PARAVIRT_SPINLOCKS + XEN + QUEUE_SPINLOCK + PARAVIRT_UNFAIR_LOCKS is a > valid combination, but it's impossible to choose PARAVIRT_UNFAIR_LOCKS > if QUEUE_SPINLOCK is unavailable. > > Paolo The PV ticketlock code assumes the presence of ticket spinlock. So it will cause compilation error if QUEUE_SPINLOCK is enabled. My patches 7/8 modified the KVM code so that the PV ticketlock code can coexist with queue spinlock. As I haven't figure out the proper way to modify the Xen code, I need to disable the queue spinlock code if PARAVIRT_SPINLOCKS and XEN are both enabled. However, by disabling PARAVIRT_SPINLOCKS, we can use PARAVIRT_UNFAIR_LOCKS with XEN. -Longman