From: "Jan Beulich" Subject: Re: [V15 PATCH 1/2] pvh dom0: Add and remove foreign pages Date: Wed, 28 May 2014 07:50:10 +0100 Message-ID: <5385A3420200007800016336@mail.emea.novell.com> References: <1400801431-31373-1-git-send-email-mukesh.rathor@oracle.com> <1400801431-31373-2-git-send-email-mukesh.rathor@oracle.com> <20140523190534.GA86158@deinos.phlegethon.org> <20140523153700.273c3d8d@mantra.us.oracle.com> <20140523230849.GB86158@deinos.phlegethon.org> <20140523165012.1210b6be@mantra.us.oracle.com> <538324510200007800015A1E@mail.emea.novell.com> <20140527175136.49d975d5@mantra.us.oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WpXgi-0002IB-Ty for xen-devel@lists.xenproject.org; Wed, 28 May 2014 06:50:13 +0000 In-Reply-To: <20140527175136.49d975d5@mantra.us.oracle.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: Mukesh Rathor Cc: George.Dunlap@eu.citrix.com, Tim Deegan , eddie.dong@intel.com, keir.xen@gmail.com, jun.nakajima@intel.com, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org >>> On 28.05.14 at 02:51, wrote: > On Mon, 26 May 2014 10:24:01 +0100 > "Jan Beulich" wrote: >> >>> On 24.05.14 at 01:50, wrote: >> > On Sat, 24 May 2014 01:08:49 +0200 >> > Tim Deegan wrote: >> >> Having the change where it is seems fine, but I think the correct >> >> test is (is_pv() && paging_mode_translate()) rather than >> >> (!is_pvh() && paging_mode_translate()) -- it's a weakness of the >> >> PV pagetable ops that's being avoided here, rather than any >> >> special treatment for PVH. >> > >> > Good point, but Jan had a concern on that when I had dropped the if >> > statement completely, that it would allow HVM guests to go thru. >> > Hence !is_pvh to let hvm guest continue to fail. >> >> The same would be achieved by using is_pv as Tim suggested. > > So sorry, but I don't understand how: > > if ( is_pv_domain(curr) && unlikely(paging_mode_translate(curr)) ) > { > MEM_LOG("Cannot mix foreign mappings with translated domains"); > goto out; > } > > will cause this error for hvm, which is what happens now without my > change, or will continue to with my proposed change: > > if ( !is_pvh_domain(curr) && unlikely(paging_mode_translate(curr)) ) > { > MEM_LOG("Cannot mix foreign mappings with translated domains"); > .. > > > I understand your suggestion earlier was that hvm should continue to fail. > > Also, my understanding is that pv domains are never translated? Hmm, indeed, good point. I wonder whether the whole condition shouldn't simply become !is_hvm() then (and perhaps the log message adjusted accordingly). Tim? Jan