Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp559110imp; Thu, 21 Feb 2019 06:51:13 -0800 (PST) X-Google-Smtp-Source: AHgI3IaJmpYpSYlaDHhYvUoJfBy+0ukbDIHzaiih3lbycvLKQpeqXiP09pqUANxWKO3cNHFwBzDp X-Received: by 2002:a17:902:7202:: with SMTP id ba2mr42326476plb.147.1550760673092; Thu, 21 Feb 2019 06:51:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550760673; cv=none; d=google.com; s=arc-20160816; b=YGGpTxIU3skJV+dVJyjjH8OV8SBdrGWwlcKy6Nu3fxur3UnVgN2+HE+dczmw5eekbW sUNMYeX7r+qDUE9WlnW7iUMoLLKCCxzE26zXxLhtsvm9uwFqL3gd4dce/KW9jJ3Q+LeL EtOT/s9IenUsj1aQD/+xIC8VUDxik0LKMq4n2GzGwiau1pwZM1g29FU2Gej7iHoMFueK 7yXaOuXmpn4qXvj/bQ1bqLlSEz//D6tvAgdMXM085/RodI7hnRkiXqI4B00DxeBW9jiq 1RP6TnVL7UwAIu3c0nH/xXO33W0PxDzfR747o14wxp1t2Xa+qlrNJ173OxQcgN2h+d2K dgxA== 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=pn0/SLqhms1/sbzFZTsKMRTuMVCMzjeX3lcfk4DurQ4=; b=wFHEHxD9gCSpxgluBdqceyhFWWRXc6urPZ2GlZtAev/fUBsywKMHUg4yg92t+wgmcr 4npo6pQ1rKxmBAMUC9c/wu9xQKO27LLnXKub0XpuMy/cZfC3msm8ak1TacS3ClNoa4zQ tUgPRwCpXM1vJe2TXaV3+tlcpBB2Q2Gmc++yb642BJv3z2gXRsBT63jl1mVT6PckIcnQ /e/Oh3pg3jBwkPIQmIVswR6tWcQnDiv8LAFmbPx9oO2m85K/ba38kXU57sxVSnPY9v0R B3dZN9ONUH7HWN/wlVHOOYXYuJDDfg5B0CTNK6nKA/gEnmrtaJJ0IVnaFrfjCte+qbAC IFVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=JjlmjuQF; 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 ck9si9070006plb.196.2019.02.21.06.50.58; Thu, 21 Feb 2019 06:51:13 -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=JjlmjuQF; 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 S1728656AbfBUOuM (ORCPT + 99 others); Thu, 21 Feb 2019 09:50:12 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:59649 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728017AbfBUOih (ORCPT ); Thu, 21 Feb 2019 09:38:37 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 444xt14pMtz9vJg9; Thu, 21 Feb 2019 15:38:33 +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=JjlmjuQF; 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 uWDZ_7dfgGli; Thu, 21 Feb 2019 15:38:33 +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 444xt13jz3z9vJfc; Thu, 21 Feb 2019 15:38:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1550759913; bh=pn0/SLqhms1/sbzFZTsKMRTuMVCMzjeX3lcfk4DurQ4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=JjlmjuQFNX4+6UZwZwArLER4Dv4USB0Eg3H0CKxuunfoKr9HhxSsqTQhycqukj2Mw 2rNjiF2aHo7Z2XFlReWSBhGSyeVs56k/FbOI2bzhAwznjsCBvgYfPNVoV2zGYL13Ie 524xMXc78bnaLiowaKUACktINY1W4boYPTaf4bbY= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 025228B85F; Thu, 21 Feb 2019 15:38:35 +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 gFzf-YsWEapS; Thu, 21 Feb 2019 15:38:34 +0100 (CET) Received: from PO15451 (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 597778B852; Thu, 21 Feb 2019 15:38:34 +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: <35f7a459-6d90-41d0-6935-55f0ef6f0669@c-s.fr> Date: Thu, 21 Feb 2019 15:38:34 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <87o9755jy2.fsf@concordia.ellerman.id.au> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 21/02/2019 à 14:51, Michael Ellerman a écrit : > 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. > Argh ! I had the same kind of warning this morning with pmac32_defconfig, that's the reason why I added the cast to unsigned long. Christophe