Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1386841 > unrolled thread

[PATCH 09/40] efi/arm*: Use memremap() to create the persistent memmap mapping

Started byMatt Fleming <matt@codeblueprint.co.uk>
First post2016-04-25 22:20 +0200
Last post2016-04-28 12:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 09/40] efi/arm*: Use memremap() to create the persistent memmap mapping Matt Fleming <matt@codeblueprint.co.uk> - 2016-04-25 22:20 +0200
    [tip:efi/core] efi/arm*: Use memremap() to create the persistent  memmap mapping tip-bot for Ard Biesheuvel <tipbot@zytor.com> - 2016-04-28 12:40 +0200

#1386841 — [PATCH 09/40] efi/arm*: Use memremap() to create the persistent memmap mapping

FromMatt Fleming <matt@codeblueprint.co.uk>
Date2016-04-25 22:20 +0200
Subject[PATCH 09/40] efi/arm*: Use memremap() to create the persistent memmap mapping
Message-ID<rrV98-3ni-23@gated-at.bofh.it>
From: Ard Biesheuvel <ard.biesheuvel@linaro.org>

Instead of using ioremap_cache(), which is slightly inappropriate for
mapping firmware tables, and is not even allowed on ARM for mapping
regions that are covered by a struct page, use memremap(), which was
invented for this purpose, and will also reuse the existing kernel
direct mapping if the requested region is covered by it.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
---
 drivers/firmware/efi/arm-runtime.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
index 55a9ea041068..19283deac375 100644
--- a/drivers/firmware/efi/arm-runtime.c
+++ b/drivers/firmware/efi/arm-runtime.c
@@ -105,8 +105,7 @@ static int __init arm_enable_runtime_services(void)
 
 	mapsize = efi.memmap.map_end - efi.memmap.map;
 
-	efi.memmap.map = (__force void *)ioremap_cache(efi.memmap.phys_map,
-						       mapsize);
+	efi.memmap.map = memremap(efi.memmap.phys_map, mapsize, MEMREMAP_WB);
 	if (!efi.memmap.map) {
 		pr_err("Failed to remap EFI memory map\n");
 		return -ENOMEM;
-- 
2.7.3

[toc] | [next] | [standalone]


#1389985 — [tip:efi/core] efi/arm*: Use memremap() to create the persistent memmap mapping

Fromtip-bot for Ard Biesheuvel <tipbot@zytor.com>
Date2016-04-28 12:40 +0200
Subject[tip:efi/core] efi/arm*: Use memremap() to create the persistent memmap mapping
Message-ID<rsRwt-1zl-5@gated-at.bofh.it>
In reply to#1386841
Commit-ID:  24d45d1dc275b818093fe1d0055a230ce5e8c4c7
Gitweb:     http://git.kernel.org/tip/24d45d1dc275b818093fe1d0055a230ce5e8c4c7
Author:     Ard Biesheuvel <ard.biesheuvel@linaro.org>
AuthorDate: Mon, 25 Apr 2016 21:06:41 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 28 Apr 2016 11:33:52 +0200

efi/arm*: Use memremap() to create the persistent memmap mapping

Instead of using ioremap_cache(), which is slightly inappropriate for
mapping firmware tables, and is not even allowed on ARM for mapping
regions that are covered by a struct page, use memremap(), which was
invented for this purpose, and will also reuse the existing kernel
direct mapping if the requested region is covered by it.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/1461614832-17633-10-git-send-email-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 drivers/firmware/efi/arm-runtime.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
index 55a9ea0..19283de 100644
--- a/drivers/firmware/efi/arm-runtime.c
+++ b/drivers/firmware/efi/arm-runtime.c
@@ -105,8 +105,7 @@ static int __init arm_enable_runtime_services(void)
 
 	mapsize = efi.memmap.map_end - efi.memmap.map;
 
-	efi.memmap.map = (__force void *)ioremap_cache(efi.memmap.phys_map,
-						       mapsize);
+	efi.memmap.map = memremap(efi.memmap.phys_map, mapsize, MEMREMAP_WB);
 	if (!efi.memmap.map) {
 		pr_err("Failed to remap EFI memory map\n");
 		return -ENOMEM;

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web