From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH v2 06/13] KVM: x86: save/load state on SMM switch Date: Thu, 4 Jun 2015 13:34:46 +0200 Message-ID: <20150604113446.GA11957@potion.brq.redhat.com> References: <1432746314-50196-1-git-send-email-pbonzini@redhat.com> <1432746314-50196-7-git-send-email-pbonzini@redhat.com> <20150603190253.GA13488@potion.brq.redhat.com> <556FECD4.3010507@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, guangrong.xiao@linux.intel.com, bdas@redhat.com To: Paolo Bonzini Return-path: Content-Disposition: inline In-Reply-To: <556FECD4.3010507@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org 2015-06-04 08:14+0200, Paolo Bonzini: > On 03/06/2015 21:02, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: >>> + r =3D kvm_write_guest(vcpu->kvm, vcpu->arch.smbase + 0xfe00, buf,= sizeof(buf)); >>=20 >> The state is saved in SMRAM, but we are accessing it using the non-S= MM >> address space ... how did it pass testing? >> (Restore is using SMM address space, so I'm guessing that the mappin= g >> from QEMU wasn't really utilizing two separate address spaces.) >=20 > At this point of the series there are no separate address spaces yet. > Patch 10 then changes it everywhere: >=20 > @@ -6558,7 +6558,7 @@ static void process_smi(struct kvm_vcpu *vcpu) My bad, people using jackhammers at 7am are getting the better of me. > Why did I order it this way? Because it is already possible to test > this code with the default SMBASE of 0x30000, and it is already > possible to run the full firmware if you hack it not to close SMRAM > (for this I used q35's high SMRAM). It is not possible to test the > code partially if you first add the two address spaces, and only > implement the world switch second. The ordering makes sense; I wanted to point out the early return, noticed this as well and missed that it was fixed later, sorry.