Attention is currently required from: Furquan Shaikh. Hello Furquan Shaikh,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/50618
to review the following change.
Change subject: util/cbfstool: Fix build in 32-bit userspace ......................................................................
util/cbfstool: Fix build in 32-bit userspace
Fix regression from commit 0dcc0662f3 util/cbfstool: Introduce concept of mmap_window.
Use of region_end() wraps around at 4 GiB, if utility is run in 32bit userspace. The build completes with an invalid coreboot.rom, while one can find error message in stdout or make.log:
E: Host address(ffc002e4) not in any mmap window!
Change-Id: Ib9b6b60c7b5031122901aabad7b3aa8d59f1bc68 Signed-off-by: Furquan Shaikh furquan@google.com Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M util/cbfstool/cbfstool.c 1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/18/50618/1
diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 57c9e51..2f920e0 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -255,7 +255,8 @@ else reg = &mmap_window_table[i].flash_space;
- if (region_offset(reg) <= addr && region_end(reg) >= addr) + if (region_offset(reg) <= addr && + ((uint64_t)region_offset(reg) + (uint64_t)region_sz(reg) - 1) >= addr) return i; }