From: Mukesh Rathor <mukesh.rathor@oracle.com>
To: Julien Grall <julien.grall@linaro.org>
Cc: Xen-devel@lists.xensource.com,
Ian Campbell <Ian.Campbell@citrix.com>,
Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
george.dunlap@eu.citrix.com, tim@xen.org, keir.xen@gmail.com,
JBeulich@suse.com
Subject: Re: [V4 PATCH 6/7] pvh dom0: Add and remove foreign pages
Date: Wed, 4 Dec 2013 17:40:53 -0800 [thread overview]
Message-ID: <20131204174053.07219c5c@mantra.us.oracle.com> (raw)
In-Reply-To: <529F5FC9.9080906@linaro.org>
On Wed, 04 Dec 2013 17:00:57 +0000
Julien Grall <julien.grall@linaro.org> wrote:
> On 12/04/2013 01:05 AM, Mukesh Rathor wrote:
> > On Wed, 04 Dec 2013 00:00:54 +0000
> > Julien Grall <julien.grall@linaro.org> wrote:
> >
......
> refcnt'd
> + * the page. See also xenmem_add_foreign_to_pmap().
> + */
> + page = get_page_from_gfn(d, xrfp.gpfn, &p2mt, P2M_ALLOC);
> +
> + if ( page || p2m_is_foreign(p2mt) )
> {
> - guest_physmap_remove_page(d, xrfp.gpfn,
> page_to_mfn(page), 0);
> - put_page(page);
> + if ( page )
> + mfn = page_to_mfn(page);
> + else
> + {
> + mfn = gmfn_to_mfn(d, xrfp.gpfn);
> + page = mfn_to_page(mfn);
> +
> + ASSERT(d != page_get_owner(page));
> + }
> +
> + guest_physmap_remove_page(d, xrfp.gpfn, mfn, 0);
> + if (page)
> + put_page(page);
Why did you drop the following release of refcnt from here?
+ if ( p2m_is_foreign(p2mt) )
+ {
+ put_page(mfn_to_page(mfn));
+ put_gfn(d, xrfp.gpfn);
+ }
> }
> else
> rc = -ENOENT;
>
> This change is assuming that:
> - p2m_is_foreign is defined on ARM (I have a patch for that)
I added #define p2m_is_foreign to 0 in my patch for now.
> - gmfn_to_mfn is defined on x86 (I don't have a patch, but the code
> should be trivial?)
I'd rather just ifdef CONFIG_X86 like guest_remove_page() does in the
same file for gmfn_to_mfn.
Also, lets not mix any partial arm changes with these x86 changes here.
So, in this patch, I've added p2m_is_foreign set to 0, and changed the
remove path to remain exactly same for arm. So, arm will continue to work
the same way, and no build break. This way, you can add arm change
incrementally and we can track things nicely.
Please see the changes in the next version.
thanks,
Mukesh
next prev parent reply other threads:[~2013-12-05 1:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-03 2:30 [V4 PATCH 0/7]: PVH dom0 Mukesh Rathor
2013-12-03 2:30 ` [V4 PATCH 1/7] PVH dom0: move some pv specific code to static functions Mukesh Rathor
2013-12-03 2:30 ` [V4 PATCH 2/7] dom0: construct_dom0 changes Mukesh Rathor
2013-12-04 15:28 ` Jan Beulich
2013-12-03 2:30 ` [V4 PATCH 3/7] PVH dom0: implement XENMEM_add_to_physmap_range for x86 Mukesh Rathor
2013-12-03 2:30 ` [V4 PATCH 4/7] PVH dom0: Introduce p2m_map_foreign Mukesh Rathor
2013-12-03 2:30 ` [V4 PATCH 5/7] pvh: change xsm_add_to_physmap Mukesh Rathor
2013-12-03 2:30 ` [V4 PATCH 6/7] pvh dom0: Add and remove foreign pages Mukesh Rathor
2013-12-04 0:00 ` Julien Grall
2013-12-04 1:05 ` Mukesh Rathor
2013-12-04 9:44 ` Ian Campbell
2013-12-04 10:56 ` Stefano Stabellini
2013-12-04 17:00 ` Julien Grall
2013-12-05 1:40 ` Mukesh Rathor [this message]
2013-12-05 12:31 ` Julien Grall
2013-12-04 9:43 ` Ian Campbell
2013-12-05 2:09 ` Mukesh Rathor
2013-12-03 2:30 ` [V4 PATCH 7/7] pvh dom0: add opt_dom0pvh to setup.c Mukesh Rathor
2013-12-04 15:37 ` [V4 PATCH 0/7]: PVH dom0 Jan Beulich
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=20131204174053.07219c5c@mantra.us.oracle.com \
--to=mukesh.rathor@oracle.com \
--cc=Ian.Campbell@citrix.com \
--cc=JBeulich@suse.com \
--cc=Xen-devel@lists.xensource.com \
--cc=george.dunlap@eu.citrix.com \
--cc=julien.grall@linaro.org \
--cc=keir.xen@gmail.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=tim@xen.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).