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 16B8BC433B4 for ; Thu, 1 Apr 2021 15:56:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9C1C261221 for ; Thu, 1 Apr 2021 15:56:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9C1C261221 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 178E56B0070; Thu, 1 Apr 2021 11:56:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 129546B0072; Thu, 1 Apr 2021 11:56:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0B5D6B0073; Thu, 1 Apr 2021 11:56:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id D0D396B0070 for ; Thu, 1 Apr 2021 11:56:37 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 91B4D183432B6 for ; Thu, 1 Apr 2021 15:56:37 +0000 (UTC) X-FDA: 77984250834.32.1CAC79C Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by imf01.hostedemail.com (Postfix) with ESMTP id B3BBF5001528 for ; Thu, 1 Apr 2021 15:56:36 +0000 (UTC) Received: by mail-pl1-f180.google.com with SMTP id l1so1218717plg.12 for ; Thu, 01 Apr 2021 08:56:37 -0700 (PDT) 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=ARw0QC1DRpSfmCGciM85XQtdkHCtL0OandbCXdTGDEw=; b=bUBDH0Xui+tfGI6ln50Z9dD1JyoQlWfuTTY361PHS22ZSq0GuufcUdsPswGHSAt56K HjjseCcRSpKHcrKlDpaIhvCudqSV5l4a1N8tNjt711U9u3glVDDaHbgdJ0M0STdsVMio VZs2lzdVUscUyS1z172X3ojPbE3Varq47plXsH7KeTKWIky3Feo1ULW/i3eVJbgxPgME S19CdM0KMZ8RScfO29ZkNSTRBxZZ78PigfNPp60MwuHG+xeriT7l7SZplmXZMwboytcw vLSJubwYXZkL5c6FeJIP4o0ughPkRsZ7FvYAVSSIKWbiLgsvCfWqeBZqxuTyn8s6mkVZ wjkQ== 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=ARw0QC1DRpSfmCGciM85XQtdkHCtL0OandbCXdTGDEw=; b=RvUCdAJGs8AcMvdFGgPR9WN6sXSJqUbM+yizSzv457nxUU3P3XjTKM8/3QZ+r2dO3w xrcN21eB7qPv3UDQ+Ap7SvLzV7OEaqqsP5YQEpGsY8nelmklHd6+XCGSiBQ5r9qyDI8P CzxOLpiMpDrG3Km+/syM7lk/zVNs95BBPZCTHoXHYyojiQ/lV0ikTg70jRaoLBPGspgQ bTeM/mLaremIQegrShF4jxWPAZy9U+Mdjtj4v/s1x5+797bwtn8RXlFS4u+4c3aLtSWY BKkdQKYLCBrHi95QMlHvKeT6SvpOu66hiBtp2X38+LLi9FN+8VQC8hmOpKoyIAE/XN8l 2U4A== X-Gm-Message-State: AOAM5335ZJ56P1EILLBzyxS+I0L8/rCAAf8eAV277DU1lGRYhTpAI+ns S4ZGCbC4HjJBJz1THAIeEgI= X-Google-Smtp-Source: ABdhPJxcBt+DP6uy6PG9M+XwqvLLJvHVOD4lvlpXsCHL90YbPs1xS+KaPKB74oAqLBmvRjY+8PRXNg== X-Received: by 2002:a17:902:b494:b029:e7:36be:9ce7 with SMTP id y20-20020a170902b494b02900e736be9ce7mr8526692plr.43.1617292596071; Thu, 01 Apr 2021 08:56:36 -0700 (PDT) Received: from localhost ([1.128.221.53]) by smtp.gmail.com with ESMTPSA id p1sm5695507pfn.22.2021.04.01.08.56.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 08:56:35 -0700 (PDT) Date: Fri, 02 Apr 2021 01:56:30 +1000 From: Nicholas Piggin Subject: Re: [PATCH v2 1/5] mm/vmalloc: remove map_kernel_range To: Andrew Morton , linux-mm@kvack.org Cc: Christoph Hellwig References: <20210322021806.892164-1-npiggin@gmail.com> <20210322021806.892164-2-npiggin@gmail.com> In-Reply-To: <20210322021806.892164-2-npiggin@gmail.com> MIME-Version: 1.0 Message-Id: <1617292497.o1uhq5ipxp.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B3BBF5001528 X-Stat-Signature: kstm6kspp9cguwaybys38a73n859obsc Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf01; identity=mailfrom; envelope-from=""; helo=mail-pl1-f180.google.com; client-ip=209.85.214.180 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617292596-428442 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 Nicholas Piggin's message of March 22, 2021 12:18 pm: > This is a shim around vmap_pages_range, get rid of it. >=20 > Move the main API comment from the _noflush variant to the normal > variant, and make _noflush internal to mm/. >=20 This requires a fix for nommu builds. --- Fix "mm/vmalloc: remove map_kernel_range" Fixes: "percpu.c:undefined reference to `vmap_pages_range_noflush'" on riscv nommu builds. Previous code had a strange NOMMU implementation of map_kernel_range_noflush that came in with commit b554cb426a955 ("NOMMU: support SMP dynamic percpu_alloc") which would return success if the size was <=3D PAGE_SIZE, but that has no way of working on NOMMU because the page can not be mapped to the new start address even if there is only one of them. So change this code to always return failure. NOMMU probably needs to take a closer look at what it does with percpu-vm.c and carve out a special case there if necessary rather than pretend vmap works. Signed-off-by: Nicholas Piggin --- mm/internal.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mm/internal.h b/mm/internal.h index 6d3fd85ab866..ac5d1abfb739 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -621,7 +621,16 @@ struct migration_target_control { /* * mm/vmalloc.c */ +#ifdef CONFIG_MMU int vmap_pages_range_noflush(unsigned long addr, unsigned long end, pgprot_t prot, struct page **pages, unsigned int page_shif= t); +#else +static inline +int vmap_pages_range_noflush(unsigned long addr, unsigned long end, + pgprot_t prot, struct page **pages, unsigned int page_shif= t) +{ + return -EINVAL; +} +#endif =20 #endif /* __MM_INTERNAL_H */ --=20 2.23.0