xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Boris Ostrovsky <boris.ostrovsky@oracle.com>
To: Stefano Stabellini <sstabellini@kernel.org>,
	George Dunlap <dunlapg@umich.edu>
Cc: Wei Liu <wei.liu2@citrix.com>,
	Steve Capper <Steve.Capper@arm.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	"Huangpeng (Peter)" <peter.huangpeng@huawei.com>,
	"xen-devel@lists.xen.org" <xen-devel@lists.xen.org>,
	Julien Grall <julien.grall@arm.com>,
	Shannon Zhao <shannon.zhao@linaro.org>,
	Shannon Zhao <zhaoshenglong@huawei.com>
Subject: Re: [PATCH v2 16/17] libxc/xc_dom_arm: Copy ACPI tables to guest space
Date: Mon, 25 Jul 2016 18:46:21 -0400	[thread overview]
Message-ID: <e73d73d3-48ad-e1a8-ba44-d29cb588cf2d@oracle.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1607251503210.12319@sstabellini-ThinkPad-X260>

On 07/25/2016 06:06 PM, Stefano Stabellini wrote:
> On Mon, 25 Jul 2016, George Dunlap wrote:
>> On Thu, Jul 21, 2016 at 10:15 PM, Stefano Stabellini
>> <sstabellini@kernel.org> wrote:
>>>> You are assuming that the guest will map the ACPI blob with the same
>>>> attributes as the rest of the superpage.
>>>>
>>>> IHMO, a sane operating system will want to map the ACPI blob read-only.
>>> That's true. But there are other things which might be mapped
>>> differently and could shatter a stage-1 superpage mapping (especially on
>>> x86 that has a much more complex memory map than ARM). Obviously adding
>>> one more is not doing it any good, but it might not make a difference in
>>> practice.
>>>
>>> Anyway, I agree with Julien that his suggestion is the best for ARM. If
>>> the libxl maintainers are willing to accept two different code paths for
>>> this on ARM and x86, then I am fine with it too.
>> Sorry to be a bit late to this thread -- there's a interface principle
>> that I think we should at some point have a larger discussion about:
>> whether "maxmem" means the amount of RAM which the guest sees as RAM,
>> or whether "maxmem" means the amount of RAM that the administrator
>> sees as used by the guest.  At the moment tnhere's no consistent
>> answer actually; but I am strongly of the opinion that for usability
>> the best answer is for "memory" to be the *total* amount of *host*
>> memory used by the guest.  In an ideal world, the admin should be able
>> to do "xl info", see that there is 3000MiB free, and then start a
>> guest with 3000MiB and expect it to succeed.  At the moment he has to
>> guess.
> I don't want to add to the confusion, but maxmem is often higher than
> the actual memory allocated for the guest at any given moment, given
> that it's the upper limit enforced by the hypervisor (maxmem and mem are
> often different, think about ballooning). So how can it be "the amount
> of RAM that the administrator sees as used by the guest"? At best it
> could be "the amount of RAM that the administrator sees could be at most
> used by the guest" or "the amount of RAM that the administrator sees as
> allocated on behalf of the guest at boot".
>
>
>> To confirm, do you include memory allocated by the hypervisor to keep
>> track of the guest (i.e struc domain, struct vcpu...)?
>>
>> If not, the problem stays the same because the admin will have to know
>> how much memory Xen will allocate to keep track of the guest. So if "xl
>> info" tells you that 3000MiB is free, you will only be able to use
>> 3000MiB - few kilobytes.
> That's right, unfortunately all those structs allocated by the
> hypervisor are completely unknown to the tootlstack. However they should
> be an order of magnitude or two smaller than things like the videoram,
> the ethernet blob (on x86) or the ACPI blob. So taking the memory for
> ACPI and videoram from the existing maxmem pool without increasing it,
> would significantly improve, but not completely solve, the problem
> described by George.
>
>
> Going back to the discussion about how to account for the ACPI blob in
> maxmem, let's make this simple, if we increase maxmem by the size of the
> ACPI blob:
>
> - the toolstack allocates more RAM than expected (bad)
> - when the admin specifies 1GB of RAM, the guest actually gets 1GB of
>   usable RAM (good)
> - things are faster as Xen and the guest can exploit superpage mappings
>   more easily at stage-1 and stage-2 (good)
>
> Let's call this option A.
>
> If we do not increase maxmem:
>
> - the toolstack allocates less RAM, closer to the size specified in the
>   VM config file (good)
> - the guest gets less usable memory than expected, less than what was
>   specified in the VM config file (bad)


Not sure I agree with this, at least for x86/Linux: guest gets 1GB of
usable RAM and part of that RAM stores ACPI stuff. Guest is free to
stash ACPI tables somewhere else or ignore them altogether and use that
memory for whatever it wants.


