* [PATCH] x86/efi Fix regression in efi_arch_mem_reserve
@ 2016-12-21 13:11 Petr Oros
2016-12-21 22:30 ` Matt Fleming
0 siblings, 1 reply; 3+ messages in thread
From: Petr Oros @ 2016-12-21 13:11 UTC (permalink / raw)
To: matt; +Cc: ard.biesheuvel, tglx, mingo, hpa, x86, linux-efi, linux-kernel
Booting on EFI with ESRT table has been stop since commit:
8e80632 efi/esrt: Use efi_mem_reserve() and avoid a kmalloc()
This is caused by this commit:
816e761 efi: Allow drivers to reserve boot services forever
Problem is, that efi_memmap_insert need memory aligned
on EFI_PAGE_SIZE. If memory not aligned, efi_memmap_insert
just return and let efi.memmap in inconsistent state.
This breaking boot.
Tested in my machine, which stop booting
after upgrade to 4.9
Signed-off-by: Petr Oros <poros@redhat.com>
---
arch/x86/platform/efi/quirks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
index 10aca63..7678857 100644
--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -214,7 +214,7 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
new_size = efi.memmap.desc_size * num_entries;
- new_phys = memblock_alloc(new_size, 0);
+ new_phys = memblock_alloc(new_size, EFI_PAGE_SIZE);
if (!new_phys) {
pr_err("Could not allocate boot services memmap\n");
return;
--
2.10.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/efi Fix regression in efi_arch_mem_reserve
2016-12-21 13:11 [PATCH] x86/efi Fix regression in efi_arch_mem_reserve Petr Oros
@ 2016-12-21 22:30 ` Matt Fleming
2016-12-22 10:21 ` Petr Oros
0 siblings, 1 reply; 3+ messages in thread
From: Matt Fleming @ 2016-12-21 22:30 UTC (permalink / raw)
To: Petr Oros; +Cc: ard.biesheuvel, tglx, mingo, hpa, x86, linux-efi, linux-kernel
On Wed, 21 Dec, at 02:11:38PM, Petr Oros wrote:
> Booting on EFI with ESRT table has been stop since commit:
> 8e80632 efi/esrt: Use efi_mem_reserve() and avoid a kmalloc()
>
> This is caused by this commit:
> 816e761 efi: Allow drivers to reserve boot services forever
>
> Problem is, that efi_memmap_insert need memory aligned
> on EFI_PAGE_SIZE. If memory not aligned, efi_memmap_insert
> just return and let efi.memmap in inconsistent state.
> This breaking boot.
>
> Tested in my machine, which stop booting
> after upgrade to 4.9
>
> Signed-off-by: Petr Oros <poros@redhat.com>
> ---
> arch/x86/platform/efi/quirks.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Could you provide some more information? Why does efi_memmap_insert()
require this alignment? How does booting "break"? If you see an Oops,
please post it here.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] x86/efi Fix regression in efi_arch_mem_reserve
2016-12-21 22:30 ` Matt Fleming
@ 2016-12-22 10:21 ` Petr Oros
0 siblings, 0 replies; 3+ messages in thread
From: Petr Oros @ 2016-12-22 10:21 UTC (permalink / raw)
To: Matt Fleming
Cc: ard.biesheuvel, tglx, mingo, hpa, x86, linux-efi, linux-kernel
Matt Fleming píše v Wed 21. 12. 2016 v 22:30 +0000:
> On Wed, 21 Dec, at 02:11:38PM, Petr Oros wrote:
> >
> > Booting on EFI with ESRT table has been stop since commit:
> > 8e80632 efi/esrt: Use efi_mem_reserve() and avoid a kmalloc()
> >
> > This is caused by this commit:
> > 816e761 efi: Allow drivers to reserve boot services forever
> >
> > Problem is, that efi_memmap_insert need memory aligned
> > on EFI_PAGE_SIZE. If memory not aligned, efi_memmap_insert
> > just return and let efi.memmap in inconsistent state.
> > This breaking boot.
> >
> > Tested in my machine, which stop booting
> > after upgrade to 4.9
> >
> > Signed-off-by: Petr Oros <poros@redhat.com>
> > ---
> > arch/x86/platform/efi/quirks.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Could you provide some more information? Why does efi_memmap_insert()
> require this alignment? How does booting "break"? If you see an Oops,
> please post it here.
Ooops, sorry, please ignore this patch. I overlooked efi_memmap_insert
argument order. I bisected kernel and this patch breaking kernel boot
but from other reason. Provided patch fixed kernel booting issue by
mistake.
-Petr
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-12-22 10:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-21 13:11 [PATCH] x86/efi Fix regression in efi_arch_mem_reserve Petr Oros
2016-12-21 22:30 ` Matt Fleming
2016-12-22 10:21 ` Petr Oros
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).