region: Turn region_end() into an inclusive region_last()
The current region_end() implementation is susceptible to overflow if the region is at the end of the addressable space. A common case with the memory-mapped flash of x86 directly below the 32-bit limit. Note: This patch also changes console output to inclusive limits. IMO, to the better. Change-Id: Ic4bd6eced638745b7e845504da74542e4220554a Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/79946 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
committed by
Julius Werner
parent
7bb8de1843
commit
41feb32559
@ -647,7 +647,7 @@ static size_t get_cse_region_end_offset(void)
|
||||
size_t end_offset;
|
||||
|
||||
for (size_t i = 0; i < BP_TOTAL; i++) {
|
||||
end_offset = region_end(¶ms.layout_regions[i]);
|
||||
end_offset = region_last(¶ms.layout_regions[i]) + 1;
|
||||
if (end_offset > offset)
|
||||
offset = end_offset;
|
||||
}
|
||||
|
Reference in New Issue
Block a user