[coreboot-gerrit] New patch to review for coreboot: arch/x86: Include timestamp.c in all stages

Alexandru Gagniuc (alexandrux.gagniuc@intel.com) gerrit at coreboot.org
Tue May 17 01:58:44 CEST 2016


Alexandru Gagniuc (alexandrux.gagniuc at intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14860

-gerrit

commit 26dd04dc2703cc67cab864e0ecfa2f7ed8765137
Author: Alexandru Gagniuc <alexandrux.gagniuc at intel.com>
Date:   Mon May 16 14:22:00 2016 -0700

    arch/x86: Include timestamp.c in all stages
    
    timestamp.c was not included in bootblock and postcar. This means that
    these two stages would use the weak implementation in lib/timestamp.c
    instead of the arch-specific implementation based on rdtsc.
    
    On the test configuration, the weak implementation always returned
    zero, resulting in wrong timestamps coming from the bootblock, while
    romstage and ramstage used the arch implementation and returned
    correct timestamps.
    
    This is a great example of why weak functions are dangerous, and how
    easy it is to miss subtle yet strong interactions between subsystems
    and the coreboot buildsystem.
    
    Change-Id: I656f9bd58a6fc179d9dbbc496c5b684ea9288eb5
    Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc at intel.com>
---
 src/arch/x86/Makefile.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/arch/x86/Makefile.inc b/src/arch/x86/Makefile.inc
index a363430..c27bb1a 100644
--- a/src/arch/x86/Makefile.inc
+++ b/src/arch/x86/Makefile.inc
@@ -97,6 +97,7 @@ ifeq ($(CONFIG_ARCH_BOOTBLOCK_X86_32)$(CONFIG_ARCH_BOOTBLOCK_X86_64),y)
 bootblock-y += boot.c
 bootblock-y += memcpy.c
 bootblock-y += memset.c
+bootblock-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
 bootblock-$(CONFIG_X86_TOP4G_BOOTMEDIA_MAP) += mmap_boot.c
 
 bootblock-y += id.S
@@ -394,6 +395,7 @@ postcar-y += memset.c
 postcar-y += memcpy.c
 postcar-y += memmove.c
 postcar-y += memlayout.ld
+postcar-$(CONFIG_COLLECT_TIMESTAMPS) += timestamp.c
 postcar-$(CONFIG_X86_TOP4G_BOOTMEDIA_MAP) += mmap_boot.c
 
 $(objcbfs)/postcar.debug: $$(postcar-objs)



More information about the coreboot-gerrit mailing list