Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/51292 )
Change subject: x86: pci_io_cfg: Make constant unsigned long to fix out of bounds shift ......................................................................
x86: pci_io_cfg: Make constant unsigned long to fix out of bounds shift
Fix the error below when building coreboot with `CONFIG_UBSAN=y`.
PCI: pci_scan_bus for bus 00 shift out of bounds src/arch/x86/include/arch/pci_io_cfg.h:13:20 ubsan: unrecoverable error.
Change-Id: Ib05d225ab9f22078d765009b4ee6ef0c63231eed Found-by: UBSAN Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- M src/arch/x86/include/arch/pci_io_cfg.h 1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/92/51292/1
diff --git a/src/arch/x86/include/arch/pci_io_cfg.h b/src/arch/x86/include/arch/pci_io_cfg.h index 61dd106..5e9761e 100644 --- a/src/arch/x86/include/arch/pci_io_cfg.h +++ b/src/arch/x86/include/arch/pci_io_cfg.h @@ -10,7 +10,7 @@ static __always_inline uint32_t pci_io_encode_addr(pci_devfn_t dev, uint16_t reg) { - uint32_t addr = 1 << 31; + uint32_t addr = 1UL << 31;
addr |= dev >> 4; addr |= reg & 0xfc;