Re: [PATCH net 0/3] dpaa_eth: a couple of fixes

2016-12-17 Thread David Miller
From: Madalin Bucur Date: Thu, 15 Dec 2016 15:13:03 +0200 > This patch set introduces big endian accessors in the dpaa_eth driver > making sure accesses to the QBMan HW are correct on little endian > platforms. Removing a redundant Kconfig dependency on FSL_SOC. > Adding

[PATCH kernel v2 03/11] powerpc/vfio_spapr_tce: Add reference counting to iommu_table

2016-12-17 Thread Alexey Kardashevskiy
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

[PATCH kernel v2 02/11] powerpc/iommu: Cleanup iommu_table disposal

2016-12-17 Thread Alexey Kardashevskiy
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

[PATCH kernel v2 04/11] powerpc/mmu: Add real mode support for IOMMU preregistered memory

2016-12-17 Thread Alexey Kardashevskiy
This makes mm_iommu_lookup() able to work in realmode by replacing list_for_each_entry_rcu() (which can do debug stuff which can fail in real mode) with list_for_each_entry_lockless(). This adds realmode version of mm_iommu_ua_to_hpa() which adds explicit vmalloc'd-to-linear address conversion.

[PATCH kernel v2 08/11] KVM: PPC: Pass kvm* to kvmppc_find_table()

2016-12-17 Thread Alexey Kardashevskiy
The guest view TCE tables are per KVM anyway (not per VCPU) so pass kvm* there. This will be used in the following patches where we will be attaching VFIO containers to LIOBNs via ioctl() to KVM (rather than to VCPU). Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson

[PATCH kernel v2 09/11] vfio iommu: Add helpers to (un)register blocking notifiers per group

2016-12-17 Thread Alexey Kardashevskiy
c086de81 "vfio iommu: Add blocking notifier to notify DMA_UNMAP" added notifiers to a VFIO group. However even though the code underneath uses groups, the API takes device struct pointers. This adds helpers which do the same thing but take IOMMU groups instead. This adds

[PATCH kernel v2 11/11] KVM: PPC: Add in-kernel acceleration for VFIO

2016-12-17 Thread Alexey Kardashevskiy
This allows the host kernel to handle H_PUT_TCE, H_PUT_TCE_INDIRECT and H_STUFF_TCE requests targeted an IOMMU TCE table used for VFIO without passing them to user space which saves time on switching to user space and back. This adds H_PUT_TCE/H_PUT_TCE_INDIRECT/H_STUFF_TCE handlers to KVM. KVM

[PATCH kernel v2 05/11] KVM: PPC: Use preregistered memory API to access TCE list

2016-12-17 Thread Alexey Kardashevskiy
VFIO on sPAPR already implements guest memory pre-registration when the entire guest RAM gets pinned. This can be used to translate the physical address of a guest page containing the TCE list from H_PUT_TCE_INDIRECT. This makes use of the pre-registrered memory API to access TCE list pages in

[PATCH kernel v2 06/11] powerpc/powernv/iommu: Add real mode version of iommu_table_ops::exchange()

2016-12-17 Thread Alexey Kardashevskiy
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

[PATCH kernel v2 10/11] vfio: Check for unregistered notifiers when group is actually released

2016-12-17 Thread Alexey Kardashevskiy
This moves a check for unregistered notifiers from fops release callback to the place where the group will actually be released. Signed-off-by: Alexey Kardashevskiy --- This is going to be used in the following patch in cleanup path. Since the next patch is RFC, this one might

[PATCH kernel v2 07/11] KVM: PPC: Enable IOMMU_API for KVM_BOOK3S_64 permanently

2016-12-17 Thread Alexey Kardashevskiy
It does not make much sense to have KVM in book3s-64 and not to have IOMMU bits for PCI pass through support as it costs little and allows VFIO to function on book3s KVM. Having IOMMU_API always enabled makes it unnecessary to have a lot of "#ifdef IOMMU_API" in arch/powerpc/kvm/book3s_64_vio*.