powerpc: kexec_file: Fix error code when trying to load kdump kernel
Subsystems (3)
PATCH 1/1 powerpc: kexec_file: Fix error code when trying to load kdump kernel
kexec_file_load() on powerpc doesn't support kdump kernels yet, so it returns -ENOTSUPP in that case.
I've recently learned that this errno is internal to the kernel and isn't supposed to be exposed to userspace. Therefore, change to -EOPNOTSUPP which is defined in an uapi header.
This does indeed make kexec-tools happier. Before the patch, on ppc64le:
# ~bauermann/src/kexec-tools/build/sbin/kexec -s -p /boot/vmlinuz kexec_file_load failed: Unknown error 524
After the patch:
# ~bauermann/src/kexec-tools/build/sbin/kexec -s -p /boot/vmlinuz kexec_file_load failed: Operation not supported
--- arch/powerpc/kernel/machine_kexec_file_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
This is a minor issue, but since it's a simple patch it might be worth applying it to stable branches.
This is the kexec-tools thread where this problem was brought up:
https://lists.infradead.org/pipermail/kexec/2018-March/020346.html
And this is an instance of a similar fix being applied elsewhere in the kernel, for the same reasons:
https://patchwork.kernel.org/patch/8490791/
The test shown in the commit log was made using Hari Bathini's patch adding kexec_file_load() support to kexec-tools in ppc64.
arch/powerpc/kernel/machine_kexec_file_64.c +1 -1
@@ -43,7 +43,7 @@ int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,/* We don't support crash kernels yet. */ if (image->type ==KEXEC_TYPE_CRASH ) -return -ENOTSUPP ; +return -EOPNOTSUPP ;for (i =0 ; i <ARRAY_SIZE (kexec_file_loaders); i++) { fops = kexec_file_loaders[i];
Quoted 12 lines · Thiago Jung Bauermann
kexec_file_load()on powerpc doesn't support kdump kernels yet, so it returns-ENOTSUPPin that case.I've recently learned that this errno is internal to the kernel and isn't supposed to be exposed to userspace. Therefore, change to
-EOPNOTSUPPwhich is defined in an uapi header.This does indeed make kexec-tools happier. Before the patch, on ppc64le:
# ~bauermann/src/kexec-tools/build/sbin/kexec -s -p
/boot/vmlinuzkexec_file_loadfailed: Unknown error 524
Quoted 8 lines
After the patch:
# ~bauermann/src/kexec-tools/build/sbin/kexec -s -p
/boot/vmlinuzkexec_file_loadfailed: Operation not supportedFixes a0458284f062 ("powerpc: Add support code for kexec_file_load()")Reported-by Dave Young <[email protected]>Signed-off-by Thiago Jung Bauermann <[email protected]>
Quoted 54 lines · Thiago Jung Bauermann
kexec_file_load()on powerpc doesn't support kdump kernels yet, so it returns-ENOTSUPPin that case.I've recently learned that this errno is internal to the kernel and isn't supposed to be exposed to userspace. Therefore, change to
-EOPNOTSUPPwhich is defined in an uapi header.This does indeed make kexec-tools happier. Before the patch, on ppc64le:
# ~bauermann/src/kexec-tools/build/sbin/kexec -s -p
/boot/vmlinuzkexec_file_loadfailed: Unknown error 524After the patch:
# ~bauermann/src/kexec-tools/build/sbin/kexec -s -p
/boot/vmlinuzkexec_file_loadfailed: Operation not supportedFixes a0458284f062 ("powerpc: Add support code for kexec_file_load()")Reported-by Dave Young <[email protected]>Signed-off-by Thiago Jung Bauermann <[email protected]>--- arch/powerpc/kernel/machine_kexec_file_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)This is a minor issue, but since it's a simple patch it might be worth applying it to stable branches.
This is the kexec-tools thread where this problem was brought up:
https://lists.infradead.org/pipermail/kexec/2018-March/020346.html
And this is an instance of a similar fix being applied elsewhere in the kernel, for the same reasons:
https://patchwork.kernel.org/patch/8490791/
The test shown in the commit log was made using Hari Bathini's patch adding
kexec_file_load()support to kexec-tools in ppc64.arch/powerpc/kernel/machine_kexec_file_64.c +1
-1@@ -43,7 +43,7 @@ int arch_kexec_kernel_image_probe(struct kimage *image, void *buf,/* We don't support crash kernels yet. */ if (image->type ==KEXEC_TYPE_CRASH ) -return -ENOTSUPP ; +return -EOPNOTSUPP ;for (i =0 ; i <ARRAY_SIZE (kexec_file_loaders); i++) { fops = kexec_file_loaders[i];
Quoted 4 lines
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Thanks
Dave
Michael Ellerman
AppliedQuoted 14 lines · Thiago Jung Bauermann
kexec_file_load()on powerpc doesn't support kdump kernels yet, so it returns-ENOTSUPPin that case.I've recently learned that this errno is internal to the kernel and isn't supposed to be exposed to userspace. Therefore, change to
-EOPNOTSUPPwhich is defined in an uapi header.This does indeed make kexec-tools happier. Before the patch, on ppc64le:
# ~bauermann/src/kexec-tools/build/sbin/kexec -s -p
/boot/vmlinuzkexec_file_loadfailed: Unknown error 524After the patch:
Quoted 8 lines
# ~bauermann/src/kexec-tools/build/sbin/kexec -s -p
/boot/vmlinuzkexec_file_loadfailed: Operation not supportedFixes a0458284f062 ("powerpc: Add support code for kexec_file_load()")Reported-by Dave Young <[email protected]>Signed-off-by Thiago Jung Bauermann <[email protected]>Reviewed-by Simon Horman <[email protected]>Reviewed-by Dave Young <[email protected]>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/bf8a1abc3ddbd6e9a8312ea7d96e5d
cheers