All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <JBeulich@suse.com>
To: Roger Pau Monne <roger.pau@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Tim Deegan <tim@xen.org>, Wei Liu <wei.liu2@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH for-4.12 4/8] x86/shadow: alloc enough pages so initialization doesn't fail
Date: Wed, 06 Feb 2019 04:02:57 -0700	[thread overview]
Message-ID: <5C5ABEE102000078002143C9@prv1-mh.provo.novell.com> (raw)
In-Reply-To: <20190206091046.dzafcjpkkwoiibda@mac>

>>> On 06.02.19 at 10:10, <roger.pau@citrix.com> wrote:
> On Tue, Feb 05, 2019 at 10:32:08AM -0700, Jan Beulich wrote:
>> >>> On 05.02.19 at 16:53, <roger.pau@citrix.com> wrote:
>> > On Tue, Feb 05, 2019 at 08:15:27AM -0700, Jan Beulich wrote:
>> >> >>> On 05.02.19 at 14:52, <roger.pau@citrix.com> wrote:
>> >> > I don't think the amount of guest memory matters here, the following
>> >> > example with 8G of RAM and 8 vCPUs fails in the same way:
>> >> > 
>> >> > # cat test.c
>> >> > test.c       test.c.gcov  test.cfg     test.core
>> >> > root@:~ # cat test.cfg
>> >> > name = "test"
>> >> > type = "hvm"
>> >> > 
>> >> > memory = 8192
>> >> > vcpus = 8
>> >> > hap = 0
>> >> > # xl create test.cfg
>> >> > Parsing config from test.cfg
>> >> > libxl: error: libxl_create.c:578:libxl__domain_make: domain creation fail: 
> 
>> >> > Cannot allocate memory
>> >> > libxl: error: libxl_create.c:975:initiate_domain_create: cannot make 
> domain: 
>> >> > -3
>> >> > 
>> >> > And I think that's a perfectly suitable guest config.
>> >> 
>> >> Indeed. And it doesn't seem to work for me anymore either. Must be
>> >> a regression, as I'm pretty sure it did still work not all that long ago.
>> >> Not even "shadow_memory=256" helps.
>> > 
>> > No, because shadow_init is called from domain_create, and it's
>> > impossible to increase the shadow memory pool before the domain is
>> > actually created.
>> 
>> Okay, I misunderstood the problem initially. Aiui this is a
>> regression from the early setting of ->max_vcpus, as that now
> 
> Ahh, I wasn't able to figure out what caused this regression, it's
> indeed caused by max_vcpus being set at domain_create.
> 
>> causes shadow_min_acceptable_pages() to block far more pages
>> than it did before from use for p2m allocs during domain creation.
>> I think I see an alternative way of fixing this for the moment
>> (without adding re-size logic yet when d->tot_pages grows), but
>> this will have to wait until tomorrow.
> 
> Ack, I'm happy to implement it if you tell me the plan :).

Well, the plan was hard to spell out without actually trying out
what is needed. You'll likely have seen already the resulting
patch I've sent out for discussion.

> Maybe as an alternative the checks in shadow_alloc_p2m_page can be
> relaxed during domain creation,

I've been considering this, but decided against it, because it
would undermine the functionality in case the tool stack would
not issue a set-allocation domctl. Mid-term (perhaps after 4.12)
I think we need to settle on a more uniform model here, e.g.
either always requiring a set-allocation request by the tool
stack, or making the code not depend on it at all.

> or the p2m allocated when the first memory page gets added to the domain?

This might be possible as well, but perhaps requires a more
intrusive change, in particular if you take into consideration
the VMX change which was a byproduct of the playing done
for this one.

