13 Dec, 2018

1 commit

  • commit 7d63fb3af87aa67aa7d24466e792f9d7c57d8e79 upstream.

    This removes needless use of '%p', and refactors the printk calls to
    use pr_*() helpers instead.

    Signed-off-by: Kees Cook
    Reviewed-by: Konrad Rzeszutek Wilk
    Signed-off-by: Christoph Hellwig
    [bwh: Backported to 4.14:
    - Adjust filename
    - Remove "swiotlb: " prefix from an additional log message]
    Signed-off-by: Ben Hutchings
    Signed-off-by: Sasha Levin

    Kees Cook
     

22 Feb, 2018

1 commit

  • commit d0bc0c2a31c95002d37c3cc511ffdcab851b3256 upstream.

    TTM tries to allocate coherent memory in chunks of 2MB first to improve
    TLB efficiency and falls back to allocating 4K pages if that fails.

    Suppress the warning when the 2MB allocations fails since there is a
    valid fall back path.

    Signed-off-by: Christian König
    Reported-by: Mike Galbraith
    Acked-by: Konrad Rzeszutek Wilk
    Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104082
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Greg Kroah-Hartman

    Christian König
     

18 Jul, 2017

2 commits

  • Add warnings to let the user know when bounce buffers are being used for
    DMA when SME is active. Since the bounce buffers are not in encrypted
    memory, these notifications are to allow the user to determine some
    appropriate action - if necessary. Actions can range from utilizing an
    IOMMU, replacing the device with another device that can support 64-bit
    DMA, ignoring the message if the device isn't used much, etc.

    Signed-off-by: Tom Lendacky
    Reviewed-by: Thomas Gleixner
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Brijesh Singh
    Cc: Dave Young
    Cc: Dmitry Vyukov
    Cc: Jonathan Corbet
    Cc: Konrad Rzeszutek Wilk
    Cc: Larry Woodman
    Cc: Linus Torvalds
    Cc: Matt Fleming
    Cc: Michael S. Tsirkin
    Cc: Paolo Bonzini
    Cc: Peter Zijlstra
    Cc: Radim Krčmář
    Cc: Rik van Riel
    Cc: Toshimitsu Kani
    Cc: kasan-dev@googlegroups.com
    Cc: kvm@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-doc@vger.kernel.org
    Cc: linux-efi@vger.kernel.org
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/d112564053c3f2e86ca634a8d4fa4abc0eb53a6a.1500319216.git.thomas.lendacky@amd.com
    Signed-off-by: Ingo Molnar

    Tom Lendacky
     
  • Since DMA addresses will effectively look like 48-bit addresses when the
    memory encryption mask is set, SWIOTLB is needed if the DMA mask of the
    device performing the DMA does not support 48-bits. SWIOTLB will be
    initialized to create decrypted bounce buffers for use by these devices.

    Signed-off-by: Tom Lendacky
    Reviewed-by: Thomas Gleixner
    Cc: Alexander Potapenko
    Cc: Andrey Ryabinin
    Cc: Andy Lutomirski
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Brijesh Singh
    Cc: Dave Young
    Cc: Dmitry Vyukov
    Cc: Jonathan Corbet
    Cc: Konrad Rzeszutek Wilk
    Cc: Larry Woodman
    Cc: Linus Torvalds
    Cc: Matt Fleming
    Cc: Michael S. Tsirkin
    Cc: Paolo Bonzini
    Cc: Peter Zijlstra
    Cc: Radim Krčmář
    Cc: Rik van Riel
    Cc: Toshimitsu Kani
    Cc: kasan-dev@googlegroups.com
    Cc: kvm@vger.kernel.org
    Cc: linux-arch@vger.kernel.org
    Cc: linux-doc@vger.kernel.org
    Cc: linux-efi@vger.kernel.org
    Cc: linux-mm@kvack.org
    Link: http://lkml.kernel.org/r/aa2d29b78ae7d508db8881e46a3215231b9327a7.1500319216.git.thomas.lendacky@amd.com
    Signed-off-by: Ingo Molnar

    Tom Lendacky
     

16 Jan, 2017

1 commit

  • Some drivers do depend on page mappings to be page aligned.

    Swiotlb already enforces such alignment for mappings greater than page,
    extend that to page-sized mappings as well.

    Without this fix, nvme hits BUG() in nvme_setup_prps(), because that routine
    assumes page-aligned mappings.

    Signed-off-by: Nikita Yushchenko
    Reviewed-by: Christoph Hellwig
    Reviewed-by: Sagi Grimberg
    Signed-off-by: Konrad Rzeszutek Wilk

    Nikita Yushchenko
     

