From patchwork Mon Jan 14 15:27:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 155540 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3792735jaa; Mon, 14 Jan 2019 07:37:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4jMWEaRQglwuybZWsxA0eROgavzkUho+uWLfCLLlB7S4ehdtuRthfpqbnI70WInmN2XwtB X-Received: by 2002:adf:9c8a:: with SMTP id d10mr23830728wre.244.1547480269576; Mon, 14 Jan 2019 07:37:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547480269; cv=none; d=google.com; s=arc-20160816; b=sw373i75b0ffIU4JJp+f7XaHjFhUuXFWdDNEUbG2tCZev3RnyioYEqDZZ28mmPpTl+ YrAAjB+GbhVWMawKq7wH7FedZ1j1sJjIJxm7vPUeokTVRmz4kAPLirpMTy/RYR7LUfDw fyJi4pb0dFnOGONFQRmuUEAnTZL4AASmB15OSQ5d3IOvfe2IeGMPV0raAC9cxVaWIX1h /5iMe5uIZeIRxBB0Vy/SY97Bl0kK4Xawq7LdCH13Z/iBpWigH3UL1+rgdxkemRj3ip7Q pfgaEQN5j1cCbV1W1a7ZZbFJ3pGWrYwZGemjoD7kuf9nuJ34mImpODl9mDCa24aVq4e4 I/HA== 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=nt3Cw0sqgI7+be4Z+9/p6RAAe2d6KErZqPqc4W/0zAA=; b=VIRRaV47oeKd4RdWniTsPmmmhLHoExJp3zs5HoOTfDawc8S1AkZUO5lN0ASnDvdebX IeXicA9DtDqHCQhg7teoGuPkMg70qne3lHwPwA1l1YhoTwO/uZ+jSwoaRGxGy4dUtL15 di1aoaGS51mU9JtQ6DkMsr6199ndmMnrK12TgXjCcHofzDNvCG/K+y7n3SjaR3caNQWr oCFxfsM5kxb9gxsbTffws7hvyWulPskUjb9g194VCcbnghj3vLz1reFgPRmCIjA/T5N6 1FhbidaDLPHWHGfjNtVpS9S2T96Sonlwl1PKtoo/YPuhCz2/bQtZPuMHTcURSlN3JEEZ 1XCg== 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 r13si19235226wmb.60.2019.01.14.07.37.49 for (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 14 Jan 2019 07:37:49 -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]:55725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gj4JA-0004hG-It for patch@linaro.org; Mon, 14 Jan 2019 10:37:48 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gj495-0003MG-Jb for grub-devel@gnu.org; Mon, 14 Jan 2019 10:27:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gj492-00089L-B2 for grub-devel@gnu.org; Mon, 14 Jan 2019 10:27:21 -0500 Received: from mx2.suse.de ([195.135.220.15]:36412 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 1gj492-00088f-3O for grub-devel@gnu.org; Mon, 14 Jan 2019 10:27:20 -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 D2687AF96; Mon, 14 Jan 2019 15:27:18 +0000 (UTC) From: Alexander Graf To: grub-devel@gnu.org Subject: [PATCH v3 0/4] arm64: Support HP Envy X2 Date: Mon, 14 Jan 2019 16:27:14 +0100 Message-Id: <20190114152718.60629-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 , Daniel Kiper , Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" I got a new toy this week: 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 the header alignment to 4K always on arm64-efi and other efi targets. This way we improve overall compatibility - there surely will be more devices coming with similar constraints. We also extend that alignemnt to any section that follows afterwards, to ensure that other protection mechanisms will have a chance to protect individual sections with page table bits. 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 Alexander Graf (4): mkimage: Simplify header size logic mkimage: Use EFI32_HEADER_SIZE define in arm-efi case mkimage: arm64-efi: Align header to page granularity mkimage: Align efi sections on 4k boundary util/mkimage.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) -- 2.12.3 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel