Re: [PATCH kernel v7 04/31] vfio: powerpc/spapr: Use it_page_size

2015-04-01 Thread Alexey Kardashevskiy
On 04/02/2015 08:48 AM, Alex Williamson wrote: On Sat, 2015-03-28 at 01:54 +1100, Alexey Kardashevskiy wrote: This makes use of the it_page_size from the iommu_table struct as page size can differ. This replaces missing IOMMU_PAGE_SHIFT macro in commented debug code as recently introduced

Re: [PATCH kernel v7 12/31] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group

2015-04-01 Thread Alexey Kardashevskiy
On 04/02/2015 08:48 AM, Alex Williamson wrote: On Sat, 2015-03-28 at 01:54 +1100, Alexey Kardashevskiy wrote: Modern IBM POWERPC systems support multiple (currently two) TCE tables per IOMMU group (a.k.a. PE). This adds a iommu_table_group container for TCE tables. Right now just one table is

Re: [PATCH kernel v7 28/31] powerpc/mmu: Add userspace-to-physical addresses translation cache

2015-04-01 Thread Alexey Kardashevskiy
On 04/02/2015 08:48 AM, Alex Williamson wrote: On Sat, 2015-03-28 at 01:55 +1100, Alexey Kardashevskiy wrote: We are adding support for DMA memory pre-registration to be used in conjunction with VFIO. The idea is that the userspace which is going to run a guest may want to pre-register a user

Re: [PATCH kernel v7 04/31] vfio: powerpc/spapr: Use it_page_size

2015-04-01 Thread Alexey Kardashevskiy
On 04/02/2015 01:50 PM, Alex Williamson wrote: On Thu, 2015-04-02 at 13:30 +1100, Alexey Kardashevskiy wrote: On 04/02/2015 08:48 AM, Alex Williamson wrote: On Sat, 2015-03-28 at 01:54 +1100, Alexey Kardashevskiy wrote: This makes use of the it_page_size from the iommu_table struct as page

Re: [PATCH kernel v7 26/31] powerpc/iommu: Add userspace view of TCE table

2015-04-07 Thread Alexey Kardashevskiy
On 04/03/2015 07:50 AM, Alex Williamson wrote: Should have sent this with the other comments, but found it hiding on my desktop... On Sat, 2015-03-28 at 01:55 +1100, Alexey Kardashevskiy wrote: In order to support memory pre-registration, we need a way to track the use of every registered

Re: [PATCH kernel v7 26/31] powerpc/iommu: Add userspace view of TCE table

2015-04-08 Thread Alexey Kardashevskiy
On 04/09/2015 01:43 AM, Alex Williamson wrote: On Wed, 2015-04-08 at 13:22 +1000, Alexey Kardashevskiy wrote: On 04/03/2015 07:50 AM, Alex Williamson wrote: Should have sent this with the other comments, but found it hiding on my desktop... On Sat, 2015-03-28 at 01:55 +1100, Alexey

[PATCH kernel] powerpc/pseries: Fix compile of memory hotplug without CONFIG_MEMORY_HOTREMOVE

2015-04-14 Thread Alexey Kardashevskiy
51925fb3c5 "powerpc/pseries: Implement memory hotplug remove in the kernel" broke compile when CONFIG_MEMORY_HOTREMOVE is not defined due to missing symbols. This fixes the issue by adding the missing symbols. Signed-off-by: Alexey Kardashevskiy --- This is made against ad30cb99465

Re: [PATCH kernel v8 07/31] vfio: powerpc/spapr: Moving pinning/unpinning to helpers

2015-04-15 Thread Alexey Kardashevskiy
On 04/15/2015 05:10 PM, David Gibson wrote: On Fri, Apr 10, 2015 at 04:30:49PM +1000, Alexey Kardashevskiy wrote: This is a pretty mechanical patch to make next patches simpler. New tce_iommu_unuse_page() helper does put_page() now but it might skip that after the memory registering patch

Re: [PATCH kernel v8 12/31] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group

2015-04-16 Thread Alexey Kardashevskiy
On 04/16/2015 03:55 PM, David Gibson wrote: On Fri, Apr 10, 2015 at 04:30:54PM +1000, Alexey Kardashevskiy wrote: Modern IBM POWERPC systems support multiple (currently two) TCE tables per IOMMU group (a.k.a. PE). This adds a iommu_table_group container for TCE tables. Right now just one table

Re: [PATCH kernel v8 21/31] powerpc/iommu: Split iommu_free_table into 2 helpers

2015-04-16 Thread Alexey Kardashevskiy
On 04/16/2015 04:46 PM, David Gibson wrote: On Fri, Apr 10, 2015 at 04:31:03PM +1000, Alexey Kardashevskiy wrote: The iommu_free_table helper release memory it is using (the TCE table and @it_map) and release the iommu_table struct as well. We might not want the very last step as we store

Re: [PATCH kernel v8 12/31] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group

2015-04-17 Thread Alexey Kardashevskiy
On 04/16/2015 03:55 PM, David Gibson wrote: On Fri, Apr 10, 2015 at 04:30:54PM +1000, Alexey Kardashevskiy wrote: Modern IBM POWERPC systems support multiple (currently two) TCE tables per IOMMU group (a.k.a. PE). This adds a iommu_table_group container for TCE tables. Right now just one table

Re: [PATCH kernel v8 14/31] vfio: powerpc/spapr: powerpc/powernv/ioda2: Rework IOMMU ownership control

