From: "Roger Pau Monné" <roger.pau@citrix.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>,
Anthony Perard <anthony.perard@citrix.com>,
Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH v2] x86+libxl: correct p2m (shadow) memory pool size calculation
Date: Mon, 25 Apr 2022 14:59:02 +0200 [thread overview]
Message-ID: <YmabFt952DO29pIA@Air-de-Roger> (raw)
In-Reply-To: <368e2d54-09f2-2081-349e-571bfeab13af@suse.com>
On Mon, Apr 25, 2022 at 10:49:34AM +0200, Jan Beulich wrote:
> char *libxl_domid_to_name(libxl_ctx *ctx, uint32_t domid)
> --- a/xen/arch/x86/dom0_build.c
> +++ b/xen/arch/x86/dom0_build.c
> @@ -317,9 +317,12 @@ unsigned long __init dom0_paging_pages(c
> /* Copied from: libxl_get_required_shadow_memory() */
Could you also update the comment, maybe better would be:
/* Keep in sync with libxl__get_required_paging_memory(). */
> unsigned long memkb = nr_pages * (PAGE_SIZE / 1024);
>
> - memkb = 4 * (256 * d->max_vcpus + 2 * (memkb / 1024));
> + memkb = 4 * (256 * d->max_vcpus +
> + (paging_mode_enabled(d) +
> + (opt_dom0_shadow || opt_pv_l1tf_hwdom)) *
opt_pv_l1tf_hwdom is only relevant for PV guests, so maybe it would be
best to use:
paging_mode_enabled(d) ? 1 + opt_dom0_shadow
: 0 + (opt_dom0_shadow || opt_pv_l1tf_hwdom)
Or something similar. Maybe placing this inside the sum will make the
expression too complex, so we could use a separate is_shadow boolean
to signal whether the domain will use shadow pagetables?
Thanks, Roger.
next prev parent reply other threads:[~2022-04-25 12:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-25 8:49 [PATCH v2] x86+libxl: correct p2m (shadow) memory pool size calculation Jan Beulich
2022-04-25 12:59 ` Roger Pau Monné [this message]
2022-04-25 13:19 ` Jan Beulich
2022-04-25 13:51 ` Roger Pau Monné
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=YmabFt952DO29pIA@Air-de-Roger \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.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.