#
47288801 |
| 29-Jul-2024 |
Mark Johnston <markj@FreeBSD.org> |
proc: Remove kernel stack swapping support, part 6
- Remove most checks of the P_INMEM flag. - Some uses remain since a few userspace tools, e.g., ps(1) and top(1) expect the flag to be set. Thes
proc: Remove kernel stack swapping support, part 6
- Remove most checks of the P_INMEM flag. - Some uses remain since a few userspace tools, e.g., ps(1) and top(1) expect the flag to be set. These can be cleaned up but the code has most likely been copy-pasted elsewhere and while linger for a long time.
Tested by: pho Reviewed by: alc, imp, kib Differential Revision: https://reviews.freebsd.org/D46117
show more ...
|
#
f0a7df4a |
| 09-Jul-2024 |
Ryan Libby <rlibby@FreeBSD.org> |
ddb: make db_error reliably no-return
Most code assumes db_error does not return, but according to kdb_reenter_silent, there may be cases where it could. Instead, panic if kdb_reenter_silent return
ddb: make db_error reliably no-return
Most code assumes db_error does not return, but according to kdb_reenter_silent, there may be cases where it could. Instead, panic if kdb_reenter_silent returns and mark the routine as __dead2. This addresses gcc warnings.
Reported by: GCC -Wmaybe-uninitialized Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45918
show more ...
|
Revision tags: release/14.1.0 |
|
#
076b64e8 |
| 12-Mar-2024 |
Andrew Turner <andrew@FreeBSD.org> |
sys/ddb: Add hardware breakpoint support to ddb
As with hardware watchpoints add support for hardware breakpoints. The command is only enabled on architectures that report support for them. Currentl
sys/ddb: Add hardware breakpoint support to ddb
As with hardware watchpoints add support for hardware breakpoints. The command is only enabled on architectures that report support for them. Currently no architectures do, however arm64 will add support in a future change.
Reviewed by: jhb (earlier version) Sponsored by: Arm Ltd Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D22191
show more ...
|
#
c21bc6f3 |
| 22-Mar-2024 |
Bojan Novković <bnovkov@FreeBSD.org> |
ddb: Add CTF-based pretty printing
Add basic CTF support and a CTF-powered pretty-printer to ddb.
The db_ctf.* files expose a basic interface for fetching type data for ELF symbols, interacting wit
ddb: Add CTF-based pretty printing
Add basic CTF support and a CTF-powered pretty-printer to ddb.
The db_ctf.* files expose a basic interface for fetching type data for ELF symbols, interacting with the CTF string table, and translating type identifiers to type data.
The db_pprint.c file uses those interfaces to implement a pretty-printer for all kernel ELF symbols. The pretty-printer works with symbol names and arbitrary addresses: pprint struct thread 0xffffffff8194ad90
Pretty-printing currently only works after the root filesystem gets mounted because the CTF info is not available during early boot.
Differential Revision: https://reviews.freebsd.org/D37899 Approved by: markj (mentor)
show more ...
|
Revision tags: release/13.3.0 |
|
#
fdafd315 |
| 24-Nov-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remov
sys: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate no-longer-needed sys/cdefs.h includes as well as now-empty blank lines in a row.
Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/ Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/ Remove /\n+#if.*\n#endif.*\n+/ Remove /^#if.*\n#endif.*\n/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/ Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/
Sponsored by: Netflix
show more ...
|
Revision tags: release/14.0.0 |
|
#
685dc743 |
| 16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
Revision tags: release/13.2.0 |
|
#
56448506 |
| 07-Jan-2023 |
Mitchell Horne <mhorne@FreeBSD.org> |
ddb: have 'reset' command use normal reboot path
This conditionally gives all registered shutdown handlers a chance to perform the reboot, with cpu_reset() being the fallback. The '\s' modifier can
ddb: have 'reset' command use normal reboot path
This conditionally gives all registered shutdown handlers a chance to perform the reboot, with cpu_reset() being the fallback. The '\s' modifier can be used with the command to get the previous behaviour.
The motivation is that some platforms may not be able do anything meaningful via cpu_reset(), due to a lack of standardized reset mechanism and/or firmware shortcomings. However, they may have a separate device driver attached that normally performs the reboot. Such is the case for some versions of the Raspberry Pi, where reset via PSCI fails, but the BCM2835 watchdog driver has a shutdown hook.
Reported by: bz Reviewed by: markj (slightly earlier version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D37981
show more ...
|
Revision tags: release/12.4.0 |
|
#
c036339d |
| 02-Nov-2022 |
Mark Johnston <markj@FreeBSD.org> |
ddb: Don't flag breakpoint/watchpoint commands as MEMSAFE
They could potentially be abused to overwrite kernel memory, so shouldn't be accessible when mac_ddb is loaded.
Reviewed by: mhorne Fixes:
ddb: Don't flag breakpoint/watchpoint commands as MEMSAFE
They could potentially be abused to overwrite kernel memory, so shouldn't be accessible when mac_ddb is loaded.
Reviewed by: mhorne Fixes: bc4ea61d55cb ("ddb: tag core commands with DB_CMD_MEMSAFE") Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D37105
show more ...
|
#
2449b9e5 |
| 18-Jul-2022 |
Mitchell Horne <mhorne@FreeBSD.org> |
mac: kdb/ddb framework hooks
Add three simple hooks to the debugger allowing for a loaded MAC policy to intervene if desired: 1. Before invoking the kdb backend 2. Before ddb command registration
mac: kdb/ddb framework hooks
Add three simple hooks to the debugger allowing for a loaded MAC policy to intervene if desired: 1. Before invoking the kdb backend 2. Before ddb command registration 3. Before ddb command execution
We extend struct db_command with a private pointer and two flag bits reserved for policy use.
Reviewed by: markj Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35370
show more ...
|
#
a305b20e |
| 18-Jul-2022 |
Mitchell Horne <mhorne@FreeBSD.org> |
ddb: tag core commands with DB_CMD_MEMSAFE
Those which are statically defined in db_command.c.
Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.
ddb: tag core commands with DB_CMD_MEMSAFE
Those which are statically defined in db_command.c.
Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35584
show more ...
|
#
c84c5e00 |
| 18-Jul-2022 |
Mitchell Horne <mhorne@FreeBSD.org> |
ddb: annotate some commands with DB_CMD_MEMSAFE
This is not completely exhaustive, but covers a large majority of commands in the tree.
Reviewed by: markj Sponsored by: Juniper Networks, Inc. Spons
ddb: annotate some commands with DB_CMD_MEMSAFE
This is not completely exhaustive, but covers a large majority of commands in the tree.
Reviewed by: markj Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35583
show more ...
|
#
8a099482 |
| 05-Jul-2022 |
Mitchell Horne <mhorne@FreeBSD.org> |
db_command.c: use designated initializers
Provide separate helper macros for regular commands and next-level table commands as they are mutually exclusive. This ensures proper initialization of each
db_command.c: use designated initializers
Provide separate helper macros for regular commands and next-level table commands as they are mutually exclusive. This ensures proper initialization of each element and allows us to exclude some redundant fields, such as specifying .more = NULL for every regular command.
Reviewed by: markj, jhb MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35580
show more ...
|
#
4f2ad624 |
| 05-Jul-2022 |
Mitchell Horne <mhorne@FreeBSD.org> |
db_command.c: style
Reviewed by: jhb MFC after: 3 days Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35368
|
#
4ef7db5a |
| 14-Jun-2022 |
Mitchell Horne <mhorne@FreeBSD.org> |
ddb: namespacing of struct command
'command' is too generic for something specific to the kernel debugger; change this so it is less likely to collide with local variable names. Also rename struct c
ddb: namespacing of struct command
'command' is too generic for something specific to the kernel debugger; change this so it is less likely to collide with local variable names. Also rename struct command_table to struct db_command_table.
Reviewed by: markj MFC after: 1 week Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D35367
show more ...
|
Revision tags: release/13.1.0, release/12.3.0, release/13.0.0 |
|
#
d85c9cef |
| 25-Feb-2021 |
Ryan Libby <rlibby@FreeBSD.org> |
ddb: reliably fail with ambiguous commands
db_cmd_match had an even/odd bug, where if a third command was partially matched (or any odd number greater than one) the search result would be set back f
ddb: reliably fail with ambiguous commands
db_cmd_match had an even/odd bug, where if a third command was partially matched (or any odd number greater than one) the search result would be set back from CMD_AMBIGUOUS to CMD_FOUND, causing the last command in the list to be executed instead of failing the match.
Reported by: mlaier Reviewed by: markj, mlaier, vangyzen Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D28659
show more ...
|
#
fa2528ac |
| 18-Feb-2021 |
Alex Richardson <arichardson@FreeBSD.org> |
Use atomic loads/stores when updating td->td_state
KCSAN complains about racy accesses in the locking code. Those races are fine since they are inside a TD_SET_RUNNING() loop that expects the value
Use atomic loads/stores when updating td->td_state
KCSAN complains about racy accesses in the locking code. Those races are fine since they are inside a TD_SET_RUNNING() loop that expects the value to be changed by another CPU.
Use relaxed atomic stores/loads to indicate that this variable can be written/read by multiple CPUs at the same time. This will also prevent the compiler from doing unexpected re-ordering.
Reported by: GENERIC-KCSAN Test Plan: KCSAN no longer complains, kernel still runs fine. Reviewed By: markj, mjg (earlier version) Differential Revision: https://reviews.freebsd.org/D28569
show more ...
|
#
3e06c7da |
| 01-Jan-2021 |
John Baldwin <jhb@FreeBSD.org> |
Use kdb_thr_* to iterate over threads consistently in DDB.
The "findstack", "show all trace", and "show active trace" commands were iterating over allproc to enumerate threads. This missed threads
Use kdb_thr_* to iterate over threads consistently in DDB.
The "findstack", "show all trace", and "show active trace" commands were iterating over allproc to enumerate threads. This missed threads executing in exit1() after being removed from allproc.
Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27829
show more ...
|
#
825d2341 |
| 01-Jan-2021 |
John Baldwin <jhb@FreeBSD.org> |
Don't check P_INMEM in kdb_thr_*().
Not all debugger operations that enumerate threads require thread stacks to be resident in memory to be useful. Instead, push P_INMEM checks (if needed) into cal
Don't check P_INMEM in kdb_thr_*().
Not all debugger operations that enumerate threads require thread stacks to be resident in memory to be useful. Instead, push P_INMEM checks (if needed) into callers.
Reviewed by: kib Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D27827
show more ...
|
Revision tags: release/12.2.0, release/11.4.0, release/12.1.0, release/11.3.0 |
|
#
0269ae4c |
| 06-Jun-2019 |
Alan Somers <asomers@FreeBSD.org> |
MFHead @348740
Sponsored by: The FreeBSD Foundation
|
#
e2e050c8 |
| 20-May-2019 |
Conrad Meyer <cem@FreeBSD.org> |
Extract eventfilter declarations to sys/_eventfilter.h
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces hea
Extract eventfilter declarations to sys/_eventfilter.h
This allows replacing "sys/eventfilter.h" includes with "sys/_eventfilter.h" in other header files (e.g., sys/{bus,conf,cpu}.h) and reduces header pollution substantially.
EVENTHANDLER_DECLARE and EVENTHANDLER_LIST_DECLAREs were moved out of .c files into appropriate headers (e.g., sys/proc.h, powernv/opal.h).
As a side effect of reduced header pollution, many .c files and headers no longer contain needed definitions. The remainder of the patch addresses adding appropriate includes to fix those files.
LOCK_DEBUG and LOCK_FILE_LINE_ARG are moved to sys/_lock.h, as required by sys/mutex.h since r326106 (but silently protected by header pollution prior to this change).
No functional change (intended). Of course, any out of tree modules that relied on header pollution for sys/eventhandler.h, sys/lock.h, or sys/mutex.h inclusion need to be fixed. __FreeBSD_version has been bumped.
show more ...
|
Revision tags: release/12.0.0 |
|
#
c6879c6c |
| 23-Oct-2018 |
Dimitry Andric <dim@FreeBSD.org> |
Merge ^/head r339015 through r339669.
|
#
e41793db |
| 20-Oct-2018 |
Conrad Meyer <cem@FreeBSD.org> |
ddb: Enable 'thread <address>'
Currently, the 'thread' command (to switch the debugger to another thread) only accepts decimal-encoded tids. Use the same parsing logic as 'show thread <arg>' to acc
ddb: Enable 'thread <address>'
Currently, the 'thread' command (to switch the debugger to another thread) only accepts decimal-encoded tids. Use the same parsing logic as 'show thread <arg>' to accept hex-encoded thread pointers in addition to decimal-encoded tids.
Document the 'thread' command in ddb.4 and expand the 'show thread' documentation to cover the tid usage.
Reported by: bwidawsk Reviewed by: bwidawsk (earlier version), kib (earlier version), markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D16962
show more ...
|
Revision tags: release/11.2.0 |
|
#
3531bbb5 |
| 17-Apr-2018 |
Warner Losh <imp@FreeBSD.org> |
Restore db_radix on parse error, otherwise we'll silently change it to 10 on a botched trace command.
|
#
796df753 |
| 30-Nov-2017 |
Pedro F. Giffuni <pfg@FreeBSD.org> |
SPDX: Consider code from Carnegie-Mellon University.
Interesting cases, most likely from CMU Mach sources.
|
#
212ff84f |
| 28-Nov-2017 |
Edward Tomasz Napierala <trasz@FreeBSD.org> |
Make kdb_reenter() silent when explicitly called from db_error(). This removes the useless backtrace on various ddb(4) user errors.
Reviewed by: jhb@ Obtained from: CheriBSD MFC after: 2 weeks Spons
Make kdb_reenter() silent when explicitly called from db_error(). This removes the useless backtrace on various ddb(4) user errors.
Reviewed by: jhb@ Obtained from: CheriBSD MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D13212
show more ...
|