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

[Xen-changelog] [xen master] x86/HVM: expose that grant table mappings update the IOMMU



commit b074b99c34f9ab5bf234b4778a417b5b55690060
Author:     Roger Pau Monné <roger.pau@xxxxxxxxxx>
AuthorDate: Mon Aug 11 14:58:40 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Aug 11 14:58:40 2014 +0200

    x86/HVM: expose that grant table mappings update the IOMMU

    Add a new CPUID flag for leaf 4 that indicates that grant/foreign
    mappings update the IOMMU accordingly.

    Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 xen/arch/x86/hvm/hvm.c              |   10 ++++++++++
 xen/include/public/arch-x86/cpuid.h |    2 ++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
index d2c6942..d40c48e 100644
--- a/xen/arch/x86/hvm/hvm.c
+++ b/xen/arch/x86/hvm/hvm.c
@@ -67,6 +67,7 @@
 #include <asm/mem_access.h>
 #include <public/mem_event.h>
 #include <xen/rangeset.h>
+#include <public/arch-x86/cpuid.h>

 bool_t __read_mostly hvm_enabled;

@@ -4197,6 +4198,15 @@ void hvm_hypervisor_cpuid_leaf(uint32_t sub_idx,
     *eax = *ebx = *ecx = *edx = 0;
     if ( hvm_funcs.hypervisor_cpuid_leaf )
         hvm_funcs.hypervisor_cpuid_leaf(sub_idx, eax, ebx, ecx, edx);
+
+    if ( sub_idx == 0 )
+    {
+        /*
+         * Indicate that memory mapped from other domains (either grants or
+         * foreign pages) has valid IOMMU entries.
+         */
+        *eax |= XEN_HVM_CPUID_IOMMU_MAPPINGS;
+    }
 }

 void hvm_cpuid(unsigned int input, unsigned int *eax, unsigned int *ebx,
diff --git a/xen/include/public/arch-x86/cpuid.h 
b/xen/include/public/arch-x86/cpuid.h
index 7135d54..e57a457 100644
--- a/xen/include/public/arch-x86/cpuid.h
+++ b/xen/include/public/arch-x86/cpuid.h
@@ -73,6 +73,8 @@
 /* EAX Features */
 #define XEN_HVM_CPUID_APIC_ACCESS_VIRT (1u << 0) /* Virtualized APIC registers 
*/
 #define XEN_HVM_CPUID_X2APIC_VIRT      (1u << 1) /* Virtualized x2APIC 
accesses */
+/* Memory mapped from other domains has valid IOMMU entries */
+#define XEN_HVM_CPUID_IOMMU_MAPPINGS   (1u << 2)

 #define XEN_CPUID_MAX_NUM_LEAVES 4

--
generated by git-patchbot for /home/xen/git/xen.git#master

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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.