| 
         
xen-devel
[Xen-devel] Re: [PATCH 18 of 38] x86: unify pci iommu setup and	allow sw
 
On Mon, 2008-11-17 at 12:48 +0900, FUJITA Tomonori wrote:
> On Thu, 13 Nov 2008 11:10:16 -0800
> Jeremy Fitzhardinge <jeremy@xxxxxxxx> wrote:
> 
> > swiotlb on 32 bit will be used by Xen domain 0 support.
> 
> If you want swiotlb on 32 bit, you need more modifications, I think.
Possibly. It currently "Works For Me(tm)", but I should check it over.
> For example, the following code assumes that the mask needs to be
> 64 bits.
The use of unsigned long for the mask is throughout the API and not
simply limited to swiotlb.c. All the callers of dma_set_seg_boundary
(PCI and SCSI subsys it seems) do not use a value >4G anywhere I can
see. Presumably if something was we would see "warning: overflow in
implicit constant conversion" somewhere along the line. If no value is
set then the default is 0xffffffff which is safe on 32 bit.
I suspect that even with PAE addresses above 4G aren't seen very often
due to pre-existing subsystem specific bounce buffers or other existing
limitations (like network buffers being in lowmem).
Perhaps dma_addr_t should be used though?
Ian.
> 
> static void *
> map_single(struct device *hwdev, char *buffer, size_t size, int dir)
> {
>       unsigned long flags;
>       char *dma_addr;
>       unsigned int nslots, stride, index, wrap;
>       int i;
>       unsigned long start_dma_addr;
>       unsigned long mask;
>       unsigned long offset_slots;
>       unsigned long max_slots;
> 
>       mask = dma_get_seg_boundary(hwdev);
>       start_dma_addr = virt_to_bus(io_tlb_start) & mask;
> 
>       offset_slots = ALIGN(start_dma_addr, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;
>       max_slots = mask + 1
>                   ? ALIGN(mask + 1, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT
>                   : 1UL << (BITS_PER_LONG - IO_TLB_SHIFT);
> 
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
 |   
 
| <Prev in Thread] | 
Current Thread | 
[Next in Thread>
 |  
- [Xen-devel] [PATCH 11 of 38] x86: define no-op exit_idle() on 32-bit, (continued)
- [Xen-devel] [PATCH 11 of 38] x86: define no-op exit_idle() on 32-bit, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 12 of 38] xen/dom0: handle acpi lapic parsing in	Xen dom0, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 13 of 38] x86: unstatic mp_find_ioapic so it can	be used elsewhere, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 14 of 38] x86: add mp_find_ioapic_pin, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 15 of 38] x86: unstatic ioapic entry funcs, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 16 of 38] x86: include linux/init.h in	asm/numa_64.h, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 17 of 38] x86: add swiotlb allocation functions, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 19 of 38] x86: add arch specific version of the	swiotlb virt<->bus<->virt functions, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 21 of 38] xen dom0: Initialize xenbus for dom0, Jeremy Fitzhardinge
 
- [Xen-devel] [PATCH 18 of 38] x86: unify pci iommu setup and allow	swiotlb to compile for 32 bit, Jeremy Fitzhardinge
 
  
 
[Xen-devel] [PATCH 20 of 38] xen dom0: Make hvc_xen console work	for dom0, Jeremy Fitzhardinge
[Xen-devel] [PATCH 23 of 38] xen-dom0: only selectively disable cpu	features, Jeremy Fitzhardinge
[Xen-devel] [PATCH 22 of 38] xen dom0: Set up basic IO permissions	for dom0, Jeremy Fitzhardinge
[Xen-devel] [PATCH 26 of 38] xen: forcibly disable PAT support, Jeremy Fitzhardinge
[Xen-devel] [PATCH 24 of 38] xen dom0: Add support for the	platform_ops hypercall, Jeremy Fitzhardinge
 |  
  
 | 
    |