From patchwork Fri May 19 06:16:48 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: 764437 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wTdBD3nGDz9s3s for ; Fri, 19 May 2017 16:17:08 +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="Y0yyzR4D"; 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 3wTdBD2gzYzDqbl for ; Fri, 19 May 2017 16:17:08 +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="Y0yyzR4D"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from mail-pg0-x244.google.com (mail-pg0-x244.google.com [IPv6:2607:f8b0:400e:c05::244]) (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 3wTdB70vhJzDqbF for ; Fri, 19 May 2017 16:17:02 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Y0yyzR4D"; dkim-atps=neutral Received: by mail-pg0-x244.google.com with SMTP id u187so8620890pgb.1 for ; Thu, 18 May 2017 23:17:02 -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=gqr/dUwt0Kjolp/zo6Sbtam1tfSzXe8S/QuLI2D9RO4=; b=Y0yyzR4D60lgfIwwieYsnq+TFDe1W7PbJHSKCZ8ZEutsGQ89gPAo0kfO4XtMEHPsZM UvVswjIUC6/EJH4VE1IVqGl8JFQkWxYwB1rsZmVRukwT50YsGCqIkfOFx7QVfC1GU5ds PulKPd1H2v2Bda5DnSLCgEE9/NRn4fXAWdJkXjyihhySh5HL7jt0+DIyJqLVzTmkxIvS bfpJtJmV3mUaIwc8otvslYATR5NSFmLl1D5K1QZWnHL3WfNIS4gNb72bw/yOmYK0S1W4 q/RBcIdC9Bu5+P4Nejjm5mLLBuabXzgUYciMCvZXUeph3P35lA5u50RiY30f7xYHj2zw +ewQ== 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=gqr/dUwt0Kjolp/zo6Sbtam1tfSzXe8S/QuLI2D9RO4=; b=aqQ/VbrnjudOwwx6SZhIMrmt9SN+LfsFaw0TI1dBvwsDq5Hiquh7y8lys828CT6Tsj NY9uzMyGK3Xrw3+kv0mnzm/6VA1stxDXOt7qFbBLK8Z5MuUzMeWQ5XC4ut23ZbVxxa/P oQm19j/xJ140EMIxgO9FqH3TaW1QeEs4Rkv5UHdG5Sgm7oJXpRwLjmgdWGaJXn1kRb5Z oIOLRRTd19hbXtD87EQCuxm7vKmImprvsnwr2tnZguyFWgkDTAWRXDPQ5HbBerQ9vFGu IspG52jjtjM6xLUaJJ6FIPyXnfQkCJH2kSLH5SMDo9W1mQ2eaRE2qdS4swwo8MAOT1CD Qmaw== X-Gm-Message-State: AODbwcAajhWo1jwtMjDRXISwS+L2DCc/mRb67W32YWL6JyZMSogIyiNS +gYR19oWtbvXxA== X-Received: by 10.84.168.69 with SMTP id e63mr9380107plb.124.1495174621135; Thu, 18 May 2017 23:17:01 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id l198sm14427610pga.50.2017.05.18.23.16.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 May 2017 23:17:00 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Fri, 19 May 2017 16:16:48 +1000 Message-Id: <20170519061648.21543-1-oohall@gmail.com> X-Mailer: git-send-email 2.9.3 Subject: [Skiboot] [PATCH] mambo: Add a reservation for the initramfs 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" On most systems the initramfs is loaded inside the part of memory reserved for the OS [0x0-0x30000000] and skiboot will never touch it. On mambo it's loaded at 0x80000000 and if you're unlucky skiboot can allocate over the top of it and corrupt the initramfs blob. There might be the downside that the kernel cannot re-use the initramfs memory since it's marked as reserved, but the kernel might also free it anyway. Signed-off-by: Oliver O'Halloran Tested-by: Michael Ellerman --- external/mambo/skiboot.tcl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl index 1b74c9bc5f3d..40e4107bf9a5 100644 --- a/external/mambo/skiboot.tcl +++ b/external/mambo/skiboot.tcl @@ -216,6 +216,11 @@ mysim of addprop $reserved_memory int "#size-cells" 2 mysim of addprop $reserved_memory int "#address-cells" 2 mysim of addprop $reserved_memory empty "ranges" "" +set initramfs_res [mysim of addchild $reserved_memory "initramfs" ""] +set reg [list $cpio_start $cpio_size ] +mysim of addprop $initramfs_res array64 "reg" reg +mysim of addprop $initramfs_res empty "name" "initramfs" + set fake_nvram_node [mysim of addchild $reserved_memory "ibm,fake-nvram" ""] set reg [list $fake_nvram_start $fake_nvram_size ] mysim of addprop $fake_nvram_node array64 "reg" reg