07 Jan, 2017

1 commit

  • So they can figure out what is the optimal number of pages
    that can be contingously stitched together without fear of
    bounce buffer.

    We also expose an mechanism for sub-users of SWIOTLB API, such
    as Xen-SWIOTLB to set the max segment value. And lastly
    if swiotlb=force is set (which mandates we bounce buffer everything)
    we set max_segment so at least we can bounce buffer one 4K page
    instead of a giant 512KB one for which we may not have space.

    Signed-off-by: Konrad Rzeszutek Wilk
    Reported-and-Tested-by: Juergen Gross

    Konrad Rzeszutek Wilk
     

19 Dec, 2016

2 commits

  • On architectures like arm64, swiotlb is tied intimately to the core
    architecture DMA support. In addition, ZONE_DMA cannot be disabled.

    To aid debugging and catch devices not supporting DMA to memory outside
    the 32-bit address space, add a kernel command line option
    "swiotlb=noforce", which disables the use of bounce buffers.
    If specified, trying to map memory that cannot be used with DMA will
    fail, and a rate-limited warning will be printed.

    Note that io_tlb_nslabs is set to 1, which is the minimal supported
    value.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Konrad Rzeszutek Wilk

    Geert Uytterhoeven
     
  • Convert the flag swiotlb_force from an int to an enum, to prepare for
    the advent of more possible values.

    Suggested-by: Konrad Rzeszutek Wilk
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Konrad Rzeszutek Wilk

    Geert Uytterhoeven
     

11 Nov, 2016

1 commit

  • I am updating the paths so that instead of trying to pass
    "attr | DMA_ATTR_SKIP_CPU_SYNC" we instead just OR the value into attr and
    then pass it since attr will not be used after we make the unmap call.

    I realized there was one spot I had missed when I was applying the DMA
    attribute to the DMA mapping exception handling. This change corrects that.

    Finally it looks like there is a stray blank line at the end of the
    swiotlb_unmap_sg_attrs function that can be dropped.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Konrad Rzeszutek Wilk

    Alexander Duyck
     

08 Nov, 2016

3 commits


04 Aug, 2016

1 commit

  • The dma-mapping core and the implementations do not change the DMA
    attributes passed by pointer. Thus the pointer can point to const data.
    However the attributes do not have to be a bitfield. Instead unsigned
    long will do fine:

    1. This is just simpler. Both in terms of reading the code and setting
    attributes. Instead of initializing local attributes on the stack
    and passing pointer to it to dma_set_attr(), just set the bits.

    2. It brings safeness and checking for const correctness because the
    attributes are passed by value.

    Semantic patches for this change (at least most of them):

    virtual patch
    virtual context

    @r@
    identifier f, attrs;

    @@
    f(...,
    - struct dma_attrs *attrs
    + unsigned long attrs
    , ...)
    {
    ...
    }

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    and

    // Options: --all-includes
    virtual patch
    virtual context

    @r@
    identifier f, attrs;
    type t;

    @@
    t f(..., struct dma_attrs *attrs);

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.com
    Signed-off-by: Krzysztof Kozlowski
    Acked-by: Vineet Gupta
    Acked-by: Robin Murphy
    Acked-by: Hans-Christian Noren Egtvedt
    Acked-by: Mark Salter [c6x]
    Acked-by: Jesper Nilsson [cris]
    Acked-by: Daniel Vetter [drm]
    Reviewed-by: Bart Van Assche
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Fabien Dessenne [bdisp]
    Reviewed-by: Marek Szyprowski [vb2-core]
    Acked-by: David Vrabel [xen]
    Acked-by: Konrad Rzeszutek Wilk [xen swiotlb]
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Richard Kuo [hexagon]
    Acked-by: Geert Uytterhoeven [m68k]
    Acked-by: Gerald Schaefer [s390]
    Acked-by: Bjorn Andersson
    Acked-by: Hans-Christian Noren Egtvedt [avr32]
    Acked-by: Vineet Gupta [arc]
    Acked-by: Robin Murphy [arm64 and dma-iommu]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Kozlowski
     

26 Jun, 2015

1 commit


11 Jun, 2015

