Patrick Rudolph has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31290 )
Change subject: Revert "cpu/x86/mtrr: Fix sign overflow" ......................................................................
Patch Set 1:
Patch Set 1:
Patch Set 1:
It was mentioned in the commit message: "Fixes wrong MTRRs settings on x86_64 romstage."
Oh that explains everything. Except that it explains nothing ;) There is no x86_64 romstage in coreboot (yet). So nothing to fix there. There also doesn't seem to be anything in queue that would get fixed (I run the numbers of the qemu ports through the surrounding macros and couldn't find any problem, actually didn't even find a case where the C compiler would see the result of _FROM_4G_TOP()).
It would be easy to convince me to fix something, if you'd point out the *operation* that overflows.
It's used in romstage: postcar_frame_add_mtrr(&pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE, ... where it casts from int to uintptr_t.