Skip to contentSkip to conversation

riscv: vector: Fix output operands in context save

PATCH In review Aurelien Jarno 2 participants 2 messages Sep 11 – Sep 19 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: vector: Fix output operands in context save

The __vstate_csr_save() inline assembly declares vcsr as an output operand while the assembly only writes vstart, vtype, and vl. Remove it as it is later saved by the C code.

Fixes d863910eabaf ("riscv: vector: Support xtheadvector save/restore")
---
 arch/riscv/include/asm/vector.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/riscv/include/asm/vector.h +2 -2
index fffe72a77208..064a24c89d74 100644
@@ -137,8 +137,8 @@ static __always_inline void __vstate_csr_save(struct __riscv_v_ext_state *dest)
 		"csrr	%0, " __stringify(CSR_VSTART) "\n\t"
 		"csrr	%1, " __stringify(CSR_VTYPE) "\n\t"
 		"csrr	%2, " __stringify(CSR_VL) "\n\t"
-		: "=r" (dest->vstart), "=r" (dest->vtype), "=r" (dest->vl),
-		"=r" (dest->vcsr) : :);
+		: "=r" (dest->vstart), "=r" (dest->vtype), "=r" (dest->vl)
+		: :);
 
 	if (has_xtheadvector()) {
 		unsigned long status;
Signature · 1 line
2.53.0
maintainer
#1 lore raw
Quoted 6 lines · Aurelien Jarno

The __vstate_csr_save() inline assembly declares vcsr as an output operand while the assembly only writes vstart, vtype, and vl. Remove it as it is later saved by the C code.

Fixes d863910eabaf ("riscv: vector: Support xtheadvector save/restore")

Thanks, queued for v7.3-rc.

- Paul