Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2558647ybe; Thu, 12 Sep 2019 11:14:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqzclnhaUGXof4t9AWlSU1Q1t6DbjAzo85rwa0P5KvTYswRNwVOYyoxty1z1CB16ET0XYmDf X-Received: by 2002:a50:ed1a:: with SMTP id j26mr32082191eds.138.1568312088398; Thu, 12 Sep 2019 11:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568312088; cv=none; d=google.com; s=arc-20160816; b=wOwktxbT6BZ1ciRHYDrJTpmmkE1acsir7SxNZdNbIvUhnOsCoGPuYQzB3IQfyeIoti vb5JfwXZlE8zi7S5828ql356T35lktjUJzwIjI279oMXEHMLXLcQhV1HwK8CCPLpnZwS JOQcobAleD4lt7C+eZVlwBF6RyqiSAjvj9QuTA+pwQP88CYWP/hcr5FDPtqTQYkGY10L xM6jy1ANVBCY8/dIxszk5OSQwwAocA4xQy+slx1mjWTeJYy7xdSmDBqB4xMLSm9iHt2V +t2WHJuSSKxVUWZ879cVFzgzEXIlKcQofjYiLerfnIdx1etYt6CMZ0MfRIEtwUkNkV2X JeMg== 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=jwkiVsyu4qTpGbjgj9zvg2L17cG+LcedXjD4KVOR3aw=; b=zIcDhTK31xx+ImZM07UiXoJlggBv6AUXErpIQYxqAQNPERUhxNRdPRZCh3VeboapIn uoPGPve+26LpaA3kXP9USfKPLNc6lxwmHFImC0Hh/KN6mC3g6cckaj4fwVj6T+BSC3xk e49WmwLMMh9Vnr3rq+4sVY+Yh+le2RzPa14ah0OzbZiu0IUoScqltsR3p8jFbROAaTAr BAc3oEBm9U/z8keYlnSjX9is9zh7KCWMACZDwegv7ca5a6TRJOObmgxIKp7bx9oyW1U7 tePl61WgfUDe+js9sFGEFEJi8c2Q1fhmC+ggjhs0Aw09s5zUKzOIkcZD182YFa+2iJI2 PxLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=ncacx61M; 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 f17si17981589eda.232.2019.09.12.11.14.23; Thu, 12 Sep 2019 11:14:48 -0700 (PDT) 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=ncacx61M; 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 S1732939AbfILPnJ (ORCPT + 99 others); Thu, 12 Sep 2019 11:43:09 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:41770 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732723AbfILPnI (ORCPT ); Thu, 12 Sep 2019 11:43:08 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 46Tjhm75TvzB09bB; Thu, 12 Sep 2019 17:43:04 +0200 (CEST) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=ncacx61M; 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 EHJt8SoSX6rY; Thu, 12 Sep 2019 17:43:04 +0200 (CEST) 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 46Tjhm5y7RzB09b0; Thu, 12 Sep 2019 17:43:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1568302984; bh=jwkiVsyu4qTpGbjgj9zvg2L17cG+LcedXjD4KVOR3aw=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=ncacx61MTw9l0fH/aIN33QEKzpSS37GIo1Lm+DGhNEzBVZV+7lFzpZzU+VCDpQl/A WOqGmEfhk+9ei5DYC46N5dLAhENVhnQ3UIcz+0p1JwxO3/OPWizlfaNThFFGeAlizK 0uFIyrZiBjrpSM2th7RKnmV5luDabUtVWeKDSZC8= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 701D58B941; Thu, 12 Sep 2019 17:43:06 +0200 (CEST) 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 Cg95q0QX3o1e; Thu, 12 Sep 2019 17:43:06 +0200 (CEST) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 730808B933; Thu, 12 Sep 2019 17:43:05 +0200 (CEST) Subject: Re: [PATCH v1 3/4] powerpc: Add support for GENERIC_EARLY_IOREMAP To: "Aneesh Kumar K.V" , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , npiggin@gmail.com, hch@infradead.org Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <412c7eaa6a373d8f82a3c3ee01e6a65a1a6589de.1568295907.git.christophe.leroy@c-s.fr> <87ftl1seyr.fsf@linux.ibm.com> From: Christophe Leroy Message-ID: Date: Thu, 12 Sep 2019 17:43:05 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <87ftl1seyr.fsf@linux.ibm.com> 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 12/09/2019 à 17:37, Aneesh Kumar K.V a écrit : > Christophe Leroy writes: > >> Add support for GENERIC_EARLY_IOREMAP. >> >> Let's define 16 slots of 256Kbytes each for early ioremap. >> >> Signed-off-by: Christophe Leroy >> --- >> arch/powerpc/Kconfig | 1 + >> arch/powerpc/include/asm/Kbuild | 1 + >> arch/powerpc/include/asm/fixmap.h | 12 ++++++++++++ >> arch/powerpc/kernel/setup_32.c | 3 +++ >> arch/powerpc/kernel/setup_64.c | 3 +++ >> 5 files changed, 20 insertions(+) >> >> diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig >> index 6a7c797fa9d2..8fe252962518 100644 >> --- a/arch/powerpc/Kconfig >> +++ b/arch/powerpc/Kconfig >> @@ -161,6 +161,7 @@ config PPC >> select GENERIC_CMOS_UPDATE >> select GENERIC_CPU_AUTOPROBE >> select GENERIC_CPU_VULNERABILITIES if PPC_BARRIER_NOSPEC >> + select GENERIC_EARLY_IOREMAP >> select GENERIC_IRQ_SHOW >> select GENERIC_IRQ_SHOW_LEVEL >> select GENERIC_PCI_IOMAP if PCI >> diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild >> index 9a1d2fc6ceb7..30829120659c 100644 >> --- a/arch/powerpc/include/asm/Kbuild >> +++ b/arch/powerpc/include/asm/Kbuild >> @@ -12,3 +12,4 @@ generic-y += preempt.h >> generic-y += vtime.h >> generic-y += msi.h >> generic-y += simd.h >> +generic-y += early_ioremap.h >> diff --git a/arch/powerpc/include/asm/fixmap.h b/arch/powerpc/include/asm/fixmap.h >> index 722289a1d000..d5c4d357bd33 100644 >> --- a/arch/powerpc/include/asm/fixmap.h >> +++ b/arch/powerpc/include/asm/fixmap.h >> @@ -15,6 +15,7 @@ >> #define _ASM_FIXMAP_H >> >> #ifndef __ASSEMBLY__ >> +#include >> #include >> #include >> #ifdef CONFIG_HIGHMEM >> @@ -64,6 +65,14 @@ enum fixed_addresses { >> FIX_IMMR_SIZE, >> #endif >> /* FIX_PCIE_MCFG, */ >> + __end_of_permanent_fixed_addresses, >> + >> +#define NR_FIX_BTMAPS (SZ_256K / PAGE_SIZE) >> +#define FIX_BTMAPS_SLOTS 16 >> +#define TOTAL_FIX_BTMAPS (NR_FIX_BTMAPS * FIX_BTMAPS_SLOTS) >> + >> + FIX_BTMAP_END = __end_of_permanent_fixed_addresses, >> + FIX_BTMAP_BEGIN = FIX_BTMAP_END + TOTAL_FIX_BTMAPS - 1, >> __end_of_fixed_addresses >> }; >> >> @@ -71,6 +80,7 @@ enum fixed_addresses { >> #define FIXADDR_START (FIXADDR_TOP - __FIXADDR_SIZE) >> >> #define FIXMAP_PAGE_NOCACHE PAGE_KERNEL_NCG >> +#define FIXMAP_PAGE_IO PAGE_KERNEL_NCG >> >> #include >> >> @@ -85,5 +95,7 @@ static inline void __set_fixmap(enum fixed_addresses idx, >> map_kernel_page(__fix_to_virt(idx), phys, flags); >> } >> >> +#define __early_set_fixmap __set_fixmap >> + >> #endif /* !__ASSEMBLY__ */ >> #endif >> diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c >> index a7541edf0cdb..dcffe927f5b9 100644 >> --- a/arch/powerpc/kernel/setup_32.c >> +++ b/arch/powerpc/kernel/setup_32.c >> @@ -44,6 +44,7 @@ >> #include >> #include >> #include >> +#include >> >> #include "setup.h" >> >> @@ -80,6 +81,8 @@ notrace void __init machine_init(u64 dt_ptr) >> /* Configure static keys first, now that we're relocated. */ >> setup_feature_keys(); >> >> + early_ioremap_setup(); >> + >> /* Enable early debugging if any specified (see udbg.h) */ >> udbg_early_init(); >> >> diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c >> index 44b4c432a273..b85f6a1cc3a1 100644 >> --- a/arch/powerpc/kernel/setup_64.c >> +++ b/arch/powerpc/kernel/setup_64.c >> @@ -65,6 +65,7 @@ >> #include >> #include >> #include >> +#include >> >> #include "setup.h" >> >> @@ -338,6 +339,8 @@ void __init early_setup(unsigned long dt_ptr) >> apply_feature_fixups(); >> setup_feature_keys(); >> >> + early_ioremap_setup(); >> + >> /* Initialize the hash table or TLB handling */ >> early_init_mmu(); >> > > Can we remove early_ioremap_range() after this? > Yes, once all early callers of ioremap functions are converted to using early_ioremap() Christophe