hc
2024-11-01 2f529f9b558ca1c1bd74be7437a84e4711743404
kernel/arch/arm64/kernel/syscall.c
....@@ -2,6 +2,7 @@
22
33 #include <linux/compiler.h>
44 #include <linux/context_tracking.h>
5
+#include <linux/irqstage.h>
56 #include <linux/errno.h>
67 #include <linux/nospec.h>
78 #include <linux/ptrace.h>
....@@ -94,6 +95,7 @@
9495 const syscall_fn_t syscall_table[])
9596 {
9697 unsigned long flags = current_thread_info()->flags;
98
+ int ret;
9799
98100 regs->orig_x0 = regs->regs[0];
99101 regs->syscallno = scno;
....@@ -117,9 +119,18 @@
117119 */
118120
119121 cortex_a76_erratum_1463225_svc_handler();
122
+ WARN_ON_ONCE(dovetail_debug() &&
123
+ running_inband() && test_inband_stall());
120124 local_daif_restore(DAIF_PROCCTX);
121125
122
- if (flags & _TIF_MTE_ASYNC_FAULT) {
126
+ ret = pipeline_syscall(scno, regs);
127
+ if (ret > 0)
128
+ return;
129
+
130
+ if (ret < 0)
131
+ goto tail_work;
132
+
133
+ if (system_supports_mte() && (flags & _TIF_MTE_ASYNC_FAULT)) {
123134 /*
124135 * Process the asynchronous tag check fault before the actual
125136 * syscall. do_notify_resume() will send a signal to userspace
....@@ -159,11 +170,16 @@
159170 * check again. However, if we were tracing entry, then we always trace
160171 * exit regardless, as the old entry assembly did.
161172 */
173
+tail_work:
162174 if (!has_syscall_work(flags) && !IS_ENABLED(CONFIG_DEBUG_RSEQ)) {
163175 local_daif_mask();
176
+ stall_inband();
164177 flags = current_thread_info()->flags;
165
- if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP))
178
+ if (!has_syscall_work(flags) && !(flags & _TIF_SINGLESTEP)) {
179
+ unstall_inband();
166180 return;
181
+ }
182
+ unstall_inband();
167183 local_daif_restore(DAIF_PROCCTX);
168184 }
169185