[14/15] common/cnxk: add memory clobber to steor and ldeor

Message ID 20230303081013.589868-14-ndabilpuram@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Jerin Jacob
Headers
Series [01/15] net/cnxk: resolve sefgault caused during transmit completion |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Nithin Dabilpuram March 3, 2023, 8:10 a.m. UTC
  To avoid compiler reordering stores to LMT line and ldeor,
add clobber attribute to ldeor, steor etc.

Signed-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
---
 drivers/common/cnxk/roc_io.h | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
  

Patch

diff --git a/drivers/common/cnxk/roc_io.h b/drivers/common/cnxk/roc_io.h
index 1e5c1f8c04..af1a10cd66 100644
--- a/drivers/common/cnxk/roc_io.h
+++ b/drivers/common/cnxk/roc_io.h
@@ -130,7 +130,8 @@  roc_lmt_submit_ldeor(plt_iova_t io_address)
 
 	asm volatile(PLT_CPU_FEATURE_PREAMBLE "ldeor xzr, %x[rf], [%[rs]]"
 		     : [rf] "=r"(result)
-		     : [rs] "r"(io_address));
+		     : [rs] "r"(io_address)
+		     : "memory");
 	return result;
 }
 
@@ -141,7 +142,8 @@  roc_lmt_submit_ldeorl(plt_iova_t io_address)
 
 	asm volatile(PLT_CPU_FEATURE_PREAMBLE "ldeorl xzr,%x[rf],[%[rs]]"
 		     : [rf] "=r"(result)
-		     : [rs] "r"(io_address));
+		     : [rs] "r"(io_address)
+		     : "memory");
 	return result;
 }
 
@@ -150,7 +152,8 @@  roc_lmt_submit_steor(uint64_t data, plt_iova_t io_address)
 {
 	asm volatile(PLT_CPU_FEATURE_PREAMBLE
 		     "steor %x[d], [%[rs]]" ::[d] "r"(data),
-		     [rs] "r"(io_address));
+		     [rs] "r"(io_address)
+		     : "memory");
 }
 
 static __plt_always_inline void
@@ -158,7 +161,8 @@  roc_lmt_submit_steorl(uint64_t data, plt_iova_t io_address)
 {
 	asm volatile(PLT_CPU_FEATURE_PREAMBLE
 		     "steorl %x[d], [%[rs]]" ::[d] "r"(data),
-		     [rs] "r"(io_address));
+		     [rs] "r"(io_address)
+		     : "memory");
 }
 
 static __plt_always_inline void