lkml.org 
[lkml]   [2026]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] mm: move phys_mem_access_prot_allowed to header
On Mon, May 4, 2026 at 10:54 PM Arnd Bergmann <arnd@arndb.de> wrote:
>
> On Tue, May 5, 2026, at 03:01, Rosen Penev wrote:
> > phys_mem_access_prot_allowed is only implemented for X86. For others, it
> > returns 1. Move it to header to avoid using __weak.
> >
> > Fixes compilation with make LLVM=1 ARCH=mips
>
> Can you describe what exactly goes wrong here on mips?
Cannot find symbol for section 4: .text.phys_mem_access_prot_allowed.
drivers/char/mem.o: failed

It's full of similar errors in drivers/pci/ as well. clang on MIPS
doesn't seem to like __weak.
>
> > @@ -239,12 +239,6 @@ static ssize_t write_mem(struct file *file, const
> > char __user *buf,
> > return written;
> > }
> >
> > -int __weak phys_mem_access_prot_allowed(struct file *file,
> > - unsigned long pfn, unsigned long size, pgprot_t *vma_prot)
> > -{
> > - return 1;
> > -}
> > -
>
> Removing __weak functions is usually an improvement, but I think
> we can go further here, see the discussion from last year at
>
> https://lore.kernel.org/all/20250520152030.1499670-1-arnd@kernel.org/#t
I hold no opinion on that.
>
> Arnd

\
 
 \ /
  Last update: 2026-05-05 09:59    [W:0.073 / U:18.751 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog