All of lore.kernel.org
 help / color / mirror / Atom feed
* VP problematic for backend drivers on IA64?
@ 2006-01-20  1:55 Muli Ben-Yehuda
  2006-01-25 10:29 ` Gerd Hoffmann
  0 siblings, 1 reply; 14+ messages in thread
From: Muli Ben-Yehuda @ 2006-01-20  1:55 UTC (permalink / raw)
  To: Magenheimer, Dan (HP Labs Fort Collins); +Cc: xen-devel, okrieg

Hi Dan,

I understand that during the IA64 session at the summit there was some
discussion on VP being problematic for the current backend drivers (or
the other way around), and IOMMUs were suggested as a possible
solution. Could you please elaborate on what's the problem?

Thanks,
Muli
-- 
Muli Ben-Yehuda
http://www.mulix.org | http://mulix.livejournal.com/

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: VP problematic for backend drivers on IA64?
@ 2006-01-20 17:08 Magenheimer, Dan (HP Labs Fort Collins)
  2006-01-20 22:17 ` Muli Ben-Yehuda
  0 siblings, 1 reply; 14+ messages in thread
From: Magenheimer, Dan (HP Labs Fort Collins) @ 2006-01-20 17:08 UTC (permalink / raw)
  To: Muli Ben-Yehuda; +Cc: xen-devel, okrieg

Hi Muli --

I'm cc'ing the xen-ia64-devel list as many of the
Xen/ia64 team don't keep up with xen-devel...

Side note for anyone new to following this thread:
The terms P2M, P==M, and VP are as defined in
http://lists.xensource.com/archives/html/xen-devel/2006-01/msg00184.html

