From: Wei Liu Subject: Re: [PATCH 1/3] x86/p2m: tighten conditions of IOMMU mapping updates Date: Tue, 29 Sep 2015 12:28:48 +0100 Message-ID: <20150929112847.GY13821@zion.uk.xensource.com> References: <560028DD02000078000A408D@prv-mh.provo.novell.com> <56002A1B02000078000A40B9@prv-mh.provo.novell.com> <56017EAC02000078000A470C@prv-mh.provo.novell.com> <20150923140016.GF9104@zion.uk.xensource.com> <560A884402000078000A68DA@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Zgt5Y-0001Ke-E9 for xen-devel@lists.xenproject.org; Tue, 29 Sep 2015 11:28:52 +0000 Content-Disposition: inline In-Reply-To: <560A884402000078000A68DA@prv-mh.provo.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: Kevin Tian , Wei Liu , George Dunlap , Andrew Cooper , Jun Nakajima , xen-devel , Keir Fraser List-Id: xen-devel@lists.xenproject.org On Tue, Sep 29, 2015 at 04:47:00AM -0600, Jan Beulich wrote: > >>> On 23.09.15 at 16:00, wrote: > > On Tue, Sep 22, 2015 at 08:15:39AM -0600, Jan Beulich wrote: > >> >>> On 21.09.15 at 16:02, wrote: > >> > In the EPT case permission changes should also result in updates or > >> > TLB flushes. > >> > > >> > In the NPT case the old MFN does not depend on the new entry being > >> > valid (but solely on the old one), and the need to update or TLB-flush > >> > again also depends on permission changes. > >> > > >> > In the shadow mode case, iommu_hap_pt_share should be ignored. > >> > > >> > Furthermore in the NPT/shadow case old intermediate page tables must > >> > be freed only after IOMMU side updates/flushes have got carried out. > >> > > >> > Signed-off-by: Jan Beulich > >> > >> Wei, > >> > >> I'm sorry, I forgot to Cc you on the patch and state that I think this > >> should be considered for 4.6. > > > > While I think having this issue fixed for 4.6 would be nice, I would > > like to ... > > > >> > --- > >> > In addition to the fixes here it looks to me as if both EPT and > >> > NPT/shadow code lack invalidation of IOMMU side paging structure > >> > caches, i.e. further changes may be needed. Am I overlooking something? > > > > have this question answered. Having a "fix" that doesn't actually fix > > the issue is not very useful... > > So I suppose you saw my reasoning of there not actually being any > further flushing necessary right now. Following the discussion with Yes, I saw it. I'm convinced. > George I split off and applied the EPT side of this, which I'd like to > see go into 4.6 too. The NPT/shadow side will need a little more work EPT side: Release-acked-by: Wei Liu > (including further splitting the original patch), partly depending on > a decision on whether to keep the dead page table sharing code in > p2m-pt.c. > > I did already split out the intermediate page table freeing patch. > The only other bug is the incomplete checking of iommu_hap_pt_share > in shadow mode, everything else would be cleanup only no matter > what route we go. The only thing is that this broken check would > go away altogether if we decided to drop the pt-share logic, but I > suppose for backporting purposes it would be worthwhile to have > that fix separated regardless of further direction. > I will reply separately to your other two patches. Wei. > Jan