--- zzzz-none-000/linux-4.9.279/arch/x86/kernel/kgdb.c 2021-08-08 06:38:54.000000000 +0000 +++ puma7-atom-6591-750/linux-4.9.279/arch/x86/kernel/kgdb.c 2023-02-08 11:43:42.000000000 +0000 @@ -1,4 +1,9 @@ /* + * Includes Intel Corporation's changes/modifications dated: 2017. + * Changed/modified portions - Copyright (c) 2017, Intel Corporation. + */ + +/* * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2, or (at your option) any @@ -193,6 +198,8 @@ gdb_regs[GDB_SP] = p->thread.sp; } +#ifdef CONFIG_HW_BREAKPOINTS + static struct hw_breakpoint { unsigned enabled; unsigned long addr; @@ -419,6 +426,8 @@ } } +#endif + #ifdef CONFIG_SMP /** * kgdb_roundup_cpus - Get other CPUs into a holding pattern @@ -644,6 +653,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) { @@ -694,6 +705,8 @@ } } +#endif + /** * kgdb_arch_exit - Perform any architecture specific uninitalization. * @@ -702,6 +715,7 @@ */ void kgdb_arch_exit(void) { +#ifdef CONFIG_HW_BREAKPOINTS int i; for (i = 0; i < 4; i++) { if (breakinfo[i].pev) { @@ -709,6 +723,7 @@ breakinfo[i].pev = NULL; } } +#endif unregister_nmi_handler(NMI_UNKNOWN, "kgdb"); unregister_nmi_handler(NMI_LOCAL, "kgdb"); unregister_die_notifier(&kgdb_notifier); @@ -808,9 +823,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 };