]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC 322437: Reliably enable debug exceptions on all CPUs.
authorjhb <jhb@FreeBSD.org>
Mon, 21 Aug 2017 17:35:04 +0000 (17:35 +0000)
committerjhb <jhb@FreeBSD.org>
Mon, 21 Aug 2017 17:35:04 +0000 (17:35 +0000)
commitb14bb46cc9d774b0726856a5f4fb11881b598557
treecce7c945052c8aab152c9ed7468177fff6dd4100
parentfb69609c7af02dccc15e0551e0feba7545f3279f
MFC 322437: Reliably enable debug exceptions on all CPUs.

Previously, debug exceptions were only enabled on the boot CPU if
DDB was enabled in the dbg_monitor_init() function.  APs also called
this function, but since mp_machdep.c doesn't include opt_ddb.h, the
APs ended up calling an empty stub defined in <machine/debug_monitor.h>
instead of the real function.  Also, if DDB was not enabled in the kernel,
the boot CPU would not enable debug exceptions.

Fix this by adding a new dbg_init() function that always clears the OS
lock to enable debug exceptions which the boot CPU and the APs call.
This function also calls dbg_monitor_init() to enable hardware breakpoints
from DDB on all CPUs if DDB is enabled.  Eventually base support for
hardware breakpoints/watchpoints will need to move out of the DDB-only
debug_monitor.c for use by userland debuggers.
sys/arm64/arm64/debug_monitor.c
sys/arm64/arm64/machdep.c
sys/arm64/arm64/mp_machdep.c
sys/arm64/include/machdep.h