xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Tamas K Lengyel <tamas.lengyel@intel.com>
Cc: "George Dunlap" <george.dunlap@eu.citrix.com>,
	xen-devel@lists.xenproject.org,
	"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>
Subject: Re: [Xen-devel] [PATCH v8 1/5] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries
Date: Tue, 11 Feb 2020 10:16:14 +0100	[thread overview]
Message-ID: <f620590a-147b-eeb8-707c-72cac10753bd@suse.com> (raw)
In-Reply-To: <cf992d6e4dd09acc48afb42d43be4a900baee189.1581362050.git.tamas.lengyel@intel.com>

On 10.02.2020 20:21, Tamas K Lengyel wrote:
> The owner domain of shared pages is dom_cow, use that for get_page
> otherwise the function fails to return the correct page under some
> situations. The check if dom_cow should be used was only performed in
> a subset of use-cases. Fixing the error and simplifying the existing check
> since we can't have any shared entries with dom_cow being NULL.
> 
> Signed-off-by: Tamas K Lengyel <tamas.lengyel@intel.com>

I find it quite disappointing that the blank lines requested to be
added ...

> --- a/xen/arch/x86/mm/p2m.c
> +++ b/xen/arch/x86/mm/p2m.c
> @@ -574,11 +574,12 @@ struct page_info *p2m_get_page_from_gfn(
>                  if ( fdom == NULL )
>                      page = NULL;
>              }
> -            else if ( !get_page(page, p2m->domain) &&
> -                      /* Page could be shared */
> -                      (!dom_cow || !p2m_is_shared(*t) ||
> -                       !get_page(page, dom_cow)) )
> -                page = NULL;
> +            else
> +            {
> +                struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
> +                if ( !get_page(page, d) )

.. above here and ...

> @@ -594,8 +595,9 @@ struct page_info *p2m_get_page_from_gfn(
>      mfn = get_gfn_type_access(p2m, gfn_x(gfn), t, a, q, NULL);
>      if ( p2m_is_ram(*t) && mfn_valid(mfn) )
>      {
> +        struct domain *d = !p2m_is_shared(*t) ? p2m->domain : dom_cow;
>          page = mfn_to_page(mfn);

... above here still haven't appeared. No matter that it's easy to
do so while committing, when you send a new version you should
really address such remarks yourself, I think.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2020-02-11  9:16 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-10 19:21 [Xen-devel] [PATCH v8 0/5] VM forking Tamas K Lengyel
2020-02-10 19:21 ` [Xen-devel] [PATCH v8 1/5] x86/p2m: Allow p2m_get_page_from_gfn to return shared entries Tamas K Lengyel
2020-02-11  9:16   ` Jan Beulich [this message]
2020-02-11 10:29     ` Tamas K Lengyel
2020-02-11 11:04       ` Jan Beulich
2020-02-11 13:34         ` Tamas K Lengyel
2020-02-21 13:48   ` Andrew Cooper
2020-02-21 14:21     ` Tamas K Lengyel
2020-02-10 19:21 ` [Xen-devel] [PATCH v8 2/5] xen/x86: Make hap_get_allocation accessible Tamas K Lengyel
2020-02-10 19:21 ` [Xen-devel] [PATCH v8 3/5] xen/mem_sharing: VM forking Tamas K Lengyel
2020-02-21 13:43   ` Andrew Cooper
2020-02-21 14:02     ` Andrew Cooper
2020-02-21 14:22       ` Tamas K Lengyel
2020-02-21 14:42   ` Andrew Cooper
2020-02-21 17:07     ` Tamas K Lengyel
2020-02-21 17:47       ` Andrew Cooper
2020-02-21 17:56         ` Tamas K Lengyel
2020-02-21 18:08         ` Tamas K Lengyel
2020-02-10 19:21 ` [Xen-devel] [PATCH v8 4/5] x86/mem_sharing: reset a fork Tamas K Lengyel
2020-02-10 19:21 ` [Xen-devel] [PATCH v8 5/5] xen/tools: VM forking toolstack side Tamas K Lengyel

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=f620590a-147b-eeb8-707c-72cac10753bd@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=tamas.lengyel@intel.com \
    --cc=wl@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).