Skip to contentSkip to conversation

x86: Cleanups around slow_down_io()

PATCH Applied Juergen Gross 5 participants 16 messages Nov 26, 2025 – Dec 16, 2025

Subsystems (11)
x86 KVM Block layer virtio core +7 more subsystems

v1 of 4 Applied Latest is v4 →

lore
Share & tools
lore

Juergen Gross

author maintainer
#0 lore raw

cover x86: Cleanups around slow_down_io()

While looking at paravirt cleanups I stumbled over slow_down_io() and the related REALLY_SLOW_IO define.

Especially REALLY_SLOW_IO is a mess, which is proven by 2 completely wrong use cases.

Do several cleanups, resulting in a deletion of REALLY_SLOW_IO and the io_delay() paravirt function hook.

Patches 2 and 3 are not changing any functionality, but maybe they should? As the potential bug has been present for more than a decade now, I went with just deleting the useless "#define REALLY_SLOW_IO". The alternative would be to do something similar as in patch 5.

Juergen Gross (5):
x86/paravirt: Replace io_delay() hook with a bool hwmon/lm78: Drop REALLY_SLOW_IO setting hwmon/w83781d: Drop REALLY_SLOW_IO setting block/floppy: Don't use REALLY_SLOW_IO for delays x86/io: Remove REALLY_SLOW_IO handling

 arch/x86/include/asm/floppy.h         | 27 ++++++++++++++++++++++-----
 arch/x86/include/asm/io.h             | 12 +++++-------
 arch/x86/include/asm/paravirt.h       | 11 +----------
 arch/x86/include/asm/paravirt_types.h |  3 +--
 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 +-----
 drivers/block/floppy.c                |  2 --
 drivers/hwmon/lm78.c                  |  5 +++--
 drivers/hwmon/w83781d.c               |  5 +++--
 11 files changed, 39 insertions(+), 45 deletions(-)
Signature · 1 line
2.51.0
author maintainer
#1 lore raw

PATCH 1/5 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.

This enables to replace the hook with a bool indicating whether native_io_delay() should be called.

---
 arch/x86/include/asm/io.h             |  7 +++++--
 arch/x86/include/asm/paravirt.h       | 11 +----------
 arch/x86/include/asm/paravirt_types.h |  3 +--
 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 +-----
 7 files changed, 11 insertions(+), 29 deletions(-)
arch/x86/include/asm/io.h +5 -2
index ca309a3227c7..0448575569b9 100644
@@ -245,9 +245,14 @@ extern void io_delay_init(void);
 #if defined(CONFIG_PARAVIRT)
 #include <asm/paravirt.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)			\
 {									\
arch/x86/include/asm/paravirt.h +1 -10
index b5e59a7ba0d0..0ab798d234cc 100644
@@ -53,16 +53,7 @@ static inline u64 paravirt_steal_clock(int cpu)
 void __init paravirt_set_cap(void);
 #endif
 
-/* The paravirtualized I/O functions */
-static inline void slow_down_io(void)
-{
-	PVOP_VCALL0(cpu.io_delay);
-#ifdef REALLY_SLOW_IO
-	PVOP_VCALL0(cpu.io_delay);
-	PVOP_VCALL0(cpu.io_delay);
-	PVOP_VCALL0(cpu.io_delay);
-#endif
-}
+#define call_io_delay() pv_info.io_delay
 
 void native_flush_tlb_local(void);
 void native_flush_tlb_global(void);
arch/x86/include/asm/paravirt_types.h +1 -2
index 37a8627d8277..ee399f467796 100644
@@ -36,6 +36,7 @@ struct pv_info {
 #ifdef CONFIG_PARAVIRT_XXL
 	u16 extra_user_64bit_cs;  /* __USER_CS if none */
 #endif
+	bool io_delay;
 
 	const char *name;
 };
@@ -51,8 +52,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);
arch/x86/kernel/cpu/vmware.c +1 -1
index cb3f900c46fc..47db25d63c8d 100644
@@ -338,7 +338,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;
arch/x86/kernel/kvm.c +1 -7
index b67d7c59dca0..b02d441efa3b 100644
@@ -73,12 +73,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)
@@ -312,7 +306,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;
arch/x86/kernel/paravirt.c +1 -2
index ab3e172dcc69..8ee952e7e7d4 100644
@@ -113,6 +113,7 @@ struct pv_info pv_info = {
 #ifdef CONFIG_PARAVIRT_XXL
 	.extra_user_64bit_cs = __USER_CS,
 #endif
+	.io_delay = true,
 };
 
 /* 64-bit pagetable entries */
