Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2927589imu; Mon, 17 Dec 2018 10:04:28 -0800 (PST) X-Google-Smtp-Source: AFSGD/XbNSDXkyslXlvgTnEY1phFL4S+Y5S+69yecUuOCTVS7Lx1i/pC02bL+vzkBTSIzQRBsHb4 X-Received: by 2002:a63:c42:: with SMTP id 2mr490597pgm.372.1545069868698; Mon, 17 Dec 2018 10:04:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545069868; cv=none; d=google.com; s=arc-20160816; b=F69Q55iiavD3DUnZx16E7oEVYQoQvi5P48y4F91nRqjjq9BUqvsqumFfFhsIml6XSQ VrVuH9YbFTt7rNis0ogyljRRZqkyswEJaYeYvinqQkRox75W3LgD+93Pe7dqkyo8yFe8 5B3O8j9PQgG6Lc19PuLYU87breCRzRQlVm/5SvuSPc+7yi+vh1MaflM9OG3e3Yfio53F 2h2OSHWk8nZ2AwgKMDdnLtznBmRkw1+ORbMBeTybDpLbRm1APD5lWbKYIjPfe6Ey7W2y auoM/5a2jbtb1xJqVuLnzaKE0xHmpWa0cH1ClglWZk/ddeNsJujdtkPfAb8NWymCJKnc EZ5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:message-id; bh=BmPaB3wPThSfTpJ4oX4+kp54f8U1U7GOtICTY7xh4zc=; b=aYcPt2/E2WIBc4mWONvdmaIumaUkEYuHft9YrZkglTZwnBjCyIz850JgyxUOaI6BIt 6DjQXc5rqFty0DgjKahr8M7+BRMpAQdPAnBHVRCqazx+WuQiRUp0tkZGtwKA6KH27b0j DZkHZ+lRedf1x5zdIJGZNXIOi69IcpGNDFEPKezxmjzQs9tlfrEp9r7JruyUL9E/oRrc YxENpNhn66I/T52CdXlaHyN+FRBPZfoBSifvs8Owf4xC4zrfOv0EwVEFqPKOUwS67T85 JeX7b2MnC7ohiJVdmqOGhq+xHoUf/c2D7qtzexqV1iX6DyYF6w5AukMsRdXuuHd/dc+f RRWQ== 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 i17si7851718pgk.233.2018.12.17.10.04.12; Mon, 17 Dec 2018 10:04:28 -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 S1727215AbeLQOSa (ORCPT + 99 others); Mon, 17 Dec 2018 09:18:30 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:13122 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726660AbeLQOS3 (ORCPT ); Mon, 17 Dec 2018 09:18:29 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43JNYH0wGLz9vBmj; Mon, 17 Dec 2018 15:18:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id gsX6KHNEOgGm; Mon, 17 Dec 2018 15:18:27 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 43JNYH0NtDz9vBmh; Mon, 17 Dec 2018 15:18:27 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E6EB58B7E1; Mon, 17 Dec 2018 15:18:27 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id 6vO1qeMetE85; Mon, 17 Dec 2018 15:18:27 +0100 (CET) Received: from po14163vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CCE828B7CB; Mon, 17 Dec 2018 15:18:27 +0100 (CET) Received: by po14163vm.idsi0.si.c-s.fr (Postfix, from userid 0) id A63F47170C; Mon, 17 Dec 2018 14:18:27 +0000 (UTC) Message-Id: <9e06c82e76e8e29cb1ae0b989f3bbbb6b2099e03.1545053638.git.christophe.leroy@c-s.fr> From: Christophe Leroy Subject: [PATCH] powerpc/prom: move the device tree if not in declared memory. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 17 Dec 2018 14:18:27 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/prom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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