Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1569308pxa; Thu, 20 Aug 2020 14:58:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGhsFYsB8QokF9qSaB1IcpVJqT1u9D51hYkKv3DqIy+9eae7TYGaBKIyns426jfy33d4xJ X-Received: by 2002:a05:6402:c0a:: with SMTP id co10mr661144edb.342.1597960714572; Thu, 20 Aug 2020 14:58:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597960714; cv=none; d=google.com; s=arc-20160816; b=pGP37foUH4z+DCLe0pe9Wy1WNDwIGwPtd+kj2SiINiJfoMFOPV4/GFXqWDvshwwmWv DzNCsWKzP02e1vsUYSuvhFi52aF5y/QUfaR/DMwqYAJ0V3IVpe7xc02qy7+Gu9ViPpOS iVM9agJCrQgQUwLobnUgiPLC+8WMSn9q1+6dnnXPvCdwj21rexGss+piU5EBgOLZauNE 2QyZMFdT7QiDdeKPZ68UMBd82fe2Kf9QJLNKGIkxli49Cgfk8C1ZmOzei+o7D0vqp5Pe IngxGcroBalLbNRyyJBQZ469JaSYplBsp4VWPAgT2Lj5MXhGr0VCkxJURMcgKeguM6GJ Kg1g== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ybzMQwKVso894VWwGnhBz4zUW+KLRn7imSEkDylS9HU=; b=gqs3lQoVPQJT3587F+4kWD9nhB+ppEk91tOHpQ/lUZG4s6Ccp5HcsJMdtwYz6/0Dmw Sokb26ej3Ho3aSkZ2rtMt5UST2DTN7zYAnK/gf+MTDn/Djo6Woo4NRP7N+t2KoW9Pbjo qa8jFqIQ8QuhwnCZF/i48Yc8RzsQUu9aiaGAEmPvzJjHgmkiqJdgXGgRKAF4J4jjYzZC DkHKISfna6Anz/lGuluA2To5Kk7fa1eL2fBEkEwsDwpDpZBJLr3MsZlQ8RML0XwtoXEy G/QXvsVAVhIxSOvqSIhJqkn8BQSpNCYNiHBaWZk43T/jM/dxExVC3lOQEFTS/lHGaTXp lHag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KtEB4K2M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b1si2161348ejb.739.2020.08.20.14.58.10; Thu, 20 Aug 2020 14:58:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KtEB4K2M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728561AbgHTUzU (ORCPT + 99 others); Thu, 20 Aug 2020 16:55:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:33972 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725820AbgHTUzS (ORCPT ); Thu, 20 Aug 2020 16:55:18 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E89BB20885; Thu, 20 Aug 2020 20:55:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597956916; bh=0sC4plwLSrHCEwGCAy2r05gwxbQdkP/sGe8Xwz3RSX0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=KtEB4K2Mxe1YWeBfBpp3kbuupp93sDeZqu4W10cnBxvmYNgrjShbUr0OMMtAIQjP7 lZBfhetsS8S/oetCoDroqLe+PjwWsWeZOh8x/xndisyuxV+YdpX5yd8s5j18W1ef/F azzTZZq2iebAalbcSX7ngCZBAPabFw5wZG5hOMaI= Date: Thu, 20 Aug 2020 13:55:15 -0700 From: Andrew Morton To: Naresh Kamboju Cc: Linux-Next Mailing List , open list , linux-mm , lkft-triage@lists.linaro.org, linuxarm@huawei.com, Barry Song , John Hubbard , Jan Kara , =?UTF-8?B?SsOpcsO0bWU=?= Glisse , "Matthew Wilcox (Oracle)" , Al Viro , Christoph Hellwig , Dan Williams , Dave Chinner , Jason Gunthorpe , Jonathan Corbet , Michal Hocko , Mike Kravetz , Shuah Khan , Vlastimil Babka Subject: Re: mm/gup.c:1922:7: error: implicit declaration of function =?UTF-8?B?4oCYaXNfdmFsaWRfZ3VwX2ZsYWdz4oCZ?= Message-Id: <20200820135515.c36b35449143c723f0800f5b@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 20 Aug 2020 14:59:52 +0530 Naresh Kamboju wrote: > arm and riscv architecture build failed on linux next 20200820 tag. > > make -sk KBUILD_BUILD_USER=TuxBuild -C/linux -j16 ARCH=arm > CROSS_COMPILE=arm-linux-gnueabihf- HOSTCC=gcc CC="sccache > arm-linux-gnueabihf-gcc" O=build zImage > > 348# > 349../mm/gup.c: In function ‘get_user_pages’: > 350../mm/gup.c:1922:7: error: implicit declaration of function > ‘is_valid_gup_flags’ [-Werror=implicit-function-declaration] > 351 1922 | if (!is_valid_gup_flags(gup_flags)) > 352 | ^~~~~~~~~~~~~~~~~~ > 353cc1: some warnings being treated as errors > Yes, thanks. From: Andrew Morton Subject: mm-gup-dont-permit-users-to-call-get_user_pages-with-foll_longterm-fix fix CONFIG_MMU=n build Link: https://lkml.kernel.org/r/CA+G9fYuNS3k0DVT62twfV746pfNhCSrk5sVMcOcQ1PGGnEseyw@mail.gmail.com Reported-by: Naresh Kamboju Cc: Barry Song Cc: Stephen Rothwell Signed-off-by: Andrew Morton --- mm/gup.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) --- a/mm/gup.c~mm-gup-dont-permit-users-to-call-get_user_pages-with-foll_longterm-fix +++ a/mm/gup.c @@ -1759,6 +1759,25 @@ static __always_inline long __gup_longte } #endif /* CONFIG_FS_DAX || CONFIG_CMA */ +static bool is_valid_gup_flags(unsigned int gup_flags) +{ + /* + * FOLL_PIN must only be set internally by the pin_user_pages*() APIs, + * never directly by the caller, so enforce that with an assertion: + */ + if (WARN_ON_ONCE(gup_flags & FOLL_PIN)) + return false; + /* + * FOLL_PIN is a prerequisite to FOLL_LONGTERM. Another way of saying + * that is, FOLL_LONGTERM is a specific case, more restrictive case of + * FOLL_PIN. + */ + if (WARN_ON_ONCE(gup_flags & FOLL_LONGTERM)) + return false; + + return true; +} + #ifdef CONFIG_MMU static long __get_user_pages_remote(struct mm_struct *mm, unsigned long start, unsigned long nr_pages, @@ -1789,25 +1808,6 @@ static long __get_user_pages_remote(stru gup_flags | FOLL_TOUCH | FOLL_REMOTE); } -static bool is_valid_gup_flags(unsigned int gup_flags) -{ - /* - * FOLL_PIN must only be set internally by the pin_user_pages*() APIs, - * never directly by the caller, so enforce that with an assertion: - */ - if (WARN_ON_ONCE(gup_flags & FOLL_PIN)) - return false; - /* - * FOLL_PIN is a prerequisite to FOLL_LONGTERM. Another way of saying - * that is, FOLL_LONGTERM is a specific case, more restrictive case of - * FOLL_PIN. - */ - if (WARN_ON_ONCE(gup_flags & FOLL_LONGTERM)) - return false; - - return true; -} - /** * get_user_pages_remote() - pin user pages in memory * @mm: mm_struct of target mm _