From mboxrd@z Thu Jan 1 00:00:00 1970 From: Raghavendra K T Subject: Re: [PATCH RFC V2 3/5] kvm hypervisor : Add two hypercalls to support pv-ticketlock Date: Mon, 24 Oct 2011 16:50:07 +0530 Message-ID: <4EA549E7.9090601@linux.vnet.ibm.com> References: <20111023190307.16364.35381.sendpatchset@oc5400248562.ibm.com> <20111023190558.16364.2136.sendpatchset@oc5400248562.ibm.com> <4EA53A7D.300@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Raghavendra K T , Greg Kroah-Hartman , "H. Peter Anvin" , Gleb Natapov , Virtualization , Jeremy Fitzhardinge , x86@kernel.org, KVM , Dave Jiang , Thomas Gleixner , Stefano Stabellini , Xen , Sedat Dilek , Yinghai Lu , Marcelo Tosatti , Ingo Molnar , Rik van Riel , Konrad Rzeszutek Wilk , LKML , Suzuki Poulose , Srivatsa Vaddagiri , Peter Zijlstra To: Avi Kivity Return-path: In-Reply-To: <4EA53A7D.300@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 10/24/2011 03:44 PM, Avi Kivity wrote: > On 10/23/2011 09:05 PM, Raghavendra K T wrote: >> Add two hypercalls to KVM hypervisor to support pv-ticketlocks. >> + >> +end_wait: >> + finish_wait(&vcpu->wq,&wait); >> +} > > This hypercall can be replaced by a HLT instruction, no? > > I'm pretty sure this misses a lot of stuff from kvm_vcpu_block(). Yes.. agree. HLT sounds better idea. 'll try this out. > >> + if (vcpu) { >> + vcpu->kicked = 1; > > Need to use smp memory barriers here. Agree. > >> + wake_up_interruptible(&vcpu->wq); >> + } >> +} >> + >> int kvm_emulate_hypercall(struct kvm_vcpu *vcpu) >> { >> unsigned long nr, a0, a1, a2, a3, ret; >> >