xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: George.Dunlap@eu.citrix.com, Tim Deegan <tim@xen.org>,
	eddie.dong@intel.com, keir.xen@gmail.com, jun.nakajima@intel.com,
	xen-devel@lists.xenproject.org
Subject: Re: [V15 PATCH 1/2] pvh dom0: Add and remove foreign pages
Date: Tue, 27 May 2014 17:51:36 -0700	[thread overview]
Message-ID: <20140527175136.49d975d5@mantra.us.oracle.com> (raw)
In-Reply-To: <538324510200007800015A1E@mail.emea.novell.com>

On Mon, 26 May 2014 10:24:01 +0100
"Jan Beulich" <JBeulich@suse.com> wrote:

> >>> On 24.05.14 at 01:50, <mukesh.rathor@oracle.com> wrote:
> > On Sat, 24 May 2014 01:08:49 +0200
> > Tim Deegan <tim@xen.org> wrote:
> > 
> >> At 15:37 -0700 on 23 May (1400855820), Mukesh Rathor wrote:
> >> > On Fri, 23 May 2014 21:05:34 +0200
> >> > Tim Deegan <tim@xen.org> wrote:
> >> > 
> >> > > At 16:30 -0700 on 22 May (1400772630), Mukesh Rathor wrote:
> >> > > > In this patch, a new function, p2m_add_foreign(), is added
> >> > > > to map pages from a foreign guest into dom0 for various
> >> > > > purposes like domU creation, running xentrace, etc... Such
> >> > > > pages are typed p2m_map_foreign.  Note, it is the nature of
> >> > > > such pages that a refcnt is held during their stay in the
> >> > > > p2m. The refcnt is added and released in the low level ept
> >> > > > function atomic_write_ept_entry. That macro is converted to
> >> > > > a function to allow for such refcounting, which only applies
> >> > > > to leaf entries in the ept. Furthermore, please note that
> >> > > > paging/sharing is disabled if the controlling or hardware
> >> > > > domain is pvh. Any enabling of those features would need to
> >> > > > ensure refcnt are properly maintained for foreign types, or
> >> > > > paging/sharing is skipped for foreign types.
> >> > > > 
> >> > > > Also, we change get_pg_owner so it allows foreign mappings
> >> > > > for pvh.
> >> > > 
> >> > > But you no longer actually call get_pg_owner() for PVH domains,
> >> > > right? So that hunk should go away.  With that done,
> >> > 
> >> > Hi Tim,
> >> > 
> >> > We actually need get_pg_owner for the mmuext call by the
> >> > toolstack when building a PV domain, doing pinning operations on
> >> > the guest table.
> >> 
> >> Ah, I see.  Let's handle that in a separate patch then, since it's
> >> now unrelated to foreign mappings in PVH any more.
> >> 
> >> 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?

thanks
mukesh

  reply	other threads:[~2014-05-28  0:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-22 23:30 [V15 PATCH 0/2] pvh dom0 patches Mukesh Rathor
2014-05-22 23:30 ` [V15 PATCH 1/2] pvh dom0: Add and remove foreign pages Mukesh Rathor
2014-05-23  7:20   ` Jan Beulich
2014-05-23 19:05   ` Tim Deegan
2014-05-23 22:37     ` Mukesh Rathor
2014-05-23 23:08       ` Tim Deegan
2014-05-23 23:50         ` Mukesh Rathor
2014-05-26  9:24           ` Jan Beulich
2014-05-28  0:51             ` Mukesh Rathor [this message]
2014-05-28  6:50               ` Jan Beulich
2014-05-28 10:40                 ` Tim Deegan
2014-05-28 10:06           ` Tim Deegan
2014-05-28 23:41             ` Mukesh Rathor
2014-05-22 23:30 ` [V15 PATCH 2/2] dom0: add opt_dom0pvh to setup.c Mukesh Rathor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140527175136.49d975d5@mantra.us.oracle.com \
    --to=mukesh.rathor@oracle.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=eddie.dong@intel.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir.xen@gmail.com \
    --cc=tim@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).