From patchwork Fri Oct 24 23:41:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 39508 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E2E1920341 for ; Fri, 24 Oct 2014 23:43:10 +0000 (UTC) Received: by mail-lb0-f199.google.com with SMTP id w7sf2340299lbi.6 for ; Fri, 24 Oct 2014 16:43:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-post:list-help :list-subscribe:mime-version:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive :content-type:content-transfer-encoding; bh=SJG+A7BG+E0tevt1CEx0gDn0cerlTI+sxggaRQo1MqU=; b=IIsauOwVgqtDSQQXONgBjBeDHU1onkGt6Kbd/q9tordHXf4wapgoVcSbX8i8SYu2F+ JSEllDLcswkatshkqELXIHEnVrkL4kH06mk/853dxz1p2CAjaXw2mPihM/BRM/9gcKGI 7BiVknlST/9+8Mfy6svlopqWuGEI3nxPChxcwseAaJ1u9GXcdKyO9vb21bX1xzj3SNor npKONQUPfdCeUJE3He98C/Zf9s2hLY5V2H7pOD5bdaQMGsOpH9mFFXVCf3ES8EZZPFI/ bekDDU/aOr0Eu/7zrJ7IATO/F0IrusscwWI0mlE5UlIfxh4bBvBFQkx1nHLQF52jn3jT PDvA== X-Gm-Message-State: ALoCoQmfvGde7fV66I+rXuVt3TKX6MD8Ye+tuuIhgdOEHa9cK66q75tLxcpDErjnVB0HasewrrR5 X-Received: by 10.112.154.194 with SMTP id vq2mr1176208lbb.10.1414194189701; Fri, 24 Oct 2014 16:43:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.198.201 with SMTP id je9ls514060lac.92.gmail; Fri, 24 Oct 2014 16:43:09 -0700 (PDT) X-Received: by 10.153.7.107 with SMTP id db11mr7568571lad.35.1414194189130; Fri, 24 Oct 2014 16:43:09 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id kz10si8939929lab.96.2014.10.24.16.43.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 24 Oct 2014 16:43:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by mail-lb0-f182.google.com with SMTP id f15so2128644lbj.27 for ; Fri, 24 Oct 2014 16:43:08 -0700 (PDT) X-Received: by 10.152.87.7 with SMTP id t7mr7648554laz.74.1414194188706; Fri, 24 Oct 2014 16:43:08 -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.84.229 with SMTP id c5csp519140lbz; Fri, 24 Oct 2014 16:43:08 -0700 (PDT) X-Received: by 10.220.111.6 with SMTP id q6mr5096673vcp.12.1414194187490; Fri, 24 Oct 2014 16:43:07 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id dc6si3322845vdc.36.2014.10.24.16.43.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 24 Oct 2014 16:43:07 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XhoTz-0000OP-2k; Fri, 24 Oct 2014 23:41:23 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XhoTx-0000OK-4E for xen-devel@lists.xen.org; Fri, 24 Oct 2014 23:41:21 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id C7/72-02953-0A3EA445; Fri, 24 Oct 2014 23:41:20 +0000 X-Env-Sender: roy.franz@linaro.org X-Msg-Ref: server-6.tower-31.messagelabs.com!1414194077!7040708!1 X-Originating-IP: [209.85.220.45] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.12.3; banners=-,-,- X-VirusChecked: Checked Received: (qmail 13714 invoked from network); 24 Oct 2014 23:41:19 -0000 Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com) (209.85.220.45) by server-6.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 24 Oct 2014 23:41:19 -0000 Received: by mail-pa0-f45.google.com with SMTP id lj1so1987748pab.32 for ; Fri, 24 Oct 2014 16:41:17 -0700 (PDT) X-Received: by 10.68.111.161 with SMTP id ij1mr1227072pbb.10.1414194077421; Fri, 24 Oct 2014 16:41:17 -0700 (PDT) Received: from rfranz-i7.local (c-24-10-97-91.hsd1.ca.comcast.net. [24.10.97.91]) by mx.google.com with ESMTPSA id a12sm4771484pdm.64.2014.10.24.16.41.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Oct 2014 16:41:16 -0700 (PDT) From: Roy Franz To: xen-devel@lists.xen.org, ian.campbell@citrix.com, stefano.stabellini@citrix.com, tim@xen.org, jbeulich@suse.com Date: Fri, 24 Oct 2014 16:41:09 -0700 Message-Id: <1414194069-24690-1-git-send-email-roy.franz@linaro.org> X-Mailer: git-send-email 1.9.1 Cc: Roy Franz , fu.wei@linaro.org Subject: [Xen-devel] [PATCH V2 for-4.5] EFI: Always use EFI command line X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.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.182 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-Archive: This patch changes the ARM EFI boot code to always use the EFI commandline, even when loaded by GRUB, which makes it consistent with Linux EFI booting. The code previously incorrectly skipped processing of the EFI command line when modules are present in the loader supplied FDT and the config file is not used. There is no change in behavior for x86 since it unconditionally uses the config file. Update documentation to clarify command line handling for EFI Xen. Signed-off-by: Roy Franz --- Changes since V1: * Fix use of data after free. * Update documentation. (I'm not sure how I'm supposed to refer to to docs/misc/efi.markdown in the booting.txt. Should I assume that it will be processed to html and refrence it that way?) docs/misc/arm/booting.txt | 3 +++ docs/misc/efi.markdown | 8 ++++++-- xen/common/efi/boot.c | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docs/misc/arm/booting.txt b/docs/misc/arm/booting.txt index 9802e5e..1193ae0 100644 --- a/docs/misc/arm/booting.txt +++ b/docs/misc/arm/booting.txt @@ -23,6 +23,9 @@ The exceptions to this on 32-bit ARM are as follows: There are no exception on 64-bit ARM. +For 64-bit ARM, EFI booting is also supported. See docs/misc/efi.markdown for +a description of EFI boot. + [1] linux/Documentation/arm/Booting Latest version: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/arm/Booting diff --git a/docs/misc/efi.markdown b/docs/misc/efi.markdown index 5e48aa3..5a783b1 100644 --- a/docs/misc/efi.markdown +++ b/docs/misc/efi.markdown @@ -13,7 +13,9 @@ configuration file as described below unless a bootloader, such as GRUB, has loaded the modules and describes them in the device tree provided to Xen. If a bootloader provides a device tree containing modules then any configuration files are ignored, and the bootloader is responsible for populating all -relevant device tree nodes. +relevant module device tree nodes, and doing any required video mode setting. +The EFI command line is always used for Xen arguments. + Once built, `make install-xen` will place the resulting binary directly into the EFI boot partition, provided `EFI_VENDOR` is set in the environment (and @@ -104,4 +106,6 @@ and really not meant to be used together with the `-cfg=` command line option. Filenames must be specified relative to the location of the EFI binary. Extra options to be passed to Xen can also be specified on the command line, -following a `--` separator option. +following a `--` separator option. These options from the EFI command line are +appended to the options contained in the configuration file "options" value, +if any, before being passed to Xen by the EFI boot code. diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index 4257341..ad9dd3a 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -930,8 +930,10 @@ efi_start(EFI_HANDLE ImageHandle, EFI_SYSTEM_TABLE *SystemTable) cfg.addr = 0; dir_handle->Close(dir_handle); - } + else + efi_arch_handle_cmdline(argc ? *argv : NULL, options, NULL); + if ( gop && !base_video ) {