mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Becky Bruce <beckyb@kernel.crashing.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	xen-devel@lists.xensource.com, x86@kernel.org,
	ian.campbell@citrix.com, jbeulich@novell.com,
	joerg.roedel@amd.com,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: Re: [PATCH 00 of 14] swiotlb/x86: lay groundwork for xen dom0 use of swiotlb
Date: Thu, 18 Dec 2008 23:03:05 -0600	[thread overview]
Message-ID: <3853A0F2-F817-4263-9EF9-9A0655BF95CD@kernel.crashing.org> (raw)
In-Reply-To: <20081218210231.GB24271@elte.hu>


On Dec 18, 2008, at 3:02 PM, Ingo Molnar wrote:

>
> * Becky Bruce <beckyb@kernel.crashing.org> wrote:
>
>>> Can you be more specific? What architecture is plan to use highmem
>>> support in swiotlb?
>>
>> 32-bit powerpc needs this support - I was actually about to push a
>> similar set of patches.  We have several processors that support 36  
>> bits
>> of physical address space and do not have any iommu capability.  The
>> rest of the kernel support for those processors is now in place, so
>> swiotlb is the last piece of the puzzle for that to be fully  
>> functional.
>> I need to take a closer look at this series to see exactly what it's
>> doing and how it differs from what I've been testing.
>>
>> So there is another immediate use case, and I'd really hate to see  
>> this
>> code duplicated.  It should be entirely possible to remove the
>> assumption that we can save off the VA of the original buffer,  
>> which is
>> the thing that precludes HIGHMEM support, and still have nice  
>> readable,
>> maintainable code.
>
> you can have a look at Jeremy's current lineup of patches in
> tip/core/iotlb:
>
>   http://people.redhat.com/mingo/tip.git/README
>
> (also integrated into tip/master)
>
> What would be needed to make it suit your usecase too?

Ingo,

I've taken a quick look at the series posted to the list, and they're  
actually very similar to what I've done.  I think there are really  
only 3 fairly minor issues that need to be resolved to make this work  
on ppc:

1) We need to add swiotlb_map/unmap_page calls, as those are part the  
ppc dma_mapping_ops (in fact, we don't have map/unmap_single in the  
dma_mapping_ops struct on ppc anymore - those just call map/ 
unmap_page).  This is really just a matter of moving some code around  
and making some minor changes, as swiotlb_map/unmap_single can call  
swiotlb_map/unmap_page once the args have been converted.  There's a  
patch in my series that should make this pretty obvious.

2) To convert any address to/from a bus address, we also need the  
hwdev pointer passed as an argument since ppc supports a per-device  
offset accessed via the device ptr that is used to calculate the bus  
address.  I'd also given my conversion functions more generic names,  
as it seemed highly likely that these would eventually be useful  
outside of the swiotlb code.

3) powerpc uses enum dma_data_direction for the direction argument to  
its dma_ops, which is, from reading the kernel docs, the correct  
argument type for the DMA API functions.  However, the iotlb/x86/ia64  
code is currently using an int.  This causes a build warning when we  
initialize the dma_ops struct using the swiotlb funcs.  Is there a  
reason for the use of "int" in x86/ia64?  The Right Thing(TM) here  
seems to be to convert those over to using the enum, and I have a big  
patch that starts doing that, but I've probably missed some places.  I  
could instead do some hackery on the ppc side, and leave the other  
platforms alone, but I'd prefer to do it cleanly. Thoughts?

Unfortunately, this is horrible timing for me, as starting tomorrow,  
I'm going to be offline for a week and a half or so in podunk  
Louisiana with essentially no net access.  I can integrate my code  
into your tree and test on PPC as soon as I return to the real world.   
I'll go ahead and post my current patch series for reference, since  
I'm about to disappear - it's not been tested on anything other than  
powerpc (which is all I have for testing - it's highly likely I've  
done something that's bogus on x86), it needs some cleanup, and I've  
only built the entire series on x86_64 (not the individual pieces),  
but it should definitely give you an idea of what we need to make  
things work on ppc - the code is stable running LTP on a 2-core 32-bit  
MPC8641 board with 6GB of RAM.

Cheers,
Becky

  reply	other threads:[~2008-12-19  5:04 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-16 20:17 Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 01 of 14] x86: remove unused iommu_nr_pages Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 02 of 14] swiotlb: allow architectures to override swiotlb pool allocation Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 03 of 14] swiotlb: move some definitions to header Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 04 of 14] swiotlb: consistently use address_needs_mapping everywhere Jeremy Fitzhardinge
