All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>,
	Julien Grall <julien.grall.oss@gmail.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: Anastasiia Lukianenko <Anastasiia_Lukianenko@epam.com>,
	Juergen Gross <jgross@suse.com>, Peng Fan <peng.fan@nxp.com>,
	Roman Shaposhnik <roman@zededa.com>,
	Bertrand Marquis <Bertrand.Marquis@arm.com>,
	Nataliya Korovkina <malus.brandywine@gmail.com>,
	Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: UEFI support in ARM DomUs
Date: Fri, 19 Jun 2020 13:47:03 +0100	[thread overview]
Message-ID: <9d4a6e78-49d3-01c3-251b-6d66f56c2761@xen.org> (raw)
In-Reply-To: <17a14578-6fc7-925d-6f69-8b2fcbf40ff3@epam.com>

Hi Oleksandr,

On 19/06/2020 13:32, Oleksandr Andrushchenko wrote:
> 
> On 6/19/20 1:49 AM, Julien Grall wrote:
>> On Thu, 18 Jun 2020 at 23:00, Stefano Stabellini <sstabellini@kernel.org> 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@xen.org>;
>>>>>>>>> Nataliya Korovkina <malus.brandywine@gmail.com>
>>>>>>>>> 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.

Cool!

> 
> 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.

I am guessing U-boot wouldn't be able to load modules into the second 
bank. Am I corre
> 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.

They will not be available from the fdt, but you can retrieve them with 
an hypervisor call (see HVM_PARAM_STORE_PFN, HVM_PARAM_CONSOLE_PFN).
One question though, why do you need to map them in advance? Couldn't 
you map them on demand?
Cheers,

-- 
Julien Grall


  reply	other threads:[~2020-06-19 12:47 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-31 22:05 UEFI support in ARM DomUs Roman Shaposhnik
2020-05-31 22:24 ` Julien Grall
2020-06-01  4:11   ` Roman Shaposhnik
2020-06-01 16:12     ` Stefano Stabellini
2020-06-02 22:50       ` Roman Shaposhnik
2020-06-04 16:58         ` George Dunlap
2020-06-03 10:16     ` Julien Grall
2020-06-04  1:57 ` Peng Fan
2020-06-04 15:26   ` Oleksandr Andrushchenko
2020-06-04 15:31     ` Stefano Stabellini
2020-06-04 16:50       ` Roman Shaposhnik
2020-06-15  1:58       ` Peng Fan
2020-06-18  5:22       ` Oleksandr Andrushchenko
2020-06-18 14:50         ` Julien Grall
2020-06-18 22:00           ` Stefano Stabellini
2020-06-18 22:49             ` Julien Grall
2020-06-19 12:32               ` Oleksandr Andrushchenko
2020-06-19 12:47                 ` Julien Grall [this message]
2020-06-19 12:51                   ` Oleksandr Andrushchenko
2020-06-19 12:59                     ` Julien Grall
2020-06-19 13:06                       ` Oleksandr Andrushchenko
2020-06-19 13:15                         ` Julien Grall
2020-06-19 13:29                           ` Oleksandr Andrushchenko
2020-06-22 13:56                             ` Oleksandr Andrushchenko
2020-06-22 14:23                               ` Julien Grall
2020-06-19 13:16                         ` Peng Fan
2020-06-19 13:31                           ` Oleksandr Andrushchenko
2020-06-19 20:02               ` Stefano Stabellini
2020-06-22 14:04                 ` Oleksandr Andrushchenko
2020-06-22 14:27                   ` Julien Grall
2020-06-22 14:33                     ` Oleksandr Andrushchenko
2020-06-22 17:49                       ` Julien Grall
2020-06-23  1:20                         ` Stefano Stabellini
2020-06-23  5:31                           ` Oleksandr Andrushchenko
2020-06-24  6:14                             ` Oleksandr Andrushchenko
2020-06-24  7:07                               ` Peng Fan
2020-06-24  7:17                                 ` Oleksandr Andrushchenko
2020-06-24  7:26                                   ` Peng Fan
2020-06-24  7:38                                     ` Oleksandr Andrushchenko
2020-06-24 17:05                               ` Stefano Stabellini
2020-06-24 19:31                                 ` Oleksandr Andrushchenko
2020-06-24 19:47                                   ` Stefano Stabellini
2020-06-19  7:04           ` Oleksandr Andrushchenko
2020-06-04 15:38     ` Julien Grall
2020-06-04 16:27       ` Stefano Stabellini
2020-06-04 16:34         ` Julien Grall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9d4a6e78-49d3-01c3-251b-6d66f56c2761@xen.org \
    --to=julien@xen.org \
    --cc=Anastasiia_Lukianenko@epam.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Oleksandr_Andrushchenko@epam.com \
    --cc=jgross@suse.com \
    --cc=julien.grall.oss@gmail.com \
    --cc=malus.brandywine@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=roman@zededa.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.