From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D56AC43461 for ; Mon, 14 Sep 2020 11:19:42 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A886B21D24 for ; Mon, 14 Sep 2020 11:19:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=trmm.net header.i=@trmm.net header.b="dcrw0xRI" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A886B21D24 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=trmm.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kHmW1-0002K3-Fa; Mon, 14 Sep 2020 11:19:21 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1kHmVz-0002Jy-VX for xen-devel@lists.xenproject.org; Mon, 14 Sep 2020 11:19:20 +0000 X-Inumbo-ID: 1ac60564-bbb6-46e6-8193-7c65d43ff894 Received: from mail-40133.protonmail.ch (unknown [185.70.40.133]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 1ac60564-bbb6-46e6-8193-7c65d43ff894; Mon, 14 Sep 2020 11:19:17 +0000 (UTC) Date: Mon, 14 Sep 2020 11:19:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trmm.net; s=protonmail; t=1600082356; bh=J4rJQxLBx0CDPyGfZ9cXQriwiRA1q9eafZo5cdAo1oI=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=dcrw0xRIuGOPoet0fSS5RFcpZ4cTc3j5lsX/tyo4zBtcyPnYhuqg0a16QE7d0bB7A +dLgXpVY3mhn2/DN2kRlDCj0YdLmPU2I0CPjrlIgYingQITc3GbnlgphiotRJhGxXv 23RI6P5za049JDrkISaFtAA0o6I1xRtq7rKN96OI= To: =?utf-8?Q?Roger_Pau_Monn=C3=A9?= From: Trammell Hudson Cc: "xen-devel@lists.xenproject.org" Subject: Re: [PATCH v3 3/4] efi: Enable booting unified hypervisor/kernel/initrd images Message-ID: <3anr6Udui7bFFb1CwaGT9tU_oq3rEh_DwgajzdD_hzmYsvfJX3WGAXUYRzGzBKdgdoxuEfSLM6O1ipl5EitDiRGkgT3vUI8WGzLWM9P2Qdg=@trmm.net> In-Reply-To: <20200914100609.GC753@Air-de-Roger> References: <20200907190027.669086-1-hudson@trmm.net> <20200907190027.669086-4-hudson@trmm.net> <20200914100609.GC753@Air-de-Roger> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Reply-To: Trammell Hudson Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" On Monday, September 14, 2020 6:06 AM, Roger Pau Monn=C3=A9 wrote: > On Mon, Sep 07, 2020 at 03:00:26PM -0400, Trammell Hudson wrote: > > [...] > > It is inspired by systemd-boot's unified kernel technique and borrows t= he > > function to locate PE sections from systemd's LGPL'ed code. During EFI > > boot, Xen looks at its own loaded image to locate the PE sections for > > the Xen configuration (`.config`), dom0 kernel (`.kernel`), dom0 initrd > > (`.initrd`), and XSM config (`.xsm`), which are included after building > > Could we name this kernel_payload or maybe just payload instead of > initrd? > > That's a Linux specific concept. Perhaps "ramdisk" is better, since that is the name of the module in the Xen config file? That was what I used elsewhere (and messed up in the docs= , as you had noticed). > [...] > > - --change-section-vma .initrd=3D0xffff82d042000000 \ > > Why do you need to adjust the VMA, is this not set to a suitable > default value? > > How can users find a suitable VMA value? The default is to put the new sections at virtual address 0, which causes load errors. It seemed to be necessary to have it above the hypervisor image, although I'm also borrowing that from the systemd-boot code. I wish objcopy had an "--append-section" that would add after the last section in the file... An earlier version of the patch series had a shell script to do this proces= s, although it was not as general as people wanted, so it was dropped in favor= of documenting how to build the images with objcopy. > [...] > > - file->ptr =3D (void *)pe_find_section(image->ImageBase, image->Imag= eSize, > > This already returns a void *, so there's no need for the cast. It returns const void *, but file has a non-const pointer. Perhaps files s= hould be immutable and that could be addressed in a const-correctness patch serie= s. The style guide issues will also be addressed in the v4 of the patch, to be posted soon. -- Trammell