Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) // SPDX-License-Identifier: GPL-2.0-only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  * Copyright (C) 2013 Huawei Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * Author: Jiang Liu <liuj97@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  * Based on arch/arm/kernel/jump_label.c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #include <linux/kernel.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) #include <linux/jump_label.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <asm/insn.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) void arch_jump_label_transform(struct jump_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) 			       enum jump_label_type type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 	void *addr = (void *)jump_entry_code(entry);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) 	u32 insn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) 	if (type == JUMP_LABEL_JMP) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 		insn = aarch64_insn_gen_branch_imm(jump_entry_code(entry),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) 						   jump_entry_target(entry),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) 						   AARCH64_INSN_BRANCH_NOLINK);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 	} else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) 		insn = aarch64_insn_gen_nop();
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 	aarch64_insn_patch_text_nosync(addr, insn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) void arch_jump_label_transform_static(struct jump_entry *entry,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 				      enum jump_label_type type)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 	/*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	 * We use the architected A64 NOP in arch_static_branch, so there's no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	 * need to patch an identical A64 NOP over the top of it here. The core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 	 * will call arch_jump_label_transform from a module notifier if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	 * NOP needs to be replaced by a branch.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) }