Re: Host-PCI-Device mapping

2021-10-15 Thread Ajay Garg
Never mind, found the answers in kvm_set_user_memory :) On Fri, Oct 15, 2021 at 9:36 PM Ajay Garg wrote: > > Hello everyone. > > I have a x86_64 L1 guest, running on a x86_64 host, with a > host-pci-device attached to the guest. > The host runs with IOMMU enabled, and passthrough enabled. > >

Re: [PATCH v8 04/12] iommu/mediatek: Add device_link between the consumer and the larb devices

2021-10-15 Thread Yong Wu
On Mon, 2021-10-11 at 14:36 +0200, Dafna Hirschfeld wrote: > > On 29.09.21 03:37, Yong Wu wrote: > > MediaTek IOMMU-SMI diagram is like below. all the consumer connect > > with > > smi-larb, then connect with smi-common. > > > > M4U > > | > > smi-common > > | >

Host-PCI-Device mapping

2021-10-15 Thread Ajay Garg
Hello everyone. I have a x86_64 L1 guest, running on a x86_64 host, with a host-pci-device attached to the guest. The host runs with IOMMU enabled, and passthrough enabled. Following are the addresses of the bar0-region of the pci-device, as per the output of lspci -v : * On host (hpa) =>

Re: [PATCH v4 03/13] memory: mtk-smi: Use clk_bulk clock ops

2021-10-15 Thread AngeloGioacchino Del Regno
Il 15/10/21 15:43, Krzysztof Kozlowski ha scritto: On 15/10/2021 15:38, AngeloGioacchino Del Regno wrote: Use clk_bulk interface instead of the orginal one to simplify the code. For SMI larbs: Require apb/smi clocks while gals is optional. For SMI common: Require apb/smi/gals0/gal1 in has_gals

Re: [PATCH v4 03/13] memory: mtk-smi: Use clk_bulk clock ops

2021-10-15 Thread AngeloGioacchino Del Regno
Use clk_bulk interface instead of the orginal one to simplify the code. For SMI larbs: Require apb/smi clocks while gals is optional. For SMI common: Require apb/smi/gals0/gal1 in has_gals case. Otherwise, also only require apb/smi, No optional clk here. About the "has_gals"

Re: [PATCH v4 03/13] memory: mtk-smi: Use clk_bulk clock ops

2021-10-15 Thread Krzysztof Kozlowski
On 15/10/2021 15:38, AngeloGioacchino Del Regno wrote: >> Use clk_bulk interface instead of the orginal one to simplify the code. >> >> For SMI larbs: Require apb/smi clocks while gals is optional. >> For SMI common: Require apb/smi/gals0/gal1 in has_gals case. Otherwise, >> also

RE: [RFC 01/20] iommu/iommufd: Add /dev/iommu core

2021-10-15 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Friday, October 15, 2021 7:18 PM > > On Fri, Oct 15, 2021 at 09:18:06AM +, Liu, Yi L wrote: > > > > Acquire from the xarray is > > >rcu_lock() > > >ioas = xa_load() > > >if (ioas) > > > if (down_read_trylock(>destroying_lock)) > > > > all

Re: [RFC 01/20] iommu/iommufd: Add /dev/iommu core

2021-10-15 Thread Jason Gunthorpe via iommu
On Fri, Oct 15, 2021 at 09:18:06AM +, Liu, Yi L wrote: > > Acquire from the xarray is > >rcu_lock() > >ioas = xa_load() > >if (ioas) > > if (down_read_trylock(>destroying_lock)) > > all good suggestions, will refine accordingly. Here destroying_lock is a > rw_semaphore.

Re: [RFC 06/20] iommu: Add iommu_device_init[exit]_user_dma interfaces

2021-10-15 Thread Jason Gunthorpe via iommu
On Fri, Oct 15, 2021 at 01:29:16AM +, Tian, Kevin wrote: > Hi, Jason, > > > From: Jason Gunthorpe > > Sent: Wednesday, September 29, 2021 8:59 PM > > > > On Wed, Sep 29, 2021 at 12:38:35AM +, Tian, Kevin wrote: > > > > > /* If set the driver must call iommu_XX as the first action in

RE: [RFC 07/20] iommu/iommufd: Add iommufd_[un]bind_device()

2021-10-15 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Wednesday, September 22, 2021 1:15 AM > > On Sun, Sep 19, 2021 at 02:38:35PM +0800, Liu Yi L wrote: > > > +/* > > + * A iommufd_device object represents the binding relationship > > + * between iommufd and device. It is created per a successful > > + * binding

RE: [RFC 01/20] iommu/iommufd: Add /dev/iommu core

2021-10-15 Thread Liu, Yi L
> From: Jason Gunthorpe > Sent: Tuesday, September 21, 2021 11:42 PM > > On Sun, Sep 19, 2021 at 02:38:29PM +0800, Liu Yi L wrote: > > /dev/iommu aims to provide a unified interface for managing I/O address > > spaces for devices assigned to userspace. This patch adds the initial > > framework