From: "Jan Beulich" Subject: [PATCH] VT-d: don't needlessly suppress page table sharing Date: Wed, 24 Sep 2014 15:36:51 +0100 Message-ID: <5422F323020000780003859E@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XWngb-00037j-0m for xen-devel@lists.xenproject.org; Wed, 24 Sep 2014 14:36:53 +0000 Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Yang Z Zhang , Kevin Tian List-Id: xen-devel@lists.xenproject.org Despite the mid term goal being to do away with the sharing there's no point in suppressing it in cases where it can be used now. Signed-off-by: Jan Beulich --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -1805,7 +1805,7 @@ void iommu_pte_flush(struct domain *d, u } } -static int vtd_ept_page_compatible(struct iommu *iommu) +static int __init vtd_ept_page_compatible(struct iommu *iommu) { u64 ept_cap, vtd_cap = iommu->cap; @@ -1814,8 +1814,8 @@ static int vtd_ept_page_compatible(struc if ( rdmsr_safe(MSR_IA32_VMX_EPT_VPID_CAP, ept_cap) != 0 ) return 0; - return ( ept_has_2mb(ept_cap) == cap_sps_2mb(vtd_cap) - && ept_has_1gb(ept_cap) == cap_sps_1gb(vtd_cap) ); + return (ept_has_2mb(ept_cap) && opt_hap_2mb) == cap_sps_2mb(vtd_cap) && + (ept_has_1gb(ept_cap) && opt_hap_1gb) == cap_sps_1gb(vtd_cap); } /*