From: Ryan Roberts <ryan.roberts@arm.com>
To: kernel test robot <lkp@intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
SeongJae Park <sj@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>,
linux-kernel@vger.kernel.org, damon@lists.linux.dev
Subject: Re: [RESEND PATCH v1 5/5] mm: ptep_deref() conversion
Date: Fri, 12 May 2023 11:50:28 +0100 [thread overview]
Message-ID: <f02402c2-3777-78e8-7fc7-99ce05a425c5@arm.com> (raw)
In-Reply-To: <202305120142.yXsNEo6H-lkp@intel.com>
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 <lkp@intel.com>
> | 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
prev parent reply other threads:[~2023-05-12 10:50 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-11 13:21 [RESEND PATCH v1 0/5] Encapsulate PTE contents from non-arch code Ryan Roberts
2023-05-11 13:21 ` [RESEND PATCH v1 1/5] mm: vmalloc must set pte via arch code Ryan Roberts
2023-05-11 15:00 ` Zi Yan
2023-05-12 11:01 ` Ryan Roberts
2023-05-13 13:14 ` Lorenzo Stoakes
2023-05-15 8:29 ` Ryan Roberts
2023-05-15 11:25 ` Lorenzo Stoakes
2023-05-15 12:14 ` Ryan Roberts
2023-05-17 6:20 ` Christoph Hellwig
2023-05-17 6:23 ` Lorenzo Stoakes
2023-05-17 6:18 ` Christoph Hellwig
2023-05-11 13:21 ` [RESEND PATCH v1 2/5] mm: damon must atomically clear young on ptes and pmds Ryan Roberts
2023-05-11 15:01 ` Zi Yan
2023-05-11 13:21 ` [RESEND PATCH v1 3/5] mm: Fix failure to unmap pte on highmem systems Ryan Roberts
2023-05-11 15:01 ` Zi Yan
2023-05-11 13:21 ` [RESEND PATCH v1 4/5] mm: Add new ptep_deref() helper to fully encapsulate pte_t Ryan Roberts
2023-05-11 13:21 ` [RESEND PATCH v1 5/5] mm: ptep_deref() conversion Ryan Roberts
2023-05-11 17:37 ` kernel test robot
2023-05-12 10:50 ` Ryan Roberts [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f02402c2-3777-78e8-7fc7-99ce05a425c5@arm.com \
--to=ryan.roberts@arm.com \
--cc=akpm@linux-foundation.org \
--cc=damon@lists.linux.dev \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=sj@kernel.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox