lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zr6Ui1NBQ8078hRZ@Asurada-Nvidia>
Date: Thu, 15 Aug 2024 16:51:39 -0700
From: Nicolin Chen <nicolinc@...dia.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: <kevin.tian@...el.com>, <will@...nel.org>, <joro@...tes.org>,
	<suravee.suthikulpanit@....com>, <robin.murphy@....com>,
	<dwmw2@...radead.org>, <baolu.lu@...ux.intel.com>, <shuah@...nel.org>,
	<linux-kernel@...r.kernel.org>, <iommu@...ts.linux.dev>,
	<linux-arm-kernel@...ts.infradead.org>, <linux-kselftest@...r.kernel.org>
Subject: Re: [PATCH v1 08/16] iommufd/viommu: Add IOMMU_VIOMMU_INVALIDATE
 ioctl

On Thu, Aug 15, 2024 at 08:24:05PM -0300, Jason Gunthorpe wrote:
> On Wed, Aug 07, 2024 at 01:10:49PM -0700, Nicolin Chen wrote:
> > @@ -946,4 +947,40 @@ struct iommu_viommu_unset_vdev_id {
> >  	__aligned_u64 vdev_id;
> >  };
> >  #define IOMMU_VIOMMU_UNSET_VDEV_ID _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VIOMMU_UNSET_VDEV_ID)
> > +
> > +/**
> > + * enum iommu_viommu_invalidate_data_type - VIOMMU Cache Invalidate Data Type
> > + * @IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3: Invalidation data for ARM SMMUv3
> > + */
> > +enum iommu_viommu_invalidate_data_type {
> > +	IOMMU_VIOMMU_INVALIDATE_DATA_ARM_SMMUV3,
> > +};
> 
> =1 here I think. Lets try to avoid 0 for the types..
> 
> And this shouldn't be in this patch
> 
> But also we can probably just use reuse enum iommu_hwpt_invalidate_data_type
> here?

Would that force IOMMU drivers to implement both hwpt and viommu
invalidations? SMMUv3 driver would implement both anyway though..

> > +struct iommu_viommu_invalidate {
> > +	__u32 size;
> > +	__u32 viommu_id;
> > +	__aligned_u64 data_uptr;
> > +	__u32 data_type;
> > +	__u32 entry_len;
> > +	__u32 entry_num;
> > +	__u32 __reserved;
> > +};
> > +#define IOMMU_VIOMMU_INVALIDATE _IO(IOMMUFD_TYPE, IOMMUFD_CMD_VIOMMU_INVALIDATE)
> 
> I wonder if we should use IOMMU_HWPT_INVALIDATE? the hwpt_id can tell
> which mode it is in. The ioctl becomes badly named but these have
> identical arguments.

Mostly they would be identical. So, I think that's doable.

If someday we need something hwpt-specific or viommu-specific, we
can always duplicate a different structure.

Thanks
Nicolin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