From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH v3 74/75] x86/sev-es: Handle NMI State Date: Wed, 3 Jun 2020 11:59:23 +0200 Message-ID: <20200603095923.GB19711@zn.tnic> References: <20200428151725.31091-1-joro@8bytes.org> <20200428151725.31091-75-joro@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20200428151725.31091-75-joro@8bytes.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" To: Joerg Roedel Cc: Juergen Gross , Tom Lendacky , Dave Hansen , Mike Stunes , Kees Cook , kvm@vger.kernel.org, Peter Zijlstra , Cfir Cohen , x86@kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Joerg Roedel , Masami Hiramatsu , Andy Lutomirski , hpa@zytor.com, Erdem Aktas , David Rientjes , Dan Williams , Jiri Slaby List-Id: virtualization@lists.linuxfoundation.org On Tue, Apr 28, 2020 at 05:17:24PM +0200, Joerg Roedel wrote: > diff --git a/arch/x86/kernel/nmi.c b/arch/x86/kernel/nmi.c > index 27d1016ec840..8898002e5600 100644 > --- a/arch/x86/kernel/nmi.c > +++ b/arch/x86/kernel/nmi.c > @@ -511,6 +511,13 @@ NOKPROBE_SYMBOL(is_debug_stack); > dotraplinkage notrace void > do_nmi(struct pt_regs *regs, long error_code) > { > + /* > + * Re-enable NMIs right here when running as an SEV-ES guest. This might > + * cause nested NMIs, but those can be handled safely. > + */ > + if (sev_es_active()) > + sev_es_nmi_complete(); Pls move the comment and the sev_es_active() check into the sev_es_nmi_complete() function. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette