Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp502755imp; Thu, 21 Feb 2019 05:52:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IatWAlWiuklG3aOM+FsQYAxxBKRUt4MHVx4FrbEgUS7Jn0EMr4Ym0QlhpA8wleUoPPE4JD8 X-Received: by 2002:a17:902:1102:: with SMTP id d2mr42870964pla.138.1550757136134; Thu, 21 Feb 2019 05:52:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550757136; cv=none; d=google.com; s=arc-20160816; b=JkyJNuiyDzVrSZpKMVmxAble8bNBznS7+f4x0puobh/vBJGzu9TMViIDEQ4Q85TTwU Cu9cGrpDvbgQHkOudV8Fhh0AlGAC2KS0PRwMWjpXNOGyZPJ+6PsfeJq6y4tkW3ZVOQvr bEWJadJZuRxJn0AvMzPI42TxAqWY3Q13KP3YG9KZkoZF4/8fchrBJ3/ZSHQB7EQl82tL MJyKu33YwCaP/OSZUfDOBjpDLEh829zxXt1us58GMN6GYYKu7dQBWRUXuzivcElzC27h RGOxPrJE6Fb4HjF/IMi1lYg+bqBgqdgg9MMKeLr+O5ilTd91sc6+T1ztJyFwDByTjFuR Sa+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from; bh=l9/UApjILkR2r80Ep5iJk5tTbDXtt2K/KfTJJfaZBzI=; b=grJ8z0y0+Pisc98HP/ppKdsp0vFMGpVK0Puhfqi3QSAehkD3mZAIoRYe2eQTo54RrK Zlrfoo36L38PVL1gz176e5RY/Y0LyUtRldAOwj9mxkBLtUMnHtSBYXz6r25gsDNJhbuL dcYhWHD98lIQxeu4qcR3Dsaj//GJ9Fe3TPfxBB9+h9MFIPP+Y6cMvGgoZNRy7tFFCg+x cLCWn7vHsV3iTsmSWMtZQNxwRIU6D2pyK9KenRi3BGywl3VT3REzpbI34skFhpruCSDd WV9/3P2AmM3e+/xSxsROOKxmaeT3U5rRIblm5cRA+d+yiVMcKf+DFUEycu6TdE3sHL32 syig== 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 z1si10576743pln.21.2019.02.21.05.52.01; Thu, 21 Feb 2019 05:52:16 -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 S1728273AbfBUNvI convert rfc822-to-8bit (ORCPT + 99 others); Thu, 21 Feb 2019 08:51:08 -0500 Received: from ozlabs.org ([203.11.71.1]:43749 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726838AbfBUNvH (ORCPT ); Thu, 21 Feb 2019 08:51:07 -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 (2048 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPSA id 444wqD2k07z9rxp; Fri, 22 Feb 2019 00:51:04 +1100 (AEDT) From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , j.neuschaefer@gmx.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v4 04/16] powerpc/mm/32s: use generic mmu_mapin_ram() for all blocks. In-Reply-To: <790cf44815f8c56b3c600560bad9139f63be9f68.1550692943.git.christophe.leroy@c-s.fr> References: <790cf44815f8c56b3c600560bad9139f63be9f68.1550692943.git.christophe.leroy@c-s.fr> Date: Fri, 22 Feb 2019 00:51:01 +1100 Message-ID: <87o9755jy2.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > 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); This gives me: In file included from ../arch/powerpc/mm/pgtable_32.c:22: ../arch/powerpc/mm/pgtable_32.c: In function ‘mapin_ram’: ../include/linux/kernel.h:846:29: error: comparison of distinct pointer types lacks a cast [-Werror] (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) ^~ ../include/linux/kernel.h:860:4: note: in expansion of macro ‘__typecheck’ (__typecheck(x, y) && __no_side_effects(x, y)) ^~~~~~~~~~~ ../include/linux/kernel.h:870:24: note: in expansion of macro ‘__safe_cmp’ __builtin_choose_expr(__safe_cmp(x, y), \ ^~~~~~~~~~ ../include/linux/kernel.h:879:19: note: in expansion of macro ‘__careful_cmp’ #define min(x, y) __careful_cmp(x, y, <) ^~~~~~~~~~~~~ ../arch/powerpc/mm/pgtable_32.c:261:23: note: in expansion of macro ‘min’ unsigned long top = min(base + reg->size, (unsigned long)total_lowmem); ^~~ cc1: all warnings being treated as errors ../scripts/Makefile.build:276: recipe for target 'arch/powerpc/mm/pgtable_32.o' failed For 44x/bamboo_defconfig. cheers