git: ce5a07a9d2c5 - stable/14 - arm64: Stop trashing x28 in savectx

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Mon, 21 Oct 2024 15:05:20 UTC
The branch stable/14 has been updated by andrew:

URL: https://cgit.FreeBSD.org/src/commit/?id=ce5a07a9d2c58b65bbce5609834af63c5ff7e85d

commit ce5a07a9d2c58b65bbce5609834af63c5ff7e85d
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2024-10-15 08:30:17 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2024-10-21 15:03:27 +0000

    arm64: Stop trashing x28 in savectx
    
    While here make it return void, we don't set any useful return value
    and nothing checks for it.
    
    Sponsored by:   Arm Ltd
    
    (cherry picked from commit a7c5c88cb29ff512467a6599f1b4d8e2b8817480)
---
 sys/arm64/arm64/swtch.S | 10 ++++------
 sys/arm64/include/pcb.h |  2 +-
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/sys/arm64/arm64/swtch.S b/sys/arm64/arm64/swtch.S
index 882bfd7cf05a..85752dd6fc86 100644
--- a/sys/arm64/arm64/swtch.S
+++ b/sys/arm64/arm64/swtch.S
@@ -265,13 +265,11 @@ ENTRY(savectx)
 	mrs	x6, tpidr_el0
 	stp	x5, x6, [x0, #PCB_SP]
 
-	/* Store the VFP registers */
 #ifdef VFP
-	mov	x28, lr
-	bl	vfp_save_state_savectx
-	mov	lr, x28
-#endif
-
+	/* Store the VFP registers */
+	b	vfp_save_state_savectx
+#else
 	ret
+#endif
 END(savectx)
 
diff --git a/sys/arm64/include/pcb.h b/sys/arm64/include/pcb.h
index 273b53cdc6cf..c0feb1149cf5 100644
--- a/sys/arm64/include/pcb.h
+++ b/sys/arm64/include/pcb.h
@@ -85,7 +85,7 @@ struct pcb {
 
 #ifdef _KERNEL
 void	makectx(struct trapframe *tf, struct pcb *pcb);
-int	savectx(struct pcb *pcb) __returns_twice;
+void	savectx(struct pcb *pcb) __returns_twice;
 #endif
 
 #endif /* !LOCORE */