xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xen.org, "Juergen Gross" <jgross@suse.com>,
	"Julien Grall" <julien@xen.org>,
	"Vincent Guittot" <vincent.guittot@linaro.org>,
	stratos-dev@op-lists.linaro.org,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Mathieu Poirier" <mathieu.poirier@linaro.com>,
	"Oleksandr Tyshchenko" <olekstysh@gmail.com>,
	"Erik Schilling" <erik.schilling@linaro.org>
Subject: Re: [PATCH] libxl: arm: Allow grant mappings for backends running on Dom0
Date: Fri, 5 May 2023 15:08:35 +0530	[thread overview]
Message-ID: <20230505093835.jcbwo6zjk5hcjvsm@vireshk-i7> (raw)
In-Reply-To: <92c7f972-f617-40fc-bc5d-582c8154d03c@perard>

Hi Anthony,

On 02-05-23, 15:44, Anthony PERARD wrote:
> > diff --git a/tools/libs/light/libxl_virtio.c b/tools/libs/light/libxl_virtio.c
> > index faada49e184e..e1f15344ef97 100644
> > --- a/tools/libs/light/libxl_virtio.c
> > +++ b/tools/libs/light/libxl_virtio.c
> > @@ -48,11 +48,13 @@ static int libxl__set_xenstore_virtio(libxl__gc *gc, uint32_t domid,
> >      flexarray_append_pair(back, "base", GCSPRINTF("%#"PRIx64, virtio->base));
> >      flexarray_append_pair(back, "type", GCSPRINTF("%s", virtio->type));
> >      flexarray_append_pair(back, "transport", GCSPRINTF("%s", transport));
> > +    flexarray_append_pair(back, "forced_grant", GCSPRINTF("%u", virtio->forced_grant));
> >  
> >      flexarray_append_pair(front, "irq", GCSPRINTF("%u", virtio->irq));
> >      flexarray_append_pair(front, "base", GCSPRINTF("%#"PRIx64, virtio->base));
> >      flexarray_append_pair(front, "type", GCSPRINTF("%s", virtio->type));
> >      flexarray_append_pair(front, "transport", GCSPRINTF("%s", transport));
> > +    flexarray_append_pair(front, "forced_grant", GCSPRINTF("%u", virtio->forced_grant));
> 
> This "forced_grant" feels weird to me in the protocol, I feel like this
> use of grant or not could be handled by the backend. For example in
> "blkif" protocol, there's plenty of "feature-*" which allows both
> front-end and back-end to advertise which feature they can or want to
> use.
> But maybe the fact that the device tree needs to be modified to be able
> to accommodate grant mapping means that libxl needs to ask the backend to
> use grant or not, and the frontend needs to now if it needs to use
> grant.

I am not sure if I fully understand what you are suggesting here.

The eventual fronend drivers (like drivers/i2c/busses/i2c-virtio.c)
aren't Xen aware and the respective virtio protocol doesn't talk about
how memory is mapped for the guest. The guest kernel allows both
memory mapping models and the decision is made based on the presence
or absence of the iommu node in the DT.

The backends in our case are hypervisor agnostic and aren't part of
Xen or any other hypervisor. I am not sure how the backend can provide
the mapping information to Xen, with which the creation of the iommu
DT node can be controlled.

Also, as I communicated in another email, the currently suggested
option in this patch, "forced_grant", isn't enough for us. We also
need a way to disable grant mappings. Right now we are creating iommu
nodes by default all the time, if the backend domain isn't Dom0.

What I need probably is something like: "use_grant", where setting it
to 1 will always create the iommu node and setting it to 0 will not,
irrespective of the backend domain, and this overrides the current
model of defaulting to create the node when not mapped by Dom0.

-- 
viresh


  reply	other threads:[~2023-05-05  9:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  8:43 [PATCH] libxl: arm: Allow grant mappings for backends running on Dom0 Viresh Kumar
2023-04-04 18:16 ` Oleksandr Tyshchenko
2023-04-04 23:42   ` Viresh Kumar
2023-05-05  6:19     ` Viresh Kumar
2023-05-05 13:11       ` Oleksandr Tyshchenko
2023-05-08  4:09         ` Viresh Kumar
2023-05-08  7:02           ` Juergen Gross
2023-05-02 14:44 ` Anthony PERARD
2023-05-05  9:38   ` Viresh Kumar [this message]
2023-05-09 15:05     ` Anthony PERARD
2023-05-11  7:28       ` Viresh Kumar

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=20230505093835.jcbwo6zjk5hcjvsm@vireshk-i7 \
    --to=viresh.kumar@linaro.org \
    --cc=alex.bennee@linaro.org \
    --cc=anthony.perard@citrix.com \
    --cc=erik.schilling@linaro.org \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=mathieu.poirier@linaro.com \
    --cc=olekstysh@gmail.com \
    --cc=stratos-dev@op-lists.linaro.org \
    --cc=vincent.guittot@linaro.org \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).