From 42b7ef13b3475199791ce2cdc6e6f9858003f670 Mon Sep 17 00:00:00 2001 From: Michael Neuling Date: Wed, 1 Mar 2017 15:27:51 +1100 Subject: hdat: Ignore broken memory reserves Ignore HDAT memory reserves > 512MB. These are considered bogus and workaround known HDAT bugs. Signed-off-by: Michael Neuling Signed-off-by: Stewart Smith --- hdata/memory.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'hdata/memory.c') diff --git a/hdata/memory.c b/hdata/memory.c index f16f4cb..442d35c 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", -- cgit v1.1