RE: [PATCH v3 01/15] iommu: Add IOMMU_CAP_ENFORCE_CACHE_COHERENCY

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

 



> From: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Sent: Wednesday, October 26, 2022 2:12 AM
> 
> This queries if a domain linked to a device should expect to support
> enforce_cache_coherency() so iommufd can negotiate the rules for when a
> domain should be shared or not.
> 
> For iommufd a device that declares
> IOMMU_CAP_ENFORCE_CACHE_COHERENCY will
> not be attached to a domain that does not support it.
> 
> Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>, with one nit

> @@ -4458,7 +4458,11 @@ static bool intel_iommu_capable(struct device
> *dev, enum iommu_cap cap)
>  		return irq_remapping_enabled == 1;
>  	if (cap == IOMMU_CAP_PRE_BOOT_PROTECTION)
>  		return dmar_platform_optin();
> +	if (cap == IOMMU_CAP_ENFORCE_CACHE_COHERENCY) {
> +		struct device_domain_info *info = dev_iommu_priv_get(dev);
> 
> +		return ecap_sc_support(info->iommu->ecap);
> +	}
>  	return false;
>  }

use switch/case while making this change.




[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