Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp242681imp; Thu, 21 Feb 2019 00:08:21 -0800 (PST) X-Google-Smtp-Source: AHgI3IYK07NzEBONnE/A1sLrVE0gBXVLIGhSGFbJGA0nP4dzED7W6M38DtErU8EOhQQA1ePm3Dp3 X-Received: by 2002:a17:902:aa06:: with SMTP id be6mr20820392plb.57.1550736501347; Thu, 21 Feb 2019 00:08:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550736501; cv=none; d=google.com; s=arc-20160816; b=k3VY5/JV5biomukf0DCme1UF7DNUEZv7kCytITE18IS0BO12cjAyMm31PkmPCrI4Vl QOMqyPO8JK7gGdleIiu1MrR6GT7XnMmpWJr4Pf39h14XrdNHQaFt44qx/FfQsimUwOwz p8MFNjiB16eUMFghJISpgYwnHMFC33P57dxNK7EU4A/Myhb16MBwD3NKzsquJQ6cvA4K TZWZOyvA8+1RtspF9iO27JvmM+XxUaFel8EbCzDIm59akIBQ+gIz9e2+Kp4TMzNdmTQD /uqNu3glwu6Ys9QuzzQRSoKGQgzvzjWtD9DIHUi45wJVaW9R8mP0HMbFzzuTBq9ggB83 6R4w== 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:references :in-reply-to:message-id:dkim-signature; bh=NaXbkvkn7psvy1eWkt9cv294BLfCTWF7bgvkHSXZLpc=; b=LAfMOVq63UKJfyjdhSn+vl9FD7+l/j3rCFoPur2X9WNDpsFlLmnIM1eFYKsIWpcFnk NJqgXEFb6CVV9IYAdoQMc2btOpUDWzHUKjNKHX7q0U0/wkV01XsS4dHkmGGyESS6s6+4 sK7f6iclJZqJ7lb5D6CBowXw3ufyZJaimmP1539Vl8+apWZ+QdS+i3p0iqtE5cn/0hF1 e9YZziW5SL+gna/7BLv4LQTiatc/j10BKnqpinilGocsg9OjA4//h9rs2GmJuCw3d8aK lFCRSFbWG5B5fU04tItGfv4ea3RZQagWD2Fs4H+FKcKE9mMMVUYJmXFtH2wbqwwK6ww8 U8PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=KoVv0G0D; 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 h9si2548634plk.373.2019.02.21.00.08.06; Thu, 21 Feb 2019 00:08:21 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=KoVv0G0D; 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 S1727652AbfBUIF4 (ORCPT + 99 others); Thu, 21 Feb 2019 03:05:56 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:56205 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727298AbfBUIEy (ORCPT ); Thu, 21 Feb 2019 03:04:54 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 444n7m02m7z9vJg6; Thu, 21 Feb 2019 09:04:52 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=KoVv0G0D; dkim-adsp=pass; dkim-atps=neutral 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 qGQ1OwQzvZCW; Thu, 21 Feb 2019 09:04:51 +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 444n7l6787z9vJg1; Thu, 21 Feb 2019 09:04:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550736291; bh=NaXbkvkn7psvy1eWkt9cv294BLfCTWF7bgvkHSXZLpc=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=KoVv0G0DNz3SqQoJTuogVN6AdHmcFdkX0fOJe3CAH55q8Fd1NfIgvNXr+x7pep6C7 ZwO2MdOl0/eHfWdjTcl7ktAOZVupUfNrjoqZxxugz5rhJsJqOvNDjaiZUE+ZkZKkh2 x9XkmHqsaSWhu5ersW/Kw1d1R8RGEPpqH1XWink0= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CBFEE8B78F; Thu, 21 Feb 2019 09:04:52 +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 7h-_uKZwI2DJ; Thu, 21 Feb 2019 09:04:52 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9FD008B75B; Thu, 21 Feb 2019 09:04:52 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 802BF6E866; Thu, 21 Feb 2019 08:04:52 +0000 (UTC) Message-Id: <790cf44815f8c56b3c600560bad9139f63be9f68.1550692943.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 04/16] powerpc/mm/32s: use generic mmu_mapin_ram() for all blocks. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , j.neuschaefer@gmx.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 21 Feb 2019 08:04:52 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that mmu_mapin_ram() is able to handle other blocks than the one starting at 0, the WII can use it for all its blocks. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/pgtable_32.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index b4858818523f..2bf9bf8867d4 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c @@ -254,26 +254,17 @@ static void __init __mapin_ram_chunk(unsigned long offset, unsigned long top) void __init mapin_ram(void) { - unsigned long s, top; - -#ifndef CONFIG_WII - top = total_lowmem; - s = mmu_mapin_ram(0, top); - __mapin_ram_chunk(s, top); -#else - if (!wii_hole_size) { - s = mmu_mapin_ram(0, total_lowmem); - __mapin_ram_chunk(s, total_lowmem); - } else { - top = wii_hole_start; - s = mmu_mapin_ram(0, top); - __mapin_ram_chunk(s, top); + struct memblock_region *reg; + + for_each_memblock(memory, reg) { + unsigned long base = reg->base; + unsigned long top = min(base + reg->size, (unsigned long)total_lowmem); - top = memblock_end_of_DRAM(); - s = wii_mmu_mapin_mem2(top); - __mapin_ram_chunk(s, top); + if (base >= top) + continue; + base = mmu_mapin_ram(base, top); + __mapin_ram_chunk(base, top); } -#endif } /* Scan the real Linux page tables and return a PTE pointer for -- 2.13.3