From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [V12 PATCH 3/4] pvh dom0: Add and remove foreign pages Date: Thu, 15 May 2014 18:39:28 -0700 Message-ID: <20140515183928.012979ec@mantra.us.oracle.com> References: <1399683043-29112-1-git-send-email-mukesh.rathor@oracle.com> <1399683043-29112-4-git-send-email-mukesh.rathor@oracle.com> <5370BFC60200007800011554@mail.emea.novell.com> <20140512180238.328745d9@mantra.us.oracle.com> <5371E1560200007800011AA2@mail.emea.novell.com> <20140513175559.635cea57@mantra.us.oracle.com> <5373305C0200007800011FEB@mail.emea.novell.com> <20140514185917.6c185e9b@mantra.us.oracle.com> <5374909802000078000126CD@mail.emea.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 1Wl77i-0003uC-Ab for xen-devel@lists.xenproject.org; Fri, 16 May 2014 01:39:46 +0000 In-Reply-To: <5374909802000078000126CD@mail.emea.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: George.Dunlap@eu.citrix.com, tim@xen.org, 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 Thu, 15 May 2014 09:02:00 +0100 "Jan Beulich" wrote: > >>> On 15.05.14 at 03:59, wrote: > > Code wise several options, but seems mem_event.c would be the best > > place to put checks (would ENOSYS be more appropriate?): > > I'd prefer -EOPNOTSUPP as you did. > > > +++ b/xen/arch/x86/mm/mem_event.c > > @@ -538,6 +538,13 @@ int mem_event_domctl(struct domain *d, > > xen_domctl_mem_event case XEN_DOMCTL_MEM_EVENT_OP_PAGING_ENABLE: > > { > > struct p2m_domain *p2m = p2m_get_hostp2m(d); > > + struct domain *hwdom = > > rcu_lock_domain_by_id(hardware_domid); + > > + rcu_unlock_domain(hwdom); > > Why not simply look at hardware_domain? But I think that's wrong > anyway, and you want to look at current->domain instead. And > even that would still assume that a guest controlled by other than > Dom0 would only ever have operations like this carried out by its > controlling domain - i.e. perhaps you need to check both. Yup, will check for both. With that I think we've resolved all issues in this patch. I'm again looking at all paths to make sure foreign entry can't go to non-present, and with that not need the BUG_ON or ASSERT in ept_p2m_type_to_flags. paging/sharing paths are fenced now, and I can't think of others. So after done checking all paths again, will send next version. thanks mukesh