From patchwork Thu Aug 3 10:04:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 109307 Delivered-To: patch@linaro.org Received: by 10.140.101.6 with SMTP id t6csp572419qge; Thu, 3 Aug 2017 03:09:27 -0700 (PDT) X-Received: by 10.200.9.27 with SMTP id t27mr1287360qth.107.1501754967866; Thu, 03 Aug 2017 03:09:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1501754967; cv=none; d=google.com; s=arc-20160816; b=cyNX3627SMgTRZNq7be9uODCIWpT/9VQlEG8bfT/I7MwZIHhm+zcFTG98caRMTTGY/ PhRRH/+f/jTg5P68jCUU4KzACyg5ohhF2VXq8Ti/utyvKYUprhI4UcvM1xJU8OGQ6mUQ gIxVEbEixkojAVgebQMQ0P5pNpHf5ggVla6zv19D8wgNtHaxfgH3ucDY1OdYhp2F8yHm plF9So8MONOQnNJZDpVAAP1sOYnuNumRhekjtiEkPbOVM1cHLVShXeDUaUx4pO8aFEkN wWasWuwMuueMzDojGhod4x10E+Wo4vh6yht0kYDEUnniOXyJICYqESF1FJtDRWWxU5u+ yFbg== 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=V6eVkXAEaslp2jfw18/fl0PL6SoQ664tL9pT++tN0iU=; b=dxQGjYoeKnZ78Cao6zpj3VI2UGksuyj21P9tOPGQVDSCaazZN4EEykcJxFKXlwAXrW CMJtXX5BkEzaQ2YaJn3xg5bXxH2SvLNN0QOHujZY35zQKmAOu76xjGcckOeKu7H8mcoO FMnZ+leTVLCSKX9oGlVgWHt5HoS3bCpBXzq3b+gGcfUqHjjPH8dtkhuBjNLCYaacu/cw VVa9PuVOjEnFNE5z2EuvoeIyx/Cl2BCt07YqEZzj12A5LkKJjBQ1A0Nu1BcVhajVpdMC kO7B4i7ggwUKf6qtczPzP6sGfo87sFTJFEMfhNLJv7WUpb5CWvlwHd8Ks3ZK3YXpRLsC rLtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=K/omtFhy; 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 h61si32018274qtd.426.2017.08.03.03.09.27 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 03 Aug 2017 03:09:27 -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=K/omtFhy; 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]:53213 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddD4H-0001Rl-9K for patch@linaro.org; Thu, 03 Aug 2017 06:09:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45965) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddD1n-0000PA-C6 for grub-devel@gnu.org; Thu, 03 Aug 2017 06:06:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddD1m-0004JK-H0 for grub-devel@gnu.org; Thu, 03 Aug 2017 06:06:51 -0400 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:36189) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ddD1m-0004IH-Bs for grub-devel@gnu.org; Thu, 03 Aug 2017 06:06:50 -0400 Received: by mail-wm0-x230.google.com with SMTP id t201so10871732wmt.1 for ; Thu, 03 Aug 2017 03:06:50 -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=I5tj2kQAvU41T9Ncnsrrj6Z+w7qjyOkZ/cOVaRrBs5o=; b=K/omtFhyHcZGMLFAmBT6dmomt5vgcY8MIcWZez5AqYSZ3DkiRc9gkKjq+lrf2FLBZN Fe78IdhzqN8L0cBwPsZ6d5eyPHWtghVtd2UhwJEkdH1IoQzlawxElb4ALVlSEFqT2nQ3 YjLLg4a+tQ6ShX3zUZFLhDx8Rv7c0H0li0Z7Q= 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=I5tj2kQAvU41T9Ncnsrrj6Z+w7qjyOkZ/cOVaRrBs5o=; b=e2Y7kUydsi4NunsjoM7uBULMAbN2EHHd4/GyOdI8+P14czAT97a4c8IO/SBgowtiq9 rnijzCzH/DSNlCI5zTYCfgDSoUdtOOj86cue/uV9/bMb6vSSbD+8/hOw+NBoadsuFqRp oUQOQ+YkeMdr7snWBbrRoO5m1sDNCDFoFFqRAxMTXJfFaf4UuzSRaPBc/fQZH5vZH+Cy 7vWzz5+GU69TFTrFc/7KFKs00eSVqAJofpp5Uz844Wl7+p6JB/QiKjSTAeAMnKZMqfXt 9FZoQED4jc2hE6z1urp3Y3gIeAK58tN3BPI5+d48IA5gGeSXY2KjvKwO5KFX4bPLzdx8 ZdTA== X-Gm-Message-State: AIVw110XXsSeNc2kpglvymqQM+QepMN58sS2uuOy0WU5A2DKauvZHByN qGULnrF/vbdUaXWG1YmVtw== X-Received: by 10.28.138.194 with SMTP id m185mr761945wmd.116.1501754809134; Thu, 03 Aug 2017 03:06:49 -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.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Aug 2017 03:06:48 -0700 (PDT) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH v2 14/14] efi: change heap allocation type to GRUB_EFI_LOADER_CODE Date: Thu, 3 Aug 2017 11:04:32 +0100 Message-Id: <20170803100432.29913-15-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:c09::230 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" 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 c8fffe902..f1424f2e4 100644 --- a/grub-core/kern/efi/mm.c +++ b/grub-core/kern/efi/mm.c @@ -448,7 +448,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),