Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4714877imu; Tue, 18 Dec 2018 22:00:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/UYBfd2rNg83hXT0FuCy89FP/w5UzPZrro4qrwF+Jpize8nRSp+x3HSeDJ5ukqEqQam8NzM X-Received: by 2002:a17:902:e20b:: with SMTP id ce11mr18406984plb.251.1545199256929; Tue, 18 Dec 2018 22:00:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545199256; cv=none; d=google.com; s=arc-20160816; b=myDblxikznKmVzB7i8VN1QBHFFm/Kx85TI5yn/AXBzXRY0jpSCmRV9RpOId/w2Q12l UYmfQA6Jo+kl+KPb0BnoW6rJ+mhPk5PCuHCDrtDerIn3NSrwylg+l+diEMuB/q3c9i24 ENXhu3YuLkLyNGVkDOZycKwca8nxKoOGJtTnWCpYai9Sq4mwHUYP1oDj7TqNm+dFCajO DgacFeYRghtxHrjFl+SKE0I5emchmzMzwqjtsC+TaMlPi1BLNYUyuBvbuhGWgg3grWyA V+C7UpLTzJHXLKqXS8w2885LAJa4RS3VjP/O7ROpah72guD12bm1vpzEaFh/VObaP5UW jngQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=ybOPFaEyXmEaTKvNAILgHopQ4iS7Q42suCva/YYMjpg=; b=yx3yAgcJwSLq4j3TBxzGG+Z8eiZwpH5QEmuIJhPUhOu7uqjoCBU1MxAj+2Zojqweg1 7Hh1r0yjEOhcHgY8/+W8cuoox8FezF9f5gBr0Mpubqv3cOvVCAb5x2av/hOvBl8kTBfp MkmypICIuBwAaeQLm57whkYyeeaBYS0dAq3woUhYz/PxqjBmUN8FqDF4nW7FRIULkHkX f7iM6kZHoFlKUJnC+2tWSA03E+5wfHxuoDduGh5CsLe+3+ujsnQTqi+6SG5e+xT4FXMV cHhTZuw9dKJYtSAlF9f/6Mks7m/NweiKb/VKJV6+5fLOFJQZkiiX+rx5Gwcwjc6BOzW3 foQA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si15093671plg.123.2018.12.18.22.00.38; Tue, 18 Dec 2018 22:00:56 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727347AbeLSEmz (ORCPT + 99 others); Tue, 18 Dec 2018 23:42:55 -0500 Received: from ozlabs.org ([203.11.71.1]:51989 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726993AbeLSEmz (ORCPT ); Tue, 18 Dec 2018 23:42:55 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 43KMhD4ngXz9s6w; Wed, 19 Dec 2018 15:42:52 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc/prom: move the device tree if not in declared memory. In-Reply-To: <9e06c82e76e8e29cb1ae0b989f3bbbb6b2099e03.1545053638.git.christophe.leroy@c-s.fr> References: <9e06c82e76e8e29cb1ae0b989f3bbbb6b2099e03.1545053638.git.christophe.leroy@c-s.fr> Date: Wed, 19 Dec 2018 15:42:50 +1100 Message-ID: <871s6erut1.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > If the device tree doesn't reside in the memory which is declared > inside it, it has to be moved as well as this memory will not be > mapped by the kernel. I worry this will break some obscure platform, but I'll merge it anyway and we'll see :) cheers > diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c > index 87a68e2dc531..4181ec715f88 100644 > --- a/arch/powerpc/kernel/prom.c > +++ b/arch/powerpc/kernel/prom.c > @@ -124,8 +124,8 @@ static void __init move_device_tree(void) > size = fdt_totalsize(initial_boot_params); > > if ((memory_limit && (start + size) > PHYSICAL_START + memory_limit) || > - overlaps_crashkernel(start, size) || > - overlaps_initrd(start, size)) { > + !memblock_is_memory(start + size - 1) || > + overlaps_crashkernel(start, size) || overlaps_initrd(start, size)) { > p = __va(memblock_phys_alloc(size, PAGE_SIZE)); > memcpy(p, initial_boot_params, size); > initial_boot_params = p; > -- > 2.13.3