From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from terminus.zytor.com ([198.137.202.10]:38968 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751713AbbEFHeM (ORCPT ); Wed, 6 May 2015 03:34:12 -0400 Date: Wed, 6 May 2015 00:33:59 -0700 From: tip-bot for Roy Franz Message-ID: Cc: mingo@kernel.org, hpa@zytor.com, matt.fleming@intel.com, stable@vger.kernel.org, tglx@linutronix.de, roy.franz@linaro.org Reply-To: roy.franz@linaro.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, tglx@linutronix.de, matt.fleming@intel.com, hpa@zytor.com, mingo@kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: stable-owner@vger.kernel.org List-ID: Commit-ID: 98b228f55014870092c15d7d168fecac69f2f12a Gitweb: http://git.kernel.org/tip/98b228f55014870092c15d7d168fecac69f2f12a Author: Roy Franz AuthorDate: Wed, 15 Apr 2015 16:32:24 -0700 Committer: Matt Fleming CommitDate: Fri, 17 Apr 2015 15:46:32 +0100 x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr 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 Cc: Signed-off-by: Matt Fleming --- arch/x86/boot/compressed/eboot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index 92b9a5f..5999980 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -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;