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=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 70B8CC282E1 for ; Sat, 25 May 2019 00:58:53 +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 2764220863 for ; Sat, 25 May 2019 00:58:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2764220863 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au 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 459lHH0N59zDqY3 for ; Sat, 25 May 2019 10:58:51 +1000 (AEST) Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 459lBd5zmpzDqTW for ; Sat, 25 May 2019 10:54:49 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au 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 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) 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: AKASHI Takahiro , Thiago Jung Bauermann , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, Mimi Zohar Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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