From nobody Sat Apr 4 00:07:14 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E1B5A192B90; Sun, 22 Mar 2026 07:47:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774165623; cv=none; b=qMFC12PXdc8Mt1eJVlTlJtuymnoc+8G9CEoj+kzIaCX1nvr4Gw0BqTDFo6StrQLxGyJoh0II16i7V03KDVQDWqnRcRUSGKCL87zr+qfZK4k3FUAINfMR75J90lPXKW+opOidGQ4dSJWtEpdt/hAFTW9WkAwArkGmokMEUvyhzjs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774165623; c=relaxed/simple; bh=TfY5o/reRw0TGvLQ6Vf9jOXB8LvjsVq7oVzqBFW8WD8=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=scIiK4L3vrQ09wYD14eEQuY2dS8UOtWEbOR5B9iH4aJhfT0lizYSJmn3LZBZ7ttjKSCbrUYdzFeJj2DasSyFIVNuEB9lGscqe7gMq8Gw1SH8lIIbT2pdyaPoPB/ALLLEt0l7ikCxoiMH7WTX58zyf6+/yvdxQaxshHzWZrYmJQw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=YLuoqI4Y; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=eoWg9GGT; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YLuoqI4Y"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="eoWg9GGT" Date: Sun, 22 Mar 2026 07:46:59 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774165620; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YUOXl1ANNmUmv7/n+1bLQSwBK+IIeoWmu4EVjJ8TJyE=; b=YLuoqI4YEaCgduZtwcbVZTkwXS30nOSvKZVEbETLhuUb5FL1mNEJwVjFTpnLkE47adomkM 4XX65PZmRKgVjXduR0G+bl3KF5tHHsf1NOsQ2vtkEmxbjR34wY18jW29Ii1kmI0bgu2JQx +WDBJENoTVD8LjsPDiHYmDMvhgJdnN6V4U0DWXNAaYHevm3c8bhvlHmapQphhThj5jCfLw j2dJhbFQwSQnLicx+U1KlrDakaOm+PrdoFkLxD8VuAb25r0aNwbgWlvuCe0XZ9gh4yDUHr VGO5sxMFky63mYBX50UUG6EKQ1swzKQaN9Bw8rT5QAvHei8G2TKlAnIQ67hXqw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774165620; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YUOXl1ANNmUmv7/n+1bLQSwBK+IIeoWmu4EVjJ8TJyE=; b=eoWg9GGTyVM7CFG3TEvsKQazi8JhQ+7lWC4nnVJkTu4vy4R0YTU9zyOl7A9an52pUyRb3A PkYfC4RFrZzqBfAg== From: "tip-bot2 for Juergen Gross" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cleanups] x86/paravirt: Replace io_delay() hook with a bool Cc: Juergen Gross , "Borislav Petkov (AMD)" , Ingo Molnar , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260119182632.596369-3-jgross@suse.com> References: <20260119182632.596369-3-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177416561932.1647592.16979307838556532745.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/cleanups branch of tip: Commit-ID: 9eece498565c3fd5f37efe58498779efd39f2269 Gitweb: https://git.kernel.org/tip/9eece498565c3fd5f37efe58498779efd= 39f2269 Author: Juergen Gross AuthorDate: Mon, 19 Jan 2026 19:26:28 +01:00 Committer: Ingo Molnar 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 Signed-off-by: Borislav Petkov (AMD) Signed-off-by: Ingo Molnar 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); =20 #if defined(CONFIG_PARAVIRT) -#include +#include #else +#define call_io_delay() true +#endif =20 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 } =20 -#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/pa= ravirt-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; }; =20 @@ -26,6 +28,10 @@ u64 _paravirt_ident_64(u64); #endif #define paravirt_nop ((void *)nop_func) =20 +#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/paravir= t.h index fcf8ab5..cdfe400 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -19,17 +19,6 @@ #include #include =20 -/* 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/p= aravirt_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 { =20 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 =3D "VMware hypervisor"; - pv_ops.cpu.io_delay =3D paravirt_nop; + pv_info.io_delay =3D false; =20 if (vmware_tsc_khz =3D=3D 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_ti= me) __aligned(64) __visi static int has_steal_clock =3D 0; =20 static int has_guest_poll =3D 0; -/* - * No need for any "IO delay" on KVM - */ -static void kvm_io_delay(void) -{ -} =20 #define KVM_TASK_SLEEP_HASHBITS 8 #define KVM_TASK_SLEEP_HASHSIZE (1<