2015-04-17 Thread Alexey Kardashevskiy
On 04/16/2015 04:07 PM, David Gibson wrote: On Fri, Apr 10, 2015 at 04:30:56PM +1000, Alexey Kardashevskiy wrote: At the moment the iommu_table struct has a set_bypass() which enables/ disables DMA bypass on IODA2 PHB. This is exposed to POWERPC IOMMU code which calls this callback when

Re: [PATCH kernel v8 15/31] powerpc/iommu: Fix IOMMU ownership control functions

2015-04-17 Thread Alexey Kardashevskiy
On 04/16/2015 04:10 PM, David Gibson wrote: On Fri, Apr 10, 2015 at 04:30:57PM +1000, Alexey Kardashevskiy wrote: This adds missing locks in iommu_take_ownership()/ iommu_release_ownership(). This marks all pages busy in iommu_table::it_map in order to catch errors if there is an attempt to

Re: [PATCH kernel v8 17/31] powerpc/iommu/powernv: Release replaced TCE

2015-04-17 Thread Alexey Kardashevskiy
On 04/16/2015 04:26 PM, David Gibson wrote: On Fri, Apr 10, 2015 at 04:30:59PM +1000, Alexey Kardashevskiy wrote: At the moment writing new TCE value to the IOMMU table fails with EBUSY if there is a valid entry already. However PAPR specification allows the guest to write new TCE value without

Re: [PATCH kernel v8 15/31] powerpc/iommu: Fix IOMMU ownership control functions

2015-04-19 Thread Alexey Kardashevskiy
On 04/20/2015 12:46 PM, David Gibson wrote: On Fri, Apr 17, 2015 at 08:16:13PM +1000, Alexey Kardashevskiy wrote: On 04/16/2015 04:10 PM, David Gibson wrote: On Fri, Apr 10, 2015 at 04:30:57PM +1000, Alexey Kardashevskiy wrote: This adds missing locks in iommu_take_ownership

Re: [PATCH kernel v8 14/31] vfio: powerpc/spapr: powerpc/powernv/ioda2: Rework IOMMU ownership control

2015-04-19 Thread Alexey Kardashevskiy
On 04/20/2015 12:44 PM, David Gibson wrote: On Fri, Apr 17, 2015 at 08:09:29PM +1000, Alexey Kardashevskiy wrote: On 04/16/2015 04:07 PM, David Gibson wrote: On Fri, Apr 10, 2015 at 04:30:56PM +1000, Alexey Kardashevskiy wrote: At the moment the iommu_table struct has a set_bypass() which

Re: [PATCH kernel v8 14/31] vfio: powerpc/spapr: powerpc/powernv/ioda2: Rework IOMMU ownership control

2015-04-21 Thread Alexey Kardashevskiy
On 04/21/2015 07:43 PM, David Gibson wrote: On Mon, Apr 20, 2015 at 04:55:32PM +1000, Alexey Kardashevskiy wrote: On 04/20/2015 12:44 PM, David Gibson wrote: On Fri, Apr 17, 2015 at 08:09:29PM +1000, Alexey Kardashevskiy wrote: On 04/16/2015 04:07 PM, David Gibson wrote: On Fri, Apr 10, 2015

Re: [PATCH 2/2] pci: Use Qemu created PCI device nodes

2015-04-25 Thread Alexey Kardashevskiy
On 04/25/2015 05:30 AM, Thomas Huth wrote: Hi Nikunj, On Wed, 22 Apr 2015 16:27:20 +0530 Nikunj A Dadhania wrote: PCI Enumeration has been part of SLOF. Now with hotplug code addition in Qemu, it makes more sense to have this code a one place, i.e. Qemu. s/Qemu/QEMU/ and s/code a one pla

[PATCH kernel v9 04/32] vfio: powerpc/spapr: Check that IOMMU page is fully contained by system page

2015-04-25 Thread Alexey Kardashevskiy
compound_order() and compound_head() work correctly on non-huge pages, there is no need for additional check whether the page is huge. Signed-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by: Alex Williamson Reviewed-by: David Gibson --- Changes: v8: changed subject v6: * the

[PATCH kernel v9 02/32] Revert "powerpc/powernv: Allocate struct pnv_ioda_pe iommu_table dynamically"

2015-04-25 Thread Alexey Kardashevskiy
This reverts commit 9e8d4a19ab66ec9e132d405357b9108a4f26efd3 as tce32_table has exactly the same life time as the whole PE. This makes use of a new iommu_reset_table() helper instead. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/iommu.h | 3 --- arch/powerpc

[PATCH kernel v9 01/32] powerpc/iommu: Split iommu_free_table into 2 helpers

2015-04-25 Thread Alexey Kardashevskiy
The iommu_free_table helper release memory it is using (the TCE table and @it_map) and release the iommu_table struct as well. We might not want the very last step as we store iommu_table in parent structures. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/iommu.h | 1 + arch

[PATCH kernel v9 03/32] vfio: powerpc/spapr: Move page pinning from arch code to VFIO IOMMU driver

2015-04-25 Thread Alexey Kardashevskiy
only. This removes page unpinning from iommu_take_ownership() as the actual TCE table might contain garbage and doing put_page() on it is undefined behaviour. Besides the last part, the rest of the patch is mechanical. Signed-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by

[PATCH kernel v9 00/32] powerpc/iommu/vfio: Enable Dynamic DMA windows

2015-04-25 Thread Alexey Kardashevskiy
MA windows at all so we do not bother with iommu_table::it_map anymore * added multilevel TCE tables support to support really huge guests v2: * added missing __pa() in "powerpc/powernv: Release replaced TCE" * reposted to make some noise Alexey Kardashevskiy (32): powerpc/iommu: Spli

