All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Roger Pau Monne <roger.pau@citrix.com>
Subject: [PATCH v2 4/4] x86/dom0: re-order DMA remapping enabling for PVH Dom0
Date: Fri, 11 Aug 2017 17:43:20 +0100	[thread overview]
Message-ID: <20170811164320.92899-5-roger.pau@citrix.com> (raw)
In-Reply-To: <20170811164320.92899-1-roger.pau@citrix.com>

Make sure the reserved regions are setup before enabling the DMA
remapping in the IOMMU, by calling dom0_setup_permissions before
iommu_hwdom_init. Also, in order to workaround IOMMU issues seen on
pre-Haswell Intel hardware, as described in patch "introduce a PVH
implementation of iommu_inclusive_mapping" make sure the DMA remapping
is enabled after populating Dom0 p2m.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
---
Changes since RFC:
 - Expand commit message to reference patch #3.
---
 xen/arch/x86/hvm/dom0_build.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 020c355faf..0e7d06be95 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -605,13 +605,6 @@ static int __init pvh_setup_cpus(struct domain *d, paddr_t entry,
         return rc;
     }
 
-    rc = dom0_setup_permissions(d);
-    if ( rc )
-    {
-        panic("Unable to setup Dom0 permissions: %d\n", rc);
-        return rc;
-    }
-
     update_domain_wallclock_time(d);
 
     clear_bit(_VPF_down, &v->pause_flags);
@@ -1059,7 +1052,12 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
 
     printk("** Building a PVH Dom0 **\n");
 
-    iommu_hwdom_init(d);
+    rc = dom0_setup_permissions(d);
+    if ( rc )
+    {
+        printk("Unable to setup Dom0 permissions: %d\n", rc);
+        return rc;
+    }
 
     rc = pvh_setup_p2m(d);
     if ( rc )
@@ -1068,6 +1066,8 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
         return rc;
     }
 
+    iommu_hwdom_init(d);
+
     rc = pvh_load_kernel(d, image, image_headroom, initrd, bootstrap_map(image),
                          cmdline, &entry, &start_info);
     if ( rc )
-- 
2.11.0 (Apple Git-81)


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

  parent reply	other threads:[~2017-08-11 16:43 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-11 16:43 [PATCH v2 0/4] x86/pvh: implement iommu_inclusive_mapping for PVH Dom0 Roger Pau Monne
2017-08-11 16:43 ` [PATCH v2 1/4] x86/dom0: prevent access to MMCFG areas " Roger Pau Monne
2017-08-17  3:12   ` Tian, Kevin
2017-08-17  9:32     ` Roger Pau Monne
2017-08-28  6:04       ` Tian, Kevin
2017-08-22 12:26   ` Jan Beulich
2017-08-22 13:54     ` Roger Pau Monne
2017-08-23  8:16       ` Jan Beulich
2017-08-25 12:15         ` Roger Pau Monne
2017-08-25 12:25           ` Jan Beulich
2017-08-25 13:58             ` Roger Pau Monne
2017-08-28  6:18               ` Tian, Kevin
2017-08-29  7:33                 ` Roger Pau Monne
2017-08-31  7:32                   ` Chao Gao
2017-08-31  8:53                     ` Roger Pau Monne
2017-08-31  9:03                     ` Roger Pau Monne
2017-08-31  8:45                       ` Chao Gao
2017-08-31 10:09                         ` Roger Pau Monne
2017-09-04  6:25                           ` Chao Gao
2017-09-04  9:00                             ` Roger Pau Monné
2017-09-04  9:26                               ` Roger Pau Monné
2017-09-04  8:52                                 ` Chao Gao
2017-09-04 15:06                                   ` Roger Pau Monné
2017-09-04 15:19                                     ` Roger Pau Monné
2017-09-04 15:39                                     ` Jan Beulich
2017-08-11 16:43 ` [PATCH v2 2/4] x86/dom0: prevent PVH Dom0 from mapping read-only the IO APIC area Roger Pau Monne
2017-08-17  3:12   ` Tian, Kevin
2017-08-17  9:35     ` Roger Pau Monne
2017-08-28  6:07       ` Tian, Kevin
2017-08-22 12:28   ` Jan Beulich
2017-08-11 16:43 ` [PATCH v2 3/4] x86/vtd: introduce a PVH implementation of iommu_inclusive_mapping Roger Pau Monne
2017-08-17  3:28   ` Tian, Kevin
2017-08-17  9:39     ` Roger Pau Monne
2017-08-28  6:13       ` Tian, Kevin
2017-08-22 12:31   ` Jan Beulich
2017-08-22 14:01     ` Roger Pau Monne
2017-08-23  8:18       ` Jan Beulich
2017-08-28  6:14         ` Tian, Kevin
2017-08-29  7:39           ` Roger Pau Monne
2017-08-11 16:43 ` Roger Pau Monne [this message]
2017-08-22 12:37   ` [PATCH v2 4/4] x86/dom0: re-order DMA remapping enabling for PVH Dom0 Jan Beulich
2017-08-22 14:05     ` Roger Pau Monne
2017-08-23  8:21       ` Jan Beulich
2017-08-17  3:10 ` [PATCH v2 0/4] x86/pvh: implement iommu_inclusive_mapping " Tian, Kevin
2017-08-17  9:28   ` Roger Pau Monne

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=20170811164320.92899-5-roger.pau@citrix.com \
    --to=roger.pau@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --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 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.