From patchwork Tue Feb 28 22:35:37 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 94669 Delivered-To: patch@linaro.org Received: by 10.140.20.113 with SMTP id 104csp1529424qgi; Tue, 28 Feb 2017 14:41:09 -0800 (PST) X-Received: by 10.237.36.116 with SMTP id s49mr6024571qtc.128.1488321669440; Tue, 28 Feb 2017 14:41:09 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t128si2622119qkb.291.2017.02.28.14.41.09 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 Feb 2017 14:41:09 -0800 (PST) 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; 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]:37463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciqSB-0000YC-0A for patch@linaro.org; Tue, 28 Feb 2017 17:41:07 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36749) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciqN1-0004ui-ED for grub-devel@gnu.org; Tue, 28 Feb 2017 17:35:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciqN0-0004b0-Lt for grub-devel@gnu.org; Tue, 28 Feb 2017 17:35:47 -0500 Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:36081) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ciqN0-0004af-F9 for grub-devel@gnu.org; Tue, 28 Feb 2017 17:35:46 -0500 Received: by mail-wm0-x22f.google.com with SMTP id v77so96291366wmv.1 for ; Tue, 28 Feb 2017 14:35:46 -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=k40hvaiiAPb9KtxKtSUVxyRM1mHccocC4rK6H4oUbnw=; b=Kz6Guc/nWDJoDdrW3RBMdonVTUezBVaiuvWSF8aYuZBZaYjvGrOGCyCuGNF/Z0O4CR Fd7zOka3MPBR+Kuldsg4/qjxahK2gtuYoTgyj5SgkbY+2YvXYTYfXpuOOrm0IbZSpIJm zKa6gEpFyDrlHXXXC91xyrWm898/9KEvpSbnA= 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=k40hvaiiAPb9KtxKtSUVxyRM1mHccocC4rK6H4oUbnw=; b=amDXYOlzeUJG6qokunKQTPlCdqODSeXJpVtBMz7VOrk5QAvDgQlTeD+ItMOGlEOL90 XMm4YUw5uStd5ZMNtpjATj/nJ7a09/pZ3k6aeu6CtDur+fXV9rYh+N17AH5lrcJp3W4e C0UnW5KWsaQESBDps49WDa+r1FGDVjTnLkaICYVp0torJmoG7UCkd3iWgUzr2tu+n7M/ yCjaU9CvNItxBc1vEPs0AYhltgbHIorFb7sxnpVx8252kN2E7VOOfckMbWa4POAzB8Qu 6FbPP98VREN1o+y210yvTwkMX/4ZKxjx6yj5BcK+9C6HOdiiEl/3BvXxWV9jVDlCRacC Vvug== X-Gm-Message-State: AMke39k5MVwfPVhl8DOEscMx3qGfTDgaL5SDF23VQeVr/bDJBFWj1tJ8M73HUl956guIGlJM X-Received: by 10.28.215.138 with SMTP id o132mr627316wmg.41.1488321345520; Tue, 28 Feb 2017 14:35:45 -0800 (PST) Received: from mohikan.hemma.eciton.net ([2a01:348:6:8735:e23f:49ff:fe6d:9d26]) by smtp.gmail.com with ESMTPSA id 40sm4043391wry.22.2017.02.28.14.35.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Feb 2017 14:35:44 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 7/7] efi: change heap allocation type to GRUB_EFI_LOADER_CODE Date: Tue, 28 Feb 2017 22:35:37 +0000 Message-Id: <20170228223537.9685-8-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170228223537.9685-1-leif.lindholm@linaro.org> References: <20170228223537.9685-1-leif.lindholm@linaro.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22f 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: Laszlo Ersek , Gerd Hoffmann , Alexander Graf , ard.biesheuvel@linaro.org MIME-Version: 1.0 Errors-To: grub-devel-bounces+patch=linaro.org@gnu.org Sender: "Grub-devel" With upcoming changes to EDK2, allocations of type EFI_LOADER_DATA may not return regions with execute ability. Since modules are loaded onto the heap, change the heap allocation type to GRUB_EFI_LOADER_CODE in order to permit execution on systems with this feature enabled. Closes: 50420 Signed-off-by: Leif Lindholm --- grub-core/kern/efi/mm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel diff --git a/grub-core/kern/efi/mm.c b/grub-core/kern/efi/mm.c index 7b1763bc5..f27a48e68 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -404,7 +404,9 @@ add_memory_regions (grub_efi_memory_descriptor_t *memory_map, pages = required_pages; } - addr = grub_efi_allocate_pages (start, pages); + addr = grub_efi_allocate_pages_real (start, pages, + GRUB_EFI_ALLOCATE_ADDRESS, + GRUB_EFI_LOADER_CODE); if (! addr) grub_fatal ("cannot allocate conventional memory %p with %u pages", (void *) ((grub_addr_t) start),