From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Roger_Pau_Monn=E9?= Subject: Re: [PATCH v2 1/4] xen: make logdirty and iommu mutually exclusive Date: Thu, 24 Apr 2014 09:36:55 +0200 Message-ID: <5358BF17.1030801@citrix.com> References: <1398240984-67266-1-git-send-email-roger.pau@citrix.com> <1398240984-67266-2-git-send-email-roger.pau@citrix.com> <5357A9F9020000780000B491@nat28.tlf.novell.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 1WdEDM-0000XH-V2 for xen-devel@lists.xenproject.org; Thu, 24 Apr 2014 07:37:01 +0000 In-Reply-To: <5357A9F9020000780000B491@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel@lists.xenproject.org, Tim Deegan List-Id: xen-devel@lists.xenproject.org On 23/04/14 11:54, Jan Beulich wrote: >>>> On 23.04.14 at 10:16, wrote: >> --- a/xen/arch/x86/mm/hap/hap.c >> +++ b/xen/arch/x86/mm/hap/hap.c >> @@ -175,6 +175,15 @@ out: >> */ >> static int hap_enable_log_dirty(struct domain *d, bool_t log_global) >> { >> + >> + if ( iommu_enabled && need_iommu(d) && log_global ) > > need_iommu() implies iommu_enabled, and hence checking only the > former ought to be sufficient. > > Also, why do you do this here and in shadow code rather than in > paging_log_dirty_enable()? Sight... yes, much better place. Will change it in next version. >> --- a/xen/drivers/passthrough/iommu.c >> +++ b/xen/drivers/passthrough/iommu.c >> @@ -292,7 +292,8 @@ static int assign_device(struct domain *d, u16 seg, u8 >> bus, u8 devfn) >> * enabled for this domain */ >> if ( unlikely(!need_iommu(d) && >> (d->arch.hvm_domain.mem_sharing_enabled || >> - d->mem_event->paging.ring_page)) ) >> + d->mem_event->paging.ring_page || >> + paging_mode_log_dirty(d))) ) > > I'm afraid that would return true also for non-global log dirty mode. > This patch series > http://lists.xenproject.org/archives/html/xen-devel/2014-04/msg02750.html > (patch 1) introduces a way to know whether global mode is enabled > - maybe you should base your series on top of that one? Sure, this series are already on top of Mukesh p2m cleanup patches, I don't mind rebasing it on top of your series also. Roger.