From patchwork Mon Nov 5 18:44:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10668913 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BDCF17D4 for ; Mon, 5 Nov 2018 18:45:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2C0D3295E2 for ; Mon, 5 Nov 2018 18:45:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1FF7D29973; Mon, 5 Nov 2018 18:45:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AAF3E295E2 for ; Mon, 5 Nov 2018 18:45:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=TeYJMdzdqAv7LlVgGywidd50cXIKhranOELCS6EI3kY=; b=HfG/YWgojiUkHm Yaa9qEzS32Pj6ysCjZ2pYR1nxdCPBDK0PedcudooD4CFCtP74tZmJcxK/+YkTsjGTXTfusxfBG+Br hKn6eU6I8JklJe/ZN6M5eTt0XO1YxkWhsxXeToNi0P1DGzvzTt3VxCFRWnuO2ZrzmIbur0JsTVsKh z+fIvxq1XWuyQRap+6Dv1296KbvgN+CpB0vjDLSQkSjlg71GJw/0BbvZTx4uYUswF6K8ycIHxyrPC 8nA6fvAwnSYxhdlyoLH9dRM+lB5yd2CIihSnm7d1/pysAsy3iaynqDNIqbEHHEpARYZMHXAGlQAli nmSuh07r1YGSx+8+i4bw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJjs6-00030R-Qi; Mon, 05 Nov 2018 18:45:10 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJjs2-0001tv-CS for linux-arm-kernel@lists.infradead.org; Mon, 05 Nov 2018 18:45:08 +0000 Received: by mail-wr1-x443.google.com with SMTP id j26-v6so10708654wre.1 for ; Mon, 05 Nov 2018 10:44:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zWNHujP8qWtN0sr3jmtAFJC83XusyxaOMB217b+i13k=; b=HF2Cr0IOKE7se9dGxEO0GSSpgNHQejmEJZVJ3+StuftoicvcJ8WyomAbEQOMcbBHdl POL92D9GmMfFHFHx85jO+udVEx3S1elEtA+2ZMANfkWNVXZo18J6s2ygT+KqQKUCplhj ZfWr6YvoBj8uvGMko2e/hukb4y6Ptk/YA3Qb0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=zWNHujP8qWtN0sr3jmtAFJC83XusyxaOMB217b+i13k=; b=CWFkFdx/JPw1VGTEZQvemti+AKgcN+2noeL6K2l5r3Yf2Ojp0Vta4GGV6xv65c5tR3 mTxS91b8BDFr0TGKudGg0KajSdcMqzEI3eoWR/GXaKL/jkQoqpZozrRzVeiohWu633b/ MQKSBiNeN6JmGoUjhJAI2EOOhTumZFe+4k6QKskaIhWncYLD2oUIiQlkqv7jpOttPBQH GI4yhV4uUjBA4dashm9VgYmS5rsqB+w29gbJxRzxBFKFMCtX7lSXL06QlLbJ/dxOxkPP y+LBu10e89Z5iudHJRW9EF+YhRC1PAikkDYOWYDW4fKkOacU/CgMptvJmPkcQm8RXMhc WyVg== X-Gm-Message-State: AGRZ1gJmgMA42xhKOSp64I3gOfREjlf6OY5QuRzrLd/JgKnnauz4fZPC yLvRNaA9wWYLolR6fgufcMtt/RGy5P0= X-Google-Smtp-Source: AJdET5fNqtZ9GDa2lSkw7jH0HF15RnU/fyiNrudoOQ3kJ8avcYNYc0oMmpFNt7P0XLA1PHyWWyxYGQ== X-Received: by 2002:adf:e651:: with SMTP id b17-v6mr20586440wrn.254.1541443491649; Mon, 05 Nov 2018 10:44:51 -0800 (PST) Received: from harold.home ([2a01:cb1d:112:6f00:3117:2b29:5ef7:a9e5]) by smtp.gmail.com with ESMTPSA id y21-v6sm19329761wma.36.2018.11.05.10.44.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Nov 2018 10:44:50 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 0/6] ARM: compressed: clean up section layout and enable EFI debugging Date: Mon, 5 Nov 2018 19:44:32 +0100 Message-Id: <20181105184438.19494-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181105_104506_509884_CFB9F046 X-CRM114-Status: GOOD ( 15.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nicolas.pitre@linaro.org, linux@armlinux.org.uk, Ard Biesheuvel Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, the decompressor section layout is somewhat unusual: head.S puts code into a .start and a .text section, which are expected to be emitted back to back, unless other objects are included that define a .start section as well, in which case execution is expected to proceed linearly from head.S's section .start section into the other .start section and then onward into head.S's .text section. This relies on the input files to be consumed by the linker in the same order they were specified on the command line, but this is not actually guaranteed by the linker, so it is better to make the inclusion of this code specific by using function calls. Also, it is better to use a jump instruction when going from one section to the next rather than relying on code flow to proceed seamlessly from one to the other. The reason I am cleaning this up is because I want to modify the section layout slightly, so that the ELF and PE/COFF layouts are identical. This permits a debug feature to be enabled that makes it possible to do single step debugging from the EFI stub into the firmware and back, which is very useful for debugging the handover from UEFI to the decompressor. Ard Biesheuvel (6): ARM: compressed: move sharpsl startup code into subroutine ARM: compressed: move sa1100 startup code into subroutine ARM: compressed: move xscale startup code into subroutine ARM: compressed: move BE32 handling into head.S ARM: compressed: put zImage header and EFI header in dedicated section ARM: efi: add PE/COFF debug table to EFI header arch/arm/boot/compressed/Makefile | 12 ++--- arch/arm/boot/compressed/big-endian.S | 14 ------ arch/arm/boot/compressed/efi-header.S | 47 ++++++++++++++++++++ arch/arm/boot/compressed/head-sa1100.S | 9 ++-- arch/arm/boot/compressed/head-sharpsl.S | 24 +++++----- arch/arm/boot/compressed/head-xscale.S | 7 +-- arch/arm/boot/compressed/head.S | 20 +++++++-- arch/arm/boot/compressed/vmlinux.lds.S | 4 +- 8 files changed, 92 insertions(+), 45 deletions(-) delete mode 100644 arch/arm/boot/compressed/big-endian.S