1 commit

  • Print a warning when all allocation tries have been failed
    and the function is about to return NULL.

    This prepares for calling the function with __GFP_NOWARN to
    suppress allocation failure warnings before all fall-backs
    have failed - which we'll do to improve kdump behavior.

    Signed-off-by: Joerg Roedel
    Signed-off-by: Borislav Petkov
    Acked-by: Konrad Rzeszutek Wilk
    Acked-by: Baoquan He
    Cc: Andrew Morton
    Cc: Andy Lutomirski
    Cc: Borislav Petkov
    Cc: Brian Gerst
    Cc: Dave Young
    Cc: Denys Vlasenko
    Cc: H. Peter Anvin
    Cc: Jörg Rödel
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: Vivek Goyal
    Cc: kexec@lists.infradead.org
    Link: http://lkml.kernel.org/r/1433500202-25531-2-git-send-email-joro@8bytes.org
    Signed-off-by: Ingo Molnar

    Joerg Roedel
     

06 Jun, 2015

1 commit

  • The map_single() function is not defined as static, even though it
    doesn't seem to be used anywhere else in the kernel. Make it static to
    avoid namespace pollution since this is a rather generic symbol.

    Signed-off-by: Alexandre Courbot
    Signed-off-by: Konrad Rzeszutek Wilk

    Alexandre Courbot
     

06 May, 2015

1 commit


21 Jun, 2014

1 commit

  • In 2.6.29 io_tlb_orig_addr[] got converted from storing virtual addresses
    to storing physical ones. While checking virtual addresses against NULL
    is a legitimate thing to catch invalid entries, checking physical ones
    against zero isn't: There's no guarantee that PFN 0 is reserved on a
    particular platform.

    Since it is unclear whether the check in swiotlb_tbl_unmap_single() is
    actually needed, retain it but check against a guaranteed invalid physical
    address. This requires setting up the array in a suitable fashion. And
    since the original code failed to invalidate array entries when regions
    get unmapped, this is being fixed at once along with adding a similar
    check to swiotlb_tbl_sync_single().

    Obviously the less intrusive change would be to simply drop the check in
    swiotlb_tbl_unmap_single().

    Signed-off-by: Jan Beulich
    Signed-off-by: Konrad Rzeszutek Wilk

    Jan Beulich
     

05 Jun, 2014

1 commit

  • The DMA Contiguous Memory Allocator support on x86 is disabled when
    swiotlb config option is enabled. So DMA CMA is always disabled on
    x86_64 because swiotlb is always enabled. This attempts to support for
    DMA CMA with enabling swiotlb config option.

    The contiguous memory allocator on x86 is integrated in the function
    dma_generic_alloc_coherent() which is .alloc callback in nommu_dma_ops
    for dma_alloc_coherent().

    x86_swiotlb_alloc_coherent() which is .alloc callback in swiotlb_dma_ops
    tries to allocate with dma_generic_alloc_coherent() firstly and then
    swiotlb_alloc_coherent() is called as a fallback.

    The main part of supporting DMA CMA with swiotlb is that changing
    x86_swiotlb_free_coherent() which is .free callback in swiotlb_dma_ops
    for dma_free_coherent() so that it can distinguish memory allocated by
    dma_generic_alloc_coherent() from one allocated by
    swiotlb_alloc_coherent() and release it with dma_generic_free_coherent()
    which can handle contiguous memory. This change requires making
    is_swiotlb_buffer() global function.

    This also needs to change .free callback in the dma_map_ops for amd_gart
    and sta2x11, because these dma_ops are also using
    dma_generic_alloc_coherent().

    Signed-off-by: Akinobu Mita
    Acked-by: Marek Szyprowski
    Acked-by: Konrad Rzeszutek Wilk
    Cc: David Woodhouse
    Cc: Don Dutile
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Andi Kleen
    Cc: Yinghai Lu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     

28 Jan, 2014

2 commits

  • The new memblock_virt APIs are used to replaced old bootmem API.

    We need to allocate page below 4G for swiotlb.

    That should fix regression on Andrew's system that is using swiotlb.

    Signed-off-by: Yinghai Lu
    Cc: Russell King
    Cc: Konrad Rzeszutek Wilk
    Acked-by: Santosh Shilimkar
    Cc: Dave Hansen
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Yinghai Lu
     
  • …kernel/git/konrad/swiotlb

    Pull swiotlb bug-fixes from Konrad Rzeszutek Wilk:
    - Don't DoS with 'swiotlb is full' message.
    - Documentation update.

    * tag 'stable/for-linus-3.14-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb:
    swiotlb: Don't DoS us with 'swiotlb buffer is full' (v2)
    swiotlb: update format

    Linus Torvalds
     

