[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5e2c456af89b60c845db2232664f6f9694aa9840.camel@gmail.com>
Date: Mon, 31 Jan 2022 11:55:39 +0100
From: Karolina Drobnik <karolinadrobnik@...il.com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-mm@...ck.org, akpm@...ux-foundation.org,
mike.rapoport@...il.com, linux-kernel@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>
Subject: Re: [PATCH 07/16] tools/include: Add io.h stub
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
Powered by blists - more mailing lists