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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C777C77B7C for ; Fri, 12 May 2023 10:50:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C1C7B6B0071; Fri, 12 May 2023 06:50:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BCC2D6B0074; Fri, 12 May 2023 06:50:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AE2186B0075; Fri, 12 May 2023 06:50:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 9D4436B0071 for ; Fri, 12 May 2023 06:50:36 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6E45240F49 for ; Fri, 12 May 2023 10:50:36 +0000 (UTC) X-FDA: 80781284472.05.D8D25C5 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf03.hostedemail.com (Postfix) with ESMTP id AA83720002 for ; Fri, 12 May 2023 10:50:33 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1683888634; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F54Tzq28Y+0o2Do70ryRoSdZHtYvl6PqUZuqsW9h7Mc=; b=Aq1tz0TeWkYqqNZsAwdfgdj+yj//inJxWF28wYbPlwjRXUwxlEKZYe2nhziVBd/tMWiLEY CzBXlALULv2SEfOFfhvJme4k6JS/5Ebl2eCaDiOk6jghflFKAjIfeaLJnQAWXe3oeA5Zg8 T6AUvFoU3K5D/UQeuQYoz2Zjac7SDDQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1683888634; a=rsa-sha256; cv=none; b=J0BS3Ty7sj122YeAniZJrL5pN820ZJVbevxew39TI9CE8nCCZn0PMBPOpt4LkDzj9nAnZQ kfX+7kZoDcmeXUK5kIhcVfk983YcQVyE2DvIEa7QXBIV2DVe3N5g3O18GU+ku0FR8hpyus fPD6q7yMUCF/btzbLo0WRmcsKFiyIig= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; spf=pass (imf03.hostedemail.com: domain of ryan.roberts@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=ryan.roberts@arm.com; dmarc=pass (policy=none) header.from=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 46C2EFEC; Fri, 12 May 2023 03:51:17 -0700 (PDT) Received: from [10.57.73.22] (unknown [10.57.73.22]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 03A323F67D; Fri, 12 May 2023 03:50:30 -0700 (PDT) Message-ID: Date: Fri, 12 May 2023 11:50:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [RESEND PATCH v1 5/5] mm: ptep_deref() conversion To: kernel test robot , Andrew Morton , "Matthew Wilcox (Oracle)" , "Kirill A. Shutemov" , SeongJae Park Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List , linux-kernel@vger.kernel.org, damon@lists.linux.dev References: <20230511132113.80196-6-ryan.roberts@arm.com> <202305120142.yXsNEo6H-lkp@intel.com> From: Ryan Roberts In-Reply-To: <202305120142.yXsNEo6H-lkp@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: AA83720002 X-Stat-Signature: ztrunm3i1agt34fmwjf9fuie8h3j3c6u X-Rspam-User: X-Rspamd-Server: rspam09 X-HE-Tag: 1683888633-198659 X-HE-Meta: U2FsdGVkX1+7IqTc6+cjZFKrC9XdtFgKFP7sqo1Nx+KrVPbTsGUdPa39acq0LLS9IlajfBFkpbWMVqkSUCgMXwwmb5F5EcC2/Ks/ZCZKXATSBOgYS7jkdpkK0HQgA4ITW2XyTIIG/9IvQ0l3xo7ghcXuMONpdnk8Gjd+rn8acMgYypoIGY1mjbGcd3a1CzSDfVR28BuxkqqHkgQnuFHpb4YeSkg9s5witQst3IOCQ17SpiS+EVMdCr8EXSRmOwUzOUZdSro/rMwdtjElAX2YmoHt2YEkYI/tACeHUa5uysoXUY0kex/pFzCrrROxWumoFVR8hs5a43vMBjZ2rXmaRiTgwbA+LTUEb7KgS3vosLYS3EZ0nF6p4zrJbTRYfvG5wAVEDgn6+yECfzzKoXFU0HNw34bdpXY+9TTCFxKl7P9UCe7KDW+m5TU7PHuXqwgxcJd9IU8xDCoxDuDdxnsuSFBIzLKq5XUUeolfDzuFLE9x9rlbHRrM5vAv8Im88H8nW780wN00o5t9kGbCOiQRK9ttDi2jo6/iMP4Pr3R5Gaqxaoo+1KTZlfZVWWQjsK8wtUdxqA/BAqQ70ZhLlxFNt8I8G2fJeSRsssRQUSQUjV09m1q+jdH1UlGaZ7vKFQfbZMSuD/c6bgP8nj6NrYf02D+A33IkimzNdMUM/lcg+EPLg/VGcehMylzW98kNDnLRheSChmBa145U1WAs0Uolg6T+7PJf4br5zuGI+YD+s3ADJNagN19MYM57ZiNta5HVjEPIoEf2XxOIdK84vxLxEtpyMTvvLK3f81C9U3lkpJbnnM54e1iGr/T318eKnO6gRpAj4llcCmKRZymbJG+cqTG3ANfKHjS76o/b+nSwK9ZbUbebYkhQbveqln1v+kS1mfXeCZTBuG71gJ8pTt88LunkjLLL08fbad3uArsoGwwJl4D1w3iFRpCsXvvuTxibjy8VxQOiMTpISQynRgX J8hBEwQ3 hY0gf+U7e0mZO+DJb7AIc3TUp4OH/8UZjZmqIZNxH8cj6GZaMbfINWtCWVOSfAx52TfMXlwPUOEnrKTGS0tUXYOR65V6eYfgNBkRL8kHr+NiKsnl4ngjFltmHk3kQ7NXB0U3Qt90nXIwktDvcne+B2wsqoE+27mzSSbzIKhPInHAu9POlI6EGKo1ngIxBL6ihYypXTpLm5dOh/sNZsUPzV/CPTG1bK69k3uV0hRgecE/VNxYdhCIcDsVj53Y/3kN1vbrg/Q3HOLiUybqfrUkT/uYIGwntI1nqD+1RJ2FRT2WJkjTlJQOMbPdPMNcOPK6CehlOleIB2I482xXiSdvj8+X1xHyg7tEXKSgkhQO2rvSoK/aU4FEMNMTQKReNYTQh/vP0SwFTZwdteWTEXyJ3//PefjaxRcQfFFN6S4bIYIrum9EILxIf065vmsRzfu7SxJXj+UbLUSump4jsp0yScDurtbwBVCf3UxAwV0jbWzVYmPUDz6zouHbp5Q== 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 11/05/2023 18:37, kernel test robot wrote: > Hi Ryan, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on akpm-mm/mm-everything] > [also build test ERROR on sj/damon/next drm-intel/for-linux-next-fixes char-misc/char-misc-testing char-misc/char-misc-next char-misc/char-misc-linus tip/perf/core kvm/queue linus/master v6.4-rc1 next-20230511] > [cannot apply to drm-intel/for-linux-next awilliam-vfio/next awilliam-vfio/for-linus xen-tip/linux-next acme/perf/core kvm/linux-next] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Ryan-Roberts/mm-vmalloc-must-set-pte-via-arch-code/20230511-213826 > base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything > patch link: https://lore.kernel.org/r/20230511132113.80196-6-ryan.roberts%40arm.com > patch subject: [RESEND PATCH v1 5/5] mm: ptep_deref() conversion > config: sh-allmodconfig (https://download.01.org/0day-ci/archive/20230512/202305120142.yXsNEo6H-lkp@intel.com/config) > compiler: sh4-linux-gcc (GCC) 12.1.0 > reproduce (this is a W=1 build): > wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # https://github.com/intel-lab-lkp/linux/commit/6cb99aca1b207cdf4f320eec14447bdc654b51df > git remote add linux-review https://github.com/intel-lab-lkp/linux > git fetch --no-tags linux-review Ryan-Roberts/mm-vmalloc-must-set-pte-via-arch-code/20230511-213826 > git checkout 6cb99aca1b207cdf4f320eec14447bdc654b51df > # save the config file > mkdir build_dir && cp config build_dir/.config > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh olddefconfig > COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=sh SHELL=/bin/bash fs/ FYI This doesn't work on Ubuntu 20.04 or Debian Bullseye due to libc being too old. So I used an Ubuntu 22.04 VM (x86_64), but with that was getting internal compiler errors while compiling. Despite that, was able to repro and fix the error. > > If you fix the issue, kindly add following tag where applicable > | Reported-by: kernel test robot > | Link: https://lore.kernel.org/oe-kbuild-all/202305120142.yXsNEo6H-lkp@intel.com/ Will do - thanks! > > All errors (new ones prefixed by >>): > > In file included from include/linux/migrate.h:8, > from fs/nfs/write.c:17: > include/linux/hugetlb.h: In function 'huge_ptep_clear_flush': >>> include/linux/hugetlb.h:1203:16: error: implicit declaration of function 'ptep_deref' [-Werror=implicit-function-declaration] > 1203 | return ptep_deref(ptep); > | ^~~~~~~~~~ >>> include/linux/hugetlb.h:1203:16: error: incompatible types when returning type 'int' but 'pte_t' was expected > 1203 | return ptep_deref(ptep); > | ^~~~~~~~~~~~~~~~ > cc1: some warnings being treated as errors > -- > In file included from fs/proc/meminfo.c:6: > include/linux/hugetlb.h: In function 'huge_ptep_clear_flush': >>> include/linux/hugetlb.h:1203:16: error: implicit declaration of function 'ptep_deref' [-Werror=implicit-function-declaration] > 1203 | return ptep_deref(ptep); > | ^~~~~~~~~~ >>> include/linux/hugetlb.h:1203:16: error: incompatible types when returning type 'int' but 'pte_t' was expected > 1203 | return ptep_deref(ptep); > | ^~~~~~~~~~~~~~~~ > fs/proc/meminfo.c: At top level: > fs/proc/meminfo.c:23:28: warning: no previous prototype for 'arch_report_meminfo' [-Wmissing-prototypes] > 23 | void __attribute__((weak)) arch_report_meminfo(struct seq_file *m) > | ^~~~~~~~~~~~~~~~~~~ > cc1: some warnings being treated as errors > > > vim +/ptep_deref +1203 include/linux/hugetlb.h > > 1199 > 1200 static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, > 1201 unsigned long addr, pte_t *ptep) > 1202 { >> 1203 return ptep_deref(ptep); > 1204 } > 1205 > Root cause is due to this being MMU=n build, where the ptep helpers (including ptep_deref()) are not defined. A huge_ptep_clear_flush() default is still defined for linking reasons, which derefrences the ptep, so changing that to the new helper blows up in this config. Fixed with: static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, unsigned long addr, pte_t *ptep) { +#ifdef CONFIG_MMU return ptep_deref(ptep); +#else + return *ptep; +#endif } Will include with v2. Thanks, Ryan