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

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

 



On Thu, Nov 03, 2022 at 05:03:01AM +0000, Tian, Kevin wrote:
> > @@ -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.

Done:

static bool intel_iommu_capable(struct device *dev, enum iommu_cap cap)
{
	struct device_domain_info *info = dev_iommu_priv_get(dev);

	switch (cap) {
	case IOMMU_CAP_CACHE_COHERENCY:
		return true;
	case IOMMU_CAP_INTR_REMAP:
		return irq_remapping_enabled == 1;
	case IOMMU_CAP_PRE_BOOT_PROTECTION:
		return dmar_platform_optin();
	case IOMMU_CAP_ENFORCE_CACHE_COHERENCY:
		return ecap_sc_support(info->iommu->ecap);
	default:
		return false;
	}
}

Thanks,
Jason



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux