Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1297600ybm; Wed, 22 May 2019 21:46:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzqL3QfnmBovi07a/NH08g12CyLmMzGyPLkatbyYPenWEyxGFLGttG571yFgpsx586hvUI X-Received: by 2002:aa7:9aa5:: with SMTP id x5mr9810947pfi.135.1558586815309; Wed, 22 May 2019 21:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558586815; cv=none; d=google.com; s=arc-20160816; b=vmxWkdUkdRLj3AcHTs9xsSe62nOjx7TThweeeRrpYC7m1ToQlXHUy0GP9U732DhQX3 0+/EjxsNe1NTJ24TumY6IitD26B1Jay8A6qmFk0egYHJoNNM4Qy8JznVytWvZ0wFyUrV yGOsBMVVLagim2tWLJvQQpsgYS9JL4EZnMSspXRqwgxqXOer+eGdc8lOnfH4NVK7YpGf QHs+KKfXGegCzhpg5jXvI/915AZotAhDF5Is02E47lmAT0Hd0zYbtYFJRoR4CQjTHmDf 3ckOUk4+1QpG+zKZbswTlLMcW/ZyJw5hM1uCb3iWmh2K+uQb5uHY2BKs2RANFOEKk5H9 9lUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:mime-version:date:in-reply-to :subject:cc:to:from:user-agent:references; bh=R8WshFmFkLAmDv60ijMui9OwnKs+CLWnihqDHZFoTSU=; b=K9BTLSShTZhkKn8lqsgt43MlHa6QWOZOlWPkfY67lgAOMmvTGd/DwOj7Nrf0vVIiWL UvutXG5ToV71eaPBmnyhybVwV65tEEzci1Xt4+uQ+RqFcXbt5C9uF0Wjdhrf3ze0cAeT HPf0FY90xl9hAF0d/jt9OIAbJ52haRuTbQv0r1d3eXRyC55s1gPEA/mYGxTe24N1MWdV LfSgmWgGf+9ElNKfCAz+dl//zMJv2F6xENlMbUr+x5wEC/4QRz/z4l4hbqBcbvLuUsjG mMf9fYM35g1kElNtE6yvPTCyaTO11eUhUXDNmpKWey1lwxtmE5UAzybH3iN6nedLccoA /T2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si28209582pgh.367.2019.05.22.21.46.39; Wed, 22 May 2019 21:46:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726636AbfEWEnm (ORCPT + 99 others); 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