[PATCH kernel v9 19/32] powerpc/powernv/ioda2: Rework iommu_table creation

2015-04-25 Thread Alexey Kardashevskiy
This moves iommu_table creation to the beginning to make following changes easier to review. This starts using table parameters from the iommu_table struct. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy --- Changes: v9: * updated commit log and did minor cleanup

[PATCH kernel v9 07/32] vfio: powerpc/spapr: Disable DMA mappings on disabled container

2015-04-25 Thread Alexey Kardashevskiy
At the moment DMA map/unmap requests are handled irrespective to the container's state. This allows the user space to pin memory which it might not be allowed to pin. This adds checks to MAP/UNMAP that the container is enabled, otherwise -EPERM is returned. Signed-off-by: Alexey Kardashe

[PATCH kernel v9 20/32] powerpc/powernv/ioda2: Introduce pnv_pci_create_table/pnv_pci_free_table

2015-04-25 Thread Alexey Kardashevskiy
release the actual TCE table. This enforces window size to be a power of two. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- Changes: v9: * moved helpers to the common powernv pci.c file from pci-ioda.c * moved bits from

[PATCH kernel v9 21/32] powerpc/powernv/ioda2: Introduce pnv_pci_ioda2_set_window

2015-04-25 Thread Alexey Kardashevskiy
good thing to do. It does not have immediate effect now as the table is never recreated after reboot but it will in the following patches. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- Changes: v9: * initialize pe->table_group.table

[PATCH kernel v9 16/32] powerpc/powernv/ioda: Move TCE kill register address to PE

2015-04-25 Thread Alexey Kardashevskiy
t required before because there is just a single TCE table and 64bit DMA is handled via bypass window (which has no table so no chache is used) but this is going to change with Dynamic DMA windows (DDW). Signed-off-by: Alexey Kardashevskiy --- Changes: v9: * new in the series --- arch/powerpc

[PATCH kernel v9 31/32] vfio: powerpc/spapr: Support multiple groups in one container if possible

2015-04-25 Thread Alexey Kardashevskiy
create/set DMA windows on IOMMU groups so the same TCE tables will be shared between several IOMMU groups. Signed-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by: Alex Williamson --- Changes: v7: * updated doc --- Documentation/vfio.txt | 8 +- drivers

[PATCH kernel v9 17/32] powerpc/powernv: Implement accessor to TCE entry

2015-04-25 Thread Alexey Kardashevskiy
This replaces direct accesses to TCE table with a helper which returns an TCE entry address. This does not make difference now but will when multi-level TCE tables get introduces. No change in behavior is expected. Signed-off-by: Alexey Kardashevskiy --- Changes: v9: * new patch in the series

[PATCH kernel v9 05/32] vfio: powerpc/spapr: Use it_page_size

2015-04-25 Thread Alexey Kardashevskiy
This makes use of the it_page_size from the iommu_table struct as page size can differ. This replaces missing IOMMU_PAGE_SHIFT macro in commented debug code as recently introduced IOMMU_PAGE_XXX macros do not include IOMMU_PAGE_SHIFT. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David

[PATCH kernel v9 08/32] vfio: powerpc/spapr: Moving pinning/unpinning to helpers

2015-04-25 Thread Alexey Kardashevskiy
-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by: Alex Williamson --- Changes: v9: * changed helpers to work with physical addresses rather than linear (for simplicity - later ::xchg() will receive physical and avoid additional convertions) v6: * tce_get_hva() returns hva

[PATCH kernel v9 15/32] powerpc/powernv/ioda/ioda2: Rework TCE invalidation in tce_build()/tce_free()

2015-04-25 Thread Alexey Kardashevskiy
. Signed-off-by: Alexey Kardashevskiy --- Changes: v9: * removed confusing comment from commit log about unintentional calling of pnv_pci_ioda_tce_invalidate() * moved mechanical changes away to "powerpc/iommu: Move tce_xxx callbacks from ppc_md to iommu_table" * fixed bug with broken in

[PATCH kernel v9 06/32] vfio: powerpc/spapr: Move locked_vm accounting to helpers

2015-04-25 Thread Alexey Kardashevskiy
might be required to be bigger than the guest RAM. This also prints pid of the current process in pr_warn/pr_debug. Signed-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by: Alex Williamson Reviewed-by: David Gibson --- Changes: v4: * new helpers do nothing if @npages

[PATCH kernel v9 27/32] powerpc/iommu/ioda2: Add get_table_size() to calculate the size of future table

2015-04-25 Thread Alexey Kardashevskiy
defines an iommu_table_group_ops callback to let VFIO know how much memory will be locked if a table is created. Signed-off-by: Alexey Kardashevskiy --- Changes: v9: * reimplemented the whole patch --- arch/powerpc/include/asm/iommu.h | 5 + arch/powerpc/platforms/powernv/pci-ioda.c

[PATCH kernel v9 32/32] vfio: powerpc/spapr: Support Dynamic DMA windows

2015-04-25 Thread Alexey Kardashevskiy
the sake of TCE acceleration in KVM (coming soon). Signed-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by: Alex Williamson --- Changes: v7: * s/VFIO_IOMMU_INFO_DDW/VFIO_IOMMU_SPAPR_INFO_DDW/ * fixed typos in and updated vfio.txt * fixed VFIO_IOMMU_SPAPR_TCE_GET_INFO

[PATCH kernel v9 29/32] vfio: powerpc/spapr: Register memory and define IOMMU v2

2015-04-25 Thread Alexey Kardashevskiy
. Signed-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by: Alex Williamson --- Changes: v9: * s/tce_get_hva_cached/tce_iommu_use_page_v2/ v7: * now memory is registered per mm (i.e. process) * moved memory registration code to powerpc/mmu * merged "vfio: powerpc/spapr: Defi

[PATCH kernel v9 09/32] vfio: powerpc/spapr: Rework groups attaching

2015-04-25 Thread Alexey Kardashevskiy
This is to make extended ownership and multiple groups support patches simpler for review. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by: Alex Williamson Reviewed-by: David Gibson --- drivers/vfio

[PATCH kernel v9 13/32] vfio: powerpc/spapr/iommu/powernv/ioda2: Rework IOMMU ownership control

2015-04-25 Thread Alexey Kardashevskiy
igned-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by: Alex Williamson --- Changes: v9: * squashed "vfio: powerpc/spapr: powerpc/iommu: Rework IOMMU ownership control" and "vfio: powerpc/spapr: powerpc/powernv/ioda2: Rework IOMMU ownership control" in

[PATCH kernel v9 11/32] powerpc/iommu: Move tce_xxx callbacks from ppc_md to iommu_table

2015-04-25 Thread Alexey Kardashevskiy
cks for IODA1/2. No change in behaviour is expected. Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- Changes: v9: * pnv_tce_build/pnv_tce_free/pnv_tce_get have been made public and lost "rm" parameters to make following patches simpler (realmode is not supported here anyway

[PATCH kernel v9 10/32] powerpc/powernv: Do not set "read" flag if direction==DMA_NONE

2015-04-25 Thread Alexey Kardashevskiy
bits) will be used to decide whether to put the page or not. This adds iommu_direction_to_tce_perm() (its counterpart is there already) and uses it for powernv's pnv_tce_build(). Signed-off-by: Alexey Kardashevskiy Reviewed-by: David Gibson --- Changes: v9: * added comment why we must put

[PATCH kernel v9 12/32] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group

2015-04-25 Thread Alexey Kardashevskiy
should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by: Alex Williamson --- Changes: v9: * s/it_group/it_table_group/ * added and used iommu_table_group_free(), from now iommu_free_table() is only used for VIO * added

[PATCH kernel v9 14/32] powerpc/iommu: Fix IOMMU ownership control functions

2015-04-25 Thread Alexey Kardashevskiy
prevent buggy drivers from crashing when allocated page is bus-mapped at zero (which is correct). This restores the bit in the case of failure to bring the it_map to the state it was in when we called iommu_take_ownership(). Signed-off-by: Alexey Kardashevskiy --- Changes: v9

[PATCH kernel v9 28/32] powerpc/mmu: Add userspace-to-physical addresses translation cache

2015-04-25 Thread Alexey Kardashevskiy
track the number of registrations. Signed-off-by: Alexey Kardashevskiy --- Changes: v8: * s/mm_iommu_table_group_mem_t/struct mm_iommu_table_group_mem_t/ * fixed error fallback look (s/[i]/[j]/) --- arch/powerpc/include/asm/mmu-hash64.h | 3 + arch/powerpc/include/asm/mmu_context.h

[PATCH kernel v9 18/32] powerpc/iommu/powernv: Release replaced TCE

2015-04-25 Thread Alexey Kardashevskiy
are to be calculated by platform code from DMA direction. This moves SetPageDirty() to the IOMMU code to make it work for both VFIO ioctl interface in in-kernel TCE acceleration (when it becomes available later). Signed-off-by: Alexey Kardashevskiy [aw: for the vfio related changes] Acked-by

[PATCH kernel v9 26/32] powerpc/iommu: Add userspace view of TCE table

2015-04-25 Thread Alexey Kardashevskiy
iommu_table struct. It contains userspace address, one per TCE entry. The table is only allocated when the ownership over an IOMMU group is taken which means it is only used from outside of the powernv code (such as VFIO). Signed-off-by: Alexey Kardashevskiy --- Changes: v9: * fixed code flow in

[PATCH kernel v9 24/32] powerpc/powernv/ioda2: Use new helpers to do proper cleanup on PE release

2015-04-25 Thread Alexey Kardashevskiy
The existing code programmed TVT#0 with some address and then immediately released that memory. This makes use of pnv_pci_ioda2_unset_window() and pnv_pci_ioda2_set_bypass() which do correct resource release and TVT update. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/platforms/powernv

[PATCH kernel v9 25/32] vfio: powerpc/spapr: powerpc/powernv/ioda2: Rework ownership

2015-04-25 Thread Alexey Kardashevskiy
ode anyway. Old-style ownership is still supported allowing VFIO to run on older P5IOC2 and IODA IO controllers. No change in userspace-visible behaviour is expected. Since it recreates TCE tables on each ownership change, related kernel traces will appear more often. Signed-off-by: Alexey Kardashe

[PATCH kernel v9 30/32] vfio: powerpc/spapr: Use 32bit DMA window properties from table_group

2015-04-25 Thread Alexey Kardashevskiy
A table group might not have a table but it always has the default 32bit window parameters so use these. No change in behavior is expected. Signed-off-by: Alexey Kardashevskiy --- Changes: v9: * new in the series - to make the next patch simpler --- drivers/vfio/vfio_iommu_spapr_tce.c | 19

[PATCH kernel v9 22/32] powerpc/powernv: Implement multilevel TCE tables

2015-04-25 Thread Alexey Kardashevskiy
5 levels which splits the table into a tree of smaller subtables. This adds multi-level TCE tables support to pnv_pci_create_table() and pnv_pci_free_table() helpers. Signed-off-by: Alexey Kardashevskiy --- Changes: v9: * moved from ioda2 to common powernv pci code * fixed cleanup if allocation

[PATCH kernel v9 23/32] powerpc/powernv/ioda: Define and implement DMA table/window management callbacks

2015-04-25 Thread Alexey Kardashevskiy
container. This adds IOMMU capabilities to iommu_table_group such as default 32bit window parameters and others. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/include/asm/iommu.h| 19 arch/powerpc/platforms/powernv/pci-ioda.c | 75 ++--- arch

[PATCH kernel] commit 4fbdf9cb ("lpfc: Fix for lun discovery issue with saturn adapter.")

2015-04-28 Thread Alexey Kardashevskiy
Saturn-X: LightPulse Fibre Channel Host Adapter [10df:f100] (rev 03) Signed-off-by: Alexey Kardashevskiy --- drivers/scsi/lpfc/lpfc_scsi.c | 41 + 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi

Re: [PATCH kernel] commit 4fbdf9cb ("lpfc: Fix for lun discovery issue with saturn adapter.")

2015-04-28 Thread Alexey Kardashevskiy
On 04/28/2015 07:18 PM, Sebastian Herbszt wrote: Alexey Kardashevskiy wrote: This reverts 4fbdf9cb is breaks LPFC on POWER7 machine, big endian kernel. This is the hardware used for verification: 0005:01:00.0 Fibre Channel [0c04]: Emulex Corporation Saturn-X: LightPulse Fibre Channel Host

Re: [PATCH v2 0/4] PCI: Generic fixes and moving enumeration back to QEMU

2015-04-28 Thread Alexey Kardashevskiy
On 04/27/2015 06:02 PM, Nikunj A Dadhania wrote: patch 1: Fixes a bug in pci-to-pci bridge while programming the limit registers during probe patch 2,3: Support 64-bit address translation and usb devices can have 64-bit pci memory BARs patch 4: Use QEMU create device tr

Re: [PATCH kernel v9 16/32] powerpc/powernv/ioda: Move TCE kill register address to PE

2015-04-29 Thread Alexey Kardashevskiy
On 04/29/2015 01:25 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:40PM +1000, Alexey Kardashevskiy wrote: At the moment the DMA setup code looks for the "ibm,opal-tce-kill" property which contains the TCE kill register address. Writes to this register invalidates TCE cache on

Re: [PATCH kernel v9 17/32] powerpc/powernv: Implement accessor to TCE entry

2015-04-29 Thread Alexey Kardashevskiy
On 04/29/2015 02:04 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:41PM +1000, Alexey Kardashevskiy wrote: This replaces direct accesses to TCE table with a helper which returns an TCE entry address. This does not make difference now but will when multi-level TCE tables get introduces

Re: [PATCH kernel v9 20/32] powerpc/powernv/ioda2: Introduce pnv_pci_create_table/pnv_pci_free_table

2015-04-29 Thread Alexey Kardashevskiy
On 04/29/2015 02:39 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:44PM +1000, Alexey Kardashevskiy wrote: This is a part of moving TCE table allocation into an iommu_ops callback to support multiple IOMMU groups per one VFIO container. This moves a table creation window to the file

Re: [PATCH kernel v9 13/32] vfio: powerpc/spapr/iommu/powernv/ioda2: Rework IOMMU ownership control

2015-04-29 Thread Alexey Kardashevskiy
On 04/29/2015 01:02 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:37PM +1000, Alexey Kardashevskiy wrote: This adds tce_iommu_take_ownership() and tce_iommu_release_ownership which call in a loop iommu_take_ownership()/iommu_release_ownership() for every table on the group. As there is

Re: [PATCH kernel v9 21/32] powerpc/powernv/ioda2: Introduce pnv_pci_ioda2_set_window

2015-04-29 Thread Alexey Kardashevskiy
On 04/29/2015 02:45 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:45PM +1000, Alexey Kardashevskiy wrote: This is a part of moving DMA window programming to an iommu_ops callback. pnv_pci_ioda2_set_window() takes an iommu_table_group as a first parameter (not pnv_ioda_pe) as it is going

Re: [PATCH kernel v9 23/32] powerpc/powernv/ioda: Define and implement DMA table/window management callbacks

2015-04-29 Thread Alexey Kardashevskiy
On 04/29/2015 03:30 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:47PM +1000, Alexey Kardashevskiy wrote: This extends iommu_table_group_ops by a set of callbacks to support dynamic DMA windows management. create_table() creates a TCE table with specific parameters. it receives

Re: [PATCH kernel v9 18/32] powerpc/iommu/powernv: Release replaced TCE

2015-04-29 Thread Alexey Kardashevskiy
On 04/29/2015 02:18 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:42PM +1000, Alexey Kardashevskiy wrote: At the moment writing new TCE value to the IOMMU table fails with EBUSY if there is a valid entry already. However PAPR specification allows the guest to write new TCE value without

Re: [PATCH kernel v9 09/32] vfio: powerpc/spapr: Rework groups attaching

2015-04-29 Thread Alexey Kardashevskiy
On 04/29/2015 12:16 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:33PM +1000, Alexey Kardashevskiy wrote: This is to make extended ownership and multiple groups support patches simpler for review. This should cause no behavioural change. Um.. this doesn't appear to be

Re: [PATCH kernel v9 12/32] powerpc/spapr: vfio: Switch from iommu_table to new iommu_table_group

