Fails to load compressed kernels on arm64

Bug #1661363 reported by dann frazier on 2017-02-02
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kexec-tools (Ubuntu)
Undecided
Manoj Iyer
Xenial
Undecided
Unassigned
Yakkety
Undecided
Unassigned

Bug Description

[Impact]
kexec-tools will not load a compressed kernel on arm64. Ubuntu ships compressed kernel images on arm64 starting with 16.10 (and hwe kernels for 16.04). A workaround is to manually decompress the kernel before loading it, but this is not supported by the use-kexec-for-reboot-by-default feature of the kexec-tools package.

[Test Case]
ubuntu@ubuntu:~$ sudo file /boot/vmlinuz-4.9.0-15-generic
/boot/vmlinuz-4.9.0-15-generic: gzip compressed data, max compression, from Unix
ubuntu@ubuntu:~$ sudo kexec -d -l /boot/vmlinuz-4.9.0-15-generic -t Image
arch_process_options:141: command_line: (null)
arch_process_options:143: initrd: (null)
arch_process_options:144: dtb: (null)
kernel: 0xffff8ff61010 kernel_size: 0x6ee18b
get_memory_ranges_iomem_cb: 0000000040000000 - 00000000ffffbfff : System RAM
get_memory_ranges_iomem_cb: 0000000100000000 - 000000013858ffff : System RAM
get_memory_ranges_iomem_cb: 0000000138750000 - 000000013bc1ffff : System RAM
get_memory_ranges_iomem_cb: 000000013c000000 - 000000013fffffff : System RAM
image_arm64_probe: Bad arm64 image header.
elf_arm64_probe: Not an ELF executable.
image_arm64_probe: Bad arm64 image header.
Cannot determine the file type of /boot/vmlinuz-4.9.0-15-generic

[Regression Risk]
kexec-tools did not support arm64 until zesty so, assuming the fix is localized to arm64 code, regression risk is negligible.

dann frazier (dannf) on 2017-02-02
description: updated
Manoj Iyer (manjo) wrote :

The debian/control file lists gnu-efi and libz-dev only for ia64, since amd64, and arm64 (may be other archs) also need these dependencies for it to support compressed kernel we need something like the following change for it to work on those archs.

-Build-Depends: debhelper (>= 7.0.0), dh-autoreconf, gnu-efi (>=3.0a-4)[ia64], libz-dev[ia64], po-debconf
+Build-Depends: debhelper (>= 7.0.0), dh-autoreconf, gnu-efi (>=3.0a-4)[amd64 arm64 ia64], libz-dev[amd64 arm64 ia64], po-debconf

I will upload a patch to zesty shortly.

Changed in kexec-tools (Ubuntu):
assignee: nobody → Manoj Iyer (manjo)
status: New → In Progress
dann frazier (dannf) wrote :

As mentioned on IRC, we shouldn't include amd64 in this unless we know that it actually improves amd64 support. My guess is that this doesn't help x86 - IIRC, those images decompress themselves at runtime.

Manoj Iyer (manjo) wrote :

ARM64 builds needs build dependency on libz-dev inorder to support compressed kernels. The attached patch adds that support. Note. amd64 and i386 do not have this dependency, I tested the current zesty version of the kexec-tools on amd64 and i386 and it works. The patch only apply to ARM64 build.

[TEST]
== Before Patch ==
ubuntu@test:~$ sudo kexec -l /boot/vmlinuz-4.9.0-15-generic --initrd=/boot/initrd.img-4.9.0-15-generic --append="root=LABEL=cloudimg-rootfs vt.handoff=7"
Cannot determine the file type of /boot/vmlinuz-4.9.0-15-generic
ubuntu@test:~$

== After Patch ==
ubuntu@test:~$ sudo kexec -l /boot/vmlinuz-4.9.0-15-generic --initrd=/boot/initrd.img-4.9.0-15-generic --append="root=LABEL=cloudimg-rootfs vt.handoff=7"
ubuntu@test:~$ sudo kexec -e

Ubuntu Zesty Zapus (development branch) test ttyAMA0

test login: [ 7616.705779] kexec_core: Starting new kernel
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.0-15-generic (buildd@bos01-arm64-009) (gcc version 6.3.0 20161229 (Ubuntu/Linaro 6.3.0-2ubuntu1) ) #16-Ubuntu SMP Fri Jan 20 15:29:58 UTC 2017 (Ubuntu 4.9.0-15.16-generic 4.9.5)
[ 0.000000] Boot CPU: AArch64 Processor [510f8000]
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: EFI v2.50 by EDK II
[ 0.000000] efi: SMBIOS=0x5bdb0000 SMBIOS 3.0=0x58660000 PROP=0x5f714518 ACPI=0x58690000 ACPI 2.0=0x58690014
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000000000-0x000000005

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package kexec-tools - 1:2.0.14-1ubuntu2

---------------
kexec-tools (1:2.0.14-1ubuntu2) zesty; urgency=medium

  [ Manoj Iyer ]
  * Enable compressed kernel support for ARM64 (LP: #1661363).

  [ dann frazier ]
  * ppc64-Reduce-number-of-ELF-LOAD-segments.patch: Cherry-pick
    from upstream, fixing kexec on some large memory configurations
    (LP: #1661168).

 -- dann frazier <email address hidden> Fri, 03 Feb 2017 14:49:31 -0700

Changed in kexec-tools (Ubuntu):
status: In Progress → Fix Released

Hello dann, or anyone else affected,

Accepted kexec-tools into yakkety-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/kexec-tools/1:2.0.10-2ubuntu1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in kexec-tools (Ubuntu Yakkety):
status: New → Fix Committed
tags: added: verification-needed
Changed in kexec-tools (Ubuntu Xenial):
status: New → Fix Committed
Brian Murray (brian-murray) wrote :

Hello dann, or anyone else affected,

Accepted kexec-tools into xenial-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/kexec-tools/1:2.0.10-1ubuntu2.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed.Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers