xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	Tim Deegan <tim@xen.org>, Jan Beulich <jbeulich@suse.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v4 4/4] xen: expose that grant table mappings update the IOMMU
Date: Wed, 4 Jun 2014 12:06:21 +0200	[thread overview]
Message-ID: <1401876381-42977-5-git-send-email-roger.pau@citrix.com> (raw)
In-Reply-To: <1401876381-42977-1-git-send-email-roger.pau@citrix.com>

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@citrix.com>
Cc: Tim Deegan <tim@xen.org>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
---
 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 4f993f4..f4de00d 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;
 
@@ -4074,6 +4075,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
 
-- 
1.7.7.5 (Apple Git-26)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2014-06-04 10:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 10:06 [PATCH v4 0/4] Fix grant/foreign mappings with auto-translated guests Roger Pau Monne
2014-06-04 10:06 ` [PATCH v4 1/4] xen: make logdirty and iommu mutually exclusive Roger Pau Monne
2014-06-05 11:33   ` Tim Deegan
2014-06-04 10:06 ` [PATCH v4 2/4] iommu: set correct IOMMU entries when iommu_hap_pt_share == 0 Roger Pau Monne
2014-06-04 10:06 ` [PATCH v4 3/4] amd-iommu: disable iommu_hap_pt_share with AMD IOMMUs Roger Pau Monne
2014-06-04 12:52   ` Jan Beulich
2014-07-04  9:44   ` Jan Beulich
2014-07-22 17:30   ` Suravee Suthikulpanit
2014-07-22 17:39     ` Roger Pau Monné
2014-08-08 15:36       ` Suravee Suthikulanit
2014-08-18  9:22         ` Roger Pau Monné
2014-08-07  8:12   ` Ping: " Jan Beulich
2014-06-04 10:06 ` Roger Pau Monne [this message]
2014-06-04 13:07   ` [PATCH v4 4/4] xen: expose that grant table mappings update the IOMMU Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1401876381-42977-5-git-send-email-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=jbeulich@suse.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).