From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C4E1829CA for ; Tue, 8 Jun 2021 13:25:55 +0000 (UTC) Received: by theia.8bytes.org (Postfix, from userid 1000) id 8A7F3386; Tue, 8 Jun 2021 15:25:53 +0200 (CEST) Date: Tue, 8 Jun 2021 15:25:51 +0200 From: Joerg Roedel To: Peter Zijlstra Cc: x86@kernel.org, Joerg Roedel , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Jiri Slaby , Dan Williams , Tom Lendacky , Juergen Gross , Kees Cook , David Rientjes , Cfir Cohen , Erdem Aktas , Masami Hiramatsu , Mike Stunes , Sean Christopherson , Martin Radev , Arvind Sankar , linux-coco@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org Subject: Re: [PATCH v3 4/7] x86/sev-es: Run #VC handler in plain IRQ state Message-ID: References: <20210608095439.12668-1-joro@8bytes.org> <20210608095439.12668-5-joro@8bytes.org> X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hi Peter, On Tue, Jun 08, 2021 at 01:58:47PM +0200, Peter Zijlstra wrote: > So #VC cannot happen with IRQs disabled? > > raw_spin_lock_irq(&my_lock); > <#VC> > raw_spin_lock_irqsave(&my_lock); // whoopsie > > Every exception that can happen with IRQs disabled must be NMI like. > > Again, what you seem to want is to split the handler in a from-user and > from-kernel way, just like we did with #DB and MCE. See how > exc_debug_user() is IRQ-like and can send signals, while > exc_debug_kernel() is NMI like and can not. You are right, thanks for pointing this out. I replaced that patch by one implementing the split in a from-user and from-kernel part. Initial testing looks good, will send it out later this week. Thanks, Joerg