From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1ddD1t-0000TJ-LH for mharc-grub-devel@gnu.org; Thu, 03 Aug 2017 06:06:57 -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 Cc: Daniel Kiper 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: , X-List-Received-Date: Thu, 03 Aug 2017 10:06:52 -0000 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(-) 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), -- 2.11.0