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

Message ID 20240906132757.457921-1-bruce.richardson@intel.com (mailing list archive)
State Accepted
Delegated to: David Marchand
Headers
Series eal/x86: fix 32-bit write-combined stores |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS

Commit Message

Bruce Richardson Sept. 6, 2024, 1:27 p.m. UTC
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@intel.com
Cc: stable@dpdk.org

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

--
2.43.0
  

Comments

Radu Nicolau Sept. 6, 2024, 3:18 p.m. UTC | #1
On 06-Sep-24 2:27 PM, Bruce Richardson wrote:
> 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@intel.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
Acked-by: Radu Nicolau <radu.nicolau@intel.com>
  
Tyler Retzlaff Sept. 12, 2024, 5:56 a.m. UTC | #2
On Fri, Sep 06, 2024 at 02:27:57PM +0100, Bruce Richardson wrote:
> 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@intel.com
> Cc: stable@dpdk.org
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  
David Marchand Oct. 4, 2024, 2:45 p.m. UTC | #3
On Fri, Sep 6, 2024 at 3:28 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> 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: stable@dpdk.org
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>

Thanks for the fix, and reviews.
Applied.
  

Patch

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));
 }