diff --git a/src/arch/x86/null_breakpoint.c b/src/arch/x86/null_breakpoint.c index 8b21a77cdc..dbb54aee2a 100644 --- a/src/arch/x86/null_breakpoint.c +++ b/src/arch/x86/null_breakpoint.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include #include +#include #include #include @@ -55,3 +56,12 @@ void null_breakpoint_init(void) create_deref_breakpoint(); create_instruction_breakpoint(); } + +static void null_breakpoint_disable(void *unused) +{ + breakpoint_remove(null_fetch_bp); + breakpoint_remove(null_deref_bp); +} + +BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, null_breakpoint_disable, NULL); +BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, null_breakpoint_disable, NULL);