Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 76b235c6 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

jump_label: Rename JUMP_LABEL_{EN,DIS}ABLE to JUMP_LABEL_{JMP,NOP}



Since we've already stepped away from ENABLE is a JMP and DISABLE is a
NOP with the branch_default bits, and are going to make it even worse,
rename it to make it all clearer.

This way we don't mix multiple levels of logic attributes, but have a
plain 'physical' name for what the current instruction patching status
of a jump label is.

This is a first step in removing the naming confusion that has led to
a stream of avoidable bugs such as:

  a833581e ("x86, perf: Fix static_key bug in load_mm_cr4()")

Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
[ Beefed up the changelog. ]
Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent f320ead7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ static void __arch_jump_label_transform(struct jump_entry *entry,
	void *addr = (void *)entry->code;
	unsigned int insn;

	if (type == JUMP_LABEL_ENABLE)
	if (type == JUMP_LABEL_JMP)
		insn = arm_gen_branch(entry->code, entry->target);
	else
		insn = arm_gen_nop();
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ void arch_jump_label_transform(struct jump_entry *entry,
	void *addr = (void *)entry->code;
	u32 insn;

	if (type == JUMP_LABEL_ENABLE) {
	if (type == JUMP_LABEL_JMP) {
		insn = aarch64_insn_gen_branch_imm(entry->code,
						   entry->target,
						   AARCH64_INSN_BRANCH_NOLINK);
+1 −1
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@ void arch_jump_label_transform(struct jump_entry *e,
	/* Target must have the right alignment and ISA must be preserved. */
	BUG_ON((e->target & J_ALIGN_MASK) != J_ISA_BIT);

	if (type == JUMP_LABEL_ENABLE) {
	if (type == JUMP_LABEL_JMP) {
		insn.j_format.opcode = J_ISA_BIT ? mm_j32_op : j_op;
		insn.j_format.target = e->target >> J_RANGE_SHIFT;
	} else {
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ void arch_jump_label_transform(struct jump_entry *entry,
{
	u32 *addr = (u32 *)(unsigned long)entry->code;

	if (type == JUMP_LABEL_ENABLE)
	if (type == JUMP_LABEL_JMP)
		patch_branch(addr, entry->target, 0);
	else
		patch_instruction(addr, PPC_INST_NOP);
+1 −1
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ static void __jump_label_transform(struct jump_entry *entry,
{
	struct insn old, new;

	if (type == JUMP_LABEL_ENABLE) {
	if (type == JUMP_LABEL_JMP) {
		jump_label_make_nop(entry, &old);
		jump_label_make_branch(entry, &new);
	} else {
Loading