Skip to contentSkip to conversation

public/gnttab: relax v2 recommendation

PATCH Superseded Jan Beulich 3 participants 10 messages Apr 29, 2021 – May 5, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 public/gnttab: relax v2 recommendation

With there being a way to disable v2 support, telling new guests to use v2 exclusively is not a good suggestion.

xen/include/public/grant_table.h +4 -2
@@ -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.
  */
 #if __XEN_INTERFACE_VERSION__ < 0x0003020a
 #define grant_entry_v1 grant_entry
Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Jan Beulich

With there being a way to disable v2 support, telling new guests to use v2 exclusively is not a good suggestion.

xen/include/public/grant_table.h +0 -0
@@ -121,8 +121,10 @@ typedef uint32_t grant_ref_t;
 */
 

xen/include/public/grant_table.h typedef uint32_t grant_ref_t; · line 130

Quoted 10 lines
xen/include/public/grant_table.h +4 -2
 /*
- * 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.
 */
 #if __XEN_INTERFACE_VERSION__ < 0x0003020a
 #define grant_entry_v1 grant_entry

Cheers,
Luca

#2 lore raw
In reply to Jan Beulich

Hi Jan,

Quoted 8 lines · Jan Beulich

With there being a way to disable v2 support, telling new guests to use v2 exclusively is not a good suggestion.

xen/include/public/grant_table.h typedef uint32_t grant_ref_t; · line 127

Quoted 9 lines
xen/include/public/grant_table.h +4 -2
@@ -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.

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).

Cheers,

Signature · 1 line
Julien Grall
#3 lore raw
Quoted 11 lines · Julien Grall
Quoted 10 lines · Jan Beulich

With there being a way to disable v2 support, telling new guests to use v2 exclusively is not a good suggestion.

xen/include/public/grant_table.h +0 -0
@@ -121,8 +121,10 @@ typedef uint32_t grant_ref_t;
   */
 
Quoted 11 lines

xen/include/public/grant_table.h typedef uint32_t grant_ref_t; · line 127

Quoted 7 lines
xen/include/public/grant_table.h +4 -2
  /*
- * 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.

Quoted 5 lines

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.

Jan

#4 lore raw

Hi Jan,

Quoted 26 lines · Jan Beulich
Quoted 11 lines · Julien Grall
Quoted 10 lines · Jan Beulich

With there being a way to disable v2 support, telling new guests to use v2 exclusively is not a good suggestion.

xen/include/public/grant_table.h +0 -0
@@ -121,8 +121,10 @@ typedef uint32_t grant_ref_t;
    */
 
Quoted 11 lines

xen/include/public/grant_table.h typedef uint32_t grant_ref_t; · line 127

Quoted 7 lines
xen/include/public/grant_table.h +4 -2
   /*
- * 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.

Quoted 7 lines
Quoted 5 lines

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. We would also need to document the limitations as they don't seem to be (clearly?) written down in the headers.

Cheers,

Signature · 1 line
Julien Grall
#5 lore raw
Quoted 32 lines · Julien Grall

Hi Jan,

Quoted 29 lines · Jan Beulich
Quoted 11 lines · Julien Grall
Quoted 10 lines · Jan Beulich

With there being a way to disable v2 support, telling new guests to use v2 exclusively is not a good suggestion.

xen/include/public/grant_table.h +0 -0
@@ -121,8 +121,10 @@ typedef uint32_t grant_ref_t;
    */
 
Quoted 11 lines

xen/include/public/grant_table.h typedef uint32_t grant_ref_t; · line 127

Quoted 7 lines
xen/include/public/grant_table.h +4 -2
   /*
- * 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.

Quoted 3 lines

I can't remember why Linux decided to not use it everywhere, but this is a sign that v2 is not always desired.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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 ...

Quoted 2 lines

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.

Jan

#6 lore raw

Hi Jan,

Quoted 42 lines · Jan Beulich
Quoted 32 lines · Julien Grall

Hi Jan,

Quoted 29 lines · Jan Beulich
Quoted 11 lines · Julien Grall
Quoted 10 lines · Jan Beulich

With there being a way to disable v2 support, telling new guests to use v2 exclusively is not a good suggestion.

xen/include/public/grant_table.h +0 -0
@@ -121,8 +121,10 @@ typedef uint32_t grant_ref_t;
     */
 
Quoted 11 lines

xen/include/public/grant_table.h typedef uint32_t grant_ref_t; · line 127

Quoted 7 lines
xen/include/public/grant_table.h +4 -2
    /*
- * 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.

Quoted 3 lines

I can't remember why Linux decided to not use it everywhere, but this is a sign that v2 is not always desired.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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 ...

Quoted 7 lines
Quoted 2 lines

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,

Signature · 1 line
Julien Grall
#7 lore raw
Quoted 48 lines · Julien Grall

Hi Jan,

Quoted 45 lines · Jan Beulich
Quoted 32 lines · Julien Grall

Hi Jan,

Quoted 29 lines · Jan Beulich
Quoted 11 lines · Julien Grall
Quoted 10 lines · Jan Beulich

With there being a way to disable v2 support, telling new guests to use v2 exclusively is not a good suggestion.

xen/include/public/grant_table.h +0 -0
@@ -121,8 +121,10 @@ typedef uint32_t grant_ref_t;
     */
 
Quoted 11 lines

xen/include/public/grant_table.h typedef uint32_t grant_ref_t; · line 127

Quoted 7 lines
xen/include/public/grant_table.h +4 -2
    /*
- * 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.

Quoted 3 lines

I can't remember why Linux decided to not use it everywhere, but this is a sign that v2 is not always desired.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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 ...

Quoted 2 lines

We would also need to document the limitations as they don't seem to be (clearly?) written down in the headers.

Quoted 8 lines
Quoted 4 lines

... 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".

I've intentionally not said "if you hit limitations".

Quoted 10 lines

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.

Quoted 3 lines

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 limitation is based on guest attributes only for HVM. For PV, host properties matter, so PV guests strictly should be able to fall back to v2, or they are liable to end up not working on large hosts.

The other limitation is more a performance one - v2 separates grant attributes from grant status.

Quoted 3 lines

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.

I don't think the public header is the place to go into such lengths, especially when all the information is already there. Textually describing the same aspects should be done elsewhere imo. I'm of the firm opinion that the patch as is represents an improvement. There's no suggestion anywhere that things couldn't be further improved, as is the case about always.

Since I created this patch only because my request to correct the statement led to me being asked to provide the suggested new text, may I suggest that you pick up this patch or create one from scratch to accommodate all your wishes, if you believe this extra information really belongs there? All I'm after is to correct a statement that's actively misleading.

Jan

#8 lore raw

Hi Jan,

Quoted 52 lines · Jan Beulich
Quoted 51 lines · Julien Grall
Quoted 49 lines · Jan Beulich
Quoted 32 lines · Julien Grall

Hi Jan,

Quoted 29 lines · Jan Beulich
Quoted 11 lines · Julien Grall
Quoted 10 lines · Jan Beulich

With there being a way to disable v2 support, telling new guests to use v2 exclusively is not a good suggestion.

xen/include/public/grant_table.h +0 -0
@@ -121,8 +121,10 @@ typedef uint32_t grant_ref_t;
      */
 
Quoted 11 lines

xen/include/public/grant_table.h typedef uint32_t grant_ref_t; · line 127

Quoted 7 lines
xen/include/public/grant_table.h +4 -2
     /*
- * 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.

Quoted 3 lines

I can't remember why Linux decided to not use it everywhere, but this is a sign that v2 is not always desired.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

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 ...

Quoted 2 lines

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.

Quoted 5 lines
Quoted 3 lines

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".

I've intentionally not said "if you hit limitations".

This doesn't really change the point I made. :)

Quoted 7 lines
Quoted 3 lines

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.

I don't think the public header is the place to go into such lengths, especially when all the information is already there. Textually describing the same aspects should be done elsewhere imo.

The goal of comments is to document anything that cannot be easily inferred. This is the case of the limitations you mention but don't describe.

I'm of the

Quoted 1 line

firm opinion that the patch as is represents an improvement.

I haven't suggested that patch wasn't improvement. However, I think it can easily be improved further.

Quoted 10 lines

There's
no suggestion anywhere that things couldn't be further improved, as is the case about always.

Since I created this patch only because my request to correct the statement led to me being asked to provide the suggested new text, may I suggest that you pick up this patch or create one from scratch to accommodate all your wishes, if you believe this extra information really belongs there? All I'm after is to correct a statement that's actively misleading.

I am a bit confused with this answer. Are you saying you are not willing to write it but if someone else does you will accept it?

Cheers,

Signature · 1 line
Julien Grall
#9 lore raw
Quoted 10 lines · Julien Grall
Quoted 6 lines · Jan Beulich

Since I created this patch only because my request to correct the statement led to me being asked to provide the suggested new text, may I suggest that you pick up this patch or create one from scratch to accommodate all your wishes, if you believe this extra information really belongs there? All I'm after is to correct a statement that's actively misleading.

I am a bit confused with this answer. Are you saying you are not willing to write it but if someone else does you will accept it?

Along these lines, yes. One problem is if I start enumerating the limitations, arguing could easily start whether I cover them all, some are not worthwhile to mention, etc. Plus, as said, I'm not convinced this is the right place for the information. In such a case I can accept someone else thinking differently and making such a change, but I'd like to be convinced of changes I'm doing myself.

Jan