summaryrefslogtreecommitdiffstats
path: root/kernel/jump_label.c
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2015-07-24 14:45:44 +0200
committerIngo Molnar <mingo@kernel.org>2015-08-03 11:34:12 +0200
commit76b235c6bcb16062d663e2ee96db0b69f2e6bc14 (patch)
tree60355848b836cd6b52228bedfbabc1631c4c905e /kernel/jump_label.c
parentMerge branch 'x86/asm' into locking/core (diff)
downloadlinux-76b235c6bcb16062d663e2ee96db0b69f2e6bc14.tar.xz
linux-76b235c6bcb16062d663e2ee96db0b69f2e6bc14.zip
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: a833581e372a ("x86, perf: Fix static_key bug in load_mm_cr4()") Signed-off-by: Peter 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: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/jump_label.c')
-rw-r--r--kernel/jump_label.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index 52ebaca1b9fc..96d8945c8bf3 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -65,9 +65,9 @@ void static_key_slow_inc(struct static_key *key)
jump_label_lock();
if (atomic_read(&key->enabled) == 0) {
if (!jump_label_get_branch_default(key))
- jump_label_update(key, JUMP_LABEL_ENABLE);
+ jump_label_update(key, JUMP_LABEL_JMP);
else
- jump_label_update(key, JUMP_LABEL_DISABLE);
+ jump_label_update(key, JUMP_LABEL_NOP);
}
atomic_inc(&key->enabled);
jump_label_unlock();
@@ -88,9 +88,9 @@ static void __static_key_slow_dec(struct static_key *key,
schedule_delayed_work(work, rate_limit);
} else {
if (!jump_label_get_branch_default(key))
- jump_label_update(key, JUMP_LABEL_DISABLE);
+ jump_label_update(key, JUMP_LABEL_NOP);
else
- jump_label_update(key, JUMP_LABEL_ENABLE);
+ jump_label_update(key, JUMP_LABEL_JMP);
}
jump_label_unlock();
}
@@ -184,9 +184,9 @@ static enum jump_label_type jump_label_type(struct static_key *key)
bool state = static_key_enabled(key);
if ((!true_branch && state) || (true_branch && !state))
- return JUMP_LABEL_ENABLE;
+ return JUMP_LABEL_JMP;
- return JUMP_LABEL_DISABLE;
+ return JUMP_LABEL_NOP;
}
void __init jump_label_init(void)
@@ -276,7 +276,7 @@ void jump_label_apply_nops(struct module *mod)
return;
for (iter = iter_start; iter < iter_stop; iter++) {
- arch_jump_label_transform_static(iter, JUMP_LABEL_DISABLE);
+ arch_jump_label_transform_static(iter, JUMP_LABEL_NOP);
}
}
@@ -318,8 +318,8 @@ static int jump_label_add_module(struct module *mod)
jlm->next = key->next;
key->next = jlm;
- if (jump_label_type(key) == JUMP_LABEL_ENABLE)
- __jump_label_update(key, iter, iter_stop, JUMP_LABEL_ENABLE);
+ if (jump_label_type(key) == JUMP_LABEL_JMP)
+ __jump_label_update(key, iter, iter_stop, JUMP_LABEL_JMP);
}
return 0;