From nobody Mon Dec 1 22:34:55 2025 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45AF633E356 for ; Wed, 26 Nov 2025 16:20:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174030; cv=none; b=tUn6R5/M68PonaTAyJiuBStsEYbynksq/T/STeXumXjfV3JqUpxRfWLt+zk5bcpI2yQvwtw35mS44IroyINuXk0VOnkuY3o0TW85kBB8SAI2D/ldEAB4U4gT2UUDzWr7+kIzu92dNJl1RxZvbIcdIwcfQdzPCzbEC2hCUFdyjNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174030; c=relaxed/simple; bh=UmeeBp9N+mdq+JkgTJXmUHeqQYey5+lsNQMy1Am//gc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qB1zy9hbmDkplz5JFCNSybKdCH3lac0/O2nUwwQ/etX6iOXpRE5hIpeQzGk9HNVsuYheeEgkqHiJ5EJYPg9Dw3sqNPztiGGiKdXFwnNUGhBYC/Xi+/Q5joehP0RuX4JMplnHAiu31JvQYDZgZlPNwgArqwz5eS+zKRvB3zqd/io= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AE63E5BE51; Wed, 26 Nov 2025 16:20:26 +0000 (UTC) Authentication-Results: smtp-out2.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3AB3C3EA63; Wed, 26 Nov 2025 16:20:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 4F7vDMooJ2lnLQAAD6G6ig (envelope-from ); Wed, 26 Nov 2025 16:20:26 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org, virtualization@lists.linux.dev, kvm@vger.kernel.org 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@lists.xenproject.org Subject: [PATCH 1/5] x86/paravirt: Replace io_delay() hook with a bool Date: Wed, 26 Nov 2025 17:20:14 +0100 Message-ID: <20251126162018.5676-2-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251126162018.5676-1-jgross@suse.com> References: <20251126162018.5676-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spam-Flag: NO X-Spam-Score: -4.00 X-Spam-Level: X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Rspamd-Queue-Id: AE63E5BE51 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org Content-Type: text/plain; charset="utf-8" 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 --- 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(-) diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h index ca309a3227c7..0448575569b9 100644 --- a/arch/x86/include/asm/io.h +++ b/arch/x86/include/asm/io.h @@ -245,9 +245,14 @@ extern void io_delay_init(void); #if defined(CONFIG_PARAVIRT) #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(); @@ -256,8 +261,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.h b/arch/x86/include/asm/paravir= t.h index b5e59a7ba0d0..0ab798d234cc 100644 --- a/arch/x86/include/asm/paravirt.h +++ b/arch/x86/include/asm/paravirt.h @@ -53,16 +53,7 @@ static inline u64 paravirt_steal_clock(int cpu) void __init paravirt_set_cap(void); #endif =20 -/* 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 =20 void native_flush_tlb_local(void); void native_flush_tlb_global(void); diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/p= aravirt_types.h index 37a8627d8277..ee399f467796 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h @@ -36,6 +36,7 @@ struct pv_info { #ifdef CONFIG_PARAVIRT_XXL u16 extra_user_64bit_cs; /* __USER_CS if none */ #endif + bool io_delay; =20 const char *name; }; @@ -51,8 +52,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 cb3f900c46fc..47db25d63c8d 100644 --- a/arch/x86/kernel/cpu/vmware.c +++ b/arch/x86/kernel/cpu/vmware.c @@ -338,7 +338,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 b67d7c59dca0..b02d441efa3b 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -73,12 +73,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<; Wed, 26 Nov 2025 16:20:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174036; cv=none; b=uXToEwVXqvPJ1ASAHciQlLdjrdPxCXnzAeFY5Ms5rEROc4ryIQIG5iIGIbXT7eI6+pf6d11gm77MY9Jtg2J/nIZ9Ag3Ow0nZvgihjz8IMF0bpQUog1GZg/m7GNWSZswsnJM4Irwqrk7Q3CQnDa0XAksZkbW8PkNXnBWHjElLANc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174036; c=relaxed/simple; bh=D6TJb6Fz3Fo8wBex17+flKz4WaxKSTIk03xFsc2TsdY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dNkZSnecPkB/HcKqapXoPZCSwfroPZRIFEAinufNN93znh6/f0biUIuxkpAwq6/DO5iBrcN1z+29+zqetjNQVrf/ddUb2h+s/968wYG68Jk8PH2wkVOpAGzpwvsDXbuftpKRq9qL7qdXgpRCZNWA0pLAsQbCtdjmL2RJMG+2liY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=tXnldcGz; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=tXnldcGz; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="tXnldcGz"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="tXnldcGz" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8A3DC5BECB; Wed, 26 Nov 2025 16:20:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1764174032; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NqzksQw7WTcZNKnXCQ4FhvD+v/7v9Egk7bc9LWG+9kw=; b=tXnldcGzJnq1wwrDxaOSld+dxi/vTRQD2tJiTTMx4LLFJhLkJJ9ao4ETVPbInCq/FHoN6c QRwUgxuu8QdMcJGlmDoXoqZXc6xVi7EnY6OlzrWz6USDB6ytZH4KfN3b2h9XIAwr8RJfJg 6gpeEx5dYVNoN0hpaprRmBeOoymHvwc= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1764174032; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NqzksQw7WTcZNKnXCQ4FhvD+v/7v9Egk7bc9LWG+9kw=; b=tXnldcGzJnq1wwrDxaOSld+dxi/vTRQD2tJiTTMx4LLFJhLkJJ9ao4ETVPbInCq/FHoN6c QRwUgxuu8QdMcJGlmDoXoqZXc6xVi7EnY6OlzrWz6USDB6ytZH4KfN3b2h9XIAwr8RJfJg 6gpeEx5dYVNoN0hpaprRmBeOoymHvwc= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4CB5B3EA63; Wed, 26 Nov 2025 16:20:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id Yb3lBNAoJ2luLQAAD6G6ig (envelope-from ); Wed, 26 Nov 2025 16:20:32 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Cc: Juergen Gross , Jean Delvare , Guenter Roeck Subject: [PATCH 2/5] hwmon/lm78: Drop REALLY_SLOW_IO setting Date: Wed, 26 Nov 2025 17:20:15 +0100 Message-ID: <20251126162018.5676-3-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251126162018.5676-1-jgross@suse.com> References: <20251126162018.5676-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Flag: NO X-Spam-Score: -6.80 X-Spam-Level: X-Spamd-Result: default: False [-6.80 / 50.00]; REPLY(-4.00)[]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_FIVE(0.00)[5]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:mid,imap1.dmz-prg2.suse.org:helo]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="utf-8" 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 " 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. Signed-off-by: Juergen Gross --- drivers/hwmon/lm78.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c index 8b53bb312069..9378a47bf5af 100644 --- a/drivers/hwmon/lm78.c +++ b/drivers/hwmon/lm78.c @@ -843,17 +843,18 @@ static int __init lm78_isa_found(unsigned short addre= ss) } } =20 -#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 =3D inb_p(address + 1); if (inb_p(address + 2) !=3D val || inb_p(address + 3) !=3D val || inb_p(address + 7) !=3D val) goto release; -#undef REALLY_SLOW_IO =20 /* * We should be able to change the 7 LSB of the address port. The --=20 2.51.0 From nobody Mon Dec 1 22:34:55 2025 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B53D33DEC5 for ; Wed, 26 Nov 2025 16:20:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174042; cv=none; b=B/eSnSgsy6H6QbjXoJ9qruS26ackmWHG2Stx4DTD11XoZFOGGQGDNyd1CcUyiny476ODgXBARaO1H6H+EOH8fqc3AWUpuT5+yCLorVKdve6S3TIfoYk/eqahCzCHYlySDFlk/05KUyXDR6ef43paE0Z23SFJyhAznvo5LsIp91o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174042; c=relaxed/simple; bh=a7aYZUF41/tSwyCTA0wp6rMXE6192XpIDjWoesCllf8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FG6ezLS6Wm8VEKuK4CGZyweigOUtEBfS7Bq0SoqlvZzKtF2ELCutyzKGd1L87oG59tvp6aYTgK2RzL/OFRIVamaZ91vvpeR8vs7vs+7Pe505jBXWoQb1Y6wxtmuP/s4c40Zlg6+Lsqf/UWguYOEg0K9SeCg/9Y6QYQrVYErwsnQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=P1g/um/4; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=P1g/um/4; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="P1g/um/4"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="P1g/um/4" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 1D4F35BED7; Wed, 26 Nov 2025 16:20:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1764174038; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=12kEtrBHsCVszOMrir+HBWZZxwemdYjjAG/yBRLp6p0=; b=P1g/um/4cFSTk+CVQn7dVZdsMO1krM7GFkJ1ootR2AT1dt8AZV1tjyadyssZ42CSCHkvXT 1jTOuynlqCbpiHgQx0VvjsIEx2R1rx9xCyNo2HL3YRTXzta/ZBieVcPCpPZNuR6k4AeHm6 uQVRWdvTqezWPHSqjkjIzTf2fMLzoxM= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1764174038; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=12kEtrBHsCVszOMrir+HBWZZxwemdYjjAG/yBRLp6p0=; b=P1g/um/4cFSTk+CVQn7dVZdsMO1krM7GFkJ1ootR2AT1dt8AZV1tjyadyssZ42CSCHkvXT 1jTOuynlqCbpiHgQx0VvjsIEx2R1rx9xCyNo2HL3YRTXzta/ZBieVcPCpPZNuR6k4AeHm6 uQVRWdvTqezWPHSqjkjIzTf2fMLzoxM= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E558A3EA63; Wed, 26 Nov 2025 16:20:37 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id BqxhNtUoJ2mCLQAAD6G6ig (envelope-from ); Wed, 26 Nov 2025 16:20:37 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org Cc: Juergen Gross , Guenter Roeck Subject: [PATCH 3/5] hwmon/w83781d: Drop REALLY_SLOW_IO setting Date: Wed, 26 Nov 2025 17:20:16 +0100 Message-ID: <20251126162018.5676-4-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251126162018.5676-1-jgross@suse.com> References: <20251126162018.5676-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Flag: NO X-Spam-Score: -6.80 X-Spam-Level: X-Spamd-Result: default: False [-6.80 / 50.00]; REPLY(-4.00)[]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_TWO(0.00)[2]; FROM_HAS_DN(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_THREE(0.00)[4]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:mid,imap1.dmz-prg2.suse.org:helo]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="utf-8" 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 " 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. Signed-off-by: Juergen Gross --- drivers/hwmon/w83781d.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index 076200ed2ec9..f664c2152a6d 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c @@ -1850,10 +1850,12 @@ w83781d_isa_found(unsigned short address) } } =20 -#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 =3D inb_p(address + 1); if (inb_p(address + 2) !=3D 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 =20 /* * We should be able to change the 7 LSB of the address port. The --=20 2.51.0 From nobody Mon Dec 1 22:34:55 2025 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CBAF430CDA1 for ; Wed, 26 Nov 2025 16:20:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174048; cv=none; b=HecPf76OrcEW046tyhtlhB6wbMQYWGR1Noa7s95w9hVnqvtR72kzCnUw3rf3Refqg0yyq6LnYMk9fgGXra/ziwSOM5t9ZATpEJ1d6hI6Z1VOab4tCcpKZ0HN6KoHB/37Inon/Avw6+rUI7ZKgRBzLTWb9MnrqFy2U6V5Y9eGEoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174048; c=relaxed/simple; bh=7HVe38fGf9O0P+2M/aGTe3AqoeP1IVHjJywuyxqp+YA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZBQjUpwBO2TQCFMujQ/gEvO6PdG5yNmTAflFevhSTKH+rAyXYZDIFSheyPtdvAQuZJKBxSb//2scPRhA4YU7/n6qFDtbhKTyCCA0MynzF+xiOK4J7huqZnMFCxjTC7gEuqqY7k8IluNDJ8U1IAtTtucSG31lhpsb7E8S+/nT1Ng= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=l0zC9X77; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=l0zC9X77; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="l0zC9X77"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="l0zC9X77" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DBECD5BEC2; Wed, 26 Nov 2025 16:20:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1764174043; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E6NZNgwK7uASRwAaTsoHBOWL98m36NgtcvOr7XBJKRI=; b=l0zC9X77WtSe+c5FbHImlnHMtbOibieEEfMRboxeXFi5BU9T27zN8fuGdXK1uSAf3ULU+V PyU4c+g3ACt9WmH8gHSUXl3I58wrqKvnvRSBre9A8SpMA8Xino0Snw40OjxvJaIOZZBMZ3 l8UsEYOmTkcMChn6NQ/hDRsk6koxVow= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1764174043; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E6NZNgwK7uASRwAaTsoHBOWL98m36NgtcvOr7XBJKRI=; b=l0zC9X77WtSe+c5FbHImlnHMtbOibieEEfMRboxeXFi5BU9T27zN8fuGdXK1uSAf3ULU+V PyU4c+g3ACt9WmH8gHSUXl3I58wrqKvnvRSBre9A8SpMA8Xino0Snw40OjxvJaIOZZBMZ3 l8UsEYOmTkcMChn6NQ/hDRsk6koxVow= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 863573EA63; Wed, 26 Nov 2025 16:20:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 6F1NH9soJ2kELgAAD6G6ig (envelope-from ); Wed, 26 Nov 2025 16:20:43 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org, linux-block@vger.kernel.org Cc: Juergen Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Denis Efremov , Jens Axboe Subject: [PATCH 4/5] block/floppy: Don't use REALLY_SLOW_IO for delays Date: Wed, 26 Nov 2025 17:20:17 +0100 Message-ID: <20251126162018.5676-5-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251126162018.5676-1-jgross@suse.com> References: <20251126162018.5676-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Flag: NO X-Spam-Score: -6.80 X-Spam-Level: X-Spamd-Result: default: False [-6.80 / 50.00]; REPLY(-4.00)[]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:email,suse.com:mid]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_SEVEN(0.00)[11]; RCVD_TLS_ALL(0.00)[] Content-Type: text/plain; charset="utf-8" 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 --- 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] =20 =20 -#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; =20 +static inline u8 fd_inb(u16 base, u16 reg) +{ + u8 ret =3D 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 !=3D (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 =3D inb_p(virtual_dma_port + FD_DATA); + *lptr =3D fd_inb(virtual_dma_port, FD_DATA); } virtual_dma_count =3D lcount; virtual_dma_addr =3D lptr; diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 5336c3c5ca36..cda36a8f9a05 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -145,8 +145,6 @@ * Better audit of register_blkdev. */ =20 -#define REALLY_SLOW_IO - #define DEBUGT 2 =20 #define DPRINT(format, args...) \ --=20 2.51.0 From nobody Mon Dec 1 22:34:55 2025 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 636C833F396 for ; Wed, 26 Nov 2025 16:20:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174053; cv=none; b=WTT9m+yUNnM1pTD6bxmQbT3EqdUlWsXJ3eU5IJOfR6Jmh9ho4IYRG/T2phInGsLblyb3oc1TlZHzcs2NdDYnZnppFKjvZDqm90nkTHfvCOeucCWHkyFRrvJ1UobZlD0QelZAkWwGzAXKKiFGDc3izMAKGzN024yJ+B7yxlG+7Pk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764174053; c=relaxed/simple; bh=+KdFWJ6McQWzi3OU4hU8Ql3l4chQKmIOHR1NLm3OxJ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JJs+VrpfAPjnspiphlgsnRIpd03JhdJZGQBFLpa1D+sT6zkYcbTefDwFqjiXfosfbrp1WOV9RNr1YwcMktJ18b2+hEJTFr989K5aTqiVFWsQbnVR19s060P3iJJnKpmAvKNbOHdLXtbvqpyHAkZAby4Hzf1/KxmUoP0KSZY/wpM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=n0UQ7XX6; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=n0UQ7XX6; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="n0UQ7XX6"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="n0UQ7XX6" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A560422DB4; Wed, 26 Nov 2025 16:20:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1764174049; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rVuoY9JOPUWAMsYZi1yGMvhzAhpx5EhkAc2XHc3BDHc=; b=n0UQ7XX6YOr5GEeMVPXkCDs5BsRM1t1nI7aT/DypfeLAvfjNFpjIp+Pk6xSrhgcZuXa4+H hipbhq7tHmSJ+nPeV08fzLzTh/FdKhta6/ozaWISy98kwahCdLUXl22vHaLBkKunA/noJq c/Y4u97NfHBr4LdQp5UXbhPqQ8mSfu0= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1764174049; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rVuoY9JOPUWAMsYZi1yGMvhzAhpx5EhkAc2XHc3BDHc=; b=n0UQ7XX6YOr5GEeMVPXkCDs5BsRM1t1nI7aT/DypfeLAvfjNFpjIp+Pk6xSrhgcZuXa4+H hipbhq7tHmSJ+nPeV08fzLzTh/FdKhta6/ozaWISy98kwahCdLUXl22vHaLBkKunA/noJq c/Y4u97NfHBr4LdQp5UXbhPqQ8mSfu0= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 560FC3EA63; Wed, 26 Nov 2025 16:20:49 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id y4doE+EoJ2kNLgAAD6G6ig (envelope-from ); Wed, 26 Nov 2025 16:20:49 +0000 From: Juergen Gross To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: Juergen Gross , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Subject: [PATCH 5/5] x86/io: Remove REALLY_SLOW_IO handling Date: Wed, 26 Nov 2025 17:20:18 +0100 Message-ID: <20251126162018.5676-6-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251126162018.5676-1-jgross@suse.com> References: <20251126162018.5676-1-jgross@suse.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Result: default: False [-6.80 / 50.00]; REPLY(-4.00)[]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:mid,suse.com:email]; URIBL_BLOCKED(0.00)[suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; RCPT_COUNT_SEVEN(0.00)[8]; R_RATELIMIT(0.00)[to_ip_from(RLfdszjqhz8kzzb9uwpzdm8png)]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: X-Spam-Score: -6.80 X-Spam-Flag: NO Content-Type: text/plain; charset="utf-8" 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 --- 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 0448575569b9..c4ddaaa1b81c 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; =20 native_io_delay(); -#ifdef REALLY_SLOW_IO - native_io_delay(); - native_io_delay(); - native_io_delay(); -#endif } =20 #define BUILDIO(bwl, type) \ --=20 2.51.0