From patchwork Thu Aug 11 23:03:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 9276119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7C6F960231 for ; Thu, 11 Aug 2016 23:07:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B8C3287BA for ; Thu, 11 Aug 2016 23:07:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F0B4287BC; Thu, 11 Aug 2016 23:07:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E0125287BA for ; Thu, 11 Aug 2016 23:07:55 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bXz2M-0004in-4i; Thu, 11 Aug 2016 23:05:18 +0000 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5] helo=mx0a-001b2d01.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bXz1u-00045E-P3 for linux-arm-kernel@lists.infradead.org; Thu, 11 Aug 2016 23:04:53 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u7BN4Kng094540 for ; Thu, 11 Aug 2016 19:04:30 -0400 Received: from e24smtp02.br.ibm.com (e24smtp02.br.ibm.com [32.104.18.86]) by mx0b-001b2d01.pphosted.com with ESMTP id 24qm9wwrxv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 11 Aug 2016 19:04:29 -0400 Received: from localhost by e24smtp02.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 11 Aug 2016 20:04:27 -0300 Received: from d24dlp01.br.ibm.com (9.18.248.204) by e24smtp02.br.ibm.com (10.172.0.142) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 11 Aug 2016 20:04:25 -0300 X-IBM-Helo: d24dlp01.br.ibm.com X-IBM-MailFrom: bauerman@linux.vnet.ibm.com X-IBM-RcptTo: kexec@lists.infradead.org; linux-arm-kernel@lists.infradead.org Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp01.br.ibm.com (Postfix) with ESMTP id BDC9E3520068; Thu, 11 Aug 2016 19:04:04 -0400 (EDT) Received: from d24av04.br.ibm.com (d24av04.br.ibm.com [9.8.31.97]) by d24relay01.br.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u7BN4Ppa4390968; Thu, 11 Aug 2016 20:04:25 -0300 Received: from d24av04.br.ibm.com (localhost [127.0.0.1]) by d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u7BN4NER019223; Thu, 11 Aug 2016 20:04:25 -0300 Received: from hactar.ibm.com (mwramos.br.ibm.com [9.18.201.183] (may be forged)) by d24av04.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u7BN4KWK019189; Thu, 11 Aug 2016 20:04:22 -0300 From: Thiago Jung Bauermann To: kexec@lists.infradead.org Subject: [PATCH v2 1/2] kexec: add dtb info to struct kimage Date: Thu, 11 Aug 2016 20:03:57 -0300 X-Mailer: git-send-email 1.9.1 In-Reply-To: <1470956638-3589-1-git-send-email-bauerman@linux.vnet.ibm.com> References: <1470956638-3589-1-git-send-email-bauerman@linux.vnet.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16081123-0020-0000-0000-0000022E8F17 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16081123-0021-0000-0000-000030182C3E Message-Id: <1470956638-3589-2-git-send-email-bauerman@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-08-11_14:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=13 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608110297 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160811_160451_083115_A8DF589D X-CRM114-Status: GOOD ( 13.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stewart Smith , Mark Rutland , Benjamin Herrenschmidt , Arnd Bergmann , Baoquan He , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Vivek Goyal , AKASHI Takahiro , David Laight , Eric Biederman , Michael Ellerman , Russell King - ARM Linux , Andrew Morton , Dave Young , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: AKASHI Takahiro Device tree blob must be passed to a second kernel on DTB-capable archs, like powerpc and arm64, but the current kernel interface lacks this support. This patch adds dtb buffer information to struct kimage. When users don't specify dtb explicitly and the one used for the current kernel can be re-used, this change will be good enough for implementing kexec_file_load feature. Signed-off-by: AKASHI Takahiro Acked-by: Dave Young --- include/linux/kexec.h | 3 +++ kernel/kexec_file.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d7437777baaa..4f85d284ed0b 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h @@ -192,6 +192,9 @@ struct kimage { char *cmdline_buf; unsigned long cmdline_buf_len; + void *dtb_buf; + unsigned long dtb_buf_len; + /* File operations provided by image loader */ struct kexec_file_ops *fops; diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c index 503bc2d348e5..113af2f219b9 100644 --- a/kernel/kexec_file.c +++ b/kernel/kexec_file.c @@ -92,6 +92,9 @@ void kimage_file_post_load_cleanup(struct kimage *image) vfree(image->initrd_buf); image->initrd_buf = NULL; + vfree(image->dtb_buf); + image->dtb_buf = NULL; + kfree(image->cmdline_buf); image->cmdline_buf = NULL;