Paul Menzel has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/51286 )
Change subject: vc/amd/sb800: SBCMN: Cast to 32-bit before shift ......................................................................
vc/amd/sb800: SBCMN: Cast to 32-bit before shift
SB800: sb_Before_Pci_Init shift out of bounds src/vendorcode/amd/cimx/sb800/SBCMN.c:486:57 ubsan: unrecoverable error.
Found-by: UBSAN Change-Id: Id05b96f1f4cf4a1cf8283db22e10ab8df833406d Signed-off-by: Paul Menzel pmenzel@molgen.mpg.de --- M src/vendorcode/amd/cimx/sb800/SBCMN.c 1 file changed, 6 insertions(+), 6 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/86/51286/1
diff --git a/src/vendorcode/amd/cimx/sb800/SBCMN.c b/src/vendorcode/amd/cimx/sb800/SBCMN.c index 0a62d0e..3d4ce82 100644 --- a/src/vendorcode/amd/cimx/sb800/SBCMN.c +++ b/src/vendorcode/amd/cimx/sb800/SBCMN.c @@ -417,9 +417,9 @@ abLinkInitBeforePciEnum (pConfig); // Set ABCFG registers // AB MSI if ( pConfig->BuildParameters.AbMsi) { - abValue = readAlink (SB_ABCFG_REG94 | (UINT32) (ABCFG << 29)); + abValue = readAlink (SB_ABCFG_REG94 | ((UINT32) ABCFG << 29)); abValue = abValue | BIT20; - writeAlink (SB_ABCFG_REG94 | (UINT32) (ABCFG << 29), abValue); + writeAlink (SB_ABCFG_REG94 | ((UINT32) ABCFG << 29), abValue); }
@@ -483,12 +483,12 @@ ) { UINT32 abValue; - abValue = readAlink (SB_ABCFG_REGC0 | (UINT32) (ABCFG << 29)); + abValue = readAlink (SB_ABCFG_REGC0 | ((UINT32) ABCFG << 29)); abValue &= 0xf0; if ( pConfig->SbPcieOrderRule && abValue ) { - abValue = readAlink (SB_RCINDXC_REG02 | (UINT32) (RCINDXC << 29)); + abValue = readAlink (SB_RCINDXC_REG02 | ((UINT32) RCINDXC << 29)); abValue = abValue | BIT9; - writeAlink (SB_RCINDXC_REG02 | (UINT32) (RCINDXC << 29), abValue); + writeAlink (SB_RCINDXC_REG02 | ((UINT32) RCINDXC << 29), abValue); } }
@@ -620,7 +620,7 @@ pAbTblPtr = (ABTBLENTRY *) FIXUP_PTR (&abTblEntry800[0]); abcfgTbl (pAbTblPtr); if ( cimResetCpuOnSyncFlood ) { - rwAlink (SB_ABCFG_REG10050 | (UINT32) (ABCFG << 29), ~BIT2, BIT2); + rwAlink (SB_ABCFG_REG10050 | ((UINT32) ABCFG << 29), ~BIT2, BIT2); } }