diff --git a/hypervisor/arch/x86/Kconfig b/hypervisor/arch/x86/Kconfig index 24b3f6ca5..bb377d119 100644 --- a/hypervisor/arch/x86/Kconfig +++ b/hypervisor/arch/x86/Kconfig @@ -340,13 +340,6 @@ config MCE_ON_PSC_WORKAROUND_DISABLED the software workaround has negative impact on performance. If all the guest OS kernels are trusted, this option may be set for performance. -config IOMMU_ENFORCE_SNP - bool "IOMMU enforce snoop behavior of DMA operation" - default n - help - GPU IOMMU doesn't support snoop control capability, - To enable gvt-d,disable IOMMU snoop control by default. - config ENFORCE_TURNOFF_AC bool "Force to disable #AC for Split-locked Access" default n diff --git a/hypervisor/arch/x86/vtd.c b/hypervisor/arch/x86/vtd.c index 4cfe3341c..0464278af 100644 --- a/hypervisor/arch/x86/vtd.c +++ b/hypervisor/arch/x86/vtd.c @@ -278,6 +278,11 @@ static inline uint8_t iommu_cap_rwbf(uint64_t cap) return ((uint8_t)(cap >> 4U) & 1U); } +static inline uint8_t iommu_ecap_sc(uint64_t ecap) +{ + return ((uint8_t)(ecap >> 7U) & 1U); +} + static void dmar_unit_show_capability(struct dmar_drhd_rt *dmar_unit) { pr_info("dmar unit[0x%x]", dmar_unit->drhd->reg_base_addr); @@ -482,17 +487,6 @@ static int32_t dmar_register_hrhd(struct dmar_drhd_rt *dmar_unit) if ((iommu_ecap_c(dmar_unit->ecap) == 0U) && (!dmar_unit->drhd->ignore)) { iommu_page_walk_coherent = false; } - - /* when the hardware support snoop control, - * to make sure snoop control is always enabled, - * the SNP filed in the leaf PTE should be set. - * How to guarantee it when EPT is used as second-level - * translation paging structures? - */ - if (iommu_ecap_sc(dmar_unit->ecap) == 0U) { - dev_dbg(DBG_LEVEL_IOMMU, "dmar uint doesn't support snoop control!"); - } - dmar_disable_translation(dmar_unit); } @@ -1020,10 +1014,6 @@ static int32_t iommu_attach_device(const struct iommu_domain *domain, uint8_t bu pr_err("invalid dmar unit"); ret = -EINVAL; } else { - if (iommu_ecap_sc(dmar_unit->ecap) == 0U) { - dev_dbg(DBG_LEVEL_IOMMU, "vm=%d add %x:%x no snoop control!", domain->vm_id, bus, devfun); - } - root_table = (struct dmar_entry *)hpa2hva(dmar_unit->root_table_addr); root_entry = root_table + bus; diff --git a/hypervisor/include/arch/x86/vtd.h b/hypervisor/include/arch/x86/vtd.h index 73690d11a..7c0b50364 100644 --- a/hypervisor/include/arch/x86/vtd.h +++ b/hypervisor/include/arch/x86/vtd.h @@ -212,11 +212,6 @@ static inline uint8_t iommu_ecap_pt(uint64_t ecap) return ((uint8_t)(ecap >> 6U) & 1U); } -static inline uint8_t iommu_ecap_sc(uint64_t ecap) -{ - return ((uint8_t)(ecap >> 7U) & 1U); -} - static inline uint16_t iommu_ecap_iro(uint64_t ecap) { return ((uint16_t)(ecap >> 8U) & 0x3ffU);