All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Julien Grall <julien.grall@arm.com>
Cc: sstabellini@kernel.org, wei.liu2@citrix.com,
	ian.jackson@eu.citrix.com, peter.huangpeng@huawei.com,
	xen-devel@lists.xen.org, shannon.zhao@linaro.org,
	Shannon Zhao <zhaoshenglong@huawei.com>,
	boris.ostrovsky@oracle.com
Subject: Re: [PATCH v5 16/16] libxl/arm: Add the size of ACPI tables to maxmem
Date: Thu, 15 Sep 2016 11:46:51 +0100	[thread overview]
Message-ID: <20160915104651.GJ15958@citrix.com> (raw)
In-Reply-To: <1923dc3f-67f0-34ec-f5c2-ffef2a982979@arm.com>

On Tue, Sep 13, 2016 at 11:38:35AM +0100, Julien Grall wrote:
> Hi Shannon,
> 
> On 13/09/16 08:03, Shannon Zhao wrote:
> >
> >
> >On 2016/9/12 23:18, Julien Grall wrote:
> >>Hi Shannon,
> >>
> >>On 02/09/16 03:55, Shannon Zhao wrote:
> >>>From: Shannon Zhao <shannon.zhao@linaro.org>
> >>>
> >>>Here it adds the ACPI tables size to set the target maxmem to avoid
> >>>providing less available memory for guest.
> >>>
> >>>Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
> >>>---
> >>> tools/libxl/libxl_arch.h        |  2 +-
> >>> tools/libxl/libxl_arm.c         | 18 +++++++++++++++++-
> >>> tools/libxl/libxl_arm.h         |  4 ++++
> >>> tools/libxl/libxl_arm_acpi.c    | 20 ++++++++++++++++++++
> >>> tools/libxl/libxl_arm_no_acpi.c |  6 ++++++
> >>> tools/libxl/libxl_dom.c         |  2 +-
> >>> tools/libxl/libxl_x86.c         |  2 +-
> >>> 7 files changed, 50 insertions(+), 4 deletions(-)
> >>>
> >>>diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h
> >>>index 337061f..d62fa4c 100644
> >>>--- a/tools/libxl/libxl_arch.h
> >>>+++ b/tools/libxl/libxl_arch.h
> >>>@@ -30,7 +30,7 @@ int libxl__arch_domain_save_config(libxl__gc *gc,
> >>> /* arch specific internal domain creation function */
> >>> _hidden
> >>> int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config
> >>>*d_config,
> >>>-               uint32_t domid);
> >>>+                              libxl__domain_build_state *state,
> >>>uint32_t domid);
> >>>
> >>> /* setup arch specific hardware description, i.e. DTB on ARM */
> >>> _hidden
> >>>diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
> >>>index e73d65e..c7d4f65 100644
> >>>--- a/tools/libxl/libxl_arm.c
> >>>+++ b/tools/libxl/libxl_arm.c
> >>>@@ -101,8 +101,24 @@ int libxl__arch_domain_save_config(libxl__gc *gc,
> >>> }
> >>>
> >>> int libxl__arch_domain_create(libxl__gc *gc, libxl_domain_config
> >>>*d_config,
> >>>-                              uint32_t domid)
> >>>+                              libxl__domain_build_state *state,
> >>>uint32_t domid)
> >>> {
> >>>+    libxl_domain_build_info *const info = &d_config->b_info;
> >>>+    libxl_ctx *ctx = libxl__gc_owner(gc);
> >>>+    int size;
> >>>+
> >>>+    /* Add the size of ACPI tables to maxmem if ACPI is enabled for
> >>>guest. */
> >>>+    if (libxl_defbool_val(info->acpi)) {
> >>>+        size = libxl__get_acpi_size(gc, info, state);
> >>>+        if (size < 0)
> >>>+            return ERROR_FAIL;
> >>>+        if (xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb +
> >>>+                                LIBXL_MAXMEM_CONSTANT + (size + 1023)
> >>>/ 1024)) {
> >>
> >>I still have some concern about use info->target_memkb +
> >>LIBXL_MAXMEM_CONSTANT here. What if the generic code decide to change
> >>the computation?
> >>
> >>We may forgot to replicate here. My suggestion on the previous version
> >>was to have in the common code
> >>
> >>xc_domain_setmaxmem(ctx->xch, domid, info->target_memkb +
> >>LIBXL_MAXMEM_CONSTANT + libxl__arch_memory_constant());
> >>
> >>Or a similar name.
> >>
> >Just to confirm, do you mean that having a arch function to get the size
> >each arch needs and adding the size in libxl__build_pre()?
> 
> That's correct. Wei, Ian, do you have any opinions on this?
> 

I'm fine with that.

Wei.

> Regards,
> 
> -- 
> Julien Grall

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

  reply	other threads:[~2016-09-15 10:46 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-02  2:55 [PATCH v5 00/16] Xen ARM DomU ACPI support Shannon Zhao
2016-09-02  2:55 ` [PATCH v5 01/16] tools/libxl: Add an unified configuration option for ACPI Shannon Zhao
2016-09-02 14:29   ` Wei Liu
2016-09-02  2:55 ` [PATCH v5 02/16] libxl/arm: prepare for constructing ACPI tables Shannon Zhao
2016-09-02 14:29   ` Wei Liu
2016-09-12 14:41   ` Julien Grall
2016-09-02  2:55 ` [PATCH v5 03/16] libxl/arm: Generate static ACPI DSDT table Shannon Zhao
2016-09-02 14:29   ` Wei Liu
2016-09-12 14:44   ` Julien Grall
2016-09-02  2:55 ` [PATCH v5 04/16] libxl/arm: Estimate the size of ACPI tables Shannon Zhao
2016-09-02  2:55 ` [PATCH v5 05/16] libxl/arm: Construct ACPI RSDP table Shannon Zhao
2016-09-12 14:58   ` Julien Grall
2016-09-02  2:55 ` [PATCH v5 06/16] libxl/arm: Construct ACPI XSDT table Shannon Zhao
2016-09-12 15:05   ` Julien Grall
2016-09-02  2:55 ` [PATCH v5 07/16] libxl/arm: Construct ACPI GTDT table Shannon Zhao
2016-09-12 15:08   ` Julien Grall
2016-09-02  2:55 ` [PATCH v5 08/16] libxl/arm: Factor MPIDR computing codes out as a helper Shannon Zhao
2016-09-02  2:55 ` [PATCH v5 09/16] libxl/arm: Construct ACPI MADT table Shannon Zhao
2016-09-12 15:09   ` Julien Grall
2016-09-02  2:55 ` [PATCH v5 10/16] libxl/arm: Construct ACPI FADT table Shannon Zhao
2016-09-12 15:10   ` Julien Grall
2016-09-02  2:55 ` [PATCH v5 11/16] libxl/arm: Construct ACPI DSDT table Shannon Zhao
2016-09-12 15:13   ` Julien Grall
2016-09-02  2:55 ` [PATCH v5 12/16] libxl/arm: Factor finalise_one_memory_node as a gerneric function Shannon Zhao
2016-09-02  2:55 ` [PATCH v5 13/16] libxl/arm: Add ACPI module Shannon Zhao
2016-09-02  2:55 ` [PATCH v5 14/16] public/hvm/params.h: Add macros for HVM_PARAM_CALLBACK_TYPE_PPI Shannon Zhao
2016-09-02  6:18   ` Jan Beulich
2016-09-02  7:23     ` Shannon Zhao
2016-09-02  8:17       ` Jan Beulich
2016-09-02  2:55 ` [PATCH v5 15/16] libxl/arm: Initialize domain param HVM_PARAM_CALLBACK_IRQ Shannon Zhao
2016-09-12 15:14   ` Julien Grall
2016-09-02  2:55 ` [PATCH v5 16/16] libxl/arm: Add the size of ACPI tables to maxmem Shannon Zhao
2016-09-12 15:18   ` Julien Grall
2016-09-13  7:03     ` Shannon Zhao
2016-09-13 10:38       ` Julien Grall
2016-09-15 10:46         ` Wei Liu [this message]
2016-09-19 14:53         ` Ian Jackson
2016-09-02 14:31 ` [PATCH v5 00/16] Xen ARM DomU ACPI support Wei Liu
2016-09-12 15:22 ` Julien Grall
2016-09-13  6:30   ` Shannon Zhao
2016-09-13 11:56 ` Julien Grall
2016-09-13 13:06   ` Shannon Zhao
2016-09-13 15:17     ` Julien Grall
2016-09-13 15:18       ` Julien Grall
2016-09-14  0:56       ` Shannon Zhao
2016-09-14  1:06         ` Stefano Stabellini
2016-09-14  7:14           ` Julien Grall
2016-09-14  7:32             ` Shannon Zhao
2016-09-14  7:40               ` Julien Grall
2016-09-14  8:01                 ` Shannon Zhao
2016-09-14 20:48             ` Stefano Stabellini
2016-09-14 21:26               ` 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=20160915104651.GJ15958@citrix.com \
    --to=wei.liu2@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=peter.huangpeng@huawei.com \
    --cc=shannon.zhao@linaro.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xen.org \
    --cc=zhaoshenglong@huawei.com \
    /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.