[coreboot-gerrit] Change in coreboot[master]: mb/emulation/qemu-i440fx|q35: Fix stack size

Patrick Rudolph (Code Review) gerrit at coreboot.org
Mon Nov 12 19:31:13 CET 2018


Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/29611


Change subject: mb/emulation/qemu-i440fx|q35: Fix stack size
......................................................................

mb/emulation/qemu-i440fx|q35: Fix stack size

Current implementation works by luck as DCACHE area is actually RAM and
stack can grow and use that RAM outside of the area.

* Set DCACHE_BSP_STACK_SIZE to 0x4000.
* Add an assert to make sure it is set to a sane value on all platforms.

Change-Id: I71f9d74d89e4129cdc4a850acc4fc1ac90e5f628
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
M src/arch/x86/car.ld
M src/mainboard/emulation/qemu-i440fx/Kconfig
M src/mainboard/emulation/qemu-q35/Kconfig
3 files changed, 11 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/11/29611/1

diff --git a/src/arch/x86/car.ld b/src/arch/x86/car.ld
index 33fb5c9..4472b42 100644
--- a/src/arch/x86/car.ld
+++ b/src/arch/x86/car.ld
@@ -113,3 +113,6 @@
 #if IS_ENABLED(CONFIG_PAGING_IN_CACHE_AS_RAM)
 _bogus2 = ASSERT(_pagetables == ALIGN(_pagetables, 4096), "_pagetables aren't 4KiB aligned");
 #endif
+#if IS_ENABLED(CONFIG_C_ENVIRONMENT_BOOTBLOCK)
+_bogus3 = ASSERT(CONFIG_DCACHE_BSP_STACK_SIZE > 0x0, "BSP stack size is to small");
+#endif
\ No newline at end of file
diff --git a/src/mainboard/emulation/qemu-i440fx/Kconfig b/src/mainboard/emulation/qemu-i440fx/Kconfig
index 2435729..4454e67 100644
--- a/src/mainboard/emulation/qemu-i440fx/Kconfig
+++ b/src/mainboard/emulation/qemu-i440fx/Kconfig
@@ -41,4 +41,8 @@
 	hex
 	default 0x4000
 
+config DCACHE_BSP_STACK_SIZE
+	hex
+	default 0x4000
+
 endif # BOARD_EMULATION_QEMU_X86_I440FX
diff --git a/src/mainboard/emulation/qemu-q35/Kconfig b/src/mainboard/emulation/qemu-q35/Kconfig
index 4394530..3be034a 100644
--- a/src/mainboard/emulation/qemu-q35/Kconfig
+++ b/src/mainboard/emulation/qemu-q35/Kconfig
@@ -49,4 +49,8 @@
 	hex
 	default 0x4000
 
+config DCACHE_BSP_STACK_SIZE
+	hex
+	default 0x4000
+
 endif # BOARD_EMULATION_QEMU_X86_Q35

-- 
To view, visit https://review.coreboot.org/29611
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I71f9d74d89e4129cdc4a850acc4fc1ac90e5f628
Gerrit-Change-Number: 29611
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro at das-labor.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20181112/2b2d3ca8/attachment.html>


More information about the coreboot-gerrit mailing list