From patchwork Tue Sep 30 18:38:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Franz X-Patchwork-Id: 38179 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1B3032032C for ; Tue, 30 Sep 2014 18:41:10 +0000 (UTC) Received: by mail-la0-f70.google.com with SMTP id ge10sf3695514lab.9 for ; Tue, 30 Sep 2014 11:41: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:mime-version:in-reply-to:references :date:message-id:from:to:cc:subject:precedence:list-id :list-unsubscribe:list-post:list-help:list-subscribe:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:list-archive:content-type:content-transfer-encoding; bh=JMpbw5Zybwjc+29W3ELEUDL9d+XaS5l5TChmPkPRk7M=; b=VBubovUCfaLVsttzoztginSMw/6doiOaN8hUa3WXJTCtauCwJGmYCXnIePHbAcI3qt eq4xXgVFsMottaaAL+fsTFVchVFNFDbJtfMOmDS+83kAsy0lJYTc0LHkFVD99aZdMEGx VHR07ec3yRN3bcjwK3RNiXkXPicOT8Kh1bvP9mj3zrP2MVHNTozd3g60Z+KREK/PiXoJ ELVrJ0QvJWjGm0rn0u6sa/e+p4XcLnl2GNZFvl4rjbtEeHS7gAgkB1OPU9YSNSYfaYIJ 8QZgVKc/WAAYsRilS8Po7b0uYQLk2bzob+kW3msE/1xbEQYiWHZbuQvJiawpcHfQD4R1 FUCA== X-Gm-Message-State: ALoCoQmvhD8VFxOvvlTTvn5uYN3FSGTEX73VYyeOO8iyI5mjx3IYOh871sY3FIImbwK14Z6+ixBT X-Received: by 10.180.106.197 with SMTP id gw5mr1186825wib.1.1412102469440; Tue, 30 Sep 2014 11:41:09 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.66 with SMTP id o2ls81414laj.8.gmail; Tue, 30 Sep 2014 11:41:09 -0700 (PDT) X-Received: by 10.112.163.103 with SMTP id yh7mr46606777lbb.73.1412102469280; Tue, 30 Sep 2014 11:41:09 -0700 (PDT) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) by mx.google.com with ESMTPS id 1si23924985lal.89.2014.09.30.11.41.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 30 Sep 2014 11:41:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.169 as permitted sender) client-ip=209.85.217.169; Received: by mail-lb0-f169.google.com with SMTP id u10so7124984lbd.14 for ; Tue, 30 Sep 2014 11:41:08 -0700 (PDT) X-Received: by 10.112.167.137 with SMTP id zo9mr17922788lbb.0.1412102468402; Tue, 30 Sep 2014 11:41: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.130.169 with SMTP id of9csp401518lbb; Tue, 30 Sep 2014 11:41:07 -0700 (PDT) X-Received: by 10.52.230.226 with SMTP id tb2mr2304723vdc.74.1412102466927; Tue, 30 Sep 2014 11:41:06 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id i9si7348814vdw.47.2014.09.30.11.41.06 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 30 Sep 2014 11:41:06 -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 1XZ2Jq-0008RO-6e; Tue, 30 Sep 2014 18:38:38 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XZ2Jp-0008RJ-IY for xen-devel@lists.xen.org; Tue, 30 Sep 2014 18:38:37 +0000 Received: from [85.158.139.211:44088] by server-7.bemta-5.messagelabs.com id 5A/47-30869-CA8FA245; Tue, 30 Sep 2014 18:38:36 +0000 X-Env-Sender: roy.franz@linaro.org X-Msg-Ref: server-4.tower-206.messagelabs.com!1412102314!11224127!1 X-Originating-IP: [209.85.220.171] X-SpamReason: No, hits=0.3 required=7.0 tests=RCVD_BY_IP X-StarScan-Received: X-StarScan-Version: 6.12.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 622 invoked from network); 30 Sep 2014 18:38:36 -0000 Received: from mail-vc0-f171.google.com (HELO mail-vc0-f171.google.com) (209.85.220.171) by server-4.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 30 Sep 2014 18:38:36 -0000 Received: by mail-vc0-f171.google.com with SMTP id hy10so3102110vcb.30 for ; Tue, 30 Sep 2014 11:38:34 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.220.197.9 with SMTP id ei9mr8779519vcb.40.1412102314695; Tue, 30 Sep 2014 11:38:34 -0700 (PDT) Received: by 10.220.110.78 with HTTP; Tue, 30 Sep 2014 11:38:34 -0700 (PDT) In-Reply-To: <1412065529.3801.34.camel@citrix.com> References: <1411770301-3263-1-git-send-email-roy.franz@linaro.org> <1411770301-3263-2-git-send-email-roy.franz@linaro.org> <542938BD020000780003A4A4@mail.emea.novell.com> <1412065529.3801.34.camel@citrix.com> Date: Tue, 30 Sep 2014 11:38:34 -0700 Message-ID: From: Roy Franz To: Ian Campbell Cc: keir , tim , xen-devel , Stefano Stabellini , Jan Beulich , Fu Wei Subject: Re: [Xen-devel] [PATCH for-4.5 V9] Add ARM EFI boot support 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: , 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.169 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: On Tue, Sep 30, 2014 at 1:25 AM, Ian Campbell wrote: > On Mon, 2014-09-29 at 09:47 +0100, Jan Beulich wrote: >> >>> On 27.09.14 at 00:25, wrote: >> > This patch adds EFI boot support for ARM based on the previous refactoring of >> > the x86 EFI boot code. All ARM specific code is in the ARM efi-boot.h header >> > file, with the main EFI entry point common/efi/boot.c. The PE/COFF header >> > is >> > open-coded in head.S, which allows us to have a single binary be both an EFI >> > executable and a normal arm64 IMAGE file. There is currently no PE/COFF >> > toolchain support for arm64, so it is not possible to create the PE/COFF >> > header >> > in the same manner as on x86. This also simplifies the build as compared to >> > x86, as we always build the same executable, whereas x86 builds 2. An ARM >> > version of efi-bind.h is added, which is based on the x86_64 version with the >> > x86 specific portions removed. The Makefile in common/efi is different for >> > x86 >> > and ARM, as for ARM we always build in EFI support. >> > NR_MEM_BANKS is increased, as memory regions are now added from the UEFI >> > memory map, >> > rather than memory banks from a DTB. The UEFI memory map may be fragmented >> > so a larger >> > number of regions will be used. >> > >> > Signed-off-by: Roy Franz >> >> For the non-ARM parts: >> Acked-by: Jan Beulich > > Acked-by: Ian Campbell > > Konrad, we would really like to get this into 4.5. It will allow Xen to > boot on EFI hardware which is already starting to appear in the field. > It also unblocks other work such as the upstreaming of the Xen on ARM > boot protocol work which Linaro are doing on grub. > > All of the precursor refactoring is already in so the impact of this > change on x86 is minimal. On the ARM side the changes to the > common/non-EFI boot path are using well-worn techniques from the Linux > equivalent so I think we can be reasonably confident of them, the > remaining code is self contained and can't regress anything else. > >> >> Two minor comments nevertheless: >> >> > --- a/xen/common/efi/boot.c >> > +++ b/xen/common/efi/boot.c >> > @@ -2,6 +2,7 @@ >> > #include >> > #include >> > #include >> > +#include >> > #include >> > #include >> > #include >> > @@ -18,9 +19,16 @@ >> > #include >> > #include >> > #include >> > +#ifdef CONFIG_X86 >> >> The context above shows xen/vga.h - this surely isn't needed in the >> common code anymore? > > Seems likely it isn't. Shall I fixup on commit (I always build test on > commit, so if it breaks I will certainly catch it) or shall we fix in a > followup? It's not needed in boot.c, but is in x86/efi/efi-boot.h. It should have been moved along with the vga code. The following moves it from boot.c to x86/efi/efi-boot.h. Ian - can you apply this fixup when you take the patch? > >> > --- /dev/null >> > +++ b/xen/include/asm-arm/arm64/efibind.h >> > @@ -0,0 +1,216 @@ >> > +/*++ >> > + >> > +Copyright (c) 1998 Intel Corporation >> > + >> > +Module Name: >> > + >> > + efefind.h >> >> Is this so badly misspelled in the original? > > Apparently! > > $ git grep efefind.h > xen/include/asm-x86/x86_64/efibind.h: efefind.h > > Shall I fix both cases on commit? > > Ian. > diff --git a/xen/arch/x86/efi/efi-boot.h b/xen/arch/x86/efi/efi-boot.h index b44746f..82bb74a 100644 --- a/xen/arch/x86/efi/efi-boot.h +++ b/xen/arch/x86/efi/efi-boot.h @@ -7,6 +7,7 @@ #include #include #include +#include static struct file __initdata ucode; static multiboot_info_t __initdata mbi = { diff --git a/xen/common/efi/boot.c b/xen/common/efi/boot.c index e1b243c..f272171 100644 --- a/xen/common/efi/boot.c +++ b/xen/common/efi/boot.c @@ -18,7 +18,6 @@ #endif #include #include -#include #ifdef CONFIG_X86 /* * Keep this arch-specific modified include in the common file, as moving