From nobody Thu Apr 2 02:40:39 2026 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) (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 3847A36655F for ; Tue, 31 Mar 2026 02:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.8 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774923312; cv=none; b=FFKC0aV1qX8h+zDnegxljzGch5gUpGEg4u7CpfvtWSyPbVZmTq0Se3DcX/DUMRckZFb/wMh/Gdl1qq/P7UmvTFu4Jod0KiJ5QPY5w53gsAgiDdQKlEgQAbg4dnrRhxcUO1bjgzWW6gmWNw7TpAAoD/Eh9z1l24eitI8oB883QB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774923312; c=relaxed/simple; bh=TfjFXIHkuW170vXqfJPDenhxgs1bqGIqJUs4bTky7pc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fvdQBiVWJYAGorTM4rVhn/9ccShYFQo6O66wA1cRXvUnE7DKuu6VF+9V2DnyvEV4/x4FgwVDPhPrkS08Ofi8PYe9FuWkj1IfxHcmooV6XSdIqHsyx3eNuigk0iGN7bRVjD7R/O3Yg5JS/UPv9y9bVrDiD7dgWv60yMnQNhZpDec= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KLn6oQfN; arc=none smtp.client-ip=192.198.163.8 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KLn6oQfN" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1774923302; x=1806459302; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TfjFXIHkuW170vXqfJPDenhxgs1bqGIqJUs4bTky7pc=; b=KLn6oQfNqAdX5HlHVCmXh0RnL9fgyVioBGqgfBig2WSuQvQXdo6jf7WL YUdE9h6zmdaVsW24lWUmdhjC5iwcfnj5isxJGKySjds7L9R2rV7WIjT15 CqcGczEp9HNowb85xKJm0sT7RSem/625uEgB9fqnizLr1oWj56SnogzVO vuxZmCNHoiGeNLhrVLhGCuhWSg6hddixyPOOpmAIxSmTUybZML4w3bVNJ 20sy3uayeIBMt64F5U9tpm0NN21iHRGBXUrifWnUBoNCr+SQJXXWl4WsF wh2og9Dx9QZ+/IUgGTFSUUJ9ahle50T8xzx8To+m+Fiu23zNjjhk72VcU A==; X-CSE-ConnectionGUID: o6q50zK+SBO302CjlGz03w== X-CSE-MsgGUID: nJMFC8PZSZyVWCr2DDvAIg== X-IronPort-AV: E=McAfee;i="6800,10657,11744"; a="93508102" X-IronPort-AV: E=Sophos;i="6.23,151,1770624000"; d="scan'208";a="93508102" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Mar 2026 19:07:46 -0700 X-CSE-ConnectionGUID: s1bAR/G7SOy/vkSfawh/LQ== X-CSE-MsgGUID: 47v05ZWqSjOIpmuw5dtuCw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,151,1770624000"; d="scan'208";a="221358700" Received: from chang-linux-3.sc.intel.com (HELO chang-linux-3) ([172.25.66.172]) by fmviesa006.fm.intel.com with ESMTP; 30 Mar 2026 19:07:45 -0700 From: "Chang S. Bae" To: linux-kernel@vger.kernel.org Cc: x86@kernel.org, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, peterz@infradead.org, david.kaplan@amd.com, chang.seok.bae@intel.com Subject: [PATCH v2 06/11] x86/apic: Implement self-NMI support Date: Tue, 31 Mar 2026 01:42:44 +0000 Message-ID: <20260331014251.86353-7-chang.seok.bae@intel.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260331014251.86353-1-chang.seok.bae@intel.com> References: <20260331014251.86353-1-chang.seok.bae@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: David Kaplan Add a function to send an NMI-to-self which is needed for stop-machine NMI facility. Note that send_IPI_self() cannot be used to send an NMI so send_IPI() is used. Signed-off-by: David Kaplan Signed-off-by: Chang S. Bae --- V1 -> V2: Fix a typo (Thomas) and wrap it under the new build option --- arch/x86/kernel/apic/ipi.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/arch/x86/kernel/apic/ipi.c b/arch/x86/kernel/apic/ipi.c index 98a57cb4aa86..597f03192a49 100644 --- a/arch/x86/kernel/apic/ipi.c +++ b/arch/x86/kernel/apic/ipi.c @@ -4,6 +4,7 @@ #include #include #include +#include =20 #include =20 @@ -248,6 +249,15 @@ void default_send_IPI_self(int vector) __default_send_IPI_shortcut(APIC_DEST_SELF, vector); } =20 +#ifdef CONFIG_STOP_MACHINE_NMI + +void arch_send_self_nmi(void) +{ + apic->send_IPI(smp_processor_id(), NMI_VECTOR); +} + +#endif + #ifdef CONFIG_X86_32 void default_send_IPI_mask_sequence_logical(const struct cpumask *mask, in= t vector) { --=20 2.51.0