Jan



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

  reply	other threads:[~2019-02-06 11:03 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-30 10:36 [PATCH for-4.12 0/8] pvh/dom0/shadow/amd fixes Roger Pau Monne
2019-01-30 10:36 ` [PATCH for-4.12 1/8] dom0/pvh: align allocation and mapping order to start address Roger Pau Monne
2019-01-30 12:37   ` Wei Liu
2019-01-30 13:58     ` Roger Pau Monné
2019-01-31 17:22       ` Wei Liu
2019-02-04 16:41   ` Jan Beulich
2019-02-04 17:11     ` Roger Pau Monné
2019-02-05  7:42       ` Jan Beulich
2019-02-05 10:26         ` Roger Pau Monné
2019-02-05 11:38           ` Jan Beulich
2019-02-05 10:54         ` Andrew Cooper
2019-02-05 11:37           ` Jan Beulich
2019-01-30 10:36 ` [PATCH for-4.12 2/8] amd/ntp: remove assert that prevents creating 2M MMIO entries Roger Pau Monne
2019-02-04 16:48   ` Andrew Cooper
2019-02-04 16:56   ` Jan Beulich
2019-02-04 17:18     ` Roger Pau Monné
2019-02-05  7:45       ` Jan Beulich
2019-02-05 10:40         ` Roger Pau Monné
2019-02-05 12:44           ` Jan Beulich
2019-02-05 13:38             ` Roger Pau Monné
2019-02-05 14:55               ` Jan Beulich
2019-02-07 17:21               ` George Dunlap
2019-02-08 17:49                 ` Roger Pau Monné
2019-02-11  9:47                   ` Jan Beulich
2019-02-11 12:03                     ` Roger Pau Monné
     [not found]                       ` <7BBE0D330200008C0063616D@prv1-mh.provo.novell.com>
2019-02-11 12:11                         ` Jan Beulich
2019-01-30 10:36 ` [PATCH for-4.12 3/8] iommu/pvh: add reserved regions below 1MB to the iommu page tables Roger Pau Monne
2019-02-05 10:47   ` Jan Beulich
2019-02-05 11:15     ` Roger Pau Monné
2019-02-05 12:49       ` Jan Beulich
2019-02-05 14:01         ` Roger Pau Monné
2019-02-05 15:18           ` Jan Beulich
2019-02-05 15:45             ` Roger Pau Monné
2019-01-30 10:36 ` [PATCH for-4.12 4/8] x86/shadow: alloc enough pages so initialization doesn't fail Roger Pau Monne
2019-02-05 11:21   ` Jan Beulich
2019-02-05 11:47     ` Roger Pau Monné
2019-02-05 12:55       ` Jan Beulich
2019-02-05 13:52         ` Roger Pau Monné
2019-02-05 15:15           ` Jan Beulich
2019-02-05 15:53             ` Roger Pau Monné
2019-02-05 17:32               ` Jan Beulich
2019-02-06  9:10                 ` Roger Pau Monné
2019-02-06 11:02                   ` Jan Beulich [this message]
2019-01-30 10:36 ` [PATCH for-4.12 5/8] pvh/dom0: warn when dom0_mem is not set to a fixed value Roger Pau Monne
2019-02-06 13:54   ` Jan Beulich
2019-02-07 15:39     ` Roger Pau Monné
2019-02-07 16:47       ` Jan Beulich
2019-02-07 17:09   ` George Dunlap
2019-02-07 17:48     ` Roger Pau Monné
2019-02-08 11:11       ` George Dunlap
2019-01-30 10:36 ` [PATCH 6/8] x86/mm: split p2m ioreq server pages special handling into helper Roger Pau Monne
2019-01-31 14:59   ` Paul Durrant
2019-01-31 16:58     ` Roger Pau Monné
2019-01-30 10:36 ` [PATCH 7/8] x86/mm: handle foreign mappings in p2m_entry_modify Roger Pau Monne
2019-02-06 16:59   ` Jan Beulich
2019-02-07 16:53     ` Roger Pau Monné
2019-02-07 16:59       ` Jan Beulich
2019-02-07 17:49   ` George Dunlap
2019-02-07 17:57     ` Roger Pau Monné
2019-02-07 18:05       ` George Dunlap
2019-02-08  9:37         ` Roger Pau Monné
2019-01-30 10:36 ` [PATCH 8/8] npt/shadow: allow getting foreign page table entries Roger Pau Monne

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=5C5ABEE102000078002143C9@prv1-mh.provo.novell.com \
    --to=jbeulich@suse.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=roger.pau@citrix.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --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.