All of lore.kernel.org
 help / color / mirror / Atom feed
From: Costin Lupu <costin.lupu@cs.pub.ro>
To: Juergen Gross <jgross@suse.com>, Julien Grall <julien@xen.org>,
	Jan Beulich <jbeulich@suse.com>
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>
Subject: Re: [PATCH] stubdom: foreignmemory: Fix build after 0dbb4be739c5
Date: Fri, 16 Jul 2021 21:28:47 +0300	[thread overview]
Message-ID: <3a6f1fc6-a9b3-78bc-1b73-b7ad10d20405@cs.pub.ro> (raw)
In-Reply-To: <7fab704a-6b59-1e9b-663e-a3afdfcc319f@suse.com>

On 7/13/21 6:20 PM, Juergen Gross wrote:
> On 13.07.21 17:15, Julien Grall wrote:
>> Hi Juergen,
>>
>> On 13/07/2021 16:09, Juergen Gross wrote:
>>> On 13.07.21 16:38, Julien Grall wrote:
>>>> Hi Juergen,
>>>>
>>>> On 13/07/2021 15:23, Juergen Gross wrote:
>>>>> On 13.07.21 16:19, Julien Grall wrote:
>>>>>> Hi Jan,
>>>>>>
>>>>>> 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.
>>>>>
>>>>> This define is used for accessing data of other domains. See the
>>>>> define
>>>>> for XEN_PAGE_SIZE in xen/include/public/io/ring.h
>>>>>
>>>>> So it should be a constant (minimal) page size for all hypervisors and
>>>>> guests of an architecture.
>>>>
>>>> Do you mean the maximum rather than minimal? If you use the minimal
>>>> (4KB), then you would not be able to map the page in the stage-2 if
>>>> the hypervisor is using 64KB.
>>>
>>> But this would mean that the current solution to use XC_PAGE_SIZE is
>>> wrong, as this is 4k.
>>
>> The existing ABI is implicitely based on using the hypervisor page
>> granularity (currently 4KB).
>>
>> There is really no way we can support existing guest on 64KB
>> hypervisor. But if we were going to break them, then we should
>> consider to do one of the following option:
>>     1) use 64KB page granularity for ABI
>>     2) query the hypervisor page granularity at runtime
>>
>> The ideal is 2) because it is more scalable for the future. We also
>> need to consider to extend the PV protocol so the backend and frontend
>> can agree on the page size.
> 
> I absolutely agree, but my suggestion was to help finding a proper way
> to cleanup the current interface mess. And this should be done the way
> I suggested IMO.
> 
> A later interface extension for future guests can still be done on top
> of that.

Alright, let's have a little recap to see if I got it right and to agree
on the next steps. There are 2 proposed solutions, let's say a static
one and a dynamic one.

1) Static solution (proposed by Juergen)
- We define XEN_PAGE_* values in a xen/include/public/arch-*/*.h header.
- Q: Should we define a new header for that? page.h or page_size.h are
ok as new filenames?

Pros:
- We fix the interfaces mess and we can get rid of xenctrl lib
dependency for some of the libs that need only the XEN_PAGE_* definitions.
- It's faster to implement, with fewer changes.

Cons:
- Well, it's static, it doesn't allow the hypervisor to provide
different values for different guests.


2) Dynamic solution (proposed by Jan and Julien)
We get the value(s) by calling a hypcall, probably as a query related to
some guest domain.

Pros:
- It's dynamic and scalable. We would support different values for
different guests.

Cons:
- More difficult to implement. It changes the paradigm in the toolstack
libs, every occurrence of XC_PAGE_* would have to be amended. Moreover,
we might want to make the hypcall once and save the value for later
(probably several toolstack structures should be extended for that)


I searched for the occurrences of XC_PAGE_* in the toolstack libs and
it's a *lot* of them. IMHO I think we should pick the static solution
for now, considering that it would be faster to implement. Please let me
know if this is OK or not. Any comments are appreciated.

Cheers,
Costin


  reply	other threads:[~2021-07-16 18:29 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
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 [this message]
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=3a6f1fc6-a9b3-78bc-1b73-b7ad10d20405@cs.pub.ro \
    --to=costin.lupu@cs.pub.ro \
    --cc=andrew.cooper3@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --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.