From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751909AbbEDQDH (ORCPT ); Mon, 4 May 2015 12:03:07 -0400 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 Message-ID: <55479830.2080002@redhat.com> Date: Mon, 04 May 2015 18:02:56 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= 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 Subject: Re: [PATCH 07/13] KVM: x86: API changes for SMM support 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> In-Reply-To: <20150504153757.GB11234@potion.brq.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/05/2015 17:37, Radim Krčmář 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/virtual/kvm/api.txt >> @@ -820,11 +820,19 @@ struct kvm_vcpu_events { >> } nmi; >> __u32 sipi_vector; >> __u32 flags; >> + struct { >> + __u8 smm; > > 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 processor > 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. > > 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 != vcpu->arch.hflags) { + vcpu->arch.hflags = ctxt->emul_flags; + kvm_mmu_reset_context(vcpu); + } Paolo