All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksandr <olekstysh@gmail.com>
To: Ian Jackson <iwj@xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	xen-devel@lists.xenproject.org,
	Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
	Wei Liu <wl@xen.org>, Anthony PERARD <anthony.perard@citrix.com>,
	Juergen Gross <jgross@suse.com>, Julien Grall <julien@xen.org>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [PATCH V5 2/3] libxl/arm: Add handling of extended regions for DomU
Date: Thu, 7 Oct 2021 17:42:06 +0300	[thread overview]
Message-ID: <0450c601-656a-4e10-1802-433d2e5c44d8@gmail.com> (raw)
In-Reply-To: <24926.53922.628049.481827@mariner.uk.xensource.com>


On 07.10.21 13:57, Ian Jackson wrote:

Hi Ian.

> Stefano Stabellini writes ("Re: [PATCH V5 2/3] libxl/arm: Add handling of extended regions for DomU"):
>> On Wed, 6 Oct 2021, Oleksandr wrote:
>>> On 06.10.21 14:34, Ian Jackson wrote:
>>>> Oleksandr Tyshchenko writes ("[PATCH V5 2/3] libxl/arm: Add handling of
>>>> extended regions for DomU"):
>>>>> The extended region (safe range) is a region of guest physical
>>>>> address space which is unused and could be safely used to create
>>>>> grant/foreign mappings instead of wasting real RAM pages from
>>>>> the domain memory for establishing these mappings.
>>>> Please forgive me for asking this question now, but: why is this
>>>> ARM-specific ?
>>>
>>> Sorry, I can't say for sure which x86 mode also suffers from
>>> that. I might be wrong, but as I understand that x86 in PVH (and
>>> HVM?) mode uses unpopulated memory ranges (which are unused from
>>> Linux PoV, actually everything not yet allocated or reserved from
>>> "iomem_resource") to create foreign/grant mappings.  So the real
>>> RAM pages are not ballooned out to get an physical address space
>>> to create these mappings. The problem is that we cannot follow
>>> Linux advise which memory ranges are unused on Arm for several
>>> reasons, this is why this patch series makes the hypervisor to
>>> start allocating and exposing these ranges.
> So it sounds like you are saying this is an ARM-specific problem ?
> The key being the "several reasons" which you mention.  Are they
> ARM-specifc problems.

Yes, you could say that. Below are reasons why we need the hypervisor to 
provide these ranges on Arm from my understanding.

[leaving aside hotplug case]

1. [Related to Dom0]  Dom0 is mapped 1:1 on Arm, but there might be some 
guest mapping, mapped identically in P2M (GFN == MFN) for PV drivers to 
work. So Xen has everything in hand to be able to choose extended 
regions (which won't clash with other resources).
2. [Related to every domain]  Not all device I/O regions might be known 
(registered) by the time the guest starts creating grant/foreign 
mappings, so guest cannot guess by itself what is really unused, but the 
entity which creates the domain (Xen, toolstack) knows these details in 
advance to be able to choose extended regions (which won't clash with 
other resources).


>
>> Two more things about this being ARM-specific.
>>
>> Even if x86 was affected exactly by the same problem, the code to expose
>> the safe memory ranges to DomU is arch-specific (currently device tree.)
>>
>> Also the code to calculate the safe memory ranges is arch-specific as it
>> depends on the DomU memory layout which is arch-specific.
> This demonstrates that the implementation is arch-specific.  But one
> of libxl's functions is to abstract away implementation details and
> provide an interface that can be used to "do the right thing".
>
> Ian.

-- 
Regards,

Oleksandr Tyshchenko



  reply	other threads:[~2021-10-07 14:42 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 11:22 [PATCH V5 0/3] Add handling of extended regions (safe ranges) on Arm (Was "xen/memory: Introduce a hypercall to provide unallocated space") Oleksandr Tyshchenko
2021-10-06 11:22 ` [PATCH V5 1/3] xen/arm: Introduce gpaddr_bits field to struct xen_arch_domainconfig Oleksandr Tyshchenko
2021-10-07  0:49   ` Stefano Stabellini
2021-10-07 20:19     ` Oleksandr
2021-10-07  7:42   ` Jan Beulich
2021-10-07 12:30     ` Oleksandr
2021-10-07 12:43       ` Jan Beulich
2021-10-07 13:12         ` Oleksandr
2021-10-07 13:50           ` Jan Beulich
2021-10-07 20:23             ` Stefano Stabellini
2021-10-08  8:13               ` Jan Beulich
2021-10-08 10:25                 ` Oleksandr
2021-10-08 12:36                   ` Jan Beulich
2021-10-08 13:21                     ` Oleksandr
2021-10-08 22:14                       ` Stefano Stabellini
2021-10-11 12:36                         ` Oleksandr
2021-10-06 11:22 ` [PATCH V5 2/3] libxl/arm: Add handling of extended regions for DomU Oleksandr Tyshchenko
2021-10-06 11:34   ` Ian Jackson
2021-10-06 12:28     ` Oleksandr
2021-10-07  0:00       ` Stefano Stabellini
2021-10-07 10:57         ` Ian Jackson
2021-10-07 14:42           ` Oleksandr [this message]
2021-10-07 20:37           ` Stefano Stabellini
2021-10-07  1:29   ` Stefano Stabellini
2021-10-07 16:57     ` Oleksandr
2021-10-07 20:29       ` Stefano Stabellini
2021-10-07 20:55         ` Oleksandr
2021-10-06 11:22 ` [PATCH V5 3/3] xen/arm: Updates for extended regions support Oleksandr Tyshchenko
2021-10-07  1:50   ` Stefano Stabellini
2021-10-07 17:11     ` Oleksandr
2021-10-07 20:06       ` Stefano Stabellini
2021-10-07 20:29         ` Oleksandr
2021-10-07 20:42           ` Stefano Stabellini
2021-10-07 21:19             ` Oleksandr
2021-10-11 11:27           ` 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=0450c601-656a-4e10-1802-433d2e5c44d8@gmail.com \
    --to=olekstysh@gmail.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=anthony.perard@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=oleksandr_tyshchenko@epam.com \
    --cc=sstabellini@kernel.org \
    --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.