From: "Jan Beulich" Subject: Re: [PATCH 1/3] iommu: set correct IOMMU entries when iommu_hap_pt_share == 0 Date: Tue, 08 Apr 2014 10:55:40 +0100 Message-ID: <5343E3BC02000078000068BF@nat28.tlf.novell.com> References: <1396886524-16921-1-git-send-email-roger.pau@citrix.com> <1396886524-16921-2-git-send-email-roger.pau@citrix.com> <5343CFD4020000780000672B@nat28.tlf.novell.com> <5343BF23.1000408@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 1WXSkq-0004MG-4Y for xen-devel@lists.xenproject.org; Tue, 08 Apr 2014 09:55:44 +0000 In-Reply-To: <5343BF23.1000408@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: =?UTF-8?Q?Roger=20Pau=20Monn=C3=A9?= Cc: xen-devel@lists.xenproject.org, Tim Deegan List-Id: xen-devel@lists.xenproject.org >>> On 08.04.14 at 11:19, wrote: > On 08/04/14 10:30, Jan Beulich wrote: >>>>> On 07.04.14 at 18:02, wrote: >>> If the memory map is not shared between HAP and IOMMU we fails to set >>> correct IOMMU mappings for memory types different than p2m_ram_rw. >>> >>> This patchs adds IOMMU support for the following memory types: >>> p2m_grant_map_rw, p2m_map_foreign, p2m_ram_ro and p2m_grant_map_ro. >> >> I'm curious about the justification for p2m_map_foreign; the others >> I agree with. > > Thanks for the review, I didn't see a reason to not allow DMA transfers > to/from foreign pages, although there's no user of foreign pages that > use DMA. They're rather special (tool stack maps of guest pages), and DMAing into/out of them shouldn't normally be done. I'd clearly suggest leaving them unmapped for now. >> I also wonder whether p2m_ram_logdirty shouldn't be treated >> equally to p2m_ram_rw: It's clearly better to have some video >> corruption than to kill the guest due to excessive IOMMU faults, >> should its kernel choose to DMA into the frame buffer. But at the >> very minimum this needs to be included alongside p2m_ram_ro. > > Ack. I wasn't sure about p2m_ram_logdirty, so I just decided to not > include it. I will add it to my next revision as a RW zone if that's fine. Yes please, subject to Tim saying otherwise. Jan