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] [day] [month] [year] [list]
Message-ID: <Z8IapaN1ZD0wImak@Asurada-Nvidia>
Date: Fri, 28 Feb 2025 12:20:53 -0800
From: Nicolin Chen <nicolinc@...dia.com>
To: Robin Murphy <robin.murphy@....com>
CC: <will@...nel.org>, <joro@...tes.org>, <iommu@...ts.linux.dev>,
	<jgg@...dia.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] iommu: Sort out domain user data

On Fri, Feb 28, 2025 at 11:31:11AM +0000, Robin Murphy wrote:
> +enum iommu_domain_cookie_type {
> +	IOMMU_NO_COOKIE,
> +	IOMMU_DMA_IOVA_COOKIE,
> +	IOMMU_DMA_MSI_COOKIE,
> +	IOMMU_FAULT_HANDLER_COOKIE,
> +	IOMMU_SVA_COOKIE,

I would like to change them to IOMMU_COOKIE_* so the iommufd one
wouldn't feel redundant like "IOMMU_IOMMUFD_COOKIE".

If you don't mind, I will make the following list:
-	IOMMU_NO_COOKIE,
-	IOMMU_DMA_IOVA_COOKIE,
-	IOMMU_DMA_MSI_COOKIE,
-	IOMMU_FAULT_HANDLER_COOKIE,
-	IOMMU_SVA_COOKIE,
+	IOMMU_COOKIE_NONE,
+	IOMMU_COOKIE_DMA_IOVA,
+	IOMMU_COOKIE_DMA_MSI,
+	IOMMU_COOKIE_FAULT_HANDLER,
+	IOMMU_COOKIE_SVA,
+	IOMMU_COOKIE_IOMMUFD,

then:
diff --git a/drivers/iommu/iommufd/hw_pagetable.c b/drivers/iommu/iommufd/hw_pagetable.c
index 7de6e914232e..227514030655 100644
--- a/drivers/iommu/iommufd/hw_pagetable.c
+++ b/drivers/iommu/iommufd/hw_pagetable.c
@@ -413,6 +413,7 @@ int iommufd_hwpt_alloc(struct iommufd_ucmd *ucmd)
                iommufd_put_object(ucmd->ictx, &fault->obj);
        }
        hwpt->domain->iommufd_hwpt = hwpt;
+       hwpt->domain->cookie_type = IOMMU_COOKIE_IOMMUFD;

        cmd->out_hwpt_id = hwpt->obj.id;
        rc = iommufd_ucmd_respond(ucmd, sizeof(*cmd));

And I can put this in my cleanup series v3, as Jason is asking.

Thanks
Nicolin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