* [PATCH arm64/kexec] arm64: kexec_file: forbid kdump via kexec_file_load()
@ 2018-12-07 10:14 James Morse
2018-12-07 15:26 ` Bhupesh Sharma
0 siblings, 1 reply; 2+ messages in thread
From: James Morse @ 2018-12-07 10:14 UTC (permalink / raw)
To: linux-arm-kernel
Cc: devicetree, Herbert Xu, Baoquan He, Ard Biesheuvel, Will Deacon,
bhsharma, Frank Rowand, kexec, linux-kernel, Heiko Carstens,
David Howells, AKASHI Takahiro, Rob Herring, Arnd Bergmann,
James Morse, Catalin Marinas, Martin Schwidefsky, prudo, dyoung,
David Miller, Vivek Goyal
Now that kexec_walk_memblock() can do the crash-kernel placement itself
architectures that don't support kdump via kexe_file_load() need to
explicitly forbid it.
We don't support this on arm64 until the kernel can add the elfcorehdr
and usable-memory-range fields to the DT. Without these the crash-kernel
overwrites the previous kernel's memory during startup.
Add a check to refuse crash image loading.
Signed-off-by: James Morse <james.morse@arm.com>
---
Context: http://lore.kernel.org/r/20181206155424.GA4422@arm.com
arch/arm64/kernel/kexec_image.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c
index 1ad1d5f8f024..07bf740bea91 100644
--- a/arch/arm64/kernel/kexec_image.c
+++ b/arch/arm64/kernel/kexec_image.c
@@ -47,6 +47,10 @@ static void *image_load(struct kimage *image,
struct kexec_segment *kernel_segment;
int ret;
+ /* We don't support crash kernels yet. */
+ if (image->type == KEXEC_TYPE_CRASH)
+ return ERR_PTR(-EOPNOTSUPP);
+
/*
* We require a kernel with an unambiguous Image header. Per
* Documentation/booting.txt, this is the case when image_size
--
2.19.2
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH arm64/kexec] arm64: kexec_file: forbid kdump via kexec_file_load()
2018-12-07 10:14 [PATCH arm64/kexec] arm64: kexec_file: forbid kdump via kexec_file_load() James Morse
@ 2018-12-07 15:26 ` Bhupesh Sharma
0 siblings, 0 replies; 2+ messages in thread
From: Bhupesh Sharma @ 2018-12-07 15:26 UTC (permalink / raw)
To: James Morse
Cc: devicetree, herbert, Baoquan He, Ard Biesheuvel,
kexec mailing list, frowand.list, Will Deacon,
Linux Kernel Mailing List, heiko.carstens, dhowells,
AKASHI Takahiro, robh+dt, arnd, Vivek Goyal, Catalin Marinas,
schwidefsky, prudo, Dave Young, davem, linux-arm-kernel
Hi James,
On Fri, Dec 7, 2018 at 3:44 PM James Morse <james.morse@arm.com> wrote:
>
> Now that kexec_walk_memblock() can do the crash-kernel placement itself
> architectures that don't support kdump via kexe_file_load() need to
> explicitly forbid it.
>
> We don't support this on arm64 until the kernel can add the elfcorehdr
> and usable-memory-range fields to the DT. Without these the crash-kernel
> overwrites the previous kernel's memory during startup.
>
> Add a check to refuse crash image loading.
>
> Signed-off-by: James Morse <james.morse@arm.com>
> ---
>
> Context: http://lore.kernel.org/r/20181206155424.GA4422@arm.com
>
> arch/arm64/kernel/kexec_image.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c
> index 1ad1d5f8f024..07bf740bea91 100644
> --- a/arch/arm64/kernel/kexec_image.c
> +++ b/arch/arm64/kernel/kexec_image.c
> @@ -47,6 +47,10 @@ static void *image_load(struct kimage *image,
> struct kexec_segment *kernel_segment;
> int ret;
>
> + /* We don't support crash kernels yet. */
> + if (image->type == KEXEC_TYPE_CRASH)
> + return ERR_PTR(-EOPNOTSUPP);
> +
> /*
> * We require a kernel with an unambiguous Image header. Per
> * Documentation/booting.txt, this is the case when image_size
> --
> 2.19.2
>
TBH, I would have loved the complete 'kexec_file_load' support to have
made way upstream for arm64 as well, but I understand that it is stuck
till we have an agreement on the DT side of things. So, refusing a
crash image loading in such a case makes sense for now.
So, please feel free to add:
Reviewed-by: Bhupesh Sharma <bhsharma@redhat.com>
Thanks,
Bhupesh
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-07 15:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-07 10:14 [PATCH arm64/kexec] arm64: kexec_file: forbid kdump via kexec_file_load() James Morse
2018-12-07 15:26 ` Bhupesh Sharma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox