All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] efi: stub: use a pool allocation for the cmdline
@ 2015-04-10 12:56 ` Ard Biesheuvel
  0 siblings, 0 replies; 12+ messages in thread
From: Ard Biesheuvel @ 2015-04-10 12:56 UTC (permalink / raw)
  To: linux-efi-u79uwXL29TY76Z2rM5mHXA,
	matt.fleming-ral2JQCrhuEAvxtiuMwx3w,
	roy.franz-QSEj5FYQhm4dnm+yROfE0A,
	leif.lindholm-QSEj5FYQhm4dnm+yROfE0A,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: x86-DgEjT+Ai2ygdnm+yROfE0A, Ard Biesheuvel

This changes the allocation for the ASCII-converted command
line to use an ordinary memory pool rather than a separate
page based allocation.

Pool allocations are generally preferred over page based
allocations due to the fact that they cause less fragmentation,
but in the particular case of arm64, where page allocations are
rounded up to 64 KB and where this allocation happens to be the
only explicit low allocation, it results in the lowest 64 KB of
memory to always be taken up by this particular allocation.

So allocate from the EFI_LOADER_DATA pool instead.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
 drivers/firmware/efi/libstub/efi-stub-helper.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c
index f07d4a67fa76..c95a567ca132 100644
--- a/drivers/firmware/efi/libstub/efi-stub-helper.c
+++ b/drivers/firmware/efi/libstub/efi-stub-helper.c
@@ -684,7 +684,8 @@ char *efi_convert_cmdline(efi_system_table_t *sys_table_arg,
 
 	options_bytes++;	/* NUL termination */
 
-	status = efi_low_alloc(sys_table_arg, options_bytes, 0, &cmdline_addr);
+	status = efi_call_early(allocate_pool, EFI_LOADER_DATA,
+				options_bytes, (void **)&cmdline_addr);
 	if (status != EFI_SUCCESS)
 		return NULL;
 
-- 
1.8.3.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2015-04-15 10:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-10 12:56 [PATCH] efi: stub: use a pool allocation for the cmdline Ard Biesheuvel
2015-04-10 12:56 ` Ard Biesheuvel
     [not found] ` <1428670569-23089-1-git-send-email-ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-04-10 16:43   ` Roy Franz
2015-04-10 16:43     ` Roy Franz
     [not found]     ` <CAFECyb9efREE=BU5RGSbzAGHqi5CkivUuTf=BRdq02GvFqJaOA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-10 17:14       ` Ard Biesheuvel
2015-04-10 17:14         ` Ard Biesheuvel
     [not found]         ` <CAKv+Gu-KHpSWLKOgA7UW8C6L1-K3dOieNmF2=qq_t5N73u3Spg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-11  0:44           ` Roy Franz
2015-04-11  0:44             ` Roy Franz
2015-04-15  9:55           ` Matt Fleming
2015-04-15  9:55             ` Matt Fleming
     [not found]             ` <20150415095506.GA4804-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
2015-04-15 10:01               ` Ard Biesheuvel
2015-04-15 10:01                 ` Ard Biesheuvel

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.