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:
It's used in romstage: postcar_frame_add_mtrr(&pcf, CACHE_ROM_BASE, CACHE_ROM_SIZE, ... where it casts from int to uintptr_t.
Is that with your qemu patch on Gerrit? Can you please check what the macros evaluate to, e.g. run the gcc command line with `-E` instead of `-o ...o`.
With and without the `UL`, please.
without UL:
void postcar_frame_add_romcache(struct postcar_frame *pcf, int type) { if (!1) return; postcar_frame_add_mtrr(pcf, (((1 << 20) - ((((0x200000 + ((0x200000>>1)|(0x200000>>2)|(0x200000>>3)|(0x200000>>4)|(0x200000>>5)| (0x200000>>6)|(0x200000>>7)|(0x200000>>8)|((1<<18)-1))) & ~((0x200000>>1)|(0x200000>>2)|(0x200000>>3)|(0x200000>>4)|(0x200000>>5)| (0x200000>>6)|(0x200000>>7)|(0x200000>>8)|((1<<18)-1)))) >> 12)) << 12), ((0x200000 + ((0x200000>>1)|(0x200000>>2)|(0x200000>>3)|(0x200000>>4)|(0x200000>>5)| (0x200000>>6)|(0x200000>>7)|(0x200000>>8)|((1<<18)-1))) & ~((0x200000>>1)|(0x200000>>2)|(0x200000>>3)|(0x200000>>4)|(0x200000>>5)| (0x200000>>6)|(0x200000>>7)|(0x200000>>8)|((1<<18)-1))), type); }
with UL:
void postcar_frame_add_romcache(struct postcar_frame *pcf, int type) { if (!1) return; postcar_frame_add_mtrr(pcf, (((1UL << 20) - ((((0x200000 + ((0x200000>>1)|(0x200000>>2)|(0x200000>>3)|(0x200000>>4)|(0x200000>>5)| (0x200000>>6)|(0x200000>>7)|(0x200000>>8)|((1<<18)-1))) & ~((0x200000>>1)|(0x200000>>2)|(0x200000>>3)|(0x200000>>4)|(0x200000>>5)| (0x200000>>6)|(0x200000>>7)|(0x200000>>8)|((1<<18)-1)))) >> 12)) << 12), ((0x200000 + ((0x200000>>1)|(0x200000>>2)|(0x200000>>3)|(0x200000>>4)|(0x200000>>5)| (0x200000>>6)|(0x200000>>7)|(0x200000>>8)|((1<<18)-1))) & ~((0x200000>>1)|(0x200000>>2)|(0x200000>>3)|(0x200000>>4)|(0x200000>>5)| (0x200000>>6)|(0x200000>>7)|(0x200000>>8)|((1<<18)-1))), type); }