summaryrefslogtreecommitdiff
path: root/src/arch/x86/Kconfig
diff options
context:
space:
mode:
authorRobert Zieba <robertzieba@google.com>2022-04-14 10:36:15 -0600
committerNick Vaccaro <nvaccaro@google.com>2022-05-12 15:47:18 +0000
commit3f01cd14533f12f04a87a9cf1111dd948094bac4 (patch)
treee1ef98e60c0f91fd59fc14f3983525d21c62760a /src/arch/x86/Kconfig
parent4be0f4bf9943f5f6c84d1c13dee70b7442f99bd0 (diff)
arch/x86: Add support for catching null dereferences through debug regs
This commit adds support for catching null dereferences and execution through x86's debug registers. This is particularly useful when running 32-bit coreboot as paging is not enabled to catch these through page faults. This commit adds three new configs to support this feature: DEBUG_HW_BREAKPOINTS, DEBUG_NULL_DEREF_BREAKPOINTS and DEBUG_NULL_DEREF_HALT. BUG=b:223902046 TEST=Ran on nipperkin device, verifying that HW breakpoints work as expected. Change-Id: I113590689046a13c2a552741bbfe7668a834354a Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/63657 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'src/arch/x86/Kconfig')
-rw-r--r--src/arch/x86/Kconfig32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index e9fce5026f..993b1e6608 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -320,6 +320,38 @@ config MEMLAYOUT_LD_FILE
string
default "src/arch/x86/memlayout.ld"
+config DEBUG_HW_BREAKPOINTS
+ bool
+ default y
+ help
+ Enable support for hardware data and instruction breakpoints through
+ the x86 debug registers
+
+config DEBUG_HW_BREAKPOINTS_IN_ALL_STAGES
+ bool
+ default y
+ depends on DEBUG_HW_BREAKPOINTS && IDT_IN_EVERY_STAGE
+
+config DEBUG_NULL_DEREF_BREAKPOINTS
+ bool
+ default y
+ depends on DEBUG_HW_BREAKPOINTS
+ help
+ Enable support for catching null dereferences and instruction execution
+
+config DEBUG_NULL_DEREF_BREAKPOINTS_IN_ALL_STAGES
+ bool
+ default y
+ depends on DEBUG_NULL_DEREF_BREAKPOINTS && DEBUG_HW_BREAKPOINTS_IN_ALL_STAGES
+
+config DEBUG_NULL_DEREF_HALT
+ bool
+ default n
+ depends on DEBUG_NULL_DEREF_BREAKPOINTS
+ help
+ When enabled null dereferences and instruction fetches will halt execution.
+ Otherwise an error will be printed.
+
# Some EC need an "EC firmware pointer" (a data structure hinting the address
# of its firmware blobs) being put at a fixed position. Its space
# (__section__(".ecfw_ptr")) should be reserved if it lies in the range of a