From: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
To: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: Re: [PATCH 2/2] efi: introduce EFI_NX_PE_DATA bit and set it from properties table
Date: Wed, 23 Sep 2015 15:18:17 +0100 [thread overview]
Message-ID: <20150923141817.GF2867@codeblueprint.co.uk> (raw)
In-Reply-To: <1441786096-8514-2-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
On Wed, 09 Sep, at 10:08:16AM, Ard Biesheuvel wrote:
> UEFI v2.5 introduces a runtime memory protection feature that splits
> PE/COFF runtime images into separate code and data regions. Since this
> may require special handling by the OS, allocate a EFI_xxx bit to
> keep track of whether this feature is currently active or not.
>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> ---
> drivers/firmware/efi/efi.c | 15 +++++++++++++++
> include/linux/efi.h | 1 +
> 2 files changed, 16 insertions(+)
The design looks fine just some very minor stylistic changes.
> diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
> index 5cbb8d31da33..8befd0b53472 100644
> --- a/drivers/firmware/efi/efi.c
> +++ b/drivers/firmware/efi/efi.c
> @@ -425,6 +425,21 @@ int __init efi_config_parse_tables(void *config_tables, int count, int sz,
> }
> pr_cont("\n");
> set_bit(EFI_CONFIG_TABLES, &efi.flags);
> +
> + /* parse the EFI Properties table if it exists */
Capital 'P', please.
> + if (efi.properties_table != EFI_INVALID_TABLE_ADDR) {
> + efi_properties_table_t *tbl;
> +
> + tbl = early_memremap(efi.properties_table, sizeof (*tbl));
No space between sizeof and '(', please.
> + if (tbl == NULL) {
> + pr_err("Could not map Properties table!\n");
> + return -ENOMEM;
> + }
Insert a newline here.
> + if (tbl->memory_protection_attribute &
> + EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA)
> + set_bit(EFI_NX_PE_DATA, &efi.flags);
Insert a newline here.
> + early_memunmap(tbl, sizeof(*tbl));
> + }
Insert a newline here.
> return 0;
> }
>
> diff --git a/include/linux/efi.h b/include/linux/efi.h
> index 5b4f3ac08053..4f2ab71e1b8a 100644
> --- a/include/linux/efi.h
> +++ b/include/linux/efi.h
> @@ -972,6 +972,7 @@ extern int __init efi_setup_pcdp_console(char *);
> #define EFI_PARAVIRT 6 /* Access is via a paravirt interface */
> #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 /* whether PE/COFF images are split */
How about "Can runtime data regions be mapped non-executable?"
--
Matt Fleming, Intel Open Source Technology Center
next prev parent reply other threads:[~2015-09-23 14:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 8:08 [PATCH 1/2] efi: add support for UEFIv2.5 Properties table Ard Biesheuvel
[not found] ` <1441786096-8514-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-09-09 8:08 ` [PATCH 2/2] efi: introduce EFI_NX_PE_DATA bit and set it from properties table Ard Biesheuvel
[not found] ` <1441786096-8514-2-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-09-23 14:18 ` Matt Fleming [this message]
[not found] ` <20150923141817.GF2867-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-09-23 14:29 ` [PATCH v2 " Ard Biesheuvel
[not found] ` <1443018574-21702-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-09-23 16:55 ` Matt Fleming
2015-09-23 13:54 ` [PATCH 1/2] efi: add support for UEFIv2.5 Properties table Matt Fleming
2015-09-24 6:06 ` Dave Young
[not found] ` <20150924060624.GA26341-sa4SJRhfYT7nqxX4cJjai/XAX3CI6PSWQQ4Iyu8u01E@public.gmane.org>
2015-09-24 21:06 ` Ard Biesheuvel
[not found] ` <CAKv+Gu9hoMybK19EGRxsQTt1A4xsfwj40d=6F5kVHQD+39CvGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-09-25 1:43 ` Dave Young
[not found] ` <20150925014336.GA6640-sa4SJRhfYT7nqxX4cJjai/XAX3CI6PSWQQ4Iyu8u01E@public.gmane.org>
2015-09-25 6:45 ` Ard Biesheuvel
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=20150923141817.GF2867@codeblueprint.co.uk \
--to=matt-mf/unelci9gs6ibeejttw/xrex20p6io@public.gmane.org \
--cc=ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.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).