From patchwork Tue Feb 28 22:35:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leif Lindholm X-Patchwork-Id: 94673 Delivered-To: patch@linaro.org Received: by 10.140.20.113 with SMTP id 104csp1531720qgi; Tue, 28 Feb 2017 14:48:44 -0800 (PST) X-Received: by 10.237.42.98 with SMTP id k31mr4573499qtf.232.1488322124508; Tue, 28 Feb 2017 14:48:44 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c16si2652176qtd.184.2017.02.28.14.48.43 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 28 Feb 2017 14:48:44 -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]:37492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciqZW-0005BE-2Z for patch@linaro.org; Tue, 28 Feb 2017 17:48:42 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36668) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ciqMw-0004qH-Vq for grub-devel@gnu.org; Tue, 28 Feb 2017 17:35:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ciqMv-0004Xh-R6 for grub-devel@gnu.org; Tue, 28 Feb 2017 17:35:43 -0500 Received: from mail-wm0-x22d.google.com ([2a00:1450:400c:c09::22d]:35394) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ciqMv-0004X0-LM for grub-devel@gnu.org; Tue, 28 Feb 2017 17:35:41 -0500 Received: by mail-wm0-x22d.google.com with SMTP id v186so96747030wmd.0 for ; Tue, 28 Feb 2017 14:35:40 -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; bh=qFKXHXkd7arQQkTREGC29ak2IfG9E44twHkdC6x5aUg=; b=iGWeNQFy7GNbGhqc46KvWWisSLBcq/Ccz5eHpJOL6b35OlG54Azj9N+sQBkwZFxHlK Fj33oRNqraXZIdmGjg9EE82DQhfdlWHOy1YVQZUCNG3VGe+Vi5iW9BuCyqx8sTy1C/px w/nPpreNJ8leL3OOdD7dS6xNm7hEc/llu1M3c= 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; bh=qFKXHXkd7arQQkTREGC29ak2IfG9E44twHkdC6x5aUg=; b=mJO6520BMIJLAQqMT5s1FFHoZThwasR8tmRC1r7nX6xHfscROpWhPz35zWx7qJLhTj E+FhraDPJBeWITke7Ex7IK6i1PvlZZEFsT/La5kP0Bunnhdz4S2gi+9f2H2UlreNAnWh wAs63fUGjyJ1685ncIAvq9MZ1qpLWpEBmB217HvKxhkGHEJJJpOVyM8d+0Mj4phScvnS tLJCK5kuUJwg2ooX8z4qvg5YtTHwBwEpCNrfQK6H+ZsMUSZldFTk3nrxh/2K0s3I0wK8 JyEzGIFxRCTjRmoWdwiPHyUmCsmaAD1kMTW+O67FP6L153NwMDxl5jj8cTNCmZnufHbG TX2g== X-Gm-Message-State: AMke39k20EYDqfOWHAwNcZ/BSS69tyxyLuShtAkFoTEZVA8hCMumUjutM2zcr0w/TQru1+E9 X-Received: by 10.28.134.67 with SMTP id i64mr626786wmd.5.1488321338922; Tue, 28 Feb 2017 14:35:38 -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.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Feb 2017 14:35:38 -0800 (PST) From: Leif Lindholm To: grub-devel@gnu.org Subject: [PATCH 0/7] efi: improved correctness, arm unification, and cleanup Date: Tue, 28 Feb 2017 22:35:30 +0000 Message-Id: <20170228223537.9685-1-leif.lindholm@linaro.org> X-Mailer: git-send-email 2.11.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22d 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" This patch series is really three different ones, but they unite around the need for (and the implementation) of more flexible control of memory allocation on UEFI systems. 1: Adding new interfaces - A function for detecting the start address of RAM Since ARM platforms have no standardised memory map, implement a function that picks the lowest-address region supporting the write-back cache atribute from the UEFI memory map. - Implement and expose a new memory allocation function giving access to the allocation type and memory type arguments to the AllocatePages boot service. 2: ARM unificatios - The fdt helper library for arm64/efi is really an efi/fdt function. So move it to neutral ground in loader/efi. - The arm64 efi linux loader was written for arm64 only, so clean it up a bit with regards to 32/64-bit portability, and abstract out some definitions and function prototypes. - Move the arm efi port to use the arm64 linux loader instead of the one shared with the u-boot port. Clean up the u-boot loder by deleting the efi-specific bits and other code only used by that. 3: Correctness improvements - There are some restrictions on the placement of initrd images in relation to the runtime kernel images, for both arm and arm64 - but the arm64 one did not use to be explicitly documented (and only triggerable on systems with > 40GB of RAM), and the u-boot loader always placed the images nearly adjacent. Use the new interfaces to place the initrd as approrpiate for each architecture. - The allocation of memory for the grub heap is done of memory type GRUB_EFI_LOADER_DATA. Since UEFI can return memory with non-executable mappings for this request, and modules are loaded onto the heap, change this allocation GRUB_EFI_LOADER_CODE instead. Leif Lindholm (7): efi: add grub_efi_get_dram_base() function for arm* efi: refactor grub_efi_allocate_pages efi: move fdt helper library arm64: make efi linux loader more generic arm: reuse arm64 linux loader on efi systems efi: restrict arm/arm64 linux loader initrd placement efi: change heap allocation type to GRUB_EFI_LOADER_CODE grub-core/Makefile.am | 1 - grub-core/Makefile.core.def | 6 +- grub-core/kern/arm/efi/misc.c | 202 ---------------------------------- grub-core/kern/efi/mm.c | 92 ++++++++++++---- grub-core/loader/arm/linux.c | 48 +------- grub-core/loader/arm64/linux.c | 73 ++++++++---- grub-core/loader/arm64/xen_boot.c | 15 +-- grub-core/loader/{arm64 => efi}/fdt.c | 11 +- include/grub/arm/efi/loader.h | 26 ----- include/grub/arm/efi/memory.h | 3 + include/grub/arm/linux.h | 30 ++--- include/grub/arm64/efi/memory.h | 3 + include/grub/arm64/linux.h | 13 +-- include/grub/efi/efi.h | 10 ++ include/grub/{arm64 => efi}/fdtload.h | 3 - include/grub/efi/pe32.h | 2 + 16 files changed, 176 insertions(+), 362 deletions(-) delete mode 100644 grub-core/kern/arm/efi/misc.c rename grub-core/loader/{arm64 => efi}/fdt.c (93%) delete mode 100644 include/grub/arm/efi/loader.h rename include/grub/{arm64 => efi}/fdtload.h (89%) -- 2.11.0 _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel