From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paolo Bonzini Subject: Re: [PATCH 08/12] KVM: x86: save/load state on SMM switch Date: Thu, 21 May 2015 18:23:31 +0200 Message-ID: <555E0683.6020600@redhat.com> References: <1431084034-8425-1-git-send-email-pbonzini@redhat.com> <1431084034-8425-9-git-send-email-pbonzini@redhat.com> <20150521162036.GA31183@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 To: =?UTF-8?B?UmFkaW0gS3LEjW3DocWZ?= Return-path: In-Reply-To: <20150521162036.GA31183@potion.brq.redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: kvm.vger.kernel.org On 21/05/2015 18:20, Radim Kr=C4=8Dm=C3=A1=C5=99 wrote: > 2. NMI -> SMI -> IRET -> RSM -> NMI > NMI is injected; I think it shouldn't be ... have you based this > behavior on the 3rd paragraph of SDM 34.8 NMI HANDLING WHILE IN SMM > ("A special case [...]")? Yes. > Why I think we should restore NMI mask on RSM: > - It's consistent with SMI -> IRET -> NMI -> RSM -> NMI (where we, > I think correctly, unmask NMIs) Yes, we do. > and the idea that SMM tries to be to > transparent (but maybe they didn't care about retarded SMI handlers= ). That's my reading of that paragraph of the manual. :) > - APM 2:15.30.3 SMM_CTL MSR (C001_0116h) > =E2=80=A2 ENTER=E2=80=94Bit 1. Enter SMM: map the SMRAM memory area= s, record whether > NMI was currently blocked and block further NMI and SMI interrupt= s. > =E2=80=A2 EXIT=E2=80=94Bit 3. Exit SMM: unmap the SMRAM memory area= s, restore the > previous masking status of NMI and unconditionally reenable SMI. > =20 > The MSR should mimic real SMM signals and does restore the NMI mask= =2E No idea... My implementation does restore the previous masking status, but only if it was "unmasked". Paolo