Thread (31 messages) 31 messages, 6 authors, 2024-03-01

Re: [PATCH 4/6] arm64/io: Provide a WC friendly __iowriteXX_copy()

From: Catalin Marinas <catalin.marinas@arm.com>
Date: 2024-02-29 10:33:31
Also in: linux-arch, linux-patches, linux-rdma, linux-s390, llvm, netdev

On Tue, Feb 20, 2024 at 09:17:08PM -0400, Jason Gunthorpe wrote:
+						 const u32 *from, size_t count)
+{
+	switch (count) {
+	case 8:
+		asm volatile("str %w0, [%8, #4 * 0]\n"
+			     "str %w1, [%8, #4 * 1]\n"
+			     "str %w2, [%8, #4 * 2]\n"
+			     "str %w3, [%8, #4 * 3]\n"
+			     "str %w4, [%8, #4 * 4]\n"
+			     "str %w5, [%8, #4 * 5]\n"
+			     "str %w6, [%8, #4 * 6]\n"
+			     "str %w7, [%8, #4 * 7]\n"
+			     :
+			     : "rZ"(from[0]), "rZ"(from[1]), "rZ"(from[2]),
+			       "rZ"(from[3]), "rZ"(from[4]), "rZ"(from[5]),
+			       "rZ"(from[6]), "rZ"(from[7]), "r"(to));
+		break;
BTW, talking of maintenance, would a series of __raw_writel() with
Mark's recent patch for offset addressing generate similar code? I.e.:

		__raw_writel(from[0], to);
		__raw_writel(from[1], to + 1);
		...
		__raw_writel(from[7], to + 7);

(you may have mentioned it in previous threads, I did not check)

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help