From: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
To: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: jlee@suse.com, bp@alien8.de, ricardo.neri@intel.com,
matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org,
ravi.v.shankar@intel.com, fenghua.yu@intel.com,
Sai Praneeth <sai.praneeth.prakhya@intel.com>
Subject: [PATCH 2/4] efi: Introduce EFI_MEM_ATTR bit and set it from memory attributes table
Date: Tue, 6 Dec 2016 11:16:01 -0800 [thread overview]
Message-ID: <1481051763-8705-3-git-send-email-sai.praneeth.prakhya@intel.com> (raw)
In-Reply-To: <1481051763-8705-1-git-send-email-sai.praneeth.prakhya@intel.com>
From: Sai Praneeth <sai.praneeth.prakhya@intel.com>
UEFI v2.6 introduces a configuration table called
EFI_MEMORY_ATTRIBUTES_TABLE which provides additional information about
efi runtime regions. Currently this table describes memory protections
that may be applied to EFI Runtime code and data regions by kernel.
Allocate a EFI_XXX bit to keep track of whether this feature is
published by firmware or not.
Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Lee, Chun-Yi <jlee@suse.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Ricardo Neri <ricardo.neri@intel.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ravi Shankar <ravi.v.shankar@intel.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
---
drivers/firmware/efi/memattr.c | 1 +
include/linux/efi.h | 1 +
2 files changed, 2 insertions(+)
diff --git a/drivers/firmware/efi/memattr.c b/drivers/firmware/efi/memattr.c
index 236004b9a50d..402197460507 100644
--- a/drivers/firmware/efi/memattr.c
+++ b/drivers/firmware/efi/memattr.c
@@ -43,6 +43,7 @@ int __init efi_memattr_init(void)
tbl_size = sizeof(*tbl) + tbl->num_entries * tbl->desc_size;
memblock_reserve(efi.mem_attr_table, tbl_size);
+ set_bit(EFI_MEM_ATTR, &efi.flags);
unmap:
early_memunmap(tbl, sizeof(*tbl));
diff --git a/include/linux/efi.h b/include/linux/efi.h
index a07a476178cd..41047ea555e3 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -1063,6 +1063,7 @@ extern int __init efi_setup_pcdp_console(char *);
#define EFI_ARCH_1 7 /* First arch-specific bit */
#define EFI_DBG 8 /* Print additional debug info at runtime */
#define EFI_NX_PE_DATA 9 /* Can runtime data regions be mapped non-executable? */
+#define EFI_MEM_ATTR 10 /* Did firmware publish EFI_MEMORY_ATTRIBUTES table? */
#ifdef CONFIG_EFI
/*
--
2.1.4
next prev parent reply other threads:[~2016-12-06 19:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-06 19:15 [PATCH 0/4] UEFI: EFI_MEMORY_ATTRIBUTES_TABLE support for x86 Sai Praneeth Prakhya
2016-12-06 19:16 ` [PATCH 1/4] efi: Make EFI_MEMORY_ATTRIBUTES_TABLE initialization common across all architectures Sai Praneeth Prakhya
2016-12-07 13:28 ` Matt Fleming
2016-12-06 19:16 ` Sai Praneeth Prakhya [this message]
2016-12-06 19:16 ` [PATCH 3/4] x86/efi: Add support for EFI_MEMORY_ATTRIBUTES_TABLE Sai Praneeth Prakhya
2016-12-06 19:16 ` [PATCH 4/4] efi: Skip parsing of EFI_PROPERTIES_TABLE if EFI_MEMORY_ATTRIBUTES_TABLE is detected Sai Praneeth Prakhya
2016-12-07 13:36 ` Matt Fleming
2016-12-07 13:26 ` [PATCH 0/4] UEFI: EFI_MEMORY_ATTRIBUTES_TABLE support for x86 Matt Fleming
2016-12-07 13:56 ` Matt Fleming
2016-12-07 19:01 ` Sai Praneeth Prakhya
2016-12-07 20:04 ` Matt Fleming
2016-12-07 20:13 ` Sai Praneeth Prakhya
2016-12-13 6:47 ` joeyli
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=1481051763-8705-3-git-send-email-sai.praneeth.prakhya@intel.com \
--to=sai.praneeth.prakhya@intel.com \
--cc=ard.biesheuvel@linaro.org \
--cc=bp@alien8.de \
--cc=fenghua.yu@intel.com \
--cc=jlee@suse.com \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matt@codeblueprint.co.uk \
--cc=ravi.v.shankar@intel.com \
--cc=ricardo.neri@intel.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).