Don't use post-4G memory on EFI even if 64-bit since some non-compliant

implementations bug on them.

	* grub-core/kern/efi/mm.c (grub_efi_allocate_pages): Skip post-4G
	memory.
	(filter_memory_map): Likewise.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-01-10 23:51:10 +01:00
parent d570097a04
commit ae67942e78
2 changed files with 13 additions and 4 deletions

View file

@ -1,3 +1,12 @@
2011-01-10 Vladimir Serbinenko <phcoder@gmail.com>
Don't use post-4G memory on EFI even if 64-bit since some non-compliant
implementations bug on them.
* grub-core/kern/efi/mm.c (grub_efi_allocate_pages): Skip post-4G
memory.
(filter_memory_map): Likewise.
2011-01-10 Vladimir Serbinenko <phcoder@gmail.com>
* util/grub-kbdcomp.in: Add missing prefix and exec_prefix variables.

View file

@ -52,13 +52,13 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address,
grub_efi_status_t status;
grub_efi_boot_services_t *b;
#if GRUB_TARGET_SIZEOF_VOID_P < 8
#if 1
/* Limit the memory access to less than 4GB for 32-bit platforms. */
if (address > 0xffffffff)
return 0;
#endif
#if GRUB_TARGET_SIZEOF_VOID_P < 8 || defined (MCMODEL_SMALL)
#if 1
if (address == 0)
{
type = GRUB_EFI_ALLOCATE_MAX_ADDRESS;
@ -251,7 +251,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size))
{
if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY
#if GRUB_TARGET_SIZEOF_VOID_P < 8 || defined (MCMODEL_SMALL)
#if 1
&& desc->physical_start <= 0xffffffff
#endif
&& desc->physical_start + PAGES_TO_BYTES (desc->num_pages) > 0x100000
@ -267,7 +267,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map,
desc->physical_start = 0x100000;
}
#if GRUB_TARGET_SIZEOF_VOID_P < 8 || defined (MCMODEL_SMALL)
#if 1
if (BYTES_TO_PAGES (filtered_desc->physical_start)
+ filtered_desc->num_pages
> BYTES_TO_PAGES (0x100000000LL))