]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr
authorRoy Franz <roy.franz@linaro.org>
Wed, 15 Apr 2015 23:32:24 +0000 (16:32 -0700)
committerMatt Fleming <matt.fleming@intel.com>
Fri, 17 Apr 2015 14:46:32 +0000 (15:46 +0100)
Until now, the EFI stub was only setting the 32 bit cmd_line_ptr in
the setup_header structure, so on 64 bit platforms this could be truncated.
This patch adds setting the upper bits of the buffer address in
ext_cmd_line_ptr.  This case was likely never hit, as the allocation
for this buffer is done at the lowest available address.  Only
x86_64 kernels have this problem, as the 1-1 mapping mandated
by EFI ensures that all memory is 32 bit addressable on 32 bit
platforms.  The EFI stub does not support mixed mode, so the
32 bit kernel on 64 bit firmware case does not need to be handled.

Signed-off-by: Roy Franz <roy.franz@linaro.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
arch/x86/boot/compressed/eboot.c

index 92b9a5f2aed6fcb73e0ac726b8fef95f8d93f6be..5999980206bf83fe54b875fb86936c51a4587fec 100644 (file)
@@ -1110,6 +1110,8 @@ struct boot_params *make_boot_params(struct efi_config *c)
        if (!cmdline_ptr)
                goto fail;
        hdr->cmd_line_ptr = (unsigned long)cmdline_ptr;
+       /* Fill in upper bits of command line address, NOP on 32 bit  */
+       boot_params->ext_cmd_line_ptr = (u64)(unsigned long)cmdline_ptr >> 32;
 
        hdr->ramdisk_image = 0;
        hdr->ramdisk_size = 0;