All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc: Fix lwsync feature fixup vs. modules on 64-bit
@ 2010-02-26  7:30 Benjamin Herrenschmidt
  2010-02-26 13:10 ` Sachin Sant
  0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Herrenschmidt @ 2010-02-26  7:30 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Anton Blanchard

Anton's commit enabling the use of the lwsync fixup mechanism on 64-bit
breaks modules. The lwsync fixup section uses .long instead of the
FTR_ENTRY_OFFSET macro used by other fixups sections, and thus will
generate 32-bit relocations that our module loader cannot resolve.

This changes it to use the same type as other feature sections.

Note however that we might want to consider using 32-bit for all the
feature fixup offsets and add support for R_PPC_REL32 to module_64.c
instead as that would reduce the size of the kernel image. I'll leave
that as an exercise for the reader for now...

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/include/asm/feature-fixups.h |    2 +-
 arch/powerpc/lib/feature-fixups.c         |    3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h
index cbd4dfa..96a7d06 100644
--- a/arch/powerpc/include/asm/feature-fixups.h
+++ b/arch/powerpc/include/asm/feature-fixups.h
@@ -165,7 +165,7 @@ label##2:						\
 	.pushsection sect,"a";				\
 	.align 2;					\
 label##3:					       	\
-	.long label##1b-label##3b;			\
+	FTR_ENTRY_OFFSET label##1b-label##3b;		\
 	.popsection;
 
 #endif /* __ASM_POWERPC_FEATURE_FIXUPS_H */
diff --git a/arch/powerpc/lib/feature-fixups.c b/arch/powerpc/lib/feature-fixups.c
index 4dee652..e640175 100644
--- a/arch/powerpc/lib/feature-fixups.c
+++ b/arch/powerpc/lib/feature-fixups.c
@@ -112,7 +112,8 @@ void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
 
 void do_lwsync_fixups(unsigned long value, void *fixup_start, void *fixup_end)
 {
-	int *start, *end, *dest;
+	long *start, *end;
+	unsigned int *dest;
 
 	if (!(value & CPU_FTR_LWSYNC))
 		return ;

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

* Re: [PATCH] powerpc: Fix lwsync feature fixup vs. modules on 64-bit
  2010-02-26  7:30 [PATCH] powerpc: Fix lwsync feature fixup vs. modules on 64-bit Benjamin Herrenschmidt
@ 2010-02-26 13:10 ` Sachin Sant
  0 siblings, 0 replies; 2+ messages in thread
From: Sachin Sant @ 2010-02-26 13:10 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: Linux/PPC Development

Benjamin Herrenschmidt wrote:
> Anton's commit enabling the use of the lwsync fixup mechanism on 64-bit
> breaks modules. The lwsync fixup section uses .long instead of the
> FTR_ENTRY_OFFSET macro used by other fixups sections, and thus will
> generate 32-bit relocations that our module loader cannot resolve.
>
> This changes it to use the same type as other feature sections.
>
> Note however that we might want to consider using 32-bit for all the
> feature fixup offsets and add support for R_PPC_REL32 to module_64.c
> instead as that would reduce the size of the kernel image. I'll leave
> that as an exercise for the reader for now...
>
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  arch/powerpc/include/asm/feature-fixups.h |    2 +-
>  arch/powerpc/lib/feature-fixups.c         |    3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
>   
Thanks for the patch Ben.

I can boot -next on my power boxes with it.

thanks
-Sachin

-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------

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

end of thread, other threads:[~2010-02-26 13:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-26  7:30 [PATCH] powerpc: Fix lwsync feature fixup vs. modules on 64-bit Benjamin Herrenschmidt
2010-02-26 13:10 ` Sachin Sant

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.