Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2932543rdb; Tue, 6 Feb 2024 02:02:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWF8TJ/OJtu7TkIlDxWPQ/G4DWMl3rgLTgCIyptQABPyAB70BN9RjDa9+FQD1WX9NGctyt X-Received: by 2002:ac8:5812:0:b0:42c:3335:941c with SMTP id g18-20020ac85812000000b0042c3335941cmr2515728qtg.5.1707213746749; Tue, 06 Feb 2024 02:02:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707213746; cv=pass; d=google.com; s=arc-20160816; b=00u+M6Bx+U2P9BjCap0Lqssq1ViRDRJFWT74la02nupmV9d7tx71zu8FGkqh5n/WbJ R/cxYVF2tBXH1ck+ivKE25LxVCXcucZtbkzDKqyMIA7RJSVr8BiTON98/t9L6IWNGPEy iaD34Zn4tufGhcjBnnpJmPsWVoPXB6748u3EdSg1yU5X6RImimMZiQrGlfxpgbb1dHsG NNDqafjCTmCVglK9RLbsN4/Y7Tk6EydtP5gMfni+V/19tol07rV3kOTu2rk672gj6cEz L+3gSG5IcttOOVQDTkixHPgB5pzi0uHU1Sp9M+hlB4aIKqOLHGzWDCvUpeAXhvko3FsH pxjg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:precedence:robot-unsubscribe:robot-id :message-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:in-reply-to:cc:subject:to:reply-to:sender :from:dkim-signature:dkim-signature:date; bh=pw8nOl6Xd35BIIwnw4TJPtMp9fLUt9BWbETiOqwVMss=; fh=Hv52rMfOiRedz50rRPXNhwsIKjeZnFnnsInDWRe3wUA=; b=z984h5321yLqtC7q2c88Szer/BCONAlKljcPLlxOeeaYLqnG1MGAbSifbQb/03k/qi FMIH3c0zTrozLduhsfEVFkGGiI6D53NzC2i8pwtq5gtC403fTOe3YErtMPGmc2JBOTsV 8tlI13kW5EmdPSGuVF9iklUBDVx6Or7gIxzA8X4YobDGIWzJURjAgpW2OD2oJ47E39iG mhbb4EyfLPzu3SOr5mTy5uhKMRgv6c29O+Psr/MguzckzpLt3Asp6CqtxnkNjztoxxjz DPnnUsFieJT5B3cj1qYj/bI3lx9t5ksR2lr4c4EMHGN66Ff07rGLnNfpZNEHrfXFA2Xz oZQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4j3laHXV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-54641-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54641-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=1; AJvYcCV8vYCf/nI+LxtTP7ol4moV/4w3M6I38Zc14d4zOVVRNa5XqxM3mSI0VPoHv+gOsh6s9DmkStHWp/Ro2caTY+bRTwJ+chQOeyhDSyNisA== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id k17-20020ac81411000000b0042c2f350bc2si1785983qtj.744.2024.02.06.02.02.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 02:02:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-54641-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=4j3laHXV; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-54641-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-54641-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 61D671C22E01 for ; Tue, 6 Feb 2024 10:02:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 222F712E1C9; Tue, 6 Feb 2024 10:02:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4j3laHXV"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="PlyAuetE" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 8527E12D75F; Tue, 6 Feb 2024 10:02:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707213726; cv=none; b=gDlvrbU0ixsv+cEeZKoHCW6XkXyvOt82s7PaXVZL6E9ouBXjJheIk/tKvEGFMBuwxsLSqXHsjjN6veqQc6vYOArWUSd/05gVSttOvpPgDPQM9NJTIIXOvxeFozWUe7lrb0q9k6zjY7F1waULqqgUlQ8+wsgMZRvrJviKazWu7Oc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707213726; c=relaxed/simple; bh=NTfMPbcLXHzOEzBkAFFoK6F8lJR6D3zYbcL8c4upvs4=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=fsJ3HwKjWAn/JfbPir+gzB3qvBXPfPjBpl/rzSuqK8KlFzDFs5jTul38D8Y+bVmrwDba0Q0pkh1kJZM0bIdLukiOlJEFzgkrKb9z/1O7syhYT4yLSCzH1/Aa6nglR76IducY1wl79UcH+IkZmd/CqVx27kqJrz9+6oETjGrT+tc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=4j3laHXV; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=PlyAuetE; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Date: Tue, 06 Feb 2024 10:01:55 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707213716; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pw8nOl6Xd35BIIwnw4TJPtMp9fLUt9BWbETiOqwVMss=; b=4j3laHXV/SVhfmDa1q8SrWGXQgYi8uEXbmhrEvLm8f3GJVd8RZfHn9Ck0MFDZfjomuwfK7 /G2lqJnTaue+IaNUgDxdEGhfeB9t1zrsMbe5WyuF/40v2F37fytKaI1ZOJwTj+wGlke5SM YI9NKduEy9F/u7P5+jQ0i09D28X/2qgQKY8ox4qZC0t0bI3DA/NNDoi4cacyDq5Yx1xPhp 3g4UhsV13smS2PcXPvzdfhb16MTT7HLyP8ZHpgK0hm1YD1f4LaoABwyaU/l8yZeVPQ/POG hPZ4xGiB3GpGeh1jbIVGFSP/BKg/1QVvMevk4TCx91P6aD5PXqiK50OldR3zcQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707213716; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pw8nOl6Xd35BIIwnw4TJPtMp9fLUt9BWbETiOqwVMss=; b=PlyAuetE1RmvWeEp7wlRTOajknyHzOEuuY5XKy7rASTWd6s/Y4irdwmQxMUWkQgfa0IUUH ka6/GaZ6y8v/8PBg== From: tip-bot2 for NOMURA =?utf-8?b?SlVOSUNISSjph47mnZEg5rez5LiAKQ==?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/boot] x86/boot: Add a message about ignored early NMIs Cc: Borislav Petkov , "H. Peter Anvin" , "Jun'ichi Nomura" , "Kirill A. Shutemov" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20231130103339.GCZWhlA196uRklTMNF@fat_crate.local> References: <20231130103339.GCZWhlA196uRklTMNF@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <170721371582.398.17711309093977482776.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/boot branch of tip: Commit-ID: ac456ca0af4fe9630cf84e7efd20b7f7bf596aab Gitweb: https://git.kernel.org/tip/ac456ca0af4fe9630cf84e7efd20b7f7bf5= 96aab Author: NOMURA JUNICHI(=E9=87=8E=E6=9D=91=E3=80=80=E6=B7=B3=E4=B8=80) = AuthorDate: Fri, 02 Feb 2024 03:51:58=20 Committer: Borislav Petkov (AMD) CommitterDate: Tue, 06 Feb 2024 10:51:11 +01:00 x86/boot: Add a message about ignored early NMIs Commit 78a509fba9c9 ("x86/boot: Ignore NMIs during very early boot") added an empty handler in early boot stage to avoid boot failure due to spurious NMIs. Add a diagnostic message to show that early NMIs have occurred. [ bp: Touchups. ] [ Committer note: tested by stopping the guest really early and injecting NMIs through qemu's monitor. Result: early console in setup code Spurious early NMIs ignored: 13 ... ] Suggested-by: Borislav Petkov Suggested-by: H. Peter Anvin Signed-off-by: Jun'ichi Nomura Signed-off-by: Borislav Petkov (AMD) Acked-by: Kirill A. Shutemov Link: https://lore.kernel.org/lkml/20231130103339.GCZWhlA196uRklTMNF@fat_crat= e.local --- arch/x86/boot/compressed/ident_map_64.c | 2 +- arch/x86/boot/compressed/misc.c | 7 +++++++ arch/x86/boot/compressed/misc.h | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/boot/compressed/ident_map_64.c b/arch/x86/boot/compress= ed/ident_map_64.c index d040080..4a029ba 100644 --- a/arch/x86/boot/compressed/ident_map_64.c +++ b/arch/x86/boot/compressed/ident_map_64.c @@ -389,5 +389,5 @@ void do_boot_page_fault(struct pt_regs *regs, unsigned lo= ng error_code) =20 void do_boot_nmi_trap(struct pt_regs *regs, unsigned long error_code) { - /* Empty handler to ignore NMI during early boot */ + spurious_nmi_count++; } diff --git a/arch/x86/boot/compressed/misc.c b/arch/x86/boot/compressed/misc.c index bf2aac4..bd6857a 100644 --- a/arch/x86/boot/compressed/misc.c +++ b/arch/x86/boot/compressed/misc.c @@ -52,6 +52,7 @@ struct port_io_ops pio_ops; =20 memptr free_mem_ptr; memptr free_mem_end_ptr; +int spurious_nmi_count; =20 static char *vidmem; static int vidport; @@ -506,6 +507,12 @@ asmlinkage __visible void *extract_kernel(void *rmode, u= nsigned char *output) /* Disable exception handling before booting the kernel */ cleanup_exception_handling(); =20 + if (spurious_nmi_count) { + error_putstr("Spurious early NMIs ignored: "); + error_putdec(spurious_nmi_count); + error_putstr("\n"); + } + return output + entry_offset; } =20 diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h index 6502bc6..b353a7b 100644 --- a/arch/x86/boot/compressed/misc.h +++ b/arch/x86/boot/compressed/misc.h @@ -59,6 +59,7 @@ extern char _head[], _end[]; /* misc.c */ extern memptr free_mem_ptr; extern memptr free_mem_end_ptr; +extern int spurious_nmi_count; void *malloc(int size); void free(void *where); void __putstr(const char *s);