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>
diff --git a/src/drivers/intel/fsp2_0/notify.c b/src/drivers/intel/fsp2_0/notify.c
index 5cd63d8..44e8795 100644
--- a/src/drivers/intel/fsp2_0/notify.c
+++ b/src/drivers/intel/fsp2_0/notify.c
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
+#include <arch/null_breakpoint.h>
 #include <bootstate.h>
 #include <console/console.h>
 #include <cpu/x86/mtrr.h>
@@ -75,10 +76,13 @@
 	timestamp_add_now(data->timestamp_before);
 	post_code(data->post_code_before);
 
+	/* FSP disables the interrupt handler so remove debug exceptions temporarily  */
+	null_breakpoint_disable();
 	if (ENV_X86_64 && CONFIG(PLATFORM_USES_FSP2_X86_32))
 		ret = protected_mode_call_1arg(fspnotify, (uintptr_t)&notify_params);
 	else
 		ret = fspnotify(&notify_params);
+	null_breakpoint_init();
 
 	timestamp_add_now(data->timestamp_after);
 	post_code(data->post_code_after);