[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC PATCH] xen/design: Add design for EFI dom0less system start


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Tue, 7 Sep 2021 15:59:39 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=g0ut8YQV8nIB9fjekl4Z/u2KCM0ldFTLssCyvuThFQ8=; b=BG3RXNkExaN28DR+y9MminQvCXEta2BYknxeJBTeBsCthS0nXowWwBn01xdjaIPWHFANmDM7WpM1jC9gkg0khDR0bkP3Y/Q+I6mJtb8w5HdoUGhkmfUydBAroq9EPJzdppAv/+n2vj1a98vbnDMSHVZeP8Mnag41i9rdr7bc6BThCAzONPHDDGxeyJrg8eGsCKI7jWa9bnvUOPzbVrMlIFxtQrwcTbVj0Ft1ME8TR9Wsr5DxTe5wl+Hgj5ejjtduUScRln79cgloTt1kdyvW+/efUJcQz6BFVcouTR38NVyXYR6I92gHz2RBb/LgnZXcfZA5RWJjPyWYArNbn8xI1Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GHjeyp1Tk8Bt44uKrDdrSON+4CmkXk3u9jS490qUmrPEYBftMGFIA6yD1nwkaemjy/hWIm1vey4CgoButen+4P89EEQ6qlKVayETBVecbFY+zF0PiE3odWayNPQQNcMRlHs8j1XsaP2guBQnT1IiOCaCj9LqHmosjXmaN+Nr2INgQNd8d7zdc7WmuDVzDMYyxi/DjPb0THrYGa9XNYi43+zjbFZJvgmF/aRUzqdZ8tmJ4vLCbd49iEsQ1ja6XmUZMsgVtnaDt5suEFkywJJ8FoGFKQwM38bSXK01cq7JC5gr9tUBfbkSEqvCk1+p/5atDhAUXmI3MuFseSqiThpRSQ==
  • Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Bertrand Marquis <bertrand.marquis@xxxxxxx>, wei.chen@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 07 Sep 2021 15:00:13 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;


> On 7 Sep 2021, at 15:18, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Luca,
> 
> On 07/09/2021 14:30, Luca Fancellu wrote:
>>> On 7 Sep 2021, at 13:30, Julien Grall <julien@xxxxxxx> wrote:
>>> On 07/09/2021 12:51, Luca Fancellu wrote:
>>>>> On 7 Sep 2021, at 10:35, Julien Grall <julien@xxxxxxx> wrote:
>>>>> What we could do is providing a list of binaries to load and associate a 
>>>>> key for each of them. Something like:
>>>>> 
>>>>> binary=<binary> <key>
>>>>> binary=<binary2> <key2>
>>>>> ....
>>>>> 
>>>>> We can then replace the property "reg" with a new property "uefi,key" 
>>>>> that will contain the name of the binary.
>>>>> 
>>>>> What do you think?
>>>> Here I’m lost, because I don’t understand what we are going to do with the 
>>>> name of the binary.
>>> 
>>> <binaryX> would be used by the UEFI stub to load the binary in memory. Each 
>>> binary will have a <keyX> which helps to refer them in the Device-Tree. To 
>>> give a concrete example, let say we have two dom0less domains:
>>>  - DomA: 2 vCPUs, 128MB
>>>  - DomB: 3 vCPUs, 512MB
>>> 
>>> DomA and DomB will be using the same kernel but a different ramdisk. 
>>> xen.cfg, would look like:
>>> 
>>> [global]
>>> default=section1
>>> 
>>> [section1]
>>> options=console=vga,com1 com1=57600 loglvl=all noreboot
>>> kernel=vmlinuz-3.0.31-0.4-xen [domain 0 command line options]
>>> ramdisk=initrd-3.0.31-0.4-xen
>>> xsm=<filename>
>>> dtb=devtree.dtb
>>> binary=vmlinuz-guest domu-kernel
>>> binary=ramdisk-domA.img domA-ramdisk
>>> binary=ramdisk-domB.img domB-ramdisk
>>> 
>>> The chosen node in the DT would look like:
>>> 
>>> chosen {
>>>    domU1 {
>>>        compatible = "xen,domain";
>>>        #address-cells = <0x2>;
>>>        #size-cells = <0x1>;
>>>        memory = <0 0x8000000>;
>>>        cpus = <2>;
>>> 
>>>        module@1 {
>>>            compatible = "multiboot,kernel", "multiboot,module";
>>>            uefi,binary = "domu-kernel";
>>>            bootargs = "console=ttyAMA0 init=/bin/sh";
>>>        };
>>> 
>>>        module@2 {
>>>            compatible = "multiboot,ramdisk", "multiboot,module";
>>>            uefi,binary = "domA-ramdisk";
>>>        };
>>>    };
>>> 
>>>    domU2 {
>>>        compatible = "xen,domain";
>>>        #address-cells = <0x3>;
>>>        #size-cells = <0x1>;
>>>        memory = <0 0x20000000>;
>>>        cpus = <3>;
>>> 
>>>        module@1 {
>>>            compatible = "multiboot,kernel", "multiboot,module";
>>>            uefi,binary = "domu-kernel";
>>>            bootargs = "console=ttyAMA0 init=/bin/sh";
>>>        };
>>> 
>>>        module@2 {
>>>            compatible = "multiboot,ramdisk", "multiboot,module";
>>>            uefi,binary = "domA-ramdisk";
>>>        };
>>>    };
>>> };
>>> 
>>> With this approach, the change is quite minimal to move between an classic 
>>> U-boot boot and EFI boot.
>> Ok now I see, yes this approach can work and can save some code, in the 
>> current code we have that if
>> a "multiboot,module” is found in the dtb, the Xen EFI configuration file is 
>> skipped, but if we use the
>> module@XX {} without the compatible it can work, the UEFI stub will load the 
>> binary and update all
>> the needed properties (compatible, reg).
> With my proposal, you don't know whether the binary is a kernel, ramdisk... 
> So you wouldn't be able to recreate the compatible properly.
> 
> But the behavior of the UEFI stub can be modified. We could say that if there 
> is a "xen,domain" then use the configuration file to fetch the binaries.

Yes you are right, or we can introduce domu_kernel, domu_ramdisk, domu_dtb with 
the same syntax of your binary= keyword, that would be enough
to select the right compatible, instead the right module is identified by the 
string.

> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.