[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Ye5zUapC/YcZs7kl@infradead.org>
Date: Mon, 24 Jan 2022 01:37:21 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Lu Baolu <baolu.lu@...ux.intel.com>
Cc: Joerg Roedel <joro@...tes.org>, Jason Gunthorpe <jgg@...dia.com>,
Christoph Hellwig <hch@...radead.org>,
Ben Skeggs <bskeggs@...hat.com>,
Kevin Tian <kevin.tian@...el.com>,
Ashok Raj <ashok.raj@...el.com>, Will Deacon <will@...nel.org>,
Robin Murphy <robin.murphy@....com>,
Alex Williamson <alex.williamson@...hat.com>,
Eric Auger <eric.auger@...hat.com>,
Liu Yi L <yi.l.liu@...el.com>,
Jacob jun Pan <jacob.jun.pan@...el.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>,
iommu@...ts.linux-foundation.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 7/7] iommu: Add iommu_domain::domain_ops
On Mon, Jan 24, 2022 at 03:11:02PM +0800, Lu Baolu wrote:
> Add a domain specific callback set, domain_ops, for vendor iommu driver
> to provide domain specific operations. Move domain-specific callbacks
> from iommu_ops to the domain_ops and hook them when a domain is allocated.
Ah, that's what I meant earlier. Perfect!
Nit: I don't think vendor is the right term here.
Maybe something like:
iommut: split struct iommu_ops
Move the domain specific operations out of struct iommu_ops into a new
structure that only has domain specific operations. This solves
the problem of needing to know if the method vector for a given
operation needs to be retreived from the device or th domain.
> +struct domain_ops {
This needs to keep an iommu in the name, i.e. iommu_domain_ops.
> + phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, dma_addr_t iova);
Overly long line.
> +static inline void iommu_domain_set_ops(struct iommu_domain *domain,
> + const struct domain_ops *ops)
> +{
> + domain->ops = ops;
> +}
Do we really need this helper?
> +static const struct domain_ops amd_domain_ops;
Can we avoid these forward declarations or would that cause too much
churn?
Powered by blists - more mailing lists