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=-9.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,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 CADCDC282E1 for ; Sat, 25 May 2019 00:54:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A9C0B20863 for ; Sat, 25 May 2019 00:54:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726490AbfEYAyx (ORCPT ); Fri, 24 May 2019 20:54:53 -0400 Received: from ozlabs.org ([203.11.71.1]:38857 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726273AbfEYAyv (ORCPT ); Fri, 24 May 2019 20:54:51 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 459lBd53mCz9sBr; Sat, 25 May 2019 10:54:49 +1000 (AEST) X-powerpc-patch-notification: thanks X-powerpc-patch-commit: 8b909e3548706cbebc0a676067b81aadda57f47e X-Patchwork-Hint: ignore In-Reply-To: <20190522220158.18479-1-bauerman@linux.ibm.com> To: Thiago Jung Bauermann , linuxppc-dev@lists.ozlabs.org From: Michael Ellerman Cc: kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Mimi Zohar , AKASHI Takahiro , Thiago Jung Bauermann Subject: Re: [PATCH] powerpc: Fix loading of kernel + initramfs with kexec_file_load() Message-Id: <459lBd53mCz9sBr@ozlabs.org> Date: Sat, 25 May 2019 10:54:49 +1000 (AEST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2019-05-22 at 22:01:58 UTC, 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 > Reviewed-by: Dave Young Applied to powerpc fixes, thanks. https://git.kernel.org/powerpc/c/8b909e3548706cbebc0a676067b81aad cheers