From patchwork Mon Jan 28 13:35:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 156735 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3435383jaa; Mon, 28 Jan 2019 05:35:53 -0800 (PST) X-Google-Smtp-Source: ALg8bN5tiqJlbft5o7pIHJtdX46PlWXsT1F/LcHcFEmF33eXu2GebMvTvd+8pL4VKDFYY6Z3vTxz X-Received: by 2002:adf:f149:: with SMTP id y9mr23392995wro.284.1548682553001; Mon, 28 Jan 2019 05:35:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548682552; cv=none; d=google.com; s=arc-20160816; b=lt8mJYe/bs2EYpVMHcTz4ySCLBvf2DOJrHRstkZ01ljCuEhlmQiQWMbOB77N+QgKtC XjAMVsmddS8wU3vaYcmMllXpP4tyd7dlc9yOGQwLcef7q0UyHL7H2cme6VsUcLpjnhf8 sFFOVrOJ7hdUDz6sS1eKOLR/bdr38GqwOfqlWfJDOvXJ5XXEMapk7ymDMglj6d8k5UI5 9vphkL53gSh++o4bWT5dD/dFXIlijRiCpsudt/M3/WHq3rwUz6jtj2KhCeXuKp4/8Af4 qZdUeEYyi8PymUzz5tA8SZZjCQf5WOppegS3jsbbEpEZfsTTbh5+R0F4ZD2V+SSFO0bv LyMA== 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:message-id:date:subject:to:from; bh=tSPodpWj2LWnWqmWNJGtYGhHlSXsgjXOurkC/XU7PsA=; b=wELt6seNl/94aG0xi3RXGl3fvcpxevlqq398YUVLfMR1dG6+QhpCD1qz2ngXhpyWaV IOZ3c4B4ChuX+GrvtQ5psg3j0QzpsX6ZpzYScKeYT5xeg7f43DnfqAxVdl/uCflp+6j3 yPcQuf8J60M267EcaoH6P3a1VRfwESf73M2wfEOL1/u8wTvBh+FFxFdWAlOlXv5nJzOr 60LU8DwafKwkYq804uj4Rv9PLCQp995cVUe0OHT6D5xBLpLgJokn3XME8nWIdtqnxjA5 BCmJrRr9hrCOkdnLHR2bbM7XJNXFrZCFoWY02wIPd5BVnnA6hKBJ4GCkWhObTAQY7/XF VFnQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id l18si80296164wra.374.2019.01.28.05.35.52 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 28 Jan 2019 05:35:52 -0800 (PST) Received-SPF: pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of grub-devel-bounces+patch=linaro.org@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="grub-devel-bounces+patch=linaro.org@gnu.org" Received: from localhost ([127.0.0.1]:60317 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go74p-00035l-KX for patch@linaro.org; Mon, 28 Jan 2019 08:35:51 -0500 Received: from eggs.gnu.org ([209.51.188.92]:58588) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1go74g-00035N-Tc for grub-devel@gnu.org; Mon, 28 Jan 2019 08:35:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1go74e-0000mK-Um for grub-devel@gnu.org; Mon, 28 Jan 2019 08:35:42 -0500 Received: from mx2.suse.de ([195.135.220.15]:39734 helo=mx1.suse.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1go74Z-0000M6-SX for grub-devel@gnu.org; Mon, 28 Jan 2019 08:35:37 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 9D414AC76; Mon, 28 Jan 2019 13:35:29 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH v6 0/3] arm64: Support HP Envy X2 Date: Mon, 28 Jan 2019 14:35:26 +0100 Message-Id: <20190128133529.82445-1-agraf@suse.de> X-Mailer: git-send-email 2.12.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 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: Jon Masters , Leif Lindholm , Daniel Kiper MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" I got a new toy recently: An HP Envy X2 system. This is one of those shiny new Qualcomm Snapdragon based Windows tablet/notebook hybrid things. While running Windows on those is actually not a terribly bad experience now that WSL is out, I would like to see Linux run on those as well in the future. Unfortunately as far as I'm aware so far nobody was able to run self built binaries on the built-in UEFI version. Turns out, it's a problem with aligning the start of the header to 4k. Once we do that, binaries can be loaded just fine and run. The reason behind that is simple: Its firmware tries to ensure NX protection flags and can do so only when the code is 4K aligned. So to maintain compatibility with that device, this patch set just bumps all PE alignments to 4K always on all efi targets. This way we improve overall compatibility - there surely will be more devices coming with similar constraints. This gets us into alignment with how the MS tools build UEFI applications, so we should not run into compatibility problems about alignment going forward. v1 -> v2: - Remove explicit device wording from patch - Use GRUB_EFI_PAGE_SIZE v2 -> v3: - Apply alignment to all architectures - new patch: mkimage: Align efi sections on 4k boundary v3 -> v4: - Reduce everything down to 1 patch which just adapts *all* alignment to GRUB_EFI_PAGE_SIZE (4k). v4 -> v5: - Use GRUB_EFI_PAGE_SIZE - Add include to have above const defined - new patch: mkimage: Clarify file alignment in efi case v5 -> v6: - Change EFIxxHEADER_SIZE macros too - Fix comment Alexander Graf (3): mkimage: Use EFI32_HEADER_SIZE define in arm-efi case mkimage: Align efi sections on 4k boundary mkimage: Clarify file alignment in efi case include/grub/efi/pe32.h | 11 +++++++++-- util/mkimage.c | 19 +++++++------------ 2 files changed, 16 insertions(+), 14 deletions(-) -- 2.12.3 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel Reviewed-by: Daniel Kiper Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>