From patchwork Wed Apr 15 23:32:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 47240 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f71.google.com (mail-la0-f71.google.com [209.85.215.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 69B0D20553 for ; Wed, 15 Apr 2015 23:32:52 +0000 (UTC) Received: by laat2 with SMTP id t2sf13483437laa.2 for ; Wed, 15 Apr 2015 16:32:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=edrNnePpomQ3ribyWQHVcy+XvS3ceHTcBI+Lqud6xsM=; b=Tn31+8EzWPr7ef2ba4b+PmgmgRa4JRYWPBiu5Ytqmd/LjPYSyDZ2pervGlEa7qLj1h UMkCQsK96Y+kzPVD0ssxZHRu/MjCkdPFFLCLJqr6woC461daoZ3djmMwClCRH9qbyijk xtUrjd93iDIXB1R0ZQU2ddu709zRiZPiWp6n+xM/9QWhX3R9c5Mb+WXZXC1laO6sH2v+ h4itTmEO1ckEMHNolKoTLEHwZbyy1IlEqL0m7KKH1MVGqiuuD+hY3bTXMQQB6flY2iDT 1eAon6RBYFQ1kmn+mutmTdXYfVegRH6l8pLTxKTXYKO6IE2Qti+Ye4MOkVPh4psp9Wjy lE+w== X-Gm-Message-State: ALoCoQlvY6armbzqAStJB9cXyN2GF4Y3vXVD98cRIecTwWgwUSwROiNzT1pT++cedgrtlNkouV/f X-Received: by 10.180.105.226 with SMTP id gp2mr512735wib.1.1429140771388; Wed, 15 Apr 2015 16:32:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.23.42 with SMTP id j10ls225875laf.27.gmail; Wed, 15 Apr 2015 16:32:51 -0700 (PDT) X-Received: by 10.152.234.108 with SMTP id ud12mr26117068lac.81.1429140771061; Wed, 15 Apr 2015 16:32:51 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id mw9si5080132lbc.9.2015.04.15.16.32.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 16:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by lbcga7 with SMTP id ga7so46066983lbc.1 for ; Wed, 15 Apr 2015 16:32:50 -0700 (PDT) X-Received: by 10.152.234.169 with SMTP id uf9mr26084263lac.88.1429140770932; Wed, 15 Apr 2015 16:32:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp2805513lbt; Wed, 15 Apr 2015 16:32:50 -0700 (PDT) X-Received: by 10.66.90.168 with SMTP id bx8mr51083021pab.53.1429140769187; Wed, 15 Apr 2015 16:32:49 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id te7si9217960pac.173.2015.04.15.16.32.48; Wed, 15 Apr 2015 16:32:49 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933304AbbDOXco (ORCPT + 27 others); Wed, 15 Apr 2015 19:32:44 -0400 Received: from mail-ie0-f181.google.com ([209.85.223.181]:36827 "EHLO mail-ie0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752154AbbDOXcg (ORCPT ); Wed, 15 Apr 2015 19:32:36 -0400 Received: by iebrs15 with SMTP id rs15so39743677ieb.3 for ; Wed, 15 Apr 2015 16:32:35 -0700 (PDT) X-Received: by 10.42.148.197 with SMTP id s5mr33919431icv.13.1429140755432; Wed, 15 Apr 2015 16:32:35 -0700 (PDT) Received: from rfranz-v430.caveonetworks.com (64.2.3.194.ptr.us.xo.net. [64.2.3.194]) by mx.google.com with ESMTPSA id p74sm1613084ioe.27.2015.04.15.16.32.33 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 16:32:34 -0700 (PDT) From: Roy Franz To: linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, matt.fleming@intel.com, hpa@zytor.com, mingo@redhat.com, x86@kernel.org Cc: Roy Franz Subject: [PATCH] x86/efi: Store upper bits of command line buffer address in ext_cmd_line_ptr Date: Wed, 15 Apr 2015 16:32:24 -0700 Message-Id: <1429140744-25768-1-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: roy.franz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- This is a follow-up to "x86_64/efi: enforce 32 bit address for command line buffer", which had the wrong fix to the truncation of address. 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 ef17683..48304b8 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -1109,6 +1109,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;