grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Josh Triplett <josh@joshtriplett.org>
To: grub-devel@gnu.org
Subject: [PATCH 2/4] efi: Fix requests to allocate GRUB_MEMORY_AVAILABLE
Date: Tue, 12 Nov 2013 18:26:27 -0800	[thread overview]
Message-ID: <04626043f86011c00505e719d84d40ef155ce312.1384309081.git.josh@joshtriplett.org> (raw)
In-Reply-To: <cover.1384309081.git.josh@joshtriplett.org>

EFI firmware refuses to allocate memory of type
GRUB_EFI_CONVENTIONAL_MEMORY, because that indicates a block of
available memory that other allocations (or the OS) would then step on.
Map GRUB_MEMORY_AVAILABLE to GRUB_EFI_LOADER_CODE instead.
---

ChangeLog entry:

2013-11-13  Josh Triplett  <josh@joshtriplett.org>

	* grub-core/mmap/efi/mmap.c (make_efi_memtype): Map
	  GRUB_MEMORY_AVAILABLE to GRUB_EFI_LOADER_CODE rather than
	  GRUB_EFI_CONVENTIONAL_MEMORY.  EFI firmware refuses to allocate
	  memory of type GRUB_EFI_CONVENTIONAL_MEMORY, because that
	  indicates a block of available memory that other allocations (or
	  the OS) would then step on.

 grub-core/mmap/efi/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grub-core/mmap/efi/mmap.c b/grub-core/mmap/efi/mmap.c
index a77efe8..e6cd185 100644
--- a/grub-core/mmap/efi/mmap.c
+++ b/grub-core/mmap/efi/mmap.c
@@ -146,7 +146,7 @@ make_efi_memtype (int type)
       return GRUB_EFI_UNUSABLE_MEMORY;
 
     case GRUB_MEMORY_AVAILABLE:
-      return GRUB_EFI_CONVENTIONAL_MEMORY;
+      return GRUB_EFI_LOADER_CODE;
 
     case GRUB_MEMORY_ACPI:
       return GRUB_EFI_ACPI_RECLAIM_MEMORY;
-- 
1.8.4.3



  parent reply	other threads:[~2013-11-13  2:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13  2:25 [PATCH 0/4] i386-efi and x86_64-efi fixes Josh Triplett
2013-11-13  2:26 ` [PATCH 1/4] efi: Fix firmware memory allocation to round to 4k pages, not 1k Josh Triplett
2013-11-18 17:01   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-13  2:26 ` Josh Triplett [this message]
2013-11-18 16:58   ` [PATCH 2/4] efi: Fix requests to allocate GRUB_MEMORY_AVAILABLE Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-13  2:26 ` [PATCH 3/4] efi: Support GRUB_MMAP_MALLOC_LOW in the EFI firmware allocator Josh Triplett
2013-11-13  3:59   ` Andrey Borzenkov
2013-11-14  8:08     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-14  8:05   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-13  2:27 ` [PATCH 4/4] efi: On x86-64, align the stack to a 16-byte boundary as required by ABI Josh Triplett
2013-11-14  8:01   ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-15  7:15   ` Jordan Justen
2013-11-15 11:01     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-11-19 13:32   ` Vladimir 'φ-coder/phcoder' Serbinenko

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=04626043f86011c00505e719d84d40ef155ce312.1384309081.git.josh@joshtriplett.org \
    --to=josh@joshtriplett.org \
    --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 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).