Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp630089imu; Fri, 11 Jan 2019 06:29:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN5USdamwieSK01lxJ+BsE1Q2rcoRiMQNd0JPIG7UVg5GQFQ6E8kAOnKRUL3L5QrW3uE20oX X-Received: by 2002:a62:5003:: with SMTP id e3mr15232047pfb.23.1547216947584; Fri, 11 Jan 2019 06:29:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547216947; cv=none; d=google.com; s=arc-20160816; b=O96sq1Faqgb/lzMLpKY1GUd36j+LN6TU7Ov2IE4R8ZAg21j57neTNiC3i/lihkw23i SudaHoP7dq6sir951coxQsZrkEPp4UG0PLtIM0H4/T/uB8YB/nWPI85Ub83th0IWVYTv GXyPrHUDyIYTZrnW9x5c80SOhZpYi70f/JdLQFi7x49MDsJvrps2Fklu/lN4gczNuP5f ie25x2VAsc4L+Kcz2JIdV++uXI/jInbZ81/lQ8i/mXmzVChbft8TWLS/tiBWWlbmYP7K nIP5jdsv4KEmYvlH07RDE+HXnq5rrvWDXsBcA7UMNRHygmpu0Q0cgNldFwvEiFTJ5OEh ET5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=cpmZBdAYm5+oUz7Cl0plUAU2+Hy4/wsqPkzzLJkkX8s=; b=RyX4s/iaN5nDC2TCg34PPUqJKki9RvplOcdXIZnsLIy5BYPERI5PHt0WLUmul++ltj qJptLFFZVI+kTQR1cDt4tlsJCtMyEW3OvCZjcp4I4l/MKd1Clt69SLykHGE5cr3swIy7 TlN19gID71kPevt/B+w1aFy3Q0dKQ8knATzA3oe0wRxicqM+Wte6zSjoBVJ7lqo175pE apvnA9/pRaUdPnW9S056sZF+EqYwIQe9JJDM93RExy/NwXeOwfFRT4dY1OzRObcfDkaK G5kIYnG0PW5FQ48OUuSYniEcuQyZ7pgLSAKKLesNYnk0/h3KxGrwCTw7eHQpMUbM1hyW Klwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vk0XQL0R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 26si19272214pgu.190.2019.01.11.06.28.52; Fri, 11 Jan 2019 06:29:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Vk0XQL0R; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387758AbfAKOZL (ORCPT + 99 others); Fri, 11 Jan 2019 09:25:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:35114 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730166AbfAKOSh (ORCPT ); Fri, 11 Jan 2019 09:18:37 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CDD5621841; Fri, 11 Jan 2019 14:18:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547216317; bh=dTm/LYUeoH7BCumYYd5wRnUaYtKRL6M5eL2t5J6LNZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vk0XQL0R9YmOGpfojNAd/kE0Di+KtuyG6AsZJAw6qyUKnTRJYMxiIxnZzCoJ9jQ1B bMMa37rQzICIqSgtg7s0j8/av5rwsZWHxWfiAI13LD2BLf86j8iDIpFPNi2paULU7O 8IYcydVnffcttEWS2hMPDl+Cf6ePrWdozCv1zrOo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Paul Mackerras , Michael Ellerman , Sasha Levin Subject: [PATCH 4.4 56/88] powerpc: Fix COFF zImage booting on old powermacs Date: Fri, 11 Jan 2019 15:08:25 +0100 Message-Id: <20190111131054.518734690@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190111131045.137499039@linuxfoundation.org> References: <20190111131045.137499039@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- 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