lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aFO/q52D4XkzmO4i@intel.com>
Date: Thu, 19 Jun 2025 15:43:39 +0800
From: Chao Gao <chao.gao@...el.com>
To: Sohil Mehta <sohil.mehta@...el.com>
CC: <x86@...nel.org>, <linux-kernel@...r.kernel.org>, Xin Li <xin@...or.com>,
	"H . Peter Anvin" <hpa@...or.com>, Andy Lutomirski <luto@...nel.org>, "Thomas
 Gleixner" <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>, "Borislav
 Petkov" <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>, "Peter
 Zijlstra" <peterz@...radead.org>, Sean Christopherson <seanjc@...gle.com>,
	Adrian Hunter <adrian.hunter@...el.com>, Kan Liang
	<kan.liang@...ux.intel.com>, Tony Luck <tony.luck@...el.com>, Zhang Rui
	<rui.zhang@...el.com>, Steven Rostedt <rostedt@...dmis.org>, Andrew Cooper
	<andrew.cooper3@...rix.com>, "Kirill A . Shutemov"
	<kirill.shutemov@...ux.intel.com>, Jacob Pan <jacob.pan@...ux.microsoft.com>,
	Andi Kleen <ak@...ux.intel.com>, Kai Huang <kai.huang@...el.com>, "Sandipan
 Das" <sandipan.das@....com>, <linux-perf-users@...r.kernel.org>,
	<linux-edac@...r.kernel.org>, <kvm@...r.kernel.org>,
	<linux-pm@...r.kernel.org>, <linux-trace-kernel@...r.kernel.org>
Subject: Re: [PATCH v7 07/10] x86/nmi: Prepare for the new NMI-source vector
 encoding

On Thu, Jun 12, 2025 at 02:48:46PM -0700, Sohil Mehta wrote:
>When using the send_IPI_* APIC calls, callers typically use NMI vector
>0x2 to trigger NMIs. The APIC APIs convert the NMI vector to the NMI
>delivery mode, which is eventually used to program the APIC.
>
>Before FRED, the hardware would ignore the vector used with NMI delivery
>mode. However, with NMI-source reporting, the vector information is
>relayed to the destination CPU, which sets the corresponding bit in the
>NMI-source bitmap. Unfortunately, the kernel now needs to maintain a new
>set of NMI vectors and differentiate them from the IDT vectors.
>
>Instead of creating a parallel set of send_NMI_* APIs to handle
>NMI-source vectors, enhance the existing send_IPI_* APIs with a new
>encoding scheme to handle the NMI delivery mode along with the
>NMI-source vector.
>
>NMI-source vectors would be encoded as:
>    APIC_DM_NMI (0x400) | NMI_SOURCE_VECTOR (0x1-0xF)
>
>Also, introduce a helper to prepare the ICR value with the encoded
>delivery mode and vector. Update the guest paravirtual APIC code to use
>the new helper as well.
>
>While at it, rename APIC_DM_FIXED_MASK to the more appropriate
>APIC_DM_MASK.
>
>Suggested-by: Sean Christopherson <seanjc@...gle.com>
>Co-developed-by: Xin Li (Intel) <xin@...or.com>
>Signed-off-by: Xin Li (Intel) <xin@...or.com>
>Signed-off-by: Sohil Mehta <sohil.mehta@...el.com>

Reviewed-by: Chao Gao <chao.gao@...el.com>

One nit below,

>--- a/arch/x86/kernel/apic/local.h
>+++ b/arch/x86/kernel/apic/local.h
>@@ -24,22 +24,24 @@ extern u32 x2apic_max_apicid;
> 
> /* IPI */
> 
>+u16 __prepare_ICR_DM_vector(u16 vector);
>+

This seems unnecessary. local.h already includes asm/apic.h, where the function
is defined.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