[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250123132532.GK5556@nvidia.com>
Date: Thu, 23 Jan 2025 09:25:32 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: "Tian, Kevin" <kevin.tian@...el.com>
Cc: Nicolin Chen <nicolinc@...dia.com>, "will@...nel.org" <will@...nel.org>,
"robin.murphy@....com" <robin.murphy@....com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"maz@...nel.org" <maz@...nel.org>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"joro@...tes.org" <joro@...tes.org>,
"shuah@...nel.org" <shuah@...nel.org>,
"Chatre, Reinette" <reinette.chatre@...el.com>,
"eric.auger@...hat.com" <eric.auger@...hat.com>,
"yebin10@...wei.com" <yebin10@...wei.com>,
"apatel@...tanamicro.com" <apatel@...tanamicro.com>,
"shivamurthy.shastri@...utronix.de" <shivamurthy.shastri@...utronix.de>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"anna-maria@...utronix.de" <anna-maria@...utronix.de>,
"yury.norov@...il.com" <yury.norov@...il.com>,
"nipun.gupta@....com" <nipun.gupta@....com>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"patches@...ts.linux.dev" <patches@...ts.linux.dev>,
"jean-philippe@...aro.org" <jean-philippe@...aro.org>,
"mdf@...nel.org" <mdf@...nel.org>,
"mshavit@...gle.com" <mshavit@...gle.com>,
"shameerali.kolothum.thodi@...wei.com" <shameerali.kolothum.thodi@...wei.com>,
"smostafa@...gle.com" <smostafa@...gle.com>,
"ddutile@...hat.com" <ddutile@...hat.com>
Subject: Re: [PATCH RFCv2 05/13] iommu: Turn fault_data to iommufd private
pointer
On Thu, Jan 23, 2025 at 09:54:38AM +0000, Tian, Kevin wrote:
> > From: Nicolin Chen <nicolinc@...dia.com>
> > Sent: Saturday, January 11, 2025 11:32 AM
> >
> > @@ -224,8 +224,10 @@ struct iommu_domain {
> > phys_addr_t msi_addr);
> > #endif
> >
> > - void *fault_data;
> > - union {
> > + union { /* Pointer usable by owner of the domain */
> > + struct iommufd_hw_pagetable *iommufd_hwpt; /* iommufd
> > */
> > + };
> > + union { /* Fault handler */
>
> hmm is it better to rename it as "void *private;" and let the caller
> do type conversion?
I like the type safety, the union can hold other in-kernel users with
their proper types and this discourages drivers from inventing weird
things..
Jason
Powered by blists - more mailing lists