From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4D44FC433DB for ; Sun, 24 Jan 2021 07:43:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C519922CB3 for ; Sun, 24 Jan 2021 07:43:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C519922CB3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E3C356B000A; Sun, 24 Jan 2021 02:43:51 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DEE0C6B000C; Sun, 24 Jan 2021 02:43:51 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C8E3B6B000D; Sun, 24 Jan 2021 02:43:51 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0035.hostedemail.com [216.40.44.35]) by kanga.kvack.org (Postfix) with ESMTP id B47666B000A for ; Sun, 24 Jan 2021 02:43:51 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 75CEE364E for ; Sun, 24 Jan 2021 07:43:51 +0000 (UTC) X-FDA: 77739879462.01.brass64_4b0e2022757b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin01.hostedemail.com (Postfix) with ESMTP id 53D2510046D42 for ; Sun, 24 Jan 2021 07:43:51 +0000 (UTC) X-HE-Tag: brass64_4b0e2022757b X-Filterd-Recvd-Size: 6890 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by imf32.hostedemail.com (Postfix) with ESMTP for ; Sun, 24 Jan 2021 07:43:50 +0000 (UTC) Received: by mail-pj1-f49.google.com with SMTP id lw17so7962392pjb.0 for ; Sat, 23 Jan 2021 23:43:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=+/6kKIloWjHkv6epE2TcP1cNMAlAxbqvJ/hMS+1BVS4=; b=ECst8pGK76Kt1i3hYRpk0C6YXFoVILwmhhITV8vLf7lxSp2DLkJIQbiJRMgNAQ8RhZ 2FVBi6yU5cpVn2+k1ymdhPEiD0mTUZewRMTA/C2lx5qVisItC7g1Qk4OGg76U8ceJGgf oVWl3fnrKEggNSaXGGGHmXoOoXhZnwiVh1RBJL+lYFEHkFwpvlYF/ZZKyKChrGABAFdp R/fMbwbCbc15w5wSt5bs8uhzzHSiG/b/UpPKVMdktKCdkIGIrgNk1sVD54D/UhBtSvjQ s/HrxyZxn4pyAnjsJNo50WHO0keUtTPyw5qR6gy6UgFyMCLXWft4SR0fRSKV2J1bQRZG TWVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=+/6kKIloWjHkv6epE2TcP1cNMAlAxbqvJ/hMS+1BVS4=; b=ALm6DJt/az79MqB5uT4DqGPvhvkUrQ/wVlrP/EDbxEtVTI5ezKXNZk1kjdP8YPtt1b FEoYa73wt3HiCteelN3M/ZjEYSkOg3bbZ5XMUbQ8tA1fp/+FOnVjt+HCmQDWsHdYAKDb 8y0u8WSt9kJ3CZyiPDqPRAk8WP70h+inqYFUtI3gMFr4HxvT8A4jqEjh51bs44jECUzY PvMdlCCrzNx49x3X8EiiMoNbzOjuq+fxlrsVPAdSlyVQ+drWMF4AmnVGl7eFdU8wVEnI BDi8O5Z5AdubF1bUUr3wKdJvOyUR7Z0rqxT7549z9lZ2thBxzQCXMWRSF9wEc/4FMs7K 3dGg== X-Gm-Message-State: AOAM532sWhRxJApKd9gaeMl0ce9HPl266OLgFp2ElsrQT0SEvRYhOB/e mPAV1lJY+1zk8OrSg3JnGgs= X-Google-Smtp-Source: ABdhPJzN8ma2KWKosLen5J4F3FRMoKuPNeofyB7rb0dBGiGJZybg1BFnjDhMrrGiBy+u68O8a9eDMw== X-Received: by 2002:a17:90a:de97:: with SMTP id n23mr6422067pjv.216.1611474229873; Sat, 23 Jan 2021 23:43:49 -0800 (PST) Received: from localhost ([124.170.13.62]) by smtp.gmail.com with ESMTPSA id b17sm12014448pfp.167.2021.01.23.23.43.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Jan 2021 23:43:49 -0800 (PST) Date: Sun, 24 Jan 2021 17:43:43 +1000 From: Nicholas Piggin Subject: Re: [PATCH v9 05/12] mm: HUGE_VMAP arch support cleanup To: Andrew Morton , Ding Tianhong , linux-mm@kvack.org Cc: Borislav Petkov , Catalin Marinas , Christophe Leroy , Christoph Hellwig , "H. Peter Anvin" , =?iso-8859-1?q?Jonathan=0A?= Cameron , linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Zefan Li , Ingo Molnar , =?iso-8859-1?q?Rick=0A?= Edgecombe , Thomas Gleixner , Will Deacon , x86@kernel.org References: <20201205065725.1286370-1-npiggin@gmail.com> <20201205065725.1286370-6-npiggin@gmail.com> In-Reply-To: MIME-Version: 1.0 Message-Id: <1611473993.etnqidihnt.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Excerpts from Ding Tianhong's message of January 4, 2021 10:33 pm: > On 2020/12/5 14:57, Nicholas Piggin wrote: >> This changes the awkward approach where architectures provide init >> functions to determine which levels they can provide large mappings for, >> to one where the arch is queried for each call. >>=20 >> This removes code and indirection, and allows constant-folding of dead >> code for unsupported levels. >>=20 >> This also adds a prot argument to the arch query. This is unused >> currently but could help with some architectures (e.g., some powerpc >> processors can't map uncacheable memory with large pages). >>=20 >> Cc: linuxppc-dev@lists.ozlabs.org >> Cc: Catalin Marinas >> Cc: Will Deacon >> Cc: linux-arm-kernel@lists.infradead.org >> Cc: Thomas Gleixner >> Cc: Ingo Molnar >> Cc: Borislav Petkov >> Cc: x86@kernel.org >> Cc: "H. Peter Anvin" >> Acked-by: Catalin Marinas [arm64] >> Signed-off-by: Nicholas Piggin >> --- >> arch/arm64/include/asm/vmalloc.h | 8 +++ >> arch/arm64/mm/mmu.c | 10 +-- >> arch/powerpc/include/asm/vmalloc.h | 8 +++ >> arch/powerpc/mm/book3s64/radix_pgtable.c | 8 +-- >> arch/x86/include/asm/vmalloc.h | 7 ++ >> arch/x86/mm/ioremap.c | 10 +-- >> include/linux/io.h | 9 --- >> include/linux/vmalloc.h | 6 ++ >> init/main.c | 1 - >> mm/ioremap.c | 88 +++++++++--------------- >> 10 files changed, 77 insertions(+), 78 deletions(-) >>=20 >> diff --git a/arch/arm64/include/asm/vmalloc.h b/arch/arm64/include/asm/v= malloc.h >> index 2ca708ab9b20..597b40405319 100644 >> --- a/arch/arm64/include/asm/vmalloc.h >> +++ b/arch/arm64/include/asm/vmalloc.h >> @@ -1,4 +1,12 @@ >> #ifndef _ASM_ARM64_VMALLOC_H >> #define _ASM_ARM64_VMALLOC_H >> =20 >> +#include >> + >> +#ifdef CONFIG_HAVE_ARCH_HUGE_VMAP >> +bool arch_vmap_p4d_supported(pgprot_t prot); >> +bool arch_vmap_pud_supported(pgprot_t prot); >> +bool arch_vmap_pmd_supported(pgprot_t prot); >> +#endif >> + >> #endif /* _ASM_ARM64_VMALLOC_H */ >> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c >> index ca692a815731..1b60079c1cef 100644 >> --- a/arch/arm64/mm/mmu.c >> +++ b/arch/arm64/mm/mmu.c >> @@ -1315,12 +1315,12 @@ void *__init fixmap_remap_fdt(phys_addr_t dt_phy= s, int *size, pgprot_t prot) >> return dt_virt; >> } >> =20 >> -int __init arch_ioremap_p4d_supported(void) >> +bool arch_vmap_p4d_supported(pgprot_t prot) >> { >> - return 0; >> + return false; >> } >> =20 >=20 > I think you should put this function in the CONFIG_HAVE_ARCH_HUGE_VMAP, o= therwise it may break the compile when disable the CONFIG_HAVE_ARCH_HUGE_VM= AP, the same > as the x86 and ppc. Ah, good catch. arm64 is okay because it always selects=20 HAVE_ARCH_HUGE_VMAP, powerpc is okay because it places them in a file that's only compiled for configs that select huge vmap, but x86-32 without PAE build breaks. I'll fix that. Thanks, Nick