lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 19 Apr 2019 11:36:37 -0700
From:   tip-bot for Daniel Bristot de Oliveira <tipbot@...or.com>
To:     linux-tip-commits@...r.kernel.org
Cc:     brgerst@...il.com, jkosina@...e.cz, mingo@...nel.org,
        jbaron@...mai.com, gregkh@...uxfoundation.org, hpa@...or.com,
        bristot@...hat.com, peterz@...radead.org, jolsa@...hat.com,
        mtosatti@...hat.com, rostedt@...dmis.org,
        alexander.shishkin@...ux.intel.com, dvlasenk@...hat.com,
        mhiramat@...nel.org, williams@...hat.com, jpoimboe@...hat.com,
        torvalds@...ux-foundation.org, bp@...en8.de, tglx@...utronix.de,
        acme@...hat.com, crecklin@...hat.com, linux-kernel@...r.kernel.org,
        swood@...hat.com, luto@...nel.org
Subject: [tip:x86/alternatives] jump_label: Add for_each_label_entry helper

Commit-ID:  b1b944f7230f4101b5a293d5ac3b7a9627ed5e6f
Gitweb:     https://git.kernel.org/tip/b1b944f7230f4101b5a293d5ac3b7a9627ed5e6f
Author:     Daniel Bristot de Oliveira <bristot@...hat.com>
AuthorDate: Fri, 21 Dec 2018 11:27:26 +0100
Committer:  Ingo Molnar <mingo@...nel.org>
CommitDate: Fri, 19 Apr 2019 19:37:34 +0200

jump_label: Add for_each_label_entry helper

Add a helper macro to make jump entry iteration code more readable.

Signed-off-by: Daniel Bristot de Oliveira <bristot@...hat.com>
Cc: Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Cc: Andy Lutomirski <luto@...nel.org>
Cc: Arnaldo Carvalho de Melo <acme@...hat.com>
Cc: Borislav Petkov <bp@...en8.de>
Cc: Brian Gerst <brgerst@...il.com>
Cc: Chris von Recklinghausen <crecklin@...hat.com>
Cc: Clark Williams <williams@...hat.com>
Cc: Denys Vlasenko <dvlasenk@...hat.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: H. Peter Anvin <hpa@...or.com>
Cc: Jason Baron <jbaron@...mai.com>
Cc: Jiri Kosina <jkosina@...e.cz>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Marcelo Tosatti <mtosatti@...hat.com>
Cc: Masami Hiramatsu <mhiramat@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Scott Wood <swood@...hat.com>
Cc: Steven Rostedt (VMware) <rostedt@...dmis.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Link: http://lkml.kernel.org/r/206640539a01e31b6f4ef4ef74962b1394e2f930.1545228276.git.bristot@redhat.com
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
 include/linux/jump_label.h | 3 +++
 kernel/jump_label.c        | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 3e113a1fa0f1..7e91af98bbb1 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -227,6 +227,9 @@ extern void static_key_disable(struct static_key *key);
 extern void static_key_enable_cpuslocked(struct static_key *key);
 extern void static_key_disable_cpuslocked(struct static_key *key);
 
+#define for_each_label_entry(key, entry, stop)				  \
+	for (; (entry < stop) && (jump_entry_key(entry) == key); entry++)
+
 /*
  * We should be using ATOMIC_INIT() for initializing .enabled, but
  * the inclusion of atomic.h is problematic for inclusion of jump_label.h
diff --git a/kernel/jump_label.c b/kernel/jump_label.c
index bad96b476eb6..288d630da22d 100644
--- a/kernel/jump_label.c
+++ b/kernel/jump_label.c
@@ -379,7 +379,7 @@ static void __jump_label_update(struct static_key *key,
 				struct jump_entry *stop,
 				bool init)
 {
-	for (; (entry < stop) && (jump_entry_key(entry) == key); entry++) {
+	for_each_label_entry(key, entry, stop) {
 		/*
 		 * An entry->code of 0 indicates an entry which has been
 		 * disabled because it was in an init text area.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