xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* Regression in RMRRs identity mapping for PVH Dom0
@ 2015-09-23 15:56 Elena Ufimtseva
  2015-09-24  7:17 ` Chen, Tiejun
  2015-09-24 10:29 ` Wei Liu
  0 siblings, 2 replies; 8+ messages in thread
From: Elena Ufimtseva @ 2015-09-23 15:56 UTC (permalink / raw)
  To: xen-devel
  Cc: kevin.tian, wei.liu2, george.dunlap, andrew.cooper3, tim,
	jbeulich, yang.z.zhang, tiejun.chen

[-- Attachment #1: Type: text/plain, Size: 1325 bytes --]

Hi                                                                              
                                                                                
There is a regression in RMRR patch 5ae03990c120a7b3067a52d9784c9aa72c0705a6 in
new set_identity_p2m_entry. RMRRs are not being mapped in IOMMU for PVH Dom0.
This causes pages faults and some long 'hang-like' delays during boot and
device assignments.
                                                                                
During construct_dom0, in PVH path  p2m is being constructed and identity mapped
in IOMMU. The p2m type is p2m_mmio_direct and p2m access p2m_rwx.
New code used to map RMRRs invoked from rmrr_identity_mapping                   
checks if p2m entry exists with same type and access and if yes, skips iommu
mapping. Since there are p2m entries for pvh dom0 iomem, RMRRs are not being
mapped in IOMMU.
                                                                                
This debug patch attached fixes this and Ill be glad to see if there is a more elegant fix.
                                                                                
Thanks!                                                                         
                                                                                
Elena         

[-- Attachment #2: 0001-RMRR-regression-debug-for-PVH-Dom0.patch --]
[-- Type: text/x-diff, Size: 1149 bytes --]

>From fb25216760a0c17447faa1f416cc59341600dc1b Mon Sep 17 00:00:00 2001
From: Elena Ufimtseva <elena.ufimtseva@oracle.com>
Date: Wed, 23 Sep 2015 11:47:49 -0400
Subject: [PATCH] RMRR regression debug for PVH Dom0

Signed-off-by: Elena Ufimtseva <elena.ufimtseva@oracle.com>
---
 xen/arch/x86/mm/p2m.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index b2726bd..16c8938 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -970,8 +970,10 @@ int set_identity_p2m_entry(struct domain *d, unsigned long gfn,
     if ( p2mt == p2m_invalid || p2mt == p2m_mmio_dm )
         ret = p2m_set_entry(p2m, gfn, _mfn(gfn), PAGE_ORDER_4K,
                             p2m_mmio_direct, p2ma);
-    else if ( mfn_x(mfn) == gfn && p2mt == p2m_mmio_direct && a == p2ma )
-        ret = 0;
+    else if ( mfn_x(mfn) == gfn && p2mt == p2m_mmio_direct )
+        if ( a == p2ma && !is_pvh_domain(d) )
+            ret = 0;
+        else ret = iommu_map_page(d, gfn, gfn, IOMMUF_readable|IOMMUF_writable);
     else
     {
         if ( flag & XEN_DOMCTL_DEV_RDM_RELAXED )
-- 
2.1.4


[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-09-24 11:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-23 15:56 Regression in RMRRs identity mapping for PVH Dom0 Elena Ufimtseva
2015-09-24  7:17 ` Chen, Tiejun
2015-09-24  9:18   ` Tim Deegan
2015-09-24 10:31     ` Jan Beulich
2015-09-24 11:29       ` Elena Ufimtseva
2015-09-24 11:37     ` Elena Ufimtseva
2015-09-24 10:29 ` Wei Liu
2015-09-24 11:42   ` Elena Ufimtseva

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).