linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: catalin.marinas@arm.com, will.deacon@arm.com, rjw@rjwysocki.net,
	lenb@kernel.org, ard.biesheuvel@linaro.org
Cc: tbaicar@codeaurora.org, bhsharma@redhat.com, dyoung@redhat.com,
	james.morse@arm.com, mark.rutland@arm.com, al.stone@linaro.org,
	graeme.gregory@linaro.org, hanjun.guo@linaro.org,
	lorenzo.pieralisi@arm.com, sudeep.holla@arm.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kexec@lists.infradead.org,
	AKASHI Takahiro <takahiro.akashi@linaro.org>
Subject: [PATCH v4 4/5] efi/arm: map UEFI memory map even w/o runtime services enabled
Date: Mon, 23 Jul 2018 10:57:31 +0900	[thread overview]
Message-ID: <20180723015732.24252-5-takahiro.akashi@linaro.org> (raw)
In-Reply-To: <20180723015732.24252-1-takahiro.akashi@linaro.org>

Under the current implementation, UEFI memory map will be mapped and made
available in virtual mappings only if runtime services are enabled.
But in a later patch, we want to use UEFI memory map in acpi_os_ioremap()
to create mappings of ACPI tables using memory attributes described in
UEFI memory map.
See the following commit:
    arm64: acpi: fix alignment fault in accessing ACPI tables

So, as a first step, arm_enter_runtime_services() is modified, alongside
Ard's patch[1], so that UEFI memory map will not be freed even if
efi=noruntime.

[1] https://marc.info/?l=linux-efi&m=152930773507524&w=2

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
 drivers/firmware/efi/arm-runtime.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
index 59a8c0ec94d5..a00934d263c5 100644
--- a/drivers/firmware/efi/arm-runtime.c
+++ b/drivers/firmware/efi/arm-runtime.c
@@ -117,6 +117,13 @@ static int __init arm_enable_runtime_services(void)
 
 	efi_memmap_unmap();
 
+	mapsize = efi.memmap.desc_size * efi.memmap.nr_map;
+
+	if (efi_memmap_init_late(efi.memmap.phys_map, mapsize)) {
+		pr_err("Failed to remap EFI memory map\n");
+		return 0;
+	}
+
 	if (efi_runtime_disabled()) {
 		pr_info("EFI runtime services will be disabled.\n");
 		return 0;
@@ -129,13 +136,6 @@ static int __init arm_enable_runtime_services(void)
 
 	pr_info("Remapping and enabling EFI services.\n");
 
-	mapsize = efi.memmap.desc_size * efi.memmap.nr_map;
-
-	if (efi_memmap_init_late(efi.memmap.phys_map, mapsize)) {
-		pr_err("Failed to remap EFI memory map\n");
-		return -ENOMEM;
-	}
-
 	if (!efi_virtmap_init()) {
 		pr_err("UEFI virtual mapping missing or invalid -- runtime services will not be available\n");
 		return -ENOMEM;
-- 
2.18.0


  parent reply	other threads:[~2018-07-23  1:59 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-23  1:57 [PATCH v4 0/5] arm64: kexec,kdump: fix boot failures on acpi-only system AKASHI Takahiro
2018-07-23  1:57 ` [PATCH v4 1/5] arm64: export memblock_reserve()d regions via /proc/iomem AKASHI Takahiro
2018-08-21  4:39   ` John Stultz
2018-08-21  6:07     ` AKASHI Takahiro
2018-08-21 10:22     ` James Morse
2018-08-21 16:48       ` James Morse
2018-08-21 19:38       ` John Stultz
2018-08-23 12:35         ` James Morse
2018-07-23  1:57 ` [PATCH v4 2/5] drivers: acpi: add dependency of EFI for arm64 AKASHI Takahiro
2018-07-23  1:57 ` [PATCH v4 3/5] efi/arm: preserve early mapping of UEFI memory map longer for BGRT AKASHI Takahiro
2018-07-23  1:57 ` AKASHI Takahiro [this message]
2018-07-23  1:57 ` [PATCH v4 5/5] arm64: acpi: fix alignment fault in accessing ACPI AKASHI Takahiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180723015732.24252-5-takahiro.akashi@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --cc=al.stone@linaro.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=bhsharma@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=dyoung@redhat.com \
    --cc=graeme.gregory@linaro.org \
    --cc=hanjun.guo@linaro.org \
    --cc=james.morse@arm.com \
    --cc=kexec@lists.infradead.org \
    --cc=lenb@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=rjw@rjwysocki.net \
    --cc=sudeep.holla@arm.com \
    --cc=tbaicar@codeaurora.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).