]> git.baikalelectronics.ru Git - kernel.git/commit
Revert "efi/libstub: Call get_memory_map() to obtain map and desc sizes"
authorMatt Fleming <matt.fleming@intel.com>
Fri, 13 Feb 2015 15:46:56 +0000 (15:46 +0000)
committerMatt Fleming <matt.fleming@intel.com>
Wed, 18 Feb 2015 11:38:13 +0000 (11:38 +0000)
commit81a30dffa095ab2ccbf3a4a0048d2caa415018f3
tree1ae076d3d17ea10f5050c5e818b8b78df4c87ed1
parentd7edfed649d2db9c8833e206468a08926a3b3b83
Revert "efi/libstub: Call get_memory_map() to obtain map and desc sizes"

This reverts commit 51701c3e74a7f47bdce77d7afc74a53dedf33b0d.

Ard reported a boot failure when running UEFI under Qemu and Xen and
experimenting with various Tianocore build options,

 "As it turns out, when allocating room for the UEFI memory map using
  UEFI's AllocatePool (), it may result in two new memory map entries
  being created, for instance, when using Tianocore's preallocated region
  feature. For example, the following region

  0x00005ead5000-0x00005ebfffff [Conventional Memory|   |  |  |  |  |WB|WT|WC|UC]

  may be split like this

  0x00005ead5000-0x00005eae2fff [Conventional Memory|   |  |  |  |  |WB|WT|WC|UC]
  0x00005eae3000-0x00005eae4fff [Loader Data        |   |  |  |  |  |WB|WT|WC|UC]
  0x00005eae5000-0x00005ebfffff [Conventional Memory|   |  |  |  |  |WB|WT|WC|UC]

  if the preallocated Loader Data region was chosen to be right in the
  middle of the original free space.

  After patch 51701c3e74a7 ("efi/libstub: Call get_memory_map() to
  obtain map and desc sizes"), this is not being dealt with correctly
  anymore, as the existing logic to allocate room for a single additional
  entry has become insufficient."

Mark requested to reinstate the old loop we had before commit
51701c3e74a7, which grows the memory map buffer until it's big enough to
hold the EFI memory map.

Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
drivers/firmware/efi/libstub/efi-stub-helper.c