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=-7.9 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 55591C433E1 for ; Thu, 20 Aug 2020 20:55:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 19C92208DB for ; Thu, 20 Aug 2020 20:55:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="KtEB4K2M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19C92208DB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id BE2348D004D; Thu, 20 Aug 2020 16:55:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B92A58D0005; Thu, 20 Aug 2020 16:55:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A801F8D004D; Thu, 20 Aug 2020 16:55:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0082.hostedemail.com [216.40.44.82]) by kanga.kvack.org (Postfix) with ESMTP id 8CC398D0005 for ; Thu, 20 Aug 2020 16:55:20 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 418F2180AD81F for ; Thu, 20 Aug 2020 20:55:20 +0000 (UTC) X-FDA: 77172152400.13.tiger60_5b0e41327033 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin13.hostedemail.com (Postfix) with ESMTP id 287E618140B85 for ; Thu, 20 Aug 2020 20:55:18 +0000 (UTC) X-HE-Tag: tiger60_5b0e41327033 X-Filterd-Recvd-Size: 5213 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Thu, 20 Aug 2020 20:55:17 +0000 (UTC) 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 X-Rspamd-Queue-Id: 287E618140B85 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 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: On Thu, 20 Aug 2020 14:59:52 +0530 Naresh Kamboju wrote: > arm and riscv architecture build failed on linux next 20200820 tag. >=20 > make -sk KBUILD_BUILD_USER=3DTuxBuild -C/linux -j16 ARCH=3Darm > CROSS_COMPILE=3Darm-linux-gnueabihf- HOSTCC=3Dgcc CC=3D"sccache > arm-linux-gnueabihf-gcc" O=3Dbuild zImage >=20 > 348# > 349../mm/gup.c: In function =E2=80=98get_user_pages=E2=80=99: > 350../mm/gup.c:1922:7: error: implicit declaration of function > =E2=80=98is_valid_gup_flags=E2=80=99 [-Werror=3Dimplicit-function-decla= ration] > 351 1922 | if (!is_valid_gup_flags(gup_flags)) > 352 | ^~~~~~~~~~~~~~~~~~ > 353cc1: some warnings being treated as errors >=20 Yes, thanks. From: Andrew Morton Subject: mm-gup-dont-permit-users-to-call-get_user_pages-with-foll_longte= rm-fix fix CONFIG_MMU=3Dn build Link: https://lkml.kernel.org/r/CA+G9fYuNS3k0DVT62twfV746pfNhCSrk5sVMcOcQ= 1PGGnEseyw@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 */ =20 +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); } =20 -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 _