From nobody Thu Dec 18 23:23:43 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1765892541; cv=none; d=zohomail.com; s=zohoarc; b=R1niXam/9c9WtlvhNYdfYCo22VWYByA4dMuPuWfFVIaIOjRLe/1rtJZ2tbnyughgNK59WJk2uoVbmD+sTmuC6n7JVj6/RuiLkRaaD7TetjoBkwNJHzYJDuD00OqDZloiNMVGqZ4ntFWq976hzv3sx2r2cEMNOykr3ntknNDDITA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1765892541; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AR9YJoS/ZrGpIqMtjrLccD/9zZj/TpZQABpLh6glIqg=; b=EV1LX09it6n4FgFBLtnCqrhCeKXuf2F30osmeSOHKeijzbBYDNZtqHGXNtqZ3Bm2WAw3RmwLX9I4FzCz5C8UC+RQr/cizrfaDVaCmTPJB97Fj7DWEVlcSbrGOxWExSFXO636VuhT3WkaFzsatOnOU/5fTLfV29gytBRXstMVVSo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1765892541320933.2699438830338; Tue, 16 Dec 2025 05:42:21 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1187924.1509229 (Exim 4.92) (envelope-from ) id 1vVVJS-0008EO-HG; Tue, 16 Dec 2025 13:42:02 +0000 Received: by outflank-mailman (output) from mailman id 1187924.1509229; Tue, 16 Dec 2025 13:42:02 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vVVJS-0008EF-Cs; Tue, 16 Dec 2025 13:42:02 +0000 Received: by outflank-mailman (input) for mailman id 1187924; Tue, 16 Dec 2025 13:42:01 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vVVJR-00080T-3c for xen-devel@lists.xenproject.org; Tue, 16 Dec 2025 13:42:01 +0000 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id fea8dddc-da84-11f0-9cce-f158ae23cfc8; Tue, 16 Dec 2025 14:41:59 +0100 (CET) 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 02B875BCD9; Tue, 16 Dec 2025 13:41:59 +0000 (UTC) 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 4FDEA3EA63; Tue, 16 Dec 2025 13:41:58 +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 jRe6EaZhQWmJHwAAD6G6ig (envelope-from ); Tue, 16 Dec 2025 13:41:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: fea8dddc-da84-11f0-9cce-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1765892519; 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=AR9YJoS/ZrGpIqMtjrLccD/9zZj/TpZQABpLh6glIqg=; b=DkVkBcd5mBJQwy0RPRVIJHi8UZSzCLnz2M6ZC+CBmmUp2O9YgvKple7Q3Z5ycz/89MNVQv tySgursow+vR91U+STvdo4ph0OZfaipg9r6mNnD5zxK7T9zfi+j6nLzNrgot4OneY02lFm VO9LaqLa5t9rEqzYanEyIbB8A3jUldk= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1765892519; 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=AR9YJoS/ZrGpIqMtjrLccD/9zZj/TpZQABpLh6glIqg=; b=DkVkBcd5mBJQwy0RPRVIJHi8UZSzCLnz2M6ZC+CBmmUp2O9YgvKple7Q3Z5ycz/89MNVQv tySgursow+vR91U+STvdo4ph0OZfaipg9r6mNnD5zxK7T9zfi+j6nLzNrgot4OneY02lFm VO9LaqLa5t9rEqzYanEyIbB8A3jUldk= 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 v2 1/5] x86/paravirt: Replace io_delay() hook with a bool Date: Tue, 16 Dec 2025 14:41:45 +0100 Message-ID: <20251216134150.2710-2-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251216134150.2710-1-jgross@suse.com> References: <20251216134150.2710-1-jgross@suse.com> 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%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.989]; MIME_GOOD(-0.10)[text/plain]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWELVE(0.00)[17]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; R_RATELIMIT(0.00)[to_ip_from(RLfdszjqhz8kzzb9uwpzdm8png)]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:helo] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -6.80 X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1765892543159154100 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 3502939415ad..b4c15856eab5 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 df78ddee0abb..24e403cdce69 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -74,12 +74,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<; Tue, 16 Dec 2025 13:42:07 +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=1765892530; cv=none; b=HCTGWbeZruXVRA6bHCDnB6G89mZoooj7+AmN+pPGL2aLaOhbebvWgbV1TtUPWI7OnZqIIMfXInvvPAdPhmWtzHFAbnbEQD58jVxPbLclqwnPhjOejsmEgibh8P70hTSUm1xF0DDB0SbbSRQRw9Sd4susiF+vQw59c6lmTrobgnc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765892530; c=relaxed/simple; bh=DjVOIUifmh6NM2I/E7/zNycX5vsGEUeskp5h0rgKAd4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=o6eSeS9kkXu/vWMAOfMA7rFC8fJi6XAP/sOdBRzsJjAARXT1+oWZM+S/us7BRFp7AfELCHoVNu3nMsY3wXAUS4wcT+4A6mSj9EbdvwNY12uIcda9MCPAvkMVPfGN1IkHXHaZpwFbXQRagAAzY0v6AwHYLxED6oRDwvn/P5GF56I= 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.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 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-out1.suse.de (Postfix) with ESMTPS id DB3FA336A1; Tue, 16 Dec 2025 13:42:04 +0000 (UTC) Authentication-Results: smtp-out1.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 6C13E3EA63; Tue, 16 Dec 2025 13:42:04 +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 u3fmGKxhQWmTHwAAD6G6ig (envelope-from ); Tue, 16 Dec 2025 13:42:04 +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 v2 2/5] block/floppy: Don't use REALLY_SLOW_IO for delays Date: Tue, 16 Dec 2025 14:41:46 +0100 Message-ID: <20251216134150.2710-3-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251216134150.2710-1-jgross@suse.com> References: <20251216134150.2710-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-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Flag: NO X-Spam-Score: -4.00 X-Rspamd-Queue-Id: DB3FA336A1 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Level: 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 c28786e0fe1c..4422bc57a4f2 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 Thu Dec 18 23:23:43 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 3C931366DA2 for ; Tue, 16 Dec 2025 13:42:17 +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=1765892540; cv=none; b=U4xvSIj1TWN+P5duI3U4P73cdee4ZpxIffDrR3/+fHOKWONE70R+Slbu3Z0FyT0+gC16WNx/UW4RRydkpW3AqHjm+KiLvWfri8o9Pqzs5ckTlejRthZBrPh4zX7g4ptlQWO++/szRSsRQA+oFoyA4up88+SDwtjkavdifhtMXBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765892540; c=relaxed/simple; bh=+KdFWJ6McQWzi3OU4hU8Ql3l4chQKmIOHR1NLm3OxJ0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cWwcoN/2jxnDNUzHjF+TvxaOXyCnaBnKr+iEVNof5Xs+GcRvJMdh3LZH2M1deGqi4IsRT7y7BCKhOOgtOyK/0E51q/vxxnkHAlKwKFjvW10tQFUN4WvjdMlhWxuj+xoVq4NR1+UCDTbyUzX0XdUK+A0XgmGHUWH5q5Q5Qdgx+oc= 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=mSqrDWcm; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=mSqrDWcm; 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="mSqrDWcm"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="mSqrDWcm" 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 ACF25336A3; Tue, 16 Dec 2025 13:42:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1765892530; 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=mSqrDWcmC0Fzn3WdgAcKSqgjDjhRAzXwoaSROPqXVMdZzolieJ5ucsm9eCwOx7tvHrtXxo LGg68BCh9gzGA4mpwwLR9n0JJ1KHFReaREeoHeylyk5yKuHQwAClNrszLqHKM6/4WPQ4X9 ehEgH0aY11z72yLgiyjvKAgPAp668EM= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1765892530; 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=mSqrDWcmC0Fzn3WdgAcKSqgjDjhRAzXwoaSROPqXVMdZzolieJ5ucsm9eCwOx7tvHrtXxo LGg68BCh9gzGA4mpwwLR9n0JJ1KHFReaREeoHeylyk5yKuHQwAClNrszLqHKM6/4WPQ4X9 ehEgH0aY11z72yLgiyjvKAgPAp668EM= 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 448993EA63; Tue, 16 Dec 2025 13:42:10 +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 RndeD7JhQWmbHwAAD6G6ig (envelope-from ); Tue, 16 Dec 2025 13:42:10 +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 v2 3/5] x86/io: Remove REALLY_SLOW_IO handling Date: Tue, 16 Dec 2025 14:41:47 +0100 Message-ID: <20251216134150.2710-4-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251216134150.2710-1-jgross@suse.com> References: <20251216134150.2710-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%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.985]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLfdszjqhz8kzzb9uwpzdm8png)]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:mid,suse.com:email,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -6.80 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 From nobody Thu Dec 18 23:23:43 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 A6EF93A5C13 for ; Tue, 16 Dec 2025 13:42:19 +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=1765892542; cv=none; b=YWjMrpUGsjvxhGqgGEDsB+yEOBmFnkrDH4z7XhY4V7sKw6Ub24t5tCeHvtA0w4tkN1UkooX5EX48zcmM1vMoh0ViCRGwf1yPFnzCQHPQVUYEZ4+gzjph+wrpCu8HMssm9bSBKs1kdlRJ/kAvGLWuiyKOFSbl6h8phkrY8xQG+jk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765892542; c=relaxed/simple; bh=NQW7jR9a/irDzU36QL35naxWFFub6FIL1/Ft5qL3lGQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gIpqYrIKeowRq1+qUAll92u/J8EJghBdRQib++XsTOTyHv/5rK1Xdc7KvkPgeBmUKDZ7Tbl1/a2jPMruj1otcB5HD1g42OZSCDbj2qPHm8bwaqaEFVd7Odg5BqNBVJvPaOu9ep2LKEQ21vwA6AtrmQFAx455SAC4vDvnparnHOg= 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 5B3D95BCD6; Tue, 16 Dec 2025 13:42:16 +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 1862D3EA63; Tue, 16 Dec 2025 13:42:16 +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 pdt7BLhhQWmgHwAAD6G6ig (envelope-from ); Tue, 16 Dec 2025 13:42:16 +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 v2 4/5] x86/io_delay: Switch io_delay() default mechanism to "none" Date: Tue, 16 Dec 2025 14:41:48 +0100 Message-ID: <20251216134150.2710-5-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251216134150.2710-1-jgross@suse.com> References: <20251216134150.2710-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-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Flag: NO X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 5B3D95BCD6 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Level: Content-Type: text/plain; charset="utf-8" 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 associatedr io_delay_0xed_port_dmi_table(). Signed-off-by: Juergen Gross --- 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". =20 -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 c4ddaaa1b81c..9c4178f2d094 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, c= onst void *from, extern void native_io_delay(void); =20 extern int io_delay_type; -extern void io_delay_init(void); =20 #if defined(CONFIG_PARAVIRT) #include 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 #include #include -#include -#include #include =20 #define IO_DELAY_TYPE_0X80 0 @@ -18,19 +16,7 @@ #define IO_DELAY_TYPE_UDELAY 2 #define IO_DELAY_TYPE_NONE 3 =20 -#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 =3D DEFAULT_IO_DELAY_TYPE; - -static int __initdata io_delay_override; +int io_delay_type __read_mostly =3D IO_DELAY_TYPE_NONE; =20 /* * Paravirt wants native_io_delay to be a constant. @@ -61,70 +47,6 @@ void native_io_delay(void) } EXPORT_SYMBOL(native_io_delay); =20 -static int __init dmi_io_delay_0xed_port(const struct dmi_system_id *id) -{ - if (io_delay_type =3D=3D IO_DELAY_TYPE_0X80) { - pr_notice("%s: using 0xed I/O delay port\n", id->ident); - io_delay_type =3D 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[] __initcon= st =3D { - { - .callback =3D dmi_io_delay_0xed_port, - .ident =3D "Compaq Presario V6000", - .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30B7") - } - }, - { - .callback =3D dmi_io_delay_0xed_port, - .ident =3D "HP Pavilion dv9000z", - .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30B9") - } - }, - { - .callback =3D dmi_io_delay_0xed_port, - .ident =3D "HP Pavilion dv6000", - .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30B8") - } - }, - { - .callback =3D dmi_io_delay_0xed_port, - .ident =3D "HP Pavilion tx1000", - .matches =3D { - DMI_MATCH(DMI_BOARD_VENDOR, "Quanta"), - DMI_MATCH(DMI_BOARD_NAME, "30BF") - } - }, - { - .callback =3D dmi_io_delay_0xed_port, - .ident =3D "Presario F700", - .matches =3D { - 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; =20 - io_delay_override =3D 1; return 0; } =20 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) =20 vsmp_init(); =20 - io_delay_init(); - early_platform_quirks(); =20 /* Some platforms need the APIC registered for NUMA configuration */ --=20 2.51.0 From nobody Thu Dec 18 23:23:43 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 277A636829B for ; Tue, 16 Dec 2025 13:42:26 +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=1765892548; cv=none; b=CguHyABLsdBgHWezl2AObf2OqZIMkAY5ZOqQNtXsvsnsk7kULzqf+fRjUXH/niP6aAv2WQvpvp5tm7pW3wCQPwKMqGKHBrDFaUpIUlbxPfozBVBFEwRSmAHiOF5x5F0nFTU5YOpVXlyrGOcC35TB7oD/w265csAlvev5wuM3IHw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765892548; c=relaxed/simple; bh=CnU1p+DcY0LjsqS9t6kzSGGJG80Naw7ECgB91jGwVuc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Af20LKZqrjkwB9/SaplsCtoevEPhxUts9UJoEpYTlFxsvYx8meGcmIlSz1ir213m/o0YprCvRaT2Tga/8TmCDEbf7Iww+Z77xmXBxSD1AZhm6htE4IMp4WmdAkYziEBbVhNgPAxToXCg/uWq7xJU8wVkWi997ByCjPxAlJn6frA= 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=nyybNWoO; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=nyybNWoO; 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="nyybNWoO"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="nyybNWoO" 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 22322336A1; Tue, 16 Dec 2025 13:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1765892542; 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=SVYXw6g8ugnGrVHrWrI3qq0RL0EvjQam8AV44nTM6hs=; b=nyybNWoOUFZMNg8rR6AvSeac8KYVPdo0LVu54H4CchWMDZSyzjq6LrrCcTWK/7rxR9S57B +GACn19GiN7YnjWvsjxu3wdgcFjAnqolKJkO8R08FiiwgjBCMSOuJtap6zCniy8f2981HM X5K8gT5EILmzjcdfxBn6EQycQYbanzQ= Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1765892542; 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=SVYXw6g8ugnGrVHrWrI3qq0RL0EvjQam8AV44nTM6hs=; b=nyybNWoOUFZMNg8rR6AvSeac8KYVPdo0LVu54H4CchWMDZSyzjq6LrrCcTWK/7rxR9S57B +GACn19GiN7YnjWvsjxu3wdgcFjAnqolKJkO8R08FiiwgjBCMSOuJtap6zCniy8f2981HM X5K8gT5EILmzjcdfxBn6EQycQYbanzQ= 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 C756C3EA63; Tue, 16 Dec 2025 13:42:21 +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 lBvwLr1hQWmmHwAAD6G6ig (envelope-from ); Tue, 16 Dec 2025 13:42:21 +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 v2 5/5] x86/io_delay: Add config option for controlling build of io_delay. Date: Tue, 16 Dec 2025 14:41:49 +0100 Message-ID: <20251216134150.2710-6-jgross@suse.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251216134150.2710-1-jgross@suse.com> References: <20251216134150.2710-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%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.987]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; R_RATELIMIT(0.00)[to_ip_from(RLfdszjqhz8kzzb9uwpzdm8png)]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,suse.com:mid,suse.com:email]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: X-Spam-Flag: NO X-Spam-Score: -6.80 Content-Type: text/plain; charset="utf-8" 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 --- 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 80527299f859..ae6da2bd6e44 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -3175,6 +3175,14 @@ config HAVE_ATOMIC_IOMAP def_bool y depends on X86_32 =20 +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" =20 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 =3D inb_p(base + reg); =20 +#ifdef CONFIG_IO_DELAY native_io_delay(); native_io_delay(); native_io_delay(); +#endif =20 return ret; } @@ -61,9 +63,11 @@ static inline void fd_outb(u8 value, u16 base, u16 reg) { outb_p(value, base + reg); =20 +#ifdef CONFIG_IO_DELAY native_io_delay(); native_io_delay(); native_io_delay(); +#endif } =20 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 9c4178f2d094..c5d19665b746 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, c= onst void *from, =20 #endif /* __KERNEL__ */ =20 +#ifdef CONFIG_IO_DELAY extern void native_io_delay(void); =20 extern int io_delay_type; @@ -254,6 +255,11 @@ static inline void slow_down_io(void) =20 native_io_delay(); } +#else +static inline void slow_down_io(void) +{ +} +#endif =20 #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 bc184dd38d99..f2bb6664b7ca 100644 --- a/arch/x86/kernel/Makefile +++ b/arch/x86/kernel/Makefile @@ -66,11 +66,12 @@ obj-$(CONFIG_X86_32) +=3D sys_ia32.o obj-$(CONFIG_IA32_EMULATION) +=3D sys_ia32.o signal_32.o obj-$(CONFIG_X86_64) +=3D sys_x86_64.o obj-$(CONFIG_X86_ESPFIX64) +=3D espfix_64.o +obj-$(CONFIG_IO_DELAY) +=3D io_delay.o obj-$(CONFIG_SYSFS) +=3D ksysfs.o obj-y +=3D bootflag.o e820.o obj-y +=3D pci-dma.o quirks.o kdebugfs.o obj-y +=3D alternative.o i8253.o hw_breakpoint.o -obj-y +=3D tsc.o tsc_msr.o io_delay.o rtc.o +obj-y +=3D tsc.o tsc_msr.o rtc.o obj-y +=3D resource.o obj-y +=3D irqflags.o obj-y +=3D 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[] =3D { .mode =3D 0444, .proc_handler =3D proc_dointvec, }, +#ifdef CONFIG_IO_DELAY { .procname =3D "io_delay_type", .data =3D &io_delay_type, @@ -190,6 +191,7 @@ static const struct ctl_table x86_sysctl_table[] =3D { .mode =3D 0644, .proc_handler =3D proc_dointvec, }, +#endif #if defined(CONFIG_ACPI_SLEEP) { .procname =3D "acpi_video_flags", --=20 2.51.0