[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231204150900.GE1493156@nvidia.com>
Date: Mon, 4 Dec 2023 11:09:00 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Yan Zhao <yan.y.zhao@...el.com>
Cc: iommu@...ts.linux.dev, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, alex.williamson@...hat.com,
pbonzini@...hat.com, seanjc@...gle.com, joro@...tes.org,
will@...nel.org, robin.murphy@....com, kevin.tian@...el.com,
baolu.lu@...ux.intel.com, dwmw2@...radead.org, yi.l.liu@...el.com
Subject: Re: [RFC PATCH 10/42] iommu: Add new iommu op to create domains
managed by KVM
On Sat, Dec 02, 2023 at 05:20:07PM +0800, Yan Zhao wrote:
> @@ -522,6 +522,13 @@ __iommu_copy_struct_from_user_array(void *dst_data,
> * @domain_alloc_paging: Allocate an iommu_domain that can be used for
> * UNMANAGED, DMA, and DMA_FQ domain types.
> * @domain_alloc_sva: Allocate an iommu_domain for Shared Virtual Addressing.
> + * @domain_alloc_kvm: Allocate an iommu domain with type IOMMU_DOMAIN_KVM.
> + * It's called by IOMMUFD and must fully initialize the new
> + * domain before return.
> + * The @data is of type "const void *" whose format is defined
> + * in kvm arch specific header "asm/kvm_exported_tdp.h".
> + * Unpon success, domain of type IOMMU_DOMAIN_KVM is returned.
> + * Upon failure, ERR_PTR is returned.
> * @probe_device: Add device to iommu driver handling
> * @release_device: Remove device from iommu driver handling
> * @probe_finalize: Do final setup work after the device is added to an IOMMU
> @@ -564,6 +571,8 @@ struct iommu_ops {
> struct iommu_domain *(*domain_alloc_paging)(struct device *dev);
> struct iommu_domain *(*domain_alloc_sva)(struct device *dev,
> struct mm_struct *mm);
> + struct iommu_domain *(*domain_alloc_kvm)(struct device *dev, u32 flags,
> + const void *data);
This should pass in some kvm related struct here, it should not be
buried in data
Jason
Powered by blists - more mailing lists