[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200815031908.1015049-6-joel@joelfernandes.org>
Date: Fri, 14 Aug 2020 23:19:01 -0400
From: "Joel Fernandes (Google)" <joel@...lfernandes.org>
To: linux-kernel@...r.kernel.org
Cc: "Joel Fernandes (Google)" <joel@...lfernandes.org>,
Aaron Lu <aaron.lwe@...il.com>,
Aubrey Li <aubrey.li@...ux.intel.com>,
Julien Desfossez <jdesfossez@...italocean.com>,
Kees Cook <keescook@...omium.org>,
"Paul E. McKenney" <paulmck@...nel.org>,
Paul Turner <pjt@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Steven Rostedt <rostedt@...dmis.org>,
Thomas Gleixner <tglx@...utronix.de>,
Tim Chen <tim.c.chen@...el.com>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Vineeth Pillai <viremana@...ux.microsoft.com>,
x86@...nel.org (maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)),
fweisbec@...il.com, kerrnel@...gle.com,
Phil Auld <pauld@...hat.com>,
Valentin Schneider <valentin.schneider@....com>,
Paolo Bonzini <pbonzini@...hat.com>,
Chen Yu <yu.c.chen@...el.com>,
Christian Brauner <christian.brauner@...ntu.com>
Subject: [PATCH RFC 05/12] entry/idle: Enter and exit kernel protection during idle entry and exit
Make use of the generic_idle_{enter,exit} helper function added in
earlier patches to enter and exit kernel protection.
On exiting idle, protection will be reenabled.
Signed-off-by: Joel Fernandes (Google) <joel@...lfernandes.org>
---
include/linux/entry-common.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/linux/entry-common.h b/include/linux/entry-common.h
index 2ea0e09b00d5..c833f2fda542 100644
--- a/include/linux/entry-common.h
+++ b/include/linux/entry-common.h
@@ -374,6 +374,9 @@ void noinstr irqentry_exit(struct pt_regs *regs, irqentry_state_t state);
*/
static inline void generic_idle_enter(void)
{
+ /* Entering idle ends the protected kernel region. */
+ sched_core_unsafe_exit();
+
rcu_idle_enter();
}
@@ -383,6 +386,9 @@ static inline void generic_idle_enter(void)
static inline void generic_idle_exit(void)
{
rcu_idle_exit();
+
+ /* Exiting idle (re)starts the protected kernel region. */
+ sched_core_unsafe_enter();
}
#endif
--
2.28.0.220.ged08abb693-goog
Powered by blists - more mailing lists