lkml.org 
[lkml]   [2022]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 07/16] tools/include: Add io.h stub
From
Date
Hi Matthew,

On Sun, 2022-01-30 at 17:53 +0000, Matthew Wilcox wrote:
> I think I found a deeper problem which is masked due to our maze of
> header files:
>
> include/asm-generic/io.h:#ifndef virt_to_phys
> include/asm-generic/io.h:#define virt_to_phys virt_to_phys
>
> so there's an assumption that <asm/io.h> defines virt_to_phys().
> You can see that in a number of architectures, eg:
>
> arch/alpha/include/asm/io.h:static inline unsigned long
> virt_to_phys(volatile void *address)
> arch/ia64/include/asm/io.h:#define virt_to_phys virt_to_phys
> arch/mips/include/asm/io.h:#define virt_to_phys virt_to_phys
> arch/nios2/include/asm/io.h:#define virt_to_phys(vaddr) \
> arch/parisc/include/asm/io.h:#define virt_to_phys(a) ((unsigned
> long)__pa(a))
> arch/powerpc/include/asm/io.h:#define virt_to_phys virt_to_phys
> arch/sh/include/asm/io.h:#define virt_to_phys(address)  ((unsigned
> long)(address))
> arch/x86/include/asm/io.h:#define virt_to_phys virt_to_phys
>
> That's clearly not the right place to define it.  Two architectures
> put it in asm/memory.h:
>
> arch/arm/include/asm/memory.h:#define virt_to_phys virt_to_phys
> arch/arm64/include/asm/memory.h:#define virt_to_phys virt_to_phys
>
> then:
>
> arch/m68k/include/asm/virtconvert.h:#define virt_to_phys virt_to_phys
> arch/sparc/include/asm/page_32.h:#define virt_to_phys           __pa
> arch/sparc/include/asm/page_64.h:#define virt_to_phys __pa

Oh, that's a lot...thank you for checking it. The simulator has its own
mm stubs, so it shouldn't be impacted by such a clean up, correct?

> This needs to be properly sorted out, but I don't want to tell
> Karolina that's now her job as a prerequisite for merging this
> patchset; that would be unfair.

Thanks. Also, I think I'm not be the best person to (efficiently) sort
this out :)


All the best,
Karolina

\
 
 \ /
  Last update: 2022-01-31 11:56    [W:0.111 / U:0.404 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site