From: Ian Jackson <ian.jackson@eu.citrix.com>
To: <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
Julien Grall <julien.grall@arm.com>,
Christian Lindig <christian.lindig@citrix.com>,
Jan Beulich <jbeulich@suse.com>, David Scott <dave@recoil.org>
Subject: [Xen-devel] [PATCH v3 12/12] tools/ocaml: abi: Use formal conversion and check in more places
Date: Tue, 10 Sep 2019 13:02:07 +0100 [thread overview]
Message-ID: <20190910120207.10358-13-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <20190910120207.10358-1-ian.jackson@eu.citrix.com>
From: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
tools/ocaml/libs/xc/xenctrl_stubs.c | 15 +++++++++------
xen/include/public/domctl.h | 4 ++++
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index c74c2b43a0..f86ecc7b7e 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -195,8 +195,10 @@ CAMLprim value stub_xc_domain_create(value xch, value config)
domain_handle_of_uuid_string(cfg.handle, String_val(VAL_HANDLE));
- for ( l = VAL_FLAGS; l != Val_none; l = Field(l, 1) )
- cfg.flags |= 1u << Int_val(Field(l, 0));
+ cfg.flags = ocaml_list_to_c_bitmap
+ /* ! domain_create_flag CDF_ lc */
+ /* ! XEN_DOMCTL_CDF_ XEN_DOMCTL_CDF_MAX max */
+ (VAL_FLAGS);
arch_domconfig = Field(VAL_ARCH, 0);
switch ( Tag_val(VAL_ARCH) )
@@ -211,8 +213,10 @@ CAMLprim value stub_xc_domain_create(value xch, value config)
/* Mnemonics for the named fields inside xen_x86_arch_domainconfig */
#define VAL_EMUL_FLAGS Field(arch_domconfig, 0)
- for ( l = VAL_EMUL_FLAGS; l != Val_none; l = Field(l, 1) )
- cfg.arch.emulation_flags |= 1u << Int_val(Field(l, 0));
+ cfg.arch.emulation_flags = ocaml_list_to_c_bitmap
+ /* ! x86_arch_emulation_flags X86_EMU_ none */
+ /* ! XEN_X86_EMU_ XEN_X86_EMU_ALL all */
+ (VAL_EMUL_FLAGS);
#undef VAL_EMUL_FLAGS
@@ -368,8 +372,7 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
* emulation_flags: x86_arch_emulation_flags list;
*/
emul_list = c_bitmap_to_ocaml_list
- /* ! x86_arch_emulation_flags X86_EMU_ none */
- /* ! XEN_X86_EMU_ XEN_X86_EMU_ALL all */
+ /* ! x86_arch_emulation_flags */
(info->arch_config.emulation_flags);
/* xen_x86_arch_domainconfig */
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index ff9265f765..77f546cbb8 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -64,6 +64,10 @@ struct xen_domctl_createdomain {
/* Is this a xenstore domain? */
#define _XEN_DOMCTL_CDF_xs_domain 4
#define XEN_DOMCTL_CDF_xs_domain (1U<<_XEN_DOMCTL_CDF_xs_domain)
+
+/* Max XEN_DOMCTL_CDF_* constant. Used for ABI checking. */
+#define XEN_DOMCTL_CDF_MAX XEN_DOMCTL_CDF_xs_domain
+
uint32_t flags;
/*
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2019-09-10 12:06 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
2019-09-10 12:01 ` [Xen-devel] [PATCH v3 01/12] tools/ocaml: Add missing X86_EMU_VPCI Ian Jackson
2019-09-10 12:01 ` [Xen-devel] [PATCH v3 02/12] tools/ocaml: Add missing CAP_PV Ian Jackson
2019-09-10 12:01 ` [Xen-devel] [PATCH v3 03/12] tools/ocaml: Introduce xenctrl ABI build-time checks Ian Jackson
2019-09-10 12:17 ` Jan Beulich
2019-09-10 12:18 ` Andrew Cooper
2019-09-10 12:01 ` [Xen-devel] [PATCH v3 04/12] xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm Ian Jackson
2019-09-10 12:20 ` Andrew Cooper
2019-09-10 12:41 ` Ian Jackson
2019-09-10 13:44 ` Julien Grall
2019-09-10 13:32 ` Jan Beulich
2019-09-10 12:02 ` [Xen-devel] [PATCH v3 05/12] tools/ocaml: abi-check: Add comments Ian Jackson
2019-09-10 12:02 ` [Xen-devel] [PATCH v3 06/12] tools/ocaml: abi handling: Provide ocaml->C conversion/check Ian Jackson
2019-09-10 12:22 ` Andrew Cooper
2019-09-10 12:50 ` Ian Jackson
2019-09-10 12:02 ` [Xen-devel] [PATCH v3 07/12] tools/ocaml: abi-check: Improve output and error messages Ian Jackson
2019-09-10 12:02 ` [Xen-devel] [PATCH v3 08/12] tools/ocaml: abi-check: Cope with multiple conversions of same type Ian Jackson
2019-09-10 12:02 ` [Xen-devel] [PATCH v3 09/12] tools/ocaml: Reformat domain_create_flag Ian Jackson
2019-09-10 12:02 ` [Xen-devel] [PATCH v3 10/12] tools/ocaml: abi-check: Check properly Ian Jackson
2019-09-10 12:02 ` [Xen-devel] [PATCH v3 11/12] tools/ocaml: tools/ocaml: Add missing CDF_* values Ian Jackson
2019-09-10 12:02 ` Ian Jackson [this message]
2019-09-10 12:18 ` [Xen-devel] [PATCH v3 12/12] tools/ocaml: abi: Use formal conversion and check in more places Jan Beulich
2019-09-10 13:24 ` [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
2019-09-10 13:27 ` Christian Lindig
2019-09-10 13:45 ` Ian Jackson
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=20190910120207.10358-13-ian.jackson@eu.citrix.com \
--to=ian.jackson@eu.citrix.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=christian.lindig@citrix.com \
--cc=dave@recoil.org \
--cc=jbeulich@suse.com \
--cc=julien.grall@arm.com \
--cc=konrad.wilk@oracle.com \
--cc=sstabellini@kernel.org \
--cc=tim@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 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).