Roger Pau Monné 4127ea3a9a lib/relocator: Always enforce the requested alignment in malloc_in_range()
On failure to allocate from grub_relocator_firmware_alloc_region() in
malloc_in_range() the function would stop enforcing the alignment, and
the following was returned:

  lib/relocator.c:431: trying to allocate in 0x200000-0xffbf9fff aligned 0x200000 size 0x406000
  lib/relocator.c:1197: allocated: 0x74de2000+0x406000
  lib/relocator.c:1407: allocated 0x74de2000/0x74de2000

Fix this by making sure that target always contains a suitably aligned
address. After the change the return from the function is:

  lib/relocator.c:431: trying to allocate in 0x200000-0xffb87fff aligned 0x200000 size 0x478000
  lib/relocator.c:1204: allocated: 0x74c00000+0x478000
  lib/relocator.c:1414: allocated 0x74c00000/0x74c00000

Fixes: 3a5768645c05 (First version of allocation from firmware)

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2023-05-17 18:19:02 +02:00
..
2011-05-13 16:36:05 +02:00
2017-05-08 20:53:28 +02:00
2023-05-17 13:21:43 +02:00
2010-08-30 00:54:15 +02:00
2022-03-14 15:47:13 +01:00
2022-03-14 15:47:13 +01:00
2021-12-23 01:05:34 +01:00
2022-03-14 15:47:13 +01:00
2022-03-14 15:47:13 +01:00
2019-02-25 11:28:44 +01:00
2016-10-27 16:22:06 +02:00
2022-03-21 18:50:13 +01:00
2022-03-14 15:47:13 +01:00
2011-07-05 20:24:20 +02:00
2022-03-14 15:47:13 +01:00
2012-02-26 18:09:07 +01:00
2022-03-14 15:47:13 +01:00
2013-12-18 05:28:05 +01:00
2016-02-12 12:39:38 +01:00
2023-05-17 12:51:50 +02:00