[Skiboot] [PATCH] hdat: Ignore broken memory reserves

Michael Neuling mikey at neuling.org
Wed Mar 1 15:27:51 AEDT 2017


Ignore HDAT memory reserves > 512MB.  These are considered bogus and
workaround known HDAT bugs.

Signed-off-by: Michael Neuling <mikey at neuling.org>
---
 hdata/memory.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/hdata/memory.c b/hdata/memory.c
index f16f4cb037..442d35caed 100644
--- a/hdata/memory.c
+++ b/hdata/memory.c
@@ -439,7 +439,6 @@ static void get_hb_reserved_mem(struct HDIF_common_hdr *ms_vpd)
 		/* remove the HRMOR bypass bit */
 		start_addr &= ~HRMOR_BIT;
 		end_addr &= ~HRMOR_BIT;
-
 		if (label_size > 64)
 			label_size = 64;
 
@@ -452,6 +451,17 @@ static void get_hb_reserved_mem(struct HDIF_common_hdr *ms_vpd)
 		if (strlen(label) == 0)
 			snprintf(label, 64, "hostboot-reserve-%d", unnamed++);
 
+		/*
+		 * Workaround broken HDAT reserve regions which are
+		 * bigger than 512MB
+		 */
+		if ((end_addr - start_addr) > 0x20000000) {
+			prlog(PR_ERR, "MEM: Ignoring Bad HDAT reserve: too big "
+			      "'%s' %#" PRIx64 "-%#" PRIx64 "\n",
+			      label, start_addr, end_addr);
+			continue;
+		}
+
 		mem_reserve_hw(label, start_addr, end_addr - start_addr);
 
 		prlog(PR_DEBUG, "MEM: Reserve '%s' %#" PRIx64 "-%#" PRIx64 "\n",
-- 
2.9.3



More information about the Skiboot mailing list