Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp13114763rwl; Wed, 4 Jan 2023 03:53:02 -0800 (PST) X-Google-Smtp-Source: AMrXdXstClovGGrw8vQ8bk5lFowarbop07wPu7xlgL2bQd8FVE+hTI5/3T2NJNc2e2JEEuWkJ868 X-Received: by 2002:a17:902:ce89:b0:192:9845:cb65 with SMTP id f9-20020a170902ce8900b001929845cb65mr33810836plg.15.1672833182296; Wed, 04 Jan 2023 03:53:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672833182; cv=none; d=google.com; s=arc-20160816; b=FK9G2lBTrWpjMelKVdqTSy/zLg8TrrcGQ11kHQVbonU29PHb0Swerlkfbgwli2yyVt SRoxFdQojx3IHEr1l9BNykoxd5xcPUTd4cvGrZc6EXDPJZExQmmUQpCinq+go18aabFf Vr8nlu/vShNK2svEl1S8A67HPD6C4q9hDJC8v5WCb4+7RmvmvdwDdQW/OAaY4NxuPG3X SqOikbitev9M00/5UU+J6aaGgMm4K2qH1MGkBaTEsCaxr2ncM1u/MwBJV3pYhDLaloRe j/7NDvCo1fLWS8T0TO07FiXkYhOIe64L8tMfXZgOAVEo/FppxsoWL1Tal0U3wE6uiL15 xxBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JOn8nACLnp1LC6xHXaGU0TE5Y3vxQZUdrpsaoEEjz2o=; b=u+kGaeZBr6K3N7o1lNy5FUw2yzGc1R3f8tRv1HCn2Ps4EJCUmbaD7BVoHPEBAhWpjq JtwlM+WyfNP2VzRBRGJSKqiZ3HFtHFoSZ4na6d1zpOfkYOPWUoiNFYhte5pvV8KcGoKh jIvwmMvjru0ZvJl7xrtMj2T9nQ+MPKBPRLiTVyjZ2cxQDm/HAObPSa3y49JkvfgEBpPe qclqvyT4zkCRFOsMdUenj8PejE6XtK44H4GSglaB35T8uUG1RDegu6K+58TrVHU9RuuH U6smmoA0zK0vgowidSwX3TvDL8CE8hiasD9u5NZGinRUCJtDnP0IUfeY6Mc/k9m4HBRm wmSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nSfA2ISP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t11-20020a170902bc4b00b0018666611f85si33315457plz.508.2023.01.04.03.52.53; Wed, 04 Jan 2023 03:53:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nSfA2ISP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234216AbjADLhi (ORCPT + 59 others); Wed, 4 Jan 2023 06:37:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229739AbjADLhf (ORCPT ); Wed, 4 Jan 2023 06:37:35 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C4CE1B9ED; Wed, 4 Jan 2023 03:37:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3158CB81629; Wed, 4 Jan 2023 11:37:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3AA1C433EF; Wed, 4 Jan 2023 11:37:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672832250; bh=ifZwfrhIkTGIQJEEvqcP0bIoc8pO2AK8DydzKJqXHo4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nSfA2ISPrHXkRmB4FnqNjYPJVLu7CqJqDLc+3I3BJ12HetiZraycDjom0q0Xt9szC INZUSjxQoYcW5KJDMVxE99EAy16q5fCyYjxxjv8Fq9ZGxbbTerfjOk7FLZ5txZDA/Z xeANQpk7lP+aC2Lw3KmrUChI9zyfSySS4Bh6ZPxT/QwiC+ZQDrV1+MjRnh21kZWogc n/tsMfEoKuqteOM3xQnZdhfcqrK3aU8+84xqomL1bPiZbmUW9sgSqf27CAToNns0u/ bWmxyxX18ZK8u/yZVcuvTWCNGDmRKlSKH4IizVmUUJxUhbWWm5jQWpGM3CrsDddiif OMf1yBaQH/FTw== Date: Wed, 4 Jan 2023 13:37:12 +0200 From: Mike Rapoport To: Yann Sionneau Cc: Will Deacon , "Aneesh Kumar K.V" , Andrew Morton , Nick Piggin , Peter Zijlstra , Paul Walmsley , Palmer Dabbelt , Albert Ou , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, Clement Leger , Guillaume Thouvenin , Jean-Christophe Pince , Jules Maselbas , Julian Vetter , Julien Hascoet , Louis Morhet , Marc =?iso-8859-1?Q?Poulhi=E8s?= , Marius Gligor , Vincent Chardon Subject: Re: [RFC PATCH 11/25] kvx: Add memory management Message-ID: References: <20230103164359.24347-1-ysionneau@kalray.eu> <20230103164359.24347-12-ysionneau@kalray.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230103164359.24347-12-ysionneau@kalray.eu> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 03, 2023 at 05:43:45PM +0100, Yann Sionneau wrote: > Add memory management support for kvx, including: cache and tlb > management, page fault handling, ioremap/mmap and streaming dma support. > > CC: Will Deacon > CC: "Aneesh Kumar K.V" > CC: Andrew Morton > CC: Nick Piggin > CC: Peter Zijlstra > CC: Paul Walmsley > CC: Palmer Dabbelt > CC: Albert Ou > CC: linux-kernel@vger.kernel.org > CC: linux-arch@vger.kernel.org > CC: linux-mm@kvack.org > CC: linux-riscv@lists.infradead.org > Co-developed-by: Clement Leger > Signed-off-by: Clement Leger > Co-developed-by: Guillaume Thouvenin > Signed-off-by: Guillaume Thouvenin > Co-developed-by: Jean-Christophe Pince > Signed-off-by: Jean-Christophe Pince > Co-developed-by: Jules Maselbas > Signed-off-by: Jules Maselbas > Co-developed-by: Julian Vetter > Signed-off-by: Julian Vetter > Co-developed-by: Julien Hascoet > Signed-off-by: Julien Hascoet > Co-developed-by: Louis Morhet > Signed-off-by: Louis Morhet > Co-developed-by: Marc Poulhi?s > Signed-off-by: Marc Poulhi?s > Co-developed-by: Marius Gligor > Signed-off-by: Marius Gligor > Co-developed-by: Vincent Chardon > Signed-off-by: Vincent Chardon > Co-developed-by: Yann Sionneau > Signed-off-by: Yann Sionneau > --- > arch/kvx/include/asm/cache.h | 46 +++ > arch/kvx/include/asm/cacheflush.h | 181 +++++++++ > arch/kvx/include/asm/fixmap.h | 47 +++ > arch/kvx/include/asm/hugetlb.h | 36 ++ > arch/kvx/include/asm/l2_cache.h | 75 ++++ > arch/kvx/include/asm/l2_cache_defs.h | 64 ++++ > arch/kvx/include/asm/mem_map.h | 44 +++ > arch/kvx/include/asm/mmu.h | 296 +++++++++++++++ > arch/kvx/include/asm/mmu_context.h | 156 ++++++++ > arch/kvx/include/asm/mmu_stats.h | 38 ++ > arch/kvx/include/asm/page.h | 187 ++++++++++ > arch/kvx/include/asm/page_size.h | 29 ++ > arch/kvx/include/asm/pgalloc.h | 101 +++++ > arch/kvx/include/asm/pgtable-bits.h | 102 ++++++ > arch/kvx/include/asm/pgtable.h | 451 +++++++++++++++++++++++ > arch/kvx/include/asm/rm_fw.h | 16 + > arch/kvx/include/asm/sparsemem.h | 15 + > arch/kvx/include/asm/symbols.h | 16 + > arch/kvx/include/asm/tlb.h | 24 ++ > arch/kvx/include/asm/tlb_defs.h | 131 +++++++ > arch/kvx/include/asm/tlbflush.h | 58 +++ > arch/kvx/include/asm/vmalloc.h | 10 + > arch/kvx/mm/cacheflush.c | 154 ++++++++ > arch/kvx/mm/dma-mapping.c | 95 +++++ > arch/kvx/mm/extable.c | 24 ++ > arch/kvx/mm/fault.c | 264 ++++++++++++++ > arch/kvx/mm/hugetlbpage.c | 317 ++++++++++++++++ > arch/kvx/mm/init.c | 527 +++++++++++++++++++++++++++ > arch/kvx/mm/kernel_rwx.c | 228 ++++++++++++ > arch/kvx/mm/mmap.c | 31 ++ > arch/kvx/mm/mmu.c | 204 +++++++++++ > arch/kvx/mm/mmu_stats.c | 94 +++++ > arch/kvx/mm/tlb.c | 433 ++++++++++++++++++++++ > 33 files changed, 4494 insertions(+) Please strip functionality that's not essential for boot and the re-add it after the very core code is merged. I'd say multiple page size, hugetlb and strict RWX are not necessary to start with. I'd also suggest to have separate patches for different parts, like cache and tlb management, page tables and page fault fault handling, ioremap/mmap and streaming dma support. -- Sincerely yours, Mike.