Thread (24 messages) 24 messages, 5 authors, 2025-05-09

Re: [PATCH v5 5/9] x86/nmi: Add support to handle NMIs with source information

From: Peter Zijlstra <peterz@infradead.org>
Date: 2025-05-08 20:49:26
Also in: kvm, linux-edac, linux-perf-users, linux-pm, lkml

On Thu, May 08, 2025 at 01:23:04PM -0700, H. Peter Anvin wrote:
On May 8, 2025 5:15:44 AM PDT, Peter Zijlstra [off-list ref] wrote:
quoted
quoted
Looks good, except when fred_event_data() returns 0. I don't expect it
to happen in practice. But, maybe with new hardware and eventually
different hypervisors being involved, it is a possibility.

We can either call it a bug that an NMI happened without source
information. Or be extra nice and do this:

if (cpu_feature_enabled(X86_FEATURE_NMI_SOURCE) && type == NMI_LOCAL) {
	source = fred_event_data(regs);
	if (!source || (source & BIT(0)))
		source = ~0UL;
}
Perhaps also WARN about the !source case?
A 0 should be interpreted such that NMI source is not available, e.g.
due to a broken hypervisor or similar.
I'm reading that as an agreement for WARN-ing on 0. We should definitely
WARN on broken hypervisors and similar.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help