xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Julien Grall <julien@xen.org>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Ian Jackson <iwj@xenproject.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	Luca Fancellu <luca.fancellu@arm.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] public/gnttab: relax v2 recommendation
Date: Wed, 5 May 2021 09:51:23 +0100	[thread overview]
Message-ID: <9b8fb87c-a2fb-f371-5914-f0d175c18b02@xen.org> (raw)
In-Reply-To: <51c29a91-8659-7525-a565-5b9fcfc935f3@suse.com>

Hi Jan,

On 05/05/2021 09:24, Jan Beulich wrote:
> On 05.05.2021 10:12, Julien Grall wrote:
>> Hi Jan,
>>
>> On 30/04/2021 09:36, Jan Beulich wrote:
>>> On 30.04.2021 10:19, Julien Grall wrote:
>>>> On 29/04/2021 14:10, Jan Beulich wrote:
>>>>> With there being a way to disable v2 support, telling new guests to use
>>>>> v2 exclusively is not a good suggestion.
>>>>>
>>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>>>
>>>>> --- a/xen/include/public/grant_table.h
>>>>> +++ b/xen/include/public/grant_table.h
>>>>> @@ -121,8 +121,10 @@ typedef uint32_t grant_ref_t;
>>>>>      */
>>>>>     
>>>>>     /*
>>>>> - * Version 1 of the grant table entry structure is maintained purely
>>>>> - * for backwards compatibility.  New guests should use version 2.
>>>>> + * Version 1 of the grant table entry structure is maintained largely for
>>>>> + * backwards compatibility.  New guests are recommended to support using
>>>>> + * version 2 to overcome version 1 limitations, but to be able to fall back
>>>>> + * to version 1.
>>>>
>>>> v2 is not supported on Arm and I don't see it coming anytime soon.
>>>> AFAIK, Linux will also not use grant table v2 unless the guest has a
>>>> address space larger than 44 (?) bits.
>>>
>>> Yes, as soon as there are frame numbers not representable in 32 bits.
>>>
>>>> I can't remember why Linux decided to not use it everywhere, but this is
>>>> a sign that v2 is not always desired.
>>>>
>>>> So I think it would be better to recommend new guest to use v1 unless
>>>> they hit the limitations (to be details).
>>>
>>> IOW you'd prefer s/be able to fall back/default/? I'd be fine that way
>>
>> Yes.
> 
> Okay, I've changed that part, but ...
> 
>> We would also need to document the limitations as they don't seem
>> to be (clearly?) written down in the headers.
> 
> ... I'm struggling to see where (and perhaps even why) this would be
> needed. The v1 and v2 grant table entry formats are all there. I'm
> inclined to consider this an orthogonal addition to make by whoever
> thinks such an addition is needed in the first place.

The current comment is not mentionning about limitations but instead say 
"new OS should use v2". Your proposal is to say "default to v1 but use 
v2 if you hit limitations".

As Xen developper, I am aware of a single limitation (the 44 bits). But 
here you suggest there are multiple ones. I could probably figure out 
the others if I dig into the code...

Now imagine, you are an OS developper new to Xen. I don't think this is 
fair to say "there are limitations but I will not tell you directly. 
Instead you should try to infer them from the definitions". There is a 
chance, he/she may have missed some of the limitations and therefore the 
decision to switch between v1 and v2 would be done incorrectly.

In addition to that, it also means she/he may end up to implement the 
two versions when implementing v1 may just be sufficient (custom OSes 
may never need 44 bits worth of address space).

This is not a very friendly way to work on Xen. FAOD, I am not saying 
that the other headers are perfect... Instead, I am saying we ought to 
improve new wording to make the project a bit more welcoming.

Cheers,

-- 
Julien Grall


  reply	other threads:[~2021-05-05  8:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-29 13:10 [PATCH] public/gnttab: relax v2 recommendation Jan Beulich
2021-04-30  7:42 ` Luca Fancellu
2021-04-30  8:19 ` Julien Grall
2021-04-30  8:36   ` Jan Beulich
2021-05-05  8:12     ` Julien Grall
2021-05-05  8:24       ` Jan Beulich
2021-05-05  8:51         ` Julien Grall [this message]
2021-05-05 10:57           ` Jan Beulich
2021-05-05 11:50             ` Julien Grall
2021-05-05 12:18               ` Jan Beulich

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=9b8fb87c-a2fb-f371-5914-f0d175c18b02@xen.org \
    --to=julien@xen.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=luca.fancellu@arm.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 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).