Furquan Shaikh has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/32881
Change subject: timestamp: Update TIMESTAMP_CACHE_IN_BSS to include ENV_POSTCAR ......................................................................
timestamp: Update TIMESTAMP_CACHE_IN_BSS to include ENV_POSTCAR
With CB:32726 ("lib/timestamp: Make timestamp_sync_cache_to_cbmem() in postcar") timestamps are synced from cache to cbmem in postcar as well. For postcar, the cache lives in BSS just like ramstage. This change updates TIMESTAMP_CACHE_IN_BSS to include both ramstage and postcar and uses this instead of ENV_RAMSTAGE to check for cache location.
Ideally, it would be good to get rid of timestamp cache in postcar and ramstage completely since early cbmem init is enabled by default in coreboot and it is guaranteed that cbmem is recovered before timestamps are added in ramstage or postcar. This change is being pushed in as a temporary fix while I make the changes to remove timestamp cache from romstage and postcar completely.
BUG=b:132939309
Change-Id: I2d82a96aba954df77c9386b7bd2e2ec0973881be Signed-off-by: Furquan Shaikh furquan@google.com --- M src/lib/timestamp.c 1 file changed, 7 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/81/32881/1
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c index 431bce2..38d0212 100644 --- a/src/lib/timestamp.c +++ b/src/lib/timestamp.c @@ -47,12 +47,15 @@ #define USE_TIMESTAMP_REGION 0 #endif
-/* The cache location will sit in BSS when in ramstage. */ -#define TIMESTAMP_CACHE_IN_BSS ENV_RAMSTAGE +/* The cache location will sit in BSS when in ramstage/postcar. */ +#define TIMESTAMP_CACHE_IN_BSS (ENV_RAMSTAGE || ENV_POSTCAR)
#define HAS_CBMEM (ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_POSTCAR)
-/* Storage of cache entries during ramstage prior to cbmem coming online. */ +/* + * Storage of cache entries during ramstage/postcar prior to cbmem coming + * online. + */ static struct timestamp_cache timestamp_cache;
enum { @@ -220,7 +223,7 @@ /* Timestamps could have already been recovered. * In those circumstances honor the cache which sits in BSS * as it has already been initialized. */ - if (ENV_RAMSTAGE && + if (TIMESTAMP_CACHE_IN_BSS && ts_cache->cache_state != TIMESTAMP_CACHE_UNINITIALIZED) return;
Duncan Laurie has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32881 )
Change subject: timestamp: Update TIMESTAMP_CACHE_IN_BSS to include ENV_POSTCAR ......................................................................
Patch Set 1: Code-Review+2
Subrata Banik has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/32881 )
Change subject: timestamp: Update TIMESTAMP_CACHE_IN_BSS to include ENV_POSTCAR ......................................................................
Patch Set 1: Code-Review+2
Duncan Laurie has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/32881 )
Change subject: timestamp: Update TIMESTAMP_CACHE_IN_BSS to include ENV_POSTCAR ......................................................................
timestamp: Update TIMESTAMP_CACHE_IN_BSS to include ENV_POSTCAR
With CB:32726 ("lib/timestamp: Make timestamp_sync_cache_to_cbmem() in postcar") timestamps are synced from cache to cbmem in postcar as well. For postcar, the cache lives in BSS just like ramstage. This change updates TIMESTAMP_CACHE_IN_BSS to include both ramstage and postcar and uses this instead of ENV_RAMSTAGE to check for cache location.
Ideally, it would be good to get rid of timestamp cache in postcar and ramstage completely since early cbmem init is enabled by default in coreboot and it is guaranteed that cbmem is recovered before timestamps are added in ramstage or postcar. This change is being pushed in as a temporary fix while I make the changes to remove timestamp cache from romstage and postcar completely.
BUG=b:132939309
Change-Id: I2d82a96aba954df77c9386b7bd2e2ec0973881be Signed-off-by: Furquan Shaikh furquan@google.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/32881 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Duncan Laurie dlaurie@chromium.org Reviewed-by: Subrata Banik subrata.banik@intel.com --- M src/lib/timestamp.c 1 file changed, 7 insertions(+), 4 deletions(-)
Approvals: build bot (Jenkins): Verified Duncan Laurie: Looks good to me, approved Subrata Banik: Looks good to me, approved
diff --git a/src/lib/timestamp.c b/src/lib/timestamp.c index 431bce2..38d0212 100644 --- a/src/lib/timestamp.c +++ b/src/lib/timestamp.c @@ -47,12 +47,15 @@ #define USE_TIMESTAMP_REGION 0 #endif
-/* The cache location will sit in BSS when in ramstage. */ -#define TIMESTAMP_CACHE_IN_BSS ENV_RAMSTAGE +/* The cache location will sit in BSS when in ramstage/postcar. */ +#define TIMESTAMP_CACHE_IN_BSS (ENV_RAMSTAGE || ENV_POSTCAR)
#define HAS_CBMEM (ENV_ROMSTAGE || ENV_RAMSTAGE || ENV_POSTCAR)
-/* Storage of cache entries during ramstage prior to cbmem coming online. */ +/* + * Storage of cache entries during ramstage/postcar prior to cbmem coming + * online. + */ static struct timestamp_cache timestamp_cache;
enum { @@ -220,7 +223,7 @@ /* Timestamps could have already been recovered. * In those circumstances honor the cache which sits in BSS * as it has already been initialized. */ - if (ENV_RAMSTAGE && + if (TIMESTAMP_CACHE_IN_BSS && ts_cache->cache_state != TIMESTAMP_CACHE_UNINITIALIZED) return;