Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp782894imp; Thu, 21 Feb 2019 11:05:24 -0800 (PST) X-Google-Smtp-Source: AHgI3IbUYyI5Ec30xs9qYr4bIRj+FxNUxmwI2sdnlwOgzVV6D2w/e7vwicpGfT7R4qI6wwf6XzvV X-Received: by 2002:a17:902:6508:: with SMTP id b8mr46054plk.17.1550775924690; Thu, 21 Feb 2019 11:05:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550775924; cv=none; d=google.com; s=arc-20160816; b=ch0Rx/hGHJeLp1iY6/gDJK1wlamttaZ3ye9YHUchioq8G7xo+/jPLNOUeeYTwa70vw u1M4w+MUxZaffxy+3QyzQUYYvnXdyxsjK69P8/mpIY79QkzjfQJwP6VFcFodCazeF1EA lUKXQ0y4KCz2IGXpIcZMwha1N36zTzgyoKdzSsCYkjvhGpjzDbewFy3mDRdRo3Z/Wxv2 RkATG60+RgD1YvhGH05RuS+YZPgXWtZ9/IQcHNrrrKHCn+qmeLISpRnQ+SoxDduggE+q nk/iq+XnzCuV6cgXqd9Y1e3NXAfw5N+Q5A6S/ZEwX0lb6Pog62bmGGsLPVhBUOG3V3WP F9dw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=P13Pznnz4SECXyfoPjqca8tjebP4ZlSv0SzbWcDRTVk=; b=toWUMjjnzxoHo3HYkekTEEtSUJcMnfrMnWd+sommyUj4KdwKsKflG3bV8sCr2HmCoG e9qig42g2Tcvl/R1PbRA+09iDvMJv/vMQPZBPlxr9RIinK1BR5UIpBE8ePsldOvWeRHK YaeoURNKFMnTmNddK9gBArETS/mTwf6UV8gjJeqoO3ASzROPYiDgYr33r1gDSdNG4gjG CyDX+snmr4mqMUZUhexWjQyEDya6Nfl+kaH8Ozyc4FsE6Xxq4Hqid5GKko7xP2CCrQjw WthQ1lmY5qio1MNFdQqQ5k9TC57r768KqTTjD2ayQ8OC5U6VsWOin+SspKta/Qyq/0/L w/lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=dXD1Lqdw; 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 j7si23136594plb.349.2019.02.21.11.05.08; Thu, 21 Feb 2019 11:05:24 -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=dXD1Lqdw; 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 S1728181AbfBUTDK (ORCPT + 99 others); Thu, 21 Feb 2019 14:03:10 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:64840 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726146AbfBUTDJ (ORCPT ); Thu, 21 Feb 2019 14:03:09 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4453lG6GJgz9v6l1; Thu, 21 Feb 2019 20:03:06 +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=dXD1Lqdw; 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 R0oiRFtOu_Fj; Thu, 21 Feb 2019 20:03:06 +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 4453lG580kz9v6jt; Thu, 21 Feb 2019 20:03:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550775786; bh=P13Pznnz4SECXyfoPjqca8tjebP4ZlSv0SzbWcDRTVk=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=dXD1LqdwY57zZhL7oa22tjup8tSeFy0DzwpyoFVou209BjblZGYwPabS2oYrsNtok +FuA1yWU/IWuLbKhV/ZHfTFODMunkGpC32WKWY6jSG0gefaRkyciILTag40AnsGcLF 8v/YDUAfVHFeIo1XnrkxUnO1liltCwqC+CLPFEiE= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 144E28B88A; Thu, 21 Feb 2019 20:03:06 +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 BaHTZHGCZYIT; Thu, 21 Feb 2019 20:03:05 +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 B9FB18B86D; Thu, 21 Feb 2019 20:02:47 +0100 (CET) Subject: Re: [PATCH v4 04/16] powerpc/mm/32s: use generic mmu_mapin_ram() for all blocks. To: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , j.neuschaefer@gmx.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <790cf44815f8c56b3c600560bad9139f63be9f68.1550692943.git.christophe.leroy@c-s.fr> <87o9755jy2.fsf@concordia.ellerman.id.au> From: Christophe Leroy Message-ID: <719e3340-dd91-9504-d39c-4257e1bf0282@c-s.fr> Date: Thu, 21 Feb 2019 19:02:45 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <87o9755jy2.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2019 01:51 PM, Michael Ellerman wrote: > 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. > The patch below should make it. Tested it on half a dozen of config. diff --git a/arch/powerpc/mm/pgtable_32.c b/arch/powerpc/mm/pgtable_32.c index 2bf9bf8867d4..c4b0eb51f6d8 100644 --- a/arch/powerpc/mm/pgtable_32.c +++ b/arch/powerpc/mm/pgtable_32.c @@ -257,8 +257,8 @@ void __init mapin_ram(void) 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); + phys_addr_t base = reg->base; + phys_addr_t top = min(base + reg->size, total_lowmem); if (base >= top) continue; I'll send out v5, hope it'll be the last one :( Christophe