public: xen: Define missing guest handle for int32_t
PATCH 1/1 public: xen: Define missing guest handle for int32_t
Commit afab29d0882f ("public: s/int/int32_t") replaced int with int32_t in XEN_GUEST_HANDLE() in memory.h but there is no guest handle defined for it. This results in a build failure. Example on Arm:
./include/public/arch-arm.h:205:41: error: unknown type name ‘__guest_handle_64_int32_t’
205 | #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name
| ^~~~~~~~~~~~~~~~~~
./include/public/arch-arm.h:206:41: note: in expansion of macro ‘__XEN_GUEST_HANDLE’
206 | #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name)
| ^~~~~~~~~~~~~~~~~~./include/public/memory.h:277:5: note: in expansion of macro ‘XEN_GUEST_HANDLE’
277 | XEN_GUEST_HANDLE(int32_t) errs;
Fix it. Also, drop guest handle definition for int given no further use.
--- xen/include/public/xen.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/include/public/xen.h +1 -1
@@ -28,7 +28,6 @@/* Guest handles for primitive C types. */ DEFINE_XEN_GUEST_HANDLE (char); __DEFINE_XEN_GUEST_HANDLE(uchar, unsigned char); -DEFINE_XEN_GUEST_HANDLE (int); __DEFINE_XEN_GUEST_HANDLE(uint, unsigned int);#if __XEN_INTERFACE_VERSION__ <0x00040300 DEFINE_XEN_GUEST_HANDLE (long);
@@ -36,6 +35,7 @@ __DEFINE_XEN_GUEST_HANDLE(ulong, unsigned long);#endif DEFINE_XEN_GUEST_HANDLE (void); +DEFINE_XEN_GUEST_HANDLE (int32_t);DEFINE_XEN_GUEST_HANDLE (uint64_t);DEFINE_XEN_GUEST_HANDLE (xen_pfn_t);DEFINE_XEN_GUEST_HANDLE (xen_ulong_t);
Signature · 1 line
2.25.1
Hi Michal,
Quoted 12 lines · Michal Orzel
Commit
afab29d0882f("public: s/int/int32_t") replaced int withint32_tinXEN_GUEST_HANDLE()inmemory.hbut there is no guest handle defined for it. This results in a build failure. Example on Arm:
./include/public/arch-arm.h:205:41: error: unknown type name ‘__guest_handle_64_int32_t’205 | #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name | ^~~~~~~~~~~~~~~~~~ ./include/public/arch-arm.h:206:41: note: in expansion of macro ‘__XEN_GUEST_HANDLE’ 206 | #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) | ^~~~~~~~~~~~~~~~~~
Quoted 8 lines
./include/public/memory.h:277:5: note: in expansion of macro ‘XEN_GUEST_HANDLE’
277 |XEN_GUEST_HANDLE(int32_t)errs;Fix it. Also, drop guest handle definition for int given no further use.
Fixes afab29d0882f ("public: s/int/int32_t")Signed-off-by Michal Orzel <[email protected]>---
I’ve build it for arm64, arm32 and x86
Hi Michal,
Quoted 10 lines · Michal Orzel
Commit
afab29d0882f("public: s/int/int32_t") replaced int withint32_tinXEN_GUEST_HANDLE()inmemory.hbut there is no guest handle defined for it. This results in a build failure. Example on Arm:
./include/public/arch-arm.h:205:41: error: unknown type name ‘__guest_handle_64_int32_t’205 | #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name | ^~~~~~~~~~~~~~~~~~ ./include/public/arch-arm.h:206:41: note: in expansion of macro ‘__XEN_GUEST_HANDLE’ 206 | #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) | ^~~~~~~~~~~~~~~~~~
Quoted 7 lines
./include/public/memory.h:277:5: note: in expansion of macro ‘XEN_GUEST_HANDLE’
277 |XEN_GUEST_HANDLE(int32_t)errs;Fix it. Also, drop guest handle definition for int given no further use.
Fixes afab29d0882f ("public: s/int/int32_t")Signed-off-by Michal Orzel <[email protected]>
So it turned out that I committed v1 from Stefano. I was meant to commit the patch at all, but I think I started with a dirty staging :(. Sorry for that.
I have reverted Stefano's commit for now so we can take the correct patch.
Now, from my understanding, Andrew suggested on Matrix that this solution may actually be a good way to handle GUEST_HANLDEs (they were removed in v2). Maybe this can be folded in Stefano's patch?
Cheers,
Signature · 1 line
Julien Grall
Stefano Stabellini
Reviewed-byQuoted 23 lines · Julien Grall
Hi Michal,
Quoted 20 lines · Michal Orzel
Commit
afab29d0882f("public: s/int/int32_t") replaced int withint32_tinXEN_GUEST_HANDLE()inmemory.hbut there is no guest handle defined for it. This results in a build failure. Example on Arm:
./include/public/arch-arm.h:205:41: error: unknown type name ‘__guest_handle_64_int32_t’205 | #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name | ^~~~~~~~~~~~~~~~~~ ./include/public/arch-arm.h:206:41: note: in expansion of macro ‘__XEN_GUEST_HANDLE’ 206 | #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) | ^~~~~~~~~~~~~~~~~~
./include/public/memory.h:277:5: note: in expansion of macro ‘XEN_GUEST_HANDLE’
277 |XEN_GUEST_HANDLE(int32_t)errs;Fix it. Also, drop guest handle definition for int given no further use.
Fixes afab29d0882f ("public: s/int/int32_t")Signed-off-by Michal Orzel <[email protected]>
Quoted 8 lines
So it turned out that I committed v1 from Stefano. I was meant to commit the patch at all, but I think I started with a dirty staging :(. Sorry for that.
I have reverted Stefano's commit for now so we can take the correct patch.
Now, from my understanding, Andrew suggested on Matrix that this solution may actually be a good way to handle
GUEST_HANLDEs(they were removed in v2). Maybe this can be folded in Stefano's patch?
v1 together with Michal's fix is correct. Also v2 alone is correct, or v2 with Michal's fix is also correct.
My preference is v2 with Michal's fix, they can be committed as separate patches. Also the others options are fine.
Hi Stefano,
Quoted 31 lines · Stefano Stabellini
Quoted 23 lines · Julien Grall
Hi Michal,
Quoted 20 lines · Michal Orzel
Commit
afab29d0882f("public: s/int/int32_t") replaced int withint32_tinXEN_GUEST_HANDLE()inmemory.hbut there is no guest handle defined for it. This results in a build failure. Example on Arm:
./include/public/arch-arm.h:205:41: error: unknown type name ‘__guest_handle_64_int32_t’205 | #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name | ^~~~~~~~~~~~~~~~~~ ./include/public/arch-arm.h:206:41: note: in expansion of macro ‘__XEN_GUEST_HANDLE’ 206 | #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) | ^~~~~~~~~~~~~~~~~~ ./include/public/memory.h:277:5: note: in expansion of macro ‘XEN_GUEST_HANDLE’ 277 | XEN_GUEST_HANDLE(int32_t) errs;Fix it. Also, drop guest handle definition for int given no further use.
Fixes afab29d0882f ("public: s/int/int32_t")Signed-off-by Michal Orzel <[email protected]>Reviewed-by Stefano Stabellini <[email protected]>Quoted 3 lines
So it turned out that I committed v1 from Stefano. I was meant to commit the patch at all, but I think I started with a dirty staging :(. Sorry for that.
Quoted 8 lines
Quoted 5 lines
I have reverted Stefano's commit for now so we can take the correct patch.
Now, from my understanding, Andrew suggested on Matrix that this solution may actually be a good way to handle
GUEST_HANLDEs(they were removed in v2). Maybe this can be folded in Stefano's patch?v1 together with Michal's fix is correct. Also v2 alone is correct, or v2 with Michal's fix is also correct.
I am slightly confused, v2 + Michal's fix means that XEN_GUEST_HANDLE(int) is removed and we introduce XEN_GUEST_INT(int32_t) with no user. So wouldn't this break the build?
Quoted 3 lines
My preference is v2 with Michal's fix, they can be committed as separate patches. Also the others options are fine.
I am fine if you want to commit them separately. However, I am not sure your suggestion about using v2 + Michal's fix is actually correct.
Cheers,
Signature · 1 line
Julien Grall
Quoted 45 lines · Julien Grall
Hi Stefano,
Quoted 42 lines · Stefano Stabellini
Quoted 25 lines · Julien Grall
Hi Michal,
Quoted 22 lines · Michal Orzel
Commit
afab29d0882f("public: s/int/int32_t") replaced int withint32_tinXEN_GUEST_HANDLE()inmemory.hbut there is no guest handle defined for it. This results in a build failure. Example on Arm:
./include/public/arch-arm.h:205:41: error: unknown type name ‘__guest_handle_64_int32_t’205 | #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name | ^~~~~~~~~~~~~~~~~~
./include/public/arch-arm.h:206:41: note: in expansion of macro ‘__XEN_GUEST_HANDLE’
206 | #defineXEN_GUEST_HANDLE(name)__XEN_GUEST_HANDLE(name)| ^~~~~~~~~~~~~~~~~~ ./include/public/memory.h:277:5: note: in expansion of macro ‘XEN_GUEST_HANDLE’ 277 | XEN_GUEST_HANDLE(int32_t) errs;Fix it. Also, drop guest handle definition for int given no further use.
Fixes afab29d0882f ("public: s/int/int32_t")Signed-off-by Michal Orzel <[email protected]>Reviewed-by Stefano Stabellini <[email protected]>Quoted 11 lines
So it turned out that I committed v1 from Stefano. I was meant to commit the
patch at all, but I think I started with a dirty staging :(. Sorry for that.I have reverted Stefano's commit for now so we can take the correct patch.
Now, from my understanding, Andrew suggested on Matrix that this solution may
actually be a good way to handleGUEST_HANLDEs(they were removed in v2). Maybe this can be folded in Stefano's patch?
Quoted 5 lines
Quoted 2 lines
v1 together with Michal's fix is correct. Also v2 alone is correct, or v2 with Michal's fix is also correct.
I am slightly confused, v2 + Michal's fix means that
XEN_GUEST_HANDLE(int)is removed and we introduceXEN_GUEST_INT(int32_t)with no user. So wouldn't this
You are right I apologize. I looked at Michal's patch too quickly and I thought it was just adding XEN_GUEST_INT(int32_t) without removing anything.
In that case, if you are OK with it, please ack and commit v2 only.
Quoted 49 lines · Stefano Stabellini
Quoted 48 lines · Julien Grall
Hi Stefano,
Quoted 44 lines · Stefano Stabellini
Quoted 25 lines · Julien Grall
Hi Michal,
Quoted 22 lines · Michal Orzel
Commit
afab29d0882f("public: s/int/int32_t") replaced int withint32_tinXEN_GUEST_HANDLE()inmemory.hbut there is no guest handle defined for it. This results in a build failure. Example on Arm:
./include/public/arch-arm.h:205:41: error: unknown type name ‘__guest_handle_64_int32_t’205 | #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name | ^~~~~~~~~~~~~~~~~~
./include/public/arch-arm.h:206:41: note: in expansion of macro ‘__XEN_GUEST_HANDLE’
206 | #defineXEN_GUEST_HANDLE(name)__XEN_GUEST_HANDLE(name)| ^~~~~~~~~~~~~~~~~~ ./include/public/memory.h:277:5: note: in expansion of macro ‘XEN_GUEST_HANDLE’ 277 | XEN_GUEST_HANDLE(int32_t) errs;Fix it. Also, drop guest handle definition for int given no further use.
Fixes afab29d0882f ("public: s/int/int32_t")Signed-off-by Michal Orzel <[email protected]>Reviewed-by Stefano Stabellini <[email protected]>Quoted 11 lines
So it turned out that I committed v1 from Stefano. I was meant to commit the
patch at all, but I think I started with a dirty staging :(. Sorry for that.I have reverted Stefano's commit for now so we can take the correct patch.
Now, from my understanding, Andrew suggested on Matrix that this solution may
actually be a good way to handleGUEST_HANLDEs(they were removed in v2). Maybe this can be folded in Stefano's patch?v1 together with Michal's fix is correct. Also v2 alone is correct, or v2 with Michal's fix is also correct.
Quoted 8 lines
Quoted 2 lines
I am slightly confused, v2 + Michal's fix means that
XEN_GUEST_HANDLE(int)is removed and we introduceXEN_GUEST_INT(int32_t)with no user. So wouldn't thisYou are right I apologize. I looked at Michal's patch too quickly and I thought it was just adding
XEN_GUEST_INT(int32_t)without removing anything.In that case, if you are OK with it, please ack and commit v2 only.
Just to mention it: Committing would apparently be premature, as I can't spot any response to comments I gave to the patch. I'm okay with those being addressed verbally only, but imo they cannot be dropped on the floor.
Jan
Quoted 57 lines · Jan Beulich
Quoted 56 lines · Stefano Stabellini
Quoted 45 lines · Julien Grall
Hi Stefano,
Quoted 42 lines · Stefano Stabellini
Quoted 25 lines · Julien Grall
Hi Michal,
Quoted 22 lines · Michal Orzel
Commit
afab29d0882f("public: s/int/int32_t") replaced int withint32_tinXEN_GUEST_HANDLE()inmemory.hbut there is no guest handle defined for it. This results in a build failure. Example on Arm:
./include/public/arch-arm.h:205:41: error: unknown type name ‘__guest_handle_64_int32_t’205 | #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name | ^~~~~~~~~~~~~~~~~~
./include/public/arch-arm.h:206:41: note: in expansion of macro ‘__XEN_GUEST_HANDLE’
206 | #defineXEN_GUEST_HANDLE(name)__XEN_GUEST_HANDLE(name)| ^~~~~~~~~~~~~~~~~~ ./include/public/memory.h:277:5: note: in expansion of macro ‘XEN_GUEST_HANDLE’ 277 | XEN_GUEST_HANDLE(int32_t) errs;Fix it. Also, drop guest handle definition for int given no further use.
Fixes afab29d0882f ("public: s/int/int32_t")Signed-off-by Michal Orzel <[email protected]>Reviewed-by Stefano Stabellini <[email protected]>Quoted 11 lines
So it turned out that I committed v1 from Stefano. I was meant to commit the
patch at all, but I think I started with a dirty staging :(. Sorry for that.I have reverted Stefano's commit for now so we can take the correct patch.
Now, from my understanding, Andrew suggested on Matrix that this solution may
actually be a good way to handleGUEST_HANLDEs(they were removed in v2). Maybe this can be folded in Stefano's patch?Quoted 5 lines
Quoted 2 lines
v1 together with Michal's fix is correct. Also v2 alone is correct, or v2 with Michal's fix is also correct.
I am slightly confused, v2 + Michal's fix means that
XEN_GUEST_HANDLE(int)is removed and we introduceXEN_GUEST_INT(int32_t)with no user. So wouldn't thisYou are right I apologize. I looked at Michal's patch too quickly and I thought it was just adding
XEN_GUEST_INT(int32_t)without removing anything.
Quoted 5 lines
Quoted 1 line
In that case, if you are OK with it, please ack and commit v2 only.
Just to mention it: Committing would apparently be premature, as I can't spot any response to comments I gave to the patch. I'm okay with those being addressed verbally only, but imo they cannot be dropped on the floor.
I agree with your comments but I prefer to keep this patch smaller and focused on doing one thing only. I don't want to mix non-mechanical changes with the mechanical substitutions. For sure, there will be follow ups to address your comments and other outstanding issues.
Quoted 10 lines · Michal Orzel
Commit
afab29d0882f("public: s/int/int32_t") replaced int withint32_tinXEN_GUEST_HANDLE()inmemory.hbut there is no guest handle defined for it. This results in a build failure. Example on Arm:
./include/public/arch-arm.h:205:41: error: unknown type name ‘__guest_handle_64_int32_t’205 | #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name | ^~~~~~~~~~~~~~~~~~ ./include/public/arch-arm.h:206:41: note: in expansion of macro ‘__XEN_GUEST_HANDLE’ 206 | #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) | ^~~~~~~~~~~~~~~~~~
Quoted 4 lines
./include/public/memory.h:277:5: note: in expansion of macro ‘XEN_GUEST_HANDLE’
277 |XEN_GUEST_HANDLE(int32_t)errs;Fix it. Also, drop guest handle definition for int given no further use.
Such cannot be done like this. Consumers of the header may have grown their own uses. The declaration needs to remain active for any consumers supplying __XEN_INTERFACE_VERSION__ < 0x00041900. Which means you need to bump __XEN_LATEST_INTERFACE_VERSION__ and wrap the handle type declaration in #ifdef. Provided the removal of that handle type for newer interface versions is really warranting all this effort.
Jan
Hi Jan,
Quoted 16 lines · Jan Beulich
Quoted 13 lines · Michal Orzel
Commit
afab29d0882f("public: s/int/int32_t") replaced int withint32_tinXEN_GUEST_HANDLE()inmemory.hbut there is no guest handle defined for it. This results in a build failure. Example on Arm:
./include/public/arch-arm.h:205:41: error: unknown type name ‘__guest_handle_64_int32_t’205 | #define __XEN_GUEST_HANDLE(name) __guest_handle_64_ ## name | ^~~~~~~~~~~~~~~~~~ ./include/public/arch-arm.h:206:41: note: in expansion of macro ‘__XEN_GUEST_HANDLE’ 206 | #define XEN_GUEST_HANDLE(name) __XEN_GUEST_HANDLE(name) | ^~~~~~~~~~~~~~~~~~
./include/public/memory.h:277:5: note: in expansion of macro ‘XEN_GUEST_HANDLE’
277 |XEN_GUEST_HANDLE(int32_t)errs;
Quoted 8 lines
Quoted 1 line
Fix it. Also, drop guest handle definition for int given no further use.
Such cannot be done like this. Consumers of the header may have grown their own uses. The declaration needs to remain active for any consumers supplying
__XEN_INTERFACE_VERSION__<0x00041900. Which means you need to bump__XEN_LATEST_INTERFACE_VERSION__and wrap the handle type declaration in #ifdef. Provided the removal of that handle type for newer interface versions is really warranting all this effort.
I think we could just leave this guest handle definition as is then.
~Michal