-boris


> - things get slower as one or two 1GB superpage mappings are going to be
>   shattered, almost certainly the stage-1 mapping, probably the stage-2
>   mapping too, depending on the guest memory layout which is arch
>   specific (bad)
>
> Let's call this option B.
>
> Both have pros and cons. Julien feels strongly for option A. I vote for
> option A, but I find option B also acceptable. Let's make a decision so
> that Shannon can move forward.



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

  reply	other threads:[~2016-07-25 22:46 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-23  3:16 [PATCH v2 00/17] Xen ARM DomU ACPI support Shannon Zhao
2016-06-23  3:16 ` [PATCH v2 01/17] libxl/arm: Factor out codes for generating DTB Shannon Zhao
2016-06-23  3:16 ` [PATCH v2 02/17] libxc: Add placeholders for ACPI tables blob and size Shannon Zhao
2016-06-23  3:16 ` [PATCH v2 03/17] libxl/arm: Add a configuration option for ARM DomU ACPI Shannon Zhao
2016-06-23 13:39   ` Stefano Stabellini
2016-06-23 14:34     ` Shannon Zhao
2016-06-27 10:40       ` Julien Grall
2016-07-07 15:30         ` Wei Liu
2016-07-12  3:40           ` Shannon Zhao
2016-07-12  9:22             ` Julien Grall
2016-07-12 11:33               ` Wei Liu
2016-07-12 14:17                 ` Shannon Zhao
2016-07-12 14:33                   ` Wei Liu
2016-07-12 14:45                     ` Shannon Zhao
2016-07-13  7:54                 ` Shannon Zhao
2016-07-13  9:20                   ` Julien Grall
2016-07-13  9:48                     ` Shannon Zhao
2016-07-13 10:03                       ` Julien Grall
2016-07-15  8:00                         ` Shannon Zhao
2016-07-15  8:07                           ` Shannon Zhao
2016-07-18 19:40                             ` Stefano Stabellini
2016-07-19 10:40                               ` Wei Liu
2016-07-19 10:44                               ` Ian Jackson
2016-06-23 15:53   ` Julien Grall
2016-06-23  3:16 ` [PATCH v2 04/17] libxl/arm: prepare for constructing ACPI tables Shannon Zhao
2016-06-23 13:37   ` Stefano Stabellini
2016-06-23 14:23     ` Shannon Zhao
2016-06-23 14:27       ` Stefano Stabellini
2016-06-23 16:18   ` Julien Grall
2016-06-23  3:16 ` [PATCH v2 05/17] libxl/arm: Construct ACPI RSDP table Shannon Zhao
2016-06-23  3:16 ` [PATCH v2 06/17] libxl/arm: Construct ACPI XSDT table Shannon Zhao
2016-06-23  3:16 ` [PATCH v2 07/17] libxl/arm: Construct ACPI GTDT table Shannon Zhao
2016-06-23 15:00   ` Stefano Stabellini
2016-06-23 16:19     ` Julien Grall
2016-06-23 16:26   ` Julien Grall
2016-06-23 16:58     ` Julien Grall
2016-06-27  1:44     ` Shannon Zhao
2016-06-27 10:17       ` Julien Grall
2016-06-29  9:29         ` Shannon Zhao
2016-06-29  9:42           ` Julien Grall
2016-06-29 13:41             ` Shannon Zhao
2016-07-05 16:42         ` Stefano Stabellini
2016-07-06  9:50           ` Julien Grall
2016-07-06 10:16             ` Stefano Stabellini
2016-06-23  3:16 ` [PATCH v2 08/17] libxl/arm: Factor MPIDR computing codes out as a helper Shannon Zhao
2016-06-23 16:29   ` Julien Grall
2016-06-23  3:16 ` [PATCH v2 09/17] libxl/arm: Construct ACPI MADT table Shannon Zhao
2016-06-23 16:36   ` Julien Grall
2016-06-23  3:16 ` [PATCH v2 10/17] libxl/arm: Construct ACPI FADT table Shannon Zhao
2016-06-23  3:16 ` [PATCH v2 11/17] libxl/arm: Construct ACPI DSDT table Shannon Zhao
2016-06-23 14:50   ` Stefano Stabellini
2016-06-23 16:42     ` Julien Grall
2016-06-27  1:50       ` Shannon Zhao
2016-06-23 17:03   ` Julien Grall
2016-06-27  6:01     ` Shannon Zhao
2016-06-27 10:29       ` Julien Grall
2016-06-27 12:05         ` Boris Ostrovsky
2016-06-28 11:03           ` Shannon Zhao
2016-06-28 13:41             ` Boris Ostrovsky
2016-06-29 18:58               ` Boris Ostrovsky
2016-07-01  7:58                 ` Shannon Zhao
2016-07-01 10:18                   ` Julien Grall
2016-07-01 14:42                     ` Boris Ostrovsky
2016-07-01 15:14                       ` Julien Grall
2016-06-23  3:16 ` [PATCH v2 12/17] libxl/arm: Add a helper to calculate the ACPI table checksum Shannon Zhao
2016-06-23 17:05   ` Julien Grall
2016-06-23  3:17 ` [PATCH v2 13/17] libxl/arm: Link all ACPI tables into one buffer Shannon Zhao
2016-06-23 17:10   ` Julien Grall
2016-06-23  3:17 ` [PATCH v2 14/17] libxl/arm: Factor finalise_one_memory_node as a gerneric function Shannon Zhao
2016-06-23  3:17 ` [PATCH v2 15/17] libxl/arm: Add ACPI module Shannon Zhao
2016-06-23 18:35   ` Julien Grall
2016-06-25  3:22     ` Shannon Zhao
2016-06-27  9:48       ` Julien Grall
2016-06-23  3:17 ` [PATCH v2 16/17] libxc/xc_dom_arm: Copy ACPI tables to guest space Shannon Zhao
2016-06-23 18:46   ` Julien Grall
2016-06-27  6:25     ` Shannon Zhao
2016-06-27 10:49       ` Julien Grall
2016-06-27 12:11         ` Boris Ostrovsky
2016-07-05 17:13     ` Stefano Stabellini
2016-07-06  9:46       ` Julien Grall
2016-07-06 10:12         ` Stefano Stabellini
2016-07-12  3:47           ` Shannon Zhao
2016-07-12  9:25             ` Julien Grall
2016-07-12 11:35             ` Wei Liu
2016-07-12 14:42               ` Shannon Zhao
2016-07-12 14:50                 ` Wei Liu
2016-07-12 14:57                   ` Shannon Zhao
2016-07-12 15:08                     ` Boris Ostrovsky
2016-07-12 15:13                       ` Wei Liu
2016-07-12 15:21                         ` Boris Ostrovsky
2016-07-12 16:05                           ` Wei Liu
2016-07-12 16:10                       ` Julien Grall
2016-07-12 16:58                         ` Boris Ostrovsky
2016-07-13 15:22                           ` Julien Grall
2016-07-13 17:08                             ` Boris Ostrovsky
2016-07-14 11:15                               ` Wei Liu
2016-07-15  9:39                                 ` Shannon Zhao
2016-07-19 10:38                                   ` Wei Liu
2016-07-20  6:52                                     ` Shannon Zhao
2016-07-20  9:32                                       ` Wei Liu
2016-07-25  7:56                                         ` Shannon Zhao
2016-07-28 11:10                                           ` Julien Grall
2016-07-14 11:29                               ` Julien Grall
2016-07-14 13:37                             ` Stefano Stabellini
2016-07-20 12:33                               ` Julien Grall
2016-07-20 13:33                                 ` Boris Ostrovsky
2016-07-20 13:41                                   ` Julien Grall
2016-07-20 14:09                                     ` Boris Ostrovsky
2016-07-20 17:28                                       ` Stefano Stabellini
2016-07-20 19:51                                         ` Boris Ostrovsky
2016-07-21 17:53                                           ` Stefano Stabellini
2016-07-21 18:23                                             ` Julien Grall
2016-07-21 18:54                                               ` Stefano Stabellini
2016-07-21 19:14                                                 ` Julien Grall
2016-07-21 21:15                                                   ` Stefano Stabellini
2016-07-25  8:38                                                     ` George Dunlap
2016-07-25  9:46                                                       ` Julien Grall
2016-07-25 22:06                                                       ` Stefano Stabellini
2016-07-25 22:46                                                         ` Boris Ostrovsky [this message]
2016-07-25 23:40                                                           ` Stefano Stabellini
2016-07-26  1:17                                                             ` Boris Ostrovsky
2016-07-28 11:06                                                               ` Julien Grall
2016-07-28 12:42                                                                 ` Shannon Zhao
2016-08-02 11:01                                                                   ` Wei Liu
2016-08-03 19:20                                                                     ` Julien Grall
2016-08-04 10:17                                                                       ` Wei Liu
2016-08-02 11:01                                                                 ` Wei Liu
2016-07-07 15:35     ` Wei Liu
2016-06-23  3:17 ` [PATCH v2 17/17] libxl/arm: Initialize domain param HVM_PARAM_CALLBACK_IRQ Shannon Zhao
2016-06-23 18:48   ` 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=e73d73d3-48ad-e1a8-ba44-d29cb588cf2d@oracle.com \
    --to=boris.ostrovsky@oracle.com \
    --cc=Steve.Capper@arm.com \
    --cc=dunlapg@umich.edu \
    --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=wei.liu2@citrix.com \
    --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 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).