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=ham 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 AB712C04AAC for ; Thu, 23 May 2019 04:43:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8649920B1F for ; Thu, 23 May 2019 04:43:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726957AbfEWEnm (ORCPT ); Thu, 23 May 2019 00:43:42 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:59618 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725792AbfEWEnm (ORCPT ); Thu, 23 May 2019 00:43:42 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4N4bVeU025427 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 2snkcqtp0d-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 Cc: linuxppc-dev@lists.ozlabs.org, Michael Ellerman , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Mimi Zohar , AKASHI Takahiro 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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