All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/swsusp: Only use tlbie in POWER4 mode
@ 2016-03-02  6:12 Russell Currey
  2016-04-11 12:35 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Russell Currey @ 2016-03-02  6:12 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Russell Currey

If CONFIG_HIBERNATION and CONFIG_PPC_BOOK3S_64 are set, code in
arch/powerpc/kernel/swsusp_amd64.S which uses the tlbia macro is enabled.
tlbia in turn uses tlbie, an instruction which takes more than one
operand in newer versions of POWER.  As such, the kernel fails to build
due to the assembler complaining about missing operands.

This can be worked around by assembling the instruction as in POWER4.
This fixes the build breakage caused by enabling CONFIG_HIBERNATION.
Hibernation is currently only tested on G5 PowerMacs, which should be
unaffected by this change.  For other platforms it may now build,
whether or not it works is a different story.

Signed-off-by: Russell Currey <ruscur@russell.cc>
---
 arch/powerpc/include/asm/ppc_asm.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/include/asm/ppc_asm.h b/arch/powerpc/include/asm/ppc_asm.h
index 499d9f8..2b31632 100644
--- a/arch/powerpc/include/asm/ppc_asm.h
+++ b/arch/powerpc/include/asm/ppc_asm.h
@@ -427,7 +427,10 @@ END_FTR_SECTION_IFCLR(CPU_FTR_601)
 	li	r4,1024;			\
 	mtctr	r4;				\
 	lis	r4,KERNELBASE@h;		\
+	.machine push;				\
+	.machine "power4";			\
 0:	tlbie	r4;				\
+	.machine pop;				\
 	addi	r4,r4,0x1000;			\
 	bdnz	0b
 #endif
-- 
2.7.2

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

* Re: powerpc/swsusp: Only use tlbie in POWER4 mode
  2016-03-02  6:12 [PATCH] powerpc/swsusp: Only use tlbie in POWER4 mode Russell Currey
@ 2016-04-11 12:35 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2016-04-11 12:35 UTC (permalink / raw)
  To: Russell Currey, linuxppc-dev

On Wed, 2016-02-03 at 06:12:45 UTC, Russell Currey wrote:
> If CONFIG_HIBERNATION and CONFIG_PPC_BOOK3S_64 are set, code in
> arch/powerpc/kernel/swsusp_amd64.S which uses the tlbia macro is enabled.
> tlbia in turn uses tlbie, an instruction which takes more than one
> operand in newer versions of POWER.  As such, the kernel fails to build
> due to the assembler complaining about missing operands.
> 
> This can be worked around by assembling the instruction as in POWER4.
> This fixes the build breakage caused by enabling CONFIG_HIBERNATION.
> Hibernation is currently only tested on G5 PowerMacs, which should be
> unaffected by this change.  For other platforms it may now build,
> whether or not it works is a different story.
> 
> Signed-off-by: Russell Currey <ruscur@russell.cc>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/e3824e4281b8e31d55c08a06b2

cheers

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

end of thread, other threads:[~2016-04-11 12:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-02  6:12 [PATCH] powerpc/swsusp: Only use tlbie in POWER4 mode Russell Currey
2016-04-11 12:35 ` 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.