From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 24A53C48BE5 for ; Tue, 15 Jun 2021 09:38:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 090C16142E for ; Tue, 15 Jun 2021 09:38:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231715AbhFOJkN (ORCPT ); Tue, 15 Jun 2021 05:40:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55930 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231760AbhFOJjz (ORCPT ); Tue, 15 Jun 2021 05:39:55 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8083C061574; Tue, 15 Jun 2021 02:37:47 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id C8B851EE; Tue, 15 Jun 2021 11:37:45 +0200 (CEST) Date: Tue, 15 Jun 2021 11:37:44 +0200 From: Joerg Roedel To: Borislav Petkov Cc: x86@kernel.org, Joerg Roedel , hpa@zytor.com, Andy Lutomirski , Dave Hansen , Peter Zijlstra , 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 v5 2/6] x86/sev-es: Make sure IRQs are disabled while GHCB is active Message-ID: References: <20210614135327.9921-1-joro@8bytes.org> <20210614135327.9921-3-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Mon, Jun 14, 2021 at 06:25:18PM +0200, Borislav Petkov wrote: > Thoughts? Okay, I tested a bit with this, it mostly works fine. The lockdep_hardirqs_disabled() check in __sev_get/put_ghcb() was problematic, because these functions are called also when no state is set up yet. More specifically it is called from __sev_es_nmi_complete(), which is called at the very beginning of do_nmi(), before the NMI handler entered NMI mode. So this triggered a warning in the NMI test-suite when booting up, I replaced these checks with a WARN_ON(!irqs_disabled()) and also removed the BUG_ON()s. With that it boots fine and without SEV-ES related warnings. Regards, Joerg