From: "Jan Beulich" Subject: Re: [PATCH 2/3] amd-iommu: disable iommu_hap_pt_share with AMD IOMMUs Date: Tue, 08 Apr 2014 09:52:44 +0100 Message-ID: <5343D4FC0200007800006788@nat28.tlf.novell.com> References: <1396886524-16921-1-git-send-email-roger.pau@citrix.com> <1396886524-16921-3-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.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WXRlx-00063f-9C for xen-devel@lists.xenproject.org; Tue, 08 Apr 2014 08:52:49 +0000 In-Reply-To: <1396886524-16921-3-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: xen-devel@lists.xenproject.org, Tim Deegan , Xiantao Zhang , Suravee Suthikulpanit List-Id: xen-devel@lists.xenproject.org >>> On 07.04.14 at 18:02, wrote: > --- a/xen/drivers/passthrough/amd/iommu_init.c > +++ b/xen/drivers/passthrough/amd/iommu_init.c > @@ -1255,6 +1255,13 @@ int __init amd_iommu_init(void) > if ( iterate_ivrs_mappings(amd_iommu_setup_device_table) != 0 ) > goto error_out; > > + /* > + * Disable sharing HAP page tables with AMD IOMMU, > + * since it only supports p2m_ram_rw, and this would > + * prevent doing IO to/from mapped grant frames. > + */ > + iommu_hap_pt_share = 0; > + I guess at the very least when the option was specified on the command line you should issue a warning, or perhaps even stay away from enforcing this. I also think we ought to consider alternatives before taking a harsh step like this (and that's independent of my earlier indication that we may want to switch away from sharing these tables): It looks like the global bit in the host page tables is unused and ignored, and could therefore be used to indicate grant entries. The IW bit could be used to distinguish p2m_{ram,grant}_{ro,rw} respectively. Curious what Tim's thoughts here are... Jan