[PATCH 0/1][SRU Cosmic][SRU Bionic] Fix booting armhf guests in EFI mode

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 0/1][SRU Cosmic][SRU Bionic] Fix booting armhf guests in EFI mode

dann frazier-4
https://bugs.launchpad.net/bugs/1809488

The fix for LP: #1786878 introduced a regression that broke booting armhf
guests in EFI mode. This clean cherry pick from upstream fixes it.

Ard Biesheuvel (1):
  efi/arm: Revert deferred unmap of early memmap mapping

 drivers/firmware/efi/arm-init.c    | 4 ++++
 drivers/firmware/efi/arm-runtime.c | 2 +-
 drivers/firmware/efi/memmap.c      | 3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)

--
2.20.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

[PATCH 1/1][SRU Cosmic][SRU Bionic] efi/arm: Revert deferred unmap of early memmap mapping

dann frazier-4
From: Ard Biesheuvel <[hidden email]>

BugLink: https://bugs.launchpad.net/bugs/1809488

Commit:

  3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory map longer for BGRT")

deferred the unmap of the early mapping of the UEFI memory map to
accommodate the ACPI BGRT code, which looks up the memory type that
backs the BGRT table to validate it against the requirements of the UEFI spec.

Unfortunately, this causes problems on ARM, which does not permit
early mappings to persist after paging_init() is called, resulting
in a WARN() splat. Since we don't support the BGRT table on ARM anway,
let's revert ARM to the old behaviour, which is to take down the
early mapping at the end of efi_init().

Signed-off-by: Ard Biesheuvel <[hidden email]>
Cc: Linus Torvalds <[hidden email]>
Cc: Peter Zijlstra <[hidden email]>
Cc: Thomas Gleixner <[hidden email]>
Cc: [hidden email]
Fixes: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory ...")
Link: http://lkml.kernel.org/r/20181114175544.12860-3-ard.biesheuvel@...
Signed-off-by: Ingo Molnar <[hidden email]>
(cherry picked from commit 33412b8673135b18ea42beb7f5117ed0091798b6)
Signed-off-by: dann frazier <[hidden email]>
---
 drivers/firmware/efi/arm-init.c    | 4 ++++
 drivers/firmware/efi/arm-runtime.c | 2 +-
 drivers/firmware/efi/memmap.c      | 3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
index 388a929baf95d..1a6a77df8a5e8 100644
--- a/drivers/firmware/efi/arm-init.c
+++ b/drivers/firmware/efi/arm-init.c
@@ -265,6 +265,10 @@ void __init efi_init(void)
     (params.mmap & ~PAGE_MASK)));
 
  init_screen_info();
+
+ /* ARM does not permit early mappings to persist across paging_init() */
+ if (IS_ENABLED(CONFIG_ARM))
+ efi_memmap_unmap();
 }
 
 static int __init register_gop_device(void)
diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
index 922cfb813109a..a00934d263c51 100644
--- a/drivers/firmware/efi/arm-runtime.c
+++ b/drivers/firmware/efi/arm-runtime.c
@@ -110,7 +110,7 @@ static int __init arm_enable_runtime_services(void)
 {
  u64 mapsize;
 
- if (!efi_enabled(EFI_BOOT) || !efi_enabled(EFI_MEMMAP)) {
+ if (!efi_enabled(EFI_BOOT)) {
  pr_info("EFI services will not be available.\n");
  return 0;
  }
diff --git a/drivers/firmware/efi/memmap.c b/drivers/firmware/efi/memmap.c
index 5fc70520e04c4..1907db2b38d81 100644
--- a/drivers/firmware/efi/memmap.c
+++ b/drivers/firmware/efi/memmap.c
@@ -118,6 +118,9 @@ int __init efi_memmap_init_early(struct efi_memory_map_data *data)
 
 void __init efi_memmap_unmap(void)
 {
+ if (!efi_enabled(EFI_MEMMAP))
+ return;
+
  if (!efi.memmap.late) {
  unsigned long size;
 
--
2.20.1


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [PATCH 1/1][SRU Cosmic][SRU Bionic] efi/arm: Revert deferred unmap of early memmap mapping

Kleber Souza
On 12/21/18 7:52 PM, dann frazier wrote:

> From: Ard Biesheuvel <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1809488
>
> Commit:
>
>   3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory map longer for BGRT")
>
> deferred the unmap of the early mapping of the UEFI memory map to
> accommodate the ACPI BGRT code, which looks up the memory type that
> backs the BGRT table to validate it against the requirements of the UEFI spec.
>
> Unfortunately, this causes problems on ARM, which does not permit
> early mappings to persist after paging_init() is called, resulting
> in a WARN() splat. Since we don't support the BGRT table on ARM anway,
> let's revert ARM to the old behaviour, which is to take down the
> early mapping at the end of efi_init().
>
> Signed-off-by: Ard Biesheuvel <[hidden email]>
> Cc: Linus Torvalds <[hidden email]>
> Cc: Peter Zijlstra <[hidden email]>
> Cc: Thomas Gleixner <[hidden email]>
> Cc: [hidden email]
> Fixes: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory ...")
> Link: http://lkml.kernel.org/r/20181114175544.12860-3-ard.biesheuvel@...
> Signed-off-by: Ingo Molnar <[hidden email]>
> (cherry picked from commit 33412b8673135b18ea42beb7f5117ed0091798b6)
> Signed-off-by: dann frazier <[hidden email]>

Clean cherry-pick, limited to arm/efi and fixes a regression.

Acked-by: Kleber Sacilotto de Souza <[hidden email]>

> ---
>  drivers/firmware/efi/arm-init.c    | 4 ++++
>  drivers/firmware/efi/arm-runtime.c | 2 +-
>  drivers/firmware/efi/memmap.c      | 3 +++
>  3 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
> index 388a929baf95d..1a6a77df8a5e8 100644
> --- a/drivers/firmware/efi/arm-init.c
> +++ b/drivers/firmware/efi/arm-init.c
> @@ -265,6 +265,10 @@ void __init efi_init(void)
>      (params.mmap & ~PAGE_MASK)));
>  
>   init_screen_info();
> +
> + /* ARM does not permit early mappings to persist across paging_init() */
> + if (IS_ENABLED(CONFIG_ARM))
> + efi_memmap_unmap();
>  }
>  
>  static int __init register_gop_device(void)
> diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
> index 922cfb813109a..a00934d263c51 100644
> --- a/drivers/firmware/efi/arm-runtime.c
> +++ b/drivers/firmware/efi/arm-runtime.c
> @@ -110,7 +110,7 @@ static int __init arm_enable_runtime_services(void)
>  {
>   u64 mapsize;
>  
> - if (!efi_enabled(EFI_BOOT) || !efi_enabled(EFI_MEMMAP)) {
> + if (!efi_enabled(EFI_BOOT)) {
>   pr_info("EFI services will not be available.\n");
>   return 0;
>   }
> diff --git a/drivers/firmware/efi/memmap.c b/drivers/firmware/efi/memmap.c
> index 5fc70520e04c4..1907db2b38d81 100644
> --- a/drivers/firmware/efi/memmap.c
> +++ b/drivers/firmware/efi/memmap.c
> @@ -118,6 +118,9 @@ int __init efi_memmap_init_early(struct efi_memory_map_data *data)
>  
>  void __init efi_memmap_unmap(void)
>  {
> + if (!efi_enabled(EFI_MEMMAP))
> + return;
> +
>   if (!efi.memmap.late) {
>   unsigned long size;
>  



--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|

ACK: [PATCH 1/1][SRU Cosmic][SRU Bionic] efi/arm: Revert deferred unmap of early memmap mapping

Stefan Bader-2
In reply to this post by dann frazier-4
On 21.12.18 19:52, dann frazier wrote:

> From: Ard Biesheuvel <[hidden email]>
>
> BugLink: https://bugs.launchpad.net/bugs/1809488
>
> Commit:
>
>   3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory map longer for BGRT")
>
> deferred the unmap of the early mapping of the UEFI memory map to
> accommodate the ACPI BGRT code, which looks up the memory type that
> backs the BGRT table to validate it against the requirements of the UEFI spec.
>
> Unfortunately, this causes problems on ARM, which does not permit
> early mappings to persist after paging_init() is called, resulting
> in a WARN() splat. Since we don't support the BGRT table on ARM anway,
> let's revert ARM to the old behaviour, which is to take down the
> early mapping at the end of efi_init().
>
> Signed-off-by: Ard Biesheuvel <[hidden email]>
> Cc: Linus Torvalds <[hidden email]>
> Cc: Peter Zijlstra <[hidden email]>
> Cc: Thomas Gleixner <[hidden email]>
> Cc: [hidden email]
> Fixes: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory ...")
> Link: http://lkml.kernel.org/r/20181114175544.12860-3-ard.biesheuvel@...
> Signed-off-by: Ingo Molnar <[hidden email]>
> (cherry picked from commit 33412b8673135b18ea42beb7f5117ed0091798b6)
> Signed-off-by: dann frazier <[hidden email]>
Acked-by: Stefan Bader <[hidden email]>

> ---
>  drivers/firmware/efi/arm-init.c    | 4 ++++
>  drivers/firmware/efi/arm-runtime.c | 2 +-
>  drivers/firmware/efi/memmap.c      | 3 +++
>  3 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c
> index 388a929baf95d..1a6a77df8a5e8 100644
> --- a/drivers/firmware/efi/arm-init.c
> +++ b/drivers/firmware/efi/arm-init.c
> @@ -265,6 +265,10 @@ void __init efi_init(void)
>      (params.mmap & ~PAGE_MASK)));
>  
>   init_screen_info();
> +
> + /* ARM does not permit early mappings to persist across paging_init() */
> + if (IS_ENABLED(CONFIG_ARM))
> + efi_memmap_unmap();
>  }
>  
>  static int __init register_gop_device(void)
> diff --git a/drivers/firmware/efi/arm-runtime.c b/drivers/firmware/efi/arm-runtime.c
> index 922cfb813109a..a00934d263c51 100644
> --- a/drivers/firmware/efi/arm-runtime.c
> +++ b/drivers/firmware/efi/arm-runtime.c
> @@ -110,7 +110,7 @@ static int __init arm_enable_runtime_services(void)
>  {
>   u64 mapsize;
>  
> - if (!efi_enabled(EFI_BOOT) || !efi_enabled(EFI_MEMMAP)) {
> + if (!efi_enabled(EFI_BOOT)) {
>   pr_info("EFI services will not be available.\n");
>   return 0;
>   }
> diff --git a/drivers/firmware/efi/memmap.c b/drivers/firmware/efi/memmap.c
> index 5fc70520e04c4..1907db2b38d81 100644
> --- a/drivers/firmware/efi/memmap.c
> +++ b/drivers/firmware/efi/memmap.c
> @@ -118,6 +118,9 @@ int __init efi_memmap_init_early(struct efi_memory_map_data *data)
>  
>  void __init efi_memmap_unmap(void)
>  {
> + if (!efi_enabled(EFI_MEMMAP))
> + return;
> +
>   if (!efi.memmap.late) {
>   unsigned long size;
>  
>


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

APPLIED: [PATCH 0/1][SRU Cosmic][SRU Bionic] Fix booting armhf guests in EFI mode

Khaled Elmously
In reply to this post by dann frazier-4
On 2018-12-21 11:52:21 , dann frazier wrote:

> https://bugs.launchpad.net/bugs/1809488
>
> The fix for LP: #1786878 introduced a regression that broke booting armhf
> guests in EFI mode. This clean cherry pick from upstream fixes it.
>
> Ard Biesheuvel (1):
>   efi/arm: Revert deferred unmap of early memmap mapping
>
>  drivers/firmware/efi/arm-init.c    | 4 ++++
>  drivers/firmware/efi/arm-runtime.c | 2 +-
>  drivers/firmware/efi/memmap.c      | 3 +++
>  3 files changed, 8 insertions(+), 1 deletion(-)
>
> --
> 2.20.1
>
>
> --
> kernel-team mailing list
> [hidden email]
> https://lists.ubuntu.com/mailman/listinfo/kernel-team

--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team