From nobody Mon Feb 9 19:26:49 2026 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [81.169.146.165]) (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 36D3C290F for ; Wed, 29 Jan 2025 09:45:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=81.169.146.165 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738143922; cv=pass; b=aVhGwufWPXvNATRqEFjsF6InZIQnzReQkXU0jTNSZ29W/wCQS9pbWKnXKyFRvHbZAv9TKXC5WmRqdI5XKd26z9Hp+QztqNoSPO4OVlKKVrD8s9KevnrwufLu+y4PHt1+fs+Bz7dWHrsI4NGh6yQMDkHN5R+t21oKzcEX5J11lB4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738143922; c=relaxed/simple; bh=Rn/up2TT5BaDijJlkgcwvqfb6i9n85Soa65HOXWBz3M=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=qWXh0FLNOxaP6Ej51maAZcG6r9P9H3v66sYMwlnu28VCa1nAp1Mos6j+CnvgqP59SnrPXDgMurOhnceuX4jLZjEnnSJHft/9O6SOle2FkRn1zNe0SLFQBvvmsvVjB5qt1aMAU+o68nf0ieRZRuIxIWP9WbUbjvKAY9miEjpNrk0= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=outer-limits.org; spf=none smtp.mailfrom=outer-limits.org; dkim=pass (2048-bit key) header.d=outer-limits.org header.i=@outer-limits.org header.b=aaTlBvrQ; dkim=permerror (0-bit key) header.d=outer-limits.org header.i=@outer-limits.org header.b=crkXNF/X; arc=pass smtp.client-ip=81.169.146.165 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=outer-limits.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=outer-limits.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=outer-limits.org header.i=@outer-limits.org header.b="aaTlBvrQ"; dkim=permerror (0-bit key) header.d=outer-limits.org header.i=@outer-limits.org header.b="crkXNF/X" ARC-Seal: i=1; a=rsa-sha256; t=1738143917; cv=none; d=strato.com; s=strato-dkim-0002; b=DAwyRj3+axJ97RcksMS6tBXFfDVf9TO7ptOyzOc/eGXqjbIYX9B3uUIiaEhA67jcj6 K0+KT/clkppF7Hl7qSnREiRx1ByobEmbSYOCFtNfdLjp0+jvTB6T4wLjyMG4yOTIiUGv TrPis/x9xgKn05ZimjuUfReIAeoDXhZHB1y+VjZfHeTQyY/nBTLlhUV6YUcmKtKdOIw7 VSgluCT8JkpY/DHnytrOB1vgktN6amXAUOL1TuiycyaoIIMic0pgw4+7hn2EVzKWMdr8 GBb5qud/joLHlyFjok16msR6mABC5qhjFChSSgDLwn9tZqjbuE0EbxMmhEZL1W5Svl8q xHiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1738143917; s=strato-dkim-0002; d=strato.com; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=3b+Zqr6HieW55Jt4gOhnbTAk0MRxpyqhi78YbnYzbqM=; b=kRp3bKb2b3b3LGDH3CKf8wd2nQm/RASWRovTMTExJEn30fqhLtxwpwDk7KRzu41h7B j+/l7Ae94TMoer/hBwL0K9vsQtsBgWMy8Sug2E2Ddg2DbF70S5XOajaeiZBIjhtKU5vE CwG5DRAVfgKwVB04Sa0pcQg4h86CuRuzB2jh9JwmudGjN7yfzGS89nK4SBFdxv24KxyT VTF+2LN45w0b3mEjWona7Jzjo8jvrA3vb6GVr2mtRGJfSYEExsnpICnWMbn9QHmLL6gU W3DA0hAXd/BvegVGtxsobtI/qR+DGlp86YS056n2DXqKQ/NWm8r/XopvsDD9P2EqZT7g mkUg== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo01 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1738143917; s=strato-dkim-0002; d=outer-limits.org; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=3b+Zqr6HieW55Jt4gOhnbTAk0MRxpyqhi78YbnYzbqM=; b=aaTlBvrQwo4+2Hzk6pZLuKjKa0KOUtHfDPeetbFQc1SnIVDNZj9JjuV9BKK6M14qJn IvaD3whgyXDRAn7gSIF14ZmEdwMVJBiBBcx2DMEIT9cjUUhWLuTb33XRVgiSkO67kHH3 CHVrxIIFhmqN9l/amy5eKNk/USxnWOb8qNK3MJELObgY0StmZtBnXVUHZ77GNEaCGCBz 2TDvdX6pTzkuTKWkutip4g9pOQ347IlIOyGvZh/33wtsnal8Tq8ZrGdQ93baAObcH6aZ crcPDhwX2lup+cTUCfjdTOlol5sIqILOyrQhpdOnOhgfdt7HqQsZyE/THZgQ0wOnZ9AJ onxw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1738143917; s=strato-dkim-0003; d=outer-limits.org; h=Message-Id:Date:Subject:Cc:To:From:Cc:Date:From:Subject:Sender; bh=3b+Zqr6HieW55Jt4gOhnbTAk0MRxpyqhi78YbnYzbqM=; b=crkXNF/XMrarDkT/I6lTIAz/7UiwAxjaWX84nnKMy8pZkrhQcEZJHmrvetsMSJl7lW EbNB/ZPhQokiHFvBrqAA== X-RZG-AUTH: ":JnkIfEGmW/AMJS6HttH4FbRVwc4dHlPLCp4e/IoHo8zEMMHAgwTfqBEHcVJSv9P5mRTGd2ImeA==" Received: from ws2104.lan.kalrayinc.com by smtp.strato.de (RZmta 51.2.17 AUTH) with ESMTPSA id J1a25110T9jGEM2 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 29 Jan 2025 10:45:16 +0100 (CET) From: Julian Vetter To: Arnd Bergmann , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Naveen N Rao Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Julian Vetter Subject: [PATCH v2] powerpc: Remove eieio() in PowerPC IO functions Date: Wed, 29 Jan 2025 10:45:10 +0100 Message-Id: <20250129094510.2038339-1-julian@outer-limits.org> X-Mailer: git-send-email 2.34.1 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 Content-Type: text/plain; charset="utf-8" Remove the eieio() calls in IO functions for PowerPC. While other architectures permit prefetching, combining, and reordering, the eieio() calls on PowerPC prevent such optimizations. This has only historical reasons, because in the early arch/powerpc64 code also readl() had these eieio() calls, but later went through several iterations which subsequently removed them. While the _memcpy_fromio and ins{b,l,w} functions stayed with the old implementation. Signed-off-by: Julian Vetter --- Changes for v2: - Removed eieio() calls also from other functions in io.c - Rephrased commit message --- arch/powerpc/kernel/io.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/powerpc/kernel/io.c b/arch/powerpc/kernel/io.c index 6af535905984..d643ec4a201d 100644 --- a/arch/powerpc/kernel/io.c +++ b/arch/powerpc/kernel/io.c @@ -34,7 +34,6 @@ void _insb(const volatile u8 __iomem *port, void *buf, lo= ng count) asm volatile("sync"); do { tmp =3D *(const volatile u8 __force *)port; - eieio(); *tbuf++ =3D tmp; } while (--count !=3D 0); asm volatile("twi 0,%0,0; isync" : : "r" (tmp)); @@ -65,7 +64,6 @@ void _insw_ns(const volatile u16 __iomem *port, void *buf= , long count) asm volatile("sync"); do { tmp =3D *(const volatile u16 __force *)port; - eieio(); *tbuf++ =3D tmp; } while (--count !=3D 0); asm volatile("twi 0,%0,0; isync" : : "r" (tmp)); @@ -96,7 +94,6 @@ void _insl_ns(const volatile u32 __iomem *port, void *buf= , long count) asm volatile("sync"); do { tmp =3D *(const volatile u32 __force *)port; - eieio(); *tbuf++ =3D tmp; } while (--count !=3D 0); asm volatile("twi 0,%0,0; isync" : : "r" (tmp)); @@ -155,21 +152,18 @@ void _memcpy_fromio(void *dest, const volatile void _= _iomem *src, __asm__ __volatile__ ("sync" : : : "memory"); while(n && (!IO_CHECK_ALIGN(vsrc, 4) || !IO_CHECK_ALIGN(dest, 4))) { *((u8 *)dest) =3D *((volatile u8 *)vsrc); - eieio(); vsrc++; dest++; n--; } while(n >=3D 4) { *((u32 *)dest) =3D *((volatile u32 *)vsrc); - eieio(); vsrc +=3D 4; dest +=3D 4; n -=3D 4; } while(n) { *((u8 *)dest) =3D *((volatile u8 *)vsrc); - eieio(); vsrc++; dest++; n--; --=20 2.34.1