All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr Andrushchenko <Oleksandr_Andrushchenko@epam.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien.grall.oss@gmail.com>
Cc: Anastasiia Lukianenko <Anastasiia_Lukianenko@epam.com>,
	Juergen Gross <jgross@suse.com>, Peng Fan <peng.fan@nxp.com>,
	Oleksandr Andrushchenko <andr2000@gmail.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: Mon, 22 Jun 2020 14:04:21 +0000	[thread overview]
Message-ID: <c5905f40-6d0a-358f-35e4-239e88ace7d8@epam.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2006191020110.12730@sstabellini-ThinkPad-T480s>


On 6/19/20 11:02 PM, Stefano Stabellini wrote:
> On Thu, 18 Jun 2020, Julien Grall wrote:
>>> 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?
>   
> Yes, I meant any meaningful differences in any of the external
> interfaces that end up impacting the UBoot implementation. A primary
> example would be the memory addresses for instance.
>
>
>>> 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.
> I'll provide more information below.
>
>
>>> 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.
> That would be my preference too, and it was great to read that it looks
> like it can be done. Yay!
>
>
>>> 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?
> Sure let me expand a bit more. I'll switch "hat" to "QEMU (or UBoot)
> contributor" for the sake of this discussion.
>
> Xen Project offers certain stability guarantees on some interfaces and
> not others. Let's say that for any reason you have to or want to use one
> of the unstable interfaces in QEMU/UBoot/Whatever. Then it becomes your
> responsibility as QEMU developer to maintain compatibility in QEMU
> itself.
>
> First I'd add code to detect the version of the interface. The detection
> is based on the Xen headers/libraries provided. In QEMU it is done in
> the "configure" script. It sets a preprocessor #define to the version
> of the interface (e.g. CONFIG_XEN_CTRL_INTERFACE_VERSION == 41100).

I looked at QEMU's configure script and I'm afraid we can't have the

same flexibility in U-boot: we don't have configure script, pkg-config

is not widely used etc. So, for now we have hardcoded:

ifeq ($(CONFIG_XEN),y)
arch-y += -D__XEN_INTERFACE_VERSION__=0x00040d00
endif

and we also have Xen 4.13 headers in the U-boot tree.

For the first part (__XEN_INTERFACE_VERSION__) I think we can provide it via

CFLAGS or something. This can also be done for the location of Xen headers.

We don't have strong opinion here, so would love to hear from Xen community on this

Current WIP with the fixes requested by Julien are at [1]: can be and will be force pushed

as we are still working on it, but can give you an impression of what we have as of now

>
> Then you can have preprocessors checks in one of the headers such as:
>
> #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40701
>      #define xenevtchn_open(l, f) xc_evtchn_open(l, f);
> #else
>      XXX
> #endif
>
>
> And also like:
>
> #if CONFIG_XEN_CTRL_INTERFACE_VERSION < 40600
>
> #ifndef HVM_IOREQSRV_BUFIOREQ_ATOMIC
> #define HVM_IOREQSRV_BUFIOREQ_ATOMIC 2
> #endif
>
> #endif
>
>
> This works OK to handle differences in the interface between past
> versions of Xen. What about building an older QEMU against a new version
> of Xen? That is not going to work if something changes again on the Xen
> side. However, it becomes much easier to add support for the new Xen
> interface in QEMU, because you can go and look at that compatibility
> header and just add the right #else XXX. It also makes it clear what
> interfaces and definitions have been used that are unstable.
>
> Of course it is better to use the stable interfaces when possible :-)
[1] https://github.com/andr2000/u-boot/tree/pvblock_upstream_v1

  reply	other threads:[~2020-06-22 14:04 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
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 [this message]
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=c5905f40-6d0a-358f-35e4-239e88ace7d8@epam.com \
    --to=oleksandr_andrushchenko@epam.com \
    --cc=Anastasiia_Lukianenko@epam.com \
    --cc=Bertrand.Marquis@arm.com \
    --cc=andr2000@gmail.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.