2015-04-29 Thread Alexey Kardashevskiy
On 04/29/2015 12:49 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:36PM +1000, Alexey Kardashevskiy wrote: Modern IBM POWERPC systems support multiple (currently two) TCE tables per IOMMU group (a.k.a. PE). This adds a iommu_table_group container for TCE tables. Right now just one table

Re: [PATCH kernel v9 15/32] powerpc/powernv/ioda/ioda2: Rework TCE invalidation in tce_build()/tce_free()

2015-04-29 Thread Alexey Kardashevskiy
On 04/29/2015 01:18 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:39PM +1000, Alexey Kardashevskiy wrote: The pnv_pci_ioda_tce_invalidate() helper invalidates TCE cache. It is supposed to be called on IODA1/2 and not called on p5ioc2. It receives start and end host addresses of TCE

Re: [PATCH kernel v9 31/32] vfio: powerpc/spapr: Support multiple groups in one container if possible

2015-04-30 Thread Alexey Kardashevskiy
On 04/30/2015 05:22 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:55PM +1000, Alexey Kardashevskiy wrote: At the moment only one group per container is supported. POWER8 CPUs have more flexible design and allows naving 2 TCE tables per IOMMU group so we can relax this limitation and

Re: [PATCH kernel v9 23/32] powerpc/powernv/ioda: Define and implement DMA table/window management callbacks

2015-04-30 Thread Alexey Kardashevskiy
On 04/30/2015 02:37 PM, David Gibson wrote: On Wed, Apr 29, 2015 at 07:44:20PM +1000, Alexey Kardashevskiy wrote: On 04/29/2015 03:30 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:47PM +1000, Alexey Kardashevskiy wrote: This extends iommu_table_group_ops by a set of callbacks to

Re: [PATCH kernel v9 26/32] powerpc/iommu: Add userspace view of TCE table

2015-04-30 Thread Alexey Kardashevskiy
On 04/29/2015 04:31 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:50PM +1000, Alexey Kardashevskiy wrote: In order to support memory pre-registration, we need a way to track the use of every registered memory region and only allow unregistration if a region is not in use anymore. So we

Re: [PATCH kernel v9 27/32] powerpc/iommu/ioda2: Add get_table_size() to calculate the size of future table

2015-04-30 Thread Alexey Kardashevskiy
On 04/29/2015 04:40 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:51PM +1000, Alexey Kardashevskiy wrote: This adds a way for the IOMMU user to know how much a new table will use so it can be accounted in the locked_vm limit before allocation happens. This stores the allocated table

Re: [PATCH kernel v9 29/32] vfio: powerpc/spapr: Register memory and define IOMMU v2

2015-04-30 Thread Alexey Kardashevskiy
On 04/30/2015 04:55 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:53PM +1000, Alexey Kardashevskiy wrote: The existing implementation accounts the whole DMA window in the locked_vm counter. This is going to be worse with multiple containers and huge DMA windows. Also, real-time

Re: [PATCH kernel v9 31/32] vfio: powerpc/spapr: Support multiple groups in one container if possible

2015-04-30 Thread Alexey Kardashevskiy
On 05/01/2015 02:33 PM, David Gibson wrote: On Thu, Apr 30, 2015 at 07:33:09PM +1000, Alexey Kardashevskiy wrote: On 04/30/2015 05:22 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:55PM +1000, Alexey Kardashevskiy wrote: At the moment only one group per container is supported. POWER8

Re: [PATCH kernel v9 29/32] vfio: powerpc/spapr: Register memory and define IOMMU v2

2015-04-30 Thread Alexey Kardashevskiy
On 05/01/2015 03:23 PM, David Gibson wrote: On Fri, May 01, 2015 at 02:35:23PM +1000, Alexey Kardashevskiy wrote: On 04/30/2015 04:55 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:53PM +1000, Alexey Kardashevskiy wrote: The existing implementation accounts the whole DMA window in the

Re: [PATCH kernel v9 27/32] powerpc/iommu/ioda2: Add get_table_size() to calculate the size of future table

2015-04-30 Thread Alexey Kardashevskiy
On 05/01/2015 03:12 PM, David Gibson wrote: On Fri, May 01, 2015 at 02:10:58PM +1000, Alexey Kardashevskiy wrote: On 04/29/2015 04:40 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:51PM +1000, Alexey Kardashevskiy wrote: This adds a way for the IOMMU user to know how much a new table

Re: [PATCH kernel v9 26/32] powerpc/iommu: Add userspace view of TCE table

2015-05-01 Thread Alexey Kardashevskiy
On 05/01/2015 02:23 PM, David Gibson wrote: On Fri, May 01, 2015 at 02:01:17PM +1000, Alexey Kardashevskiy wrote: On 04/29/2015 04:31 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:50PM +1000, Alexey Kardashevskiy wrote: In order to support memory pre-registration, we need a way to

Re: [PATCH kernel v9 22/32] powerpc/powernv: Implement multilevel TCE tables

2015-05-01 Thread Alexey Kardashevskiy
On 04/29/2015 03:04 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:46PM +1000, Alexey Kardashevskiy wrote: TCE tables might get too big in case of 4K IOMMU pages and DDW enabled on huge guests (hundreds of GB of RAM) so the kernel might be unable to allocate contiguous chunk of physical

Re: [PATCH kernel v9 20/32] powerpc/powernv/ioda2: Introduce pnv_pci_create_table/pnv_pci_free_table

2015-05-01 Thread Alexey Kardashevskiy
On 04/29/2015 02:39 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:44PM +1000, Alexey Kardashevskiy wrote: This is a part of moving TCE table allocation into an iommu_ops callback to support multiple IOMMU groups per one VFIO container. This moves a table creation window to the file

Re: [PATCH kernel v9 28/32] powerpc/mmu: Add userspace-to-physical addresses translation cache

2015-05-01 Thread Alexey Kardashevskiy
On 04/29/2015 05:01 PM, David Gibson wrote: On Sat, Apr 25, 2015 at 10:14:52PM +1000, Alexey Kardashevskiy wrote: We are adding support for DMA memory pre-registration to be used in conjunction with VFIO. The idea is that the userspace which is going to run a guest may want to pre-register a

Re: [PATCH v4 00/21] PowerPC/PowerNV: PCI Slot Management

2015-05-08 Thread Alexey Kardashevskiy
On 05/01/2015 04:02 PM, Gavin Shan wrote: The series of patches intend to support PCI slot for PowerPC PowerNV platform, which is running on top of skiboot firmware. The patchset requires corresponding changes from skiboot firmware, which is sent to skib...@lists.ozlabs.org for review. The PCI sl

Re: [PATCH v4 02/21] powerpc/powernv: Enable M64 on P7IOC

2015-05-08 Thread Alexey Kardashevskiy
On 05/01/2015 04:02 PM, Gavin Shan wrote: The patch enables M64 window on P7IOC, which has been enabled on PHB3. Comparing to PHB3, there are 16 M64 BARs and each of them are divided to 8 segments. "compared to something" means you will tell about PHB3 too :) Do I understand correctly that IOD

Re: [PATCH v4 03/21] powerpc/powernv: M64 support improvement

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:02 PM, Gavin Shan wrote: We're having the hardware or enforced (on P7IOC) limitation: M64 I would think if it is enforced, then it is enforced by hardware but you say "hardware OR enforced" :) segment#x can only be assigned to PE#x. IO and M32 segment can be mapped to arbi

Re: [PATCH v4 04/21] powerpc/powernv: Improve IO and M32 mapping

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:02 PM, Gavin Shan wrote: The PHB's IO or M32 window is divided evenly to segments, each of them can be mapped to arbitrary PE# by IODT or M32DT. Current code figures out the consumed IO and M32 segments by one particular PE from the windows of the PE's upstream bridge. It won't b

Re: [PATCH v4 06/21] powerpc/powernv: Create PEs dynamically

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:02 PM, Gavin Shan wrote: Currently, the PEs and their associated resources are assigned in ppc_md.pcibios_fixup(). The function is called for once after PCI probing and resources assignment are finished. Obviously, it's not hotplug friendly. The patch creates PEs dynamically by p

Re: [PATCH v4 07/21] powerpc/powernv: Release PEs dynamically

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:02 PM, Gavin Shan wrote: The original code doesn't support releasing PEs dynamically, meaning that PE and the associated resources (IO, M32, M64 and DMA) can't be released when unplugging a PCI adapter from one hotpluggable slot. The patch takes object oriented methodology, intr

Re: [PATCH v4 08/21] powerpc/powernv: Drop pnv_ioda_setup_dev_PE()

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:02 PM, Gavin Shan wrote: Nobody is using the this function. The patch drops it. Signed-off-by: Gavin Shan Yay! :) I would move this patchset along with other mechanical changes to the beginning of the patchset. Reviewed-by: Alexey Kardashevskiy --- arch/powerpc

Re: [PATCH v4 09/21] powerpc/powernv: Use PCI slot reset infrastructure

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:02 PM, Gavin Shan wrote: For PowerNV platform, running on top of skiboot, all PE level reset should be routed to firmware if the bridge of the PE primary bus has device-node property "ibm,reset-by-firmware". Otherwise, the kernel has to issue hot reset on PE's primary bus despite

Re: [PATCH v4 10/21] powerpc/powernv: Fundamental reset for PCI bus reset

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:02 PM, Gavin Shan wrote: Function pnv_pci_reset_secondary_bus() is used to reset specified PCI bus, which is leaded by root complex or PCI bridge. That means the function shouldn't be called on PCI root bus and the patch removes the logic for that case. Also, some adapters benea

Re: [PATCH v4 13/21] powerpc/powernv: Introduce pnv_pci_poll()

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:03 PM, Gavin Shan wrote: We might not get some PCI slot information (e.g. power status) immediately by OPAL API. Instead, opal_pci_poll() need to be called for the required information. The patch introduces pnv_pci_poll(), which bases on original pnv_eeh_poll(), to cover the abo

Re: [PATCH v4 14/21] powerpc/powernv: Functions to get/reset PCI slot status

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:03 PM, Gavin Shan wrote: The patch exports 3 functions, which base on corresponding OPAL APIs to get or set PCI slot status. Those functions are going to be used by PCI hotplug module in subsequent patches: pnv_pci_get_presence_status() opal_pci_get_presence_status() pn

Re: [PATCH v4 15/21] powerpc/pci: Delay creating pci_dn

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:03 PM, Gavin Shan wrote: The pci_dn instances are allocated from memblock or bootmem when creating PCI controller (hoses) in setup_arch(). The PCI hotplug, which will be supported by proceeding patches, will release PCI device nodes and their corresponding pci_dn on unplugging ev

Re: [PATCH v4 16/21] powerpc/pci: Create eeh_dev while creating pci_dn

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:03 PM, Gavin Shan wrote: The eeh_dev is always created based on pci_dn, but with initcall supported by core_initcall_sync(). The patch creates eeh_dev when pci_dn is created, indicating they have same life cycle. Signed-off-by: Gavin Shan --- arch/powerpc/include/asm/eeh.h

