staticvoid __kprobes patch_unmap(int fixmap)
{
clear_fixmap(fixmap);
} /* * In ARMv8-A, A64 instructions have a fixed length of 32 bits and are always * little-endian.
*/ int __kprobes aarch64_insn_read(void *addr, u32 *insnp)
{ int ret;
__le32 val;
ret = copy_from_kernel_nofault(&val, addr, AARCH64_INSN_SIZE); if (!ret)
*insnp = le32_to_cpu(val);
/** * aarch64_insn_copy - Copy instructions into (an unused part of) RX memory * @dst: address to modify * @src: source of the copy * @len: length to copy * * Useful for JITs to dump new code blocks into unused regions of RX memory.
*/
noinstr void *aarch64_insn_copy(void *dst, void *src, size_t len)
{ /* A64 instructions must be word aligned */ if ((uintptr_t)dst & 0x3) return NULL;
/** * aarch64_insn_set - memset for RX memory regions. * @dst: address to modify * @insn: value to set * @len: length of memory region. * * Useful for JITs to fill regions of RX memory with illegal instructions.
*/
noinstr void *aarch64_insn_set(void *dst, u32 insn, size_t len)
{ if ((uintptr_t)dst & 0x3) return NULL;
staticint __kprobes aarch64_insn_patch_text_cb(void *arg)
{ int i, ret = 0; struct aarch64_insn_patch *pp = arg;
/* The last CPU becomes master */ if (atomic_inc_return(&pp->cpu_count) == num_online_cpus()) { for (i = 0; ret == 0 && i < pp->insn_cnt; i++)
ret = aarch64_insn_patch_text_nosync(pp->text_addrs[i],
pp->new_insns[i]); /* Notify other processors with an additional increment. */
atomic_inc(&pp->cpu_count);
} else { while (atomic_read(&pp->cpu_count) <= num_online_cpus())
cpu_relax();
isb();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.