aboutsummaryrefslogtreecommitdiff
path: root/hdata
diff options
context:
space:
mode:
authorOliver O'Halloran <oohall@gmail.com>2017-05-26 17:00:00 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-05-26 17:02:24 +1000
commit1d4a0a4374f69c890b64f5463930775d94139ded (patch)
tree6dc545907428886174438822b09ec1b1bc863650 /hdata
parent25e42bad1f29384526d4ac1ad43dbd53505a687b (diff)
downloadskiboot-1d4a0a4374f69c890b64f5463930775d94139ded.zip
skiboot-1d4a0a4374f69c890b64f5463930775d94139ded.tar.gz
skiboot-1d4a0a4374f69c890b64f5463930775d94139ded.tar.bz2
hdata: Ignore unnamed memory reservations.
Hostboot should name any and all memory reservations that it provides. Currently some hostboots export a broken reservation covering the first 256MB of memory and this causes the system to crash at boot due to an invalid free because this overlaps with the static "ibm,os-reserve" region (which covers the first 768MB of memory). According to the hostboot team unnamed reservations are invalid and can be ignored. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/memory.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/hdata/memory.c b/hdata/memory.c
index 686c93e..3010428 100644
--- a/hdata/memory.c
+++ b/hdata/memory.c
@@ -409,7 +409,7 @@ static void get_hb_reserved_mem(struct HDIF_common_hdr *ms_vpd)
{
const struct msvpd_hb_reserved_mem *hb_resv_mem;
u64 start_addr, end_addr, label_size;
- int unnamed = 0, count, i;
+ int count, i;
char *label;
/*
@@ -463,9 +463,11 @@ static void get_hb_reserved_mem(struct HDIF_common_hdr *ms_vpd)
memcpy(label, hb_resv_mem->label, label_size);
label[label_size] = '\0';
- if (strlen(label) == 0)
- snprintf(label, 64, "hostboot-reserve-%d", unnamed++);
-
+ /* Unnamed reservations are always broken. Ignore them. */
+ if (strlen(label) == 0) {
+ free(label);
+ continue;
+ }
prlog(PR_DEBUG, "MEM: Reserve '%s' %#" PRIx64 "-%#" PRIx64 " (type/inst=0x%08x)\n",
label, start_addr, end_addr, be32_to_cpu(hb_resv_mem->type_instance));