From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8999CC04AAC for ; Thu, 23 May 2019 04:45:05 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF31420B1F for ; Thu, 23 May 2019 04:45:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF31420B1F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 458cPB2BJBzDqSw for ; Thu, 23 May 2019 14:45:02 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=linux.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=bauerman@linux.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 458cMj74VFzDqR0 for ; Thu, 23 May 2019 14:43:44 +1000 (AEST) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4N4bTqI135325 for ; Thu, 23 May 2019 00:43:41 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2snh786reb-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 May 2019 00:43:41 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 23 May 2019 05:43:40 +0100 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 23 May 2019 05:43:38 +0100 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4N4hbPk3473914 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 May 2019 04:43:37 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E7414C605F; Thu, 23 May 2019 04:43:36 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DA869C6055; Thu, 23 May 2019 04:43:34 +0000 (GMT) Received: from morokweng.localdomain (unknown [9.80.216.227]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTPS; Thu, 23 May 2019 04:43:34 +0000 (GMT) References: <20190522220158.18479-1-bauerman@linux.ibm.com> <20190523032302.GD8174@dhcp-128-65.nay.redhat.com> User-agent: mu4e 1.0; emacs 26.2 From: Thiago Jung Bauermann To: Dave Young Subject: Re: [PATCH] powerpc: Fix loading of kernel + initramfs with kexec_file_load() In-reply-to: <20190523032302.GD8174@dhcp-128-65.nay.redhat.com> Date: Thu, 23 May 2019 01:43:29 -0300 MIME-Version: 1.0 Content-Type: text/plain X-TM-AS-GCONF: 00 x-cbid: 19052304-0016-0000-0000-000009B8A5A7 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011146; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01207281; UDB=6.00634023; IPR=6.00988261; MB=3.00027013; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-23 04:43:39 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19052304-0017-0000-0000-000043546588 Message-Id: <87zhndzspa.fsf@morokweng.localdomain> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-23_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1905230032 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Mimi Zohar , AKASHI Takahiro , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Dave Young writes: > On 05/22/19 at 07:01pm, Thiago Jung Bauermann wrote: >> Commit b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()") >> changed kexec_add_buffer() to skip searching for a memory location if >> kexec_buf.mem is already set, and use the address that is there. >> >> In powerpc code we reuse a kexec_buf variable for loading both the kernel >> and the initramfs by resetting some of the fields between those uses, but >> not mem. This causes kexec_add_buffer() to try to load the kernel at the >> same address where initramfs will be loaded, which is naturally rejected: >> >> # kexec -s -l --initrd initramfs vmlinuz >> kexec_file_load failed: Invalid argument >> >> Setting the mem field before every call to kexec_add_buffer() fixes this >> regression. >> >> Fixes: b6664ba42f14 ("s390, kexec_file: drop arch_kexec_mem_walk()") >> Signed-off-by: Thiago Jung Bauermann >> --- >> arch/powerpc/kernel/kexec_elf_64.c | 6 +++++- >> 1 file changed, 5 insertions(+), 1 deletion(-) > > Reviewed-by: Dave Young Thanks! -- Thiago Jung Bauermann IBM Linux Technology Center