aboutsummaryrefslogtreecommitdiff
path: root/src/cpu/qemu-x86
diff options
context:
space:
mode:
authorPatrick Rudolph <siro@das-labor.org>2019-09-28 17:44:01 +0200
committerPatrick Georgi <pgeorgi@google.com>2019-11-04 11:58:58 +0000
commitb1ef725f391b3864c5051c7e7290311c475cfcd3 (patch)
tree0c79e4d7dce03eaeb64233075bde399498fb65b6 /src/cpu/qemu-x86
parent6f7c955464783ba21cda1bcf4b5582b2af0be31e (diff)
cpu/qemu-x86: Add x86_64 bootblock support
Add support for x86_64 bootblock on qemu. Introduce a new approach to long mode support. The previous patch set generated page tables at runtime and placed them in heap. The new approach places the page tables in memory mapped ROM. Introduce a new tool called pgtblgen that creates x86 long mode compatible page tables and writes those to a file. The file is included into the CBFS and placed at a predefined offset. Add assembly code to load the page tables, based on a Kconfig symbol and enter long in bootblock. The code can be easily ported to real hardware bootblock. Tested on qemu q35. Change-Id: Iec92c6cea464c97c18a0811e2e91bc22133ace42 Signed-off-by: Patrick Rudolph <siro@das-labor.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35680 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/cpu/qemu-x86')
-rw-r--r--src/cpu/qemu-x86/cache_as_ram_bootblock.S11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/cpu/qemu-x86/cache_as_ram_bootblock.S b/src/cpu/qemu-x86/cache_as_ram_bootblock.S
index 6ec2e4dc2c..f5678a1807 100644
--- a/src/cpu/qemu-x86/cache_as_ram_bootblock.S
+++ b/src/cpu/qemu-x86/cache_as_ram_bootblock.S
@@ -38,9 +38,17 @@ cache_as_ram:
/* Align the stack and keep aligned for call to bootblock_c_entry() */
and $0xfffffff0, %esp
- sub $4, %esp
/* Restore the BIST result and timestamps. */
+#if defined(__x86_64__)
+ movd %mm1, %rdi
+ shld %rdi, 32
+ movd %mm1, %rsi
+ or %rsi, %rdi
+ movd %mm2, %rsi
+#else
+ sub $4, %esp
+
movd %mm0, %ebx
movd %mm1, %eax
movd %mm2, %edx
@@ -48,6 +56,7 @@ cache_as_ram:
pushl %ebx
pushl %edx
pushl %eax
+#endif
before_c_entry:
post_code(0x29)