linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH AUTOSEL 4.4 01/21] powerpc: Fix COFF zImage booting on old powermacs
@ 2018-12-26 22:54 Sasha Levin
  2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 02/21] ARM: imx: update the cpu power up timing setting on i.mx6sx Sasha Levin
                   ` (19 more replies)
  0 siblings, 20 replies; 21+ messages in thread
From: Sasha Levin @ 2018-12-26 22:54 UTC (permalink / raw)
  To: stable, linux-kernel
  Cc: Paul Mackerras, Michael Ellerman, Sasha Levin, linuxppc-dev

From: Paul Mackerras <paulus@ozlabs.org>

[ Upstream commit 5564597d51c8ff5b88d95c76255e18b13b760879 ]

Commit 6975a783d7b4 ("powerpc/boot: Allow building the zImage wrapper
as a relocatable ET_DYN", 2011-04-12) changed the procedure descriptor
at the start of crt0.S to have a hard-coded start address of 0x500000
rather than a reference to _zimage_start, presumably because having
a reference to a symbol introduced a relocation which is awkward to
handle in a position-independent executable.  Unfortunately, what is
at 0x500000 in the COFF image is not the first instruction, but the
procedure descriptor itself, that is, a word containing 0x500000,
which is not a valid instruction.  Hence, booting a COFF zImage
results in a "DEFAULT CATCH!, code=FFF00700" message from Open
Firmware.

This fixes the problem by (a) putting the procedure descriptor in the
data section and (b) adding a branch to _zimage_start as the first
instruction in the program.

Fixes: 6975a783d7b4 ("powerpc/boot: Allow building the zImage wrapper as a relocatable ET_DYN")
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 arch/powerpc/boot/crt0.S | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/boot/crt0.S b/arch/powerpc/boot/crt0.S
index 5c2199857aa8..a3550e8f1a77 100644
--- a/arch/powerpc/boot/crt0.S
+++ b/arch/powerpc/boot/crt0.S
@@ -15,7 +15,7 @@
 RELA = 7
 RELACOUNT = 0x6ffffff9
 
-	.text
+	.data
 	/* A procedure descriptor used when booting this as a COFF file.
 	 * When making COFF, this comes first in the link and we're
 	 * linked at 0x500000.
@@ -23,6 +23,8 @@ RELACOUNT = 0x6ffffff9
 	.globl	_zimage_start_opd
 _zimage_start_opd:
 	.long	0x500000, 0, 0, 0
+	.text
+	b	_zimage_start
 
 #ifdef __powerpc64__
 .balign 8
-- 
2.19.1


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

end of thread, other threads:[~2018-12-26 22:59 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-26 22:54 [PATCH AUTOSEL 4.4 01/21] powerpc: Fix COFF zImage booting on old powermacs Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 02/21] ARM: imx: update the cpu power up timing setting on i.mx6sx Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 03/21] Input: restore EV_ABS ABS_RESERVED Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 04/21] checkstack.pl: fix for aarch64 Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 05/21] xfrm: Fix bucket count reported to userspace Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 06/21] scsi: bnx2fc: Fix NULL dereference in error handling Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 07/21] Input: omap-keypad - fix idle configuration to not block SoC idle states Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 08/21] USB: hso: Fix OOB memory access in hso_probe/hso_get_config_data Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 09/21] bnx2x: Clear fip MAC when fcoe offload support is disabled Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 10/21] w90p910_ether: remove incorrect __init annotation Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 11/21] net: hns: Incorrect offset address used for some registers Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 12/21] net: hns: Fixed bug that netdev was opened twice Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 13/21] net: hns: Avoid net reset caused by pause frames storm Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 14/21] net: hns: Add mac pcs config when enable|disable mac Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 15/21] SUNRPC: Fix a race with XPRT_CONNECTING Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 16/21] x86/mtrr: Don't copy uninitialized gentry fields back to userspace Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 17/21] lan78xx: Resolve issue with changing MAC address Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 18/21] xen/netfront: tolerate frags with no data Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 19/21] vxge: ensure data0 is initialized in when fetching firmware version information Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 20/21] net: netxen: fix a missing check and an uninitialized use Sasha Levin
2018-12-26 22:54 ` [PATCH AUTOSEL 4.4 21/21] serial/sunsu: fix refcount leak Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).