[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260120214754.1f309010@pumpkin>
Date: Tue, 20 Jan 2026 21:47:54 +0000
From: David Laight <david.laight.linux@...il.com>
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Thomas Gleixner <tglx@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
Uros Bizjak <ubizjak@...il.com>, Petr Mladek <pmladek@...e.com>, Andrew
Morton <akpm@...ux-foundation.org>, Kees Cook <kees@...nel.org>, "Peter
Zijlstra (Intel)" <peterz@...radead.org>, Nathan Chancellor
<nathan@...nel.org>, Kiryl Shutsemau <kas@...nel.org>, Rick Edgecombe
<rick.p.edgecombe@...el.com>, linux-kernel@...r.kernel.org,
linux-coco@...ts.linux.dev, x86@...nel.org
Subject: Re: [PATCH v1 01/14] x86/realmode: remove I/O port
paravirtualization
On Tue, 20 Jan 2026 11:53:53 -0800
"H. Peter Anvin" <hpa@...or.com> wrote:
> In commit:
>
> eb4ea1ae8f45 x86/boot: Port I/O: Allow to hook up alternative helpers
>
> ... paravirtualization hooks were added to (some!) of the port I/O
> functions. However, they were only ever used in the 32/64-bit
> "compressed" directory, and never made any sense in the real-mode
> code, which is notoriously size sensitive.
>
> Without these hooks, <asm/shared/io.h> is usable directly, so mode
v
David
> io.h into the compressed/ directory and replace "io.h" with
> <asm/shared/io.h> for the actual real-mode code.
>
> Signed-off-by: H. Peter Anvin (Intel) <hpa@...or.com>
> ---
> arch/x86/boot/boot.h | 2 +-
> arch/x86/boot/{ => compressed}/io.h | 0
> arch/x86/boot/compressed/misc.h | 2 +-
> arch/x86/boot/compressed/tdx.c | 2 +-
> arch/x86/boot/main.c | 5 +----
> arch/x86/realmode/rm/wakemain.c | 4 ----
> 6 files changed, 4 insertions(+), 11 deletions(-)
> rename arch/x86/boot/{ => compressed}/io.h (100%)
>
> diff --git a/arch/x86/boot/boot.h b/arch/x86/boot/boot.h
> index 8e3eab34dff4..f185931283cb 100644
> --- a/arch/x86/boot/boot.h
> +++ b/arch/x86/boot/boot.h
> @@ -18,6 +18,7 @@
>
> #ifndef __ASSEMBLER__
>
> +#include <asm/shared/io.h>
> #include <linux/stdarg.h>
> #include <linux/types.h>
> #include <linux/edd.h>
> @@ -26,7 +27,6 @@
> #include "bitops.h"
> #include "ctype.h"
> #include "cpuflags.h"
> -#include "io.h"
>
> /* Useful macros */
> #define ARRAY_SIZE(x) (sizeof(x) / sizeof(*(x)))
> diff --git a/arch/x86/boot/io.h b/arch/x86/boot/compressed/io.h
> similarity index 100%
> rename from arch/x86/boot/io.h
> rename to arch/x86/boot/compressed/io.h
> diff --git a/arch/x86/boot/compressed/misc.h b/arch/x86/boot/compressed/misc.h
> index fd855e32c9b9..68957e7698ad 100644
> --- a/arch/x86/boot/compressed/misc.h
> +++ b/arch/x86/boot/compressed/misc.h
> @@ -43,8 +43,8 @@
>
> #define BOOT_BOOT_H
> #include "../ctype.h"
> -#include "../io.h"
>
> +#include "io.h"
> #include "efi.h"
>
> #ifdef CONFIG_X86_64
> diff --git a/arch/x86/boot/compressed/tdx.c b/arch/x86/boot/compressed/tdx.c
> index 8451d6a1030c..00359dbe1f8c 100644
> --- a/arch/x86/boot/compressed/tdx.c
> +++ b/arch/x86/boot/compressed/tdx.c
> @@ -2,7 +2,7 @@
>
> #include "../cpuflags.h"
> #include "../string.h"
> -#include "../io.h"
> +#include "io.h"
> #include "error.h"
>
> #include <vdso/limits.h>
> diff --git a/arch/x86/boot/main.c b/arch/x86/boot/main.c
> index 9d0fea18d3c8..da01ade4959e 100644
> --- a/arch/x86/boot/main.c
> +++ b/arch/x86/boot/main.c
> @@ -15,10 +15,9 @@
> #include "boot.h"
> #include "string.h"
>
> +/* Buffer for building the full "zero page" struct boot_params */
> struct boot_params boot_params __attribute__((aligned(16)));
>
> -struct port_io_ops pio_ops;
> -
> char *HEAP = _end;
> char *heap_end = _end; /* Default end of heap = no heap */
>
> @@ -132,8 +131,6 @@ static void init_heap(void)
>
> void main(void)
> {
> - init_default_io_ops();
> -
> /* First, copy the boot header into the "zeropage" */
> copy_boot_params();
>
> diff --git a/arch/x86/realmode/rm/wakemain.c b/arch/x86/realmode/rm/wakemain.c
> index a6f4d8388ad8..1d6437e6d2ba 100644
> --- a/arch/x86/realmode/rm/wakemain.c
> +++ b/arch/x86/realmode/rm/wakemain.c
> @@ -62,12 +62,8 @@ static void send_morse(const char *pattern)
> }
> }
>
> -struct port_io_ops pio_ops;
> -
> void main(void)
> {
> - init_default_io_ops();
> -
> /* Kill machine if structures are wrong */
> if (wakeup_header.real_magic != 0x12345678)
> while (1)
Powered by blists - more mailing lists