From patchwork Wed Feb 8 11:55:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 93613 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2648637qgi; Wed, 8 Feb 2017 04:04:46 -0800 (PST) X-Received: by 10.98.51.70 with SMTP id z67mr25676938pfz.68.1486555486049; Wed, 08 Feb 2017 04:04:46 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z126si6908390pfz.272.2017.02.08.04.04.45; Wed, 08 Feb 2017 04:04:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-efi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-efi-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754370AbdBHME0 (ORCPT + 2 others); Wed, 8 Feb 2017 07:04:26 -0500 Received: from mail-wm0-f45.google.com ([74.125.82.45]:38317 "EHLO mail-wm0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751674AbdBHMET (ORCPT ); Wed, 8 Feb 2017 07:04:19 -0500 Received: by mail-wm0-f45.google.com with SMTP id r141so184316690wmg.1 for ; Wed, 08 Feb 2017 04:03:23 -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:in-reply-to:references; bh=nYLQ/TWjzdTocZ/APHH9ZMeWcOS9zJzl3JkWnBGDSYg=; b=Fe2JZmfJkyudM3/oXlU67msTnCZSQsZ7suUuD+neHBFc2vbFyFwUfIeb3NgMNSwQht sRX6rGByyD44chFHEVMTFp9vSZTqvBMq5n5rByo85kHFFRSiWMukqc9QBNkJs3DAA6/5 NHSaOcdUwNZb0zO/6R0kWdCxgZlH/aVp2RBq8= 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:in-reply-to :references; bh=nYLQ/TWjzdTocZ/APHH9ZMeWcOS9zJzl3JkWnBGDSYg=; b=ci4tPfGPwrW25s7R3uoJdM7gJu1HNM0kwqeQC2pOImRu31P5JwxeZ1/KNGzIcBLIOD BgAKWqB08IgMk+ZwUcbRHyikTWhwKoVdkKbjSdBCrS4ujhucFvnkvi8sXBFSsfawkM1l ijn8LZPfzvf0VWikuEUS3O0NuvbKG+a8O+8tV1obREyHwrXWz5I013CLW2uJk0+zYhDh mA9dJMJHpXuCva3DjdDzb8F70JAkQEwqlCvBoygqnTme6FZXyy+lFcaBTBlCcbMq8wlJ fOFs3KO82pw6Q4v+JdvKnYE6itvnwvsJs8pOz0A1I3AbxJYSqtvbeEE3n5T96uiTEXlK o8LA== X-Gm-Message-State: AMke39nCE6pOnQBtWLe4PKAWMJt5z1Lt0er/S5wtQu932UdgxZXQRZJbHo19RRuOS3iPfe5k X-Received: by 10.28.191.79 with SMTP id p76mr16806845wmf.21.1486554973357; Wed, 08 Feb 2017 03:56:13 -0800 (PST) Received: from localhost.localdomain ([160.169.163.122]) by smtp.gmail.com with ESMTPSA id 123sm2974815wml.6.2017.02.08.03.56.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Feb 2017 03:56:12 -0800 (PST) From: Ard Biesheuvel To: linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mark.rutland@arm.com, leif.lindholm@linaro.org Cc: catalin.marinas@arm.com, linux@armlinux.org.uk, kernel-hardening@lists.openwall.com, labbott@fedoraproject.org, Ard Biesheuvel Subject: [PATCH v2 04/14] arm64: efi: clean up Image header after PE header has been split off Date: Wed, 8 Feb 2017 11:55:37 +0000 Message-Id: <1486554947-3964-5-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486554947-3964-1-git-send-email-ard.biesheuvel@linaro.org> References: <1486554947-3964-1-git-send-email-ard.biesheuvel@linaro.org> Sender: linux-efi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-efi@vger.kernel.org After having split off the PE header, clean up the bits that remain: use .long consistently, merge two adjacent #ifdef CONFIG_EFI blocks, fix the offset of the PE header pointer and remove the redundant .align that follows it. Also, since we will be eliminating all open coded constants from the EFI header in subsequent patches, let's replace the open coded "ARM\x64" magic number with its .ascii equivalent. No changes to the resulting binary image are intended. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/head.S | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-efi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index f779a7483736..aa8f6cd8c33f 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S @@ -91,20 +91,19 @@ _head: .quad 0 // reserved .quad 0 // reserved .quad 0 // reserved - .byte 0x41 // Magic number, "ARM\x64" - .byte 0x52 - .byte 0x4d - .byte 0x64 + .ascii "ARM\x64" // Magic number #ifdef CONFIG_EFI + /* + * PE/COFF requires the offset to the PE header + * to be stored at offset 0x3c into the file. + */ + .org _head + 0x3c .long pe_header - _head // Offset to the PE header. -#else - .word 0 // reserved -#endif -#ifdef CONFIG_EFI - .align 3 pe_header: __EFI_PE_HEADER +#else + .long 0 // reserved #endif __INIT