The backend drivers have a lot of code that assume P2M.
Blkback has been "ported" to handle P==M but netback
never was.  Neither has been "ported" to VP yet so there
is some work to do.  It may turn out to be easy (e.g.
#define'ing a few macros to be no-ops).  However, there's
likely to be some subtle changes too as there was for P==M.

But the real problem is not really in the backend drivers,
it is in the lower layers of the driver stack that the
backend drivers sit on top of.  VP means that the machine
addresses are hidden to the domain.  But domain0 (and
future driver domains) still need to program DMA-capable
devices, both for any domain0 I/O and for I/O on behalf
of domU's (via blkfront/blkback).  Thus, domain0 cannot
really be fully VP.

I think what we discussed at the summit was a modified form
of VP which is somewhere between VP and P2M.  All RAM
addressing is VP, but all device addressing needs to be
P2M.   It was observed that since an IOMMU intercepts all
device addressing (and only device addressing), by ensuring
that domain0 (and any driver domain) only has device
addressing via a "software IOMMU", the problem should be
solved.

That just about exhausts my expertise in this area, so
others can feel free to jump in (and please correct my
mistakes).

Dan

> -----Original Message-----
> From: Muli Ben-Yehuda [mailto:mulix@mulix.org] 
> Sent: Thursday, January 19, 2006 6:55 PM
> To: Magenheimer, Dan (HP Labs Fort Collins)
> Cc: xen-devel; okrieg@us.ibm.com
> Subject: VP problematic for backend drivers on IA64?
> 
> Hi Dan,
> 
> I understand that during the IA64 session at the summit there was some
> discussion on VP being problematic for the current backend drivers (or
> the other way around), and IOMMUs were suggested as a possible
> solution. Could you please elaborate on what's the problem?
> 
> Thanks,
> Muli
> -- 
> Muli Ben-Yehuda
> http://www.mulix.org | http://mulix.livejournal.com/
> 
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: VP problematic for backend drivers on IA64?
@ 2006-01-22 22:45 Magenheimer, Dan (HP Labs Fort Collins)
  0 siblings, 0 replies; 14+ messages in thread
From: Magenheimer, Dan (HP Labs Fort Collins) @ 2006-01-22 22:45 UTC (permalink / raw)
  To: Muli Ben-Yehuda; +Cc: xen-ia64-devel, Jon Mason, xen-devel, okrieg

> -----Original Message-----
> From: Muli Ben-Yehuda [mailto:mulix@mulix.org] 
> Sent: Friday, January 20, 2006 3:17 PM
> To: Magenheimer, Dan (HP Labs Fort Collins)
> Cc: xen-devel; okrieg@us.ibm.com; Jon Mason
> Subject: Re: VP problematic for backend drivers on IA64?
> 
> On Fri, Jan 20, 2006 at 09:08:21AM -0800, Magenheimer, Dan 
> (HP Labs Fort Collins) wrote:
> > Hi Muli --
> > 
> > I'm cc'ing the xen-ia64-devel list as many of the
> > Xen/ia64 team don't keep up with xen-devel...
> 
> Actually, you didn't :-)

Oops!  For anyone on xen-ia64-devel wanting to catch up on this thread:

http://lists.xensource.com/archives/html/xen-devel/2006-01/msg00492.html
http://lists.xensource.com/archives/html/xen-devel/2006-01/msg00507.html



> > The backend drivers have a lot of code that assume P2M.
> > Blkback has been "ported" to handle P==M but netback
> > never was.  Neither has been "ported" to VP yet so there
> > is some work to do.  It may turn out to be easy (e.g.
> > #define'ing a few macros to be no-ops).  However, there's
> > likely to be some subtle changes too as there was for P==M.
> 
> Where can I find the diff for blkback to work P==M? is this integrated
> into xen-unstable or is it in the IA64 tree?

It is all checked in to xen-unstable.  (The xen-ia64-unstable tree is
sync'ed roughly weekly with xen-unstable.)

> > But the real problem is not really in the backend drivers,
> > it is in the lower layers of the driver stack that the
> > backend drivers sit on top of.  VP means that the machine
> > addresses are hidden to the domain.  But domain0 (and
> > future driver domains) still need to program DMA-capable
> > devices, both for any domain0 I/O and for I/O on behalf
> > of domU's (via blkfront/blkback).  Thus, domain0 cannot
> > really be fully VP.
> 
> Linux provides the DMA-API abstraction, so that drivers do not need to
> be aware of the deails of translating from a guest-physical address to
> a bus address (akak machine address). Theoretically, a DMA-API
> implementation is the only part of the dom0 Linux kernel that would
> need to know to read the P2M table (P2M) or do nothing (P=M) or call
> into Xen to get the tanslation (VP without IOMMU) or call into Xen to
> establish an IOMMU mapping (VP w/ IOMMU).

Yes, unless there are legacy drivers/devices that circumvent the
DMA interface.  I don't know if this is the case on some/many/all
Linux/ia64 configurations... perhaps someone with more familiarity
with a broad range of Linux/ia64 configurations can comment?  I
would be concerned with, for example, IDE, GART, VGA, console...?

> > I think what we discussed at the summit was a modified form
> > of VP which is somewhere between VP and P2M.  All RAM
> > addressing is VP, but all device addressing needs to be
> > P2M.   It was observed that since an IOMMU intercepts all
> > device addressing (and only device addressing), by ensuring
> > that domain0 (and any driver domain) only has device
> > addressing via a "software IOMMU", the problem should be
> > solved.
> 
> Unless the machine has a real HW IOMMU, the device must see bus
> addresses, which means the driver must pass it bus addresses. The
> "virtual IOMMU" therefore becomes a DMA-API implementation which calls
> into Xen for P->Bus translation.

OK.

> > That just about exhausts my expertise in this area, so
> > others can feel free to jump in (and please correct my
> > mistakes).
> 
> I think it makes sense. Does IA64 already implement VP dom0? are there
> any plans for x86(-64) VP dom0?

No, Xen/ia64 domain0 has always been P==M, though some hypervisor
code written prior to booting on hardware (back when it only ran
on a simulator) under an ifdef may be resurrected that supports
VP dom0.

> Cheers,
> Muli
> -- 
> Muli Ben-Yehuda

Thanks!
Dan

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: VP problematic for backend drivers on IA64?
@ 2006-01-24 23:42 Ian Pratt
  0 siblings, 0 replies; 14+ messages in thread
From: Ian Pratt @ 2006-01-24 23:42 UTC (permalink / raw)
  To: Muli Ben-Yehuda, Magenheimer, Dan (HP Labs Fort Collins)
  Cc: xen-devel, okrieg

 
> I understand that during the IA64 session at the summit there 
> was some discussion on VP being problematic for the current 
> backend drivers (or the other way around), and IOMMUs were 
> suggested as a possible solution. Could you please elaborate 
> on what's the problem?

It's simply that the actual DMA operations need to use machine
addresses. Ideally, you'd use an iommu to translate/partition, but in
the absence of an iommu simply enabling a privileged domain to read its
p2m table and translate the pfn to an mfn is sufficient. 

Ian

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: VP problematic for backend drivers on IA64?
@ 2006-01-25  0:02 Magenheimer, Dan (HP Labs Fort Collins)
  2006-01-25  0:16 ` Muli Ben-Yehuda
  0 siblings, 1 reply; 14+ messages in thread
From: Magenheimer, Dan (HP Labs Fort Collins) @ 2006-01-25  0:02 UTC (permalink / raw)
  To: Ian Pratt, Muli Ben-Yehuda; +Cc: xen-ia64-devel, xen-devel, okrieg

>translate the pfn to an mfn is sufficient

Actually, after thinking about this, it's a bit
more complicated because of the possibility that a DMA may
address more than one page.  If so, a simple DMA may need to be
translated into a scatter-gather (or a scatter-gather into
a more complex scatter-gather).

Not impossible, obviously because Xen/x86 handles this -- by
changing Linux, correct?

Do hardware IOMMU's in general handle this complication?
E.g. is there a cleanly defined interface that can be applied
to a VP domain "Xen IOMMU"?

Dan

> -----Original Message-----
> From: Ian Pratt [mailto:m+Ian.Pratt@cl.cam.ac.uk] 
> Sent: Tuesday, January 24, 2006 4:43 PM
> To: Muli Ben-Yehuda; Magenheimer, Dan (HP Labs Fort Collins)
> Cc: xen-devel; okrieg@us.ibm.com; ian.pratt@cl.cam.ac.uk
> Subject: RE: [Xen-devel] VP problematic for backend drivers on IA64?
> 
>  
> > I understand that during the IA64 session at the summit there 
> > was some discussion on VP being problematic for the current 
> > backend drivers (or the other way around), and IOMMUs were 
> > suggested as a possible solution. Could you please elaborate 
> > on what's the problem?
> 
> It's simply that the actual DMA operations need to use machine
> addresses. Ideally, you'd use an iommu to translate/partition, but in
> the absence of an iommu simply enabling a privileged domain 
> to read its
> p2m table and translate the pfn to an mfn is sufficient. 
> 
> Ian
> 

^ permalink raw reply	[flat|nested] 14+ messages in thread
* RE: VP problematic for backend drivers on IA64?
@ 2006-01-25  1:35 Ian Pratt
  0 siblings, 0 replies; 14+ messages in thread
From: Ian Pratt @ 2006-01-25  1:35 UTC (permalink / raw)
  To: Muli Ben-Yehuda, Magenheimer, Dan (HP Labs Fort Collins)
  Cc: xen-ia64-devel, xen-devel, okrieg

 
> > Actually, after thinking about this, it's a bit more complicated 
> > because of the possibility that a DMA may address more than 
> one page.  
> > If so, a simple DMA may need to be translated into a scatter-gather 
> > (or a scatter-gather into a more complex scatter-gather).
> > 
> > Not impossible, obviously because Xen/x86 handles this -- 
> by changing 
> > Linux, correct?
> 
> Correct. Specifically, it's handled by Xen's version of swiotlb.c.

swiotlb just handles the rare cases where things straddle a page. Other
modifications we've made try to avoid this happening (preventing block
request merging across boundries that aren't machine and phys
contiguous, skb slab cache).

> > Do hardware IOMMU's in general handle this complication?
> 
> Yes. You can use a HW IOMMU to map a scatter-gather list of 
> machine pages into a contigous range in the IO space. It can 
> also do the reverse, but that's less interesting.
> 
> > E.g. is there a cleanly defined interface that can be 
> applied to a VP 
> > domain "Xen IOMMU"?

The existing linux one will suffice.

Ian

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-01-25 17:54 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-01-20  1:55 VP problematic for backend drivers on IA64? Muli Ben-Yehuda
2006-01-25 10:29 ` Gerd Hoffmann
2006-01-25 14:37   ` Muli Ben-Yehuda
2006-01-25 16:24     ` Gerd Hoffmann
2006-01-25 16:46       ` Muli Ben-Yehuda
2006-01-25 16:56         ` Keir Fraser
2006-01-25 17:54           ` Muli Ben-Yehuda
  -- strict thread matches above, loose matches on Subject: below --
2006-01-20 17:08 Magenheimer, Dan (HP Labs Fort Collins)
2006-01-20 22:17 ` Muli Ben-Yehuda
2006-01-22 22:45 Magenheimer, Dan (HP Labs Fort Collins)
2006-01-24 23:42 Ian Pratt
2006-01-25  0:02 Magenheimer, Dan (HP Labs Fort Collins)
2006-01-25  0:16 ` Muli Ben-Yehuda
2006-01-25  1:35 Ian Pratt

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.