From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 07/13] KVM: x86: API changes for SMM support Date: Mon, 04 May 2015 18:02:56 +0200 Message-ID: <55479830.2080002@redhat.com> References: <1430393772-27208-1-git-send-email-pbonzini@redhat.com> <1430393772-27208-8-git-send-email-pbonzini@redhat.com> <20150504153757.GB11234@potion.brq.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, bsd@redhat.com, guangrong.xiao@linux.intel.com, Yang Zhang , wanpeng.li@linux.intel.com To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37017 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbbEDQDB (ORCPT ); Mon, 4 May 2015 12:03:01 -0400 In-Reply-To: <20150504153757.GB11234@potion.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 04/05/2015 17:37, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > 2015-04-30 13:36+0200, Paolo Bonzini: >> This patch includes changes to the external API for SMM support. >> All the changes are predicated by the availability of a new >> capability, KVM_CAP_X86_SMM, which is added at the end of the >> patch series. >> >> Signed-off-by: Paolo Bonzini >> --- >> diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtu= al/kvm/api.txt >> @@ -820,11 +820,19 @@ struct kvm_vcpu_events { >> } nmi; >> __u32 sipi_vector; >> __u32 flags; >> + struct { >> + __u8 smm; >=20 > 34.3.1 Entering SMM: > Subsequent SMI requests are not acknowledged while the processor is= in > SMM. The first SMI interrupt request that occurs while the processo= r > is in SMM (that is, after SMM has been acknowledged to external > hardware) is latched and serviced when the processor exits SMM with > the RSM instruction. The processor will latch only one SMI while in > SMM. >=20 > The final code doesn't handle pending SMI's at all, so we'll need to > store it somewhere and expose to userspace here. Right, and I can add this to the slow path I already have for SMM exits= : + if (ctxt->emul_flags !=3D vcpu->arch.hflags) { + vcpu->arch.hflags =3D ctxt->emul_flags; + kvm_mmu_reset_context(vcpu); + } Paolo