Skip to content

Commit df717b9

Browse files
Li Qiangctmarinas
authored andcommitted
arm64: add unlikely hint to MTE async fault check in el0_svc_common
Add unlikely() hint to the _TIF_MTE_ASYNC_FAULT flag check in el0_svc_common() since asynchronous MTE faults are expected to be rare occurrences during normal system call execution. This optimization helps the compiler to improve instruction caching and branch prediction for the common case where no asynchronous MTE faults are pending, while maintaining correct behavior for the exceptional case where such faults need to be handled prior to system call execution. Signed-off-by: Li Qiang <liqiang01@kylinos.cn> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent 420cab0 commit df717b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/arm64/kernel/syscall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
9696
* (Similarly for HVC and SMC elsewhere.)
9797
*/
9898

99-
if (flags & _TIF_MTE_ASYNC_FAULT) {
99+
if (unlikely(flags & _TIF_MTE_ASYNC_FAULT)) {
100100
/*
101101
* Process the asynchronous tag check fault before the actual
102102
* syscall. do_notify_resume() will send a signal to userspace

0 commit comments

Comments
 (0)