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

Re: UEFI support in ARM DomUs


  • To: Julien Grall <julien.grall.oss@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@xxxxxxxx>
  • Date: Fri, 19 Jun 2020 12:32:14 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.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:X-MS-Exchange-SenderADCheck; bh=GbP2RTlkNxVnRFwh3YeM/LZxhrjsq9/+z4Ag+Q5G2b8=; b=ejmT/dFVN8htPY7AuICO5neHEEKnXquXj3jcWGd/c/o7kZ4ejcsztl5HV6pYRhRNVOmhVUKQ8xScjvLja/6cOG1287jcIAjNfbvm8pd1w+u4ooowX9dix64F60/FACccQhItJXDuwSjzMWqBODT7FtPUi3vf/JCB+umwiOWpRQXVGaiydseTcVtNug8U/jTTDxO8gznTDsU+mifFrSU+b5td/7DOzPwXySYmF2oDYt4A9CIvltR3eok7HhXJiL5VzIMVqhBTWAOzDx1khxCxJlZT3Et6lCe0sK/SRWQTzaBoBoKIMalhKXwMVZV42b/Xp6ZAgkJhhJEKeoB3Wx1HZw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Dm/Elfgr1WPtuQx3Xw0Nz6kFZ5YrhjxHafP0Q9bxjrQ2BmXoFzYyxmoj/c6YDab+MQq1LTSk2FZtYUH6wJFd5SfYJUN86+KCwzP2vx6MWAkL9/7WVsWVRwVT18wh26EX09BmmezW1IEtUr2zbeTr4RpMigbJlPMk2dD19nmfB1aLWbIfnCcrkhBusiaOUcCyKk2zV+S5+CJk+kZ69cho4rmKDSq5Gi6Dg9XA15bsfX9wfuTtA8u65sOM6TU8wHL74K95jxygqwZuyvThqXjKdjjVZHJjmLURwlbGSPqwim/tXr/X1zJhhNxsw6liWp/uj0HnBU5MSAEtWymQ4QGa5g==
  • Authentication-results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=epam.com;
  • Cc: Anastasiia Lukianenko <Anastasiia_Lukianenko@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Peng Fan <peng.fan@xxxxxxx>, Roman Shaposhnik <roman@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Nataliya Korovkina <malus.brandywine@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 19 Jun 2020 12:32:28 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHWOoSI1wnhumD+IkWBnAQX9mudyajIlWsAgBVWbwCAAJ62gIAAeBOAgAANxQCAAOXggA==
  • Thread-topic: UEFI support in ARM DomUs

On 6/19/20 1:49 AM, Julien Grall wrote:
> On Thu, 18 Jun 2020 at 23:00, Stefano Stabellini <sstabellini@xxxxxxxxxx> 
> wrote:
>> On Thu, 18 Jun 2020, Julien Grall wrote:
>>> On 18/06/2020 06:22, Oleksandr Andrushchenko wrote:
>>>> On 6/4/20 6:31 PM, Stefano Stabellini wrote:
>>>>> On Thu, 4 Jun 2020, Oleksandr Andrushchenko wrote:
>>>>>> On 6/4/20 4:57 AM, Peng Fan wrote:
>>>>>>> Grall <julien@xxxxxxx>;
>>>>>>>> Nataliya Korovkina <malus.brandywine@xxxxxxxxx>
>>>>>>>> Subject: UEFI support in ARM DomUs
>>>>>>> We have made U-Boot run inside XEN DomU, but just only PV console
>>>>>>> part,
>>>>>>> not implement other frontend drivers currently. Would this help for
>>>>>>> your
>>>>>>> case if enable EFI in U-Boot?
>>>>>> Well, we have a working PV block implementation on top of that on iMX8
>>>>>>
>>>>>> platform, mostly ported from mini-os. Currently we are finalizing the
>>>>>> work
>>>>>>
>>>>>> and cleaning up (it's going to take a week or so hopefully). Then, we
>>>>>> we'll post
>>>>>>
>>>>>> it on our public github. We are also thinking about upstreaming the
>>>>>> work, but it may
>>>>>>
>>>>>> take quite some time if the whole idea fits u-boot's view on such an
>>>>>> extension at all.
>>>>> Yes please to both of you! :-)
>>>>>
>>>>> In the meantime, while we wait for those changes to go upstream in
>>>>> uboot, could you please post a branch on github and a link on this email
>>>>> thread?
>>>> It took a bit more time than we expected, but here we go [1]:
>>>>
>>>> this is in form of a pull-request as we would love to hear from the
>>>>
>>>> community and it is easier to discuss the code (please leave comments 
>>>> there)
>>>>
>>>> 1. There is code originating from MiniOS and work done by Peng, so we
>>>>
>>>> would like to ask the respective copyright owners to raise their hands and
>>> Not everyone are closely watching xen-devel. So if you want to find out who
>>> are the copyright owners, then your best solution is to go through the git 
>>> log
>>> and CC the authors.
>> That is true. But why do you want to contact them? It doesn't look like
>> there would be any licensing issues.
>  From the sentence, I wasn't entirely sure whether he wanted to contact
> the copyright owner for crediting them in the headers.
>
>>>> 5. We use -D__XEN__ to access some of the hidden defines we need such as
>>>>
>>>> GUEST_RAM0_BASE and the friends as there is no other way but manually
>>>> defining the
>>>>
>>>> same which is not cute.
>>> I have replied to this in the pull request. But I want to bring the
>>> conversation here to have a wider discussion.
>>>
>>> For a first, __XEN__ should really only be defined by the hypervisor and not
>>> used by the guest. This is used to gate non-stable ABI (such as the tools) 
>>> and
>>> anything behind it hasn't been vetted to work in other build configuration
>>> that the one used by Xen.
>>>
>>> In general, we expect the guest to discover everything for the device-tree
>>> because the memory layout is not stable (we want to be able to reshuffle as 
>>> we
>>> add more features).
>>>
>>> I know that EDK2/Tianocore can be built once and work on every Xen
>>> configuration. It would be ideal that U-boot follow the same. If it is 
>>> really
>>> not possible, then we should explore a path that is preventing to define
>>> __XEN__.
>>>
>>> How much does U-boot expect to know about the memory layout? Does it require
>>> to know all the memory banks? Or would it be sufficient for it to know the
>>> start address of the first bank and the minimum of RAM?
>> Copy/pasting here from my comment on the pull request plus additional
>> thoughts.
>>
>> Uboot is one of those embedded projects that typically assumes that all
>> the information about the platform is available at *build time*. It is
>> meant to be built tailored for a specific version of a specific board. A
>> Uboot binary is not expected to be "portable" across different versions
>> of the platform or different platforms. In other words, it is not
>> expected to be portable across Xen versions.
> Can you define "version" here? Do you refer to the difference in terms
> of memory?
>
>> This is a different model meant for different use-cases. I don't think
>> it is a problem "philosophically" to let Uboot know about Xen details at
>> build time. Yes, that is not what we did historically but it is very
>> much in the spirit of Uboot.
> TBH, I don't particularly mind that U-boot is built against a specific
> version of Xen. I am more concerned about the long term implication if
> we endorse it
> and then try to change the memory layout in depth.
>
>> But of course the least Uboot depends on these details the better
>> because it will be more flexible, but it could very well be that we
>> won't be able to reach the point where the binary works on any version
>> like we did with Tianocore. The two projects work differently.
> Can we have a list of things U-boot require to know at compile time?
>
> In particular, I would like to understand if it would be sufficient to
> only be aware of the first bank. If it is, then my preference would be
> to standardize that bit of the layout.

Well, my bad, I was not right about PIE. We are lucky that it is supported

for ARM64, so we can avoid using GUEST_RAM0_BASE.

With respect to the number of banks I see no big issue if we do not use

GUEST_RAM_BANKS, but set it to 1.

The last thing at the moment that I am not sure of is GUEST_MAGIC_{BASE|SIZE}:

those can be retrieved from the device tree and I'll have to check if

fdt is available at the very early boot stage so we can get that when it is 
needed.

We'll keep you updated on this

>> That said, I think Julien is right that we need to be careful on how we
>> expose these information to Uboot, i.e. defining __XEN__ to build Uboot
>> doesn't seem like a good idea because we enable definitions that were
>> never meant to be used outside of a Xen build. Also, it wouldn't be easy
>> to know exactly which definitions are actively used by Uboot and which
>> ones aren't.
>>
>> If we are going to make Uboot dependent on version-specific information
>> of the Xen interface, it would be better to be very clear about which
>> definitions we are using. So that one day if we need to change them, we
>> can find them easily.
>>
>> So I think it would be better to introduce a set of defines with the
>> minimum amount of information required by Uboot statically. That way,
>> at least we have a single place where to find all the version-specific
>> definitions that Uboot is using.
> I am not sure what you are suggesting. Can you expand a bit more?
>
>> We can also manage versioning of the
>> Xen interface (like we do in QEMU) if we have to.
> Can you provide more details about the compatibility? I am quite
> interested in the part where you would have to deal with an older QEMU
> version built against a new Xen?
>
> Cheers,

 


Rackspace

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