]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
kexec_file: do not add extra alignment to efi memmap
authorDave Young <dyoung@redhat.com>
Fri, 20 Apr 2018 21:56:10 +0000 (14:56 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 1 Oct 2018 12:55:29 +0000 (14:55 +0200)
commitc9cc59c18e22b851a4cd82eefeffeb4e9c4a58f3
treebb59bb5cc61a01090f49a0238386b2668af4edd0
parentefa89beef51b7c5da985a6eb28f213ae91874a77
kexec_file: do not add extra alignment to efi memmap

BugLink: http://bugs.launchpad.net/bugs/1794889
[ Upstream commit a841aa83dff0af75c88aa846ba610a8af4c5ee21 ]

Chun-Yi reported a kernel warning message below:

  WARNING: CPU: 0 PID: 0 at ../mm/early_ioremap.c:182 early_iounmap+0x4f/0x12c()
  early_iounmap(ffffffffff20018000000118) [0] size not consistent 00000120

The problem is x86 kexec_file_load adds extra alignment to the efi
memmap: in bzImage64_load():

        efi_map_sz = efi_get_runtime_map_size();
        efi_map_sz = ALIGN(efi_map_sz, 16);

And __efi_memmap_init maps with the size including the alignment bytes
but efi_memmap_unmap use nr_maps * desc_size which does not include the
extra bytes.

The alignment in kexec code is only needed for the kexec buffer internal
use Actually kexec should pass exact size of the efi memmap to 2nd
kernel.

Link: http://lkml.kernel.org/r/20180417083600.GA1972@dhcp-128-65.nay.redhat.com
Signed-off-by: Dave Young <dyoung@redhat.com>
Reported-by: joeyli <jlee@suse.com>
Tested-by: Randy Wright <rwright@hpe.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/x86/kernel/kexec-bzimage64.c