@@ -120,8 +121,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,
arch/x86/xen/enlighten_pv.c +1 -5
index 4806cc28d7ca..a43b525f25cd 100644
@@ -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",
 };
 
@@ -1253,7 +1250,6 @@ static const typeof(pv_ops) xen_cpu_ops __initconst = {
 		.invalidate_io_bitmap = xen_invalidate_io_bitmap,
 		.update_io_bitmap = xen_update_io_bitmap,
 #endif
-		.io_delay = xen_io_delay,
 
 		.start_context_switch = xen_start_context_switch,
 		.end_context_switch = xen_end_context_switch,
Signature · 1 line
2.51.0
author maintainer
#2 lore raw

PATCH 2/5 hwmon/lm78: Drop REALLY_SLOW_IO setting

In reply to Juergen Gross

In lm78_isa_found() there is REALLY_SLOW_IO defined around some port accesses, probably in order to wait between multiple accesses.

Unfortunately this isn't making any difference compared to not having this define since more than a decade, as REALLY_SLOW_IO needs to be defined while "#include <asm/io.h>" is called to have an effect.

As there seem not to be any outstanding issues in spite of this having no effect, just drop the "#define" and add a remark to the related comment.

---
 drivers/hwmon/lm78.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/hwmon/lm78.c +3 -2
index 8b53bb312069..9378a47bf5af 100644
@@ -843,17 +843,18 @@ static int __init lm78_isa_found(unsigned short address)
 		}
 	}
 
-#define REALLY_SLOW_IO
 	/*
 	 * We need the timeouts for at least some LM78-like
 	 * chips. But only if we read 'undefined' registers.
+	 * There used to be a "#define REALLY_SLOW_IO" to enforce that, but
+	 * this has been without any effect since more than a decade, so it
+	 * has been dropped.
 	 */
 	val = inb_p(address + 1);
 	if (inb_p(address + 2) != val
 	 || inb_p(address + 3) != val
 	 || inb_p(address + 7) != val)
 		goto release;
-#undef REALLY_SLOW_IO
 
 	/*
 	 * We should be able to change the 7 LSB of the address port. The
Signature · 1 line
2.51.0
author maintainer
#4 lore raw

PATCH 3/5 hwmon/w83781d: Drop REALLY_SLOW_IO setting

In reply to Juergen Gross

In w83781d_isa_found() there is REALLY_SLOW_IO defined around some port accesses, probably in order to wait between multiple accesses.

Unfortunately this isn't making any difference compared to not having this define since more than a decade, as REALLY_SLOW_IO needs to be defined while "#include <asm/io.h>" is called to have an effect.

As there seem not to be any outstanding issues in spite of this having no effect, just drop the "#define" and add a remark to the related comment.

---
 drivers/hwmon/w83781d.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/hwmon/w83781d.c +3 -2
index 076200ed2ec9..f664c2152a6d 100644
@@ -1850,10 +1850,12 @@ w83781d_isa_found(unsigned short address)
 		}
 	}
 
-#define REALLY_SLOW_IO
 	/*
 	 * We need the timeouts for at least some W83781D-like
 	 * chips. But only if we read 'undefined' registers.
+	 * There used to be a "#define REALLY_SLOW_IO" to enforce that, but
+	 * this has been without any effect since more than a decade, so it
+	 * has been dropped.
 	 */
 	val = inb_p(address + 1);
 	if (inb_p(address + 2) != val
@@ -1862,7 +1864,6 @@ w83781d_isa_found(unsigned short address)
 		pr_debug("Detection failed at step %d\n", 1);
 		goto release;
 	}
-#undef REALLY_SLOW_IO
 
 	/*
 	 * We should be able to change the 7 LSB of the address port. The
Signature · 1 line
2.51.0
author maintainer
#6 lore raw

PATCH 4/5 block/floppy: Don't use REALLY_SLOW_IO for delays

In reply to Juergen Gross

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.

---
 arch/x86/include/asm/floppy.h | 27 ++++++++++++++++++++++-----
 drivers/block/floppy.c        |  2 --
 2 files changed, 22 insertions(+), 7 deletions(-)
arch/x86/include/asm/floppy.h +22 -5
index e7a244051c62..8d1e86687b98 100644
@@ -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;
drivers/block/floppy.c +0 -2
index 5336c3c5ca36..cda36a8f9a05 100644
@@ -145,8 +145,6 @@
  * Better audit of register_blkdev.
  */
 
-#define REALLY_SLOW_IO
-
 #define DEBUGT 2
 
 #define DPRINT(format, args...) \
Signature · 1 line
2.51.0
author maintainer
#7 lore raw

PATCH 5/5 x86/io: Remove REALLY_SLOW_IO handling

In reply to Juergen Gross

As there is no user of REALLY_SLOW_IO left, remove the related handling from arch/x86/include/asm/io.h.

---
 arch/x86/include/asm/io.h | 5 -----
 1 file changed, 5 deletions(-)
arch/x86/include/asm/io.h +0 -5
index 0448575569b9..c4ddaaa1b81c 100644
@@ -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)						\
Signature · 1 line
2.51.0
maintainer Applied
#3 lore raw

Re: [PATCH 2/5] hwmon/lm78: Drop REALLY_SLOW_IO setting

In reply to Juergen Gross
Quoted 7 lines · Juergen Gross

In lm78_isa_found() there is REALLY_SLOW_IO defined around some port accesses, probably in order to wait between multiple accesses.

Unfortunately this isn't making any difference compared to not having this define since more than a decade, as REALLY_SLOW_IO needs to be defined while "#include <asm/io.h>" is called to have an effect.

Quoted 5 lines

As there seem not to be any outstanding issues in spite of this having no effect, just drop the "#define" and add a remark to the related comment.

Applied.

Thanks,
Guenter

maintainer Applied
#5 lore raw

Re: [PATCH 3/5] hwmon/w83781d: Drop REALLY_SLOW_IO setting

In reply to Juergen Gross
Quoted 7 lines · Juergen Gross

In w83781d_isa_found() there is REALLY_SLOW_IO defined around some port accesses, probably in order to wait between multiple accesses.

Unfortunately this isn't making any difference compared to not having this define since more than a decade, as REALLY_SLOW_IO needs to be defined while "#include <asm/io.h>" is called to have an effect.

Quoted 5 lines

As there seem not to be any outstanding issues in spite of this having no effect, just drop the "#define" and add a remark to the related comment.

Applied.

Thanks,
Guenter

maintainer
#8 lore raw
In reply to Juergen Gross
Quoted 6 lines · Juergen Gross

While looking at paravirt cleanups I stumbled over slow_down_io() and the related REALLY_SLOW_IO define.

Especially REALLY_SLOW_IO is a mess, which is proven by 2 completely wrong use cases.

Quoted 7 lines

Do several cleanups, resulting in a deletion of REALLY_SLOW_IO and the io_delay() paravirt function hook.

Patches 2 and 3 are not changing any functionality, but maybe they should? As the potential bug has been present for more than a decade now, I went with just deleting the useless "#define REALLY_SLOW_IO". The alternative would be to do something similar as in patch 5.

Maybe, but as you point out there has not been a report of a problem for a long time (who knows if any of the affected systems still exist). We can apply always apply a fix if it turns out that someone does run into a problem.

Thanks,
Guenter

#9 lore raw
In reply to Juergen Gross
Quoted 21 lines · Juergen Gross

While looking at paravirt cleanups I stumbled over slow_down_io() and the related REALLY_SLOW_IO define.

Especially REALLY_SLOW_IO is a mess, which is proven by 2 completely wrong use cases.

Do several cleanups, resulting in a deletion of REALLY_SLOW_IO and the io_delay() paravirt function hook.

Patches 2 and 3 are not changing any functionality, but maybe they should? As the potential bug has been present for more than a decade now, I went with just deleting the useless "#define REALLY_SLOW_IO". The alternative would be to do something similar as in patch 5.

Juergen Gross (5):
x86/paravirt: Replace io_delay() hook with a bool hwmon/lm78: Drop REALLY_SLOW_IO setting hwmon/w83781d: Drop REALLY_SLOW_IO setting block/floppy: Don't use REALLY_SLOW_IO for delays x86/io: Remove REALLY_SLOW_IO handling

Quoted 12 lines
 arch/x86/include/asm/floppy.h         | 27 ++++++++++++++++++++++-----
 arch/x86/include/asm/io.h             | 12 +++++-------
 arch/x86/include/asm/paravirt.h       | 11 +----------
 arch/x86/include/asm/paravirt_types.h |  3 +--
 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 +-----
 drivers/block/floppy.c                |  2 --
 drivers/hwmon/lm78.c                  |  5 +++--
 drivers/hwmon/w83781d.c               |  5 +++--
 11 files changed, 39 insertions(+), 45 deletions(-)

I think we should get rid of *all* io_delay hacks, they might have been relevant in the days of i386 systems, but we don't even support i386 CPUs anymore. Should it cause any regressions, it's easy to bisect to. There's been enough changes around all these facilities that the original timings are probably way off already, so we've just been cargo-cult porting these to newer kernels essentially.

Thanks,

Ingo

author maintainer
#10 lore raw
Quoted 37 lines · Ingo Molnar
Quoted 21 lines · Juergen Gross

While looking at paravirt cleanups I stumbled over slow_down_io() and the related REALLY_SLOW_IO define.

Especially REALLY_SLOW_IO is a mess, which is proven by 2 completely wrong use cases.

Do several cleanups, resulting in a deletion of REALLY_SLOW_IO and the io_delay() paravirt function hook.

Patches 2 and 3 are not changing any functionality, but maybe they should? As the potential bug has been present for more than a decade now, I went with just deleting the useless "#define REALLY_SLOW_IO". The alternative would be to do something similar as in patch 5.

Juergen Gross (5):
x86/paravirt: Replace io_delay() hook with a bool hwmon/lm78: Drop REALLY_SLOW_IO setting hwmon/w83781d: Drop REALLY_SLOW_IO setting block/floppy: Don't use REALLY_SLOW_IO for delays x86/io: Remove REALLY_SLOW_IO handling

Quoted 12 lines
  arch/x86/include/asm/floppy.h         | 27 ++++++++++++++++++++++-----
  arch/x86/include/asm/io.h             | 12 +++++-------
  arch/x86/include/asm/paravirt.h       | 11 +----------
  arch/x86/include/asm/paravirt_types.h |  3 +--
  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 +-----
  drivers/block/floppy.c                |  2 --
  drivers/hwmon/lm78.c                  |  5 +++--
  drivers/hwmon/w83781d.c               |  5 +++--
  11 files changed, 39 insertions(+), 45 deletions(-)
Quoted 6 lines

I think we should get rid of *all* io_delay hacks, they might have been relevant in the days of i386 systems, but we don't even support i386 CPUs anymore. Should it cause any regressions, it's easy to bisect to. There's been enough changes around all these facilities that the original timings are probably way off already, so we've just been cargo-cult porting these to newer kernels essentially.

Fine with me.

Which path to removal of io_delay would you (and others) prefer?

1. Ripping it out immediately.

2. Hiding it behind a default-off config option for a few kernel versions before removing it.

3. Using CONFIG_IO_DELAY_NONE as the default io_delay_type before ripping it out.

4. Using CONFIG_IO_DELAY_NONE as the default io_delay_type before hiding it behind a default-off config option, then rip it out later.

In cases 2-4 I'd still like to have patch 1 of my series applied, as it will make paravirt rework easier.

Juergen

#11 lore raw
Quoted 10 lines · Jürgen Groß
Quoted 4 lines

CPUs anymore. Should it cause any regressions, it's easy to bisect to. There's been enough changes around all these facilities that the original timings are probably way off already, so we've just been cargo-cult porting these to newer kernels essentially.

Fine with me.

Which path to removal of io_delay would you (and others) prefer?

1. Ripping it out immediately.

I'd just rip it out immediately, and see who complains. :-)

Whatever side effects it still may have, I very strongly doubt it has anything to do with the original purpose of IO delays...

Quoted 2 lines

In cases 2-4 I'd still like to have patch 1 of my series applied, as it will make paravirt rework easier.

Sure.

Thanks,

Ingo

author maintainer
#12 lore raw
Quoted 8 lines · Ingo Molnar
Quoted 5 lines · Jürgen Groß
Quoted 4 lines

CPUs anymore. Should it cause any regressions, it's easy to bisect to. There's been enough changes around all these facilities that the original timings are probably way off already, so we've just been cargo-cult porting these to newer kernels essentially.

Quoted 7 lines
Quoted 5 lines

Fine with me.

Which path to removal of io_delay would you (and others) prefer?

1. Ripping it out immediately.

I'd just rip it out immediately, and see who complains. :-)

I figured this might be a little bit too evil. :-)

I've just sent V2 defaulting to have no delay, so anyone hit by that can still fix it by applying the "io_delay" boot parameter.

