Re: [PATCH v5 10/11] iommu/vt-d: Add nested domain allocation

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

 



On 2023/9/27 14:56, Tian, Kevin wrote:
From: Liu, Yi L <yi.l.liu@xxxxxxxxx>
Sent: Thursday, September 21, 2023 3:55 PM


+	if (hwpt_type != IOMMU_HWPT_TYPE_DEFAULT &&
+	    hwpt_type != IOMMU_HWPT_TYPE_VTD_S1)
+		return ERR_PTR(-EINVAL);
+
+	if ((hwpt_type == IOMMU_HWPT_TYPE_DEFAULT) == !!parent)
+		return ERR_PTR(-EINVAL);

this is probably too strict. What about intel-iommu driver supports a
IOMMU_HWPT_TYPE_VTD_S2 later for some tweak w/o nesting?

in that case, this check needs to be updated

let's make the parent match specific to VTD_S1 type.

ok. how about below?

if ((data_type == IOMMU_HWPT_ALLOC_DATA_VTD_S1) && !parent)

+
+	if (parent && request_nest_parent)
+		return ERR_PTR(-EINVAL);

this check should be moved to iommufd?


oops, maybe no need, iommufd_hwpt_alloc() has below check.

if (cmd->flags & IOMMU_HWPT_ALLOC_NEST_PARENT &&
    cmd->data_type != IOMMU_HWPT_ALLOC_DATA_NONE)
        return -EINVAL;

--
Regards,
Yi Liu



[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