public inbox for linux-efi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] correct call to free_pages to specify memory size in pages, not bytes.
@ 2013-07-25  0:48 Roy Franz
  2013-07-25  0:48 ` Roy Franz
  0 siblings, 1 reply; 3+ messages in thread
From: Roy Franz @ 2013-07-25  0:48 UTC (permalink / raw)
  To: matt.fleming-ral2JQCrhuEAvxtiuMwx3w, hpa-YMNOUZJC4hwAvxtiuMwx3w
  Cc: roy.franz-QSEj5FYQhm4dnm+yROfE0A, tglx-hfZtesqFncYOwBW4kG4KsQ,
	mingo-H+wXaHxf7aLQT0dZR+AlfA, x86-DgEjT+Ai2ygdnm+yROfE0A,
	linux-efi-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

I found this bug while working on the EFI stub for ARM - free_pages
is being passed memory size in bytes instead of pages.  Since this is 
unrelated to ARM, I am submitting this separately from the patch set
that adds EFI stub support for ARM.  Those patches will depend on this
one, since the code in question is moved to a shared location and shared
by both x86 and ARM EFI stubs.

Roy Franz (1):
  correct call to free_pages to specify memory size in pages, not
    bytes.

 arch/x86/boot/compressed/eboot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
1.7.10.4

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

* [PATCH] correct call to free_pages to specify memory size in pages, not bytes.
  2013-07-25  0:48 [PATCH] correct call to free_pages to specify memory size in pages, not bytes Roy Franz
@ 2013-07-25  0:48 ` Roy Franz
  2013-07-26 14:58   ` Matt Fleming
  0 siblings, 1 reply; 3+ messages in thread
From: Roy Franz @ 2013-07-25  0:48 UTC (permalink / raw)
  To: matt.fleming, hpa; +Cc: roy.franz, tglx, mingo, x86, linux-efi, linux-kernel

Signed-off-by: Roy Franz <roy.franz@linaro.org>
---
 arch/x86/boot/compressed/eboot.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
index d606463..b7388a4 100644
--- a/arch/x86/boot/compressed/eboot.c
+++ b/arch/x86/boot/compressed/eboot.c
@@ -225,7 +225,7 @@ static void low_free(unsigned long size, unsigned long addr)
 	unsigned long nr_pages;
 
 	nr_pages = round_up(size, EFI_PAGE_SIZE) / EFI_PAGE_SIZE;
-	efi_call_phys2(sys_table->boottime->free_pages, addr, size);
+	efi_call_phys2(sys_table->boottime->free_pages, addr, nr_pages);
 }
 
 static void find_bits(unsigned long mask, u8 *pos, u8 *size)
-- 
1.7.10.4

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

* Re: [PATCH] correct call to free_pages to specify memory size in pages, not bytes.
  2013-07-25  0:48 ` Roy Franz
@ 2013-07-26 14:58   ` Matt Fleming
  0 siblings, 0 replies; 3+ messages in thread
From: Matt Fleming @ 2013-07-26 14:58 UTC (permalink / raw)
  To: Roy Franz; +Cc: hpa, tglx, mingo, x86, linux-efi, linux-kernel

On 25/07/13 01:48, Roy Franz wrote:
> Signed-off-by: Roy Franz <roy.franz@linaro.org>
> ---
>  arch/x86/boot/compressed/eboot.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
> index d606463..b7388a4 100644
> --- a/arch/x86/boot/compressed/eboot.c
> +++ b/arch/x86/boot/compressed/eboot.c
> @@ -225,7 +225,7 @@ static void low_free(unsigned long size, unsigned long addr)
>  	unsigned long nr_pages;
>  
>  	nr_pages = round_up(size, EFI_PAGE_SIZE) / EFI_PAGE_SIZE;
> -	efi_call_phys2(sys_table->boottime->free_pages, addr, size);
> +	efi_call_phys2(sys_table->boottime->free_pages, addr, nr_pages);
>  }
>  
>  static void find_bits(unsigned long mask, u8 *pos, u8 *size)

Thanks Roy. I pulled this into my urgent queue, as it's obviously a bug
and I don't fancy our chances if we ask the firmware to free more memory
than it initially allocated.

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

end of thread, other threads:[~2013-07-26 14:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-25  0:48 [PATCH] correct call to free_pages to specify memory size in pages, not bytes Roy Franz
2013-07-25  0:48 ` Roy Franz
2013-07-26 14:58   ` Matt Fleming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox