[PATCH 4/7] powerpc: translate msi addr to iova if iommu is in use

2013-09-19 Thread Bharat Bhushan
If the device is attached with iommu domain then set MSI address to the iova configured in PAMU. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/sysdev/fsl_msi.c | 56 +++- 1 files changed, 54 insertions(+), 2 deletions(-) diff

[PATCH 1/7] powerpc: Add interface to get msi region information

2013-09-19 Thread Bharat Bhushan
to create IOMMU (Freescale PAMU) mapping for devices which are directly assigned using VFIO. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- arch/powerpc/include/asm/machdep.h |8 +++ arch/powerpc/include/asm/pci.h |2 + arch/powerpc/kernel/msi.c | 18

[PATCH 6/7] vfio: moving some functions in common file

2013-09-19 Thread Bharat Bhushan
Some function defined in vfio_iommu_type1.c were common and we want to use these for FSL IOMMU (PAMU) and iommu-none driver. So some of them are moved to vfio_iommu_common.c I think we can do more of that but we will take this step by step. Signed-off-by: Bharat Bhushan bharat.bhus

[PATCH 3/7] fsl iommu: add get_dev_iommu_domain

2013-09-19 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com returns the iommu_domain of the requested device for fsl pamu. Use PCI controller dev struct for pci devices as current LIODN schema assign LIODN to PCI controller not PCI device. This will be corrected with proper LIODN schema. Signed-off

[PATCH 7/7] vfio pci: Add vfio iommu implementation for FSL_PAMU

2013-09-19 Thread Bharat Bhushan
-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- drivers/vfio/Kconfig |6 + drivers/vfio/Makefile |1 + drivers/vfio/vfio_iommu_fsl_pamu.c | 952 include/uapi/linux/vfio.h | 100 4 files changed, 1059

[PATCH 2/9 v2] pci: msi: expose msi region information functions

2013-11-18 Thread Bharat Bhushan
So by now we have defined all the interfaces for getting the msi region, this patch expose the interface to linux subsystem. These will be used by vfio subsystem for setting up iommu for MSI interrupt of direct assignment devices. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- v1

[PATCH 1/9 v2] pci:msi: add weak function for returning msi region info

2013-11-18 Thread Bharat Bhushan
In Aperture type of IOMMU (like FSL PAMU), VFIO-iommu system need to know the MSI region to map its window in h/w. This patch just defines the required weak functions only and will be used by followup patches. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- v1-v2 - Added

[PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-11-18 Thread Bharat Bhushan
From: Bharat Bhushan bharat.bhus...@freescale.com PAMU (FSL IOMMU) has a concept of primary window and subwindows. Primary window corresponds to the complete guest iova address space (including MSI space), with respect to IOMMU_API this is termed as geometry. IOVA Base of subwindow is determined

[PATCH 5/9 v2] pci/msi: interface to set an iova for a msi region

2013-11-18 Thread Bharat Bhushan
This patch defines an interface by which a msi page can be mapped to a specific iova page. This is a requirement in aperture type of IOMMUs (like Freescale PAMU), where we map msi iova page just after guest memory iova address. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- v2

[PATCH 4/9 v2] powerpc: msi: Extend the msi region interface to get info from fsl_msi

2013-11-18 Thread Bharat Bhushan
(Freescale PAMU) mapping for devices which are directly assigned using VFIO. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- v1-v2 - Atomic increment of bank index for parallel probe of msi node arch/powerpc/sysdev/fsl_msi.c | 42 +++- arch

[PATCH 3/9 v2] powerpc: pci: Add arch specific msi region interface

2013-11-18 Thread Bharat Bhushan
This patch adds the interface to get the msi region information from arch specific code. The machine spicific code is not yet defined. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- v1-v2 - None arch/powerpc/include/asm/machdep.h |8 arch/powerpc/kernel/msi.c

[PATCH 8/9 v2] vfio: moving some functions in common file

2013-11-18 Thread Bharat Bhushan
. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- v1-v2 - removed un-necessary header file inclusion - mark static function which are internal to *common.c drivers/vfio/Makefile|4 +- drivers/vfio/vfio_iommu_common.c | 227

RE: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-11-21 Thread Bharat Bhushan
- p...@vger.kernel.org; linuxppc-...@lists.ozlabs.org; linux- ker...@vger.kernel.org; Bhushan Bharat-R65777 Subject: Re: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU) On Tue, 2013-11-19 at 10:47 +0530, Bharat Bhushan wrote: From: Bharat Bhushan bharat.bhus...@freescale.com

RE: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-11-28 Thread Bharat Bhushan
:33 +, Bharat Bhushan wrote: -Original Message- From: Alex Williamson [mailto:alex.william...@redhat.com] Sent: Friday, November 22, 2013 2:31 AM To: Wood Scott-B07421 Cc: Bhushan Bharat-R65777; linux-...@vger.kernel.org; ag...@suse.de; Yoder Stuart-B08248

RE: [PATCH 1/9 v2] pci:msi: add weak function for returning msi region info

2013-11-28 Thread Bharat Bhushan
, Bharat Bhushan wrote: In Aperture type of IOMMU (like FSL PAMU), VFIO-iommu system need to know the MSI region to map its window in h/w. This patch just defines the required weak functions only and will be used by followup patches. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com

RE: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-12-05 Thread Bharat Bhushan
; linux-ker...@vger.kernel.org Subject: Re: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU) On Thu, 2013-11-28 at 03:19 -0600, Bharat Bhushan wrote: -Original Message- From: Bhushan Bharat-R65777 Sent: Wednesday, November 27, 2013 9:39 PM To: 'Alex Williamson

RE: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU)

2013-12-05 Thread Bharat Bhushan
; linux-ker...@vger.kernel.org Subject: Re: [PATCH 0/9 v2] vfio-pci: add support for Freescale IOMMU (PAMU) On Sun, 2013-11-24 at 23:33 -0600, Bharat Bhushan wrote: -Original Message- From: Alex Williamson [mailto:alex.william...@redhat.com] Sent: Friday, November 22, 2013 2:31

RE: RFC: extend iommu-map binding to support #iommu-cells > 1

2016-12-15 Thread Bharat Bhushan
> -Original Message- > From: Stuart Yoder > Sent: Friday, December 16, 2016 8:07 AM > To: Mark Rutland <mark.rutl...@arm.com>; robin.mur...@arm.com; > will.dea...@arm.com > Cc: robh...@kernel.org; Bharat Bhushan <bharat.bhus...@nxp.com>; > Nipun G

RE: RFC: extend iommu-map binding to support #iommu-cells > 1

2016-12-16 Thread Bharat Bhushan
> -Original Message- > From: Robin Murphy [mailto:robin.mur...@arm.com] > Sent: Friday, December 16, 2016 8:21 PM > To: Stuart Yoder <stuart.yo...@nxp.com>; Mark Rutland > <mark.rutl...@arm.com> > Cc: will.dea...@arm.com; robh...@kernel.org; Bharat Bhu

RE: [PATCH v8 00/18] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA reserved regions

2017-01-11 Thread Bharat Bhushan
t.agra...@arm.com; Diana Madalina > Craciun <diana.crac...@nxp.com>; gpkulka...@gmail.com; > shank...@codeaurora.org; Bharat Bhushan <bharat.bhus...@nxp.com>; > geethasowjanya.ak...@gmail.com > Subject: [PATCH v8 00/18] KVM PCIe/MSI passthrough on ARM/ARM64 and > IOVA reserved re

RE: [PATCH v6 17/18] vfio/type1: Check MSI remapping at irq domain level

2017-01-06 Thread Bharat Bhushan
> -Original Message- > From: Marc Zyngier [mailto:marc.zyng...@arm.com] > Sent: Friday, January 06, 2017 2:50 PM > To: Auger Eric <eric.au...@redhat.com>; Bharat Bhushan > <bharat.bhus...@nxp.com>; eric.auger@gmail.com; > christoffer.d...@li

RE: [RFC PATCH] iommu/arm-smmu: Add global SMR masking property

2017-01-09 Thread Bharat Bhushan
Hi Robin, > -Original Message- > From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > boun...@lists.linux-foundation.org] On Behalf Of Nipun Gupta > Sent: Sunday, December 18, 2016 2:37 AM > To: Robin Murphy ; iommu@lists.linux- > foundation.org;

RE: [PATCH v5 13/17] irqdomain: irq_domain_check_msi_remap

2017-01-05 Thread Bharat Bhushan
Craciun <diana.crac...@nxp.com>; iommu@lists.linux- > foundation.org; pranav.sawargaon...@gmail.com; Bharat Bhushan > <bharat.bhus...@nxp.com>; shank...@codeaurora.org; > gpkulka...@gmail.com > Subject: Re: [PATCH v5 13/17] irqdomain: irq_domain_check_msi_remap > > Hi M

RE: [PATCH v6 17/18] vfio/type1: Check MSI remapping at irq domain level

2017-01-06 Thread Bharat Bhushan
t.agra...@arm.com; Diana Madalina > Craciun <diana.crac...@nxp.com>; gpkulka...@gmail.com; > shank...@codeaurora.org; Bharat Bhushan <bharat.bhus...@nxp.com>; > geethasowjanya.ak...@gmail.com > Subject: [PATCH v6 17/18] vfio/type1: Check MSI remapping at irq domain > level

RE: [RFC v4 00/16] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA reserved regions

2016-12-19 Thread Bharat Bhushan
awargaon...@gmail.com; > iommu@lists.linux-foundation.org; punit.agra...@arm.com; Diana Madalina > Craciun <diana.crac...@nxp.com>; gpkulka...@gmail.com; > shank...@codeaurora.org; Bharat Bhushan <bharat.bhus...@nxp.com> > Subject: [RFC v4 00/16] KVM PCIe/MSI passthrough on AR

RE: [RFC v3 00/10] KVM PCIe/MSI passthrough on ARM/ARM64 and IOVA reserved regions

2016-12-07 Thread Bharat Bhushan
Hi Eric, I have tested this series on NXP platform. Thanks -Bharat > -Original Message- > From: iommu-boun...@lists.linux-foundation.org [mailto:iommu- > boun...@lists.linux-foundation.org] On Behalf Of Eric Auger > Sent: Tuesday, November 15, 2016 6:39 PM > To: eric.au...@redhat.com;

RE: [virtio-dev] [RFC] virtio-iommu version 0.4

2017-08-17 Thread Bharat Bhushan
x-foundation.org; virtio-...@lists.oasis-open.org; > will.dea...@arm.com; robin.mur...@arm.com; lorenzo.pieral...@arm.com; > m...@redhat.com; jasow...@redhat.com; marc.zyng...@arm.com; > eric.au...@redhat.com; eric.auger@gmail.com; Bharat Bhushan > <bharat.bhus...@nxp.com>; pet...@

RE: [RFC PATCH kvmtool 00/15] Add virtio-iommu

2017-05-22 Thread Bharat Bhushan
Hi Jean, I am trying to run and review on my side but I see Linux patches are not with latest kernel version. Will it be possible for you to share your Linux and kvmtool git repository reference? Thanks -Bharat > -Original Message- > From:

RE: [PATCH] iommu/dma: Setup iova_domain granule for IOMMU_DMA_MSI cookies

2017-05-04 Thread Bharat Bhushan
Hi Robin, I faced same issue on our platform and debugged to get the root cause of the issue. Also fixed in somewhat similar way, cleared iova_off and not change size for if cookie->type is IOMMU_DMA_MSI_COOKIE. Anyways that was not as good as below changes. While just now I saw this was

RE: [RFC] virtio-iommu version 0.4

2017-09-12 Thread Bharat Bhushan
sts.linux-foundation.org; virtio-...@lists.oasis-open.org > Cc: will.dea...@arm.com; robin.mur...@arm.com; > lorenzo.pieral...@arm.com; m...@redhat.com; jasow...@redhat.com; > marc.zyng...@arm.com; eric.auger@gmail.com; Bharat Bhushan > <bharat.bhus...@nxp.com>; pet...@redhat.com

RE: [PATCH 2/6 v2] iommu: of: make of_pci_map_rid() available for other devices too

2018-04-17 Thread Bharat Bhushan
xppc- > d...@lists.ozlabs.org; linux-...@vger.kernel.org; Bharat Bhushan > <bharat.bhus...@nxp.com>; stuyo...@gmail.com; Laurentiu Tudor > <laurentiu.tu...@nxp.com>; Leo Li <leoyang...@nxp.com> > Subject: Re: [PATCH 2/6 v2] iommu: of: make of_pci_map_rid() available for > other

RE: [PATCH v2 1/2] dma-mapping: move dma configuration to bus infrastructure

2018-03-21 Thread Bharat Bhushan
gt; ker...@vger.kernel.org; iommu@lists.linux-foundation.org; linux- > wirel...@vger.kernel.org; linux-arm-...@vger.kernel.org; linux- > s...@vger.kernel.org; dmaeng...@vger.kernel.org; dri- > de...@lists.freedesktop.org; linux-te...@vger.kernel.org; > devicet...@vger.kernel.org; linux-...@v

RE: [PATCH v5 0/7] Add virtio-iommu driver

2018-11-26 Thread Bharat Bhushan
robin.mur...@arm.com; > will.dea...@arm.com; lorenzo.pieral...@arm.com; Bharat Bhushan > > Subject: Re: [PATCH v5 0/7] Add virtio-iommu driver > > Hi Jean, > > On 11/22/18 8:37 PM, Jean-Philippe Brucker wrote: > > Implement the virtio-iommu driver, following specificatio

RE: [EXT] Re: [PATCH v2 3/3] iommu/virtio: Reject IOMMU page granule larger than PAGE_SIZE

2020-03-26 Thread Bharat Bhushan
Hi Jean, > -Original Message- > From: Auger Eric > Sent: Thursday, March 26, 2020 11:11 PM > To: Jean-Philippe Brucker ; iommu@lists.linux- > foundation.org > Cc: virtualizat...@lists.linux-foundation.org; j...@8bytes.org; > m...@redhat.com; > jasow...@re

[RFC PATCH v2] iommu/virtio: Use page size bitmap supported by endpoint

2020-04-01 Thread Bharat Bhushan
Different endpoint can support different page size, probe endpoint if it supports specific page size otherwise use global page sizes. Signed-off-by: Bharat Bhushan --- drivers/iommu/virtio-iommu.c | 33 +++ include/uapi/linux/virtio_iommu.h | 7 +++ 2 files

[RFC PATCH v4] iommu/virtio: Use page size bitmap supported by endpoint

2020-04-02 Thread Bharat Bhushan
Different endpoint can support different page size, probe endpoint if it supports specific page size otherwise use global page sizes. Signed-off-by: Bharat Bhushan --- v3->v4: - Fix whitespace error v2->v3: - Fixed error return for incompatible endpoint - __u64 changed to __le64 in

[RFC PATCH v3] iommu/virtio: Use page size bitmap supported by endpoint

2020-04-02 Thread Bharat Bhushan
Different endpoint can support different page size, probe endpoint if it supports specific page size otherwise use global page sizes. Signed-off-by: Bharat Bhushan --- drivers/iommu/virtio-iommu.c | 54 +++ include/uapi/linux/virtio_iommu.h | 7 2 files

RE: [EXT] Re: [RFC PATCH v2] iommu/virtio: Use page size bitmap supported by endpoint

2020-04-01 Thread Bharat Bhushan
> -Original Message- > From: Jean-Philippe Brucker > Sent: Wednesday, April 1, 2020 9:20 PM > To: Robin Murphy > Cc: Bharat Bhushan ; j...@8bytes.org; > m...@redhat.com; jasow...@redhat.com; virtualization@lists.linux- > foundation.org; iommu@lists.linux-foundat

[PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-05 Thread Bharat Bhushan
Different endpoint can support different page size, probe endpoint if it supports specific page size otherwise use global page sizes. Signed-off-by: Bharat Bhushan --- v4->v5: - Rebase to Linux v5.7-rc4 v3->v4: - Fix whitespace error v2->v3: - Fixed error return for incompatible

RE: [EXT] Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-13 Thread Bharat Bhushan
Hi Jean, > -Original Message- > From: Michael S. Tsirkin > Sent: Wednesday, May 6, 2020 5:53 AM > To: Bharat Bhushan > Cc: jean-phili...@linaro.org; j...@8bytes.org; jasow...@redhat.com; > virtualizat...@lists.linux-foundation.org; iommu@lists.linux-foundatio

[PATCH v6] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-14 Thread Bharat Bhushan
to use domain supported page sizes only. Signed-off-by: Bharat Bhushan --- v5->v6 - property length before dereference - Error out on no supported page sizes (page-size-mask is zero) - Allow device to attach to domain even it supports minimum of domain supported page sizes. In that c

[PATCH v6] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-14 Thread Bharat Bhushan
to use domain supported page sizes only. Signed-off-by: Bharat Bhushan --- v5->v6 - property length before dereference - Error out on no supported page sizes (page-size-mask is zero) - Allow device to attach to domain even it supports minimum of domain supported page sizes. In that c

RE: [EXT] Re: [PATCH v5] iommu/virtio: Use page size bitmap supported by endpoint

2020-05-07 Thread Bharat Bhushan
> -Original Message- > From: Michael S. Tsirkin > Sent: Wednesday, May 6, 2020 5:53 AM > To: Bharat Bhushan > Cc: jean-phili...@linaro.org; j...@8bytes.org; jasow...@redhat.com; > virtualizat...@lists.linux-foundation.org; iommu@lists.linux-foundatio

RE: [EXT] Re: [PATCH RFC] iommu/virtio: Use page size bitmap supported by endpoint

2020-03-23 Thread Bharat Bhushan
Hi Jean, > -Original Message- > From: Jean-Philippe Brucker > Sent: Monday, March 23, 2020 3:30 PM > To: Bharat Bhushan > Cc: j...@8bytes.org; m...@redhat.com; jasow...@redhat.com; > virtualizat...@lists.linux-foundation.org; iommu@lists.linux-foundation.org; >

RE: [EXT] Re: [PATCH RFC] iommu/virtio: Use page size bitmap supported by endpoint

2020-03-23 Thread Bharat Bhushan
Hi Jean, > -Original Message- > From: Jean-Philippe Brucker > Sent: Monday, March 23, 2020 3:30 PM > To: Bharat Bhushan > Cc: j...@8bytes.org; m...@redhat.com; jasow...@redhat.com; > virtualizat...@lists.linux-foundation.org; iommu@lists.linux-foundation.org; >