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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 D1DFFC48BDF for ; Tue, 15 Jun 2021 16:13:49 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 4E4A661585 for ; Tue, 15 Jun 2021 16:13:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4E4A661585 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4G4Czw39p3z3c2m for ; Wed, 16 Jun 2021 02:13:48 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=S3nWv4Yf; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.microsoft.com (client-ip=13.77.154.182; helo=linux.microsoft.com; envelope-from=nramas@linux.microsoft.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.a=rsa-sha256 header.s=default header.b=S3nWv4Yf; dkim-atps=neutral Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by lists.ozlabs.org (Postfix) with ESMTP id 4G4CzN4bWvz3btL for ; Wed, 16 Jun 2021 02:13:20 +1000 (AEST) Received: from nramas-ThinkStation-P520 (c-73-42-176-67.hsd1.wa.comcast.net [73.42.176.67]) by linux.microsoft.com (Postfix) with ESMTPSA id 289BF20B83DE; Tue, 15 Jun 2021 09:13:15 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 289BF20B83DE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1623773595; bh=6UtEbcJN/IpvUsLN1GwdJnJrbEZUHAkAxbKrwbhgW78=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=S3nWv4Yf1N41H0w1XOSwFPGkr7/xfVoa9sUqWF341iik0xwYxblV16N/Bn7QfL+Gu 4rULT6aNTDRocdECtjebsPLhXgpR5L67WcrQMTYKf/J9N2zaDDOmFqJGxI8/rygbOq LZOJ+ayZrbnAqpTcPicLrwL8cTXwbtOcLdLzJGEk= Message-ID: <54efb4fce5aac7efbd0b1b3885e9098b1d4ea745.camel@linux.microsoft.com> Subject: Re: [PATCH v19 05/13] of: Add a common kexec FDT setup function From: nramas To: Rob Herring , Geert Uytterhoeven Date: Tue, 15 Jun 2021 09:13:14 -0700 In-Reply-To: References: <20210221174930.27324-1-nramas@linux.microsoft.com> <20210221174930.27324-6-nramas@linux.microsoft.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5-0ubuntu1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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: Mark Rutland , tao.li@vivo.com, Mimi Zohar , Paul Mackerras , Vincenzo Frascino , Frank Rowand , Sasha Levin , Stephen Rothwell , Masahiro Yamada , James Morris , AKASHI Takahiro , Linux ARM , Catalin Marinas , "Serge E. Hallyn" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Pavel Tatashin , Will Deacon , Prakhar Srivastava , Hsin-Yi Wang , Allison Randal , Christophe Leroy , Matthias Brugger , balajib@linux.microsoft.com, dmitry.kasatkin@gmail.com, Linux Kernel Mailing List , James Morse , Greg KH , Joe Perches , linux-integrity , linuxppc-dev , Thiago Jung Bauermann Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, 2021-06-15 at 08:01 -0600, Rob Herring wrote: > On Tue, Jun 15, 2021 at 6:18 AM Geert Uytterhoeven < > geert@linux-m68k.org> wrote: > > > > > +void *of_kexec_alloc_and_setup_fdt(const struct kimage *image, > > > + unsigned long > > > initrd_load_addr, > > > + unsigned long initrd_len, > > > + const char *cmdline, size_t > > > extra_fdt_size) > > > +{ > > > + /* Did we boot using an initrd? */ > > > + prop = fdt_getprop(fdt, chosen_node, "linux,initrd- > > > start", NULL); > > > + if (prop) { > > > + u64 tmp_start, tmp_end, tmp_size; > > > + > > > + tmp_start = fdt64_to_cpu(*((const fdt64_t *) > > > prop)); > > > + > > > + prop = fdt_getprop(fdt, chosen_node, > > > "linux,initrd-end", NULL); > > > + if (!prop) { > > > + ret = -EINVAL; > > > + goto out; > > > + } > > > + > > > + tmp_end = fdt64_to_cpu(*((const fdt64_t *) > > > prop)); > > > > Some kernel code assumes "linux,initrd-{start,end}" are 64-bit, > > other code assumes 32-bit. > > It can be either. The above code was a merge of arm64 and powerpc > both > of which use 64-bit and still only runs on those arches. It looks > like > some powerpc platforms may use 32-bit, but this would have been > broken > before. of_kexec_alloc_and_setup_fdt() is called from elf_64.c (in arch/powerpc/kexec) which is for 64-bit powerpc platform only. thanks, -lakshmi > > The code in drivers/of/fdt.c handles either case. We should probably > refactor early_init_dt_check_for_initrd() and this function to use a > common routine. > > > linux/Documentation/arm/uefi.rst says 64-bit, > > dt-schema/schemas/chosen.yaml says 32-bit. > > We should fix that. > > Rob