# HG changeset patch
# User Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
# Date 1314720153 -3600
# Node ID 20bc824fde06e6825ac61109eaa029211726a4e5
# Parent 3ecd151a692514edf6f0ac2d2e88186953051651
# Parent 4cd50a27f7fbc18b2be28f70ab0283ec0e34b526
Merge
---
diff -r 3ecd151a6925 -r 20bc824fde06 xen/Makefile
--- a/xen/Makefile Tue Aug 30 16:57:05 2011 +0100
+++ b/xen/Makefile Tue Aug 30 17:02:33 2011 +0100
@@ -2,7 +2,7 @@
# All other places this is stored (eg. compile.h) should be autogenerated.
export XEN_VERSION = 4
export XEN_SUBVERSION = 1
-export XEN_EXTRAVERSION ?= .2-rc1$(XEN_VENDORVERSION)
+export XEN_EXTRAVERSION ?= .2-rc2-pre$(XEN_VENDORVERSION)
export XEN_FULLVERSION = $(XEN_VERSION).$(XEN_SUBVERSION)$(XEN_EXTRAVERSION)
-include xen-version
diff -r 3ecd151a6925 -r 20bc824fde06 xen/drivers/passthrough/iommu.c
--- a/xen/drivers/passthrough/iommu.c Tue Aug 30 16:57:05 2011 +0100
+++ b/xen/drivers/passthrough/iommu.c Tue Aug 30 17:02:33 2011 +0100
@@ -82,6 +82,8 @@
iommu_passthrough = 1;
else if ( !strcmp(s, "dom0-strict") )
iommu_dom0_strict = 1;
+ else if ( !strcmp(s, "sharept") )
+ iommu_hap_pt_share = 1;
s = ss + 1;
} while ( ss );
@@ -175,7 +177,7 @@
if ( has_arch_pdevs(d) && !need_iommu(d) )
{
d->need_iommu = 1;
- if ( !iommu_hap_pt_share )
+ if ( !iommu_use_hap_pt(d) )
rc = iommu_populate_page_table(d);
goto done;
}
diff -r 3ecd151a6925 -r 20bc824fde06 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c Tue Aug 30 16:57:05 2011 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c Tue Aug 30 17:02:33 2011 +0100
@@ -1622,7 +1622,7 @@
if ( list_empty(&acpi_drhd_units) )
return;
- if ( iommu_hap_pt_share )
+ if ( iommu_use_hap_pt(d) )
return;
spin_lock(&hd->mapping_lock);
@@ -1644,7 +1644,7 @@
int iommu_domid;
/* Do nothing if VT-d shares EPT page table */
- if ( iommu_hap_pt_share )
+ if ( iommu_use_hap_pt(d) )
return 0;
/* do nothing if dom0 and iommu supports pass thru */
@@ -1748,15 +1748,15 @@
static int vtd_ept_page_compatible(struct iommu *iommu)
{
- u64 cap = iommu->cap;
+ u64 ept_cap, vtd_cap = iommu->cap;
- if ( ept_has_2mb(cpu_has_vmx_ept_2mb) != cap_sps_2mb(cap) )
+ /* EPT is not initialised yet, so we must check the capability in
+ * the MSR explicitly rather than use cpu_has_vmx_ept_*() */
+ if ( rdmsr_safe(MSR_IA32_VMX_EPT_VPID_CAP, ept_cap) != 0 )
return 0;
- if ( ept_has_1gb(cpu_has_vmx_ept_1gb) != cap_sps_1gb(cap) )
- return 0;
-
- return 1;
+ return ( ept_has_2mb(ept_cap) == cap_sps_2mb(vtd_cap)
+ && ept_has_1gb(ept_cap) == cap_sps_1gb(vtd_cap) );
}
/*
@@ -1769,7 +1769,7 @@
ASSERT( is_hvm_domain(d) && d->arch.hvm_domain.hap_enabled );
- if ( !iommu_hap_pt_share )
+ if ( !iommu_use_hap_pt(d) )
return;
pgd_mfn = pagetable_get_mfn(p2m_get_pagetable(p2m_get_hostp2m(d)));
diff -r 3ecd151a6925 -r 20bc824fde06 xen/include/xen/iommu.h
--- a/xen/include/xen/iommu.h Tue Aug 30 16:57:05 2011 +0100
+++ b/xen/include/xen/iommu.h Tue Aug 30 17:02:33 2011 +0100
@@ -34,6 +34,9 @@
extern bool_t amd_iommu_debug;
extern bool_t amd_iommu_perdev_intremap;
+/* Does this domain have a P2M table we can use as its IOMMU pagetable? */
+#define iommu_use_hap_pt(d) (hap_enabled(d) && iommu_hap_pt_share)
+
extern struct rangeset *mmio_ro_ranges;
#define domain_hvm_iommu(d) (&d->arch.hvm_domain.hvm_iommu)
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|