All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baskov Evgeniy <baskov@ispras.ru>
To: grub-devel@gnu.org
Cc: Baskov Evgeniy <baskov@ispras.ru>
Subject: [PATCH RFC 0/3] EFI memory attributes
Date: Thu,  7 Apr 2022 06:32:25 +0300	[thread overview]
Message-ID: <20220407033228.30242-1-baskov@ispras.ru> (raw)

UEFI specification does not guarantee that all memory would
be executable and there exist some UEFI implementations imposing 
stricter memory management policies and restricting execution
of memory where trampoline code generated by relocator is placed.
That causes page fault during boot.

Explicitly set memory attributes using DXE services for
memory region possibly occupied with trampoline code and data.

This patch works in the same way as the following patch
for the Linux kernel [1].

Later the use of DXE services can be replaced with
UEFI_MEMORY_ATTRIBUTE protocol, when it will become ready [2].

[1] https://lkml.org/lkml/2022/3/3/532
[2] https://bugzilla.tianocore.org/show_bug.cgi?id=3519

Baskov Evgeniy(3):
       efi: explicitly set memory attributes for memory
       relocator: allocate trampoline in lower 640k
       efi: provide definitions of DXE services table

 grub-core/kern/efi/efi.c             |   11 +
 grub-core/kern/efi/mm.c              |   67 ++++++++++++
 grub-core/lib/i386/relocator.c       |    5 
 grub-core/lib/relocator.c            |    1 
 grub-core/lib/x86_64/efi/relocator.c |    6 -
 grub-core/loader/i386/bsd.c          |    2 
 include/grub/efi/api.h               |  149 +++++++++++++++++++++++++++
 include/grub/efi/efi.h               |    3 
 include/grub/i386/relocator.h        |    3 
 9 files changed, 238 insertions(+), 9 deletions(-)


             reply	other threads:[~2022-04-07 14:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07  3:32 Baskov Evgeniy [this message]
2022-04-07  3:32 ` [PATCH RFC 1/3] efi: provide definitions of DXE services table Baskov Evgeniy
2022-04-11  7:12   ` Paul Menzel
2022-04-14 15:15     ` baskov
2022-04-07  3:32 ` [PATCH RFC 2/3] relocator: allocate trampoline in lower 640k Baskov Evgeniy
2022-04-07  3:32 ` [PATCH RFC 3/3] efi: explicitly set memory attributes for memory Baskov Evgeniy

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=20220407033228.30242-1-baskov@ispras.ru \
    --to=baskov@ispras.ru \
    --cc=grub-devel@gnu.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.