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]
Message-ID: <20201110103909.GD2594@hirez.programming.kicks-ass.net>
Date:   Tue, 10 Nov 2020 11:39:09 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Frederic Weisbecker <frederic@...nel.org>
Cc:     LKML <linux-kernel@...r.kernel.org>, Mel Gorman <mgorman@...e.de>,
        Michal Hocko <mhocko@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        Ingo Molnar <mingo@...hat.com>, Michal Hocko <mhocko@...e.com>
Subject: Re: [RFC PATCH 4/7] preempt/dynamic: Provide cond_resched() and
 might_resched() static calls

On Tue, Nov 10, 2020 at 01:56:06AM +0100, Frederic Weisbecker wrote:

> +#ifdef CONFIG_PREEMPT_DYNAMIC
> +DEFINE_STATIC_CALL(cond_resched, __static_call_return0);
> +EXPORT_STATIC_CALL(cond_resched);
> +
> +DEFINE_STATIC_CALL(might_resched, __static_call_return0);
> +EXPORT_STATIC_CALL(might_resched);
>  #endif

I suppose we want the below and change the above to use
EXPORT_STATIC_CALL_TRAMP().

---
Subject: static_call: EXPORT_STATIC_CALL_TRAMP()
From: Peter Zijlstra <peterz@...radead.org>
Date: Tue Nov 10 11:37:48 CET 2020

For when we want to allow modules to call the static_call() but not
change it.

Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
---
 include/linux/static_call.h |   23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -160,13 +160,19 @@ extern int static_call_text_reserved(voi
 
 #define static_call_cond(name)	(void)__static_call(name)
 
+#define EXPORT_STATIC_CALL_TRAMP(name)					\
+	EXPORT_SYMBOL(STATIC_CALL_TRAMP(name))
+
 #define EXPORT_STATIC_CALL(name)					\
 	EXPORT_SYMBOL(STATIC_CALL_KEY(name));				\
-	EXPORT_SYMBOL(STATIC_CALL_TRAMP(name))
+	EXPORT_STATIC_CALL_TRAMP(name)
+
+#define EXPORT_STATIC_CALL_TRAMP_GPL(name)				\
+	EXPORT_SYMBOL_GPL(STATIC_CALL_TRAMP(name))
 
 #define EXPORT_STATIC_CALL_GPL(name)					\
 	EXPORT_SYMBOL_GPL(STATIC_CALL_KEY(name));			\
-	EXPORT_SYMBOL_GPL(STATIC_CALL_TRAMP(name))
+	EXPORT_STATIC_CALL_TRAMP_GPL(name)
 
 #elif defined(CONFIG_HAVE_STATIC_CALL)
 
@@ -206,13 +212,19 @@ static inline int static_call_text_reser
 	return 0;
 }
 
+#define EXPORT_STATIC_CALL_TRAMP(name)					\
+	EXPORT_SYMBOL(STATIC_CALL_TRAMP(name))
+
 #define EXPORT_STATIC_CALL(name)					\
 	EXPORT_SYMBOL(STATIC_CALL_KEY(name));				\
-	EXPORT_SYMBOL(STATIC_CALL_TRAMP(name))
+	EXPORT_STATIC_CALL_TRAMP(name)
+
+#define EXPORT_STATIC_CALL_TRAMP_GPL(name)				\
+	EXPORT_SYMBOL_GPL(STATIC_CALL_TRAMP(name))
 
 #define EXPORT_STATIC_CALL_GPL(name)					\
 	EXPORT_SYMBOL_GPL(STATIC_CALL_KEY(name));			\
-	EXPORT_SYMBOL_GPL(STATIC_CALL_TRAMP(name))
+	EXPORT_STATIC_CALL_TRAMP_GPL(name)
 
 #else /* Generic implementation */
 
@@ -269,6 +281,9 @@ static inline int static_call_text_reser
 	return 0;
 }
 
+#define EXPORT_STATIC_CALL_TRAMP(name)
+#define EXPORT_STATIC_CALL_TRAMP_GPL(name)
+
 #define EXPORT_STATIC_CALL(name)	EXPORT_SYMBOL(STATIC_CALL_KEY(name))
 #define EXPORT_STATIC_CALL_GPL(name)	EXPORT_SYMBOL_GPL(STATIC_CALL_KEY(name))
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