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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5276d1ff-be9c-4391-ae64-4f7451f6ced8@zytor.com>
Date: Tue, 3 Jun 2025 00:23:53 -0700
From: Xin Li <xin@...or.com>
To: Sohil Mehta <sohil.mehta@...el.com>, x86@...nel.org,
        linux-kernel@...r.kernel.org
Cc: "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 v6 3/9] x86/nmi: Extend the registration interface to
 include the NMI-source vector

On 5/13/2025 1:37 PM, Sohil Mehta wrote:
> To prepare for NMI-source reporting, add a source vector argument to the
> NMI handler registration interface. Later, this will be used to
> register NMI handlers with a unique source vector that can be used to
> identify the originator of the NMI.
> 
> For now, just extend the interface and pass zero as the source vector
> for all handlers. No functional change intended.
> 
> Originally-by: Jacob Pan <jacob.jun.pan@...ux.intel.com>
> Signed-off-by: Sohil Mehta <sohil.mehta@...el.com>

Just two nits below, other than that:

Reviewed-by: Xin Li (Intel) <xin@...or.com>
> diff --git a/arch/x86/include/asm/nmi.h b/arch/x86/include/asm/nmi.h
> index 79d88d12c8fb..f0a577bf7bba 100644
> --- a/arch/x86/include/asm/nmi.h
> +++ b/arch/x86/include/asm/nmi.h
> @@ -54,6 +54,7 @@ struct nmiaction {
>   	u64			max_duration;
>   	unsigned long		flags;
>   	const char		*name;
> +	u8			source_vector;
>   };
>   
>   /**
> @@ -62,6 +63,7 @@ struct nmiaction {
>    * @fn:   The NMI handler
>    * @fg:   Flags associated with the NMI handler
>    * @n:    Name of the NMI handler
> + * @src:  NMI-source based vector for the NMI handler

"NMI-source based" sounds weird to me.

>    * @init: Optional __init* attributes for struct nmiaction
>    *
>    * Adds the provided handler to the list of handlers for the specified
> @@ -75,13 +77,14 @@ struct nmiaction {
>    *
>    * Return: 0 on success, or an error code on failure.
>    */
> -#define register_nmi_handler(t, fn, fg, n, init...)	\
> +#define register_nmi_handler(t, fn, fg, n, src, init...)	\
>   ({							\
>   	static struct nmiaction init fn##_na = {	\
>   		.list = LIST_HEAD_INIT(fn##_na.list),	\
>   		.handler = (fn),			\
>   		.name = (n),				\
>   		.flags = (fg),				\
> +		.source_vector = (src),			\
>   	};						\
>   	__register_nmi_handler((t), &fn##_na);		\
>   })
Please keep the line-ending backslashes (\) aligned.

I guess you want to keep the change minimal.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