<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/powerpc/kernel/iommu.c, branch linux-4.17.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.17.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.17.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-09-01T06:42:54Z</updated>
<entry>
<title>powerpc/iommu: Use permission-specific DEVICE_ATTR variants</title>
<updated>2017-09-01T06:42:54Z</updated>
<author>
<name>Julia Lawall</name>
</author>
<published>2016-10-29T19:37:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8a7aef2cb3dafd2e8560750f4e5ad2cc2d9b1d17'/>
<id>urn:sha1:8a7aef2cb3dafd2e8560750f4e5ad2cc2d9b1d17</id>
<content type='text'>
Use DEVICE_ATTR_RW for read-write attributes.  This simplifies the
source code, improves readbility, and reduces the chance of
inconsistencies.

Signed-off-by: Julia Lawall &lt;Julia.Lawall@lip6.fr&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt; (powerpc)
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/iommu: Avoid undefined right shift in iommu_range_alloc()</title>
<updated>2017-08-15T10:30:58Z</updated>
<author>
<name>Michael Ellerman</name>
</author>
<published>2017-08-08T07:06:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=63b85621d9aa6bdc410f01b22f7821cea3d7bdc6'/>
<id>urn:sha1:63b85621d9aa6bdc410f01b22f7821cea3d7bdc6</id>
<content type='text'>
In iommu_range_alloc() we generate a mask by right shifting ~0,
however if the specified alignment is 0 then we right shift by 64,
which is undefined. UBSAN tells us so:

  UBSAN: Undefined behaviour in ../arch/powerpc/kernel/iommu.c:193:35
  shift exponent 64 is too large for 64-bit type 'long unsigned int'

We can avoid it by instead generating the mask with:

  align_mask = (1ull &lt;&lt; align_order) - 1;

That will also generate an undefined shift if align_order is 64 or
greater, but that shouldn't be a problem for a while.

Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/kernel: Avoid preemption check in iommu_range_alloc()</title>
<updated>2017-08-01T11:49:23Z</updated>
<author>
<name>Victor Aoqui</name>
</author>
<published>2017-07-20T17:26:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=75f327c6b75715f3a090daeb33e05003aaffb010'/>
<id>urn:sha1:75f327c6b75715f3a090daeb33e05003aaffb010</id>
<content type='text'>
Replace the __this_cpu_read() with raw_cpu_read() in
iommu_range_alloc(). Otherwise we get a warning about using
__this_cpu_read() in preemptible code:

  BUG: using __this_cpu_read() in preemptible
  caller is iommu_range_alloc+0xa8/0x3d0

Preemption doesn't need to be disabled since according to the comment
any CPU can safely use any IOMMU pool.

Signed-off-by: Victor Aoqui &lt;victora@linux.vnet.ibm.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc: implement -&gt;mapping_error</title>
<updated>2017-06-28T13:54:33Z</updated>
<author>
<name>Christoph Hellwig</name>
</author>
<published>2017-05-21T12:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6009faa43f804c99b3d8fff94fa1e0692be70358'/>
<id>urn:sha1:6009faa43f804c99b3d8fff94fa1e0692be70358</id>
<content type='text'>
DMA_ERROR_CODE is going to go away, so don't rely on it.  Instead
define a -&gt;mapping_error method for all IOMMU based dma operation
instances.  The direct ops don't ever return an error and don't
need a -&gt;mapping_error method.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>KVM: PPC: iommu: Unify TCE checking</title>
<updated>2017-04-20T01:39:21Z</updated>
<author>
<name>Alexey Kardashevskiy</name>
</author>
<published>2017-03-22T04:21:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b1af23d836f811137d504d14d4cbdd01929dec34'/>
<id>urn:sha1:b1af23d836f811137d504d14d4cbdd01929dec34</id>
<content type='text'>
This reworks helpers for checking TCE update parameters in way they
can be used in KVM.

This should cause no behavioral change.

Signed-off-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Signed-off-by: Paul Mackerras &lt;paulus@ozlabs.org&gt;
</content>
</entry>
<entry>
<title>powerpc/vfio_spapr_tce: Add reference counting to iommu_table</title>
<updated>2017-03-30T10:42:11Z</updated>
<author>
<name>Alexey Kardashevskiy</name>
</author>
<published>2017-03-22T04:21:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e5afdf9dd515a9446c009f44f99f9bc2f91b89a7'/>
<id>urn:sha1:e5afdf9dd515a9446c009f44f99f9bc2f91b89a7</id>
<content type='text'>
So far iommu_table obejcts were only used in virtual mode and had
a single owner. We are going to change this by implementing in-kernel
acceleration of DMA mapping requests. The proposed acceleration
will handle requests in real mode and KVM will keep references to tables.

This adds a kref to iommu_table and defines new helpers to update it.
This replaces iommu_free_table() with iommu_tce_table_put() and makes
iommu_free_table() static. iommu_tce_table_get() is not used in this patch
but it will be in the following patch.

Since this touches prototypes, this also removes @node_name parameter as
it has never been really useful on powernv and carrying it for
the pseries platform code to iommu_free_table() seems to be quite
useless as well.

This should cause no behavioral change.

Signed-off-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Acked-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/iommu/vfio_spapr_tce: Cleanup iommu_table disposal</title>
<updated>2017-03-30T10:42:11Z</updated>
<author>
<name>Alexey Kardashevskiy</name>
</author>
<published>2017-03-22T04:21:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=11edf116e3a6352cfee6b1437d41603c9aff79c9'/>
<id>urn:sha1:11edf116e3a6352cfee6b1437d41603c9aff79c9</id>
<content type='text'>
At the moment iommu_table can be disposed by either calling
iommu_table_free() directly or it_ops::free(); the only implementation
of free() is in IODA2 - pnv_ioda2_table_free() - and it calls
iommu_table_free() anyway.

As we are going to have reference counting on tables, we need an unified
way of disposing tables.

This moves it_ops::free() call into iommu_free_table() and makes use
of the latter. The free() callback now handles only platform-specific
data.

As from now on the iommu_free_table() calls it_ops-&gt;free(), we need
to have it_ops initialized before calling iommu_free_table() so this
moves this initialization in pnv_pci_ioda2_create_table().

This should cause no behavioral change.

Signed-off-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Acked-by: Alex Williamson &lt;alex.williamson@redhat.com&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc/powernv/iommu: Add real mode version of iommu_table_ops::exchange()</title>
<updated>2017-03-30T10:42:01Z</updated>
<author>
<name>Alexey Kardashevskiy</name>
</author>
<published>2017-03-22T04:21:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a540aa56ba3d29084f28710c8b93cc9c3c422943'/>
<id>urn:sha1:a540aa56ba3d29084f28710c8b93cc9c3c422943</id>
<content type='text'>
In real mode, TCE tables are invalidated using special
cache-inhibited store instructions which are not available in
virtual mode

This defines and implements exchange_rm() callback. This does not
define set_rm/clear_rm/flush_rm callbacks as there is no user for those -
exchange/exchange_rm are only to be used by KVM for VFIO.

The exchange_rm callback is defined for IODA1/IODA2 powernv platforms.

This replaces list_for_each_entry_rcu with its lockless version as
from now on pnv_pci_ioda2_tce_invalidate() can be called in
the real mode too.

Signed-off-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Reviewed-by: David Gibson &lt;david@gibson.dropbear.id.au&gt;
Signed-off-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
</content>
</entry>
<entry>
<title>powerpc: implement the DMA_ATTR_NO_WARN attribute</title>
<updated>2016-10-11T22:06:32Z</updated>
<author>
<name>Mauricio Faria de Oliveira</name>
</author>
<published>2016-10-11T20:54:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=af8a24988e48f9ed20acf4d5230ac216d5baf723'/>
<id>urn:sha1:af8a24988e48f9ed20acf4d5230ac216d5baf723</id>
<content type='text'>
Add support for the DMA_ATTR_NO_WARN attribute on powerpc iommu code.

Link: http://lkml.kernel.org/r/1470092390-25451-3-git-send-email-mauricfo@linux.vnet.ibm.com
Signed-off-by: Mauricio Faria de Oliveira &lt;mauricfo@linux.vnet.ibm.com&gt;
Acked-by: Michael Ellerman &lt;mpe@ellerman.id.au&gt;
Cc: Keith Busch &lt;keith.busch@intel.com&gt;
Cc: Jens Axboe &lt;axboe@fb.com&gt;
Cc: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>dma-mapping: use unsigned long for dma_attrs</title>
<updated>2016-08-04T12:50:07Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2016-08-03T20:46:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=00085f1efa387a8ce100e3734920f7639c80caa3'/>
<id>urn:sha1:00085f1efa387a8ce100e3734920f7639c80caa3</id>
<content type='text'>
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 &lt;k.kozlowski@samsung.com&gt;
Acked-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Acked-by: Robin Murphy &lt;robin.murphy@arm.com&gt;
Acked-by: Hans-Christian Noren Egtvedt &lt;egtvedt@samfundet.no&gt;
Acked-by: Mark Salter &lt;msalter@redhat.com&gt; [c6x]
Acked-by: Jesper Nilsson &lt;jesper.nilsson@axis.com&gt; [cris]
Acked-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt; [drm]
Reviewed-by: Bart Van Assche &lt;bart.vanassche@sandisk.com&gt;
Acked-by: Joerg Roedel &lt;jroedel@suse.de&gt; [iommu]
Acked-by: Fabien Dessenne &lt;fabien.dessenne@st.com&gt; [bdisp]
Reviewed-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt; [vb2-core]
Acked-by: David Vrabel &lt;david.vrabel@citrix.com&gt; [xen]
Acked-by: Konrad Rzeszutek Wilk &lt;konrad.wilk@oracle.com&gt; [xen swiotlb]
Acked-by: Joerg Roedel &lt;jroedel@suse.de&gt; [iommu]
Acked-by: Richard Kuo &lt;rkuo@codeaurora.org&gt; [hexagon]
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt; [m68k]
Acked-by: Gerald Schaefer &lt;gerald.schaefer@de.ibm.com&gt; [s390]
Acked-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Acked-by: Hans-Christian Noren Egtvedt &lt;egtvedt@samfundet.no&gt; [avr32]
Acked-by: Vineet Gupta &lt;vgupta@synopsys.com&gt; [arc]
Acked-by: Robin Murphy &lt;robin.murphy@arm.com&gt; [arm64 and dma-iommu]
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
</feed>
