Skip to contentSkip to conversation

RISC-V: Document that V registers are clobbered on syscalls

PATCH Superseded Palmer Dabbelt 2 participants 3 messages Jun 19, 2023

Subsystems (2)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 RISC-V: Document that V registers are clobbered on syscalls

This is included in the ISA manual, but it's pretty common for bits of the ISA manual that are actually ABI to change. So let's document it explicitly.

---
Changes since v1 <[email protected]>:

* Remove the code change, just update the documentation. We might still want to do something in the code, but that's still under discussion so let's get the docs sorted out for now.

---
 Documentation/riscv/vector.rst | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/riscv/vector.rst +6 -0
index 48f189d79e41..96f0fedece73 100644
@@ -130,3 +130,9 @@ processes in form of sysctl knob:
 
     Modifying the system default enablement status does not affect the enablement
     status of any existing process of thread that do not make an execve() call.
+
+3.  Vector Register State Across System Calls
+---------------------------------------------
+
+As indicated by version 1.0 of the V extension, vector registers are clobbered
+by system calls.
Signature · 7 lines
2.40.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
Reviewed-by on v2 1/1
#1 lore raw
Quoted 20 lines · Palmer Dabbelt

This is included in the ISA manual, but it's pretty common for bits of the ISA manual that are actually ABI to change. So let's document it explicitly.

---
Changes since v1 <[email protected]>:

* Remove the code change, just update the documentation. We might still want to do something in the code, but that's still under discussion so let's get the docs sorted out for now.

---
 Documentation/riscv/vector.rst | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/riscv/vector.rst +0 -0
index 48f189d79e41..96f0fedece73 100644

Documentation/riscv/vector.rst processes in form of sysctl knob: · line 138

Quoted 9 lines
Documentation/riscv/vector.rst +6 -0
@@ -130,3 +130,9 @@ processes in form of sysctl knob:
 
     Modifying the system default enablement status does not affect the enablement
     status of any existing process of thread that do not make an execve() call.
+
+3.  Vector Register State Across System Calls
+---------------------------------------------
+
+As indicated by version 1.0 of the V extension, vector registers are clobbered
+by system calls.

Maybe add a reference to the spec [1]?

Regardless if that is added, or not:

[1] https://github.com/riscv/riscv-v-spec/blob/master/calling-convention.adoc

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#2 lore raw
Quoted 34 lines · On Mon, 19 Jun 2023 11:37:38 PDT (-0700), [email protected] wrote:
Quoted 20 lines · Palmer Dabbelt

This is included in the ISA manual, but it's pretty common for bits of the ISA manual that are actually ABI to change. So let's document it explicitly.

---
Changes since v1 <[email protected]>:

* Remove the code change, just update the documentation. We might still want to do something in the code, but that's still under discussion so let's get the docs sorted out for now.

---
 Documentation/riscv/vector.rst | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/riscv/vector.rst +0 -0
index 48f189d79e41..96f0fedece73 100644

Documentation/riscv/vector.rst processes in form of sysctl knob: · line 138

Quoted 9 lines
Documentation/riscv/vector.rst +6 -0
@@ -130,3 +130,9 @@ processes in form of sysctl knob:
 
     Modifying the system default enablement status does not affect the enablement
     status of any existing process of thread that do not make an execve() call.
+
+3.  Vector Register State Across System Calls
+---------------------------------------------
+
+As indicated by version 1.0 of the V extension, vector registers are clobbered
+by system calls.

Maybe add a reference to the spec [1]?

Quoted 4 lines

Regardless if that is added, or not:

[1] https://github.com/riscv/riscv-v-spec/blob/master/calling-convention.adoc

Seems reasonable, I just sent a v3

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv