Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/44733 )
Change subject: Documentation: Add known bugs of x86_64 code on real hardware
......................................................................
Documentation: Add known bugs of x86_64 code on real hardware
The bugs happen on real hardware or in qemu with KVM enabled.
The very same code runs on some real devices and it runs in qemu
with KVM disabled.
The bugs are so strange that no root cause could be found yet.
Change-Id: I01050f2e38f92c6b96e3258a5b619aa9ee685acc
Signed-off-by: Patrick Rudolph <patrick.rudolph(a)9elements.com>
---
M Documentation/arch/x86/index.md
1 file changed, 15 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/44733/1
diff --git a/Documentation/arch/x86/index.md b/Documentation/arch/x86/index.md
index 11d8a4f..a5406c0 100644
--- a/Documentation/arch/x86/index.md
+++ b/Documentation/arch/x86/index.md
@@ -65,3 +65,18 @@
* Test how well CAR works with x86_64 and paging
* Improve mode switches
* Test libgfxinit / VGA Option ROMs / FSP
+
+## Known bugs on real hardware
+
+The `x86_64` reference code runs fine in qemu and on some real x86 platforms.
+However some issues have been observed and no workaround or explanation could
+be found. It either works fine or not at all. Here's a list of known issues:
+
+* After entering long mode the FPU doesn't work any more, including accessing
+ MMX register. It works fine before entering long mode.
+* Reading from virtual memory where the lower twelve address bits are zero
+ returns a fixed constant. Writing to that memory location has no effect.
+ Depeding on the variables stored in heap and stack and where the code
+ resides, undefined behaviour happens whenever the lower twelve bits are zero.
+* Disabling paging in compability mode crashes the CPU.
+* Returning from long mode to compability mode crashes the CPU.
--
To view, visit https://review.coreboot.org/c/coreboot/+/44733
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I01050f2e38f92c6b96e3258a5b619aa9ee685acc
Gerrit-Change-Number: 44733
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph(a)9elements.com>
Gerrit-MessageType: newchange
Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40808 )
Change subject: soc/amd/picasso/Makefile: Verify bootblock size is power of two
......................................................................
soc/amd/picasso/Makefile: Verify bootblock size is power of two
Enabling caching for bootblock requires its size to be a power of two.
This is because MTRRs have this requirement.
BUG=b:153675909
TEST=Changed bootblock size and saw a build error
Signed-off-by: Raul E Rangel <rrangel(a)chromium.org>
Change-Id: Idede916cbc75bb0fecd729219b92dc9046c23d78
---
M src/soc/amd/picasso/Makefile.inc
1 file changed, 6 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/08/40808/1
diff --git a/src/soc/amd/picasso/Makefile.inc b/src/soc/amd/picasso/Makefile.inc
index b04e1e9..d137aba 100644
--- a/src/soc/amd/picasso/Makefile.inc
+++ b/src/soc/amd/picasso/Makefile.inc
@@ -189,6 +189,12 @@
# This address must match the BOOTBLOCK logic in arch/x86/memlayout.ld.
PSP_BIOSBIN_DEST=$(shell printf "%x" $(call int-subtract, $(call int-add, $(CONFIG_X86_RESET_VECTOR) 0x10) $(PSP_BIOSBIN_SIZE)))
+# MTRRs sizes must be a power of two. Ensure the bootblock has a compatible size
+# so we can enable caching.
+ifneq ($(call is-power-of-two,$(PSP_BIOSBIN_SIZE)),1)
+$(error Bootblock size $(PSP_BIOSBIN_SIZE) is not a power of two.)
+endif
+
# type = 0x63
ifeq ($(CONFIG_HAVE_ACPI_RESUME),y)
PSP_APOBNV_BASE=$(CONFIG_PSP_APOB_NV_ADDRESS)
--
To view, visit https://review.coreboot.org/c/coreboot/+/40808
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Idede916cbc75bb0fecd729219b92dc9046c23d78
Gerrit-Change-Number: 40808
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Raul Rangel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/40765 )
Change subject: Makefile: Add is-power-of-two
......................................................................
Makefile: Add is-power-of-two
It is sometimes necessary to verify if a CONFIG_ option is a power of
two at build time. This adds a `make` function `is-power-of-two`.
I chose to define all the values because it's the most straightforward
way to do this with `make`.
BUG=b:147042464
Signed-off-by: Raul E Rangel <rrangel(a)chromium.org>
Change-Id: I189a4c722996279e2d8940c566cb362f53ef92d8
---
M Makefile.inc
1 file changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/40765/1
diff --git a/Makefile.inc b/Makefile.inc
index e315732..cbec2dd 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -133,6 +133,7 @@
# int-gt: 1 if the first values is greater than the second. 0 otherwise
# int-eq: 1 if the two values are equal. 0 otherwise
# int-align: align $1 to $2 units
+# is-power-of-two:1 if value is a power of two
# file-size: returns the filesize of the given file
# tolower: returns the value in all lowercase
# toupper: returns the value in all uppercase
@@ -151,6 +152,15 @@
int-eq=$(if $(filter 1,$(words $1)),$(strip $1),$(shell expr $(call _toint,$(word 1,$1)) = $(call _toint,$(word 2,$1))))
int-align=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A + \( \( $$B - \( $$A % $$B \) \) % $$B \) )
int-align-down=$(shell A=$(call _toint,$1) B=$(call _toint,$2); expr $$A - \( $$A % $$B \) )
+power-of-twos := 0x00000001 0x00000002 0x00000004 0x00000008 \
+0x00000010 0x00000020 0x00000040 0x00000080 \
+0x00000100 0x00000200 0x00000400 0x00000800 \
+0x00001000 0x00002000 0x00004000 0x00008000 \
+0x00010000 0x00020000 0x00040000 0x00080000 \
+0x00100000 0x00200000 0x00400000 0x00800000 \
+0x01000000 0x02000000 0x04000000 0x08000000 \
+0x10000000 0x20000000 0x40000000 0x80000000
+is-power-of-two=$(if $(filter $(power-of-twos), $(shell printf "0x%08x" $1)),1)
file-size=$(strip $(shell cat $1 | wc -c))
tolower=$(shell echo '$1' | tr '[:upper:]' '[:lower:]')
toupper=$(shell echo '$1' | tr '[:lower:]' '[:upper:]')
@@ -575,6 +585,8 @@
@printf " HOSTCC $(subst $(obj)/,,$(@))\n"
$(HOSTCC) $(HOSTCFLAGS) -DCONFIG_ROM_SIZE=$(CONFIG_ROM_SIZE) -o $@ $<
+APCB_EDIT_TOOL:=$(top)/util/apcb/apcb_edit.py
+
CBOOTIMAGE:=$(objutil)/cbootimage/cbootimage
FUTILITY?=$(objutil)/futility/futility
--
To view, visit https://review.coreboot.org/c/coreboot/+/40765
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I189a4c722996279e2d8940c566cb362f53ef92d8
Gerrit-Change-Number: 40765
Gerrit-PatchSet: 1
Gerrit-Owner: Raul Rangel <rrangel(a)chromium.org>
Gerrit-Reviewer: Martin Roth <martinroth(a)google.com>
Gerrit-Reviewer: Patrick Georgi <pgeorgi(a)google.com>
Gerrit-MessageType: newchange
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37368 )
Change subject: arch/x86/car: Remove runtime stack alignment enforcing
......................................................................
arch/x86/car: Remove runtime stack alignment enforcing
This is now checked at buildtime.
Change-Id: Ice687b1a4de53de4799e90238c98cfef19a81136
Signed-off-by: Arthur Heymans <arthur(a)aheymans.xyz>
---
M src/cpu/intel/car/core2/cache_as_ram.S
M src/cpu/intel/car/non-evict/cache_as_ram.S
M src/cpu/intel/car/p3/cache_as_ram.S
M src/cpu/intel/car/p4-netburst/cache_as_ram.S
M src/cpu/qemu-x86/cache_as_ram_bootblock.S
M src/soc/intel/common/block/cpu/car/cache_as_ram.S
6 files changed, 0 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/68/37368/1
diff --git a/src/cpu/intel/car/core2/cache_as_ram.S b/src/cpu/intel/car/core2/cache_as_ram.S
index 73618d9..be96633 100644
--- a/src/cpu/intel/car/core2/cache_as_ram.S
+++ b/src/cpu/intel/car/core2/cache_as_ram.S
@@ -173,7 +173,6 @@
/* Need to align stack to 16 bytes at call instruction. Account for
the pushes below. */
- andl $0xfffffff0, %esp
subl $4, %esp
/* push TSC and BIST to stack */
diff --git a/src/cpu/intel/car/non-evict/cache_as_ram.S b/src/cpu/intel/car/non-evict/cache_as_ram.S
index 5a668c4..6c78ddb 100644
--- a/src/cpu/intel/car/non-evict/cache_as_ram.S
+++ b/src/cpu/intel/car/non-evict/cache_as_ram.S
@@ -219,7 +219,6 @@
/* Need to align stack to 16 bytes at call instruction. Account for
the pushes below. */
- andl $0xfffffff0, %esp
subl $4, %esp
/* push TSC and BIST to stack */
diff --git a/src/cpu/intel/car/p3/cache_as_ram.S b/src/cpu/intel/car/p3/cache_as_ram.S
index 5262b18..8c3009a 100644
--- a/src/cpu/intel/car/p3/cache_as_ram.S
+++ b/src/cpu/intel/car/p3/cache_as_ram.S
@@ -161,7 +161,6 @@
/* Need to align stack to 16 bytes at call instruction. Account for
the pushes below. */
- andl $0xfffffff0, %esp
subl $4, %esp
/* push TSC and BIST to stack */
diff --git a/src/cpu/intel/car/p4-netburst/cache_as_ram.S b/src/cpu/intel/car/p4-netburst/cache_as_ram.S
index fdeb0af..8fd240d 100644
--- a/src/cpu/intel/car/p4-netburst/cache_as_ram.S
+++ b/src/cpu/intel/car/p4-netburst/cache_as_ram.S
@@ -372,7 +372,6 @@
/* Need to align stack to 16 bytes at call instruction. Account for
the pushes below. */
- andl $0xfffffff0, %esp
subl $4, %esp
/* push TSC and BIST to stack */
diff --git a/src/cpu/qemu-x86/cache_as_ram_bootblock.S b/src/cpu/qemu-x86/cache_as_ram_bootblock.S
index 1fa0018..c1fe52d 100644
--- a/src/cpu/qemu-x86/cache_as_ram_bootblock.S
+++ b/src/cpu/qemu-x86/cache_as_ram_bootblock.S
@@ -37,8 +37,6 @@
movl $_ecar_stack, %esp
/* Align the stack and keep aligned for call to bootblock_c_entry() */
- and $0xfffffff0, %esp
-
/* Restore the BIST result and timestamps. */
#if defined(__x86_64__)
movd %mm1, %rdi
diff --git a/src/soc/intel/common/block/cpu/car/cache_as_ram.S b/src/soc/intel/common/block/cpu/car/cache_as_ram.S
index 0992d85..5d7eafa 100644
--- a/src/soc/intel/common/block/cpu/car/cache_as_ram.S
+++ b/src/soc/intel/common/block/cpu/car/cache_as_ram.S
@@ -174,7 +174,6 @@
/* Need to align stack to 16 bytes at call instruction. Account for
the two pushes below. */
- andl $0xfffffff0, %esp
sub $8, %esp
/* push TSC value to stack */
--
To view, visit https://review.coreboot.org/c/coreboot/+/37368
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: Ice687b1a4de53de4799e90238c98cfef19a81136
Gerrit-Change-Number: 37368
Gerrit-PatchSet: 1
Gerrit-Owner: Arthur Heymans <arthur(a)aheymans.xyz>
Gerrit-MessageType: newchange