* [PATCH v4 0/6] x86: Cleanups around slow_down_io()
@ 2026-01-19 18:26 Juergen Gross
2026-01-19 18:26 ` [PATCH v4 1/6] x86/irqflags: Fix build failure Juergen Gross
` (8 more replies)
0 siblings, 9 replies; 23+ messages in thread
From: Juergen Gross @ 2026-01-19 18:26 UTC (permalink / raw)
To: linux-kernel, x86, virtualization, kvm, linux-block
Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, H. Peter Anvin, Ajay Kaher, Alexey Makhalov,
Broadcom internal kernel review list, Paolo Bonzini,
Vitaly Kuznetsov, Boris Ostrovsky, xen-devel, Denis Efremov,
Jens Axboe
While looking at paravirt cleanups I stumbled over slow_down_io() and
the related REALLY_SLOW_IO define.
Do several cleanups, resulting in a deletion of REALLY_SLOW_IO and the
io_delay() paravirt function hook.
Patch 4 is removing the config options for selecting the default delay
mechanism and sets the default to "no delay". This is in preparation of
removing the io_delay() functionality completely, as suggested by Ingo
Molnar.
Patch 5 is adding an additional config option allowing to avoid
building io_delay.c (default is still to build it).
Changes in V2:
- patches 2 and 3 of V1 have been applied
- new patches 4 and 5
Changes in V3:
- rebase to tip/master kernel branch
Changes in V4:
- add patch 1 as prereq patch to the series
Juergen Gross (6):
x86/irqflags: Fix build failure
x86/paravirt: Replace io_delay() hook with a bool
block/floppy: Don't use REALLY_SLOW_IO for delays
x86/io: Remove REALLY_SLOW_IO handling
x86/io_delay: Switch io_delay() default mechanism to "none"
x86/io_delay: Add config option for controlling build of io_delay.
arch/x86/Kconfig | 8 +++
arch/x86/Kconfig.debug | 30 ----------
arch/x86/include/asm/floppy.h | 31 ++++++++--
arch/x86/include/asm/io.h | 19 ++++---
arch/x86/include/asm/irqflags.h | 6 +-
arch/x86/include/asm/paravirt-base.h | 6 ++
arch/x86/include/asm/paravirt.h | 11 ----
arch/x86/include/asm/paravirt_types.h | 2 -
arch/x86/kernel/Makefile | 3 +-
arch/x86/kernel/cpu/vmware.c | 2 +-
arch/x86/kernel/io_delay.c | 81 +--------------------------
arch/x86/kernel/kvm.c | 8 +--
arch/x86/kernel/paravirt.c | 3 +-
arch/x86/kernel/setup.c | 4 +-
arch/x86/xen/enlighten_pv.c | 6 +-
drivers/block/floppy.c | 2 -
16 files changed, 63 insertions(+), 159 deletions(-)
--
2.52.0
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH v4 1/6] x86/irqflags: Fix build failure
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
@ 2026-01-19 18:26 ` Juergen Gross
2026-03-21 15:47 ` [tip: x86/cleanups] x86/irqflags: Preemptively move include paravirt.h directive where it belongs tip-bot2 for Juergen Gross
2026-03-22 7:47 ` tip-bot2 for Juergen Gross
2026-01-19 18:26 ` [PATCH v4 2/6] x86/paravirt: Replace io_delay() hook with a bool Juergen Gross
` (7 subsequent siblings)
8 siblings, 2 replies; 23+ messages in thread
From: Juergen Gross @ 2026-01-19 18:26 UTC (permalink / raw)
To: linux-kernel, x86
Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, H. Peter Anvin, kernel test robot
Commit 22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under
CONFIG_PARAVIRT") moved some paravirt hooks from the CONFIG_PARAVIRT_XXL
umbrella to CONFIG_PARAVIRT, but missed to move the associated
"#include <asm/paravirt.h>" in irqflags.h from CONFIG_PARAVIRT_XXL to
CONFIG_PARAVIRT.
This hasn't resulted in build failures yet, as all use cases of
irqflags.h had paravirt.h included via other header files, even without
CONFIG_PARAVIRT_XXL being set.
In order to allow changing those other header files, e.g. by no longer
including paravirt.h, fix irqflags.h by moving inclusion of paravirt.h
under the CONFIG_PARAVIRT umbrella.
Fixes: 22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202601152203.plJOoOEF-lkp@intel.com/
Signed-off-by: Juergen Gross <jgross@suse.com>
---
V4:
- merge into slow_io series as prereq patch (Boris Petkov)
- rewrite commit message (Boris Petkov)
---
arch/x86/include/asm/irqflags.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index a1193e9d65f2..4d4d02e31287 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -96,11 +96,11 @@ static __always_inline void halt(void)
native_halt();
}
#endif /* __ASSEMBLY__ */
+#else
+#include <asm/paravirt.h>
#endif /* CONFIG_PARAVIRT */
-#ifdef CONFIG_PARAVIRT_XXL
-#include <asm/paravirt.h>
-#else
+#ifndef CONFIG_PARAVIRT_XXL
#ifndef __ASSEMBLER__
#include <linux/types.h>
--
2.52.0
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH v4 2/6] x86/paravirt: Replace io_delay() hook with a bool
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
2026-01-19 18:26 ` [PATCH v4 1/6] x86/irqflags: Fix build failure Juergen Gross
@ 2026-01-19 18:26 ` Juergen Gross
2026-03-21 15:47 ` [tip: x86/cleanups] " tip-bot2 for Juergen Gross
2026-03-22 7:46 ` tip-bot2 for Juergen Gross
2026-01-19 18:26 ` [PATCH v4 3/6] block/floppy: Don't use REALLY_SLOW_IO for delays Juergen Gross
` (6 subsequent siblings)
8 siblings, 2 replies; 23+ messages in thread
From: Juergen Gross @ 2026-01-19 18:26 UTC (permalink / raw)
To: linux-kernel, x86, virtualization, kvm
Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, H. Peter Anvin, Ajay Kaher, Alexey Makhalov,
Broadcom internal kernel review list, Paolo Bonzini,
Vitaly Kuznetsov, Boris Ostrovsky, xen-devel
The io_delay() paravirt hook is in no way performance critical and all
users setting it to a different function than native_io_delay() are
using an empty function as replacement.
This enables to replace the hook with a bool indicating whether
native_io_delay() should be called.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
V3:
- rebase to tip/master kernel branch
---
arch/x86/include/asm/io.h | 9 ++++++---
arch/x86/include/asm/paravirt-base.h | 6 ++++++
arch/x86/include/asm/paravirt.h | 11 -----------
arch/x86/include/asm/paravirt_types.h | 2 --
arch/x86/kernel/cpu/vmware.c | 2 +-
arch/x86/kernel/kvm.c | 8 +-------
arch/x86/kernel/paravirt.c | 3 +--
arch/x86/xen/enlighten_pv.c | 6 +-----
8 files changed, 16 insertions(+), 31 deletions(-)
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index ca309a3227c7..8a9292ce7d2d 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -243,11 +243,16 @@ extern int io_delay_type;
extern void io_delay_init(void);
#if defined(CONFIG_PARAVIRT)
-#include <asm/paravirt.h>
+#include <asm/paravirt-base.h>
#else
+#define call_io_delay() true
+#endif
static inline void slow_down_io(void)
{
+ if (!call_io_delay())
+ return;
+
native_io_delay();
#ifdef REALLY_SLOW_IO
native_io_delay();
@@ -256,8 +261,6 @@ static inline void slow_down_io(void)
#endif
}
-#endif
-
#define BUILDIO(bwl, type) \
static inline void out##bwl##_p(type value, u16 port) \
{ \
diff --git a/arch/x86/include/asm/paravirt-base.h b/arch/x86/include/asm/paravirt-base.h
index 982a0b93bc76..3b9e7772d196 100644
--- a/arch/x86/include/asm/paravirt-base.h
+++ b/arch/x86/include/asm/paravirt-base.h
@@ -15,6 +15,8 @@ struct pv_info {
#ifdef CONFIG_PARAVIRT_XXL
u16 extra_user_64bit_cs; /* __USER_CS if none */
#endif
+ bool io_delay;
+
const char *name;
};
@@ -26,6 +28,10 @@ u64 _paravirt_ident_64(u64);
#endif
#define paravirt_nop ((void *)nop_func)
+#ifdef CONFIG_PARAVIRT
+#define call_io_delay() pv_info.io_delay
+#endif
+
#ifdef CONFIG_PARAVIRT_SPINLOCKS
void paravirt_set_cap(void);
#else
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index b21072af731d..f4885bd98a18 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -19,17 +19,6 @@
#include <linux/cpumask.h>
#include <asm/frame.h>
-/* The paravirtualized I/O functions */
-static inline void slow_down_io(void)
-{
- PVOP_VCALL0(pv_ops, cpu.io_delay);
-#ifdef REALLY_SLOW_IO
- PVOP_VCALL0(pv_ops, cpu.io_delay);
- PVOP_VCALL0(pv_ops, cpu.io_delay);
- PVOP_VCALL0(pv_ops, cpu.io_delay);
-#endif
-}
-
void native_flush_tlb_local(void);
void native_flush_tlb_global(void);
void native_flush_tlb_one_user(unsigned long addr);
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 7ccd41628d36..3946d0f69921 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -30,8 +30,6 @@ struct pv_lazy_ops {
struct pv_cpu_ops {
/* hooks for various privileged instructions */
- void (*io_delay)(void);
-
#ifdef CONFIG_PARAVIRT_XXL
unsigned long (*get_debugreg)(int regno);
void (*set_debugreg)(int regno, unsigned long value);
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index a3e6936839b1..eee0d1a48802 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -339,7 +339,7 @@ arch_initcall(activate_jump_labels);
static void __init vmware_paravirt_ops_setup(void)
{
pv_info.name = "VMware hypervisor";
- pv_ops.cpu.io_delay = paravirt_nop;
+ pv_info.io_delay = false;
if (vmware_tsc_khz == 0)
return;
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 26ab6f8e36df..911950c9110c 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -75,12 +75,6 @@ DEFINE_PER_CPU_DECRYPTED(struct kvm_steal_time, steal_time) __aligned(64) __visi
static int has_steal_clock = 0;
static int has_guest_poll = 0;
-/*
- * No need for any "IO delay" on KVM
- */
-static void kvm_io_delay(void)
-{
-}
#define KVM_TASK_SLEEP_HASHBITS 8
#define KVM_TASK_SLEEP_HASHSIZE (1<<KVM_TASK_SLEEP_HASHBITS)
@@ -327,7 +321,7 @@ static void __init paravirt_ops_setup(void)
pv_info.name = "KVM";
if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY))
- pv_ops.cpu.io_delay = kvm_io_delay;
+ pv_info.io_delay = false;
#ifdef CONFIG_X86_IO_APIC
no_timer_check = 1;
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index a6ed52cae003..792fa96b3233 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -94,6 +94,7 @@ struct pv_info pv_info = {
#ifdef CONFIG_PARAVIRT_XXL
.extra_user_64bit_cs = __USER_CS,
#endif
+ .io_delay = true,
};
/* 64-bit pagetable entries */
@@ -101,8 +102,6 @@ struct pv_info pv_info = {
struct paravirt_patch_template pv_ops = {
/* Cpu ops. */
- .cpu.io_delay = native_io_delay,
-
#ifdef CONFIG_PARAVIRT_XXL
.cpu.cpuid = native_cpuid,
.cpu.get_debugreg = pv_native_get_debugreg,
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 8a19a88190ee..9c9695f5d158 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1046,10 +1046,6 @@ static void xen_update_io_bitmap(void)
}
#endif
-static void xen_io_delay(void)
-{
-}
-
static DEFINE_PER_CPU(unsigned long, xen_cr0_value);
static unsigned long xen_read_cr0(void)
@@ -1209,6 +1205,7 @@ void __init xen_setup_vcpu_info_placement(void)
static const struct pv_info xen_info __initconst = {
.extra_user_64bit_cs = FLAT_USER_CS64,
+ .io_delay = false,
.name = "Xen",
};
@@ -1392,7 +1389,6 @@ asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
pv_ops.cpu.invalidate_io_bitmap = xen_invalidate_io_bitmap;
pv_ops.cpu.update_io_bitmap = xen_update_io_bitmap;
#endif
- pv_ops.cpu.io_delay = xen_io_delay;
pv_ops.cpu.start_context_switch = xen_start_context_switch;
pv_ops.cpu.end_context_switch = xen_end_context_switch;
--
2.52.0
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH v4 3/6] block/floppy: Don't use REALLY_SLOW_IO for delays
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
2026-01-19 18:26 ` [PATCH v4 1/6] x86/irqflags: Fix build failure Juergen Gross
2026-01-19 18:26 ` [PATCH v4 2/6] x86/paravirt: Replace io_delay() hook with a bool Juergen Gross
@ 2026-01-19 18:26 ` Juergen Gross
2026-03-21 15:47 ` [tip: x86/cleanups] " tip-bot2 for Juergen Gross
2026-03-22 7:46 ` tip-bot2 for Juergen Gross
2026-01-19 18:26 ` [PATCH v4 4/6] x86/io: Remove REALLY_SLOW_IO handling Juergen Gross
` (5 subsequent siblings)
8 siblings, 2 replies; 23+ messages in thread
From: Juergen Gross @ 2026-01-19 18:26 UTC (permalink / raw)
To: linux-kernel, x86, linux-block
Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, H. Peter Anvin, Denis Efremov, Jens Axboe
Instead of defining REALLY_SLOW_IO before including io.h, add the
required additional calls of native_io_delay() to the related functions
in arch/x86/include/asm/floppy.h.
This will remove the last place where REALLY_SLOW_IO is being defined.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
arch/x86/include/asm/floppy.h | 27 ++++++++++++++++++++++-----
drivers/block/floppy.c | 2 --
2 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
index e7a244051c62..8d1e86687b98 100644
--- a/arch/x86/include/asm/floppy.h
+++ b/arch/x86/include/asm/floppy.h
@@ -29,9 +29,6 @@
#define CSW fd_routine[can_use_virtual_dma & 1]
-#define fd_inb(base, reg) inb_p((base) + (reg))
-#define fd_outb(value, base, reg) outb_p(value, (base) + (reg))
-
#define fd_request_dma() CSW._request_dma(FLOPPY_DMA, "floppy")
#define fd_free_dma() CSW._free_dma(FLOPPY_DMA)
#define fd_enable_irq() enable_irq(FLOPPY_IRQ)
@@ -49,6 +46,26 @@ static char *virtual_dma_addr;
static int virtual_dma_mode;
static int doing_pdma;
+static inline u8 fd_inb(u16 base, u16 reg)
+{
+ u8 ret = inb_p(base + reg);
+
+ native_io_delay();
+ native_io_delay();
+ native_io_delay();
+
+ return ret;
+}
+
+static inline void fd_outb(u8 value, u16 base, u16 reg)
+{
+ outb_p(value, base + reg);
+
+ native_io_delay();
+ native_io_delay();
+ native_io_delay();
+}
+
static irqreturn_t floppy_hardint(int irq, void *dev_id)
{
unsigned char st;
@@ -79,9 +96,9 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id)
if (st != (STATUS_DMA | STATUS_READY))
break;
if (virtual_dma_mode)
- outb_p(*lptr, virtual_dma_port + FD_DATA);
+ fd_outb(*lptr, virtual_dma_port, FD_DATA);
else
- *lptr = inb_p(virtual_dma_port + FD_DATA);
+ *lptr = fd_inb(virtual_dma_port, FD_DATA);
}
virtual_dma_count = lcount;
virtual_dma_addr = lptr;
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index c28786e0fe1c..4422bc57a4f2 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -145,8 +145,6 @@
* Better audit of register_blkdev.
*/
-#define REALLY_SLOW_IO
-
#define DEBUGT 2
#define DPRINT(format, args...) \
--
2.52.0
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH v4 4/6] x86/io: Remove REALLY_SLOW_IO handling
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
` (2 preceding siblings ...)
2026-01-19 18:26 ` [PATCH v4 3/6] block/floppy: Don't use REALLY_SLOW_IO for delays Juergen Gross
@ 2026-01-19 18:26 ` Juergen Gross
2026-03-26 8:39 ` Juergen Gross
2026-01-19 18:26 ` [PATCH v4 5/6] x86/io_delay: Switch io_delay() default mechanism to "none" Juergen Gross
` (4 subsequent siblings)
8 siblings, 1 reply; 23+ messages in thread
From: Juergen Gross @ 2026-01-19 18:26 UTC (permalink / raw)
To: linux-kernel, x86
Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, H. Peter Anvin
As there is no user of REALLY_SLOW_IO left, remove the related handling
from arch/x86/include/asm/io.h.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
arch/x86/include/asm/io.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 8a9292ce7d2d..843f23044754 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -254,11 +254,6 @@ static inline void slow_down_io(void)
return;
native_io_delay();
-#ifdef REALLY_SLOW_IO
- native_io_delay();
- native_io_delay();
- native_io_delay();
-#endif
}
#define BUILDIO(bwl, type) \
--
2.52.0
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH v4 5/6] x86/io_delay: Switch io_delay() default mechanism to "none"
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
` (3 preceding siblings ...)
2026-01-19 18:26 ` [PATCH v4 4/6] x86/io: Remove REALLY_SLOW_IO handling Juergen Gross
@ 2026-01-19 18:26 ` Juergen Gross
2026-03-20 22:02 ` Borislav Petkov
2026-01-19 18:26 ` [PATCH v4 6/6] x86/io_delay: Add config option for controlling build of io_delay Juergen Gross
` (3 subsequent siblings)
8 siblings, 1 reply; 23+ messages in thread
From: Juergen Gross @ 2026-01-19 18:26 UTC (permalink / raw)
To: linux-kernel, x86
Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, H. Peter Anvin
The habit to delay some port operations via io_delay() is probably a
no longer needed relict from i386 times.
Switch the default to no longer do delays for port operations. In case
this is breaking some still supported hardware, the default can still
be overwritten via boot parameter.
Remove the Kconfig options to select the default io_delay() mechanism.
This makes io_delay_init() a nop, so it can be removed together with
dmi_io_delay_0xed_port() and the associated
io_delay_0xed_port_dmi_table().
Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch (kind of suggested by Ingo Molnar)
---
arch/x86/Kconfig.debug | 30 --------------
arch/x86/include/asm/io.h | 1 -
arch/x86/kernel/io_delay.c | 81 +-------------------------------------
arch/x86/kernel/setup.c | 2 -
4 files changed, 1 insertion(+), 113 deletions(-)
diff --git a/arch/x86/Kconfig.debug b/arch/x86/Kconfig.debug
index c95c3aaadf97..56888156a64b 100644
--- a/arch/x86/Kconfig.debug
+++ b/arch/x86/Kconfig.debug
@@ -120,36 +120,6 @@ config X86_DECODER_SELFTEST
decoder code.
If unsure, say "N".
-choice
- prompt "IO delay type"
- default IO_DELAY_0X80
-
-config IO_DELAY_0X80
- bool "port 0x80 based port-IO delay [recommended]"
- help
- This is the traditional Linux IO delay used for in/out_p.
- It is the most tested hence safest selection here.
-
-config IO_DELAY_0XED
- bool "port 0xed based port-IO delay"
- help
- Use port 0xed as the IO delay. This frees up port 0x80 which is
- often used as a hardware-debug port.
-
-config IO_DELAY_UDELAY
- bool "udelay based port-IO delay"
- help
- Use udelay(2) as the IO delay method. This provides the delay
- while not having any side-effect on the IO port space.
-
-config IO_DELAY_NONE
- bool "no port-IO delay"
- help
- No port-IO delay. Will break on old boxes that require port-IO
- delay for certain operations. Should work on most new machines.
-
-endchoice
-
config DEBUG_BOOT_PARAMS
bool "Debug boot parameters"
depends on DEBUG_KERNEL
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 843f23044754..d50d31023385 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -240,7 +240,6 @@ static inline void __iowrite32_copy(void __iomem *to, const void *from,
extern void native_io_delay(void);
extern int io_delay_type;
-extern void io_delay_init(void);
#if defined(CONFIG_PARAVIRT)
#include <asm/paravirt-base.h>
diff --git a/arch/x86/kernel/io_delay.c b/arch/x86/kernel/io_delay.c
index fdb6506ceaaa..458e2fd9279b 100644
--- a/arch/x86/kernel/io_delay.c
+++ b/arch/x86/kernel/io_delay.c
@@ -9,8 +9,6 @@
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/delay.h>
-#include <linux/init.h>
-#include <linux/dmi.h>
#include <linux/io.h>
#define IO_DELAY_TYPE_0X80 0
@@ -18,19 +16,7 @@
#define IO_DELAY_TYPE_UDELAY 2
#define IO_DELAY_TYPE_NONE 3
-#if defined(CONFIG_IO_DELAY_0X80)
-#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_0X80
-#elif defined(CONFIG_IO_DELAY_0XED)
-#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_0XED
-#elif defined(CONFIG_IO_DELAY_UDELAY)
-#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_UDELAY
-#elif defined(CONFIG_IO_DELAY_NONE)
-#define DEFAULT_IO_DELAY_TYPE IO_DELAY_TYPE_NONE
-#endif
-
-int io_delay_type __read_mostly = DEFAULT_IO_DELAY_TYPE;
-
-static int __initdata io_delay_override;
+int io_delay_type __read_mostly = IO_DELAY_TYPE_NONE;
/*
* Paravirt wants native_io_delay to be a constant.
@@ -61,70 +47,6 @@ void native_io_delay(void)
}
EXPORT_SYMBOL(native_io_delay);
-static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id)
-{
- if (io_delay_type == IO_DELAY_TYPE_0X80) {
- pr_notice("%s: using 0xed I/O delay port\n", id->ident);
- io_delay_type = IO_DELAY_TYPE_0XED;
- }
-
- return 0;
-}
-
-/*
- * Quirk table for systems that misbehave (lock up, etc.) if port
- * 0x80 is used:
- */
-static const struct dmi_system_id io_delay_0xed_port_dmi_table[] __initconst = {
- {
- .callback = dmi_io_delay_0xed_port,
- .ident = "Compaq Presario V6000",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
- DMI_MATCH(DMI_BOARD_NAME, "30B7")
- }
- },
- {
- .callback = dmi_io_delay_0xed_port,
- .ident = "HP Pavilion dv9000z",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
- DMI_MATCH(DMI_BOARD_NAME, "30B9")
- }
- },
- {
- .callback = dmi_io_delay_0xed_port,
- .ident = "HP Pavilion dv6000",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
- DMI_MATCH(DMI_BOARD_NAME, "30B8")
- }
- },
- {
- .callback = dmi_io_delay_0xed_port,
- .ident = "HP Pavilion tx1000",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
- DMI_MATCH(DMI_BOARD_NAME, "30BF")
- }
- },
- {
- .callback = dmi_io_delay_0xed_port,
- .ident = "Presario F700",
- .matches = {
- DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"),
- DMI_MATCH(DMI_BOARD_NAME, "30D3")
- }
- },
- { }
-};
-
-void __init io_delay_init(void)
-{
- if (!io_delay_override)
- dmi_check_system(io_delay_0xed_port_dmi_table);
-}
-
static int __init io_delay_param(char *s)
{
if (!s)
@@ -141,7 +63,6 @@ static int __init io_delay_param(char *s)
else
return -EINVAL;
- io_delay_override = 1;
return 0;
}
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 1b2edd07a3e1..8ef29c1ebb8d 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -1176,8 +1176,6 @@ void __init setup_arch(char **cmdline_p)
vsmp_init();
- io_delay_init();
-
early_platform_quirks();
/* Some platforms need the APIC registered for NUMA configuration */
--
2.52.0
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCH v4 6/6] x86/io_delay: Add config option for controlling build of io_delay.
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
` (4 preceding siblings ...)
2026-01-19 18:26 ` [PATCH v4 5/6] x86/io_delay: Switch io_delay() default mechanism to "none" Juergen Gross
@ 2026-01-19 18:26 ` Juergen Gross
2026-02-02 10:27 ` [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
` (2 subsequent siblings)
8 siblings, 0 replies; 23+ messages in thread
From: Juergen Gross @ 2026-01-19 18:26 UTC (permalink / raw)
To: linux-kernel, x86
Cc: Juergen Gross, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
Dave Hansen, H. Peter Anvin
Prepare phasing out support of io_delay() by adding a config option
(default on for now) controlling the build of io_delay.c.
Signed-off-by: Juergen Gross <jgross@suse.com>
---
V2:
- new patch (kind of suggested by Ingo Molnar)
---
arch/x86/Kconfig | 8 ++++++++
arch/x86/include/asm/floppy.h | 4 ++++
arch/x86/include/asm/io.h | 6 ++++++
arch/x86/kernel/Makefile | 3 ++-
arch/x86/kernel/setup.c | 2 ++
5 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 62e11572da27..e93abd2ffeb9 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -3169,6 +3169,14 @@ config HAVE_ATOMIC_IOMAP
def_bool y
depends on X86_32
+config IO_DELAY
+ bool "Support delay of I/O-port activities"
+ default y
+ help
+ Include code allowing to delay I/O-port activities. This might be
+ needed on some rather old hardware. The delay mechanism will still
+ require to be selected via the "io_delay" boot parameter.
+
source "arch/x86/kvm/Kconfig"
source "arch/x86/Kconfig.cpufeatures"
diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
index 8d1e86687b98..d7df95255761 100644
--- a/arch/x86/include/asm/floppy.h
+++ b/arch/x86/include/asm/floppy.h
@@ -50,9 +50,11 @@ static inline u8 fd_inb(u16 base, u16 reg)
{
u8 ret = inb_p(base + reg);
+#ifdef CONFIG_IO_DELAY
native_io_delay();
native_io_delay();
native_io_delay();
+#endif
return ret;
}
@@ -61,9 +63,11 @@ static inline void fd_outb(u8 value, u16 base, u16 reg)
{
outb_p(value, base + reg);
+#ifdef CONFIG_IO_DELAY
native_io_delay();
native_io_delay();
native_io_delay();
+#endif
}
static irqreturn_t floppy_hardint(int irq, void *dev_id)
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index d50d31023385..4946f870bdb7 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -237,6 +237,7 @@ static inline void __iowrite32_copy(void __iomem *to, const void *from,
#endif /* __KERNEL__ */
+#ifdef CONFIG_IO_DELAY
extern void native_io_delay(void);
extern int io_delay_type;
@@ -254,6 +255,11 @@ static inline void slow_down_io(void)
native_io_delay();
}
+#else
+static inline void slow_down_io(void)
+{
+}
+#endif
#define BUILDIO(bwl, type) \
static inline void out##bwl##_p(type value, u16 port) \
diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile
index e9aeeeafad17..879c1b7bf7c2 100644
--- a/arch/x86/kernel/Makefile
+++ b/arch/x86/kernel/Makefile
@@ -66,11 +66,12 @@ obj-$(CONFIG_X86_32) += sys_ia32.o
obj-$(CONFIG_IA32_EMULATION) += sys_ia32.o signal_32.o
obj-$(CONFIG_X86_64) += sys_x86_64.o
obj-$(CONFIG_X86_ESPFIX64) += espfix_64.o
+obj-$(CONFIG_IO_DELAY) += io_delay.o
obj-$(CONFIG_SYSFS) += ksysfs.o
obj-y += bootflag.o e820.o
obj-y += pci-dma.o quirks.o kdebugfs.o
obj-y += alternative.o i8253.o hw_breakpoint.o
-obj-y += tsc.o tsc_msr.o io_delay.o rtc.o
+obj-y += tsc.o tsc_msr.o rtc.o
obj-y += resource.o
obj-y += irqflags.o
obj-y += static_call.o
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 8ef29c1ebb8d..a3fa38a23807 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -183,6 +183,7 @@ static const struct ctl_table x86_sysctl_table[] = {
.mode = 0444,
.proc_handler = proc_dointvec,
},
+#ifdef CONFIG_IO_DELAY
{
.procname = "io_delay_type",
.data = &io_delay_type,
@@ -190,6 +191,7 @@ static const struct ctl_table x86_sysctl_table[] = {
.mode = 0644,
.proc_handler = proc_dointvec,
},
+#endif
#if defined(CONFIG_ACPI_SLEEP)
{
.procname = "acpi_video_flags",
--
2.52.0
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v4 0/6] x86: Cleanups around slow_down_io()
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
` (5 preceding siblings ...)
2026-01-19 18:26 ` [PATCH v4 6/6] x86/io_delay: Add config option for controlling build of io_delay Juergen Gross
@ 2026-02-02 10:27 ` Juergen Gross
2026-02-09 9:11 ` Juergen Gross
2026-03-11 9:16 ` Juergen Gross
8 siblings, 0 replies; 23+ messages in thread
From: Juergen Gross @ 2026-02-02 10:27 UTC (permalink / raw)
To: linux-kernel, x86, virtualization, kvm, linux-block
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H. Peter Anvin, Ajay Kaher, Alexey Makhalov,
Broadcom internal kernel review list, Paolo Bonzini,
Vitaly Kuznetsov, Boris Ostrovsky, xen-devel, Denis Efremov,
Jens Axboe
[-- Attachment #1.1.1: Type: text/plain, Size: 2156 bytes --]
Ping?
On 19.01.26 19:26, Juergen Gross wrote:
> While looking at paravirt cleanups I stumbled over slow_down_io() and
> the related REALLY_SLOW_IO define.
>
> Do several cleanups, resulting in a deletion of REALLY_SLOW_IO and the
> io_delay() paravirt function hook.
>
> Patch 4 is removing the config options for selecting the default delay
> mechanism and sets the default to "no delay". This is in preparation of
> removing the io_delay() functionality completely, as suggested by Ingo
> Molnar.
>
> Patch 5 is adding an additional config option allowing to avoid
> building io_delay.c (default is still to build it).
>
> Changes in V2:
> - patches 2 and 3 of V1 have been applied
> - new patches 4 and 5
>
> Changes in V3:
> - rebase to tip/master kernel branch
>
> Changes in V4:
> - add patch 1 as prereq patch to the series
>
> Juergen Gross (6):
> x86/irqflags: Fix build failure
> x86/paravirt: Replace io_delay() hook with a bool
> block/floppy: Don't use REALLY_SLOW_IO for delays
> x86/io: Remove REALLY_SLOW_IO handling
> x86/io_delay: Switch io_delay() default mechanism to "none"
> x86/io_delay: Add config option for controlling build of io_delay.
>
> arch/x86/Kconfig | 8 +++
> arch/x86/Kconfig.debug | 30 ----------
> arch/x86/include/asm/floppy.h | 31 ++++++++--
> arch/x86/include/asm/io.h | 19 ++++---
> arch/x86/include/asm/irqflags.h | 6 +-
> arch/x86/include/asm/paravirt-base.h | 6 ++
> arch/x86/include/asm/paravirt.h | 11 ----
> arch/x86/include/asm/paravirt_types.h | 2 -
> arch/x86/kernel/Makefile | 3 +-
> arch/x86/kernel/cpu/vmware.c | 2 +-
> arch/x86/kernel/io_delay.c | 81 +--------------------------
> arch/x86/kernel/kvm.c | 8 +--
> arch/x86/kernel/paravirt.c | 3 +-
> arch/x86/kernel/setup.c | 4 +-
> arch/x86/xen/enlighten_pv.c | 6 +-
> drivers/block/floppy.c | 2 -
> 16 files changed, 63 insertions(+), 159 deletions(-)
>
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v4 0/6] x86: Cleanups around slow_down_io()
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
` (6 preceding siblings ...)
2026-02-02 10:27 ` [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
@ 2026-02-09 9:11 ` Juergen Gross
2026-02-09 10:19 ` Borislav Petkov
2026-03-11 9:16 ` Juergen Gross
8 siblings, 1 reply; 23+ messages in thread
From: Juergen Gross @ 2026-02-09 9:11 UTC (permalink / raw)
To: linux-kernel, x86, virtualization, kvm, linux-block
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H. Peter Anvin, Ajay Kaher, Alexey Makhalov,
Broadcom internal kernel review list, Paolo Bonzini,
Vitaly Kuznetsov, Boris Ostrovsky, xen-devel, Denis Efremov,
Jens Axboe
[-- Attachment #1.1.1: Type: text/plain, Size: 2195 bytes --]
PING?
Now 3 weeks without any reaction...
On 19.01.26 19:26, Juergen Gross wrote:
> While looking at paravirt cleanups I stumbled over slow_down_io() and
> the related REALLY_SLOW_IO define.
>
> Do several cleanups, resulting in a deletion of REALLY_SLOW_IO and the
> io_delay() paravirt function hook.
>
> Patch 4 is removing the config options for selecting the default delay
> mechanism and sets the default to "no delay". This is in preparation of
> removing the io_delay() functionality completely, as suggested by Ingo
> Molnar.
>
> Patch 5 is adding an additional config option allowing to avoid
> building io_delay.c (default is still to build it).
>
> Changes in V2:
> - patches 2 and 3 of V1 have been applied
> - new patches 4 and 5
>
> Changes in V3:
> - rebase to tip/master kernel branch
>
> Changes in V4:
> - add patch 1 as prereq patch to the series
>
> Juergen Gross (6):
> x86/irqflags: Fix build failure
> x86/paravirt: Replace io_delay() hook with a bool
> block/floppy: Don't use REALLY_SLOW_IO for delays
> x86/io: Remove REALLY_SLOW_IO handling
> x86/io_delay: Switch io_delay() default mechanism to "none"
> x86/io_delay: Add config option for controlling build of io_delay.
>
> arch/x86/Kconfig | 8 +++
> arch/x86/Kconfig.debug | 30 ----------
> arch/x86/include/asm/floppy.h | 31 ++++++++--
> arch/x86/include/asm/io.h | 19 ++++---
> arch/x86/include/asm/irqflags.h | 6 +-
> arch/x86/include/asm/paravirt-base.h | 6 ++
> arch/x86/include/asm/paravirt.h | 11 ----
> arch/x86/include/asm/paravirt_types.h | 2 -
> arch/x86/kernel/Makefile | 3 +-
> arch/x86/kernel/cpu/vmware.c | 2 +-
> arch/x86/kernel/io_delay.c | 81 +--------------------------
> arch/x86/kernel/kvm.c | 8 +--
> arch/x86/kernel/paravirt.c | 3 +-
> arch/x86/kernel/setup.c | 4 +-
> arch/x86/xen/enlighten_pv.c | 6 +-
> drivers/block/floppy.c | 2 -
> 16 files changed, 63 insertions(+), 159 deletions(-)
>
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v4 0/6] x86: Cleanups around slow_down_io()
2026-02-09 9:11 ` Juergen Gross
@ 2026-02-09 10:19 ` Borislav Petkov
0 siblings, 0 replies; 23+ messages in thread
From: Borislav Petkov @ 2026-02-09 10:19 UTC (permalink / raw)
To: Juergen Gross
Cc: linux-kernel, x86, virtualization, kvm, linux-block,
Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin,
Ajay Kaher, Alexey Makhalov,
Broadcom internal kernel review list, Paolo Bonzini,
Vitaly Kuznetsov, Boris Ostrovsky, xen-devel, Denis Efremov,
Jens Axboe
On Mon, Feb 09, 2026 at 10:11:49AM +0100, Juergen Gross wrote:
> PING?
>
> Now 3 weeks without any reaction...
Jürgen, there are other patchsets that need review too. And we have merge
window right now so no reviewing anyway.
And you know all that damn well!
How about you help us out and you start reviewing x86 patches instead of
pinging every week?
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v4 0/6] x86: Cleanups around slow_down_io()
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
` (7 preceding siblings ...)
2026-02-09 9:11 ` Juergen Gross
@ 2026-03-11 9:16 ` Juergen Gross
8 siblings, 0 replies; 23+ messages in thread
From: Juergen Gross @ 2026-03-11 9:16 UTC (permalink / raw)
To: linux-kernel, x86, virtualization, kvm, linux-block
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen,
H. Peter Anvin, Ajay Kaher, Alexey Makhalov,
Broadcom internal kernel review list, Paolo Bonzini,
Vitaly Kuznetsov, Boris Ostrovsky, xen-devel, Denis Efremov,
Jens Axboe
[-- Attachment #1.1.1: Type: text/plain, Size: 2175 bytes --]
On 19.01.26 19:26, Juergen Gross wrote:
> While looking at paravirt cleanups I stumbled over slow_down_io() and
> the related REALLY_SLOW_IO define.
>
> Do several cleanups, resulting in a deletion of REALLY_SLOW_IO and the
> io_delay() paravirt function hook.
>
> Patch 4 is removing the config options for selecting the default delay
> mechanism and sets the default to "no delay". This is in preparation of
> removing the io_delay() functionality completely, as suggested by Ingo
> Molnar.
>
> Patch 5 is adding an additional config option allowing to avoid
> building io_delay.c (default is still to build it).
>
> Changes in V2:
> - patches 2 and 3 of V1 have been applied
> - new patches 4 and 5
>
> Changes in V3:
> - rebase to tip/master kernel branch
>
> Changes in V4:
> - add patch 1 as prereq patch to the series
>
> Juergen Gross (6):
> x86/irqflags: Fix build failure
> x86/paravirt: Replace io_delay() hook with a bool
> block/floppy: Don't use REALLY_SLOW_IO for delays
> x86/io: Remove REALLY_SLOW_IO handling
> x86/io_delay: Switch io_delay() default mechanism to "none"
> x86/io_delay: Add config option for controlling build of io_delay.
>
> arch/x86/Kconfig | 8 +++
> arch/x86/Kconfig.debug | 30 ----------
> arch/x86/include/asm/floppy.h | 31 ++++++++--
> arch/x86/include/asm/io.h | 19 ++++---
> arch/x86/include/asm/irqflags.h | 6 +-
> arch/x86/include/asm/paravirt-base.h | 6 ++
> arch/x86/include/asm/paravirt.h | 11 ----
> arch/x86/include/asm/paravirt_types.h | 2 -
> arch/x86/kernel/Makefile | 3 +-
> arch/x86/kernel/cpu/vmware.c | 2 +-
> arch/x86/kernel/io_delay.c | 81 +--------------------------
> arch/x86/kernel/kvm.c | 8 +--
> arch/x86/kernel/paravirt.c | 3 +-
> arch/x86/kernel/setup.c | 4 +-
> arch/x86/xen/enlighten_pv.c | 6 +-
> drivers/block/floppy.c | 2 -
> 16 files changed, 63 insertions(+), 159 deletions(-)
>
Any comments?
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v4 5/6] x86/io_delay: Switch io_delay() default mechanism to "none"
2026-01-19 18:26 ` [PATCH v4 5/6] x86/io_delay: Switch io_delay() default mechanism to "none" Juergen Gross
@ 2026-03-20 22:02 ` Borislav Petkov
2026-03-21 6:29 ` Jürgen Groß
0 siblings, 1 reply; 23+ messages in thread
From: Borislav Petkov @ 2026-03-20 22:02 UTC (permalink / raw)
To: Juergen Gross
Cc: linux-kernel, x86, Thomas Gleixner, Ingo Molnar, Dave Hansen,
H. Peter Anvin
On Mon, Jan 19, 2026 at 07:26:31PM +0100, Juergen Gross wrote:
> The habit to delay some port operations via io_delay() is probably a
> no longer needed relict from i386 times.
>
> Switch the default to no longer do delays for port operations. In case
> this is breaking some still supported hardware, the default can still
> be overwritten via boot parameter.
So machines which worked perfectly fine until now, would break and would all
of a sudden need a cmdline param?
And when they break, how are people going to know that they need a cmdline
param?
Absurd.
No, if you don't know you're going to introduce regressions, then you simply
don't do them.
Removing something which is "probably a no longer needed relict" without
knowing whether that really is the case and then throwing users a boot param
if not, is not really what we do.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v4 5/6] x86/io_delay: Switch io_delay() default mechanism to "none"
2026-03-20 22:02 ` Borislav Petkov
@ 2026-03-21 6:29 ` Jürgen Groß
2026-03-21 11:32 ` Borislav Petkov
0 siblings, 1 reply; 23+ messages in thread
From: Jürgen Groß @ 2026-03-21 6:29 UTC (permalink / raw)
To: Borislav Petkov
Cc: linux-kernel, x86, Thomas Gleixner, Ingo Molnar, Dave Hansen,
H. Peter Anvin
[-- Attachment #1.1.1: Type: text/plain, Size: 809 bytes --]
On 20.03.26 23:02, Borislav Petkov wrote:
> On Mon, Jan 19, 2026 at 07:26:31PM +0100, Juergen Gross wrote:
>> The habit to delay some port operations via io_delay() is probably a
>> no longer needed relict from i386 times.
>>
>> Switch the default to no longer do delays for port operations. In case
>> this is breaking some still supported hardware, the default can still
>> be overwritten via boot parameter.
>
> So machines which worked perfectly fine until now, would break and would all
> of a sudden need a cmdline param?
This patch is the result of a suggestion by Ingo [1]. He even wanted to rip out
the io_delay() code completely.
If you don't like that, we can just drop patches 5 and 6 of the series.
Juergen
[1]: https://lore.kernel.org/lkml/aUFjRDqbfWMsXvvS@gmail.com/
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v4 5/6] x86/io_delay: Switch io_delay() default mechanism to "none"
2026-03-21 6:29 ` Jürgen Groß
@ 2026-03-21 11:32 ` Borislav Petkov
0 siblings, 0 replies; 23+ messages in thread
From: Borislav Petkov @ 2026-03-21 11:32 UTC (permalink / raw)
To: Jürgen Groß
Cc: linux-kernel, x86, Thomas Gleixner, Ingo Molnar, Dave Hansen,
H. Peter Anvin
On Sat, Mar 21, 2026 at 07:29:11AM +0100, Jürgen Groß wrote:
> This patch is the result of a suggestion by Ingo [1]. He even wanted to rip out
> the io_delay() code completely.
>
> If you don't like that, we can just drop patches 5 and 6 of the series.
Yes, I'll test 1-4 some more and queue them.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 23+ messages in thread
* [tip: x86/cleanups] block/floppy: Don't use REALLY_SLOW_IO for delays
2026-01-19 18:26 ` [PATCH v4 3/6] block/floppy: Don't use REALLY_SLOW_IO for delays Juergen Gross
@ 2026-03-21 15:47 ` tip-bot2 for Juergen Gross
2026-03-22 7:46 ` tip-bot2 for Juergen Gross
1 sibling, 0 replies; 23+ messages in thread
From: tip-bot2 for Juergen Gross @ 2026-03-21 15:47 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Juergen Gross, Borislav Petkov (AMD), x86, linux-kernel
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 00c5f98db0e3a109331de89a42081cd9cdad8ec1
Gitweb: https://git.kernel.org/tip/00c5f98db0e3a109331de89a42081cd9cdad8ec1
Author: Juergen Gross <jgross@suse.com>
AuthorDate: Mon, 19 Jan 2026 19:26:29 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Sat, 21 Mar 2026 12:36:41 +01:00
block/floppy: Don't use REALLY_SLOW_IO for delays
Instead of defining REALLY_SLOW_IO before including io.h, add the
required additional calls of native_io_delay() to the related functions
in arch/x86/include/asm/floppy.h.
Drop REALLY_SLOW_IO now too as it has no users.
[ bp: Merge the REALLY_SLOW_IO removal into this patch. ]
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260119182632.596369-4-jgross@suse.com
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
---
arch/x86/include/asm/floppy.h | 27 ++++++++++++++++++++++-----
arch/x86/include/asm/io.h | 5 -----
drivers/block/floppy.c | 2 --
3 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
index e7a2440..8d1e866 100644
--- a/arch/x86/include/asm/floppy.h
+++ b/arch/x86/include/asm/floppy.h
@@ -29,9 +29,6 @@
#define CSW fd_routine[can_use_virtual_dma & 1]
-#define fd_inb(base, reg) inb_p((base) + (reg))
-#define fd_outb(value, base, reg) outb_p(value, (base) + (reg))
-
#define fd_request_dma() CSW._request_dma(FLOPPY_DMA, "floppy")
#define fd_free_dma() CSW._free_dma(FLOPPY_DMA)
#define fd_enable_irq() enable_irq(FLOPPY_IRQ)
@@ -49,6 +46,26 @@ static char *virtual_dma_addr;
static int virtual_dma_mode;
static int doing_pdma;
+static inline u8 fd_inb(u16 base, u16 reg)
+{
+ u8 ret = inb_p(base + reg);
+
+ native_io_delay();
+ native_io_delay();
+ native_io_delay();
+
+ return ret;
+}
+
+static inline void fd_outb(u8 value, u16 base, u16 reg)
+{
+ outb_p(value, base + reg);
+
+ native_io_delay();
+ native_io_delay();
+ native_io_delay();
+}
+
static irqreturn_t floppy_hardint(int irq, void *dev_id)
{
unsigned char st;
@@ -79,9 +96,9 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id)
if (st != (STATUS_DMA | STATUS_READY))
break;
if (virtual_dma_mode)
- outb_p(*lptr, virtual_dma_port + FD_DATA);
+ fd_outb(*lptr, virtual_dma_port, FD_DATA);
else
- *lptr = inb_p(virtual_dma_port + FD_DATA);
+ *lptr = fd_inb(virtual_dma_port, FD_DATA);
}
virtual_dma_count = lcount;
virtual_dma_addr = lptr;
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 4179a2e..7f4847b 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -253,11 +253,6 @@ static inline void slow_down_io(void)
return;
native_io_delay();
-#ifdef REALLY_SLOW_IO
- native_io_delay();
- native_io_delay();
- native_io_delay();
-#endif
}
#define BUILDIO(bwl, type) \
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 92e446a..0509746 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -145,8 +145,6 @@
* Better audit of register_blkdev.
*/
-#define REALLY_SLOW_IO
-
#define DEBUGT 2
#define DPRINT(format, args...) \
^ permalink raw reply [flat|nested] 23+ messages in thread
* [tip: x86/cleanups] x86/paravirt: Replace io_delay() hook with a bool
2026-01-19 18:26 ` [PATCH v4 2/6] x86/paravirt: Replace io_delay() hook with a bool Juergen Gross
@ 2026-03-21 15:47 ` tip-bot2 for Juergen Gross
2026-03-22 7:46 ` tip-bot2 for Juergen Gross
1 sibling, 0 replies; 23+ messages in thread
From: tip-bot2 for Juergen Gross @ 2026-03-21 15:47 UTC (permalink / raw)
To: linux-tip-commits; +Cc: Juergen Gross, Borislav Petkov (AMD), x86, linux-kernel
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 11cff44c45f797cb7e3f75bfb9610d6b2a89ad3a
Gitweb: https://git.kernel.org/tip/11cff44c45f797cb7e3f75bfb9610d6b2a89ad3a
Author: Juergen Gross <jgross@suse.com>
AuthorDate: Mon, 19 Jan 2026 19:26:28 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Sat, 21 Mar 2026 12:36:41 +01:00
x86/paravirt: Replace io_delay() hook with a bool
The io_delay() paravirt hook is in no way performance critical and all users
setting it to a different function than native_io_delay() are using an empty
function as replacement.
Allow replacing the hook with a bool indicating whether native_io_delay()
should be called.
[ bp: Massage commit message. ]
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260119182632.596369-3-jgross@suse.com
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
---
arch/x86/include/asm/io.h | 9 ++++++---
arch/x86/include/asm/paravirt-base.h | 6 ++++++
arch/x86/include/asm/paravirt.h | 11 -----------
arch/x86/include/asm/paravirt_types.h | 2 --
arch/x86/kernel/cpu/vmware.c | 2 +-
arch/x86/kernel/kvm.c | 8 +-------
arch/x86/kernel/paravirt.c | 3 +--
arch/x86/xen/enlighten_pv.c | 6 +-----
8 files changed, 16 insertions(+), 31 deletions(-)
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 2ea2574..4179a2e 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -242,11 +242,16 @@ extern int io_delay_type;
extern void io_delay_init(void);
#if defined(CONFIG_PARAVIRT)
-#include <asm/paravirt.h>
+#include <asm/paravirt-base.h>
#else
+#define call_io_delay() true
+#endif
static inline void slow_down_io(void)
{
+ if (!call_io_delay())
+ return;
+
native_io_delay();
#ifdef REALLY_SLOW_IO
native_io_delay();
@@ -255,8 +260,6 @@ static inline void slow_down_io(void)
#endif
}
-#endif
-
#define BUILDIO(bwl, type) \
static inline void out##bwl##_p(type value, u16 port) \
{ \
diff --git a/arch/x86/include/asm/paravirt-base.h b/arch/x86/include/asm/paravirt-base.h
index 982a0b9..3b9e777 100644
--- a/arch/x86/include/asm/paravirt-base.h
+++ b/arch/x86/include/asm/paravirt-base.h
@@ -15,6 +15,8 @@ struct pv_info {
#ifdef CONFIG_PARAVIRT_XXL
u16 extra_user_64bit_cs; /* __USER_CS if none */
#endif
+ bool io_delay;
+
const char *name;
};
@@ -26,6 +28,10 @@ u64 _paravirt_ident_64(u64);
#endif
#define paravirt_nop ((void *)nop_func)
+#ifdef CONFIG_PARAVIRT
+#define call_io_delay() pv_info.io_delay
+#endif
+
#ifdef CONFIG_PARAVIRT_SPINLOCKS
void paravirt_set_cap(void);
#else
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index fcf8ab5..cdfe400 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -19,17 +19,6 @@
#include <linux/cpumask.h>
#include <asm/frame.h>
-/* The paravirtualized I/O functions */
-static inline void slow_down_io(void)
-{
- PVOP_VCALL0(pv_ops, cpu.io_delay);
-#ifdef REALLY_SLOW_IO
- PVOP_VCALL0(pv_ops, cpu.io_delay);
- PVOP_VCALL0(pv_ops, cpu.io_delay);
- PVOP_VCALL0(pv_ops, cpu.io_delay);
-#endif
-}
-
void native_flush_tlb_local(void);
void native_flush_tlb_global(void);
void native_flush_tlb_one_user(unsigned long addr);
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 9bcf6bc..4f5ae00 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -30,8 +30,6 @@ struct pv_lazy_ops {
struct pv_cpu_ops {
/* hooks for various privileged instructions */
- void (*io_delay)(void);
-
#ifdef CONFIG_PARAVIRT_XXL
unsigned long (*get_debugreg)(int regno);
void (*set_debugreg)(int regno, unsigned long value);
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index a3e6936..eee0d1a 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -339,7 +339,7 @@ arch_initcall(activate_jump_labels);
static void __init vmware_paravirt_ops_setup(void)
{
pv_info.name = "VMware hypervisor";
- pv_ops.cpu.io_delay = paravirt_nop;
+ pv_info.io_delay = false;
if (vmware_tsc_khz == 0)
return;
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 3bc0623..29226d1 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -75,12 +75,6 @@ DEFINE_PER_CPU_DECRYPTED(struct kvm_steal_time, steal_time) __aligned(64) __visi
static int has_steal_clock = 0;
static int has_guest_poll = 0;
-/*
- * No need for any "IO delay" on KVM
- */
-static void kvm_io_delay(void)
-{
-}
#define KVM_TASK_SLEEP_HASHBITS 8
#define KVM_TASK_SLEEP_HASHSIZE (1<<KVM_TASK_SLEEP_HASHBITS)
@@ -327,7 +321,7 @@ static void __init paravirt_ops_setup(void)
pv_info.name = "KVM";
if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY))
- pv_ops.cpu.io_delay = kvm_io_delay;
+ pv_info.io_delay = false;
#ifdef CONFIG_X86_IO_APIC
no_timer_check = 1;
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index a6ed52c..792fa96 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -94,6 +94,7 @@ struct pv_info pv_info = {
#ifdef CONFIG_PARAVIRT_XXL
.extra_user_64bit_cs = __USER_CS,
#endif
+ .io_delay = true,
};
/* 64-bit pagetable entries */
@@ -101,8 +102,6 @@ struct pv_info pv_info = {
struct paravirt_patch_template pv_ops = {
/* Cpu ops. */
- .cpu.io_delay = native_io_delay,
-
#ifdef CONFIG_PARAVIRT_XXL
.cpu.cpuid = native_cpuid,
.cpu.get_debugreg = pv_native_get_debugreg,
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 6e459e4..0a6a50f 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1045,10 +1045,6 @@ static void xen_update_io_bitmap(void)
}
#endif
-static void xen_io_delay(void)
-{
-}
-
static DEFINE_PER_CPU(unsigned long, xen_cr0_value);
static unsigned long xen_read_cr0(void)
@@ -1208,6 +1204,7 @@ void __init xen_setup_vcpu_info_placement(void)
static const struct pv_info xen_info __initconst = {
.extra_user_64bit_cs = FLAT_USER_CS64,
+ .io_delay = false,
.name = "Xen",
};
@@ -1391,7 +1388,6 @@ asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
pv_ops.cpu.invalidate_io_bitmap = xen_invalidate_io_bitmap;
pv_ops.cpu.update_io_bitmap = xen_update_io_bitmap;
#endif
- pv_ops.cpu.io_delay = xen_io_delay;
pv_ops.cpu.start_context_switch = xen_start_context_switch;
pv_ops.cpu.end_context_switch = xen_end_context_switch;
^ permalink raw reply [flat|nested] 23+ messages in thread
* [tip: x86/cleanups] x86/irqflags: Preemptively move include paravirt.h directive where it belongs
2026-01-19 18:26 ` [PATCH v4 1/6] x86/irqflags: Fix build failure Juergen Gross
@ 2026-03-21 15:47 ` tip-bot2 for Juergen Gross
2026-03-22 7:47 ` tip-bot2 for Juergen Gross
1 sibling, 0 replies; 23+ messages in thread
From: tip-bot2 for Juergen Gross @ 2026-03-21 15:47 UTC (permalink / raw)
To: linux-tip-commits
Cc: kernel test robot, Juergen Gross, Borislav Petkov (AMD),
x86, linux-kernel
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 9cf31fe0f8e0edf35d534bd531a701d6f310d0e5
Gitweb: https://git.kernel.org/tip/9cf31fe0f8e0edf35d534bd531a701d6f310d0e5
Author: Juergen Gross <jgross@suse.com>
AuthorDate: Mon, 19 Jan 2026 19:26:27 +01:00
Committer: Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Sat, 21 Mar 2026 12:36:41 +01:00
x86/irqflags: Preemptively move include paravirt.h directive where it belongs
Commit
22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT")
moved some paravirt hooks from the CONFIG_PARAVIRT_XXL umbrella to
CONFIG_PARAVIRT, but missed to move the associated "#include <asm/paravirt.h>"
in irqflags.h from CONFIG_PARAVIRT_XXL to CONFIG_PARAVIRT.
This hasn't resulted in build failures yet, as all use cases of irqflags.h had
paravirt.h included via other header files, even without CONFIG_PARAVIRT_XXL
being set.
In order to allow changing those other header files, e.g. by no longer
including paravirt.h, fix irqflags.h by moving inclusion of paravirt.h under
the CONFIG_PARAVIRT umbrella.
[ bp: Massage commit message. ]
Fixes: 22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT")
Closes: https://lore.kernel.org/oe-kbuild-all/202601152203.plJOoOEF-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://patch.msgid.link/20260119182632.596369-2-jgross@suse.com
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
---
arch/x86/include/asm/irqflags.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index 462754b..6f25de0 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -96,11 +96,11 @@ static __always_inline void halt(void)
native_halt();
}
#endif /* __ASSEMBLER__ */
+#else
+#include <asm/paravirt.h>
#endif /* CONFIG_PARAVIRT */
-#ifdef CONFIG_PARAVIRT_XXL
-#include <asm/paravirt.h>
-#else
+#ifndef CONFIG_PARAVIRT_XXL
#ifndef __ASSEMBLER__
#include <linux/types.h>
^ permalink raw reply [flat|nested] 23+ messages in thread
* [tip: x86/cleanups] block/floppy: Don't use REALLY_SLOW_IO for delays
2026-01-19 18:26 ` [PATCH v4 3/6] block/floppy: Don't use REALLY_SLOW_IO for delays Juergen Gross
2026-03-21 15:47 ` [tip: x86/cleanups] " tip-bot2 for Juergen Gross
@ 2026-03-22 7:46 ` tip-bot2 for Juergen Gross
1 sibling, 0 replies; 23+ messages in thread
From: tip-bot2 for Juergen Gross @ 2026-03-22 7:46 UTC (permalink / raw)
To: linux-tip-commits
Cc: Juergen Gross, Borislav Petkov (AMD), Ingo Molnar, x86, linux-kernel
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 2219ec23b6cf4ba6e6e23f43601e859f9eaaa24d
Gitweb: https://git.kernel.org/tip/2219ec23b6cf4ba6e6e23f43601e859f9eaaa24d
Author: Juergen Gross <jgross@suse.com>
AuthorDate: Mon, 19 Jan 2026 19:26:29 +01:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Sun, 22 Mar 2026 08:43:23 +01:00
block/floppy: Don't use REALLY_SLOW_IO for delays
Instead of defining REALLY_SLOW_IO before including io.h, add the
required additional calls of native_io_delay() to the related functions
in arch/x86/include/asm/floppy.h.
Drop REALLY_SLOW_IO now too as it has no users.
[ bp: Merge the REALLY_SLOW_IO removal into this patch. ]
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20260119182632.596369-4-jgross@suse.com
---
arch/x86/include/asm/floppy.h | 27 ++++++++++++++++++++++-----
arch/x86/include/asm/io.h | 5 -----
drivers/block/floppy.c | 2 --
3 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/arch/x86/include/asm/floppy.h b/arch/x86/include/asm/floppy.h
index e7a2440..8d1e866 100644
--- a/arch/x86/include/asm/floppy.h
+++ b/arch/x86/include/asm/floppy.h
@@ -29,9 +29,6 @@
#define CSW fd_routine[can_use_virtual_dma & 1]
-#define fd_inb(base, reg) inb_p((base) + (reg))
-#define fd_outb(value, base, reg) outb_p(value, (base) + (reg))
-
#define fd_request_dma() CSW._request_dma(FLOPPY_DMA, "floppy")
#define fd_free_dma() CSW._free_dma(FLOPPY_DMA)
#define fd_enable_irq() enable_irq(FLOPPY_IRQ)
@@ -49,6 +46,26 @@ static char *virtual_dma_addr;
static int virtual_dma_mode;
static int doing_pdma;
+static inline u8 fd_inb(u16 base, u16 reg)
+{
+ u8 ret = inb_p(base + reg);
+
+ native_io_delay();
+ native_io_delay();
+ native_io_delay();
+
+ return ret;
+}
+
+static inline void fd_outb(u8 value, u16 base, u16 reg)
+{
+ outb_p(value, base + reg);
+
+ native_io_delay();
+ native_io_delay();
+ native_io_delay();
+}
+
static irqreturn_t floppy_hardint(int irq, void *dev_id)
{
unsigned char st;
@@ -79,9 +96,9 @@ static irqreturn_t floppy_hardint(int irq, void *dev_id)
if (st != (STATUS_DMA | STATUS_READY))
break;
if (virtual_dma_mode)
- outb_p(*lptr, virtual_dma_port + FD_DATA);
+ fd_outb(*lptr, virtual_dma_port, FD_DATA);
else
- *lptr = inb_p(virtual_dma_port + FD_DATA);
+ *lptr = fd_inb(virtual_dma_port, FD_DATA);
}
virtual_dma_count = lcount;
virtual_dma_addr = lptr;
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 4179a2e..7f4847b 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -253,11 +253,6 @@ static inline void slow_down_io(void)
return;
native_io_delay();
-#ifdef REALLY_SLOW_IO
- native_io_delay();
- native_io_delay();
- native_io_delay();
-#endif
}
#define BUILDIO(bwl, type) \
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
index 92e446a..0509746 100644
--- a/drivers/block/floppy.c
+++ b/drivers/block/floppy.c
@@ -145,8 +145,6 @@
* Better audit of register_blkdev.
*/
-#define REALLY_SLOW_IO
-
#define DEBUGT 2
#define DPRINT(format, args...) \
^ permalink raw reply [flat|nested] 23+ messages in thread
* [tip: x86/cleanups] x86/paravirt: Replace io_delay() hook with a bool
2026-01-19 18:26 ` [PATCH v4 2/6] x86/paravirt: Replace io_delay() hook with a bool Juergen Gross
2026-03-21 15:47 ` [tip: x86/cleanups] " tip-bot2 for Juergen Gross
@ 2026-03-22 7:46 ` tip-bot2 for Juergen Gross
1 sibling, 0 replies; 23+ messages in thread
From: tip-bot2 for Juergen Gross @ 2026-03-22 7:46 UTC (permalink / raw)
To: linux-tip-commits
Cc: Juergen Gross, Borislav Petkov (AMD), Ingo Molnar, x86, linux-kernel
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 9eece498565c3fd5f37efe58498779efd39f2269
Gitweb: https://git.kernel.org/tip/9eece498565c3fd5f37efe58498779efd39f2269
Author: Juergen Gross <jgross@suse.com>
AuthorDate: Mon, 19 Jan 2026 19:26:28 +01:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Sun, 22 Mar 2026 08:43:05 +01:00
x86/paravirt: Replace io_delay() hook with a bool
The io_delay() paravirt hook is in no way performance critical and all users
setting it to a different function than native_io_delay() are using an empty
function as replacement.
Allow replacing the hook with a bool indicating whether native_io_delay()
should be called.
[ bp: Massage commit message. ]
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20260119182632.596369-3-jgross@suse.com
---
arch/x86/include/asm/io.h | 9 ++++++---
arch/x86/include/asm/paravirt-base.h | 6 ++++++
arch/x86/include/asm/paravirt.h | 11 -----------
arch/x86/include/asm/paravirt_types.h | 2 --
arch/x86/kernel/cpu/vmware.c | 2 +-
arch/x86/kernel/kvm.c | 8 +-------
arch/x86/kernel/paravirt.c | 3 +--
arch/x86/xen/enlighten_pv.c | 6 +-----
8 files changed, 16 insertions(+), 31 deletions(-)
diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index 2ea2574..4179a2e 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -242,11 +242,16 @@ extern int io_delay_type;
extern void io_delay_init(void);
#if defined(CONFIG_PARAVIRT)
-#include <asm/paravirt.h>
+#include <asm/paravirt-base.h>
#else
+#define call_io_delay() true
+#endif
static inline void slow_down_io(void)
{
+ if (!call_io_delay())
+ return;
+
native_io_delay();
#ifdef REALLY_SLOW_IO
native_io_delay();
@@ -255,8 +260,6 @@ static inline void slow_down_io(void)
#endif
}
-#endif
-
#define BUILDIO(bwl, type) \
static inline void out##bwl##_p(type value, u16 port) \
{ \
diff --git a/arch/x86/include/asm/paravirt-base.h b/arch/x86/include/asm/paravirt-base.h
index 982a0b9..3b9e777 100644
--- a/arch/x86/include/asm/paravirt-base.h
+++ b/arch/x86/include/asm/paravirt-base.h
@@ -15,6 +15,8 @@ struct pv_info {
#ifdef CONFIG_PARAVIRT_XXL
u16 extra_user_64bit_cs; /* __USER_CS if none */
#endif
+ bool io_delay;
+
const char *name;
};
@@ -26,6 +28,10 @@ u64 _paravirt_ident_64(u64);
#endif
#define paravirt_nop ((void *)nop_func)
+#ifdef CONFIG_PARAVIRT
+#define call_io_delay() pv_info.io_delay
+#endif
+
#ifdef CONFIG_PARAVIRT_SPINLOCKS
void paravirt_set_cap(void);
#else
diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
index fcf8ab5..cdfe400 100644
--- a/arch/x86/include/asm/paravirt.h
+++ b/arch/x86/include/asm/paravirt.h
@@ -19,17 +19,6 @@
#include <linux/cpumask.h>
#include <asm/frame.h>
-/* The paravirtualized I/O functions */
-static inline void slow_down_io(void)
-{
- PVOP_VCALL0(pv_ops, cpu.io_delay);
-#ifdef REALLY_SLOW_IO
- PVOP_VCALL0(pv_ops, cpu.io_delay);
- PVOP_VCALL0(pv_ops, cpu.io_delay);
- PVOP_VCALL0(pv_ops, cpu.io_delay);
-#endif
-}
-
void native_flush_tlb_local(void);
void native_flush_tlb_global(void);
void native_flush_tlb_one_user(unsigned long addr);
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h
index 9bcf6bc..4f5ae00 100644
--- a/arch/x86/include/asm/paravirt_types.h
+++ b/arch/x86/include/asm/paravirt_types.h
@@ -30,8 +30,6 @@ struct pv_lazy_ops {
struct pv_cpu_ops {
/* hooks for various privileged instructions */
- void (*io_delay)(void);
-
#ifdef CONFIG_PARAVIRT_XXL
unsigned long (*get_debugreg)(int regno);
void (*set_debugreg)(int regno, unsigned long value);
diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
index a3e6936..eee0d1a 100644
--- a/arch/x86/kernel/cpu/vmware.c
+++ b/arch/x86/kernel/cpu/vmware.c
@@ -339,7 +339,7 @@ arch_initcall(activate_jump_labels);
static void __init vmware_paravirt_ops_setup(void)
{
pv_info.name = "VMware hypervisor";
- pv_ops.cpu.io_delay = paravirt_nop;
+ pv_info.io_delay = false;
if (vmware_tsc_khz == 0)
return;
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index 3bc0623..29226d1 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -75,12 +75,6 @@ DEFINE_PER_CPU_DECRYPTED(struct kvm_steal_time, steal_time) __aligned(64) __visi
static int has_steal_clock = 0;
static int has_guest_poll = 0;
-/*
- * No need for any "IO delay" on KVM
- */
-static void kvm_io_delay(void)
-{
-}
#define KVM_TASK_SLEEP_HASHBITS 8
#define KVM_TASK_SLEEP_HASHSIZE (1<<KVM_TASK_SLEEP_HASHBITS)
@@ -327,7 +321,7 @@ static void __init paravirt_ops_setup(void)
pv_info.name = "KVM";
if (kvm_para_has_feature(KVM_FEATURE_NOP_IO_DELAY))
- pv_ops.cpu.io_delay = kvm_io_delay;
+ pv_info.io_delay = false;
#ifdef CONFIG_X86_IO_APIC
no_timer_check = 1;
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c
index a6ed52c..792fa96 100644
--- a/arch/x86/kernel/paravirt.c
+++ b/arch/x86/kernel/paravirt.c
@@ -94,6 +94,7 @@ struct pv_info pv_info = {
#ifdef CONFIG_PARAVIRT_XXL
.extra_user_64bit_cs = __USER_CS,
#endif
+ .io_delay = true,
};
/* 64-bit pagetable entries */
@@ -101,8 +102,6 @@ struct pv_info pv_info = {
struct paravirt_patch_template pv_ops = {
/* Cpu ops. */
- .cpu.io_delay = native_io_delay,
-
#ifdef CONFIG_PARAVIRT_XXL
.cpu.cpuid = native_cpuid,
.cpu.get_debugreg = pv_native_get_debugreg,
diff --git a/arch/x86/xen/enlighten_pv.c b/arch/x86/xen/enlighten_pv.c
index 6e459e4..0a6a50f 100644
--- a/arch/x86/xen/enlighten_pv.c
+++ b/arch/x86/xen/enlighten_pv.c
@@ -1045,10 +1045,6 @@ static void xen_update_io_bitmap(void)
}
#endif
-static void xen_io_delay(void)
-{
-}
-
static DEFINE_PER_CPU(unsigned long, xen_cr0_value);
static unsigned long xen_read_cr0(void)
@@ -1208,6 +1204,7 @@ void __init xen_setup_vcpu_info_placement(void)
static const struct pv_info xen_info __initconst = {
.extra_user_64bit_cs = FLAT_USER_CS64,
+ .io_delay = false,
.name = "Xen",
};
@@ -1391,7 +1388,6 @@ asmlinkage __visible void __init xen_start_kernel(struct start_info *si)
pv_ops.cpu.invalidate_io_bitmap = xen_invalidate_io_bitmap;
pv_ops.cpu.update_io_bitmap = xen_update_io_bitmap;
#endif
- pv_ops.cpu.io_delay = xen_io_delay;
pv_ops.cpu.start_context_switch = xen_start_context_switch;
pv_ops.cpu.end_context_switch = xen_end_context_switch;
^ permalink raw reply [flat|nested] 23+ messages in thread
* [tip: x86/cleanups] x86/irqflags: Preemptively move include paravirt.h directive where it belongs
2026-01-19 18:26 ` [PATCH v4 1/6] x86/irqflags: Fix build failure Juergen Gross
2026-03-21 15:47 ` [tip: x86/cleanups] x86/irqflags: Preemptively move include paravirt.h directive where it belongs tip-bot2 for Juergen Gross
@ 2026-03-22 7:47 ` tip-bot2 for Juergen Gross
1 sibling, 0 replies; 23+ messages in thread
From: tip-bot2 for Juergen Gross @ 2026-03-22 7:47 UTC (permalink / raw)
To: linux-tip-commits
Cc: kernel test robot, Juergen Gross, Borislav Petkov (AMD),
Ingo Molnar, x86, linux-kernel
The following commit has been merged into the x86/cleanups branch of tip:
Commit-ID: 36c1eb9531e0c9bdcb3494142123f1c1e128367b
Gitweb: https://git.kernel.org/tip/36c1eb9531e0c9bdcb3494142123f1c1e128367b
Author: Juergen Gross <jgross@suse.com>
AuthorDate: Mon, 19 Jan 2026 19:26:27 +01:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Sun, 22 Mar 2026 08:42:44 +01:00
x86/irqflags: Preemptively move include paravirt.h directive where it belongs
Commit
22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT")
moved some paravirt hooks from the CONFIG_PARAVIRT_XXL umbrella to
CONFIG_PARAVIRT, but missed to move the associated "#include <asm/paravirt.h>"
in irqflags.h from CONFIG_PARAVIRT_XXL to CONFIG_PARAVIRT.
This hasn't resulted in build failures yet, as all use cases of irqflags.h had
paravirt.h included via other header files, even without CONFIG_PARAVIRT_XXL
being set.
In order to allow changing those other header files, e.g. by no longer
including paravirt.h, fix irqflags.h by moving inclusion of paravirt.h under
the CONFIG_PARAVIRT umbrella.
[ bp: Massage commit message. ]
Fixes: 22cc5ca5de52 ("x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT")
Closes: https://lore.kernel.org/oe-kbuild-all/202601152203.plJOoOEF-lkp@intel.com/
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20260119182632.596369-2-jgross@suse.com
---
arch/x86/include/asm/irqflags.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/include/asm/irqflags.h b/arch/x86/include/asm/irqflags.h
index 462754b..6f25de0 100644
--- a/arch/x86/include/asm/irqflags.h
+++ b/arch/x86/include/asm/irqflags.h
@@ -96,11 +96,11 @@ static __always_inline void halt(void)
native_halt();
}
#endif /* __ASSEMBLER__ */
+#else
+#include <asm/paravirt.h>
#endif /* CONFIG_PARAVIRT */
-#ifdef CONFIG_PARAVIRT_XXL
-#include <asm/paravirt.h>
-#else
+#ifndef CONFIG_PARAVIRT_XXL
#ifndef __ASSEMBLER__
#include <linux/types.h>
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v4 4/6] x86/io: Remove REALLY_SLOW_IO handling
2026-01-19 18:26 ` [PATCH v4 4/6] x86/io: Remove REALLY_SLOW_IO handling Juergen Gross
@ 2026-03-26 8:39 ` Juergen Gross
2026-03-26 10:04 ` Borislav Petkov
0 siblings, 1 reply; 23+ messages in thread
From: Juergen Gross @ 2026-03-26 8:39 UTC (permalink / raw)
To: linux-kernel, x86, Borislav Petkov
Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, H. Peter Anvin
[-- Attachment #1.1.1: Type: text/plain, Size: 821 bytes --]
Boris,
On 19.01.26 19:26, Juergen Gross wrote:
> As there is no user of REALLY_SLOW_IO left, remove the related handling
> from arch/x86/include/asm/io.h.
>
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> arch/x86/include/asm/io.h | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
> index 8a9292ce7d2d..843f23044754 100644
> --- a/arch/x86/include/asm/io.h
> +++ b/arch/x86/include/asm/io.h
> @@ -254,11 +254,6 @@ static inline void slow_down_io(void)
> return;
>
> native_io_delay();
> -#ifdef REALLY_SLOW_IO
> - native_io_delay();
> - native_io_delay();
> - native_io_delay();
> -#endif
> }
>
> #define BUILDIO(bwl, type) \
any special reason you didn't take this one, too?
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v4 4/6] x86/io: Remove REALLY_SLOW_IO handling
2026-03-26 8:39 ` Juergen Gross
@ 2026-03-26 10:04 ` Borislav Petkov
2026-03-26 10:23 ` Jürgen Groß
0 siblings, 1 reply; 23+ messages in thread
From: Borislav Petkov @ 2026-03-26 10:04 UTC (permalink / raw)
To: Juergen Gross
Cc: linux-kernel, x86, Thomas Gleixner, Ingo Molnar, Dave Hansen,
H. Peter Anvin
On Thu, Mar 26, 2026 at 09:39:31AM +0100, Juergen Gross wrote:
> any special reason you didn't take this one, too?
https://git.kernel.org/tip/2219ec23b6cf4ba6e6e23f43601e859f9eaaa24d
"[ bp: Merge the REALLY_SLOW_IO removal into this patch. ]"
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCH v4 4/6] x86/io: Remove REALLY_SLOW_IO handling
2026-03-26 10:04 ` Borislav Petkov
@ 2026-03-26 10:23 ` Jürgen Groß
0 siblings, 0 replies; 23+ messages in thread
From: Jürgen Groß @ 2026-03-26 10:23 UTC (permalink / raw)
To: Borislav Petkov
Cc: linux-kernel, x86, Thomas Gleixner, Ingo Molnar, Dave Hansen,
H. Peter Anvin
[-- Attachment #1.1.1: Type: text/plain, Size: 404 bytes --]
On 26.03.26 11:04, Borislav Petkov wrote:
> On Thu, Mar 26, 2026 at 09:39:31AM +0100, Juergen Gross wrote:
>> any special reason you didn't take this one, too?
>
> https://git.kernel.org/tip/2219ec23b6cf4ba6e6e23f43601e859f9eaaa24d
>
> "[ bp: Merge the REALLY_SLOW_IO removal into this patch. ]"
>
Ah, thanks, didn't look into the committed patches.
Sorry for the noise,
Juergen
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 3743 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 495 bytes --]
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2026-03-26 10:23 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-19 18:26 [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
2026-01-19 18:26 ` [PATCH v4 1/6] x86/irqflags: Fix build failure Juergen Gross
2026-03-21 15:47 ` [tip: x86/cleanups] x86/irqflags: Preemptively move include paravirt.h directive where it belongs tip-bot2 for Juergen Gross
2026-03-22 7:47 ` tip-bot2 for Juergen Gross
2026-01-19 18:26 ` [PATCH v4 2/6] x86/paravirt: Replace io_delay() hook with a bool Juergen Gross
2026-03-21 15:47 ` [tip: x86/cleanups] " tip-bot2 for Juergen Gross
2026-03-22 7:46 ` tip-bot2 for Juergen Gross
2026-01-19 18:26 ` [PATCH v4 3/6] block/floppy: Don't use REALLY_SLOW_IO for delays Juergen Gross
2026-03-21 15:47 ` [tip: x86/cleanups] " tip-bot2 for Juergen Gross
2026-03-22 7:46 ` tip-bot2 for Juergen Gross
2026-01-19 18:26 ` [PATCH v4 4/6] x86/io: Remove REALLY_SLOW_IO handling Juergen Gross
2026-03-26 8:39 ` Juergen Gross
2026-03-26 10:04 ` Borislav Petkov
2026-03-26 10:23 ` Jürgen Groß
2026-01-19 18:26 ` [PATCH v4 5/6] x86/io_delay: Switch io_delay() default mechanism to "none" Juergen Gross
2026-03-20 22:02 ` Borislav Petkov
2026-03-21 6:29 ` Jürgen Groß
2026-03-21 11:32 ` Borislav Petkov
2026-01-19 18:26 ` [PATCH v4 6/6] x86/io_delay: Add config option for controlling build of io_delay Juergen Gross
2026-02-02 10:27 ` [PATCH v4 0/6] x86: Cleanups around slow_down_io() Juergen Gross
2026-02-09 9:11 ` Juergen Gross
2026-02-09 10:19 ` Borislav Petkov
2026-03-11 9:16 ` Juergen Gross
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox