All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Wei Chen <Wei.Chen@arm.com>
Cc: Julien Grall <julien@xen.org>,
	 "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>,
	 Stefano Stabellini <sstabellini@kernel.org>,
	 Bertrand Marquis <Bertrand.Marquis@arm.com>,
	 Penny Zheng <Penny.Zheng@arm.com>,
	Henry Wang <Henry.Wang@arm.com>,  nd <nd@arm.com>
Subject: RE: Proposal for Porting Xen to Armv8-R64 - DraftA
Date: Mon, 7 Mar 2022 14:58:20 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2203071348220.3261@ubuntu-linux-20-04-desktop> (raw)
In-Reply-To: <PAXPR08MB7420827063D47932F428CEC89E089@PAXPR08MB7420.eurprd08.prod.outlook.com>

On Mon, 7 Mar 2022, Wei Chen wrote:
> > > On 01/03/2022 07:51, Wei Chen wrote:
> > > >>> ### 1.2. Xen Challenges with PMSA Virtualization
> > > >>> Xen is PMSA unaware Type-1 Hypervisor, it will need modifications to
> > > run
> > > >>> with an MPU and host multiple guest OSes.
> > > >>>
> > > >>> - No MMU at EL2:
> > > >>>       - No EL2 Stage 1 address translation
> > > >>>           - Xen provides fixed ARM64 virtual memory layout as basis
> > of
> > > >> EL2
> > > >>>             stage 1 address translation, which is not applicable on
> > > MPU
> > > >> system,
> > > >>>             where there is no virtual addressing. As a result, any
> > > >> operation
> > > >>>             involving transition from PA to VA, like ioremap, needs
> > > >> modification
> > > >>>             on MPU system.
> > > >>>       - Xen's run-time addresses are the same as the link time
> > > addresses.
> > > >>>           - Enable PIC (position-independent code) on a real-time
> > > target
> > > >>>             processor probably very rare.
> > > >>
> > > >> Aside the assembly boot code and UEFI stub, Xen already runs at the
> > > same
> > > >> address as it was linked.
> > > >>
> > > >
> > > > But the difference is that, base on MMU, we can use the same link
> > > address
> > > > for all platforms. But on MPU system, we can't do it in the same way.
> > >
> > > I agree that we currently use the same link address for all the
> > > platforms. But this is also a problem when using MMU because EL2 has a
> > > single TTBR.
> > >
> > > At the moment we are switching page-tables with the MMU which is not
> > > safe. Instead we need to turn out the MMU off, switch page-tables and
> > > then turn on the MMU. This means we need to have an identity mapping of
> > > Xen in the page-tables. Assuming Xen is not relocated, the identity
> > > mapping may clash with Xen (or the rest of the virtual address map).
> > >
> > 
> > Is this the same reason we create a dummy reloc section for EFI loader?
> > 
> > > My initial idea was to enable PIC and update the relocation at boot
> > > time. But this is a bit cumbersome to do. So now I am looking to have a
> > > semi-dynamic virtual layout and find some place to relocate part of Xen
> > > to use for CPU bring-up.
> > >
> > > Anyway, my point is we possibly could look at PIC if that could allow
> > > generic Xen image.
> > >
> > 
> > I understand your concern. IMO, PIC is possible to do this, but obviously,
> > it's not a small amount of work. And I want to hear some suggestions from
> > Stefano, because he also has some solutions in previous thread.
> >
> 
> Can you have a look at the PIC discussion between Julien and me?
> I think we may need some inputs from your view.

If we have to have a build-time device tree anyway, we could
automatically generate the link address, together with other required
addresses. There would little benefit to do PIC if we have to have a
build-time device tree in any case.

On the other hand, if we could get rid of the build-time device tree
altogether, then yes doing PIC provides some benefits. It would allow us
to have single Xen binary working on multiple Cortex-R boards. However,
I don't think that would be important from a user perspective. People
will not install Ubuntu on a Cortex-R and apt-get xen.  The target is
embedded: users will know from the start the board they will target, so
it would not be a problem for them to build Xen for a specific board.
ImageBuilder (or something like it) will still be required to generate
boot scripts and boot info. In other words, although it would be
convenient to produce a generic binary, it is not a must-have feature
and I would consider it low-priority compared to others.


  reply	other threads:[~2022-03-07 22:58 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24  6:01 Proposal for Porting Xen to Armv8-R64 - DraftA Wei Chen
2022-02-24 11:52 ` Ayan Kumar Halder
2022-02-25  6:33   ` Wei Chen
2022-02-25  0:55 ` Stefano Stabellini
2022-02-25 10:48   ` Wei Chen
2022-02-25 20:12     ` Julien Grall
2022-03-01  6:29       ` Wei Chen
2022-03-01 13:17         ` Julien Grall
2022-03-02  6:43           ` Wei Chen
2022-03-02 10:24             ` Julien Grall
2022-03-03  1:35               ` Wei Chen
2022-03-03  9:15                 ` Julien Grall
2022-03-03 10:43                   ` Wei Chen
2022-02-25 23:54     ` Stefano Stabellini
2022-03-01 12:55       ` Wei Chen
2022-03-01 23:38         ` Stefano Stabellini
2022-03-02  7:13           ` Wei Chen
2022-03-02 22:55             ` Stefano Stabellini
2022-03-03  1:05               ` Wei Chen
2022-03-03  2:03                 ` Stefano Stabellini
2022-03-03  2:12                   ` Wei Chen
2022-03-03  2:15                     ` Stefano Stabellini
2022-02-25 20:55 ` Julien Grall
2022-03-01  7:51   ` Wei Chen
2022-03-02  7:21     ` Penny Zheng
2022-03-02 12:06       ` Julien Grall
2022-03-02 12:00     ` Julien Grall
2022-03-03  2:06       ` Wei Chen
2022-03-03 19:51         ` Julien Grall
2022-03-04  5:38           ` Wei Chen
2022-03-07  2:12         ` Wei Chen
2022-03-07 22:58           ` Stefano Stabellini [this message]
2022-03-08  7:28             ` Wei Chen
2022-03-08 19:49               ` Stefano Stabellini

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=alpine.DEB.2.22.394.2203071348220.3261@ubuntu-linux-20-04-desktop \
    --to=sstabellini@kernel.org \
    --cc=Bertrand.Marquis@arm.com \
    --cc=Henry.Wang@arm.com \
    --cc=Penny.Zheng@arm.com \
    --cc=Wei.Chen@arm.com \
    --cc=julien@xen.org \
    --cc=nd@arm.com \
    --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.