git: d920ff6f23f5 - stable/13 - Trap SVE instructions until we have SVE support

From: Andrew Turner <andrew_at_FreeBSD.org>
Date: Tue, 19 Jul 2022 07:37:23 UTC
The branch stable/13 has been updated by andrew:

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

commit d920ff6f23f5821e6bd09940432339d1755d5e7a
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2022-06-24 11:50:28 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2022-07-19 07:03:30 +0000

    Trap SVE instructions until we have SVE support
    
    When running on hardware that supports SVE send the correct signal when
    an SVE instruction is run.
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit ffa5bf8b600a77838be8fbf383382a2e7bafedc6)
---
 sys/arm64/arm64/trap.c     | 5 +++++
 sys/arm64/include/armreg.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/sys/arm64/arm64/trap.c b/sys/arm64/arm64/trap.c
index e9afbd47c0af..e845f998633a 100644
--- a/sys/arm64/arm64/trap.c
+++ b/sys/arm64/arm64/trap.c
@@ -585,6 +585,11 @@ do_el0_sync(struct thread *td, struct trapframe *frame)
 		panic("VFP exception in userland");
 #endif
 		break;
+	case EXCP_SVE:
+		call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)frame->tf_elr,
+		    exception);
+		userret(td, frame);
+		break;
 	case EXCP_SVC32:
 	case EXCP_SVC64:
 		svc_handler(td, frame);
diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h
index 1e7fefd70dc6..c164ebe9ece6 100644
--- a/sys/arm64/include/armreg.h
+++ b/sys/arm64/include/armreg.h
@@ -301,6 +301,7 @@
 #define	 EXCP_SVC64		0x15	/* SVC trap for AArch64 */
 #define	 EXCP_HVC		0x16	/* HVC trap */
 #define	 EXCP_MSR		0x18	/* MSR/MRS trap */
+#define	 EXCP_SVE		0x19	/* SVE trap */
 #define	 EXCP_FPAC		0x1c	/* Faulting PAC trap */
 #define	 EXCP_INSN_ABORT_L	0x20	/* Instruction abort, from lower EL */
 #define	 EXCP_INSN_ABORT	0x21	/* Instruction abort, from same EL */