octeontx2: use arch_extension to enable LSE
Subsystems (5)
PATCH 1/1 octeontx2: use arch_extension to enable LSE
Instead of using ".cpu generic+lse", use ".arch_extension lse" to enable LSE.
The ".cpu generic+lse" directive replaces the assembler's current feature set with generic+lse, dropping other previously enabled features. In contrast, ".arch_extension lse" enables LSE while preserving the current feature set.
For example, the following code is rejected with "selected processor does not support retaa", because ".cpu generic+lse" drops PAuth even though it was enabled by armv9-a:
.arch armv9-a
.text
.cpu generic+lse
retaa
We encountered this issue while building the kernel with GCC configured using --with-arch=armv9-a. Since Armv9-A includes pointer authentication, GCC can assume that PAuth instructions are available and may use retaa when generating PAuth-protected returns.
--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 2 +- include/linux/soc/marvell/octeontx2/asm.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1 -1
@@ -786,7 +786,7 @@ static inline u64 otx2_atomic64_add(u64 incr, void __iomem *addr)u64 __iomem *ptr = addr;u64 result; - __asm__volatile (".cpu generic+lse\n" + __asm__volatile (".arch_extension lse\n" "ldadd %x[i], %x[r], [%[b]]" : [r]"=r" (result),"+m" (*ptr) : [i]"r"(incr), [b]"r"(ptr)
include/linux/soc/marvell/octeontx2/asm.h +3 -3
@@ -17,7 +17,7 @@#define otx2_lmt_flush (ioaddr) \ ({ \ u64 result = 0; \ - __asm__ volatile(".cpu generic+lse\n" \ + __asm__ volatile(".arch_extension lse\n" \ "ldeor xzr, %x[rf], [%[rs]]" \ : [rf]"=r" (result) \ : [rs]"r" (ioaddr)); \
@@ -30,7 +30,7 @@*/ #define cn10k_lmt_flush (val, addr) \ ({ \ - __asm__ volatile(".cpu generic+lse\n" \ + __asm__ volatile(".arch_extension lse\n" \ "steorl %x[rf],[%[rs]]" \ : [rf] "+r"(val) \ : [rs] "r"(addr)); \
@@ -40,7 +40,7 @@ static inline u64 otx2_atomic64_fetch_add(u64 incr, u64 *ptr) {u64 result; - asmvolatile (".cpu generic+lse\n" + asmvolatile (".arch_extension lse\n" "ldadda %x[i], %x[r], [%[b]]" : [r]"=r" (result),"+m" (*ptr) : [i] "r" (incr), [b] "r" (ptr)
Signature · 1 line
2.47.3
Geethasowjanya Akula
maintainerQuoted 94 lines
-----Original Message-----
From: Emanuele Rocca <[email protected]>
Sent: Monday, October 5, 2026 9:52 PM
To: Sunil Kovvuri Goutham <[email protected]>
Cc: Geethasowjanya Akula <[email protected]>; Ratheesh Kannoth <[email protected]>; Subbaraya Sundeep Bhatta <[email protected]>; Bharat Bhushan <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Srujana Challa <[email protected]>; [email protected]; linux- [email protected]; [email protected]; linux-arm- [email protected]; Tamar Christina <[email protected]>; Jeremy Linton <[email protected]>; Emanuele Rocca <[email protected]>
Subject: [EXTERNAL] [PATCH net] octeontx2: usearch_extensionto enable LSEInstead of using ".cpu generic+lse", use ".arch_extension lse" to enable LSE.
The ".cpu generic+lse" directive replaces the assembler's current feature set with generic+lse, dropping other previously enabled features. In contrast, ".arch_extension lse" enables LSE while preserving the current feature set.
For example, the following code is rejected with "selected processor does not support retaa", because ".cpu generic+lse" drops PAuth even though it was enabled by armv9-a:
.arch armv9-a
.text
.cpu generic+lse
retaaWe encountered this issue while building the kernel with GCC configured using --with-arch=armv9-a. Since Armv9-A includes pointer authentication, GCC can assume that PAuth instructions are available and may use retaa when generating PAuth-protected returns.
Fixes caa2da34fd25a ("octeontx2-pf: Initialize and config queues")Signed-off-by Emanuele Rocca <[email protected]>---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h| 2 +-include/linux/soc/marvell/octeontx2/asm.h| 6 +++---2 files changed, 4 insertions(+), 4 deletions(-)drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1
-1@@ -786,7 +786,7 @@ static inline u64 otx2_atomic64_add(u64 incr, void __iomem *addr)u64 __iomem *ptr = addr;u64 result; - __asm__volatile (".cpu generic+lse\n" + __asm__volatile (".arch_extension lse\n" "ldadd %x[i], %x[r], [%[b]]" : [r]"=r"(result), "+m"(*ptr): [i]"r"(incr), [b]"r"(ptr)include/linux/soc/marvell/octeontx2/asm.h +3
-4@@ -17,7 +17,7 @@#define otx2_lmt_flush (ioaddr) \ ({ \ u64 result = 0; \ - __asm__ volatile(".cpu generic+lse\n" \ + __asm__ volatile(".arch_extension lse\n" \ "ldeor xzr, %x[rf], [%[rs]]" \ : [rf]"=r" (result) \ : [rs]"r" (ioaddr)); \@@ -30,7 +30,7 @@*/ #define cn10k_lmt_flush (val, addr) \ ({ \ - __asm__ volatile(".cpu generic+lse\n" \ + __asm__ volatile(".arch_extension lse\n" \ "steorl %x[rf],[%[rs]]" \ : [rf] "+r"(val) \ : [rs] "r"(addr)); \@@ -40,7 +40,7 @@ static inline u64 otx2_atomic64_fetch_add(u64 incr, u64 *ptr) {u64 result; - asm volatile (".cpu generic+lse\n" + asmvolatile (".arch_extension lse\n" "ldadda %x[i], %x[r], [%[b]]" : [r]"=r" (result),"+m" (*ptr) : [i] "r" (incr), [b] "r" (ptr) --
Quoted 1 line
2.47.3
Thanks for the patch.
We will verify these changes on our hardware and provide our feedback by tomorrow.
Geetha.
Quoted 94 lines
-----Original Message-----
From: Emanuele Rocca <[email protected]>
Sent: Monday, October 5, 2026 9:52 PM
To: Sunil Kovvuri Goutham <[email protected]>
Cc: Geethasowjanya Akula <[email protected]>; Ratheesh Kannoth <[email protected]>; Subbaraya Sundeep Bhatta <[email protected]>; Bharat Bhushan <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Srujana Challa <[email protected]>; [email protected]; linux- [email protected]; [email protected]; linux-arm- [email protected]; Tamar Christina <[email protected]>; Jeremy Linton <[email protected]>; Emanuele Rocca <[email protected]>
Subject: [EXTERNAL] [PATCH net] octeontx2: usearch_extensionto enable LSEInstead of using ".cpu generic+lse", use ".arch_extension lse" to enable LSE.
The ".cpu generic+lse" directive replaces the assembler's current feature set with generic+lse, dropping other previously enabled features. In contrast, ".arch_extension lse" enables LSE while preserving the current feature set.
For example, the following code is rejected with "selected processor does not support retaa", because ".cpu generic+lse" drops PAuth even though it was enabled by armv9-a:
.arch armv9-a
.text
.cpu generic+lse
retaaWe encountered this issue while building the kernel with GCC configured using --with-arch=armv9-a. Since Armv9-A includes pointer authentication, GCC can assume that PAuth instructions are available and may use retaa when generating PAuth-protected returns.
Fixes caa2da34fd25a ("octeontx2-pf: Initialize and config queues")Signed-off-by Emanuele Rocca <[email protected]>---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h| 2 +-include/linux/soc/marvell/octeontx2/asm.h| 6 +++---2 files changed, 4 insertions(+), 4 deletions(-)drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1
-1@@ -786,7 +786,7 @@ static inline u64 otx2_atomic64_add(u64 incr, void __iomem *addr)u64 __iomem *ptr = addr;u64 result; - __asm__volatile (".cpu generic+lse\n" + __asm__volatile (".arch_extension lse\n" "ldadd %x[i], %x[r], [%[b]]" : [r]"=r"(result), "+m"(*ptr): [i]"r"(incr), [b]"r"(ptr)include/linux/soc/marvell/octeontx2/asm.h +3
-4@@ -17,7 +17,7 @@#define otx2_lmt_flush (ioaddr) \ ({ \ u64 result = 0; \ - __asm__ volatile(".cpu generic+lse\n" \ + __asm__ volatile(".arch_extension lse\n" \ "ldeor xzr, %x[rf], [%[rs]]" \ : [rf]"=r" (result) \ : [rs]"r" (ioaddr)); \@@ -30,7 +30,7 @@*/ #define cn10k_lmt_flush (val, addr) \ ({ \ - __asm__ volatile(".cpu generic+lse\n" \ + __asm__ volatile(".arch_extension lse\n" \ "steorl %x[rf],[%[rs]]" \ : [rf] "+r"(val) \ : [rs] "r"(addr)); \@@ -40,7 +40,7 @@ static inline u64 otx2_atomic64_fetch_add(u64 incr, u64 *ptr) {u64 result; - asm volatile (".cpu generic+lse\n" + asmvolatile (".arch_extension lse\n" "ldadda %x[i], %x[r], [%[b]]" : [r]"=r" (result),"+m" (*ptr) : [i] "r" (incr), [b] "r" (ptr) --
Quoted 1 line
2.47.3
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Mon, 5 Oct 2026 18:21:37 +0200 you wrote:
Instead of using ".cpu generic+lse", use ".arch_extension lse" to enable LSE.
The ".cpu generic+lse" directive replaces the assembler's current feature set with generic+lse, dropping other previously enabled features. In contrast, ".arch_extension lse" enables LSE while preserving the current feature set.
[...]
Here is the summary with links:
- [net] octeontx2: use arch_extension to enable LSE
https://git.kernel.org/netdev/net-next/c/9142c2f8f84b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html