#
f242c47e |
|
12-Mar-2024 |
Andrew Turner <andrew@FreeBSD.org> |
arm64: Support hardware breakpoints As with watchpoints allow the kernel debugger to set hardware breakpoints on arm64. These have been tested to work in both the ddb and gdb backends. Reviewed by: jhb (earlier version) Sponsored by: Arm Ltd Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D44355
|
#
03d04bf4 |
|
12-Jan-2024 |
Minsoo Choo <minsoochoo0122@proton.me> |
Stop using expressions in _Alignof() _Alignof(expression) is a non-standard extension. This is not allowed in gnu11 and gnu17 which follow the C11 standard _Alignof(type). Reviewed by: arichardson, imp, jhb Fixes: 4a9cd9fc22d7 amd64 db_trace: Reject unaligned frame pointers Fixes: 7ccaf76a27f1 riscv db_trace: Ensure trapframe pointer is suitably aligned. Fixes: 638c68897fbd arm64 db_trace: Ensure trapframe pointer is suitably aligned. Differential Revision: https://reviews.freebsd.org/D43409
|
#
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. 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
|
#
638c6889 |
|
17-Aug-2023 |
John Baldwin <jhb@FreeBSD.org> |
arm64 db_trace: Ensure trapframe pointer is suitably aligned. Reviewed by: jrtc27, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D41486
|
#
685dc743 |
|
16-Aug-2023 |
Warner Losh <imp@FreeBSD.org> |
sys: Remove $FreeBSD$: one-line .c pattern Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
#
89c52f9d |
|
23-Mar-2023 |
Kyle Evans <kevans@FreeBSD.org> |
arm64: add KASAN support This entails: - Marking some obvious candidates for __nosanitizeaddress - Similar trap frame markings as amd64, for similar reasons - Shadow map implementation The shadow map implementation is roughly similar to what was done on amd64, with some exceptions. Attempting to use available space at preinit_map_va + PMAP_PREINIT_MAPPING_SIZE (up to the end of that range, as depicted in the physmap) results in odd failures, so we instead search the physmap for free regions that we can carve out, fragmenting the shadow map as necessary to try and fit as much as we need for the initial kernel map. pmap_bootstrap_san() is thus after pmap_bootstrap(), which still included some technically reserved areas of the memory map that needed to be included in the DMAP. The odd failure noted above may be a bug, but I haven't investigated it all that much. Initial work by mhorne with additional fixes from kevans and markj. Reviewed by: andrew, markj Sponsored by: Juniper Networks, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D36701
|
#
1c1f31a5 |
|
21-Mar-2023 |
Andrew Turner <andrew@FreeBSD.org> |
Remove unused registes from the arm pcb These were kept for ABI reasons. Remove them and bump __FreeBSD_version so debuggers can be updated to use the new layout. Reviewed by: jhb Sponsored by: Arm Ltd Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D35378
|
#
2ecbbcc7 |
|
24-Feb-2023 |
Zachary Leaf <zachary.leaf@arm.com> |
arm64: extend ESR/SPSR registers to 64b For the Exception Syndrome Register, ESR_ELx, the upper 32b were previously unused, but now may contain additional exception info as of Armv8.7 (FEAT_LS64). Extend ESR from u32->u64 in exception handling code to support this. In addition, also extend Saved Program Status Register SPSR_ELx in the same way to allow for future extensions. Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D38983
|
#
1c33a94a |
|
21-Mar-2023 |
Andrew Turner <andrew@FreeBSD.org> |
Add macros for arm64 pcb register offsets Add macros for offsets of macros we set in the arm64 pcb pcb_x array. This will simplift reducing the size of this array in a later change. Sponsored by: Arm Ltd
|
#
94074089 |
|
15-Aug-2022 |
Dimitry Andric <dim@FreeBSD.org> |
Adjust function definition in arm64's db_trace.c to avoid clang 15 warning With clang 15, the following -Werror warning is produced: sys/arm64/arm64/db_trace.c:53:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] db_md_list_watchpoints() ^ void This is because db_md_list_watchpoints() is declared with a (void) argument list, but defined with an empty argument list. Make the definition match the declaration. MFC after: 3 days
|
#
85b7c566 |
|
08-Jul-2021 |
Andrew Turner <andrew@FreeBSD.org> |
Add arm64 pointer authentication support Pointer authentication allows userspace to add instructions to insert a Pointer Authentication Code (PAC) into a register based on an address and modifier and check if the PAC is correct. If the check fails it will either return an invalid address or fault to the kernel. As many of these instructions are a NOP when disabled and in earlier revisions of the architecture this can be used, for example, to sign the return address before pushing it to the stack making Return-oriented programming (ROP) attack more difficult on hardware that supports them. The kernel manages five 128 bit signing keys: 2 instruction keys, 2 data keys, and a generic key. The instructions then use one of these when signing the registers. Instructions that use the first four store the PAC in the register being signed, however the instructions that use the generic key store the PAC in a separate register. Currently all userspace threads share all the keys within a process with a new set of userspace keys being generated when executing a new process. This means a forked child will share its keys with its parent until it calls an appropriate exec system call. In the kernel we allow the use of one of the instruction keys, the ia key. This will be used to sign return addresses in function calls. Unlike userspace each kernel thread has its own randomly generated. Thread0 has a static key as does the early code on secondary CPUs. This should be safe as there is minimal user interaction with these threads, however we could generate random keys when the Armv8.5 Random number generation instructions are present. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D31261
|
#
9feff969 |
|
08-Aug-2021 |
Ed Maste <emaste@FreeBSD.org> |
Remove "All Rights Reserved" from FreeBSD Foundation sys/ copyrights These ones were unambiguous cases where the Foundation was the only listed copyright holder (in the associated license block). Sponsored by: The FreeBSD Foundation
|
#
9d81dd54 |
|
08-Mar-2021 |
Mitchell Horne <mhorne@FreeBSD.org> |
ddb: replace watchpoint set/clear functions Use the new kdb variants. Print more specific error messages. Reviewed by: jhb, markj MFC after: 3 weeks Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D29156
|
#
05985a7f |
|
01-Feb-2021 |
Jessica Clarke <jrtc27@FreeBSD.org> |
arm64: Improve DDB backtrace support The existing implementation relies on each trap handler saving a normal stack frame record, which is a waste of time and space when we're already saving a trapframe to the stack. It's also wrong as it currently saves LR not ELR. Instead of patching it up, rewrite it based on the RISC-V implementation with inspiration from the amd64 implementation for how to handle vectored traps to provide an improved implementation. This includes compressing the information down to one line like other architectures rather than the highly-verbose old form that repeats itself by printing LR and FP in one frame only to print them as PC and SP in the next. It also includes printing out actually useful information about the traps that occurred, though FAR is not saved in the trapframe so we cannot print it (in general it can be clobbered between when the trap happened and now), only ESR. The AAPCS also allows the stack frame record to be located anywhere in the frame, not just the top, so the caller's SP is not at a fixed offset from the callee's FP like on almost all other architectures in existence. This means there is no way to derive the caller's SP in the unwinder, and so we have to drop that bit of (unused) state everywhere. Reviewed by: jhb, markj Differential Revision: https://reviews.freebsd.org/D28026
|
#
5f66d5a3 |
|
20-Dec-2020 |
mhorne <mhorne@FreeBSD.org> |
arm64: remove pcb_pc The program counter field in the PCB is written in exactly one place, makectx(), upon entry to the debugger. For threads other than curthread, its value will be empty, or bogus. Rather than writing to this field in more places, it can be removed in favor of using the value in the link register. To make this clearer, pcb->pcb_x[30] is renamed to pcb->pcb_lr, similar to what already exists in struct trapframe. Also, prefer lr to x30 in assembly, as it better conveys intention. This improves PC_REGS() for kdb_thread != curthread. It is required for a functional gdb(4) stub, fixing the output of `info threads`, in particular. The space occupied by pcb_pc is retained, for compatibility with kgdb. Reviewed by: markj, jhb MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27720
|
#
ae953968 |
|
08-Dec-2020 |
John Baldwin <jhb@FreeBSD.org> |
Check that the frame pointer is within the current stack. This same check is used on other architectures. Previously this would permit a stack frame to unwind into any arbitrary kernel address (including unmapped addresses). Reviewed by: andrew, markj Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27362
|
#
4d16f941 |
|
01-Dec-2020 |
John Baldwin <jhb@FreeBSD.org> |
Use uintptr_t instead of uint64_t for pointers in stack frames. Reviewed by: andrew Obtained from: CheriBSD Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D27361
|
#
a5d295e2 |
|
30-Oct-2019 |
Andrew Turner <andrew@FreeBSD.org> |
Update the debug monitor handling to work after userspace has started The debug monitor register state is now stored in a struct and updated when required. Currently there is only a kernel state, however a per-process state will be added in a future change. Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22128
|
#
6de3c415 |
|
13-Sep-2016 |
Andrew Turner <andrew@FreeBSD.org> |
Add a missing opt_ddb.h include from places that include debug_moditor.h to fix the build. Obtained from: ABT Systems Ltd X-MFC with: r305771 Sponsored by: The FreeBSD Foundation
|
#
3f66bd50 |
|
10-Jun-2015 |
Ruslan Bukin <br@FreeBSD.org> |
Split out db_unwind_frame() so it can be used by DTrace. Sponsored by: ARM Ltd. Differential Revision: https://reviews.freebsd.org/D2741
|
#
988b7f60 |
|
27-Apr-2015 |
Zbigniew Bodek <zbb@FreeBSD.org> |
Introduce ddb(4) support for ARM64 Obtained from: Semihalf Reviewed by: emaste Sponsored by: The FreeBSD Foundation
|