20 Dec, 2011

1 commit


16 Dec, 2011

1 commit

  • This fixes an odd bug found on a Dell PowerEdge 1850/0RC130
    (BIOS A05 01/09/2006) where all of the modules doing pci_set_dma_mask
    would fail with:

    ata_piix 0000:00:1f.1: enabling device (0005 -> 0007)
    ata_piix 0000:00:1f.1: can't derive routing for PCI INT A
    ata_piix 0000:00:1f.1: BMDMA: failed to set dma mask, falling back to PIO

    The issue was the Xen-SWIOTLB was allocated such as that the end of
    buffer was stradling a page (and also above 4GB). The fix was
    spotted by Kalev Leonid which was to piggyback on git commit
    e79f86b2ef9c0a8c47225217c1018b7d3d90101c "swiotlb: Use page alignment
    for early buffer allocation" which:

    We could call free_bootmem_late() if swiotlb is not used, and
    it will shrink to page alignment.

    So alloc them with page alignment at first, to avoid lose two pages

    And doing that fixes the outstanding issue.

    CC: stable@kernel.org
    Suggested-by: "Kalev, Leonid"
    Reported-and-Tested-by: "Taylor, Neal E"
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

06 Dec, 2011

1 commit


01 Nov, 2011

1 commit


27 Aug, 2011

4 commits

  • The process to swizzle a Machine Frame Number (MFN) is not always
    necessary. Especially if we know that we actually do not have to do it.
    In this patch we check the MFN against the device's coherent
    DMA mask and if the requested page(s) are contingous. If it all checks
    out we will just return the bus addr without doing the memory
    swizzle.

    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     
  • Fix printk() and panic() args [swap them] to fix build warnings:

    drivers/xen/swiotlb-xen.c:201: warning: format '%s' expects type 'char *', but argument 2 has type 'int'
    drivers/xen/swiotlb-xen.c:201: warning: format '%d' expects type 'int', but argument 3 has type 'char *'
    drivers/xen/swiotlb-xen.c:202: warning: format '%s' expects type 'char *', but argument 2 has type 'int'
    drivers/xen/swiotlb-xen.c:202: warning: format '%d' expects type 'int', but argument 3 has type 'char *'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Konrad Rzeszutek Wilk

    Randy Dunlap
     
  • Propagate the baremetal git commit "swiotlb: fix wrong panic"
    (fba99fa38b023224680308a482e12a0eca87e4e1) in the Xen-SWIOTLB version.
    wherein swiotlb's map_page wrongly calls panic() when it can't find
    a buffer fit for device's dma mask. It should return an error instead.

    Devices with an odd dma mask (i.e. under 4G) like b44 network card hit
    this bug (the system crashes):

    http://marc.info/?l=linux-kernel&m=129648943830106&w=2

    If xen-swiotlb returns an error, b44 driver can use the own bouncing
    mechanism.

    CC: stable@kernel.org
    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     
  • We can fail seting up Xen-SWIOTLB if:
    - The host does not have enough contiguous DMA32 memory available
    (can happen on a machine that has fragmented memory from starting,
    stopping many guests).
    - Not enough low memory (almost never happens).

    We retry allocating and exchanging the swath of contiguous memory
    up to three times. Each time we decrease the amount we need - the
    minimum being of 2MB.

    If we compleltly fail, we will print the reason for failure on the Xen
    console on top of doing it to earlyprintk=xen console.

    Signed-off-by: Konrad Rzeszutek Wilk

    Konrad Rzeszutek Wilk
     

10 Jun, 2011

1 commit


07 Jun, 2011

1 commit

  • By default the io_tlb_nslabs is set to zero, and gets set to
    whatever value is passed in via swiotlb_init_with_tbl function.
    The default value passed in is 64MB. However, if the user provides
    the 'swiotlb=' the default value is ignored and
    the value provided by the user is used... Except when the SWIOTLB
    is used under Xen - there the default value of 64MB is used and
    the Xen-SWIOTLB has no mechanism to get the 'io_tlb_nslabs' filled
    out by setup_io_tlb_npages functions. This patch provides a function
    for the Xen-SWIOTLB to call to see if the io_tlb_nslabs is set
    and if so use that value.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: Konrad Rzeszutek Wilk

    FUJITA Tomonori
     

10 Apr, 2011

1 commit


27 Jul, 2010

1 commit

  • This patchset:

    PV guests under Xen are running in an non-contiguous memory architecture.

    When PCI pass-through is utilized, this necessitates an IOMMU for
    translating bus (DMA) to virtual and vice-versa and also providing a
    mechanism to have contiguous pages for device drivers operations (say DMA
    operations).

    Specifically, under Xen the Linux idea of pages is an illusion. It
    assumes that pages start at zero and go up to the available memory. To
    help with that, the Linux Xen MMU provides a lookup mechanism to
    translate the page frame numbers (PFN) to machine frame numbers (MFN)
    and vice-versa. The MFN are the "real" frame numbers. Furthermore
    memory is not contiguous. Xen hypervisor stitches memory for guests
    from different pools, which means there is no guarantee that PFN==MFN
    and PFN+1==MFN+1. Lastly with Xen 4.0, pages (in debug mode) are
    allocated in descending order (high to low), meaning the guest might
    never get any MFN's under the 4GB mark.

    Signed-off-by: Konrad Rzeszutek Wilk
    Acked-by: Jeremy Fitzhardinge
    Cc: FUJITA Tomonori
    Cc: Albert Herranz
    Cc: Ian Campbell

    Konrad Rzeszutek Wilk