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, Nov 3, 7:02 PM
Unknown Object (File)
Sat, Nov 1, 7:05 AM
Unknown Object (File)
Thu, Oct 30, 9:32 AM
Unknown Object (File)
Thu, Oct 30, 7:42 AM
Unknown Object (File)
Thu, Oct 30, 7:31 AM
Unknown Object (File)
Thu, Oct 30, 4:18 AM
Unknown Object (File)
Wed, Oct 29, 9:11 PM
Unknown Object (File)
Wed, Oct 29, 7:39 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 56730
Build 53618: arc lint + arc unit

Event Timeline

sys/x86/x86/cpu_machdep.c
885

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

900

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

sys/x86/x86/cpu_machdep.c
885

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

900

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