mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: jeremy@goop.org, x86@kernel.org, linux-kernel@vger.kernel.org,
	xen-devel@lists.xensource.com, gregkh@suse.de, okir@suse.de
Subject: Re: Where do we stand with the Xen patches?
Date: Tue, 19 May 2009 15:03:00 +0200	[thread overview]
Message-ID: <20090519130300.GB6238@elte.hu> (raw)
In-Reply-To: <20090519142626X.fujita.tomonori@lab.ntt.co.jp>


* FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:

> On Mon, 18 May 2009 10:40:52 +0200
> Ingo Molnar <mingo@elte.hu> wrote:
> 
> > 
> > * FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> wrote:
> > 
> > > On Thu, 14 May 2009 12:54:54 -0700
> > > Jeremy Fitzhardinge <jeremy@goop.org> wrote:
> > > 
> > > > Hi Ingo,
> > > > 
> > > > Over the last week or so, I've set out pull requests for the following 
> > > > branches in git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git :
> > > > 
> > > > for-ingo/xen/dom0/core
> > > > 
> > > >     You made two comments about the first post of this set:
> > > > 
> > > >        1. The // comments in the mtrr code.  Now fixed.
> > > >        2. A query about when Xen can support PAT.  In progress; when its
> > > >           done, we can remove the unconditional PAT disable.
> > > > 
> > > > for-ingo/xen/dom0/pci
> > > > for-ingo/xen/dom0/swiotlb
> > > > 
> > > >     Updated with Joerg Roedel, FUJITA Tomonori and Matthew Wilcox's
> > > >     comments,  Acked-by and Reviewed-bys as appropriate.
> > > 
> > > The original code added dom0-specific dma mapping stuff in the 
> > > generic place, which is completely wrong. I asked you to move the 
> > > hacky stuff to Xen-specific code and ack'ed the patchset.
> > > 
> > > But as I said again and again, the dom0 changes to the generic dma 
> > > mapipng code is really ugly and I don't like them at all. I didn't 
> > > ack'ed such changes.
> > 
> > How should it be solved instead? Can you see a clean way to achieve 
> > it? (maybe you already explained it in past threads - if yes then 
> > have you got subject lines or URIs to that?)
> 
> If we really need to merge dom0 support, then dom0 should have the 
> own IOMMU implementation instead of adding any hacks to swiotlb 
> (as I said long time ago). Yeah, there might be some duplication 
> between swiotlb and the Xen IOMMU but IMO it's better to have 
> clean code with some duplication rather than ugly unified code; 
> unification makes sense only if we do cleanly.

Well, but since we merged PowerPC highmem support ... the precedent 
is there already that the swiotlb code can be librarized and 
generalized some more, right?

What is the fundamental difference between a DMA32 device on native 
hardware using lib/swiotlb.c to bounce IO directed to/from a high 
address over buffers in a low, DMA-capable address, and between a 
Xen Dom0 instance using the same functionality to DMA buffers?

The payback is significant: Linux drivers can be used basically 
as-is (as far as their DMA functionality goes) in a Xen dom0 guest.

There's really just two non-standard Xen features compared to the 
PowerPC-highmem use:

 - special allocation

 - non-standard virtual/physical/bus memory translations

The latter is understandable - Xen cannot do the (mostly-) linear 
transformations that (most) platforms can do in their address 
transformation primitives. But other than the non-linearity, it's a 
"mapping" just as much.

The special allocator is arguably a bit of a hack - Xen should 
_probably_ recognize GFP_DMA32 allocations at the page allocator 
level and rearrange buffers there.

So realizing that dom0 _has_ to have guest OS help here, the best 
possible design seems to be to minimalize the Xen cross section to 
Linux, while still keeping it fast enough. And that seems to be 
these two straightforward hooks: 'ready buffers for DMA' and 'map 
addresses'. As long as we'll want to have swiotlb code in the 
kernel, we'll deal with such primitives anyway - so there doesnt 
seem to be a significant mainteinance drag here.

Hm?

	Ingo

  reply	other threads:[~2009-05-19 13:03 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-14 19:54 Jeremy Fitzhardinge
2009-05-15 18:35 ` Ingo Molnar
2009-05-15 19:59   ` Jeremy Fitzhardinge
2009-05-18  1:36 ` FUJITA Tomonori
2009-05-18  1:42   ` Jeremy Fitzhardinge
2009-05-18  8:40   ` Ingo Molnar
2009-05-19  5:27     ` FUJITA Tomonori
2009-05-19 13:03       ` Ingo Molnar [this message]
2009-05-19 15:30         ` FUJITA Tomonori
2009-05-19 15:56           ` Ian Campbell
2009-05-20 17:06             ` Jeremy Fitzhardinge
2009-05-21  8:54               ` FUJITA Tomonori
2009-05-21 10:27                 ` Ian Campbell
2009-05-21 10:28                   ` Ian Campbell
2009-05-21 10:39                     ` FUJITA Tomonori
2009-05-21 11:03                       ` [Xen-devel] " Ian Campbell
2009-05-21 11:08                         ` Ian Campbell
2009-05-21 11:19                         ` FUJITA Tomonori
2009-05-21 11:45                           ` Ian Campbell
2009-05-21 16:15                             ` swiotlb: remove __weak hooks in favour of architecture-specific functions Ian Campbell
2009-05-21 16:19                               ` Ian Campbell
2009-05-21 16:47                               ` Randy Dunlap
2009-05-22  8:55                                 ` Ian Campbell
2009-05-22 11:13                               ` FUJITA Tomonori
2009-05-22 11:43                                 ` Ian Campbell
2009-05-22 11:55                                   ` FUJITA Tomonori
2009-05-22 14:02                                     ` Ian Campbell
2009-05-22 14:24                                       ` FUJITA Tomonori
2009-05-21 16:15                             ` [PATCH] swiotlb: make is_buffer_dma_capable architecture-specific Ian Campbell
2009-05-21 16:15                             ` [PATCH] swiotlb: make range_needs_mapping architecture-specific Ian Campbell
2009-05-22 11:13                               ` FUJITA Tomonori
2009-05-22 11:45                                 ` Ian Campbell
2009-05-21 16:15                             ` [PATCH] swiotlb/xen: update xen for swiotlb_arch_force_mapping changes Ian Campbell
2009-05-21 16:15                             ` [PATCH] swiotlb: make swiotlb allocation functions architecture-specific Ian Campbell
2009-05-22 11:13                               ` FUJITA Tomonori
2009-05-22 11:46                                 ` Ian Campbell
2009-05-21 16:15                             ` [PATCH] swiotlb/xen: update xen for changes to swiotlb allocation interface Ian Campbell
2009-05-21 16:15                             ` [PATCH] swiotlb: make swiotlb phys<->bus translations architecture-specific Ian Campbell
2009-05-22 11:13                               ` FUJITA Tomonori
2009-05-22 11:46                                 ` Ian Campbell
2009-05-21 16:15                             ` [PATCH] swiotlb/xen: update xen swiotlb for phys<->bus API changes Ian Campbell
2009-05-21 17:21                             ` [Xen-devel] Re: Where do we stand with the Xen patches? FUJITA Tomonori
2009-05-21 10:48                 ` Ian Campbell
2009-05-17 18:37 devzero
2009-05-17 19:25 ` david
2009-05-17 19:33   ` Arjan van de Ven
2009-05-17 19:46 devzero
2009-05-18  1:54 ` Jeremy Fitzhardinge
2009-05-19 13:10   ` Chris Mason

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=20090519130300.GB6238@elte.hu \
    --to=mingo@elte.hu \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=gregkh@suse.de \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=okir@suse.de \
    --cc=x86@kernel.org \
    --cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®