Paul Menzel (paulepanter@users.sourceforge.net) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7093
-gerrit
commit c27d6aeaab392973aeae85bce5e0ce698c62f008 Author: Paul Menzel paulepanter@users.sourceforge.net Date: Fri Oct 17 13:46:12 2014 +0200
util/cbmem: Fix CBMEM TOC printing
Since commit c0199078 (cbmem utility: Find actual CBMEM area) [1], at least on the Lenovo X201, X230 and X60, printing the CBMEM table of contents did not work. It still worked on the ASRock E350M1 though.
$ sudo /src/coreboot/util/cbmem/cbmem -l --verbose # Lenovo X60t Looking for coreboot table at 0 Mapping 1MB of physical memory at 0x0. Found! coreboot table entry 0x11 Found forwarding entry. Unmapping 1MB of virtual memory at 0xb74dc000. Looking for coreboot table at 7f6c4000 Mapping 1MB of physical memory at 0x7f6c4000. Found! coreboot table entry 0xc8 coreboot table entry 0x01 Found memory map. coreboot table entry 0x03 coreboot table entry 0x04 coreboot table entry 0x05 coreboot table entry 0x06 coreboot table entry 0x07 coreboot table entry 0x08 coreboot table entry 0x09 coreboot table entry 0x0a coreboot table entry 0x16 Found timestamp table. cbmem_addr = 7f7dd000 coreboot table entry 0x17 Found cbmem console. cbmem_addr = 7f7de000 Unmapping 1MB of virtual memory at 0xb74dc000. No coreboot CBMEM area found!
The address of the boot info record has to be used for checking, that reading takes place in the bounds of the boot info record.
$ sudo ~/src/coreboot/util/cbmem/cbmem -l # Lenovo X60 CBMEM table of contents: ID START LENGTH […]
Big thanks to David and Stefan for their help.
[1] http://review.coreboot.org/2117
Change-Id: I1eb09a6445d9ea17e1e16b6866dece74315d3c73 Found-by: Kyösti Mälkki kyosti.malkki@gmail.com Signed-off-by: Paul Menzel paulepanter@users.sourceforge.net --- util/cbmem/cbmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c index cee3818..91fa8e1 100644 --- a/util/cbmem/cbmem.c +++ b/util/cbmem/cbmem.c @@ -220,7 +220,7 @@ static int parse_cbtable(u64 address) debug(" Found memory map.\n"); struct lb_memory *memory = (struct lb_memory *)lbr_p; - while ((char *)&memory->map[i] < ((char *)lbtable + while ((char *)&memory->map[i] < ((char *)lbr_p + lbr_p->size)) { if (memory->map[i].type == LB_MEM_TABLE) { debug(" LB_MEM_TABLE found.\n");