RE: [PATCH v3 02/10] devicetree: Add generic IOMMU device tree bindings

2014-07-03 Thread Varun Sethi
> -Original Message- > From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > boun...@lists.linux-foundation.org] On Behalf Of Thierry Reding > Sent: Friday, June 27, 2014 2:20 AM > To: Rob Herring; Pawel Moll; Mark Rutland; Ian Campbell; Kumar Gala; > Stephen Warren; Arnd Bergma

Re: [RFC/PATCH 2/7] iommu-api: Add map_range/unmap_range functions

2014-07-03 Thread Hiroshi Doyu
Hi Olav, Olav Haugan writes: > Mapping and unmapping are more often than not in the critical path. > map_range and unmap_range allows SMMU driver implementations to optimize > the process of mapping and unmapping buffers into the SMMU page tables. > Instead of mapping one physical address, do TL

Re: [PATCH 1/6] mmput: use notifier chain to call subsystem exit handler.

2014-07-03 Thread Jerome Glisse
On Fri, Jul 04, 2014 at 01:15:41AM +0200, Joerg Roedel wrote: > Hi Jerome, > > On Thu, Jul 03, 2014 at 02:30:26PM -0400, Jerome Glisse wrote: > > Joerg do you still object to this patch ? > > Yes. > > > Again the natural place to call this is from mmput and the fact that many > > other subsystem

Re: [PATCH 1/6] mmput: use notifier chain to call subsystem exit handler.

2014-07-03 Thread Joerg Roedel
Hi Jerome, On Thu, Jul 03, 2014 at 02:30:26PM -0400, Jerome Glisse wrote: > Joerg do you still object to this patch ? Yes. > Again the natural place to call this is from mmput and the fact that many > other subsystem already call in from there to cleanup there own per mm data > structure is a te

Re: [PATCH 1/6] mmput: use notifier chain to call subsystem exit handler.

2014-07-03 Thread Jerome Glisse
On Tue, Jul 01, 2014 at 05:32:09PM -0400, Jerome Glisse wrote: > On Tue, Jul 01, 2014 at 11:06:20PM +0200, Joerg Roedel wrote: > > On Tue, Jul 01, 2014 at 03:33:44PM -0400, Jerome Glisse wrote: > > > On Tue, Jul 01, 2014 at 01:00:18PM +0200, Joerg Roedel wrote: > > > > No, its not in this case. The

Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Antonios and all, Recently, I want to test vfio on ARM and refer to this document "http://www.virtualopensystems.com/en/solutions/guides/vfio-on-arm/"; . Following is my test steps. 1. Get kernel src git clone git://github.com/virtualopensystems/linux-k

RE: [PATCH 0/3] iommu: Expose IOMMU information in sysfs

2014-07-03 Thread Varun Sethi
Hi Alex, This is on my todo list. I have a requirement for adding sysfs support for PAMU. Regards Varun > -Original Message- > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, July 03, 2014 9:39 PM > To: Joerg Roedel > Cc: iommu@lists.linux-foundation.org; dw...@

Re: [RFC/PATCH 7/7] iommu-api: Add domain attribute to enable coherent HTW

2014-07-03 Thread Will Deacon
On Wed, Jul 02, 2014 at 11:11:13PM +0100, Olav Haugan wrote: > On 7/1/2014 1:49 AM, Varun Sethi wrote: > > > > > >> -Original Message- > >> From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > >> boun...@lists.linux-foundation.org] On Behalf Of Olav Haugan > >> Sent: Monday, Ju

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Alvise , I have tried to use vfio-platform-v4 and vfio-platform-v5 kernel, but it doesn't work. Kernel Panic as mentioned before : [ cut here ] kernel BUG at mm/slub.c:3392! Internal error: Oops - BUG: 0 [#1] SMP ARM Modules linked in: CPU: 1 PID: 1711 Comm: qemu-syst

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Alvise Rigo
Hi Shannon, Thank you for reporting this issue, the device tree file was indeed missing. To solve the problem, you can apply the following patch to the repository you mentioned (git://github.com/virtualopensystems/arm-dts.git). For your information, soon we will update the guide with a newer vers

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread alvise rigo
Hi, On Tue, Jun 24, 2014 at 8:59 AM, Shannon Zhao wrote: > Hi Alvise, > > Thanks for your help. > Now I can see /dev/vfio/vfio and /dev/vfio/0 after executing "echo > 2c0a.dma > /sys/bus/platform/drivers/vfio-platform/vfio_bind". > But when using qemu to start guest, there is an error : > >

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Alvise, Thanks for your help. I'm using pl330-vfio-dev branch but it's not up-to-date. Then I update the qemu code. Now I can start up the guest. I run the following cmd in guest : echo 1 > /sys/kernel/debug/vosys_dmatest/start dmaengine: dma_sync_wait: timeout!

Re: [PATCH] iommu/intel: GAW only gets smaller by adding devices

2014-07-03 Thread Matthieu
Tested-by: mspe...@users.sourceforge.net Problem described in bug 76331 is fully solved by Alex's patch. Could it be included in next 3.15 release ? Thanks ! Matthieu On Thu, May 29, 2014 at 10:23 PM, Alex Williamson < alex.william...@redhat.com> wrote: > As analyzed in https://bugzilla.kern

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
On 2014/6/19 20:12, bharat.bhus...@freescale.com wrote: > > >> -Original Message- >> From: Shannon Zhao [mailto:zhaoshengl...@huawei.com] >> Sent: Thursday, June 19, 2014 5:38 PM >> To: Alvise Rigo; Bhushan Bharat-R65777; a.mota...@virtualopensystems.com; >> iommu@lists.linux-foundation

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
On 2014/6/19 18:47, Alvise Rigo wrote: > Hi, > > Il 19/06/2014 11:38, Shannon Zhao ha scritto: >> Hi Bharat, >> >> On 2014/6/19 17:19, bharat.bhus...@freescale.com wrote: >>> >>> -Original Message- From: kvmarm-boun...@lists.cs.columbia.edu [mailto:kvmarm- boun...@lists.cs

RE: [RFC PATCH v6 04/20] iommu/arm-smmu: add capability IOMMU_CAP_INTR_REMAP

2014-07-03 Thread Chalamarla, Tirumalesh
When I say emulating ITS, I mean translating guest ITS commands to physical ITS commands and placing them in physical queue. Regards, Tirumalesh. -Original Message- From: kvmarm-boun...@lists.cs.columbia.edu [mailto:kvmarm-boun...@lists.cs.columbia.edu] On Behalf Of Chalamarla, Tirum

RE: [RFC PATCH v6 04/20] iommu/arm-smmu: add capability IOMMU_CAP_INTR_REMAP

2014-07-03 Thread Chalamarla, Tirumalesh
Sorry there was a type, The question is: How is VFIO restricting software from writing to MSI/MSI-X vectors of the device. -Original Message- From: Chalamarla, Tirumalesh Sent: Thursday, June 26, 2014 11:16 AM To: Chalamarla, Tirumalesh; Joerg Roedel; Will Deacon Cc: k...

RE: [RFC PATCH v6 04/20] iommu/arm-smmu: add capability IOMMU_CAP_INTR_REMAP

2014-07-03 Thread Chalamarla, Tirumalesh
Marc, What is your opinion on ITS emulation . is it should be part of KVM or VFIO. Also this code needs to depend on ITS host driver a lot, Host ITS driver needs to have an interface for this code to use. Thanks, Tirumalesh -Original Message- From: Will Deacon [m

RE: [PATCH 1/6] mmput: use notifier chain to call subsystem exit handler.

2014-07-03 Thread Lewycky, Andrew
> On Mon, Jun 30, 2014 at 08:16:23PM +0200, Joerg Roedel wrote: > > On Mon, Jun 30, 2014 at 12:06:05PM -0400, Jerome Glisse wrote: > > > No this patch does not duplicate it. Current user of mmu_notifier > > > rely on file close code path to call mmu_notifier_unregister. New > > > code like AMD IOMM

Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-03 Thread Emil Medve
On 06/24/2014 08:57 AM, Varun Sethi wrote: > is_power_of_2 requires an unsigned long parameter which would > lead to truncation of 64 bit values on 32 bit architectures. > > __ffs also expects an unsigned long parameter thus won't work > for 64 bit values on 32 bit architectures. > > Signed-off-b

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Alvise Rigo
Hi Shannon, On 25/06/2014 05:09, Shannon Zhao wrote: > Hi Alvise , > > I have tried to use vfio-platform-v4 and vfio-platform-v5 kernel, but it > doesn't work. Strange, I tried to replicate it with both v4 and v5 and it worked fine. > Kernel Panic as mentioned before : > > [ cut

RE: [PATCH 1/3] PCI/MSI: Add pci_enable_msi_partial()

2014-07-03 Thread David Laight
From: Bjorn Helgaas > On Tue, Jun 10, 2014 at 03:10:30PM +0200, Alexander Gordeev wrote: > > There are PCI devices that require a particular value written > > to the Multiple Message Enable (MME) register while aligned on > > power of 2 boundary value of actually used MSI vectors 'nvec' > > is a le

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Bharat, Thanks for your help. I executed the following cmd: echo vfio-platform > /sys/bus/platform/devices/2c0a.dma/driver_override But there is no /dev/vfio/0 and error reported starting guest -nographic can not be used with -daemonize char device redirected to /

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Alvise, I'm so sorry that I can't use qemu-debootstrap because my environment can't access some links using proxy. Are there other ways to get a proper fs? Thanks Shannon On 2014/6/20 15:15, Alvise Rigo wrote: > Hi Shannon, > > If you follow the steps in the section "Creating the File Syste

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Alvise, Thanks for your reply. I have apply the patch and could see the DMA devices. But there is no vosys_dmatest int the directory "/sys/kernel/debug/" after mounting debugfs. I found that the branch vfio-platform-v4 doesn't contain the module vosys_dmatest. Then I port it from the branch p

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Alvise Rigo
Yes, that is an old guide based on VFIO v4. We will update it soon. Regards, alvise Il 19/06/2014 12:18, Eric Auger ha scritto: > On 06/19/2014 12:15 PM, bharat.bhus...@freescale.com wrote: >> >> >>> -Original Message- >>> From: Eric Auger [mailto:eric.au...@linaro.org] >>> Sent: Thursday

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Alvise Rigo
Hi Shannon, If you follow the steps in the section "Creating the File System" of the guide you should be able to obtain a working fs. Regards, alvise Il 20/06/2014 04:57, Shannon Zhao ha scritto: > Hi Bharat, > > Thanks for your advice . > > I'm using the rootfs getting from the url > "http:/

RE: [RFC PATCH v6 04/20] iommu/arm-smmu: add capability IOMMU_CAP_INTR_REMAP

2014-07-03 Thread Chalamarla, Tirumalesh
Thanks for the clarification Alex, That’s exactly my point, why are we relying on QEMU or something else to emulate the MSI space when we can directly give access to devices using ITS (of course with a small emulation code). This way we are also benefited from all ITS services like VCPU migratio

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Alvise Rigo
Hello, This is a known error, caused by using the last version of VFIO with an old version of QEMU. Try to use the vfio-platform-v4 kernel, if it still doesn't work, use the vfio-platform-v5. Regards, alvise Il 24/06/2014 15:19, Shannon Zhao ha scritto: > Hi Alvise, > > Thanks for your help. >

RE: [RFC PATCH v6 04/20] iommu/arm-smmu: add capability IOMMU_CAP_INTR_REMAP

2014-07-03 Thread Chalamarla, Tirumalesh
Forgive me if this discussion is not relative here, but I thought it is. How is VFIO restricting devices from writing to MSI/MSI-X, Is all the vector area is mapped by VFIO to trap the accesses. I am asking this because we might need to emulate ITS somewhere either in KVM or VFIO to provide

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Bharat, Thanks for your advice . I'm using the rootfs getting from the url "http://www.virtualopensystems.com/downloads/guides/kvm_on_arm/fs-alip-armel.cramfs";. Can you give me another link to get a newer rootfs? Thank you Shannon On 2014/6/19 20:20, bharat.bhus...@freescale.com wrote: >

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Alvise Rigo
This is a QEMU error. Are you using the pl330-vfio-dev branch? Is it up-to-date? alvise Il 24/06/2014 11:00, Shannon Zhao ha scritto: > Hi Bharat, > > > ls -l /sys/bus/platform/devices/2c0a.dma/iommu_group/devices > total 0 > lrwxrwxrwx 1 root root 0 Jan 1 02:58 2c0a.dma -> > ../../..

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Alvise Rigo
Linaro has a great set of pre-built images here http://releases.linaro.org/. For example these should work fine: http://releases.linaro.org/13.12/ubuntu/saucy-images alvise Il 20/06/2014 10:23, Shannon Zhao ha scritto: > Hi Alvise, > > I'm so sorry that I can't use qemu-debootstrap because my e

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Bharat, ls -l /sys/bus/platform/devices/2c0a.dma/iommu_group/devices total 0 lrwxrwxrwx 1 root root 0 Jan 1 02:58 2c0a.dma -> ../../../../devices/2c0a.dma Then I run "echo 2c0a.dma > /sys/bus/platform/drivers/vfio-platform/bind". There is /dev/vfio/0. But there is also an

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Alvise Rigo
Il 19/06/2014 13:11, Shannon Zhao ha scritto: > > > On 2014/6/19 18:47, Alvise Rigo wrote: >> Hi, >> >> Il 19/06/2014 11:38, Shannon Zhao ha scritto: >>> Hi Bharat, >>> >>> On 2014/6/19 17:19, bharat.bhus...@freescale.com wrote: > -Original Message- > From: kvmarm-boun

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Alvise Rigo
Hi, Il 19/06/2014 11:38, Shannon Zhao ha scritto: > Hi Bharat, > > On 2014/6/19 17:19, bharat.bhus...@freescale.com wrote: >> >> >>> -Original Message- >>> From: kvmarm-boun...@lists.cs.columbia.edu [mailto:kvmarm- >>> boun...@lists.cs.columbia.edu] On Behalf Of Shannon Zhao >>> Sent: Thu

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Alvise, I run following cmds : echo 2c0a.dma > /sys/bus/platform/drivers/vfio-platform/vfio_bind ./qemu-system-arm -enable-kvm -M vexpress-a15 -cpu cortex-a15 \ -device pl330,vfio_group="/dev/vfio/0",vfio_device="2c0a.dma",vfio_container="/dev/vfio/vfio"

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Alvise, Thanks for your help. Now I can see /dev/vfio/vfio and /dev/vfio/0 after executing "echo 2c0a.dma > /sys/bus/platform/drivers/vfio-platform/vfio_bind". But when using qemu to start guest, there is an error : -nographic can not be used with -daemonize char device redirected to /dev

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Eric, Thanks for your reply. There is no such directory "/sys/bus/platform/devices/2c0a.dma/driver/". On 2014/6/19 18:11, Eric Auger wrote: > On 06/19/2014 11:38 AM, Shannon Zhao wrote: >> Hi Bharat, >> >> On 2014/6/19 17:19, bharat.bhus...@freescale.com wrote: >>> >>> -Original M

Re: Vfio-on-arm: the device tree does not contain the DMA device

2014-07-03 Thread Shannon Zhao
Hi Bharat, On 2014/6/19 17:19, bharat.bhus...@freescale.com wrote: > > >> -Original Message- >> From: kvmarm-boun...@lists.cs.columbia.edu [mailto:kvmarm- >> boun...@lists.cs.columbia.edu] On Behalf Of Shannon Zhao >> Sent: Thursday, June 19, 2014 2:45 PM >> To: Alvise Rigo; a.mota...@vi

[PATCH 09/24] drivers/iommu: check actual error on iommu_init

2014-07-03 Thread Jeff Liu
From: Jie Liu kset_create_and_add() has been fixed to return the actual error code ptr rather than NULL, so update iommu_init() to check the return value via IS_ERR() accordingly. Cc: Joerg Roedel Signed-off-by: Jie Liu --- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

What devices are using ATS/PRI?

2014-07-03 Thread Ilya Lesokhin
Hi, I'm doing research about support for I/O page faults and I'm trying to find out what devices are using it today. I've notice that the AMD IOMMUv2 driver has support for I/O page faults. However I'm a bit confused as to how it relates to ATS/PRI. I've gotten the impression that the code is use

Re: [PATCH 0/3] iommu: Expose IOMMU information in sysfs

2014-07-03 Thread Alex Williamson
On Mon, 2014-06-16 at 09:24 -0600, Alex Williamson wrote: > On Mon, 2014-06-16 at 17:16 +0200, Joerg Roedel wrote: > > On Thu, Jun 12, 2014 at 04:12:18PM -0600, Alex Williamson wrote: > > > Alex Williamson (3): > > > iommu: Add sysfs support for IOMMUs > > > iommu/intel: Make use of IOM

[PATCH 7/7] iommu: Remove pci.h

2014-07-03 Thread Alex Williamson
The single helper here no longer has any users. Signed-off-by: Alex Williamson --- drivers/iommu/pci.h | 29 - 1 file changed, 29 deletions(-) delete mode 100644 drivers/iommu/pci.h diff --git a/drivers/iommu/pci.h b/drivers/iommu/pci.h deleted file mode 100644 i

[RESEND PATCH v2] iommu/intel: Exclude devices using RMRRs from IOMMU API domains

2014-07-03 Thread Alex Williamson
The user of the IOMMU API domain expects to have full control of the IOVA space for the domain. RMRRs are fundamentally incompatible with that idea. We can neither map the RMRR into the IOMMU API domain, nor can we guarantee that the device won't continue DMA with the area described by the RMRR a

[PATCH 2/7] iommu/amd: Update to use PCI DMA aliases

2014-07-03 Thread Alex Williamson
AMD-Vi already has a concept of an alias provided via the IVRS table. Now that PCI-core also understands aliases, we need to incorporate both aspects when programming the IOMMU. IVRS is generally quite reliable, so we continue to prefer it when an alias is present. For cases where we have an IVRS

[PATCH 3/7] iommu/amd: Use iommu_group_get_for_dev()

2014-07-03 Thread Alex Williamson
The common iommu_group_get_for_dev() allows us to greatly simplify our group lookup for a new device. Also, since we insert IVRS aliases into the PCI DMA alias quirks, we should alway come up with the same results as the existing code. Signed-off-by: Alex Williamson Cc: Joerg Roedel --- drive

[PATCH 6/7] iommu/fsl: Use iommu_group_get_for_dev() for IOMMU groups

2014-07-03 Thread Alex Williamson
Drop custom code and use IOMMU provided grouping support for PCI. Signed-off-by: Alex Williamson Acked-by: Varun Sethi --- drivers/iommu/fsl_pamu_domain.c | 66 +-- 1 file changed, 1 insertion(+), 65 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain

[PATCH 5/7] iommu/intel: Update to use PCI DMA aliases

2014-07-03 Thread Alex Williamson
VT-d code currently makes use of pci_find_upstream_pcie_bridge() in order to find the topology based alias of a device. This function has a few problems. First, it doesn't check the entire alias path of the device to the root bus, therefore if a PCIe device is masked upstream, the wrong result is

[PATCH 4/7] iommu/intel: Use iommu_group_get_for_dev()

2014-07-03 Thread Alex Williamson
The IOMMU code now provides a common interface for finding or creating an IOMMU group for a device on PCI buses. Make use of it and remove piles of code. Signed-off-by: Alex Williamson Cc: David Woodhouse --- drivers/iommu/intel-iommu.c | 79 ++- 1 fi

[PATCH 1/7] iommu: Create central IOMMU group lookup/creation interface

2014-07-03 Thread Alex Williamson
Currently each IOMMU driver that supports IOMMU groups has its own code for discovering the base device used in grouping. This code is generally not specific to the IOMMU hardware, but to the bus of the devices managed by the IOMMU. We can therefore create a common interface for supporting device

[PATCH 0/7] iommu: Fix DMA alias problems

2014-07-03 Thread Alex Williamson
This is effectively a resend of the iommu parts of the previously combined iommu and pci v4 series. The pci base changes are in, we just need the iommu changes to make them effective. These changes have proven to solve numerous issues with devices that use the wrong requester ID and bridges that

Re: [PATCH 2/5] iommu/arm-smmu: add support for PCI master devices

2014-07-03 Thread Will Deacon
On Thu, Jul 03, 2014 at 03:22:37PM +0100, Varun Sethi wrote: > Hi Will, Hi Varun, Thanks for taking a look at this! > > +static struct arm_smmu_master_cfg * > > +find_smmu_master_cfg(struct arm_smmu_device *smmu, struct device *dev) > > +{ > > + struct arm_smmu_master *master; > > + > > +

RE: [PATCH 2/5] iommu/arm-smmu: add support for PCI master devices

2014-07-03 Thread Varun Sethi
Hi Will, > -Original Message- > From: Will Deacon [mailto:will.dea...@arm.com] > Sent: Monday, June 30, 2014 4:22 PM > To: linux-arm-ker...@lists.infradead.org; iommu@lists.linux- > foundation.org > Cc: thierry.red...@gmail.com; a...@arndb.de; ohau...@codeaurora.org; > Sethi Varun-B16395;

RE: [RFC 01/10] iommu: Add IOMMU device registry

2014-07-03 Thread Varun Sethi
> -Original Message- > From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > boun...@lists.linux-foundation.org] On Behalf Of Thierry Reding > Sent: Friday, June 27, 2014 12:29 PM > To: Rob Herring; Pawel Moll; Mark Rutland; Ian Campbell; Kumar Gala; > Stephen Warren; Arnd Bergm