2008-12-17  2:48   ` FUJITA Tomonori
2008-12-17  2:51     ` FUJITA Tomonori
2008-12-17 16:43       ` Ian Campbell
2008-12-17 16:40     ` Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 05 of 14] swiotlb: add comment where we handle the overflow of a dma mask on 32 bit Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 06 of 14] swiotlb: allow architectures to override phys<->bus<->phys conversions Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 07 of 14] swiotlb: add arch hook to force mapping Jeremy Fitzhardinge
2008-12-22  5:34   ` FUJITA Tomonori
2008-12-16 20:17 ` [PATCH 08 of 14] swiotlb: factor out copy to/from device Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 09 of 14] swiotlb: support bouncing of HighMem pages Jeremy Fitzhardinge
2008-12-17  2:48   ` FUJITA Tomonori
2008-12-16 20:17 ` [PATCH 10 of 14] swiotlb: consolidate swiotlb info message printing Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 11 of 14] x86: add swiotlb allocation functions Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 12 of 14] x86: unify pci iommu setup and allow swiotlb to compile for 32 bit Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 13 of 14] x86/swiotlb: add default phys<->bus conversion Jeremy Fitzhardinge
2008-12-16 20:17 ` [PATCH 14 of 14] x86/swiotlb: add default swiotlb_arch_range_needs_mapping Jeremy Fitzhardinge
2008-12-16 20:35 ` [PATCH 00 of 14] swiotlb/x86: lay groundwork for xen dom0 use of swiotlb Ingo Molnar
2008-12-17  5:25   ` FUJITA Tomonori
2008-12-17  8:47     ` [PATCH 00 of 14] swiotlb/x86: lay groundwork for xen dom0 useof swiotlb Jan Beulich
2008-12-17 16:51       ` FUJITA Tomonori
2008-12-17 16:31     ` [PATCH 00 of 14] swiotlb/x86: lay groundwork for xen dom0 use of swiotlb Jeremy Fitzhardinge
2008-12-17 16:56       ` FUJITA Tomonori
2008-12-17 18:58         ` Jeremy Fitzhardinge
2008-12-18 13:23           ` Ingo Molnar
2008-12-18 15:45             ` FUJITA Tomonori
2008-12-18 18:17         ` Becky Bruce
2008-12-18 20:09           ` Jeremy Fitzhardinge
2008-12-18 21:02           ` Ingo Molnar
2008-12-19  5:03             ` Becky Bruce [this message]
2008-12-19  7:02               ` Jeremy Fitzhardinge
2008-12-19 14:25                 ` Becky Bruce
2008-12-19 17:48                   ` Jeremy Fitzhardinge
2008-12-19  5:11             ` swiotlb highmem for ppc series Becky Bruce
2008-12-19  5:16               ` Becky Bruce
2008-12-19  5:11             ` [PATCH 01/11] swiotlb: Drop SG_ENT_VIRT_ADDRESS macro Becky Bruce
2008-12-19  5:11             ` [PATCH 02/11] swiotlb: Allow arch to provide address_needs_mapping Becky Bruce
2008-12-19  5:11             ` [PATCH 03/11] swiotlb: Rename SG_ENT_PHYS_ADDRESS to SG_ENT_BUS_ADDRESS Becky Bruce
2008-12-19  5:11             ` [PATCH 04/11] swiotlb: Print physical addr instead of bus addr in info printks Becky Bruce
2008-12-19  5:11             ` [PATCH 05/11] swiotlb: Create virt to/from dma_addr and phys_to_dma_addr funcs Becky Bruce
2008-12-19  5:11             ` [PATCH 06/11] swiotlb: Store phys address in io_tlb_orig_addr array Becky Bruce
2008-12-19 17:39               ` Jeremy Fitzhardinge
2008-12-22  5:34                 ` FUJITA Tomonori
2008-12-19  5:11             ` [PATCH 07/11] swiotlb: Add support for systems with highmem Becky Bruce
2008-12-19 17:46               ` Jeremy Fitzhardinge
2008-12-19 18:12                 ` Becky Bruce
2008-12-19  5:11             ` [PATCH 08/11] ia64/x86/swiotlb: use enum dma_data_direciton in dma_ops Becky Bruce
2008-12-19  5:11             ` [PATCH 09/11] swiotlb: add swiotlb_map/unmap_page Becky Bruce
2008-12-19  2:47           ` [PATCH 00 of 14] swiotlb/x86: lay groundwork for xen dom0 use of swiotlb FUJITA Tomonori
2008-12-19  8:18             ` 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=3853A0F2-F817-4263-9EF9-9A0655BF95CD@kernel.crashing.org \
    --to=beckyb@kernel.crashing.org \
    --cc=benh@kernel.crashing.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=ian.campbell@citrix.com \
    --cc=jbeulich@novell.com \
    --cc=jeremy@goop.org \
    --cc=joerg.roedel@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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®