linux-efi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 4.11 048/150] efi: Dont issue error message when booted under Xen
       [not found] <20170612152519.404936272@linuxfoundation.org>
@ 2017-06-12 15:24 ` Greg Kroah-Hartman
  2017-06-12 15:24 ` [PATCH 4.11 049/150] efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-12 15:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Juergen Gross, Matt Fleming,
	Ard Biesheuvel, Linus Torvalds, Peter Zijlstra, Thomas Gleixner,
	linux-efi, Ingo Molnar

4.11-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Juergen Gross <jgross@suse.com>

commit 1ea34adb87c969b89dfd83f1905a79161e9ada26 upstream.

When booted as Xen dom0 there won't be an EFI memmap allocated. Avoid
issuing an error message in this case:

  [    0.144079] efi: Failed to allocate new EFI memmap

Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20170526113652.21339-2-matt@codeblueprint.co.uk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/platform/efi/quirks.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/arch/x86/platform/efi/quirks.c
+++ b/arch/x86/platform/efi/quirks.c
@@ -358,6 +358,9 @@ void __init efi_free_boot_services(void)
 		free_bootmem_late(start, size);
 	}
 
+	if (!num_entries)
+		return;
+
 	new_size = efi.memmap.desc_size * num_entries;
 	new_phys = efi_memmap_alloc(num_entries);
 	if (!new_phys) {

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

* [PATCH 4.11 049/150] efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot
       [not found] <20170612152519.404936272@linuxfoundation.org>
  2017-06-12 15:24 ` [PATCH 4.11 048/150] efi: Dont issue error message when booted under Xen Greg Kroah-Hartman
@ 2017-06-12 15:24 ` Greg Kroah-Hartman
  2017-06-14 23:34   ` Maniaxx
  1 sibling, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-12 15:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: Greg Kroah-Hartman, stable, Sabrina Dubroca, Dave Young,
	Ard Biesheuvel, Matt Fleming, Linus Torvalds, Peter Zijlstra,
	Thomas Gleixner, linux-efi, Ingo Molnar

4.11-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dave Young <dyoung@redhat.com>

commit 7425826f4f7ac60f2538b06a7f0a5d1006405159 upstream.

Sabrina Dubroca reported an early panic:

  BUG: unable to handle kernel paging request at ffffffffff240001
  IP: efi_bgrt_init+0xdc/0x134

  [...]

  ---[ end Kernel panic - not syncing: Attempted to kill the idle task!

... which was introduced by:

  7b0a911478c7 ("efi/x86: Move the EFI BGRT init code to early init code")

The cause is that on this machine the firmware provides the EFI ACPI BGRT
table even on legacy non-EFI bootups - which table should be EFI only.

The garbage BGRT data causes the efi_bgrt_init() panic.

Add a check to skip efi_bgrt_init() in case non-EFI bootup to work around
this firmware bug.

Tested-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Dave Young <dyoung@redhat.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-efi@vger.kernel.org
Fixes: 7b0a911478c7 ("efi/x86: Move the EFI BGRT init code to early init code")
Link: http://lkml.kernel.org/r/20170526113652.21339-6-matt@codeblueprint.co.uk
[ Rewrote the changelog to be more readable. ]
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/x86/platform/efi/efi-bgrt.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/arch/x86/platform/efi/efi-bgrt.c
+++ b/arch/x86/platform/efi/efi-bgrt.c
@@ -36,6 +36,9 @@ void __init efi_bgrt_init(struct acpi_ta
 	if (acpi_disabled)
 		return;
 
+	if (!efi_enabled(EFI_BOOT))
+		return;
+
 	if (table->length < sizeof(bgrt_tab)) {
 		pr_notice("Ignoring BGRT: invalid length %u (expected %zu)\n",
 		       table->length, sizeof(bgrt_tab));

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

* Re: [PATCH 4.11 049/150] efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot
  2017-06-12 15:24 ` [PATCH 4.11 049/150] efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot Greg Kroah-Hartman
@ 2017-06-14 23:34   ` Maniaxx
       [not found]     ` <9a71b41b-5e6a-e0a5-776d-829792e7f998-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Maniaxx @ 2017-06-14 23:34 UTC (permalink / raw)
  To: linux-kernel; +Cc: stable, linux-efi

On 12.06.2017 at 17:24 wrote Greg Kroah-Hartman:
> 4.11-stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Dave Young <dyoung@redhat.com>
> 
> commit 7425826f4f7ac60f2538b06a7f0a5d1006405159 upstream.
> 
> Sabrina Dubroca reported an early panic:
> 
>   BUG: unable to handle kernel paging request at ffffffffff240001
>   IP: efi_bgrt_init+0xdc/0x134
> 
>   [...]
> 
>   ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
> 
> ... which was introduced by:
> 
>   7b0a911478c7 ("efi/x86: Move the EFI BGRT init code to early init code")
> 
> The cause is that on this machine the firmware provides the EFI ACPI BGRT
> table even on legacy non-EFI bootups - which table should be EFI only.
> 
> The garbage BGRT data causes the efi_bgrt_init() panic.
> 
> Add a check to skip efi_bgrt_init() in case non-EFI bootup to work around
> this firmware bug.
> 
> Tested-by: Sabrina Dubroca <sd@queasysnail.net>
> Signed-off-by: Dave Young <dyoung@redhat.com>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
> Cc: Linus Torvalds <torvalds@linux-foundation.org>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: linux-efi@vger.kernel.org
> Fixes: 7b0a911478c7 ("efi/x86: Move the EFI BGRT init code to early init code")
> Link: http://lkml.kernel.org/r/20170526113652.21339-6-matt@codeblueprint.co.uk
> [ Rewrote the changelog to be more readable. ]
> Signed-off-by: Ingo Molnar <mingo@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> ---
>  arch/x86/platform/efi/efi-bgrt.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> --- a/arch/x86/platform/efi/efi-bgrt.c
> +++ b/arch/x86/platform/efi/efi-bgrt.c
> @@ -36,6 +36,9 @@ void __init efi_bgrt_init(struct acpi_ta
>  	if (acpi_disabled)
>  		return;
>  
> +	if (!efi_enabled(EFI_BOOT))
> +		return;
> +
>  	if (table->length < sizeof(bgrt_tab)) {
>  		pr_notice("Ignoring BGRT: invalid length %u (expected %zu)\n",
>  		       table->length, sizeof(bgrt_tab));
> 
> 
> 

The patch is ok but it only fixes BIOS systems.
To fix the regression above (commit 7b0a911478c7) for EFI systems 
it needs this patch as well:
commit 792ef14df5c585c19b2831673a077504a09e5203 master
(efi: Fix boot panic because of invalid BGRT image address)

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

* Re: [PATCH 4.11 049/150] efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot
       [not found]     ` <9a71b41b-5e6a-e0a5-776d-829792e7f998-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-06-15  7:17       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2017-06-15  7:17 UTC (permalink / raw)
  To: Maniaxx
  Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	stable-u79uwXL29TY76Z2rM5mHXA, Sabrina Dubroca, Dave Young,
	Ard Biesheuvel, Matt Fleming, Linus Torvalds, Peter Zijlstra,
	Thomas Gleixner, linux-efi-u79uwXL29TY76Z2rM5mHXA, Ingo Molnar

On Thu, Jun 15, 2017 at 01:34:38AM +0200, Maniaxx wrote:
> On 12.06.2017 at 17:24 wrote Greg Kroah-Hartman:
> > 4.11-stable review patch.  If anyone has any objections, please let me know.
> > 
> > ------------------
> > 
> > From: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > 
> > commit 7425826f4f7ac60f2538b06a7f0a5d1006405159 upstream.
> > 
> > Sabrina Dubroca reported an early panic:
> > 
> >   BUG: unable to handle kernel paging request at ffffffffff240001
> >   IP: efi_bgrt_init+0xdc/0x134
> > 
> >   [...]
> > 
> >   ---[ end Kernel panic - not syncing: Attempted to kill the idle task!
> > 
> > ... which was introduced by:
> > 
> >   7b0a911478c7 ("efi/x86: Move the EFI BGRT init code to early init code")
> > 
> > The cause is that on this machine the firmware provides the EFI ACPI BGRT
> > table even on legacy non-EFI bootups - which table should be EFI only.
> > 
> > The garbage BGRT data causes the efi_bgrt_init() panic.
> > 
> > Add a check to skip efi_bgrt_init() in case non-EFI bootup to work around
> > this firmware bug.
> > 
> > Tested-by: Sabrina Dubroca <sd-y1jBWg8GRStKuXlAQpz2QA@public.gmane.org>
> > Signed-off-by: Dave Young <dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > Signed-off-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
> > Signed-off-by: Matt Fleming <matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org>
> > Cc: Linus Torvalds <torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
> > Cc: Peter Zijlstra <peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
> > Cc: Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
> > Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > Fixes: 7b0a911478c7 ("efi/x86: Move the EFI BGRT init code to early init code")
> > Link: http://lkml.kernel.org/r/20170526113652.21339-6-matt-mF/unelCI9GS6iBeEJttW/XRex20P6io@public.gmane.org
> > [ Rewrote the changelog to be more readable. ]
> > Signed-off-by: Ingo Molnar <mingo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
> > 
> > ---
> >  arch/x86/platform/efi/efi-bgrt.c |    3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > --- a/arch/x86/platform/efi/efi-bgrt.c
> > +++ b/arch/x86/platform/efi/efi-bgrt.c
> > @@ -36,6 +36,9 @@ void __init efi_bgrt_init(struct acpi_ta
> >  	if (acpi_disabled)
> >  		return;
> >  
> > +	if (!efi_enabled(EFI_BOOT))
> > +		return;
> > +
> >  	if (table->length < sizeof(bgrt_tab)) {
> >  		pr_notice("Ignoring BGRT: invalid length %u (expected %zu)\n",
> >  		       table->length, sizeof(bgrt_tab));
> > 
> > 
> > 
> 
> The patch is ok but it only fixes BIOS systems.
> To fix the regression above (commit 7b0a911478c7) for EFI systems 
> it needs this patch as well:
> commit 792ef14df5c585c19b2831673a077504a09e5203 master
> (efi: Fix boot panic because of invalid BGRT image address)

Thanks for letting me know, now queued up.

greg k-h

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

end of thread, other threads:[~2017-06-15  7:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20170612152519.404936272@linuxfoundation.org>
2017-06-12 15:24 ` [PATCH 4.11 048/150] efi: Dont issue error message when booted under Xen Greg Kroah-Hartman
2017-06-12 15:24 ` [PATCH 4.11 049/150] efi/bgrt: Skip efi_bgrt_init() in case of non-EFI boot Greg Kroah-Hartman
2017-06-14 23:34   ` Maniaxx
     [not found]     ` <9a71b41b-5e6a-e0a5-776d-829792e7f998-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-15  7:17       ` Greg Kroah-Hartman

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).