Re: [PATCH v4 21/21] pci/hotplug: PowerPC PowerNV PCI hotplug driver

2015-05-09 Thread Alexey Kardashevskiy
On 05/01/2015 04:03 PM, Gavin Shan wrote: The patch intends to add standalone driver to support PCI hotplug for PowerPC PowerNV platform, which runs on top of skiboot firmware. The firmware identified hotpluggable slots and marked their device tree node with proper "ibm,slot-pluggable" and "ibm,r

Re: [PATCH kernel v9 26/32] powerpc/iommu: Add userspace view of TCE table

2015-05-10 Thread Alexey Kardashevskiy
On 05/05/2015 10:02 PM, David Gibson wrote: On Fri, May 01, 2015 at 05:12:45PM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 02:23 PM, David Gibson wrote: On Fri, May 01, 2015 at 02:01:17PM +1000, Alexey Kardashevskiy wrote: On 04/29/2015 04:31 PM, David Gibson wrote: On Sat, Apr 25, 2015

Re: [PATCH kernel v9 27/32] powerpc/iommu/ioda2: Add get_table_size() to calculate the size of future table

2015-05-10 Thread Alexey Kardashevskiy
On 05/05/2015 09:58 PM, David Gibson wrote: On Fri, May 01, 2015 at 04:53:08PM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 03:12 PM, David Gibson wrote: On Fri, May 01, 2015 at 02:10:58PM +1000, Alexey Kardashevskiy wrote: On 04/29/2015 04:40 PM, David Gibson wrote: On Sat, Apr 25, 2015

Re: [PATCH kernel v9 31/32] vfio: powerpc/spapr: Support multiple groups in one container if possible

2015-05-10 Thread Alexey Kardashevskiy
On 05/05/2015 09:50 PM, David Gibson wrote: On Fri, May 01, 2015 at 04:05:24PM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 02:33 PM, David Gibson wrote: On Thu, Apr 30, 2015 at 07:33:09PM +1000, Alexey Kardashevskiy wrote: On 04/30/2015 05:22 PM, David Gibson wrote: On Sat, Apr 25, 2015

Re: [PATCH kernel v9 26/32] powerpc/iommu: Add userspace view of TCE table

2015-05-10 Thread Alexey Kardashevskiy
On 05/11/2015 12:11 PM, Alexey Kardashevskiy wrote: On 05/05/2015 10:02 PM, David Gibson wrote: On Fri, May 01, 2015 at 05:12:45PM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 02:23 PM, David Gibson wrote: On Fri, May 01, 2015 at 02:01:17PM +1000, Alexey Kardashevskiy wrote: On 04/29

Re: [PATCH v4 07/21] powerpc/powernv: Release PEs dynamically

2015-05-11 Thread Alexey Kardashevskiy
On 05/11/2015 04:25 PM, Gavin Shan wrote: On Sat, May 09, 2015 at 10:43:23PM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 04:02 PM, Gavin Shan wrote: The original code doesn't support releasing PEs dynamically, meaning that PE and the associated resources (IO, M32, M64 and DMA) can

Re: [PATCH v4 09/21] powerpc/powernv: Use PCI slot reset infrastructure

2015-05-11 Thread Alexey Kardashevskiy
On 05/11/2015 04:45 PM, Gavin Shan wrote: On Sat, May 09, 2015 at 11:41:05PM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 04:02 PM, Gavin Shan wrote: For PowerNV platform, running on top of skiboot, all PE level reset should be routed to firmware if the bridge of the PE primary bus has

Re: [PATCH v4 10/21] powerpc/powernv: Fundamental reset for PCI bus reset

2015-05-11 Thread Alexey Kardashevskiy
On 05/11/2015 04:47 PM, Gavin Shan wrote: On Sun, May 10, 2015 at 12:12:18AM +1000, Alexey Kardashevskiy wrote: On 05/01/2015 04:02 PM, Gavin Shan wrote: Function pnv_pci_reset_secondary_bus() is used to reset specified PCI bus, which is leaded by root complex or PCI bridge. That means the

[PATCH kernel v10 00/34] powerpc/iommu/vfio: Enable Dynamic DMA windows

2015-05-11 Thread Alexey Kardashevskiy
reregistration is required for DDW * PEs (IOMMU groups) are passed to VFIO with no DMA windows at all so we do not bother with iommu_table::it_map anymore * added multilevel TCE tables support to support really huge guests v2: * added missing __pa() in "powerpc/powernv: Release replaced TCE

[PATCH kernel v10 04/34] powerpc/iommu: Put IOMMU group explicitly

2015-05-11 Thread Alexey Kardashevskiy
iommu_free_table(). Later it will be changed to receive a table_group and we will have to change less lines then. This should cause no behavioural change. Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kernel/iommu.c | 7 --- arch/powerpc/platforms/powernv/pci-ioda.c

[PATCH kernel v10 01/34] powerpc/eeh/ioda2: Use device::iommu_group to check IOMMU group

2015-05-11 Thread Alexey Kardashevskiy
e the @add_to_iommu_group parameter from pnv_ioda_setup_bus_dma(). Signed-off-by: Alexey Kardashevskiy --- arch/powerpc/kernel/eeh.c | 4 +--- arch/powerpc/platforms/powernv/pci-ioda.c | 27 +-- 2 files changed, 6 insertions(+), 25 deletions(-) diff --

  1   2   3   4   5   6   7   8   9   10   >