Aladyshev Konstantin has uploaded a new patch set (#2). ( https://review.coreboot.org/20839 )
Change subject: AGESA f15 f15tn f16kb: Add extra check for incorrect SPD data
......................................................................
AGESA f15 f15tn f16kb: Add extra check for incorrect SPD data
If memory module is broken and its SPD data is wrong in a way
that Data[11] or Data[9]&0xF is equal to zero, division by 0
in DIMM speed calculation could reboot CPU. Add extra check
to avoid this issue.
Change-Id: Ica92850cc77e1f7cbf3e7e44717de42a03b93bbe
Signed-off-by: Konstantin Aladyshev <aladyshev22(a)gmail.com>
---
M src/vendorcode/amd/agesa/f15/Proc/Mem/Feat/DMI/mfDMI.c
M src/vendorcode/amd/agesa/f15tn/Proc/Mem/Feat/DMI/mfDMI.c
M src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c
3 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/20839/2
--
To view, visit https://review.coreboot.org/20839
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ica92850cc77e1f7cbf3e7e44717de42a03b93bbe
Gerrit-Change-Number: 20839
Gerrit-PatchSet: 2
Gerrit-Owner: Aladyshev Konstantin <aladyshev22(a)gmail.com>
Aladyshev Konstantin has uploaded this change for review. ( https://review.coreboot.org/20839
Change subject: AGESA: f15 f15tn f16kb: Add extra check for incorrect SPD data
......................................................................
AGESA: f15 f15tn f16kb: Add extra check for incorrect SPD data
If memory module is broken and its SPD data is wrong in a way
that Data[11] or Data[9]&0xF is equal to zero, division by 0
in DIMM speed calculation could reboot CPU. Add extra check
to avoid this issue.
Change-Id: Ica92850cc77e1f7cbf3e7e44717de42a03b93bbe
Signed-off-by: Konstantin Aladyshev <aladyshev22(a)gmail.com>
---
M src/vendorcode/amd/agesa/f15/Proc/Mem/Feat/DMI/mfDMI.c
M src/vendorcode/amd/agesa/f15tn/Proc/Mem/Feat/DMI/mfDMI.c
M src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c
3 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/39/20839/1
diff --git a/src/vendorcode/amd/agesa/f15/Proc/Mem/Feat/DMI/mfDMI.c b/src/vendorcode/amd/agesa/f15/Proc/Mem/Feat/DMI/mfDMI.c
index 3138f3f..b968349 100644
--- a/src/vendorcode/amd/agesa/f15/Proc/Mem/Feat/DMI/mfDMI.c
+++ b/src/vendorcode/amd/agesa/f15/Proc/Mem/Feat/DMI/mfDMI.c
@@ -228,6 +228,13 @@
DmiTable[DimmIndex].PartNumber[i] = 0x0;
}
+ // If SPD is wrong, division by 0 in DIMM speed calculation could reboot CPU
+ // So avoid it by this check
+ if ((SpdDataStructure[DimmIndex].Data[11]==0) || ((SpdDataStructure[DimmIndex].Data[9] & 0xF) == 0)) {
+ DmiTable[DimmIndex].DimmPresent = 0;
+ SpdDataStructure[DimmIndex].DimmPresent = 0;
+ }
+
if (SpdDataStructure[DimmIndex].DimmPresent) {
// Total Width (offset 08h) & Data Width (offset 0Ah)
TotalWidth = (UINT16) SpdDataStructure[DimmIndex].Data[8];
diff --git a/src/vendorcode/amd/agesa/f15tn/Proc/Mem/Feat/DMI/mfDMI.c b/src/vendorcode/amd/agesa/f15tn/Proc/Mem/Feat/DMI/mfDMI.c
index 6620030..61499f5 100644
--- a/src/vendorcode/amd/agesa/f15tn/Proc/Mem/Feat/DMI/mfDMI.c
+++ b/src/vendorcode/amd/agesa/f15tn/Proc/Mem/Feat/DMI/mfDMI.c
@@ -243,6 +243,13 @@
DmiTable[DimmIndex].PartNumber[i] = 0x0;
}
+ // If SPD is wrong, division by 0 in DIMM speed calculation could reboot CPU
+ // So avoid it by this check
+ if ((SpdDataStructure[DimmIndex].Data[11]==0) || ((SpdDataStructure[DimmIndex].Data[9] & 0xF) == 0)) {
+ DmiTable[DimmIndex].DimmPresent = 0;
+ SpdDataStructure[DimmIndex].DimmPresent = 0;
+ }
+
if (SpdDataStructure[DimmIndex].DimmPresent) {
// Total Width (offset 08h) & Data Width (offset 0Ah)
TotalWidth = (UINT16) SpdDataStructure[DimmIndex].Data[8];
diff --git a/src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c b/src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c
index 57cc491..edaf9ee 100644
--- a/src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c
+++ b/src/vendorcode/amd/agesa/f16kb/Proc/Mem/Feat/DMI/mfDMI.c
@@ -293,6 +293,13 @@
DmiPhysicalDimmInfoTable->PartNumber[i] = 0x0;
}
+ // If SPD is wrong, division by 0 in DIMM speed calculation could reboot CPU
+ // So avoid it by this check
+ if ((SpdDataStructure[DimmIndex].Data[11]==0) || ((SpdDataStructure[DimmIndex].Data[9] & 0xF) == 0)) {
+ DmiTable[DimmIndex].DimmPresent = 0;
+ SpdDataStructure[DimmIndex].DimmPresent = 0;
+ }
+
if (SpdDataStructure->DimmPresent) {
// Total Width (offset 08h) & Data Width (offset 0Ah)
TotalWidth = (UINT16) SpdDataStructure->Data[8];
--
To view, visit https://review.coreboot.org/20839
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica92850cc77e1f7cbf3e7e44717de42a03b93bbe
Gerrit-Change-Number: 20839
Gerrit-PatchSet: 1
Gerrit-Owner: Aladyshev Konstantin <aladyshev22(a)gmail.com>
Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/20836
Change subject: util/cbfstool: Fix build with armv7-eabi cross compiler
......................................................................
util/cbfstool: Fix build with armv7-eabi cross compiler
We recently changed all PACKED, __PACKED, __attribute__((packed)) ... to
__packed to gain some consistency. In cbfstool we use compiler.h to
provide that where necessary.
The cross compiler I use doesn't provide __packed by itself, but liblz4
doesn't compensate for that. Therefore include compiler.h, and to avoid
adding dependencies to non-liblz4 code, do so through the command line.
Change-Id: I581e45639ac3e103af7c16793e8effe2e632dec7
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
---
M util/cbfstool/Makefile.inc
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/20836/1
diff --git a/util/cbfstool/Makefile.inc b/util/cbfstool/Makefile.inc
index 950092f..8e4d8b6 100644
--- a/util/cbfstool/Makefile.inc
+++ b/util/cbfstool/Makefile.inc
@@ -131,7 +131,7 @@
$(objutil)/cbfstool/%.o: $(top)/util/cbfstool/lz4/lib/%.c
printf " HOSTCC $(subst $(objutil)/,,$(@))\n"
- $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -c -o $@ $<
+ $(HOSTCC) $(TOOLCPPFLAGS) $(TOOLCFLAGS) $(HOSTCFLAGS) -include $(top)/util/cbfstool/compiler.h -c -o $@ $<
$(objutil)/cbfstool/cbfstool: $(addprefix $(objutil)/cbfstool/,$(cbfsobj))
printf " HOSTCC $(subst $(objutil)/,,$(@)) (link)\n"
--
To view, visit https://review.coreboot.org/20836
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I581e45639ac3e103af7c16793e8effe2e632dec7
Gerrit-Change-Number: 20836
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi(a)google.com>