From: Ian Campbell <Ian.Campbell@citrix.com>
To: Paul Durrant <Paul.Durrant@citrix.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
"Keir (Xen.org)" <keir@xen.org>, "Tim (Xen.org)" <tim@xen.org>,
"Xen-devel@lists.xen.org" <Xen-devel@lists.xen.org>,
"Yu, Zhang" <yu.c.zhang@linux.intel.com>,
"JBeulich@suse.com" <JBeulich@suse.com>
Subject: Re: One question about the hypercall to translate gfn to mfn.
Date: Tue, 9 Dec 2014 11:29:03 +0000 [thread overview]
Message-ID: <1418124543.14361.27.camel@citrix.com> (raw)
In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD025785926@AMSPEX01CL01.citrite.net>
On Tue, 2014-12-09 at 11:17 +0000, Paul Durrant wrote:
> > -----Original Message-----
> > From: Ian Campbell
> > Sent: 09 December 2014 11:11
> > To: Paul Durrant
> > Cc: Tim (Xen.org); Yu, Zhang; Kevin Tian; Keir (Xen.org); JBeulich@suse.com;
> > Xen-devel@lists.xen.org
> > Subject: Re: [Xen-devel] One question about the hypercall to translate gfn to
> > mfn.
> >
> > On Tue, 2014-12-09 at 11:05 +0000, Paul Durrant wrote:
> > > > -----Original Message-----
> > > > From: Tim Deegan [mailto:tim@xen.org]
> > > > Sent: 09 December 2014 10:47
> > > > To: Yu, Zhang
> > > > Cc: Paul Durrant; Keir (Xen.org); JBeulich@suse.com; Kevin Tian; Xen-
> > > > devel@lists.xen.org
> > > > Subject: Re: One question about the hypercall to translate gfn to mfn.
> > > >
> > > > At 18:10 +0800 on 09 Dec (1418145055), Yu, Zhang wrote:
> > > > > Hi all,
> > > > >
> > > > > As you can see, we are pushing our XenGT patches to the upstream.
> > One
> > > > > feature we need in xen is to translate guests' gfn to mfn in XenGT dom0
> > > > > device model.
> > > > >
> > > > > Here we may have 2 similar solutions:
> > > > > 1> Paul told me(and thank you, Paul :)) that there used to be a
> > > > > hypercall, XENMEM_translate_gpfn_list, which was removed by Keir in
> > > > > commit 2d2f7977a052e655db6748be5dabf5a58f5c5e32, because there
> > was
> > > > no
> > > > > usage at that time.
> > > >
> > > > It's been suggested before that we should revive this hypercall, and I
> > > > don't think it's a good idea. Whenever a domain needs to know the
> > > > actual MFN of another domain's memory it's usually because the
> > > > security model is problematic. In particular, finding the MFN is
> > > > usually followed by a brute-force mapping from a dom0 process, or by
> > > > passing the MFN to a device for unprotected DMA.
> > > >
> > > > These days DMA access should be protected by IOMMUs, or else
> > > > the device drivers (and associated tools) are effectively inside the
> > > > hypervisor's TCB. Luckily on x86 IOMMUs are widely available (and
> > > > presumably present on anything new enough to run XenGT?).
> > > >
> > > > So I think the interface we need here is a please-map-this-gfn one,
> > > > like the existing grant-table ops (which already do what you need by
> > > > returning an address suitable for DMA). If adding a grant entry for
> > > > every frame of the framebuffer within the guest is too much, maybe we
> > > > can make a new interface for the guest to grant access to larger areas.
> > > >
> > >
> > > IIUC the in-guest driver is Xen-unaware so any grant entry would have
> > > to be put in the guests table by the tools, which would entail some
> > > form of flexibly sized reserved range of grant entries otherwise any
> > > PV driver that are present in the guest would merrily clobber the new
> > > grant entries.
> > > A domain can already priv map a gfn into the MMU, so I think we just
> > > need an equivalent for the IOMMU.
> >
> > I'm not sure I'm fully understanding what's going on here, but is a
> > variant of XENMEM_add_to_physmap+XENMAPSPACE_gmfn_foreign which
> > also
> > returns a DMA handle a plausible solution?
> >
>
> I think we want be able to avoid setting up a PTE in the MMU since
> it's not needed in most (or perhaps all?) cases.
Another (wildly under-informed) thought then:
A while back Global logic proposed (for ARM) an infrastructure for
allowing dom0 drivers to maintain a set of iommu like pagetables under
hypervisor supervision (they called these "remoteprocessor iommu").
I didn't fully grok what it was at the time, let alone remember the
details properly now, but AIUI it was essentially a framework for
allowing a simple Xen side driver to provide PV-MMU-like update
operations for a set of PTs which were not the main-processor's PTs,
with validation etc.
See http://thread.gmane.org/gmane.comp.emulators.xen.devel/212945
The introductory email even mentions GPUs...
Ian.
next prev parent reply other threads:[~2014-12-09 11:29 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-09 10:10 One question about the hypercall to translate gfn to mfn Yu, Zhang
2014-12-09 10:19 ` Paul Durrant
2014-12-09 10:37 ` Yu, Zhang
2014-12-09 10:50 ` Jan Beulich
2014-12-10 1:07 ` Tian, Kevin
2014-12-10 8:39 ` Jan Beulich
2014-12-10 8:47 ` Tian, Kevin
2014-12-10 9:16 ` Jan Beulich
2014-12-10 9:51 ` Tian, Kevin
2014-12-10 10:07 ` Jan Beulich
2014-12-10 11:04 ` Malcolm Crossley
2014-12-10 8:50 ` Tian, Kevin
2014-12-09 10:51 ` Malcolm Crossley
2014-12-10 1:22 ` Tian, Kevin
2014-12-09 10:38 ` Jan Beulich
2014-12-09 10:46 ` Tim Deegan
2014-12-09 11:05 ` Paul Durrant
2014-12-09 11:11 ` Ian Campbell
2014-12-09 11:17 ` Paul Durrant
2014-12-09 11:23 ` Jan Beulich
2014-12-09 11:28 ` Malcolm Crossley
2014-12-09 11:29 ` Ian Campbell [this message]
2014-12-09 11:43 ` Paul Durrant
2014-12-10 1:48 ` Tian, Kevin
2014-12-10 10:11 ` Ian Campbell
2014-12-11 1:50 ` Tian, Kevin
2014-12-10 1:14 ` Tian, Kevin
2014-12-10 10:36 ` Jan Beulich
2014-12-11 1:45 ` Tian, Kevin
2014-12-10 10:55 ` Tim Deegan
2014-12-11 1:41 ` Tian, Kevin
2014-12-11 16:46 ` Tim Deegan
2014-12-12 7:24 ` Tian, Kevin
2014-12-12 10:54 ` Jan Beulich
2014-12-15 6:25 ` Tian, Kevin
2014-12-15 8:44 ` Jan Beulich
2014-12-15 9:05 ` Tian, Kevin
2014-12-15 9:22 ` Jan Beulich
2014-12-15 11:16 ` Tian, Kevin
2014-12-15 11:27 ` Jan Beulich
2014-12-15 15:22 ` Stefano Stabellini
2014-12-15 16:01 ` Jan Beulich
2014-12-15 16:15 ` Stefano Stabellini
2014-12-15 16:28 ` David Vrabel
2014-12-15 16:28 ` Jan Beulich
2014-12-18 15:46 ` Tim Deegan
2015-01-06 8:56 ` Tian, Kevin
2015-01-08 12:43 ` Tim Deegan
2015-01-09 8:02 ` Tian, Kevin
2015-01-09 20:08 ` Konrad Rzeszutek Wilk
2015-01-12 11:14 ` David Vrabel
2014-12-11 21:29 ` Tim Deegan
2014-12-12 6:29 ` Tian, Kevin
2014-12-18 16:08 ` Tim Deegan
2014-12-18 17:01 ` Andrew Cooper
2015-01-05 15:49 ` George Dunlap
2015-01-06 8:42 ` Tian, Kevin
2015-01-06 10:35 ` Ian Campbell
2014-12-12 7:30 ` Tian, Kevin
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=1418124543.14361.27.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=JBeulich@suse.com \
--cc=Paul.Durrant@citrix.com \
--cc=Xen-devel@lists.xen.org \
--cc=keir@xen.org \
--cc=kevin.tian@intel.com \
--cc=tim@xen.org \
--cc=yu.c.zhang@linux.intel.com \
/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.