[PATCH] eal/x86: fix 32-bit write-combined stores

Bruce Richardson bruce.richardson at intel.com
Fri Sep 6 15:27:57 CEST 2024


The "movdiri" instruction is given as a series of bytes in rte_io.h so
that it works on compilers/assemblers which are unaware of the
instruction. The REX prefix (0x40) on this instruction is invalid for
32-bit code, causing issues. Thankfully, the prefix is unnecessary in
64-bit code, since the data size used is 32-bits.

Fixes: 8a00dfc738fe ("eal: add write combining store")
Cc: radu.nicolau at intel.com
Cc: stable at dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
---
 lib/eal/x86/include/rte_io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/eal/x86/include/rte_io.h b/lib/eal/x86/include/rte_io.h
index 0e1fefdee1..5366e09c47 100644
--- a/lib/eal/x86/include/rte_io.h
+++ b/lib/eal/x86/include/rte_io.h
@@ -24,7 +24,7 @@ __rte_x86_movdiri(uint32_t value, volatile void *addr)
 {
 	asm volatile(
 		/* MOVDIRI */
-		".byte 0x40, 0x0f, 0x38, 0xf9, 0x02"
+		".byte 0x0f, 0x38, 0xf9, 0x02"
 		:
 		: "a" (value), "d" (addr));
 }
--
2.43.0



More information about the dev mailing list