Re: [PATCH RFCv2 05/13] iommu: Turn fault_data to iommufd private pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jan 23, 2025 at 09:54:38AM +0000, Tian, Kevin wrote:
> > From: Nicolin Chen <nicolinc@xxxxxxxxxx>
> > 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




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux