From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v4 4/8] KVM-HV: Add VCPU running/pre-empted state for guest Date: Fri, 24 Aug 2012 12:02:49 -0300 Message-ID: <20120824150249.GF13206@amt.cnet> References: <20120821112346.3512.99814.stgit@abhimanyu.in.ibm.com> <20120821112640.3512.43771.stgit@abhimanyu> <20120823114622.GA4747@amt.cnet> <87y5l4q335.fsf@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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: Nikunj A Dadhania Return-path: Received: from mx1.redhat.com ([209.132.183.28]:20495 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759010Ab2HXPNQ (ORCPT ); Fri, 24 Aug 2012 11:13:16 -0400 Content-Disposition: inline In-Reply-To: <87y5l4q335.fsf@linux.vnet.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Aug 24, 2012 at 10:49:26AM +0530, Nikunj A Dadhania wrote: > 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 OK, its fine.