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: <cd6e6d88-944c-40b2-a343-3d81415d9b64@intel.com>
Date: Tue, 3 Jun 2025 11:02:25 -0700
From: Sohil Mehta <sohil.mehta@...el.com>
To: Dave Hansen <dave.hansen@...el.com>, <x86@...nel.org>,
	<linux-kernel@...r.kernel.org>
CC: 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 v6 3/9] x86/nmi: Extend the registration interface to
 include the NMI-source vector

On 6/3/2025 10:07 AM, Dave Hansen wrote:
> On 5/13/25 13:37, Sohil Mehta wrote:

>> -	retval = register_nmi_handler(NMI_IO_CHECK, hpwdt_pretimeout, 0, "hpwdt");
>> +	retval = register_nmi_handler(NMI_IO_CHECK, hpwdt_pretimeout, 0, "hpwdt", 0);
>>  	if (retval)
> 
> Could we get rid of all these random 0's, please? (or at least try to
> keep them from proliferating).
> 

I had patches for avoiding both zeros, but I ended up not including
them. I wasn't sure if folks prefer '0' when not using a parameter or
explicitly prefer to deny.

> Either do a:
> 
> 	register_nmi_handler_source()
> 
> that takes a source and leave
> 
> 	register_nmi_handler()
> 
> in place and not take a source. Or, do this:

> 
> 	retval = register_nmi_handler(NMI_IO_CHECK, hpwdt_pretimeout,
> 				      0, "hpwdt", NMI_NO_SOURCE);
> 

I prefer this approach. Since we are touching all these lines, maybe
it's a good time to get rid of the other 0 as well (in a separate patch).

The 3rd parameter pertains to handler "flags". The only flag in use
right now is NMI_FLAG_FIRST. Assuming that more flags might get added
later, the 0 should probably correspond to NMI_FLAG_NONE. Agree?

The other option would be NMI_FLAG_LAST, which would be the opposite of
NMI_FLAG_FIRST, but that seems shortsighted.


> where the 0 is at least given a symbolic name.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