All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] powerpc/tm: Remove msr_tm_active()
@ 2018-06-15 17:37 Breno Leitao
  2018-06-15 17:42 ` [PATCH 2/3] powerpc/tm: Fix HTM documentation Breno Leitao
  2018-06-15 20:06 ` [PATCH 1/3] powerpc/tm: Remove msr_tm_active() kbuild test robot
  0 siblings, 2 replies; 19+ messages in thread
From: Breno Leitao @ 2018-06-15 17:37 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Breno Leitao

Currently msr_tm_active() is a wrapper around MSR_TM_ACTIVE() if
CONFIG_PPC_TRANSACTIONAL_MEM is set, or it is just a function that
returns false if CONFIG_PPC_TRANSACTIONAL_MEM is not set.

This function is not necessary, since MSR_TM_ACTIVE() just do the same,
checking for the TS bits and does not require any TM facility.

This patchset remove every instance of msr_tm_active() and replaced it
by MSR_TM_ACTIVE();

Signed-off-by: Breno Leitao <leitao@debian.org>
---
 arch/powerpc/kernel/process.c | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 9ef4aea9fffe..6b73d74793c2 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -102,24 +102,18 @@ static void check_if_tm_restore_required(struct task_struct *tsk)
 	}
 }
 
-static inline bool msr_tm_active(unsigned long msr)
-{
-	return MSR_TM_ACTIVE(msr);
-}
-
 static bool tm_active_with_fp(struct task_struct *tsk)
 {
-	return msr_tm_active(tsk->thread.regs->msr) &&
+	return MSR_TM_ACTIVE(tsk->thread.regs->msr) &&
 		(tsk->thread.ckpt_regs.msr & MSR_FP);
 }
 
 static bool tm_active_with_altivec(struct task_struct *tsk)
 {
-	return msr_tm_active(tsk->thread.regs->msr) &&
+	return MSR_TM_ACTIVE(tsk->thread.regs->msr) &&
 		(tsk->thread.ckpt_regs.msr & MSR_VEC);
 }
 #else
-static inline bool msr_tm_active(unsigned long msr) { return false; }
 static inline void check_if_tm_restore_required(struct task_struct *tsk) { }
 static inline bool tm_active_with_fp(struct task_struct *tsk) { return false; }
 static inline bool tm_active_with_altivec(struct task_struct *tsk) { return false; }
@@ -247,7 +241,7 @@ void enable_kernel_fp(void)
 		 * giveup as this would save  to the 'live' structure not the
 		 * checkpointed structure.
 		 */
-		if(!msr_tm_active(cpumsr) && msr_tm_active(current->thread.regs->msr))
+		if(!MSR_TM_ACTIVE(cpumsr) && MSR_TM_ACTIVE(current->thread.regs->msr))
 			return;
 		__giveup_fpu(current);
 	}
@@ -311,7 +305,7 @@ void enable_kernel_altivec(void)
 		 * giveup as this would save  to the 'live' structure not the
 		 * checkpointed structure.
 		 */
-		if(!msr_tm_active(cpumsr) && msr_tm_active(current->thread.regs->msr))
+		if(!MSR_TM_ACTIVE(cpumsr) && MSR_TM_ACTIVE(current->thread.regs->msr))
 			return;
 		__giveup_altivec(current);
 	}
@@ -397,7 +391,7 @@ void enable_kernel_vsx(void)
 		 * giveup as this would save  to the 'live' structure not the
 		 * checkpointed structure.
 		 */
-		if(!msr_tm_active(cpumsr) && msr_tm_active(current->thread.regs->msr))
+		if(!MSR_TM_ACTIVE(cpumsr) && MSR_TM_ACTIVE(current->thread.regs->msr))
 			return;
 		__giveup_vsx(current);
 	}
@@ -530,7 +524,7 @@ void restore_math(struct pt_regs *regs)
 {
 	unsigned long msr;
 
-	if (!msr_tm_active(regs->msr) &&
+	if (!MSR_TM_ACTIVE(regs->msr) &&
 		!current->thread.load_fp && !loadvec(current->thread))
 		return;
 
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-10-04  6:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-15 17:37 [PATCH 1/3] powerpc/tm: Remove msr_tm_active() Breno Leitao
2018-06-15 17:42 ` [PATCH 2/3] powerpc/tm: Fix HTM documentation Breno Leitao
2018-06-15 17:42   ` [PATCH 3/3] powerpc/tm: Remove struct thread_info param from tm_reclaim_thread() Breno Leitao
2018-06-15 20:06 ` [PATCH 1/3] powerpc/tm: Remove msr_tm_active() kbuild test robot
2018-06-18 22:59   ` [PATCH v2 1/4] " Breno Leitao
2018-06-18 22:59     ` [PATCH v2 2/4] powerpc/tm: Fix HTM documentation Breno Leitao
2018-08-15 23:46       ` Michael Neuling
2018-09-20  4:20       ` [v2,2/4] " Michael Ellerman
2018-06-18 22:59     ` [PATCH v2 3/4] powerpc/tm: Adjust tm_reclaim_thread() parameters Breno Leitao
2018-08-15 23:48       ` Michael Neuling
2018-06-18 22:59     ` [PATCH v2 4/4] powerpc/tm: Do not recheckpoint non-tm task Breno Leitao
2018-08-15 23:50       ` Michael Neuling
2018-08-16 14:19         ` Breno Leitao
2018-08-15 23:46     ` [PATCH v2 1/4] powerpc/tm: Remove msr_tm_active() Michael Neuling
2018-08-16 17:21       ` [PATCH v3] " Breno Leitao
2018-10-04  6:14         ` [v3] " Michael Ellerman
2018-08-17  0:49       ` [PATCH v2 1/4] " Michael Ellerman
2018-08-17 12:26         ` Breno Leitao
2018-08-21  6:33           ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.