Lines Matching +full:no +full:- +full:sync +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0-only
86 * tagged, return non-zero to avoid KSM merging. If only one of the in memcmp_pages()
96 static inline void __mte_enable_kernel(const char *mode, unsigned long tcf) in __mte_enable_kernel() argument
98 /* Enable MTE Sync Mode for EL1. */ in __mte_enable_kernel()
103 pr_info_once("MTE: enabled in %s mode at EL1\n", mode); in __mte_enable_kernel()
110 * Make sure we enter this function when no PE has set in mte_enable_kernel_sync()
111 * async mode previously. in mte_enable_kernel_sync()
114 "MTE async mode enabled system wide!"); in mte_enable_kernel_sync()
124 * MTE async mode is set system wide by the first PE that in mte_enable_kernel_async()
128 * mode in between sync and async, this strategy needs in mte_enable_kernel_async()
141 * MTE asymm mode behaves as async mode for store in mte_enable_kernel_asymm()
142 * operations. The mode is set system wide by the in mte_enable_kernel_asymm()
146 * mode in between sync and async, this strategy needs in mte_enable_kernel_asymm()
153 * If the CPU does not support MTE asymmetric mode the in mte_enable_kernel_asymm()
154 * kernel falls back on synchronous mode which is the in mte_enable_kernel_asymm()
170 * because there is no indirect read subsequent to it in mte_check_tfsr_el1()
171 * (per ARM DDI 0487F.c table D13-1). in mte_check_tfsr_el1()
181 * This is where we actually resolve the system and process MTE mode
193 unsigned long sctlr = task->thread.sctlr_user; in mte_update_sctlr_user()
194 unsigned long mte_ctrl = task->thread.mte_ctrl; in mte_update_sctlr_user()
199 * If there is no overlap between the system preferred and in mte_update_sctlr_user()
214 sctlr |= SYS_FIELD_PREP_ENUM(SCTLR_EL1, TCF0, SYNC); in mte_update_sctlr_user()
215 task->thread.sctlr_user = sctlr; in mte_update_sctlr_user()
221 * SYS_GCR_EL1 will be set to current->thread.mte_ctrl value by in mte_update_gcr_excl()
228 ((task->thread.mte_ctrl >> MTE_CTRL_GCR_USER_EXCL_SHIFT) & in mte_update_gcr_excl()
241 BUG_ON(nr_inst != 1); /* Branch -> NOP */ in kasan_hw_tags_enable()
291 * CPU power-up. in mte_cpu_setup()
309 * RGSR_EL1.SEED must be non-zero for IRG to produce in mte_cpu_setup()
364 * If the system supports it and both sync and async modes are in set_mte_ctrl()
365 * specified then implicitly enable asymmetric mode. in set_mte_ctrl()
366 * Userspace could see a mix of both sync and async anyway due in set_mte_ctrl()
374 task->thread.mte_ctrl = mte_ctrl; in set_mte_ctrl()
379 update_sctlr_el1(task->thread.sctlr_user); in set_mte_ctrl()
389 u64 mte_ctrl = task->thread.mte_ctrl; in get_mte_ctrl()
413 void __user *buf = kiov->iov_base; in __access_remote_tags()
414 size_t len = kiov->iov_len; in __access_remote_tags()
419 return -EFAULT; in __access_remote_tags()
422 return -EIO; in __access_remote_tags()
444 if (!(vma->vm_flags & VM_MTE)) { in __access_remote_tags()
445 err = -EOPNOTSUPP; in __access_remote_tags()
458 tags = min(len, (PAGE_SIZE - offset) / MTE_GRANULE_SIZE); in __access_remote_tags()
473 len -= tags; in __access_remote_tags()
479 /* return an error if no tags copied */ in __access_remote_tags()
480 kiov->iov_len = buf - kiov->iov_base; in __access_remote_tags()
481 if (!kiov->iov_len) { in __access_remote_tags()
484 return -EIO; in __access_remote_tags()
486 return -EFAULT; in __access_remote_tags()
504 return -EPERM; in access_remote_tags()
506 if (!tsk->ptrace || (current != tsk->parent) || in access_remote_tags()
508 !ptracer_capable(tsk, mm->user_ns))) { in access_remote_tags()
510 return -EPERM; in access_remote_tags()
528 return -EIO; in mte_ptrace_copy_tags()
530 if (get_user(kiov.iov_base, &uiov->iov_base) || in mte_ptrace_copy_tags()
531 get_user(kiov.iov_len, &uiov->iov_len)) in mte_ptrace_copy_tags()
532 return -EFAULT; in mte_ptrace_copy_tags()
542 ret = put_user(kiov.iov_len, &uiov->iov_len); in mte_ptrace_copy_tags()
550 switch (per_cpu(mte_tcf_preferred, dev->id)) { in mte_tcf_preferred_show()
554 return sysfs_emit(buf, "sync\n"); in mte_tcf_preferred_show()
570 else if (sysfs_streq(buf, "sync")) in mte_tcf_preferred_store()
575 return -EINVAL; in mte_tcf_preferred_store()
578 per_cpu(mte_tcf_preferred, dev->id) = tcf; in mte_tcf_preferred_store()
626 return end - uaddr; in mte_probe_user_range()