22 Jan, 2014

1 commit

  • Switch to memblock interfaces for early memory allocator instead of
    bootmem allocator. No functional change in beahvior than what it is in
    current code from bootmem users points of view.

    Archs already converted to NO_BOOTMEM now directly use memblock
    interfaces instead of bootmem wrappers build on top of memblock. And
    the archs which still uses bootmem, these new apis just fallback to
    exiting bootmem APIs.

    Signed-off-by: Santosh Shilimkar
    Cc: "Rafael J. Wysocki"
    Cc: Arnd Bergmann
    Cc: Christoph Lameter
    Cc: Greg Kroah-Hartman
    Cc: Grygorii Strashko
    Cc: H. Peter Anvin
    Cc: Johannes Weiner
    Cc: KAMEZAWA Hiroyuki
    Cc: Konrad Rzeszutek Wilk
    Cc: Michal Hocko
    Cc: Paul Walmsley
    Cc: Pavel Machek
    Cc: Russell King
    Cc: Tejun Heo
    Cc: Tony Lindgren
    Cc: Yinghai Lu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Santosh Shilimkar
     

07 Jan, 2014

1 commit


09 Nov, 2013

1 commit

  • * stefano/swiotlb-xen-9.1:
    swiotlb-xen: fix error code returned by xen_swiotlb_map_sg_attrs
    swiotlb-xen: static inline xen_phys_to_bus, xen_bus_to_phys, xen_virt_to_bus and range_straddles_page_boundary
    grant-table: call set_phys_to_machine after mapping grant refs
    arm,arm64: do not always merge biovec if we are running on Xen
    swiotlb: print a warning when the swiotlb is full
    swiotlb-xen: use xen_dma_map/unmap_page, xen_dma_sync_single_for_cpu/device
    xen: introduce xen_dma_map/unmap_page and xen_dma_sync_single_for_cpu/device
    swiotlb-xen: use xen_alloc/free_coherent_pages
    xen: introduce xen_alloc/free_coherent_pages
    arm64/xen: get_dma_ops: return xen_dma_ops if we are running as xen_initial_domain
    arm/xen: get_dma_ops: return xen_dma_ops if we are running as xen_initial_domain
    swiotlb-xen: introduce xen_swiotlb_set_dma_mask
    xen/arm,arm64: enable SWIOTLB_XEN
    xen: make xen_create_contiguous_region return the dma address
    xen/x86: allow __set_phys_to_machine for autotranslate guests
    arm/xen,arm64/xen: introduce p2m
    arm64: define DMA_ERROR_CODE
    arm: make SWIOTLB available

    Signed-off-by: Konrad Rzeszutek Wilk

    Conflicts:
    arch/arm/include/asm/dma-mapping.h
    drivers/xen/swiotlb-xen.c

    [Conflicts arose b/c "arm: make SWIOTLB available" v8 was in Stefano's
    branch, while I had v9 + Ack from Russel. I also fixed up white-space
    issues]

    Konrad Rzeszutek Wilk
     

25 Oct, 2013

1 commit


24 Oct, 2013

1 commit

  • Tracepoints are only created when Xen support is enabled, but they are
    also referenced within lib/swiotlb.c. So unless Xen support is enabled
    the tracepoints will be missing, therefore causing builds to fail. Fix
    this by moving the tracepoint creation to lib/swiotlb.c, which works
    nicely because the Xen swiotlb support selects the generic swiotlb
    support.

    Signed-off-by: Thierry Reding
    Signed-off-by: Konrad Rzeszutek Wilk

    Thierry Reding
     

03 Oct, 2013

