WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-4.1-testing] VT-d: Explicitly test EPT capabilities

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.1-testing] VT-d: Explicitly test EPT capabilities during IOMMU init
From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
Date: Wed, 31 Aug 2011 09:22:12 +0100
Delivery-date: Wed, 31 Aug 2011 01:23:55 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Tim Deegan <tim@xxxxxxx>
# Date 1314092600 -3600
# Node ID b42d905cd0321094011e5c3ae5133fe406a2e01c
# Parent  007a4037900015b8fdd3978d1bdcbe7863d959f0
VT-d: Explicitly test EPT capabilities during IOMMU init
because the cached version isn't set up until the EPT init happens.

Signed-off-by: Tim Deegan <tim@xxxxxxx>
xen-unstable changeset:   23787:41f00cf6b822
xen-unstable date:        Tue Aug 23 10:43:20 2011 +0100
---


diff -r 007a40379000 -r b42d905cd032 xen/drivers/passthrough/vtd/iommu.c
--- a/xen/drivers/passthrough/vtd/iommu.c       Thu Aug 25 15:36:14 2011 +0100
+++ b/xen/drivers/passthrough/vtd/iommu.c       Tue Aug 23 10:43:20 2011 +0100
@@ -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) );
 }
 
 /*

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.1-testing] VT-d: Explicitly test EPT capabilities during IOMMU init, Xen patchbot-4 . 1-testing <=