From patchwork Thu Aug 3 10:04:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 109309 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp572557qge; Thu, 3 Aug 2017 03:09:37 -0700 (PDT) X-Received: by 10.200.8.188 with SMTP id v57mr1271468qth.213.1501754977342; Thu, 03 Aug 2017 03:09:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501754977; cv=none; d=google.com; s=arc-20160816; b=oeKOlfD567x8PxSBFBQzRJBQ3OoTiN8K2gsgKZbozvxlZqE0QRHv/nkjkAyYi8eTwD NtglmxqboBzRNAe1s8MXpyLmcnVaTWn5tHbXcpJsv1Iw2DXlxfeuv53am/O6czTruIeP fvTLafvIH7nLHiBRANrDXhB1QUl7Kf5dQvnyO1J6fDkESA8vQW8VBrG2YQztucfpwvhj yxYGir01DkjXYSKlsOZl5ACpHVf732SxKXYtU8kk5HeKpgI+7Op1+VTAxRdp2T1LhaLy yf7k75G15bWYaVdqGHKEik0R5OjYt7yczeplJD2iw4MPIq5IBkK4uhweKi30E7S17nxi Ukhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:references:in-reply-to:message-id:date:subject :to:from:dkim-signature:arc-authentication-results; bh=TSt13fs6OVUVa45QAkNsZwwV5wjMVndpuDC9uz5aQDs=; b=nrbUg02736ekgOUx3EJkXzjiyYToM4oeKyylg025k6I+WSHgc1WI5C8nbzw8Ki5z1i IoZei9YhELEnK+5tD6M0nY121cKUfIba4qA1JrclonE+r4ejGXyq8ufzfVhBPE1rv4dX 3d5GSJpz4GD3C5hkyyg8UQXs5g62ZjTIN4oPYi/VyKZmtHr1ZUrLS1BUAIdo2KhpACNY Hl9QReMWyh9PKxeOQQVLUfmpUDWlEi4pv9hJARbBiGWvljA/H1RRmJUptVFu9FFbn4fP L8DZKyBpvgk2z1iBGyf5CcedeolEnUmrmIWolcMALa1x9AJYMxDFeDi9L4/TKVYc/TdI 0Feg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=cLLpde98; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id o52si31299864qto.230.2017.08.03.03.09.36 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 03 Aug 2017 03:09:37 -0700 (PDT) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=cLLpde98; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=grub-devel-bounces+patch=linaro.org@gnu.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53215 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddD4Q-0001a5-O5 for patch@linaro.org; Thu, 03 Aug 2017 06:09:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45733) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddD1f-0000Fw-NT for grub-devel@gnu.org; Thu, 03 Aug 2017 06:06:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddD1e-0004B3-Go for grub-devel@gnu.org; Thu, 03 Aug 2017 06:06:43 -0400 Received: from mail-wr0-x234.google.com ([2a00:1450:400c:c0c::234]:38104) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ddD1e-00049u-6n for grub-devel@gnu.org; Thu, 03 Aug 2017 06:06:42 -0400 Received: by mail-wr0-x234.google.com with SMTP id f21so3672497wrf.5 for ; Thu, 03 Aug 2017 03:06:42 -0700 (PDT) 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=CR11G9RTvme4c2Zf6y1HZTKvjrS3Hybar674t0v+DX0=; b=cLLpde98Mv70onaA9rCCuEhSDHq6a/Hi7sUY8W4b85eIUfqqAWwohJHUwjW3wrWLst BOeviCU3IkF81bONl2HbnfkaJ20LfBjXDQ/Y9P7Cv5ieQmwzf9tWeR1c0DsbSQYeyRCw 5AzAbMxaM517UpbYR8ZI+5Np8eVu884svxMow= 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=CR11G9RTvme4c2Zf6y1HZTKvjrS3Hybar674t0v+DX0=; b=mFd23Fv/blSyU9zDvNYSuXI5V2bM0SnlBUTRzfhd/xHIYRw/ITHm/OY0J0u9gQ/D/U tU4kKZXykzaY7o2b+mtHstnulkskxVMEI14Y7211G6tjqZiQ7juiOTca4kkaSLV+cMR6 +iQVs8IeqyqQ3nmWqwqE12HGx2uuD99ZUtwnPftjVsFJ77m34ubm2aL3rjCCI56nK5bB ZdgVh6YJMS1T6yPaIf4gCNy95LIBd2y6tmQkgM4QTPAr1JOG6VwUTPFZIKtuF96oy7xX xgkdrjTWOPHUlGEeZz5kWm98VBUMJtJEtk6PBn+7MJkgYKbDHum5ym9dFFcN1b6uxBZo TC3g== X-Gm-Message-State: AIVw110za7bQnVFQLOfPbD+HxiPnW1ukYiqtcWsg+LW1EMPEm4EF1liX Wn9X7fqFFrSpeydqIUe9uA== X-Received: by 10.223.176.247 with SMTP id j52mr859509wra.192.1501754801037; Thu, 03 Aug 2017 03:06:41 -0700 (PDT) Received: from vanye.hemma.eciton.net (cpc92316-cmbg19-2-0-cust118.5-4.cable.virginm.net. [82.12.0.119]) by smtp.gmail.com with ESMTPSA id e5sm2274543wre.24.2017.08.03.03.06.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 03:06:40 -0700 (PDT) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH v2 07/14] efi: Add GRUB_PE32_MAGIC definition Date: Thu, 3 Aug 2017 11:04:25 +0100 Message-Id: <20170803100432.29913-8-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170803100432.29913-1-leif.lindholm@linaro.org> References: <20170803100432.29913-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::234 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: The development of GNU GRUB Cc: Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" Add a generic GRUB_PE32_MAGIC definition for the PE 'MZ' tag and delete the existing one in arm64/linux.h. Update arm64 Linux loader to use this new definition. Signed-off-by: Leif Lindholm --- grub-core/loader/arm64/linux.c | 2 +- include/grub/arm64/linux.h | 2 -- include/grub/efi/pe32.h | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/arm64/linux.c index cac94d53d..57ee43fac 100644 --- a/grub-core/loader/arm64/linux.c +++ b/grub-core/loader/arm64/linux.c @@ -53,7 +53,7 @@ grub_arm64_uefi_check_image (struct grub_arm64_linux_kernel_header * lh) if (lh->magic != GRUB_ARM64_LINUX_MAGIC) return grub_error(GRUB_ERR_BAD_OS, "invalid magic number"); - if ((lh->code0 & 0xffff) != GRUB_EFI_PE_MAGIC) + if ((lh->code0 & 0xffff) != GRUB_PE32_MAGIC) return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, N_("plain image kernel not supported - rebuild with CONFIG_(U)EFI_STUB enabled")); diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h index 1ea23696e..a981df5d1 100644 --- a/include/grub/arm64/linux.h +++ b/include/grub/arm64/linux.h @@ -23,8 +23,6 @@ #define GRUB_ARM64_LINUX_MAGIC 0x644d5241 /* 'ARM\x64' */ -#define GRUB_EFI_PE_MAGIC 0x5A4D - /* From linux/Documentation/arm64/booting.txt */ struct grub_arm64_linux_kernel_header { diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h index f79c36c02..7d44732d2 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -45,6 +45,8 @@ #define GRUB_PE32_MSDOS_STUB_SIZE 0x80 +#define GRUB_PE32_MAGIC 0x5a4d + /* According to the spec, the minimal alignment is 512 bytes... But some examples (such as EFI drivers in the Intel Sample Implementation) use 32 bytes (0x20) instead, and it seems