summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2011-01-17 13:03:26 +0100
committerBorislav Petkov <borislav.petkov@amd.com>2011-03-17 14:46:22 +0100
commit355fba600549cfcfab227f928eab3ccae444ec8e (patch)
treec1b5b554fabcefc656a27c630a2f184d2197692c
parent614ec9d8532cc6b2f6b471c399daffdfd1c32d03 (diff)
downloadlinux-3.10-355fba600549cfcfab227f928eab3ccae444ec8e.tar.gz
linux-3.10-355fba600549cfcfab227f928eab3ccae444ec8e.tar.bz2
linux-3.10-355fba600549cfcfab227f928eab3ccae444ec8e.zip
amd64_edac: Beef up early exit reporting
Add paranoid checks for the sys address before going off and decoding it. Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
-rw-r--r--drivers/edac/amd64_edac.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
index 4bba43e7ee8..e4ad09110b9 100644
--- a/drivers/edac/amd64_edac.c
+++ b/drivers/edac/amd64_edac.c
@@ -1380,9 +1380,20 @@ static int f10_match_to_this_node(struct amd64_pvt *pvt, int range,
debugf1("(range %d) SystemAddr= 0x%llx Limit=0x%llx\n",
range, sys_addr, get_dram_limit(pvt, range));
+ if (dhar_valid(pvt) &&
+ dhar_base(pvt) <= sys_addr &&
+ sys_addr < BIT_64(32)) {
+ amd64_warn("Huh? Address is in the MMIO hole: 0x%016llx\n",
+ sys_addr);
+ return -EINVAL;
+ }
+
if (intlv_en &&
- (intlv_sel != ((sys_addr >> 12) & intlv_en)))
+ (intlv_sel != ((sys_addr >> 12) & intlv_en))) {
+ amd64_warn("Botched intlv bits, en: 0x%x, sel: 0x%x\n",
+ intlv_en, intlv_sel);
return -EINVAL;
+ }
sys_addr = f10_swap_interleaved_region(pvt, sys_addr);