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)
Fri, May 17, 9:19 AM
Unknown Object (File)
Mon, May 13, 2:00 AM
Unknown Object (File)
Thu, May 9, 7:31 AM
Unknown Object (File)
Thu, May 2, 7:42 AM
Unknown Object (File)
Sat, Apr 27, 11:58 AM
Unknown Object (File)
Fri, Apr 26, 4:25 AM
Unknown Object (File)
Apr 22 2024, 1:45 PM
Unknown Object (File)
Apr 22 2024, 9:42 AM
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