* [PATCH 4.9 39/92] efi/arm: Revert deferred unmap of early memmap mapping [not found] <20181129140106.520639693@linuxfoundation.org> @ 2018-11-29 14:12 ` Greg Kroah-Hartman 2018-11-29 14:28 ` Ard Biesheuvel 0 siblings, 1 reply; 4+ messages in thread From: Greg Kroah-Hartman @ 2018-11-29 14:12 UTC (permalink / raw) To: linux-kernel Cc: Greg Kroah-Hartman, stable, Ard Biesheuvel, Linus Torvalds, Peter Zijlstra, Thomas Gleixner, linux-efi, Ingo Molnar, Sasha Levin 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 33412b8673135b18ea42beb7f5117ed0091798b6 ] 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 <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 Fixes: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory ...") Link: http://lkml.kernel.org/r/20181114175544.12860-3-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> --- 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 1d1c9693ebfb..8ee91777abce 100644 --- a/drivers/firmware/efi/arm-init.c +++ b/drivers/firmware/efi/arm-init.c @@ -256,6 +256,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 4d788e0debfe..069c5a4479e6 100644 --- a/drivers/firmware/efi/arm-runtime.c +++ b/drivers/firmware/efi/arm-runtime.c @@ -118,7 +118,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 78686443cb37..3fd2b450c649 100644 --- a/drivers/firmware/efi/memmap.c +++ b/drivers/firmware/efi/memmap.c @@ -117,6 +117,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.17.1 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 4.9 39/92] efi/arm: Revert deferred unmap of early memmap mapping 2018-11-29 14:12 ` [PATCH 4.9 39/92] efi/arm: Revert deferred unmap of early memmap mapping Greg Kroah-Hartman @ 2018-11-29 14:28 ` Ard Biesheuvel 2018-11-29 15:02 ` Greg Kroah-Hartman 0 siblings, 1 reply; 4+ messages in thread From: Ard Biesheuvel @ 2018-11-29 14:28 UTC (permalink / raw) To: Greg Kroah-Hartman Cc: Linux Kernel Mailing List, stable, Linus Torvalds, Peter Zijlstra, Thomas Gleixner, linux-efi, Ingo Molnar, sashal On Thu, 29 Nov 2018 at 15:21, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote: > > 4.9-stable review patch. If anyone has any objections, please let me know. > > ------------------ > > [ Upstream commit 33412b8673135b18ea42beb7f5117ed0091798b6 ] > > 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 <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 > Fixes: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory ...") This commit is only in v4.19 as far as I know. Does it even apply? > Link: http://lkml.kernel.org/r/20181114175544.12860-3-ard.biesheuvel@linaro.org > Signed-off-by: Ingo Molnar <mingo@kernel.org> > Signed-off-by: Sasha Levin <sashal@kernel.org> > --- > 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 1d1c9693ebfb..8ee91777abce 100644 > --- a/drivers/firmware/efi/arm-init.c > +++ b/drivers/firmware/efi/arm-init.c > @@ -256,6 +256,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 4d788e0debfe..069c5a4479e6 100644 > --- a/drivers/firmware/efi/arm-runtime.c > +++ b/drivers/firmware/efi/arm-runtime.c > @@ -118,7 +118,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 78686443cb37..3fd2b450c649 100644 > --- a/drivers/firmware/efi/memmap.c > +++ b/drivers/firmware/efi/memmap.c > @@ -117,6 +117,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.17.1 > > > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4.9 39/92] efi/arm: Revert deferred unmap of early memmap mapping 2018-11-29 14:28 ` Ard Biesheuvel @ 2018-11-29 15:02 ` Greg Kroah-Hartman 2018-11-29 15:03 ` Ard Biesheuvel 0 siblings, 1 reply; 4+ messages in thread From: Greg Kroah-Hartman @ 2018-11-29 15:02 UTC (permalink / raw) To: Ard Biesheuvel Cc: Linux Kernel Mailing List, stable, Linus Torvalds, Peter Zijlstra, Thomas Gleixner, linux-efi, Ingo Molnar, sashal On Thu, Nov 29, 2018 at 03:28:44PM +0100, Ard Biesheuvel wrote: > On Thu, 29 Nov 2018 at 15:21, Greg Kroah-Hartman > <gregkh@linuxfoundation.org> wrote: > > > > 4.9-stable review patch. If anyone has any objections, please let me know. > > > > ------------------ > > > > [ Upstream commit 33412b8673135b18ea42beb7f5117ed0091798b6 ] > > > > 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 <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 > > Fixes: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory ...") > > This commit is only in v4.19 as far as I know. Does it even apply? This commit is in the following releases: 4.9.129 4.14.72 4.18.10 4.19 so it should apply :) thanks, greg k-h ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 4.9 39/92] efi/arm: Revert deferred unmap of early memmap mapping 2018-11-29 15:02 ` Greg Kroah-Hartman @ 2018-11-29 15:03 ` Ard Biesheuvel 0 siblings, 0 replies; 4+ messages in thread From: Ard Biesheuvel @ 2018-11-29 15:03 UTC (permalink / raw) To: Greg Kroah-Hartman Cc: Linux Kernel Mailing List, stable, Linus Torvalds, Peter Zijlstra, Thomas Gleixner, linux-efi, Ingo Molnar, sashal On Thu, 29 Nov 2018 at 16:02, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote: > > On Thu, Nov 29, 2018 at 03:28:44PM +0100, Ard Biesheuvel wrote: > > On Thu, 29 Nov 2018 at 15:21, Greg Kroah-Hartman > > <gregkh@linuxfoundation.org> wrote: > > > > > > 4.9-stable review patch. If anyone has any objections, please let me know. > > > > > > ------------------ > > > > > > [ Upstream commit 33412b8673135b18ea42beb7f5117ed0091798b6 ] > > > > > > 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 <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 > > > Fixes: 3ea86495aef2 ("efi/arm: preserve early mapping of UEFI memory ...") > > > > This commit is only in v4.19 as far as I know. Does it even apply? > > This commit is in the following releases: > 4.9.129 4.14.72 4.18.10 4.19 > > so it should apply :) > Ah, of course. I didn't realize (or failed to remember) that it had been taken into -stable. Thanks, ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-29 15:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20181129140106.520639693@linuxfoundation.org>
2018-11-29 14:12 ` [PATCH 4.9 39/92] efi/arm: Revert deferred unmap of early memmap mapping Greg Kroah-Hartman
2018-11-29 14:28 ` Ard Biesheuvel
2018-11-29 15:02 ` Greg Kroah-Hartman
2018-11-29 15:03 ` Ard Biesheuvel
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox