public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Cc: jeremy@goop.org, tony.luck@intel.com,
	linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com,
	x86@kernel.org, ian.campbell@citrix.com,
	beckyb@kernel.crashing.org, joerg.roedel@amd.com
Subject: Re: [PATCH 0 of 9] swiotlb: use phys_addr_t for pages
Date: Sun, 28 Dec 2008 11:34:19 +0100	[thread overview]
Message-ID: <20081228103419.GA7128@elte.hu> (raw)
In-Reply-To: <20081228190111H.fujita.tomonori@lab.ntt.co.jp>


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

> > Note that the main complication wasnt even the small variations in 
> > signatures, but the different _semantics_: one dma_mapping_ops 
> > implementation passed in kernel-virtual addresses, the other physical 
> > addresses. Unifying that was invasive and non-trivial, and it can 
> > break
> 
> I guess that you are talking about the dma_map_single difference between 
> x86_32 and x86_64. As far as I know, Only x64_64 uses physical address 
> with dma_map_single.

yes - dma_map_single() has this signature:

 static inline dma_addr_t
 dma_map_single(struct device *hwdev, void *ptr, size_t size, int direction)

on x86 dma_mapping_ops.map_single has this signature:

        dma_addr_t      (*map_single)(struct device *hwdev, phys_addr_t ptr,
                                size_t size, int direction);

ia64 and powerpc uses kernel-virt addresses for map_single(). So there's 
material semantic differences between the dma_mapping_ops implementations.

> > stuff not at the build level but at the runtime level. We can expect 
> > similar complications when done over 20 architectures as well.
> 
> We don't need to touch 20 architectures. We are talking about unifying 
> dma_mapping_ops. Only architectures that need to handle multiple dma 
> mapping operations use the dma_mapping_ops scheme; X86, IA64, POWERPC, 
> SPARC, and PARISC. Unifying X86, IA64 and POWERPC is a must since they 
> actually share dma_mapping_ops.

if it's just dma_mapping_ops - then it's those 3 architectures. But 
there's no reason why the various DMA bouncing implementations in other 
architectures couldnt use the common code - for example couldnt 
arch/arm/common/dmabounce.c use the swiotlb too?

> > But yes, it's all desired. Obviously extending swiotlb to highmem and 
> > using it on xen and powerpc is an essential first step in the 
> > direction of generalizing all this code.
> 
> No, it's not about swiotlb highmem patchset.
> 
> Due to this problem, IA64 and X86_64 share swiotlb in a very hacky way. 
> We added more hacky code due to this problem again when we added VT-d 
> support to IA64.
> 
> This problem has been for long time. We added ugly hacks again and again 
> instead of fixing the root cause.

well the swiotlb highmem patches are what enable xen (and now powerpc too) 
to make full use of the swiotlb dma bouncing facilities. And that gives a 
common platform for unifying all the rest of the lowlevel DMA mapping APIs 
as well.

Without that, the swiotlb code is limited, life is going on in separate 
islands, with everyone doing their own private variations and hacks. We 
would still probably be nowhere with this had Jeremy not sent the highmem 
patches.

	Ingo

  reply	other threads:[~2008-12-28 10:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-22 18:26 [PATCH 0 of 9] swiotlb: use phys_addr_t for pages Jeremy Fitzhardinge
2008-12-22 18:26 ` [PATCH 1 of 9] revert "swiotlb: support bouncing of HighMem pages." Jeremy Fitzhardinge
2008-12-22 18:26 ` [PATCH 2 of 9] revert "swiotlb: factor out copy to/from device." Jeremy Fitzhardinge
2008-12-22 18:26 ` [PATCH 3 of 9] swiotlb: add hwdev to swiotlb_phys_to_bus Jeremy Fitzhardinge
2008-12-22 18:26 ` [PATCH 4 of 9] swiotlb: Drop SG_ENT_VIRT_ADDRESS macro Jeremy Fitzhardinge
2008-12-22 18:26 ` [PATCH 5 of 9] swiotlb: Rename SG_ENT_PHYS_ADDRESS to SG_ENT_BUS_ADDRESS Jeremy Fitzhardinge
2008-12-22 18:26 ` [PATCH 6 of 9] swiotlb: Store phys address in io_tlb_orig_addr array Jeremy Fitzhardinge
2008-12-22 18:26 ` [PATCH 7 of 9] swiotlb: Add support for systems with highmem Jeremy Fitzhardinge
2008-12-22 18:26 ` [PATCH 8 of 9] swiotlb: cleanups to swiotlb_bounce() Jeremy Fitzhardinge
2008-12-22 18:26 ` [PATCH 9 of 9] ia64/x86/swiotlb: use enum dma_data_direciton in dma_ops Jeremy Fitzhardinge
2008-12-22 18:43 ` [PATCH 0 of 9] swiotlb: use phys_addr_t for pages FUJITA Tomonori
2008-12-27 10:48 ` Ingo Molnar
2008-12-27 15:06   ` FUJITA Tomonori
2008-12-28  5:01     ` Jeremy Fitzhardinge
2008-12-28  9:50       ` Ingo Molnar
2008-12-27 16:44   ` FUJITA Tomonori
2008-12-27 16:56     ` Ingo Molnar
2008-12-27 17:03       ` FUJITA Tomonori
2008-12-28  5:29         ` FUJITA Tomonori
2008-12-28  7:30           ` Christoph Hellwig
2008-12-28  9:36             ` FUJITA Tomonori
2008-12-28 21:37             ` Benjamin Herrenschmidt
2008-12-28  9:37           ` Ingo Molnar
2008-12-28 10:02             ` FUJITA Tomonori
2008-12-28 10:34               ` Ingo Molnar [this message]
2008-12-28 11:00                 ` FUJITA Tomonori
2008-12-28 11:56                   ` Ingo Molnar
2008-12-28 12:34                     ` FUJITA Tomonori
2008-12-28 12:49                       ` Ingo Molnar

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=20081228103419.GA7128@elte.hu \
    --to=mingo@elte.hu \
    --cc=beckyb@kernel.crashing.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=ian.campbell@citrix.com \
    --cc=jeremy@goop.org \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.com \
    --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