All of lore.kernel.org
 help / color / mirror / Atom feed
From: <paul@xen.org>
To: <xen-devel@lists.xenproject.org>
Cc: "Wei Liu" <wl@xen.org>, "Paul Durrant" <paul@xen.org>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Paul Durrant" <pdurrant@amazon.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>
Subject: [Xen-devel] [PATCH v5 2/6] x86 / p2m: replace page_list check in p2m_alloc_table...
Date: Mon, 9 Mar 2020 10:23:00 +0000	[thread overview]
Message-ID: <20200309102304.1251-3-paul@xen.org> (raw)
In-Reply-To: <20200309102304.1251-1-paul@xen.org>

From: Paul Durrant <pdurrant@amazon.com>

... with a check of domain_tot_pages().

The check of page_list prevents the prior allocation of PGC_extra pages,
whereas what the code is trying to verify is that the toolstack has not
already RAM for the domain.

Signed-off-by: Paul Durrant <paul@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <george.dunlap@citrix.com>
Cc: Wei Liu <wl@xen.org>
Cc: "Roger Pau Monné" <roger.pau@citrix.com>

v4:
 - Re-worked so as not to completely remove the check

v2:
 - New in v2
---
 xen/arch/x86/mm/p2m.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/xen/arch/x86/mm/p2m.c b/xen/arch/x86/mm/p2m.c
index 3719deae77..9f51370327 100644
--- a/xen/arch/x86/mm/p2m.c
+++ b/xen/arch/x86/mm/p2m.c
@@ -695,8 +695,7 @@ int p2m_alloc_table(struct p2m_domain *p2m)
 
     p2m_lock(p2m);
 
-    if ( p2m_is_hostp2m(p2m)
-         && !page_list_empty(&d->page_list) )
+    if ( p2m_is_hostp2m(p2m) && domain_tot_pages(d) )
     {
         P2M_ERROR("dom %d already has memory allocated\n", d->domain_id);
         p2m_unlock(p2m);
-- 
2.20.1


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

  parent reply	other threads:[~2020-03-09 10:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 10:22 [Xen-devel] [PATCH v5 0/6] remove one more shared xenheap page: shared_info paul
2020-03-09 10:22 ` [Xen-devel] [PATCH v5 1/6] domain: introduce alloc/free_shared_info() helpers paul
2020-03-09 10:23 ` paul [this message]
2020-03-09 10:23 ` [Xen-devel] [PATCH v5 3/6] x86 / pv: do not treat PGC_extra pages as RAM paul
2020-03-09 13:04   ` Jan Beulich
2020-03-10 13:32     ` Paul Durrant
2020-03-10 14:58       ` Jan Beulich
2020-03-10 15:05         ` Paul Durrant
2020-03-10 15:12           ` Jan Beulich
2020-03-10 15:16             ` Paul Durrant
2020-03-10 15:33               ` Jan Beulich
2020-03-10 15:54                 ` Paul Durrant
2020-03-09 10:23 ` [Xen-devel] [PATCH v5 4/6] x86 / ioreq: use a MEMF_no_refcount allocation for server pages paul
2020-03-09 10:23 ` [Xen-devel] [PATCH v5 5/6] mm: add 'is_special_page' inline function paul
2020-03-09 13:28   ` Jan Beulich
2020-03-10 16:32     ` Paul Durrant
2020-03-09 10:23 ` [Xen-devel] [PATCH v5 6/6] domain: use PGC_extra domheap page for shared_info paul
2020-03-09 15:56   ` Jan Beulich
2020-03-10 17:33     ` Paul Durrant
2020-03-11  9:16       ` Jan Beulich
     [not found]         ` <004501d5f7b9$b00e1120$102a3360$@xen.org>
2020-03-12  8:34           ` Jan Beulich
2020-03-12  9:09             ` [Xen-devel] [EXTERNAL][PATCH " Paul Durrant
2020-03-12  9:26               ` 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=20200309102304.1251-3-paul@xen.org \
    --to=paul@xen.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=pdurrant@amazon.com \
    --cc=roger.pau@citrix.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 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.