All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Malcolm Crossley <malcolm.crossley@citrix.com>,
	Wei Liu <wei.liu2@citrix.com>, Jan Beulich <jbeulich@suse.com>
Subject: [PATCH for 4.6] x86/mm: make {set, clear}_identity_p2m_mapping() work for HVM guests as well
Date: Mon, 14 Sep 2015 15:24:14 +0100	[thread overview]
Message-ID: <1442240654-3456-1-git-send-email-andrew.cooper3@citrix.com> (raw)

From: Malcolm Crossley <malcolm.crossley@citrix.com>

For Intel IGD passthrough, the guest driver programs the device to DMA
to/from its RMRR.

c/s 619ecf8 "make {set,clear}_identity_p2m_mapping() work for PV guests"
was incomplete for pre-Broadwell systems which did not support shared
EPT.

The correct check to use is iommu_use_hap_pt() not
paging_mode_translate() as IOMMU mappings also need to be created for
HVM guests with separate EPT and IOMMU tables.

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Jan Beulich <jbeulich@suse.com>
CC: George Dunlap <george.dunlap@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
 xen/arch/x86/mm/p2m.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index c4329d2..c7f437c 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -957,7 +957,7 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     int ret;
 
-    if ( !paging_mode_translate(p2m->domain) )
+    if ( !iommu_use_hap_pt(d) )
     {
         if ( !need_iommu(d) )
             return 0;
@@ -1032,7 +1032,7 @@ int clear_identity_p2m_entry(struct domain *d, unsigned long gfn)
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
     int ret;
 
-    if ( !paging_mode_translate(d) )
+    if ( !iommu_use_hap_pt(d) )
     {
         if ( !need_iommu(d) )
             return 0;
-- 
1.7.10.4

             reply	other threads:[~2015-09-14 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-14 14:24 Andrew Cooper [this message]
2015-09-14 14:42 ` [PATCH for 4.6] x86/mm: make {set, clear}_identity_p2m_mapping() work for HVM guests as well 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=1442240654-3456-1-git-send-email-andrew.cooper3@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=malcolm.crossley@citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.