--- zzzz-none-000/linux-5.15.111/arch/x86/kernel/alternative.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/arch/x86/kernel/alternative.c 2024-02-07 10:22:35.000000000 +0000 @@ -1011,17 +1011,28 @@ return temp_state; } + +#ifndef CONFIG_HW_BREAKPOINTS +DEFINE_PER_CPU(unsigned long, cpu_dr7); +EXPORT_PER_CPU_SYMBOL(cpu_dr7); +#endif + static inline void unuse_temporary_mm(temp_mm_state_t prev_state) { lockdep_assert_irqs_disabled(); switch_mm_irqs_off(NULL, prev_state.mm, current); +#ifdef CONFIG_HW_BREAKPOINTS /* * Restore the breakpoints if they were disabled before the temporary mm * was loaded. */ if (hw_breakpoint_active()) hw_breakpoint_restore(); +#else + set_debugreg(__this_cpu_read(cpu_dr7), 7); +#endif + } __ro_after_init struct mm_struct *poking_mm;