From ea2c1d357cccf4ee84473d304c880250fbd97080 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Thu, 19 May 2022 14:22:36 +0200 Subject: cpu/x86/smm: Remove heap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently no smihandler uses heap. coreboot's heap manager also is quite limited in what it will free (only the latest alloc). This makes it a bad idea to use it inside the smihandler, as depending on the alloc usage the heap might actually be full at some point, breaking the smihandler. This also reduces the ramstage by 448 bytes on google/vilboz. Change-Id: I70cd822be17c1efe13c94a9dbd2e1038808b9c56 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/64521 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Felix Held Reviewed-by: Nico Huber --- src/cpu/x86/Kconfig | 7 ------- src/cpu/x86/smm/Makefile.inc | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) (limited to 'src/cpu/x86') diff --git a/src/cpu/x86/Kconfig b/src/cpu/x86/Kconfig index 658d2aaf74..f34a2626f8 100644 --- a/src/cpu/x86/Kconfig +++ b/src/cpu/x86/Kconfig @@ -124,13 +124,6 @@ config SMM_LEGACY_ASEG if HAVE_SMI_HANDLER && !SMM_LEGACY_ASEG -config SMM_MODULE_HEAP_SIZE - hex - default 0x4000 - help - This option determines the size of the heap within the SMM handler - modules. - config SMM_MODULE_STACK_SIZE hex default 0x800 if ARCH_RAMSTAGE_X86_64 diff --git a/src/cpu/x86/smm/Makefile.inc b/src/cpu/x86/smm/Makefile.inc index cd920daf1a..5f695909a8 100644 --- a/src/cpu/x86/smm/Makefile.inc +++ b/src/cpu/x86/smm/Makefile.inc @@ -67,9 +67,9 @@ $(call src-to-obj,ramstage,$(obj)/cpu/x86/smm/smmstub.manual): $(obj)/smmstub/sm # C-based SMM handler. ifeq ($(CONFIG_ARCH_RAMSTAGE_X86_32),y) -$(eval $(call rmodule_link,$(obj)/smm/smm.elf, $(obj)/smm/smm.o, $(CONFIG_SMM_MODULE_HEAP_SIZE),x86_32)) +$(eval $(call rmodule_link,$(obj)/smm/smm.elf, $(obj)/smm/smm.o, 0,x86_32)) else -$(eval $(call rmodule_link,$(obj)/smm/smm.elf, $(obj)/smm/smm.o, $(CONFIG_SMM_MODULE_HEAP_SIZE),x86_64)) +$(eval $(call rmodule_link,$(obj)/smm/smm.elf, $(obj)/smm/smm.o, 0,x86_64)) endif $(obj)/smm/smm: $(obj)/smm/smm.elf.rmod -- cgit v1.2.3