From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F286D3D331E for ; Tue, 20 Jan 2026 21:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768945683; cv=none; b=CPOnQ8CNlarc20IkNC5GtivcIZsXLbdJZDKGA8Vciu7rRtBcNpR+erNXAvGsEtvgALm1LnzPP72aI7d06nxUgNIid2ijD1VTlIHIi95L/s4r0U5/NhJUD6H8rUdQ3X5yBF2kdiOjZU6Rm4P1xIRYakNpAJDHgMgHCN2HEnu/5V4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768945683; c=relaxed/simple; bh=yQP2Bhh0JVZYQHukZ5sYv7vdxCRank8Svaw9GvOPEYs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e50iV/pi5qrSL41GqJAwJO+q48v8fAsosw+krKRUWsJ4+ad5XM6y9WkkQAeyNvzvJe6cMscl1EElhBcUNHI55ef4dNboPKw7m4GYyveADgtw6kRp2NFUqvKCC5+LyayfhEURkDk4tv2dAzFoAr+gGmS9i2mMHavjeh8RkX/pKfY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=cnLyroVY; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="cnLyroVY" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-435903c4040so692524f8f.3 for ; Tue, 20 Jan 2026 13:47:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768945677; x=1769550477; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=nxAJit3cy3zQxDPIGkNvzfMvCiBbKehPhneoVBS7hA4=; b=cnLyroVYToyksGoPP4qdr/JQw05DS5GTSEi6FKhxryzLoJsYDB+MdKsCUS79EJgJZl UPa5Mnfd61ehYEU0YLrWEZPO4ZFOF/i8pLvYv4PE4Alm5iSQLZ5I41h4haaedhoiZ+dS TZmOYaUeXkWMmqCLU7enZmqlGEJIXNIVWoTI1GTF1mkxGGNDR0qkEgOfiW3tmdUkawo0 jdpggLpCEAnPbz6SdJ2l3MLO8b36uxAeZfCBBX39Y6wN6eW5DaZjbjjJ55OjJl2qKLVb W3I0AYyoPV2VyUHzpSJ/wu9+VrOkmIO1xZBuHPvkWewCxLxJyXaYbs+Rvv+79JiGQ9Cx iI6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768945677; x=1769550477; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nxAJit3cy3zQxDPIGkNvzfMvCiBbKehPhneoVBS7hA4=; b=fGs3o8MVGSRZrwHzcXhSoC0stnJZ3OKqh0EM3/jQaEQFKzXvOyVZ6Yn3KWRyGRFbJU uipDXaSB3azRjHSAZ2a5LkFfs7guTM2l/CwoJ3bIB+EoJRQRtzGqHx3ZVVlCadhxqRqg C6I6EaQ4FK5I0Zmql3DxRIWXcXybfup9y90GnZZFZt665ee5CDoxKbVKcx8FdFSDp5aq B0YCJU30970dXrg2LtaFbzbdRSdZLfmIGTFEmaTdPYBGMszePpg2rk69Hm2xtuTamvxt M0r95nrKmNaHlazyeTKCJhkM9gQluK1tf1M9TNoGxON+a/xrcec6umvU5f0KigC3U59T O28Q== X-Forwarded-Encrypted: i=1; AJvYcCUsidn8zy6jBI0JNNYqEnaBNWJyWrPC4RjrnftsCyzSqzmXlWKP9716iiQUb0g1eLSZZtfOvz6CAo+QSTQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyOC3mvwgBBUr0qoMiYL9kt3Q5CQ0q7p3KkTS3Rd0lvdjyj+M5K MFsnghYP9rGbLLF9GmD3l0fTsJ810+Tj/N9uJVtMwClArGY/NgreH+C8 X-Gm-Gg: AZuq6aIiIK7jvgFuaUQXIE5xFmZe04I8ezWb1Wp62b4fqTySEnQtEP020da+YpR76FA 0k8qLJ58BvbNfxzdXptmUthfeIjmN+UL56NiCpJfekPjJR7tr05jZKDP9MC+035Ek49mMweFtzj XndrLf3+yCzsOs3mVpMwQW6JLzhgEKNiC8LlAfAkTXlz0DeOzfAWtvD3DwAVjYu0Jdc+Sxe3NUF 0oIuTR5mdDxUafjMT0zNrnrIyAIZ753z2v6bBwIFft0K1Wg6rh9z17P7KNizYtu+l8CmqDb8NWq 5tdY4xmTwgHGnNxnFZR+VvWVMOxny52Jf65XxcOKELVxAESBbFk3yGxWbNKdpCIijFsLKA4bLFj RMptO5p42LRTDuvSo3zeaGYHxengVjMFLFF2W6L6TPniXIBsbxwLd8Ee7DiQbdRbTs8h/tX1XZr Uq6aHcHUTyHnijpaSmg2ztieDVbbUBwO0Rd44aamrdcYlj4J1VG+62 X-Received: by 2002:a5d:64c5:0:b0:430:f449:5f18 with SMTP id ffacd0b85a97d-4356a061401mr21577182f8f.46.1768945676741; Tue, 20 Jan 2026 13:47:56 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4359333b924sm4594022f8f.13.2026.01.20.13.47.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Jan 2026 13:47:56 -0800 (PST) Date: Tue, 20 Jan 2026 21:47:54 +0000 From: David Laight To: "H. Peter Anvin" Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Uros Bizjak , Petr Mladek , Andrew Morton , Kees Cook , "Peter Zijlstra (Intel)" , Nathan Chancellor , Kiryl Shutsemau , Rick Edgecombe , linux-kernel@vger.kernel.org, linux-coco@lists.linux.dev, x86@kernel.org Subject: Re: [PATCH v1 01/14] x86/realmode: remove I/O port paravirtualization Message-ID: <20260120214754.1f309010@pumpkin> In-Reply-To: <20260120195407.1163051-2-hpa@zytor.com> References: <20260119192923.651588-1-hpa@zytor.com> <20260120195407.1163051-1-hpa@zytor.com> <20260120195407.1163051-2-hpa@zytor.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 20 Jan 2026 11:53:53 -0800 "H. Peter Anvin" 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, is usable directly, so mode v David > io.h into the compressed/ directory and replace "io.h" with > for the actual real-mode code. > > Signed-off-by: H. Peter Anvin (Intel) > --- > 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 > #include > #include > #include > @@ -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 > 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)