From: "Jan Beulich" Subject: Re: [PATCH] xen/iommu: fix usage of shared EPT/IOMMU page tables on PVH guests Date: Fri, 27 Feb 2015 10:38:12 +0000 Message-ID: <54F057240200007800064843@mail.emea.novell.com> References: <1425031853-23196-1-git-send-email-roger.pau@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YRIJC-0005zf-4Z for xen-devel@lists.xenproject.org; Fri, 27 Feb 2015 10:38:14 +0000 In-Reply-To: <1425031853-23196-1-git-send-email-roger.pau@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: Roger Pau Monne Cc: Yang Zhang , xen-devel@lists.xenproject.org, Kevin Tian , Aravind Gopalakrishnan , Suravee Suthikulpanit List-Id: xen-devel@lists.xenproject.org >>> On 27.02.15 at 11:10, wrote: > iommu_share_p2m_table should not prevent PVH guests from using a shared page > table. Change the condition to has_hvm_container_domain instead of > is_hvm_domain. This allows both PVH and HVM guests to use it. Remove the > asserts in iommu_set_pgd and amd_iommu_share_p2m, iommu_share_p2m_table > and p2m_alloc_table already do them. This wording is confusing - it took me to got into p2m_alloc_table() to see that one half of the assertion is being satisfied there an the other in iommu_share_p2m_table(). While not asserting what IOMMU code does is quite fine in IOMMU code (especially as closely related as is the case here), the assertion regarding what P2M code does (and what a future second caller of iommu_share_p2m_table() might violate) should be kept, but perhaps be moved into iommu_share_p2m_table() instead of keeping it in vendor specific code. Jan