From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Chen, Tiejun" Subject: Re: Regression in RMRRs identity mapping for PVH Dom0 Date: Thu, 24 Sep 2015 15:17:32 +0800 Message-ID: <5603A38C.2060805@intel.com> References: <20150923155612.GB3042@elena.ufimtseva> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150923155612.GB3042@elena.ufimtseva> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Elena Ufimtseva , xen-devel@lists.xen.org Cc: kevin.tian@intel.com, wei.liu2@citrix.com, george.dunlap@eu.citrix.com, andrew.cooper3@citrix.com, tim@xen.org, jbeulich@suse.com, yang.z.zhang@intel.com List-Id: xen-devel@lists.xenproject.org On 9/23/2015 11:56 PM, Elena Ufimtseva wrote: > 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. Based on your explanation, sounds pvh always creates this mapping beforehand, so what about this? diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c index cf8485e..d026845 100644 --- a/xen/arch/x86/mm/p2m.c +++ b/xen/arch/x86/mm/p2m.c @@ -964,7 +964,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 ( !paging_mode_translate(p2m->domain) || is_pvh_domain(d) ) { if ( !need_iommu(d) ) return 0; Thanks Tiejun