summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2021-02-03 17:33:40 +0100
committerPatrick Rudolph <siro@das-labor.org>2021-02-06 18:51:29 +0000
commitd12f0301507ebb2e4acbdcd752817a4b6f9756af (patch)
tree1968f65abde630fa0f10920bf0fa29ead5760b9d
parenta85d4a5a9c23ac891e2587733088154efeaad6b3 (diff)
mb/emulation/qemu-q35: Mark TSEG region as reserved
Mark TSEG as reserved, which is done on other platforms as well. For some reason CorebootPayloadPkg crashes when using the region where TSEG typically resides, which is basically RAM. UefiPayloadPkg doesn't show this issue. Change-Id: I3ae3659349d2a88bc3575fe9675433c054e28832 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/50267 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r--src/mainboard/emulation/qemu-q35/mainboard.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mainboard/emulation/qemu-q35/mainboard.c b/src/mainboard/emulation/qemu-q35/mainboard.c
index 540db040c9..e53404d55c 100644
--- a/src/mainboard/emulation/qemu-q35/mainboard.c
+++ b/src/mainboard/emulation/qemu-q35/mainboard.c
@@ -4,6 +4,7 @@
#include <device/pci.h>
#include <device/pci_ops.h>
#include <pc80/keyboard.h>
+#include <cpu/x86/smm.h>
#include "q35.h"
@@ -39,6 +40,9 @@ static void qemu_nb_init(struct device *dev)
static void qemu_nb_read_resources(struct device *dev)
{
+ size_t tseg_size;
+ uintptr_t tseg_base;
+
pci_dev_read_resources(dev);
mmconf_resource(dev, 2);
@@ -48,6 +52,9 @@ static void qemu_nb_read_resources(struct device *dev)
reserved_ram_resource(dev, 0, CONFIG_ARCH_X86_64_PGTBL_LOC / KiB,
(6 * 0x1000) / KiB);
}
+
+ smm_region(&tseg_base, &tseg_size);
+ reserved_ram_resource(dev, ESMRAMC, tseg_base / 1024, tseg_size / 1024);
}