From 747c07f08a839f5b2b6220f2e61fdf99b9ff35eb Mon Sep 17 00:00:00 2001 From: Paul Menzel Date: Fri, 17 Oct 2014 13:46:12 +0200 Subject: util/cbmem: Fix CBMEM TOC printing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Paul Menzel Reviewed-on: http://review.coreboot.org/7093 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki Reviewed-by: Patrick Georgi --- util/cbmem/cbmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c index 3a5a428e40..f1de620c59 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"); -- cgit v1.2.3