Re: [PATCHv8 14/30] x86: Consolidate port I/O helpers

From: Kirill A. Shutemov
Date: Sun Apr 10 2022 - 15:59:01 EST


On Sun, Apr 10, 2022 at 12:58:17PM +0200, Borislav Petkov wrote:
> On Wed, Apr 06, 2022 at 02:29:23AM +0300, Kirill A. Shutemov wrote:
> > There are two implementations of port I/O helpers: one in the kernel and
> > one in the boot stub.
> >
> > Move the helpers required for both to <asm/shared/io.h> and use the one
> > implementation everywhere.
> >
> > Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
> > Reviewed-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> > ---
> > arch/x86/boot/boot.h | 35 +-------------------------------
> > arch/x86/boot/compressed/misc.h | 2 +-
> > arch/x86/include/asm/io.h | 22 ++------------------
> > arch/x86/include/asm/shared/io.h | 34 +++++++++++++++++++++++++++++++
> > 4 files changed, 38 insertions(+), 55 deletions(-)
> > create mode 100644 arch/x86/include/asm/shared/io.h
>
> This complains with clang-13 here, config attached.
>
> And yap, this is the damn include hell I keep talking about. That
> lib/kalsr.c thing includes the kernel proper io.h header ...

Right. <asm/shared/io.h> is enough for lib/kaslr.c.

What about this: