From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH 08/13] KVM: x86: stubs for SMM support Date: Tue, 5 May 2015 20:48:14 +0200 Message-ID: <20150505184814.GC17198@potion.brq.redhat.com> References: <1430393772-27208-1-git-send-email-pbonzini@redhat.com> <1430393772-27208-9-git-send-email-pbonzini@redhat.com> <20150504175102.GC11234@potion.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Paolo Bonzini , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, guangrong.xiao@linux.intel.com, Yang Zhang , wanpeng.li@linux.intel.com To: Bandan Das Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2015-05-05 14:38-0400, Bandan Das: > Radim Kr=C4=8Dm=C3=A1=C5=99 writes: > ... > >> + break; > > > > (I'm not sure if this is supported if IA32_VMX_BASIC[49] =3D 0. > > 34.15.6.4 Saving Guest State > > The SMM-transfer monitor (STM) can also discover the current val= ue of > > the SMBASE register by using the RDMSR > > > > but it's not possible to get into STM without having a support for= it > > noted in IA32_VMX_BASIC[49] and more magic we also don't emulate t= o > > actually enable it.) >=20 > Where does it mention IA32_VMX_BASIC[49] ? I only see "IA32_VMX_MISC[= 15] should be 1" > in 34.15.6.4. Anyway, I think we should do what the spec says.. The relevant part is "SMM-transfer monitor (STM) can" -- you can't be STM without IA32_VMX_MISC[15] and a bunch of other stuff. Testing on real hardware would be the best way to tell ... (Till we know, I'm okay with anything.) > >> @@ -7208,6 +7240,8 @@ void kvm_vcpu_reset(struct kvm_vcpu *vcpu) > >> vcpu->arch.regs_avail =3D ~0; > >> vcpu->arch.regs_dirty =3D ~0; > >> =20 > >> + vcpu->arch.smbase =3D 0x30000; > > > > It's not reset on INIT, only on RESET. (34.11 SMBASE RELOCATION) > I remember mentioning it elsewhere - IMO kvm_vcpu_reset() and kvm_vcp= u_init() > should really be two different interfaces. I don't mean code duplicat= ion - one > can just call the other but different names will be of some help when= it comes > to the million places where the spec mentions INIT and RESET have dif= ferent > behavior. Agreed.