summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2022-05-17 13:07:30 +0200
committerArthur Heymans <arthur@aheymans.xyz>2022-06-01 13:40:20 +0000
commitfdf6d121f5382d116fd9d408525635348d64dd69 (patch)
tree28503766bee50e84b1ad78ff729db68abdd4234d /src/arch
parentc055f3531407c06218e05973bc634d958aba779f (diff)
driver/intel/fsp2_0: Disable NULL deref code when calling FSP
FSP needs interrupts disable so also disable generating exceptions around debug registers. Change-Id: Ia49dde68d45b71e231aaf32a0e6fd847f0e06146 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/64426 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Reviewed-by: Uwe Poeche <uwe.poeche@siemens.com> Reviewed-by: Sean Rhodes <sean@starlabs.systems> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/include/arch/null_breakpoint.h7
-rw-r--r--src/arch/x86/null_breakpoint.c11
2 files changed, 14 insertions, 4 deletions
diff --git a/src/arch/x86/include/arch/null_breakpoint.h b/src/arch/x86/include/arch/null_breakpoint.h
index bc86dc03e4..9d69d3c0e4 100644
--- a/src/arch/x86/include/arch/null_breakpoint.h
+++ b/src/arch/x86/include/arch/null_breakpoint.h
@@ -7,10 +7,15 @@
/* Places data and instructions breakpoints at address zero. */
void null_breakpoint_init(void);
+void null_breakpoint_disable(void);
#else
static inline void null_breakpoint_init(void)
{
- /* Not implemented */
+ /* Not implemented */
+}
+static inline void null_breakpoint_disable(void)
+{
+ /* Not implemented */
}
#endif
#endif /* _NULL_BREAKPOINT_H_ */
diff --git a/src/arch/x86/null_breakpoint.c b/src/arch/x86/null_breakpoint.c
index 4da6d87ab1..70b94b6909 100644
--- a/src/arch/x86/null_breakpoint.c
+++ b/src/arch/x86/null_breakpoint.c
@@ -57,11 +57,16 @@ void null_breakpoint_init(void)
create_instruction_breakpoint();
}
-static void null_breakpoint_disable(void *unused)
+void null_breakpoint_disable(void)
{
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);
+static void null_breakpoint_disable_hook(void *unused)
+{
+ null_breakpoint_disable();
+}
+
+BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, null_breakpoint_disable_hook, NULL);
+BOOT_STATE_INIT_ENTRY(BS_PAYLOAD_BOOT, BS_ON_ENTRY, null_breakpoint_disable_hook, NULL);