1 commit

  • Ftrace is currently not able to detect when SWIOTLB has to do double buffering.
    Under Xen you can only see it indirectly in function_graph, when
    xen_swiotlb_map_page() doesn't stop after range_straddles_page_boundary(), but
    calls spinlock functions, memcpy() and xen_phys_to_bus() as well. This patch
    introduces the swiotlb:swiotlb_bounced event, which also prints out the
    following informations to help you find out why bouncing happened:

    dev_name: 0000:08:00.0 dma_mask=ffffffffffffffff dev_addr=9149f000 size=32768
    swiotlb_force=0

    If you use Xen, and (dev_addr + size + 1) > dma_mask, the buffer is out of the
    device's DMA range. If swiotlb_force == 1, you should really change the kernel
    parameters. Otherwise, the buffer is not contiguous in mfn space.

    Signed-off-by: Zoltan Kiss
    [v1: Don't print 'swiotlb_force=X', just print swiotlb_force if it is enabled]
    Signed-off-by: Konrad Rzeszutek Wilk

    Zoltan Kiss
     

09 Aug, 2013

1 commit


18 Apr, 2013

1 commit

  • Chao said that kdump does does work well on his system on 3.8
    without extra parameter, even iommu does not work with kdump.
    And now have to append crashkernel_low=Y in first kernel to make
    kdump work.

    We have now modified crashkernel=X to allocate memory beyong 4G (if
    available) and do not allocate low range for crashkernel if the user
    does not specify that with crashkernel_low=Y. This causes regression
    if iommu is not enabled. Without iommu, swiotlb needs to be setup in
    first 4G and there is no low memory available to second kernel.

    Set crashkernel_low automatically if the user does not specify that.

    For system that does support IOMMU with kdump properly, user could
    specify crashkernel_low=0 to save that 72M low ram.

    -v3: add swiotlb_size() according to Konrad.
    -v4: add comments what 8M is for according to hpa.
    also update more crashkernel_low= in kernel-parameters.txt
    -v5: update changelog according to Vivek.
    -v6: Change description about swiotlb referring according to HATAYAMA.

    Reported-by: WANG Chao
    Tested-by: WANG Chao
    Signed-off-by: Yinghai Lu
    Link: http://lkml.kernel.org/r/1366089828-19692-2-git-send-email-yinghai@kernel.org
    Acked-by: Vivek Goyal
    Signed-off-by: H. Peter Anvin

    Yinghai Lu
     

30 Jan, 2013

1 commit

  • Normal boot path on system with iommu support:
    swiotlb buffer will be allocated early at first and then try to initialize
    iommu, if iommu for intel or AMD could setup properly, swiotlb buffer
    will be freed.

    The early allocating is with bootmem, and could panic when we try to use
    kdump with buffer above 4G only, or with memmap to limit mem under 4G.
    for example: memmap=4095M$1M to remove memory under 4G.

    According to Eric, add _nopanic version and no_iotlb_memory to fail
    map single later if swiotlb is still needed.

    -v2: don't pass nopanic, and use -ENOMEM return value according to Eric.
    panic early instead of using swiotlb_full to panic...according to Eric/Konrad.
    -v3: make swiotlb_init to be notpanic, but will affect:
    arm64, ia64, powerpc, tile, unicore32, x86.
    -v4: cleanup swiotlb_init by removing swiotlb_init_with_default_size.

    Suggested-by: Eric W. Biederman
    Signed-off-by: Yinghai Lu
    Link: http://lkml.kernel.org/r/1359058816-7615-36-git-send-email-yinghai@kernel.org
    Reviewed-and-tested-by: Konrad Rzeszutek Wilk
    Cc: Joerg Roedel
    Cc: Ralf Baechle
    Cc: Jeremy Fitzhardinge
    Cc: Kyungmin Park
    Cc: Marek Szyprowski
    Cc: Arnd Bergmann
    Cc: Andrzej Pietrasiewicz
    Cc: linux-mips@linux-mips.org
    Cc: xen-devel@lists.xensource.com
    Cc: virtualization@lists.linux-foundation.org
    Cc: Shuah Khan
    Signed-off-by: H. Peter Anvin

    Yinghai Lu
     

30 Oct, 2012

7 commits

  • Currently swiotlb is the only consumer for swiotlb_bounce. Since that is the
    case it doesn't make much sense to be exporting it so make it a static
    function only.

    In addition we can save a few more lines of code by making it so that it
    accepts the DMA address as a physical address instead of a virtual one. This
    is the last piece in essentially pushing all of the DMA address values to use
    physical addresses in swiotlb.

    In order to clarify things since we now have 2 physical addresses in use
    inside of swiotlb_bounce I am renaming phys to orig_addr, and dma_addr to
    tlb_addr. This way is should be clear that orig_addr is contained within
    io_orig_addr and tlb_addr is an address within the io_tlb_addr buffer.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Konrad Rzeszutek Wilk

    Alexander Duyck
     
  • This change makes it so that the sync functionality also uses physical
    addresses. This helps to further reduce the use of virt_to_phys and
    phys_to_virt functions.

    In order to clarify things since we now have 2 physical addresses in use
    inside of swiotlb_tbl_sync_single I am renaming phys to orig_addr, and
    dma_addr to tlb_addr. This way is should be clear that orig_addr is
    contained within io_orig_addr and tlb_addr is an address within the
    io_tlb_addr buffer.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Konrad Rzeszutek Wilk

    Alexander Duyck
     
  • This change makes it so that the unmap functionality also uses physical
    addresses. This helps to further reduce the use of virt_to_phys and
    phys_to_virt functions.

    In order to clarify things since we now have 2 physical addresses in use
    inside of swiotlb_tbl_unmap_single I am renaming phys to orig_addr, and
    dma_addr to tlb_addr. This way is should be clear that orig_addr is
    contained within io_orig_addr and tlb_addr is an address within the
    io_tlb_addr buffer.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Konrad Rzeszutek Wilk

    Alexander Duyck
     
  • This change makes it so that swiotlb_tbl_map_single will return a physical
    address instead of a virtual address when called. The advantage to this once
    again is that we are avoiding a number of virt_to_phys and phys_to_virt
    translations by working with everything as a physical address.

    One change I had to make in order to support using physical addresses is that
    I could no longer trust 0 to be a invalid physical address on all platforms.
    So instead I made it so that ~0 is returned on error. This should never be a
    valid return value as it implies that only one byte would be available for
    use.

    In order to clarify things since we now have 2 physical addresses in use
    inside of swiotlb_tbl_map_single I am renaming phys to orig_addr, and
    dma_addr to tlb_addr. This way is should be clear that orig_addr is
    contained within io_orig_addr and tlb_addr is an address within the
    io_tlb_addr buffer.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Konrad Rzeszutek Wilk

    Alexander Duyck
     
  • This change makes it so that we can avoid virt_to_phys overhead when using the
    io_tlb_overflow_buffer. My original plan was to completely remove the value
    and replace it with a constant but I had seen that there were recent patches
    that stated this couldn't be done until all device drivers that depended on
    that functionality be updated.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Konrad Rzeszutek Wilk

    Alexander Duyck
     
  • This change replaces all references to the virtual address for io_tlb_start
    with references to the physical address io_tlb_end. The main advantage of
    replacing the virtual address with a physical address is that we can avoid
    having to do multiple translations from the virtual address to the physical
    one needed for testing an existing DMA address.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Konrad Rzeszutek Wilk

    Alexander Duyck
     
  • This change replaces all references to the virtual address for io_tlb_end
    with references to the physical address io_tlb_end. The main advantage of
    replacing the virtual address with a physical address is that we can avoid
    having to do multiple translations from the virtual address to the physical
    one needed for testing an existing DMA address.

    Signed-off-by: Alexander Duyck
    Signed-off-by: Konrad Rzeszutek Wilk

    Alexander Duyck
     

22 Aug, 2012

1 commit


30 May, 2012

1 commit

  • Print swiotlb info in a style consistent with the %pR style used elsewhere
    in the kernel. For example:

    -Placing 64MB software IO TLB between ffff88007a662000 - ffff88007e662000
    -software IO TLB at phys 0x7a662000 - 0x7e662000
    +software IO TLB [mem 0x7a662000-0x7e661fff] (64MB) mapped at [ffff88007a662000-ffff88007e661fff]

    Signed-off-by: Bjorn Helgaas
    Cc: Yinghai Lu
    Cc: Konrad Rzeszutek Wilk
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: Thomas Gleixner
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Bjorn Helgaas
     

25 Mar, 2012

1 commit

  • Pull cleanup of fs/ and lib/ users of module.h from Paul Gortmaker:
    "Fix up files in fs/ and lib/ dirs to only use module.h if they really
    need it.

    These are trivial in scope vs the work done previously. We now have
    things where any few remaining cleanups can be farmed out to arch or
    subsystem maintainers, and I have done so when possible. What is
    remaining here represents the bits that don't clearly lie within a
    single arch/subsystem boundary, like the fs dir and the lib dir.

    Some duplicate includes arising from overlapping fixes from
    independent subsystem maintainer submissions are also quashed."

    Fix up trivial conflicts due to clashes with other include file cleanups
    (including some due to the previous bug.h cleanup pull).

    * tag 'module-for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
    lib: reduce the use of module.h wherever possible
    fs: reduce the use of module.h wherever possible
    includecheck: delete any duplicate instances of module.h

    Linus Torvalds