Page MenuHomeFreeBSD

x86: Add NMI callback function.
Needs ReviewPublic

Authored by stevek on Mar 21 2024, 10:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 1:51 PM
Unknown Object (File)
Oct 3 2024, 12:39 PM
Unknown Object (File)
Oct 3 2024, 10:56 AM
Unknown Object (File)
Oct 1 2024, 1:27 PM
Unknown Object (File)
Oct 1 2024, 1:05 PM
Unknown Object (File)
Sep 30 2024, 11:17 PM
Unknown Object (File)
Sep 28 2024, 11:31 AM
Unknown Object (File)
Sep 27 2024, 4:54 PM
Subscribers

Details

Reviewers
markj
Summary

Repurpose 'nmi_call_kdb_smp' function to be able to call a callback
function that is meant for safely handling a callback in SMP
environment. The function increments reference on 'nmi_kdb_lock'
atomically for one of the CPU cores. The rest of the CPU cores
execute ia32_pause(). On return from the NMI handler the ref count
on 'nmi_kdb_lock' is dropped and call made to resume the CPU cores.

Obtained from: Juniper Networks, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 56861
Build 53749: arc lint + arc unit

Event Timeline

sys/x86/x86/cpu_machdep.c
884

Doesn't this kind of check now logically belong in the parent? It's a bit odd for the kdb handler to implement this.

897–899

The non-SMP handler should be refactored similarly, no?

sys/x86/x86/cpu_machdep.c
884

Good point. It should be able to move to nmi_handle_intr(), since that's what is called from the trap handler.

897–899

I don't think there's anything that needs to be done for it. It doesn't need to do all the work that the SMP case needs to in a single CPU case (or unicast, not broadcast.)

Updated based on review comments