diff options
author | Michael Neuling <mikey@neuling.org> | 2017-03-01 15:27:51 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-03-02 14:07:52 +1100 |
commit | 42b7ef13b3475199791ce2cdc6e6f9858003f670 (patch) | |
tree | e16f71b0d7636989ac2f7c42028833eaf86d0ac7 /hdata/memory.c | |
parent | 8e64bbd66280ee39d4c91efc567587f6af53cc85 (diff) | |
download | skiboot-42b7ef13b3475199791ce2cdc6e6f9858003f670.zip skiboot-42b7ef13b3475199791ce2cdc6e6f9858003f670.tar.gz skiboot-42b7ef13b3475199791ce2cdc6e6f9858003f670.tar.bz2 |
hdat: Ignore broken memory reserves
Ignore HDAT memory reserves > 512MB. These are considered bogus and
workaround known HDAT bugs.
Signed-off-by: Michael Neuling <mikey@neuling.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata/memory.c')
-rw-r--r-- | hdata/memory.c | 12 |
1 files changed, 11 insertions, 1 deletions
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", |