From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] arm*: efi: take the Memory Attributes table into account
Date: Mon, 22 Feb 2016 15:29:15 +0100 [thread overview]
Message-ID: <1456151355-25943-2-git-send-email-ard.biesheuvel@linaro.org> (raw)
In-Reply-To: <1456151355-25943-1-git-send-email-ard.biesheuvel@linaro.org>
Call into the generic memory attributes table support code at the
appropriate times during the init sequence so that the UEFI Runtime
Services region are mapped according to the strict permissions it
specifies.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
arch/arm64/include/asm/efi.h | 2 ++
drivers/firmware/efi/arm-init.c | 1 +
drivers/firmware/efi/arm-runtime.c | 3 +++
3 files changed, 6 insertions(+)
diff --git a/arch/arm64/include/asm/efi.h b/arch/arm64/include/asm/efi.h
index 8e88a696c9cb..4dafc89f373a 100644
--- a/arch/arm64/include/asm/efi.h
+++ b/arch/arm64/include/asm/efi.h
@@ -14,6 +14,8 @@ extern void efi_init(void);
int efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md);
+#define efi_set_mapping_permissions efi_create_mapping
+
#define efi_call_virt(f, ...) \
({ \
efi_##f##_t *__f; \
diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
index aa1f743152a2..022f11157acd 100644
--- a/drivers/firmware/efi/arm-init.c
+++ b/drivers/firmware/efi/arm-init.c
@@ -202,6 +202,7 @@ void __init efi_init(void)
return;
reserve_regions();
+ efi_memattr_init();
early_memunmap(memmap.map, params.mmap_size);
memblock_mark_nomap(params.mmap & PAGE_MASK,
PAGE_ALIGN(params.mmap_size +
diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
index 3a3911641049..848ede1587dc 100644
--- a/drivers/firmware/efi/arm-runtime.c
+++ b/drivers/firmware/efi/arm-runtime.c
@@ -65,6 +65,9 @@ static bool __init efi_virtmap_init(void)
return false;
}
}
+
+ if (efi_memattr_apply_permissions(&efi_mm, efi_set_mapping_permissions))
+ return false;
return true;
}
--
2.5.0
next prev parent reply other threads:[~2016-02-22 14:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-22 14:25 [PATCH 0/5] memory attribute table support Ard Biesheuvel
2016-02-22 14:25 ` [PATCH 1/5] ARM: efi: apply strict permissons for UEFI Runtime Services regions Ard Biesheuvel
2016-03-02 11:49 ` Matt Fleming
2016-03-02 13:07 ` Ard Biesheuvel
2016-03-02 13:14 ` Matt Fleming
2016-02-22 14:25 ` [PATCH 2/5] arm64: " Ard Biesheuvel
2016-03-02 12:10 ` Matt Fleming
2016-03-02 13:09 ` Ard Biesheuvel
2016-02-22 14:25 ` [PATCH 3/5] efi: add support for the EFI_MEMORY_ATTRIBUTES_TABLE config table Ard Biesheuvel
2016-02-22 14:29 ` [PATCH 4/5] efi: implement generic support for the Memory Attributes table Ard Biesheuvel
2016-02-22 14:29 ` Ard Biesheuvel [this message]
2016-03-02 13:10 ` Matt Fleming
2016-03-02 12:22 ` [PATCH 3/5] efi: add support for the EFI_MEMORY_ATTRIBUTES_TABLE config table Matt Fleming
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=1456151355-25943-2-git-send-email-ard.biesheuvel@linaro.org \
--to=ard.biesheuvel@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/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).