Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7622942pxb; Thu, 18 Feb 2021 15:30:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCwpg0LEpDpQaJmQgyLVu18ZIiMmL9g0feQ1RXoO7hDYBY8lhGnHI1duSveH+kjSiEZfhX X-Received: by 2002:a17:906:f288:: with SMTP id gu8mr6309283ejb.512.1613691029582; Thu, 18 Feb 2021 15:30:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613691029; cv=none; d=google.com; s=arc-20160816; b=Y8BraCVGdncFk3s6ZBEFA/qqFBY/XlwKszsx2aa+ai4UyaOyl9t2z0kuvZrQq19MbK mXzTVF/1+alko4SffwM3U4GNjzsWeXFHG39q2x+6Xx1P6nIIEx5/fYsRzOoQKMg12VoR jAPpQDP9TH9DgdvDVI3rny+WaHANvYdXgc11/Mv/UTi5ywfsV4qPAyvCoyDcJMuIDebX WrSw6K3Bcm3IbJx3kkJA7fdRtCWsh2As0HN3G++QXL9YECW/6E4PfseY3xhJ3nYjXIvB wccSzBlPi8SqK131fFZHEYgv/4hzGVABPnKc7VxXbBVn+rk9k6EAMKevjkxh8PjRqQzO 0iSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=bFN18q4O/nDm7OdyQJ0+r8zoqNuSxpefhw2HLaeFKLs=; b=hHF73g/A3JqPk0QyMf30HtTrZ0ATXQp4PiSWVtRx1n7AKbOYFMZtoJaKBt+NYg2k1A OPzo456f8LdpFldMLJcIzfchIHkW7l7Ev58XCV2PJnrZQ368gn5ordLwBdbdUvUbA9eX Iw+wn2r39fLYGP0tPAoz5dodRj+U3eDWRv6kBCQNiMJggWHAbPYvCHpiZu1rPXE//ZCI FIJr152FgeHrNGfBhT4XHV91oZLiyec+t7r+gfl5/dcOs0RuOe2QWkOXSnKE99DkdAKx wpV4NF+or1FTmuFuUafwy+uMpPvyHTeiEJszAIqemNFuqq8mYcGRl0QU8U7tNx7T/wUD GGMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=MWJn7fTB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lz22si1219942ejb.184.2021.02.18.15.30.06; Thu, 18 Feb 2021 15:30:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=MWJn7fTB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230000AbhBRX33 (ORCPT + 99 others); Thu, 18 Feb 2021 18:29:29 -0500 Received: from ozlabs.org ([203.11.71.1]:43969 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229752AbhBRX32 (ORCPT ); Thu, 18 Feb 2021 18:29:28 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4DhW9p4XL0z9sRf; Fri, 19 Feb 2021 10:28:46 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1613690926; bh=D32VQYe7TeZriP6FVSqNq/sNmMNac+rakTOCN0D48VM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=MWJn7fTBHjA4tuIUkAcAOgbOBj7PBPHMOw5sJUiJZx97FE4+LjwAPrckH9YskJEg9 wgXkR71nvnV71clrFRA8gtIb+fMgvvrhu5m0p2jv6eSEFUJcXqPNnVTLdf0ncbywdI KYOwufP4ibYlBPkEIDEcpCM07l8dGf4xFdo693XiwHdKYgzIG7UyJJKvSJhzDq/B0D R8y1Ej8vDx0ZZyS12rf+OE0nyxJ+498bKTvOc/bT7rVtgetAWrYgPTRGezgqtehMvz ejEWMoP7sEJiG5nZEAeECljfL6qYrLRQnYF81ldXX09egwNUHMMuyzrYelFLrf6X4K TlM7ZPUTbuamA== From: Michael Ellerman To: Rob Herring , Stephen Rothwell Cc: PowerPC , Hari Bathini , Lakshmi Ramasubramanian , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: linux-next: manual merge of the devicetree tree with the powerpc tree In-Reply-To: References: <20210218144815.5673ae6f@canb.auug.org.au> <874ki9vene.fsf@mpe.ellerman.id.au> <20210218223427.77109d83@canb.auug.org.au> Date: Fri, 19 Feb 2021 10:28:46 +1100 Message-ID: <87r1ldt0pd.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rob Herring writes: > On Thu, Feb 18, 2021 at 5:34 AM Stephen Rothwell wrote: >> On Thu, 18 Feb 2021 21:44:37 +1100 Michael Ellerman wrote: >> > >> > I think it just needs this? >> > >> > diff --git a/arch/powerpc/kexec/elf_64.c b/arch/powerpc/kexec/elf_64.c >> > index 87e34611f93d..0492ca6003f3 100644 >> > --- a/arch/powerpc/kexec/elf_64.c >> > +++ b/arch/powerpc/kexec/elf_64.c >> > @@ -104,7 +104,7 @@ static void *elf64_load(struct kimage *image, char *kernel_buf, >> > >> > fdt = of_kexec_alloc_and_setup_fdt(image, initrd_load_addr, >> > initrd_len, cmdline, >> > - fdt_totalsize(initial_boot_params)); >> > + kexec_fdt_totalsize_ppc64(image)); >> > if (!fdt) { >> > pr_err("Error setting up the new device tree.\n"); >> > ret = -EINVAL; >> > >> >> I thought about that, but the last argument to >> of_kexec_alloc_and_setup_fdt() is extra_fdt_size and the allocation >> done is for this: >> >> fdt_size = fdt_totalsize(initial_boot_params) + >> (cmdline ? strlen(cmdline) : 0) + >> FDT_EXTRA_SPACE + >> extra_fdt_size; >> >> and kexec_fdt_totalsize_ppc64() also includes >> fdt_totalsize(initial_boot_params) so I was not sure. Maybe >> kexec_fdt_totalsize_ppc64() needs modification as well? > > You're both right. Michael's fix is sufficient for the merge. The only > risk with a larger size is failing to allocate it, but we're talking > only 10s of KB. Historically until the commit causing the conflict, > PPC was just used 2x fdt_totalsize(initial_boot_params). You could > drop 'fdt_size = fdt_totalsize(initial_boot_params) + (2 * > COMMAND_LINE_SIZE);' from kexec_fdt_totalsize_ppc64() as well, but > then the function name is misleading. > > Lakshmi can send a follow-up patch to fine tune the size and rename > kexec_fdt_totalsize_ppc64. Sounds good. cheers