From: "Jan Beulich" Subject: Re: [v2][PATCH 1/1] xen:vtd: missing RMRR mapping while share EPT Date: Thu, 24 Jul 2014 10:31:37 +0100 Message-ID: <53D0EE9902000078000256C5@mail.emea.novell.com> References: <1406191841-5258-1-git-send-email-tiejun.chen@intel.com> <53D0CA69.6090500@citrix.com> <53D0CBDF.4010606@intel.com> <53D0CDA9.7020306@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53D0CDA9.7020306@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Tiejun Chen Cc: yang.z.zhang@intel.com, kevin.tian@intel.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 24.07.14 at 11:11, wrote: > On 24/07/14 10:03, Chen, Tiejun wrote: >> On 2014/7/24 16:57, Andrew Cooper wrote: >>> On 24/07/14 09:50, Tiejun Chen wrote: >>>> --- a/xen/drivers/passthrough/vtd/iommu.c >>>> +++ b/xen/drivers/passthrough/vtd/iommu.c >>>> @@ -41,6 +41,7 @@ >>>> #include "extern.h" >>>> #include "vtd.h" >>>> #include "../ats.h" >>>> +#include "../../../arch/x86/mm/mm-locks.h" >>> >>> >> >> iommu.c:38:29: fatal error: asm/mm/mm-locks.h: No such file or directory >> #include >> ^ >> compilation terminated. >> >> Tiejun > > Hmm - my mistake. The lack of easy access to this header file goes to > emphasise that it is private to arch/x86/mm, and there are indeed no > current users outside of that part of the tree. > > Would it not be better have some public p2m_set_identity() function in > p2m.c ? Actually I think this should be using set_mmio_p2m_entry(), which in turn points out another problem: What is happening with the GFN that gets replaced here? How will the guest know this is not RAM? I pointed out on an earlier occasion that passing through devices with associated RMRR is problematic/dangerous - this is another proof. Perhaps this should be disallowed, at least when sharing page tables. Jan