From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikunj A Dadhania Subject: Re: [PATCH v4 4/8] KVM-HV: Add VCPU running/pre-empted state for guest Date: Fri, 24 Aug 2012 10:49:26 +0530 Message-ID: <87y5l4q335.fsf@linux.vnet.ibm.com> References: <20120821112346.3512.99814.stgit@abhimanyu.in.ibm.com> <20120821112640.3512.43771.stgit@abhimanyu> <20120823114622.GA4747@amt.cnet> Mime-Version: 1.0 Content-Type: text/plain Cc: avi@redhat.com, raghukt@linux.vnet.ibm.com, alex.shi@intel.com, kvm@vger.kernel.org, stefano.stabellini@eu.citrix.com, peterz@infradead.org, hpa@zytor.com, vsrivatsa@gmail.com, mingo@elte.hu To: Marcelo Tosatti Return-path: Received: from e28smtp01.in.ibm.com ([122.248.162.1]:60006 "EHLO e28smtp01.in.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755987Ab2HXFUI (ORCPT ); Fri, 24 Aug 2012 01:20:08 -0400 Received: from /spool/local by e28smtp01.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 24 Aug 2012 10:50:06 +0530 Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay02.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7O5K3r463176830 for ; Fri, 24 Aug 2012 10:50:03 +0530 Received: from d28av05.in.ibm.com (loopback [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7O5K1cr019749 for ; Fri, 24 Aug 2012 15:20:02 +1000 In-Reply-To: <20120823114622.GA4747@amt.cnet> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, 23 Aug 2012 08:46:22 -0300, Marcelo Tosatti wrote: > On Tue, Aug 21, 2012 at 04:56:43PM +0530, Nikunj A. Dadhania wrote: > > From: Nikunj A. Dadhania > > > > Hypervisor code to indicate guest running/pre-empteded status through > > msr. The page is now pinned during MSR write time and use > > kmap_atomic/kunmap_atomic to access the shared area vcpu_state area. > > > > Suggested-by: Marcelo Tosatti > > Signed-off-by: Nikunj A. Dadhania > > --- [...] > > + > > +static void kvm_set_vcpu_state(struct kvm_vcpu *vcpu) > > +{ > > + struct kvm_vcpu_state *vs; > > + char *kaddr; > > + > > + if (!((vcpu->arch.v_state.msr_val & KVM_MSR_ENABLED) && > > + vcpu->arch.v_state.vs_page)) > > + return; > > It was agreed it was necessary to have valid vs_page only if MSR was > enabled? Or was that a misunderstanding? > There is a case where MSR is enabled but vs_page is NULL, this is gaurding that case. The check is now: if (!(msr_enabled && vs_page)) return; I had proposed that here: http://www.spinics.net/lists/kvm/msg77147.html Regards Nikunj