--- zzzz-none-000/linux-5.15.111/arch/x86/kernel/kgdb.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/arch/x86/kernel/kgdb.c 2024-02-07 10:22:35.000000000 +0000 @@ -1,5 +1,8 @@ // SPDX-License-Identifier: GPL-2.0-or-later + /* + * Includes Intel Corporation's changes/modifications dated: 2017. + * Changed/modified portions - Copyright (c) 2017, Intel Corporation. */ /* @@ -176,6 +179,8 @@ gdb_regs[GDB_SP] = p->thread.sp; } +#ifdef CONFIG_HW_BREAKPOINTS + static struct hw_breakpoint { unsigned enabled; unsigned long addr; @@ -402,6 +407,8 @@ } } +#endif + #ifdef CONFIG_SMP /** * kgdb_roundup_cpus - Get other CPUs into a holding pattern @@ -623,6 +630,8 @@ return retval; } +#ifdef CONFIG_HW_BREAKPOINTS + static void kgdb_hw_overflow_handler(struct perf_event *event, struct perf_sample_data *data, struct pt_regs *regs) { @@ -674,6 +683,8 @@ } } +#endif + /** * kgdb_arch_exit - Perform any architecture specific uninitalization. * @@ -682,6 +693,7 @@ */ void kgdb_arch_exit(void) { +#ifdef CONFIG_HW_BREAKPOINTS int i; for (i = 0; i < 4; i++) { if (breakinfo[i].pev) { @@ -689,6 +701,7 @@ breakinfo[i].pev = NULL; } } +#endif unregister_nmi_handler(NMI_UNKNOWN, "kgdb"); unregister_nmi_handler(NMI_LOCAL, "kgdb"); unregister_die_notifier(&kgdb_notifier); @@ -777,9 +790,11 @@ /* Breakpoint instruction: */ .gdb_bpt_instr = { 0xcc }, .flags = KGDB_HW_BREAKPOINT, +#ifdef CONFIG_HW_BREAKPOINTS .set_hw_breakpoint = kgdb_set_hw_break, .remove_hw_breakpoint = kgdb_remove_hw_break, .disable_hw_break = kgdb_disable_hw_debug, .remove_all_hw_break = kgdb_remove_all_hw_break, .correct_hw_break = kgdb_correct_hw_break, +#endif };