From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: IA32_FEATURE_CONTROL MSR in nested virt Date: Wed, 3 Jul 2013 17:59:05 +0300 Message-ID: <20130703145905.GE32123@redhat.com> References: <20130703091446.GH18508@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Arthur Chunqi Li , kvm , Paolo Bonzini , Jan Kiszka To: Bandan Das Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40327 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932845Ab3GCO7K (ORCPT ); Wed, 3 Jul 2013 10:59:10 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Wed, Jul 03, 2013 at 10:48:33AM -0400, Bandan Das wrote: > Gleb Natapov writes: > > > On Wed, Jul 03, 2013 at 04:24:33PM +0800, Arthur Chunqi Li wrote: > >> Hi Gleb and Paolo, > >> When I write test cases for nested virt and found that reading/writing > >> IA32_FEATURE_CONTROL will be simply ignored or return 0 (in > >> arch/x86/kvm/vmx.c) in VM. Checking this MSR will be done by some > >> hypervisors (e.g. NOVA) and may cause error then, so it is necessary > >> to behave right when read/write it in VM. > >> > > NOVA cannot write to it and expect anything but #GP since BIOSes usually > > lock the MSR. So I agree with Paolo about returning 5 on read and #GP on > > write. Later we can implement locking functionality and make BIOS > > enable/disable nested vmx. > > I vaguely recalled Nadav had posted a patch related to this MSR a > while back and found this : > > http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/88478 > > Shouldn't this work ? > It should, but it needs additional Seabios patch to enabled vmx. Also the patch is incorrectly resets MSR on SIPI. There is no point in lock bit if it can be reset by SIPI. > >> Are there any difficulties to handle this MSR? I have two solutions. > >> The first one is return the value of physical CPU's and always return > >> true when write. This is simple but may behave as if it is a VM > >> because write to it after VMXON will not return GP exception. This > >> solution can solve most basic problems since this MSR is not commonly > >> used. Another solution is adding a field in VCPU to handle this MSR. > >> This is a complex but better method. > >> > >> I think I can complete this if needed. > >> > >> Thanks, > >> Arthur > >> > >> -- > >> Arthur Chunqi Li > >> Department of Computer Science > >> School of EECS > >> Peking University > >> Beijing, China > > > > -- > > Gleb. > > -- > > To unsubscribe from this list: send the line "unsubscribe kvm" in > > the body of a message to majordomo@vger.kernel.org > > More majordomo info at http://vger.kernel.org/majordomo-info.html -- Gleb.