I'll do the ripping out for kernel 6.21 (or whatever it will be called).

Juergen

#13 lore raw
Quoted 19 lines · Jürgen Groß
Quoted 8 lines · Ingo Molnar
Quoted 5 lines · Jürgen Groß
Quoted 4 lines

CPUs anymore. Should it cause any regressions, it's easy to bisect to. There's been enough changes around all these facilities that the original timings are probably way off already, so we've just been cargo-cult porting these to newer kernels essentially.

Quoted 7 lines
Quoted 5 lines

Fine with me.

Which path to removal of io_delay would you (and others) prefer?

1. Ripping it out immediately.

I'd just rip it out immediately, and see who complains. :-)

I figured this might be a little bit too evil. :-)

Quoted 7 lines

I've just sent V2 defaulting to have no delay, so anyone hit by that can still fix it by applying the "io_delay" boot parameter.

I'll do the ripping out for kernel 6.21 (or whatever it will be called).

Juergen

Ok, I'm going to veto ripping it out from the real-mode init code, because I actually know why it is there :) ... and that code is pre-UEFI legacy these days anyway.

Other places... I don't care :)

#14 lore raw
Quoted 23 lines · On Tue, 16 Dec 2025 07:32:09 -0800 "H. Peter Anvin" <[email protected]> wrote:
Quoted 22 lines · Jürgen Groß
Quoted 8 lines · Ingo Molnar
Quoted 5 lines · Jürgen Groß
Quoted 4 lines

CPUs anymore. Should it cause any regressions, it's easy to bisect to. There's been enough changes around all these facilities that the original timings are probably way off already, so we've just been cargo-cult porting these to newer kernels essentially.

Quoted 7 lines
Quoted 5 lines

Fine with me.

Which path to removal of io_delay would you (and others) prefer?

1. Ripping it out immediately.

I'd just rip it out immediately, and see who complains. :-)

I figured this might be a little bit too evil. :-)

I've just sent V2 defaulting to have no delay, so anyone hit by that can still fix it by applying the "io_delay" boot parameter.

Quoted 7 lines
Quoted 4 lines

I'll do the ripping out for kernel 6.21 (or whatever it will be called).

Juergen

Ok, I'm going to veto ripping it out from the real-mode init code, because I actually know why it is there :) ...

Pray tell.
One thing I can think of is the delay allows time for a level-sensitive IRQ line to de-assert before an ISR exits.
Or, maybe more obscure, to avoid back to back accesses to some register breaking the 'inter-cycle recovery time' for the device. That was a good way to 'break' the Zilog SCC and the 8259 interrupt controller (eg on any reference board with a '286 cpu).

David

Quoted 4 lines

and that code is pre-UEFI legacy these days anyway.

Other places... I don't care :)

#15 lore raw
Quoted 42 lines · David Laight
Quoted 23 lines · On Tue, 16 Dec 2025 07:32:09 -0800 "H. Peter Anvin" <[email protected]> wrote:
Quoted 22 lines · Jürgen Groß
Quoted 8 lines · Ingo Molnar
Quoted 5 lines · Jürgen Groß
Quoted 4 lines

CPUs anymore. Should it cause any regressions, it's easy to bisect to. There's been enough changes around all these facilities that the original timings are probably way off already, so we've just been cargo-cult porting these to newer kernels essentially.

Quoted 7 lines
Quoted 5 lines

Fine with me.

Which path to removal of io_delay would you (and others) prefer?

1. Ripping it out immediately.

I'd just rip it out immediately, and see who complains. :-)

I figured this might be a little bit too evil. :-)

I've just sent V2 defaulting to have no delay, so anyone hit by that can still fix it by applying the "io_delay" boot parameter.

Quoted 7 lines
Quoted 4 lines

I'll do the ripping out for kernel 6.21 (or whatever it will be called).

Juergen

Ok, I'm going to veto ripping it out from the real-mode init code, because I actually know why it is there :) ...

Pray tell.
One thing I can think of is the delay allows time for a level-sensitive IRQ line to de-assert before an ISR exits.
Or, maybe more obscure, to avoid back to back accesses to some register breaking the 'inter-cycle recovery time' for the device. That was a good way to 'break' the Zilog SCC and the 8259 interrupt controller (eg on any reference board with a '286 cpu).

Quoted 8 lines

David

Quoted 4 lines

and that code is pre-UEFI legacy these days anyway.

Other places... I don't care :)

A20 gate logic on some motherboards, especially.