Thread (4 messages) flat view 4 messages, 4 authors, 2012-07-03

Re: [PATCH][v2] PPC: use CURRENT_THREAD_INFO instead of open coded assembly

From: Alexander Graf <hidden>
Date: 2012-07-02 21:16:00

On 02.07.2012, at 23:14, Stuart Yoder wrote:
From: Stuart Yoder <redacted>
=20
Signed-off-by: Stuart Yoder <redacted>
---
=20
-this patch is a pre-requisite for the idle hcall which I
am trying to get into Alex's KVM tree, so ideally would like
Ben's ack and get this applied to Alex's tree
=20
-built/tested with a 32-bit booke kernel, built a 64-bit
booke kernel
=20
-v2
  -moved CURRENT_THREAD_INFO under assembly only
   #ifdef
=20
arch/powerpc/include/asm/exception-64s.h |    4 ++--
arch/powerpc/include/asm/thread_info.h   |    8 ++++++++
arch/powerpc/kernel/entry_32.S           |   24 =
++++++++++++------------
quoted hunk ↗ jump to hunk
arch/powerpc/kernel/entry_64.S           |   14 +++++++-------
arch/powerpc/kernel/exceptions-64e.S     |    2 +-
arch/powerpc/kernel/exceptions-64s.S     |    2 +-
arch/powerpc/kernel/head_fsl_booke.S     |    2 +-
arch/powerpc/kernel/idle_6xx.S           |    4 ++--
arch/powerpc/kernel/idle_book3e.S        |    2 +-
arch/powerpc/kernel/idle_e500.S          |    4 ++--
arch/powerpc/kernel/idle_power4.S        |    2 +-
arch/powerpc/kernel/misc_32.S            |    4 ++--
arch/powerpc/kvm/bookehv_interrupts.S    |    6 +-----
arch/powerpc/mm/hash_low_32.S            |    8 ++++----
arch/powerpc/sysdev/6xx-suspend.S        |    2 +-
15 files changed, 46 insertions(+), 42 deletions(-)
=20
diff --git a/arch/powerpc/include/asm/exception-64s.h =
b/arch/powerpc/include/asm/exception-64s.h
quoted hunk ↗ jump to hunk
index d58fc4e..5dbd00d 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -293,7 +293,7 @@ label##_hv:						=
		\
quoted hunk ↗ jump to hunk
=20
#define RUNLATCH_ON				\
BEGIN_FTR_SECTION				\
-	clrrdi	r3,r1,THREAD_SHIFT;		\
+	CURRENT_THREAD_INFO(r3, r1)		\
	ld	r4,TI_LOCAL_FLAGS(r3);		\
	andi.	r0,r4,_TLF_RUNLATCH;		\
	beql	ppc64_runlatch_on_trampoline;	\
@@ -332,7 +332,7 @@ label##_common:						=
	\
quoted hunk ↗ jump to hunk
#ifdef CONFIG_PPC_970_NAP
#define FINISH_NAP				\
BEGIN_FTR_SECTION				\
-	clrrdi	r11,r1,THREAD_SHIFT;		\
+	CURRENT_THREAD_INFO(r11, r1)		\
	ld	r9,TI_LOCAL_FLAGS(r11);		\
	andi.	r10,r9,_TLF_NAPPING;		\
	bnel	power4_fixup_nap;		\
diff --git a/arch/powerpc/include/asm/thread_info.h =
b/arch/powerpc/include/asm/thread_info.h
quoted hunk ↗ jump to hunk
index 68831e9..3760620 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -74,6 +74,14 @@ static inline struct thread_info =
*current_thread_info(void)
	return (struct thread_info *)(sp & ~(THREAD_SIZE-1));
}
=20
+#else
+
+#ifndef CONFIG_PPC64
Oh no! The logic is still backwards :(
+#define CURRENT_THREAD_INFO(dest, sp)	rlwinm dest, sp, 0, 0, =
31-THREAD_SHIFT
+#else
+#define CURRENT_THREAD_INFO(dest, sp)	clrrdi dest, sp, =
THREAD_SHIFT
+#endif

Alex
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help