All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/6] xen/abi: On wide bitfields inside primitive types
@ 2024-10-29 18:16 Alejandro Vallejo
  2024-10-29 18:16 ` [RFC PATCH 1/6] xen/domctl: Refine grant_opts into grant_version Alejandro Vallejo
                   ` (8 more replies)
  0 siblings, 9 replies; 16+ messages in thread
From: Alejandro Vallejo @ 2024-10-29 18:16 UTC (permalink / raw)
  To: xen-devel
  Cc: Alejandro Vallejo, Andrew Cooper, Jan Beulich, Julien Grall,
	Stefano Stabellini, Juergen Gross, Anthony PERARD,
	Marek Marczykowski-Górecki, Christian Lindig, David Scott,
	Bertrand Marquis, Michal Orzel, Volodymyr Babchuk,
	Roger Pau Monné

Non-boolean bitfields in the hypercall ABI make it fairly inconvenient to
create bindings for any language because (a) they are always ad-hoc and are
subject to restrictions regular fields are not (b) require boilerplate that
regular fields do not and (c) might not even be part of the core language,
forcing avoidable external libraries into any sort of generic library.

This patch (it's a series merely to split roughly by maintainer) is one such
case that I happened to spot while playing around. It's the grant_version
field, buried under an otherwise empty grant_opts.

The invariant I'd like to (slowly) introduce and discuss is that fields may
have bitflags (e.g: a packed array of booleans indexed by some enumerated
type), but not be mixed with wider fields in the same primitive type. This
ensures any field containing an integer of any kind can be referred by pointer
and treated the same way as any other with regards to sizeof() and the like.

I'd like to have a certain consensus about this general point before going
establishing this restriction in the IDL system I'm working on.

My preference would be to fold everything into a single patch if we decide to
follow through with this particular case. As I said before, the split is
artificial for review.

Alejandro Vallejo (6):
  xen/domctl: Refine grant_opts into grant_version
  tools: Rename grant_opts to grant_version
  tools/ocaml: Rename grant_opts to grant_version
  xen/arm: Rename grant_opts to grant_version
  xen/x86: Rename grant_opts to grant_version
  xen/common: Rename grant_opts to grant_version

 tools/helpers/init-xenstore-domain.c             |  2 +-
 tools/libs/light/libxl_create.c                  |  2 +-
 tools/ocaml/libs/xc/xenctrl_stubs.c              |  3 +--
 tools/python/xen/lowlevel/xc/xc.c                |  2 +-
 tools/tests/paging-mempool/test-paging-mempool.c |  2 +-
 tools/tests/resource/test-resource.c             |  6 +++---
 tools/tests/tsx/test-tsx.c                       |  4 ++--
 xen/arch/arm/dom0less-build.c                    |  4 ++--
 xen/arch/arm/domain_build.c                      |  2 +-
 xen/arch/x86/setup.c                             |  2 +-
 xen/common/domain.c                              |  6 +++---
 xen/common/grant_table.c                         |  3 +--
 xen/include/public/domctl.h                      | 15 +++++++++++----
 xen/include/xen/grant_table.h                    |  4 ++--
 14 files changed, 31 insertions(+), 26 deletions(-)

-- 
2.47.0



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2024-10-31 13:55 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-29 18:16 [RFC PATCH 0/6] xen/abi: On wide bitfields inside primitive types Alejandro Vallejo
2024-10-29 18:16 ` [RFC PATCH 1/6] xen/domctl: Refine grant_opts into grant_version Alejandro Vallejo
2024-10-30  9:08   ` Jan Beulich
2024-10-30 13:58     ` Alejandro Vallejo
2024-10-29 18:16 ` [RFC PATCH 2/6] tools: Rename grant_opts to grant_version Alejandro Vallejo
2024-10-29 18:16 ` [RFC PATCH 3/6] tools/ocaml: " Alejandro Vallejo
2024-10-29 18:16 ` [RFC PATCH 4/6] xen/arm: " Alejandro Vallejo
2024-10-29 18:16 ` [RFC PATCH 5/6] xen/x86: " Alejandro Vallejo
2024-10-29 18:16 ` [RFC PATCH 6/6] xen/common: " Alejandro Vallejo
2024-10-29 18:29 ` [RFC PATCH 0/6] xen/abi: On wide bitfields inside primitive types Alejandro Vallejo
2024-10-30  8:45 ` Christian Lindig
2024-10-30 14:02   ` Alejandro Vallejo
2024-10-30  9:14 ` Jan Beulich
2024-10-30 15:08   ` Alejandro Vallejo
2024-10-31  7:57     ` Jan Beulich
2024-10-31 13:55       ` Alejandro Vallejo

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.