From nobody Sat Apr 4 00:24:54 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 441B926B742; Sat, 21 Mar 2026 15:47:55 +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=1774108076; cv=none; b=JuiNm/xetZJcNNH1hKOAqeWkVL2czOqFWAxVkxf0qhvagiUKxjUnkFeokzFvxdR+EeH9ECcu1Te2+cMCjPO400VzyvXMKWsSeMILTb+VChqEJXyTxlU+nCvWAXvq8qMc46RqOFNcWyV+rk2M8vps6HlBZUqONEWKc+US92ogG1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774108076; c=relaxed/simple; bh=vlR2OppPK3qYeNfuI37W4V46NbJ+JwS8f6Kia+UGxSA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=iMIrBeKPPvMxXmmteCRK66XEQ+VRv4ZwUgCidScxm+KaQKAHeASfXAyXED5GJ14ooNu9VPuMA2LaycjJbVGZFXiTKuKWmZDgh4D0kUg1n6zjWTso3g0CNwGEF3S9+zSpYHxy5SrULYPMWWsHokGxmVaxNDKhdFNochxSLVVULeQ= 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=r9EwjOGb; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=66XM8hSU; 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="r9EwjOGb"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="66XM8hSU" Date: Sat, 21 Mar 2026 15:47:46 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1774108067; 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=Upaz/T+mloUH63RKtlkjFdrAA8Qsei7lqVCLeJLC9X8=; b=r9EwjOGbcTGBV9JgBNSymSvQFIbNcoQ2QD5k5pd1mEICdo236+aiAWC9lGfYlB55Iq0D/0 Ogccjn5H5vXrVuE7XCn3X6i/Q1Kbn/AHsm6jM/7ss5VdV9i9Y0P13F4ph3Lm6GlvLr86Gc DCfjQdq0RePssmAAKKE1hKLWKJG5bd7xSViTYWlbxBpiwP/80BPPOZc7aj1YBv6+8fyQ61 zRHa5MxF8yjDqZDv2wHwZExS1Zv83foob3elxRwVUgeOZ3ws44f955cyW5NbRY9esUV8a+ K53TAEjgYVYb9xVmKMnJnUm/4aLDRLGsYF7GH7DKUmpfl6xSW5YjMhtZfnlMjQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1774108067; 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=Upaz/T+mloUH63RKtlkjFdrAA8Qsei7lqVCLeJLC9X8=; b=66XM8hSUZzBb36HfSbQKOw5HNksS1HMnDM0XNZjZ7J228A9kDDG9jPPYiA/obVYGDCAJDF qzgqTkhB9TMh2TCQ== 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)" , 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: <177410806664.1647592.8371665240883608800.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: 11cff44c45f797cb7e3f75bfb9610d6b2a89ad3a Gitweb: https://git.kernel.org/tip/11cff44c45f797cb7e3f75bfb9610d6b2= a89ad3a Author: Juergen Gross AuthorDate: Mon, 19 Jan 2026 19:26:28 +01:00 Committer: Borislav Petkov (AMD) 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 Signed-off-by: Borislav Petkov (AMD) Link: https://patch.msgid.link/20260119182632.596369-3-jgross@suse.com Signed-off-by: Borislav Petkov (AMD) --- 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<