All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Julien Grall <julien@xen.org>
Cc: Julien Grall <jgrall@amazon.com>,
	Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Costin Lupu <costin.lupu@cs.pub.ro>,
	Juergen Gross <jgross@suse.com>
Subject: Re: [PATCH] stubdom: foreignmemory: Fix build after 0dbb4be739c5
Date: Wed, 14 Jul 2021 08:11:22 +0200	[thread overview]
Message-ID: <06a6b8de-520f-1c62-0f5f-a28eb1d9c7fd@suse.com> (raw)
In-Reply-To: <de797e4f-cab9-a31e-4cf7-5e8996cae5bc@xen.org>

On 13.07.2021 18:33, Julien Grall wrote:
> Hi,
> 
> On 13/07/2021 17:27, Jan Beulich wrote:
>> On 13.07.2021 18:15, Julien Grall wrote:
>>> On 13/07/2021 16:52, Jan Beulich wrote:
>>>> On 13.07.2021 16:33, Julien Grall wrote:
>>>>> On 13/07/2021 15:23, Jan Beulich wrote:
>>>>>> On 13.07.2021 16:19, Julien Grall wrote:
>>>>>>> On 13/07/2021 15:14, Jan Beulich wrote:
>>>>>>>>> And I don't think it should be named XC_PAGE_*, but rather XEN_PAGE_*.
>>>>>>>>
>>>>>>>> Even that doesn't seem right to me, at least in principle. There shouldn't
>>>>>>>> be a build time setting when it may vary at runtime. IOW on Arm I think a
>>>>>>>> runtime query to the hypervisor would be needed instead.
>>>>>>>
>>>>>>> Yes, we want to be able to use the same userspace/OS without rebuilding
>>>>>>> to a specific hypervisor page size.
>>>>>>>
>>>>>>>> And thinking
>>>>>>>> even more generally, perhaps there could also be mixed (base) page sizes
>>>>>>>> in use at run time, so it may need to be a bit mask which gets returned.
>>>>>>>
>>>>>>> I am not sure to understand this. Are you saying the hypervisor may use
>>>>>>> at the same time different page size?
>>>>>>
>>>>>> I think so, yes. And I further think the hypervisor could even allow its
>>>>>> guests to do so.
>>>>>
>>>>> This is already the case on Arm. We need to differentiate between the
>>>>> page size used by the guest and the one used by Xen for the stage-2 page
>>>>> table (what you call EPT on x86).
>>>>>
>>>>> In this case, we are talking about the page size used by the hypervisor
>>>>> to configure the stage-2 page table
>>>>>
>>>>>> There would be a distinction between the granularity at
>>>>>> which RAM gets allocated and the granularity at which page mappings (RAM
>>>>>> or other) can be established. Which yields an environment which I'd say
>>>>>> has no clear "system page size".
>>>>>
>>>>> I don't quite understand why you would allocate and etablish the memory
>>>>> with a different page size in the hypervisor. Can you give an example?
>>>>
>>>> Pages may get allocated in 16k chunks, but there may be ways to map
>>>> 4k MMIO regions, 4k grants, etc. Due to the 16k allocation granularity
>>>> you'd e.g. still balloon pages in and out at 16k granularity.
>>> Right, 16KB is a multiple of 4KB, so a guest could say "Please allocate
>>> a contiguous chunk of 4 4KB pages".
>>>
>>>   From my understanding, you are suggesting to tell the guest that we
>>> "support 4KB, 16KB, 64KB...". However, it should be sufficient to say
>>> "we support 4KB and all its multiple".
>>
>> No - in this case it could legitimately expect to be able to balloon
>> out a single 4k page. Yet that's not possible with 16k allocation
>> granularity.
> 
> I am confused... why would you want to put such restriction? IOW, what 
> are you trying to protect against?

Protect? It may simply be that the most efficient page size is 16k.
Hence accounting of pages may be done at 16k granularity. IOW there
then is one struct page_info per 16k page. How would you propose a
guest would alloc/free 4k pages in such a configuration?

Jan



  reply	other threads:[~2021-07-14  6:11 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13  9:20 [PATCH] stubdom: foreignmemory: Fix build after 0dbb4be739c5 Julien Grall
2021-07-13  9:25 ` Andrew Cooper
2021-07-13  9:27 ` Juergen Gross
2021-07-13  9:31   ` Julien Grall
2021-07-13 10:35     ` Juergen Gross
2021-07-13  9:35   ` Andrew Cooper
2021-07-13 11:21     ` Julien Grall
2021-07-13 11:23       ` Andrew Cooper
2021-07-13 11:53         ` Julien Grall
2021-07-13 12:39           ` Andrew Cooper
2021-07-13 13:00             ` Julien Grall
2021-07-13 13:46               ` Costin Lupu
2021-07-13 14:00                 ` Juergen Gross
2021-07-13 14:14                   ` Jan Beulich
2021-07-13 14:19                     ` Julien Grall
2021-07-13 14:23                       ` Jan Beulich
2021-07-13 14:33                         ` Julien Grall
2021-07-13 15:52                           ` Jan Beulich
2021-07-13 16:15                             ` Julien Grall
2021-07-13 16:27                               ` Jan Beulich
2021-07-13 16:33                                 ` Julien Grall
2021-07-14  6:11                                   ` Jan Beulich [this message]
2021-07-14  8:51                                     ` Julien Grall
2021-07-13 14:23                       ` Juergen Gross
2021-07-13 14:28                         ` Jan Beulich
2021-07-13 14:33                           ` Juergen Gross
2021-07-13 14:38                         ` Julien Grall
2021-07-13 15:09                           ` Juergen Gross
2021-07-13 15:15                             ` Julien Grall
2021-07-13 15:20                               ` Juergen Gross
2021-07-16 18:28                                 ` Costin Lupu
2021-07-27 13:36                                   ` Andrew Cooper
2021-07-30  9:18                                     ` Costin Lupu

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=06a6b8de-520f-1c62-0f5f-a28eb1d9c7fd@suse.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=costin.lupu@cs.pub.ro \
    --cc=iwj@xenproject.org \
    --cc=jgrall@amazon.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.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.