From: Julien Grall <julien.grall@linaro.org>
To: Tim Deegan <tim@xen.org>
Cc: Keir Fraser <keir@xen.org>,
ian.campbell@citrix.com, patches@linaro.org,
stefano.stabellini@citrix.com, Jan Beulich <jbeulich@suse.com>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 08/11] xen/arm: Handle remove foreign mapping
Date: Mon, 16 Dec 2013 15:34:06 +0000 [thread overview]
Message-ID: <52AF1D6E.7080402@linaro.org> (raw)
In-Reply-To: <20131216115131.GB35881@deinos.phlegethon.org>
On 12/16/2013 11:51 AM, Tim Deegan wrote:
> At 19:37 +0000 on 13 Dec (1386959858), Julien Grall wrote:
>> @@ -693,12 +694,21 @@ long do_memory_op(unsigned long cmd, XEN_GUEST_HANDLE_PARAM(void) arg)
>> return rc;
>> }
>>
>> - page = get_page_from_gfn(d, xrfp.gpfn, NULL, P2M_ALLOC);
>> + /*
>> + * If autotranslate guest, (eg pvh), the gfn could be mapped to a mfn
>> + * from foreign domain by the user space tool during domain creation.
>> + * We need to check for that, free it up from the p2m, and release
>> + * refcnt on it. In such a case, page would be NULL and the following
>> + * call would not have refcnt'd the page.
>> + */
>> + page = get_page_from_gfn(d, xrfp.gpfn, &p2mt, P2M_ALLOC);
>> if ( page )
>> {
>> guest_physmap_remove_page(d, xrfp.gpfn, page_to_mfn(page), 0);
>> put_page(page);
>> }
>> + else if ( p2m_is_foreign(p2mt) )
>> + rc = p2m_remove_foreign(d, xrfp.gpfn);
>
> This doesn't seem like the right interface -- having special cases
> like this in the callers is something we slipped into in x86 for a lot
> of the paging/sharing code and it's not nice. I think maybe we can
> just have get_page_from_gfn() DTRT for foreign (and grant) entries.
>
> Also, the comment will have been out of data by the time the x86
> version of this code is finished, as we won't be handling the refcount
> at this level. :)
I will remove the comment and modify get_page_from_gfn to handle foreign
mapping.
--
Julien Grall
next prev parent reply other threads:[~2013-12-16 15:34 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-13 19:37 [PATCH v4 00/11] xen/arm: Handle correctly foreign mapping Julien Grall
2013-12-13 19:37 ` [PATCH v4 01/11] pvh dom0: Introduce p2m_map_foreign Julien Grall
2013-12-13 23:19 ` Ian Campbell
2013-12-14 0:00 ` Julien Grall
2013-12-16 10:45 ` Ian Campbell
2013-12-16 10:59 ` Tim Deegan
2013-12-16 17:15 ` Julien Grall
2013-12-16 11:04 ` George Dunlap
2013-12-13 19:37 ` [PATCH v4 02/11] xen/arm: Introduce steps in domain_relinquish_resource Julien Grall
2013-12-13 19:37 ` [PATCH v4 03/11] xen/arm: move mfn_to_p2m_entry in arch/arm/p2m.c Julien Grall
2013-12-13 19:37 ` [PATCH v4 04/11] xen/arm: Implement p2m_type_t as an enum Julien Grall
2013-12-13 19:37 ` [PATCH v4 05/11] xen/arm: Store p2m type in each page of the guest Julien Grall
2013-12-13 19:37 ` [PATCH v4 06/11] xen/arm: p2m: Extend p2m_lookup parameters to retrieve the p2m type Julien Grall
2013-12-13 19:37 ` [PATCH v4 07/11] xen/arm: Retrieve p2m type in get_page_from_gfn Julien Grall
2013-12-13 19:37 ` [PATCH v4 08/11] xen/arm: Handle remove foreign mapping Julien Grall
2013-12-16 11:51 ` Tim Deegan
2013-12-16 11:55 ` Ian Campbell
2013-12-16 15:26 ` Tim Deegan
2013-12-16 15:34 ` Julien Grall [this message]
2013-12-16 15:40 ` Ian Campbell
2013-12-16 16:26 ` Julien Grall
2013-12-16 16:33 ` Ian Campbell
2013-12-16 16:40 ` Julien Grall
2013-12-16 17:06 ` Julien Grall
2013-12-16 17:21 ` Ian Campbell
2013-12-16 17:14 ` Julien Grall
2013-12-16 17:18 ` Ian Campbell
2013-12-13 19:37 ` [PATCH v4 09/11] xen/arm: Add relinquish_p2m_mapping to remove reference on every mapped page Julien Grall
2013-12-13 19:37 ` [PATCH v4 10/11] xen/arm: Set foreign page type to p2m_map_foreign Julien Grall
2013-12-13 19:37 ` [PATCH v4 11/11] xen/arm: grant-table: Support read-only mapping Julien Grall
2013-12-14 0:01 ` [PATCH v4 00/11] xen/arm: Handle correctly foreign mapping Julien Grall
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=52AF1D6E.7080402@linaro.org \
--to=julien.grall@linaro.org \
--cc=ian.campbell@citrix.com \
--cc=jbeulich@suse.com \
--cc=keir@xen.org \
--cc=patches@linaro.org \
--cc=stefano.stabellini@citrix.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.