From patchwork Fri May 26 07:00:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 767265 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wYxq05tgvz9s86 for ; Fri, 26 May 2017 17:00:28 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="t9gAx80O"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wYxq04PTnzDqR5 for ; Fri, 26 May 2017 17:00:28 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="t9gAx80O"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wYxps1ZhrzDqQl for ; Fri, 26 May 2017 17:00:21 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="t9gAx80O"; dkim-atps=neutral Received: by mail-pf0-x243.google.com with SMTP id n23so764802pfb.3 for ; Fri, 26 May 2017 00:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=+lFwT24sByQjFW40k1NoWaeemDphLpgR5OTjtvcPUd4=; b=t9gAx80Oj3Wge2szvFqiYuZTjADQB2u+AD84p0Zmh7+nRfl1gKA6tI8tJk7gaWVbQ2 +NSVngy8n0bNqW1LgW58ywGdr6K+va22qkMZuyKyf+gkcPvvZsqMUE+xOWnLfr01GX7A K+6I2JU0WWYMIuVC+cptpcyvVAvwZzuDYE8QAqXWfx6NAzNfJaMZHMFFdOmaje62F5Ua 7tajyEWUFUBkmt0rUx0217yMm+Umketbneqo8HUYam0cIOi5oAFpimWS2wct2j3+s6Wd 43XDZ0C1O8gLt6M32fu3B7Fbfgk8tWNk4NyNaYynUMXDykjZcPeBpHJ44/p4SGD7ldRv hGrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+lFwT24sByQjFW40k1NoWaeemDphLpgR5OTjtvcPUd4=; b=cDsvgAvmqskIO/D0qmtq+OtLVmmqghoSJYIqvMvWv4nHqv0exsIa6OsDzCtoVvm5r7 J94UT0vL1pnJJ1JIq5hNSgrPkz1p6P88W9R3LVgSjcJIvnd08I5djWnlKZDAbXk0YVLD qA4gAw9i523hGU9lKrFry+X5yz/TKrPtLm1kQd2n6hhedBFFXRkO5g2oEZ2iGL1/yaUV 4JD3ps9ekjaTAEvUbAhM1MYDDpljv9ILBOJpaDMZ9Ty+8ft5vgY6PGOEY1xLF9zN6vkX KAJON7WskCBzeTS3J/3BrlI/gZG8parYTWUAYUDux0ZD+ekPphCYNEXRKSgD71Iafa/B Kk4Q== X-Gm-Message-State: AODbwcC8USl+UoLqI9vqPEwSx/iFefDZAs6v8hIXbLq9nGfRGrxHpK3i 9Wf+XqxX+beOGhsE X-Received: by 10.98.69.193 with SMTP id n62mr579192pfi.216.1495782018893; Fri, 26 May 2017 00:00:18 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id x73sm19194729pfa.71.2017.05.26.00.00.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 May 2017 00:00:18 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 26 May 2017 17:00:00 +1000 Message-Id: <20170526070001.25510-1-oohall@gmail.com> X-Mailer: git-send-email 2.9.3 Subject: [Skiboot] [PATCH v2] hdata: Ignore unnamed memory reservations. X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- hdata/memory.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hdata/memory.c b/hdata/memory.c index 0c6c0811f61a..4ff3854f0fd6 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));