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=-10.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,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 8D71BC433E6 for ; Sun, 24 Jan 2021 07:45:49 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 396ED22CB3 for ; Sun, 24 Jan 2021 07:45:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 396ED22CB3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:MIME-Version:In-Reply-To:References:To: Subject:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WCHdXC00U0omeVtfeysuHtHFgjFXab5DdFLNaoJqZHM=; b=kRQwdqxh6tXCKQlr8R+o7pSQ2 1uuQ7AYQGCQx3r6RCnxcBhGvWv8evRepB4ncxNHJOkmeKkGl9z2JxgvXnW6TBdcjmZ4HZJdV4Hmas 02Zt7VtvNO3SAuc7BCHjrLqWaVuHrRRcmxG7KR2IdquKtUqPjYxKHq//Of20zM5jJDw6nMHEgTCOL fVYu7X5EMR0vYI3EzI1xrtbeeH4wxWu9cVMsKcTvvGtCe0OUeiUGVHxSQVP+P0HBf4NiBzFZrXWui UWzqrWGubEKiibd8Pu1XVode1gxb64jZCWveN2/M7m7gympw9idti5ydXyY3csY53KvKEYEQ82wlm YZh/AYJWQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3a3z-0001CC-Nh; Sun, 24 Jan 2021 07:43:59 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l3a3x-0001Ao-9F for linux-arm-kernel@lists.infradead.org; Sun, 24 Jan 2021 07:43:58 +0000 Received: by mail-pl1-x630.google.com with SMTP id b8so5739759plx.0 for ; Sat, 23 Jan 2021 23:43:51 -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=WXmbWMBdUHMNCJ+RoQG0DUP6pN3uyenluoQNowJl7bMiROEu3+VpJ/ECJUrz2CbDTn 7CxEJL/3dik+9+Z+z2Rz0Lc6jsd0Uck/FENu0dwydlksqQexuYJdVG09h87Yj2b0TBBc q8/Rrkpvlv6YDQU1JB3JiG/uqR2pNjFwPEydrfA5rgxzVybnWN2KnO3bRtWZaJUWTZbN HIJLNU0tUdX25iX/LLfkuwQ5V4WE0125GW0n1/ncT2kE0+ijOWRorOj/bw7xRhzZVcOg GF4mnwQRTMC+XVm6HbewTX1LE7olDCyEyXFs2+vfZhj/TN5I9UIJ3htzhUQhGqDWFvU7 y91g== X-Gm-Message-State: AOAM532uRErRCd01iQ+Hb4ZEoV4sR8X9+J7MpKSwXlEUgfVkk6Qb/XHJ Yjby9kKsGT0GD+nIKRAEV6s= 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210124_024357_333221_2ECEC5E2 X-CRM114-Status: GOOD ( 19.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, x86@kernel.org, Will Deacon , Catalin Marinas , "H. Peter Anvin" , linux-kernel@vger.kernel.org, Christophe Leroy , Christoph Hellwig , Zefan Li , Borislav Petkov , =?iso-8859-1?q?Jonathan=0A?= Cameron , Thomas Gleixner , =?iso-8859-1?q?Rick=0A?= Edgecombe , linuxppc-dev@lists.ozlabs.org, Ingo Molnar , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. >> >> This removes code and indirection, and allows constant-folding of dead >> code for unsupported levels. >> >> 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). >> >> 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(-) >> >> diff --git a/arch/arm64/include/asm/vmalloc.h b/arch/arm64/include/asm/vmalloc.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 >> >> +#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_phys, int *size, pgprot_t prot) >> return dt_virt; >> } >> >> -int __init arch_ioremap_p4d_supported(void) >> +bool arch_vmap_p4d_supported(pgprot_t prot) >> { >> - return 0; >> + return false; >> } >> > > I think you should put this function in the CONFIG_HAVE_ARCH_HUGE_VMAP, otherwise it may break the compile when disable the CONFIG_HAVE_ARCH_HUGE_VMAP, the same > as the x86 and ppc. Ah, good catch. arm64 is okay because it always selects 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel