Skip to contentSkip to conversation

eal/x86: fix 32-bit write-combined stores

PATCH In review Bruce Richardson 4 participants 4 messages Sep 6, 2024 – Oct 4, 2024

lore
Share & tools
lore
#0 lore raw

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

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")
---
 lib/eal/x86/include/rte_io.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/eal/x86/include/rte_io.h +1 -1
index 0e1fefdee1..5366e09c47 100644
@@ -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

Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Bruce Richardson

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.

Quoted 6 lines
Fixes 8a00dfc738fe ("eal: add write combining store")

---

Acked-by on v1 1/1
#2 lore raw
In reply to Bruce Richardson
Quoted 6 lines · Bruce Richardson

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.

Quoted 6 lines
Fixes 8a00dfc738fe ("eal: add write combining store")

---

#3 lore raw
In reply to Bruce Richardson
Quoted 11 lines · Bruce Richardson

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")

Thanks for the fix, and reviews.
Applied.

Signature · 1 line
David Marchand