From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753850Ab2D2NS2 (ORCPT ); Sun, 29 Apr 2012 09:18:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23147 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753467Ab2D2NSY (ORCPT ); Sun, 29 Apr 2012 09:18:24 -0400 Message-ID: <4F9D3F8B.9010805@redhat.com> Date: Sun, 29 Apr 2012 16:18:03 +0300 From: Avi Kivity User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1 MIME-Version: 1.0 To: Gleb Natapov CC: Raghavendra K T , Jeremy Fitzhardinge , Greg Kroah-Hartman , Alexander Graf , Randy Dunlap , linux-doc@vger.kernel.org, "H. Peter Anvin" , Konrad Rzeszutek Wilk , KVM , Stefano Stabellini , Virtualization , X86 , Ingo Molnar , Marcelo Tosatti , LKML , Xen , Sasha Levin , Srivatsa Vaddagiri Subject: Re: [PATCH RFC V6 1/5] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks References: <20120423095937.30893.14776.sendpatchset@codeblue.in.ibm.com> <20120423095947.30893.84029.sendpatchset@codeblue.in.ibm.com> <20120424095923.GS15413@redhat.com> In-Reply-To: <20120424095923.GS15413@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/24/2012 12:59 PM, Gleb Natapov wrote: > > > > +/* > > + * kvm_pv_kick_cpu_op: Kick a vcpu. > > + * > > + * @apicid - apicid of vcpu to be kicked. > > + */ > > +static void kvm_pv_kick_cpu_op(struct kvm *kvm, int apicid) > > +{ > > + struct kvm_vcpu *vcpu = NULL; > > + int i; > > + > > + kvm_for_each_vcpu(i, vcpu, kvm) { > > + if (!kvm_apic_present(vcpu)) > > + continue; > > + > > + if (kvm_apic_match_dest(vcpu, 0, 0, apicid, 0)) > > + break; > > + } > > + if (vcpu) { > > + /* > > + * Setting unhalt flag here can result in spurious runnable > > + * state when unhalt reset does not happen in vcpu_block. > > + * But that is harmless since that should soon result in halt. > > + */ > > + vcpu->arch.pv.pv_unhalted = 1; > > + /* We need everybody see unhalt before vcpu unblocks */ > > + smp_mb(); > > + kvm_vcpu_kick(vcpu); > > + } > > +} > This is too similar to kvm_irq_delivery_to_apic(). Why not reuse it. We > can use one of reserved delivery modes as PV delivery mode. We will > disallow guest to trigger it through apic interface, so this will not be > part of ABI and can be changed at will. > I'm not thrilled about this. Those delivery modes will eventually become unreserved. We can have a kvm_lookup_apic_id() that is shared among implementations. -- error compiling committee.c: too many arguments to function