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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 21 Mar 2023 21:00:08 -0700
From:   Josh Poimboeuf <jpoimboe@...nel.org>
To:     x86@...nel.org
Cc:     linux-kernel@...r.kernel.org,
        Peter Zijlstra <peterz@...radead.org>,
        Mark Rutland <mark.rutland@....com>,
        Jason Baron <jbaron@...mai.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Ard Biesheuvel <ardb@...nel.org>,
        Christophe Leroy <christophe.leroy@...roup.eu>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Sean Christopherson <seanjc@...gle.com>,
        Sami Tolvanen <samitolvanen@...gle.com>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Will McVicker <willmcvicker@...gle.com>,
        Kees Cook <keescook@...omium.org>,
        linux-arm-kernel@...ts.infradead.org
Subject: [PATCH v2 02/11] static_call: Flip key type union bit

Flip the meaning of the key->type union field.  This will make it easier
to converge some of the DECLARE_STATIC_CALL() macros.

Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
---
 include/linux/static_call.h             | 3 ---
 include/linux/static_call_types.h       | 4 ++--
 tools/include/linux/static_call_types.h | 4 ++--
 3 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/include/linux/static_call.h b/include/linux/static_call.h
index 141e6b176a1b..f984b8f6d974 100644
--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -186,7 +186,6 @@ extern long __static_call_return0(void);
 	DECLARE_STATIC_CALL(name, _func);				\
 	struct static_call_key STATIC_CALL_KEY(name) = {		\
 		.func = _func,						\
-		.type = 1,						\
 	};								\
 	ARCH_DEFINE_STATIC_CALL_TRAMP(name, _func)
 
@@ -194,7 +193,6 @@ extern long __static_call_return0(void);
 	DECLARE_STATIC_CALL(name, _func);				\
 	struct static_call_key STATIC_CALL_KEY(name) = {		\
 		.func = NULL,						\
-		.type = 1,						\
 	};								\
 	ARCH_DEFINE_STATIC_CALL_NULL_TRAMP(name)
 
@@ -202,7 +200,6 @@ extern long __static_call_return0(void);
 	DECLARE_STATIC_CALL(name, _func);				\
 	struct static_call_key STATIC_CALL_KEY(name) = {		\
 		.func = __static_call_return0,				\
-		.type = 1,						\
 	};								\
 	ARCH_DEFINE_STATIC_CALL_RET0_TRAMP(name)
 
diff --git a/include/linux/static_call_types.h b/include/linux/static_call_types.h
index 87c3598609e8..c4c4efb6f6fa 100644
--- a/include/linux/static_call_types.h
+++ b/include/linux/static_call_types.h
@@ -61,10 +61,10 @@ struct static_call_site {
 struct static_call_key {
 	void *func;
 	union {
-		/* bit 0: 0 = mods, 1 = sites */
+		/* bit 0: 0 = sites, 1 = mods */
 		unsigned long type;
-		struct static_call_mod *_mods;
 		struct static_call_site *_sites;
+		struct static_call_mod *_mods;
 	};
 };
 
diff --git a/tools/include/linux/static_call_types.h b/tools/include/linux/static_call_types.h
index 87c3598609e8..c4c4efb6f6fa 100644
--- a/tools/include/linux/static_call_types.h
+++ b/tools/include/linux/static_call_types.h
@@ -61,10 +61,10 @@ struct static_call_site {
 struct static_call_key {
 	void *func;
 	union {
-		/* bit 0: 0 = mods, 1 = sites */
+		/* bit 0: 0 = sites, 1 = mods */
 		unsigned long type;
-		struct static_call_mod *_mods;
 		struct static_call_site *_sites;
+		struct static_call_mod *_mods;
 	};
 };
 
-- 
2.39.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