xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [Xen-devel] [PATCH v3 00/12] ocaml abi fixes
@ 2019-09-10 12:01 Ian Jackson
  2019-09-10 12:01 ` [Xen-devel] [PATCH v3 01/12] tools/ocaml: Add missing X86_EMU_VPCI Ian Jackson
                   ` (12 more replies)
  0 siblings, 13 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Tim Deegan, Ian Jackson,
	Marek Marczykowski-Górecki, Julien Grall, Andrew Cooper,
	Christian Lindig, Jan Beulich, David Scott, Anthony PERARD,
	Volodymyr Babchuk, Roger Pau Monné

This now has further updates and improvements.  Patches 1-3 are as
before.  Patches 4-12 are new.  Thanks to Andy for his work (in
particular, some debugging and commentary for my script) which I have
incorporated here.

This is available as a git branch here
  https://xenbits.xen.org/gitweb/?p=people/iwj/xen.git;a=summary
  -b wip.ocaml.v3

Andrew Cooper (5):
  tools/ocaml: Add missing CAP_PV
  xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm
  tools/ocaml: abi handling: Provide ocaml->C conversion/check
  tools/ocaml: Reformat domain_create_flag
  tools/ocaml: abi: Use formal conversion and check in more places

Ian Jackson (7):
  tools/ocaml: Add missing X86_EMU_VPCI
  tools/ocaml: Introduce xenctrl ABI build-time checks
  tools/ocaml: abi-check: Add comments
  tools/ocaml: abi-check: Improve output and error messages
  tools/ocaml: abi-check: Cope with multiple conversions of same type
  tools/ocaml: abi-check: Check properly.
  tools/ocaml: tools/ocaml: Add missing CDF_* values

 .gitignore                          |   1 +
 tools/libxl/libxl_create.c          |   2 +-
 tools/ocaml/libs/xc/Makefile        |   5 ++
 tools/ocaml/libs/xc/abi-check       | 114 ++++++++++++++++++++++++++++++++++++
 tools/ocaml/libs/xc/xenctrl.ml      |   9 ++-
 tools/ocaml/libs/xc/xenctrl.mli     |  13 +++-
 tools/ocaml/libs/xc/xenctrl_stubs.c |  95 ++++++++++++++++++++++--------
 tools/python/xen/lowlevel/xc/xc.c   |   2 +-
 xen/arch/arm/domain.c               |   2 +-
 xen/arch/arm/domain_build.c         |   2 +-
 xen/arch/arm/setup.c                |   2 +-
 xen/arch/x86/domain.c               |   4 +-
 xen/arch/x86/setup.c                |   2 +-
 xen/common/domain.c                 |   4 +-
 xen/include/public/domctl.h         |   8 ++-
 xen/include/public/sysctl.h         |   4 ++
 xen/include/xen/sched.h             |   4 +-
 17 files changed, 232 insertions(+), 41 deletions(-)
 create mode 100755 tools/ocaml/libs/xc/abi-check

-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 01/12] tools/ocaml: Add missing X86_EMU_VPCI
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
@ 2019-09-10 12:01 ` Ian Jackson
  2019-09-10 12:01 ` [Xen-devel] [PATCH v3 02/12] tools/ocaml: Add missing CAP_PV Ian Jackson
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Ian Jackson, Christian Lindig, Wei Liu, David Scott

This was missing from x86_arch_emulation_flags.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/libs/xc/xenctrl.ml  | 1 +
 tools/ocaml/libs/xc/xenctrl.mli | 1 +
 2 files changed, 2 insertions(+)

diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 35958b94d5..305625cb6c 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -46,6 +46,7 @@ type x86_arch_emulation_flags =
 	| X86_EMU_IOMMU
 	| X86_EMU_PIT
 	| X86_EMU_USE_PIRQ
+	| X86_EMU_VPCI
 
 type xen_x86_arch_domainconfig =
 {
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index 6c4268d453..da93160ed3 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -40,6 +40,7 @@ type x86_arch_emulation_flags =
   | X86_EMU_IOMMU
   | X86_EMU_PIT
   | X86_EMU_USE_PIRQ
+  | X86_EMU_VPCI
 
 type xen_x86_arch_domainconfig = {
   emulation_flags: x86_arch_emulation_flags list;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 02/12] tools/ocaml: Add missing CAP_PV
  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 ` Ian Jackson
  2019-09-10 12:01 ` [Xen-devel] [PATCH v3 03/12] tools/ocaml: Introduce xenctrl ABI build-time checks Ian Jackson
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Ian Jackson, Christian Lindig, Wei Liu, David Scott

From: Andrew Cooper <andrew.cooper3@citrix.com>

c/s f089fddd941 broke the Ocaml ABI by renumering XEN_SYSCTL_PHYSCAP_directio
without adjusting the Ocaml physinfo_cap_flag enumeration.  Fix this by
inserting CAP_PV between CAP_HVM and CAP_DirectIO.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/libs/xc/xenctrl.ml  | 1 +
 tools/ocaml/libs/xc/xenctrl.mli | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 305625cb6c..097f39d5ce 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -100,6 +100,7 @@ type sched_control =
 
 type physinfo_cap_flag =
 	| CAP_HVM
+	| CAP_PV
 	| CAP_DirectIO
 
 type physinfo =
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index da93160ed3..957c9fdc2e 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -83,7 +83,10 @@ type domaininfo = {
   arch_config : arch_domainconfig;
 }
 type sched_control = { weight : int; cap : int; }
-type physinfo_cap_flag = CAP_HVM | CAP_DirectIO
+type physinfo_cap_flag =
+  | CAP_HVM
+  | CAP_PV
+  | CAP_DirectIO
 type physinfo = {
   threads_per_core : int;
   cores_per_socket : int;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 03/12] tools/ocaml: Introduce xenctrl ABI build-time checks
  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 ` Ian Jackson
  2019-09-10 12:17   ` Jan Beulich
  2019-09-10 12:01 ` [Xen-devel] [PATCH v3 04/12] xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm Ian Jackson
                   ` (9 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Tim Deegan, Ian Jackson, Julien Grall,
	Andrew Cooper, Christian Lindig, Jan Beulich, David Scott

c/s f089fddd941 broke the Ocaml ABI by renumering
XEN_SYSCTL_PHYSCAP_directio without adjusting the Ocaml
physinfo_cap_flag enumeration.

Add build machinery which will check the ABI correspondence.

This will result in a compile time failure whenever constants get
renumbered/added without a compatible adjustment to the Ocaml ABI.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
---
 .gitignore                          |  1 +
 tools/ocaml/libs/xc/Makefile        |  5 +++
 tools/ocaml/libs/xc/abi-check       | 84 +++++++++++++++++++++++++++++++++++++
 tools/ocaml/libs/xc/xenctrl_stubs.c | 69 +++++++++++++++++++++---------
 xen/include/public/sysctl.h         |  4 ++
 5 files changed, 143 insertions(+), 20 deletions(-)
 create mode 100755 tools/ocaml/libs/xc/abi-check

diff --git a/.gitignore b/.gitignore
index 3c947ac948..3ada0c4f0b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -392,6 +392,7 @@ tools/ocaml/libs/xentoollog/_xtl_levels.*
 tools/ocaml/libs/xentoollog/xentoollog.ml
 tools/ocaml/libs/xentoollog/xentoollog.mli
 tools/ocaml/libs/xs/paths.ml
+tools/ocaml/libs/xc/xenctrl_abi_check.h
 tools/ocaml/xenstored/_paths.h
 tools/ocaml/xenstored/oxenstored
 tools/ocaml/xenstored/oxenstored.conf
diff --git a/tools/ocaml/libs/xc/Makefile b/tools/ocaml/libs/xc/Makefile
index d24b0144d0..ac780627d2 100644
--- a/tools/ocaml/libs/xc/Makefile
+++ b/tools/ocaml/libs/xc/Makefile
@@ -31,4 +31,9 @@ install: $(LIBS) META
 uninstall:
 	$(OCAMLFIND) remove -destdir $(OCAMLDESTDIR) xenctrl
 
+xenctrl_stubs.o: xenctrl_abi_check.h
+
+xenctrl_abi_check.h: abi-check xenctrl_stubs.c xenctrl.ml
+	$(PERL) -w $^ >$@.tmp && mv -f $@.tmp $@
+
 include $(TOPLEVEL)/Makefile.rules
diff --git a/tools/ocaml/libs/xc/abi-check b/tools/ocaml/libs/xc/abi-check
new file mode 100755
index 0000000000..c987cd8454
--- /dev/null
+++ b/tools/ocaml/libs/xc/abi-check
@@ -0,0 +1,84 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Data::Dumper;
+
+our %enums;
+
+@ARGV == 2 or die;
+our ($c, $o) = @ARGV;
+
+open STDIN, "<", $c or die $!;
+
+our $cline = -1;
+our $ei;
+
+while (<>) {
+    if ($cline == -1) {
+        if (m/c_bitmap_to_ocaml_list/) {
+            $cline = 0;
+            $ei = { };
+        }
+    } else {
+        $cline++;
+        m{^\s+/\* \s+ ! \s+ (.*?) \s* \*/\s*$}x or die "$cline $_ ?";
+        my @vals = split /\s+/, $1;
+        if ($cline == 1 && !@vals) {
+            $cline = -1;
+        } elsif ($cline == 1 && @vals == 3) {
+            $ei->{$_} = shift @vals foreach qw(OType OPrefix Mangle);
+        } elsif ($cline == 2 && @vals == 3) {
+            $ei->{$_} = shift @vals foreach qw(CPrefix CFinal CFinalHow);
+            die if $enums{ $ei->{OType} };
+            $enums{ $ei->{OType} } = $ei;
+            $cline = -1;
+        } else {
+            die "$_ ?";
+        }
+    }
+}
+
+sub expect ($$) {
+    printf "BUILD_BUG_ON( %-30s != %-10s );\n", @_ or die $!;
+}
+
+open STDIN, "<", $o or die $!;
+my $cval;
+$ei = undef;
+my $bitnum = 0;
+while (<>) {
+    if (!$ei) {
+        if (m{^type \s+ (\w+) \s* \= \s* $/}x && $enums{$1}) {
+            $ei = $enums{$1};
+            $cval = '';
+            $bitnum = 0;
+        }
+    } else {
+        if (m{^\s+ \| \s* $ei->{OPrefix} (\w+) \s*$}x) {
+            $cval = $1;
+            if ($ei->{Mangle} eq 'lc') {
+                $cval = lc $cval;
+            } elsif ($ei->{Mangle} eq 'none') {
+            } else {
+                die;
+            }
+            $cval = $ei->{CPrefix}.$cval;
+            expect($cval, "(1u << $bitnum)");
+            $bitnum++;
+        } elsif (m/^\w|\{/) {
+            if ($ei->{CFinalHow} eq 'max') {
+                expect($ei->{CFinal}, "(1u << ".($bitnum-1).")");
+            } elsif ($ei->{CFinalHow} eq 'all') {
+                expect($ei->{CFinal}, "(1u << $bitnum)-1u");
+            } else {
+                die Dumper($ei)." ?";
+            }
+            $ei = undef;
+        } elsif (!m{\S}) {
+        } else {
+            die "$_ ?";
+        }
+    }
+}
+
+close STDOUT or die $!;
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 2e1b29ce33..352a6bd2d6 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -32,6 +32,7 @@
 
 #define XC_WANT_COMPAT_MAP_FOREIGN_API
 #include <xenctrl.h>
+#include <xen-tools/libs.h>
 
 #include "mmap_stubs.h"
 
@@ -119,6 +120,39 @@ static void domain_handle_of_uuid_string(xen_domain_handle_t h,
 #undef X
 }
 
+/*
+ * Various fields which are a bitmap in the C ABI are converted to lists of
+ * integers in the Ocaml ABI for more idiomatic handling.
+ */
+static value c_bitmap_to_ocaml_list
+             /* ! */
+             /*
+	      * All calls to this function must be in a form suitable
+	      * for xenctrl_abi_check.  The parsing there is ad-hoc.
+	      */
+             (unsigned int bitmap)
+{
+	CAMLparam0();
+	CAMLlocal2(list, tmp);
+
+#include "xenctrl_abi_check.h"
+
+	list = tmp = Val_emptylist;
+
+	for ( unsigned int i = 0; bitmap; i++, bitmap >>= 1 )
+	{
+		if ( !(bitmap & 1) )
+			continue;
+
+		tmp = caml_alloc_small(2, Tag_cons);
+		Field(tmp, 0) = Val_int(i);
+		Field(tmp, 1) = list;
+		list = tmp;
+	}
+
+	CAMLreturn(list);
+}
+
 CAMLprim value stub_xc_domain_create(value xch, value config)
 {
 	CAMLparam2(xch, config);
@@ -315,16 +349,13 @@ static value alloc_domaininfo(xc_domaininfo_t * info)
 	Store_field(result, 15, tmp);
 
 #if defined(__i386__) || defined(__x86_64__)
-	/* emulation_flags: x86_arch_emulation_flags list; */
-	tmp = emul_list = Val_emptylist;
-	for (i = 0; i < 10; i++) {
-		if ((info->arch_config.emulation_flags >> i) & 1) {
-			tmp = caml_alloc_small(2, Tag_cons);
-			Field(tmp, 0) = Val_int(i);
-			Field(tmp, 1) = emul_list;
-			emul_list = tmp;
-		}
-	}
+	/*
+	 * 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 */
+		(info->arch_config.emulation_flags);
 
 	/* xen_x86_arch_domainconfig */
 	x86_arch_config = caml_alloc_tuple(1);
@@ -635,7 +666,7 @@ CAMLprim value stub_xc_send_debug_keys(value xch, value keys)
 CAMLprim value stub_xc_physinfo(value xch)
 {
 	CAMLparam1(xch);
-	CAMLlocal3(physinfo, cap_list, tmp);
+	CAMLlocal2(physinfo, cap_list);
 	xc_physinfo_t c_physinfo;
 	int r;
 
@@ -646,15 +677,13 @@ CAMLprim value stub_xc_physinfo(value xch)
 	if (r)
 		failwith_xc(_H(xch));
 
-	tmp = cap_list = Val_emptylist;
-	for (r = 0; r < 2; r++) {
-		if ((c_physinfo.capabilities >> r) & 1) {
-			tmp = caml_alloc_small(2, Tag_cons);
-			Field(tmp, 0) = Val_int(r);
-			Field(tmp, 1) = cap_list;
-			cap_list = tmp;
-		}
-	}
+	/*
+	 * capabilities: physinfo_cap_flag list;
+	 */
+	cap_list = c_bitmap_to_ocaml_list
+		/* ! physinfo_cap_flag CAP_ lc */
+		/* ! XEN_SYSCTL_PHYSCAP_ XEN_SYSCTL_PHYSCAP_MAX max */
+		(c_physinfo.capabilities);
 
 	physinfo = caml_alloc_tuple(10);
 	Store_field(physinfo, 0, Val_int(c_physinfo.threads_per_core));
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 36b3f8c429..5401f9c2fe 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -90,6 +90,10 @@ struct xen_sysctl_tbuf_op {
  /* The platform supports direct access to I/O devices with IOMMU. */
 #define _XEN_SYSCTL_PHYSCAP_directio     2
 #define XEN_SYSCTL_PHYSCAP_directio  (1u<<_XEN_SYSCTL_PHYSCAP_directio)
+
+/* Max XEN_SYSCTL_PHYSCAP_* constant.  Used for ABI checking. */
+#define XEN_SYSCTL_PHYSCAP_MAX XEN_SYSCTL_PHYSCAP_directio
+
 struct xen_sysctl_physinfo {
     uint32_t threads_per_core;
     uint32_t cores_per_socket;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 04/12] xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
                   ` (2 preceding siblings ...)
  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:01 ` Ian Jackson
  2019-09-10 12:20   ` Andrew Cooper
  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
                   ` (8 subsequent siblings)
  12 siblings, 2 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:01 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson,
	Marek Marczykowski-Górecki, Tim Deegan, Julien Grall,
	Jan Beulich, Anthony PERARD, Volodymyr Babchuk,
	Roger Pau Monné

From: Andrew Cooper <andrew.cooper3@citrix.com>

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
 tools/libxl/libxl_create.c        | 2 +-
 tools/python/xen/lowlevel/xc/xc.c | 2 +-
 xen/arch/arm/domain.c             | 2 +-
 xen/arch/arm/domain_build.c       | 2 +-
 xen/arch/arm/setup.c              | 2 +-
 xen/arch/x86/domain.c             | 4 ++--
 xen/arch/x86/setup.c              | 2 +-
 xen/common/domain.c               | 4 ++--
 xen/include/public/domctl.h       | 4 ++--
 xen/include/xen/sched.h           | 4 ++--
 10 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 03ce166f4f..79e010da72 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -557,7 +557,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config *d_config,
         };
 
         if (info->type != LIBXL_DOMAIN_TYPE_PV) {
-            create.flags |= XEN_DOMCTL_CDF_hvm_guest;
+            create.flags |= XEN_DOMCTL_CDF_hvm;
             create.flags |=
                 libxl_defbool_val(info->hap) ? XEN_DOMCTL_CDF_hap : 0;
             create.flags |=
diff --git a/tools/python/xen/lowlevel/xc/xc.c b/tools/python/xen/lowlevel/xc/xc.c
index 9d53c4cf37..26b9a0fb74 100644
--- a/tools/python/xen/lowlevel/xc/xc.c
+++ b/tools/python/xen/lowlevel/xc/xc.c
@@ -155,7 +155,7 @@ static PyObject *pyxc_domain_create(XcObject *self,
     }
 
 #if defined (__i386) || defined(__x86_64__)
-    if ( config.flags & XEN_DOMCTL_CDF_hvm_guest )
+    if ( config.flags & XEN_DOMCTL_CDF_hvm )
         config.arch.emulation_flags = (XEN_X86_EMU_ALL & ~XEN_X86_EMU_VPCI);
 #elif defined (__arm__) || defined(__aarch64__)
     config.arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE;
diff --git a/xen/arch/arm/domain.c b/xen/arch/arm/domain.c
index 941bbff4fe..a9c4113c26 100644
--- a/xen/arch/arm/domain.c
+++ b/xen/arch/arm/domain.c
@@ -608,7 +608,7 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
     unsigned int max_vcpus;
 
-    if ( config->flags != (XEN_DOMCTL_CDF_hvm_guest | XEN_DOMCTL_CDF_hap) )
+    if ( config->flags != (XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap) )
     {
         dprintk(XENLOG_INFO, "Unsupported configuration %#x\n", config->flags);
         return -EINVAL;
diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index e79d4e204f..a0fee1ef13 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -2070,7 +2070,7 @@ void __init create_domUs(void)
         struct xen_domctl_createdomain d_cfg = {
             .arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE,
             .arch.nr_spis = 0,
-            .flags = XEN_DOMCTL_CDF_hvm_guest | XEN_DOMCTL_CDF_hap,
+            .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
             .max_evtchn_port = -1,
             .max_grant_frames = 64,
             .max_maptrack_frames = 1024,
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index fa6c110b11..1b303bde34 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -797,7 +797,7 @@ void __init start_xen(unsigned long boot_phys_offset,
     struct bootmodule *xen_bootmodule;
     struct domain *dom0;
     struct xen_domctl_createdomain dom0_cfg = {
-        .flags = XEN_DOMCTL_CDF_hvm_guest | XEN_DOMCTL_CDF_hap,
+        .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
         .max_evtchn_port = -1,
         .max_grant_frames = gnttab_dom0_frames(),
         .max_maptrack_frames = opt_max_maptrack_frames,
diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index d538de8eae..4b0ad5e15d 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -442,7 +442,7 @@ void arch_vcpu_destroy(struct vcpu *v)
 
 int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
-    bool hvm = config->flags & XEN_DOMCTL_CDF_hvm_guest;
+    bool hvm = config->flags & XEN_DOMCTL_CDF_hvm;
     unsigned int max_vcpus;
 
     if ( hvm ? !hvm_enabled : !IS_ENABLED(CONFIG_PV) )
@@ -473,7 +473,7 @@ int arch_sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
-    if ( !(config->flags & XEN_DOMCTL_CDF_hvm_guest) )
+    if ( !(config->flags & XEN_DOMCTL_CDF_hvm) )
         /*
          * It is only meaningful for XEN_DOMCTL_CDF_oos_off to be clear
          * for HVM guests.
diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
index 5a88ef368f..27981adc0b 100644
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1723,7 +1723,7 @@ void __init noreturn __start_xen(unsigned long mbi_p)
 
     if ( opt_dom0_pvh )
     {
-        dom0_cfg.flags |= (XEN_DOMCTL_CDF_hvm_guest |
+        dom0_cfg.flags |= (XEN_DOMCTL_CDF_hvm |
                            ((hvm_hap_supported() && !opt_dom0_shadow) ?
                             XEN_DOMCTL_CDF_hap : 0));
 
diff --git a/xen/common/domain.c b/xen/common/domain.c
index e9d2c613e0..09917b2885 100644
--- a/xen/common/domain.c
+++ b/xen/common/domain.c
@@ -297,7 +297,7 @@ static void _domain_destroy(struct domain *d)
 
 static int sanitise_domain_config(struct xen_domctl_createdomain *config)
 {
-    if ( config->flags & ~(XEN_DOMCTL_CDF_hvm_guest |
+    if ( config->flags & ~(XEN_DOMCTL_CDF_hvm |
                            XEN_DOMCTL_CDF_hap |
                            XEN_DOMCTL_CDF_s3_integrity |
                            XEN_DOMCTL_CDF_oos_off |
@@ -313,7 +313,7 @@ static int sanitise_domain_config(struct xen_domctl_createdomain *config)
         return -EINVAL;
     }
 
-    if ( !(config->flags & XEN_DOMCTL_CDF_hvm_guest) &&
+    if ( !(config->flags & XEN_DOMCTL_CDF_hvm) &&
          (config->flags & XEN_DOMCTL_CDF_hap) )
     {
         dprintk(XENLOG_INFO, "HAP requested for non-HVM guest\n");
diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h
index 72d5133cba..ff9265f765 100644
--- a/xen/include/public/domctl.h
+++ b/xen/include/public/domctl.h
@@ -50,8 +50,8 @@ struct xen_domctl_createdomain {
     uint32_t ssidref;
     xen_domain_handle_t handle;
  /* Is this an HVM guest (as opposed to a PV guest)? */
-#define _XEN_DOMCTL_CDF_hvm_guest     0
-#define XEN_DOMCTL_CDF_hvm_guest      (1U<<_XEN_DOMCTL_CDF_hvm_guest)
+#define _XEN_DOMCTL_CDF_hvm           0
+#define XEN_DOMCTL_CDF_hvm            (1U<<_XEN_DOMCTL_CDF_hvm)
  /* Use hardware-assisted paging if available? */
 #define _XEN_DOMCTL_CDF_hap           1
 #define XEN_DOMCTL_CDF_hap            (1U<<_XEN_DOMCTL_CDF_hap)
diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
index d2bbe03bd9..e3601c1935 100644
--- a/xen/include/xen/sched.h
+++ b/xen/include/xen/sched.h
@@ -912,7 +912,7 @@ void watchdog_domain_destroy(struct domain *d);
 static inline bool is_pv_domain(const struct domain *d)
 {
     return IS_ENABLED(CONFIG_PV) &&
-        evaluate_nospec(!(d->options & XEN_DOMCTL_CDF_hvm_guest));
+        evaluate_nospec(!(d->options & XEN_DOMCTL_CDF_hvm));
 }
 
 static inline bool is_pv_vcpu(const struct vcpu *v)
@@ -944,7 +944,7 @@ static inline bool is_pv_64bit_vcpu(const struct vcpu *v)
 static inline bool is_hvm_domain(const struct domain *d)
 {
     return IS_ENABLED(CONFIG_HVM) &&
-        evaluate_nospec(d->options & XEN_DOMCTL_CDF_hvm_guest);
+        evaluate_nospec(d->options & XEN_DOMCTL_CDF_hvm);
 }
 
 static inline bool is_hvm_vcpu(const struct vcpu *v)
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 05/12] tools/ocaml: abi-check: Add comments
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
                   ` (3 preceding siblings ...)
  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:02 ` Ian Jackson
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 06/12] tools/ocaml: abi handling: Provide ocaml->C conversion/check Ian Jackson
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Ian Jackson, Christian Lindig, Wei Liu, David Scott

Provide interface documentation for this script.

Explain why we check .ml not .mli.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/libs/xc/abi-check | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/tools/ocaml/libs/xc/abi-check b/tools/ocaml/libs/xc/abi-check
index c987cd8454..ccc35e79e9 100755
--- a/tools/ocaml/libs/xc/abi-check
+++ b/tools/ocaml/libs/xc/abi-check
@@ -5,6 +5,13 @@ use Data::Dumper;
 
 our %enums;
 
+# Usage: abi-check C-file Ocaml-file
+# Writes out a BUILD_BUG_ON() list to be included back into C.
+#
+# Ocaml-file should be the .ml file.  The ocaml compiler will check
+# that any declarations in a .mli correspond.  We check the .ml
+# rather than the .mli in case there are private types in future.
+
 @ARGV == 2 or die;
 our ($c, $o) = @ARGV;
 
@@ -13,6 +20,14 @@ open STDIN, "<", $c or die $!;
 our $cline = -1;
 our $ei;
 
+# Parse the C file looking for calls to:
+#   c_bitmap_to_ocaml_list()
+#
+# followed by anotations of the following form:
+#   /* ! OType OPrefix Mangle */
+#   /* ! CPrefix CFinal CFinalHow */
+#
+# The function definitions use /* ! */ which simply skips that instance.
 while (<>) {
     if ($cline == -1) {
         if (m/c_bitmap_to_ocaml_list/) {
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 06/12] tools/ocaml: abi handling: Provide ocaml->C conversion/check
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
                   ` (4 preceding siblings ...)
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 05/12] tools/ocaml: abi-check: Add comments Ian Jackson
@ 2019-09-10 12:02 ` Ian Jackson
  2019-09-10 12:22   ` Andrew Cooper
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 07/12] tools/ocaml: abi-check: Improve output and error messages Ian Jackson
                   ` (6 subsequent siblings)
  12 siblings, 1 reply; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Ian Jackson, Christian Lindig, Wei Liu, David Scott

From: Andrew Cooper <andrew.cooper3@citrix.com>

No users of this yet so no overall change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/libs/xc/abi-check       |  3 ++-
 tools/ocaml/libs/xc/xenctrl_stubs.c | 15 +++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xc/abi-check b/tools/ocaml/libs/xc/abi-check
index ccc35e79e9..a470c05e0b 100755
--- a/tools/ocaml/libs/xc/abi-check
+++ b/tools/ocaml/libs/xc/abi-check
@@ -22,6 +22,7 @@ our $ei;
 
 # Parse the C file looking for calls to:
 #   c_bitmap_to_ocaml_list()
+#   ocaml_list_to_c_bitmap()
 #
 # followed by anotations of the following form:
 #   /* ! OType OPrefix Mangle */
@@ -30,7 +31,7 @@ our $ei;
 # The function definitions use /* ! */ which simply skips that instance.
 while (<>) {
     if ($cline == -1) {
-        if (m/c_bitmap_to_ocaml_list/) {
+        if (m/c_bitmap_to_ocaml_list|ocaml_list_to_c_bitmap/) {
             $cline = 0;
             $ei = { };
         }
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index 352a6bd2d6..c74c2b43a0 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -153,6 +153,21 @@ static value c_bitmap_to_ocaml_list
 	CAMLreturn(list);
 }
 
+static unsigned int ocaml_list_to_c_bitmap(value l)
+             /* ! */
+             /*
+	      * All calls to this function must be in a form suitable
+	      * for xenctrl_abi_check.  The parsing there is ad-hoc.
+	      */
+{
+	unsigned int val;
+
+	for ( ; l != Val_none; l = Field(l, 1) )
+		val |= 1u << Int_val(Field(l, 0));
+
+	return val;
+}
+
 CAMLprim value stub_xc_domain_create(value xch, value config)
 {
 	CAMLparam2(xch, config);
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 07/12] tools/ocaml: abi-check: Improve output and error messages
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
                   ` (5 preceding siblings ...)
  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:02 ` 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
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Ian Jackson, Christian Lindig, Wei Liu, David Scott

In the generated C, add some comments saying where we found the ocaml
type.  This helps with debugging.  (I considered emitting #line
directives but decided this would be more confusing than helpful.)

Improve two dies.

Use better-named filehandles (perl prints thier names when it dies).

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/libs/xc/abi-check | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tools/ocaml/libs/xc/abi-check b/tools/ocaml/libs/xc/abi-check
index a470c05e0b..9450676429 100755
--- a/tools/ocaml/libs/xc/abi-check
+++ b/tools/ocaml/libs/xc/abi-check
@@ -15,7 +15,7 @@ our %enums;
 @ARGV == 2 or die;
 our ($c, $o) = @ARGV;
 
-open STDIN, "<", $c or die $!;
+open C_FILE, "<", $c or die $!;
 
 our $cline = -1;
 our $ei;
@@ -29,7 +29,7 @@ our $ei;
 #   /* ! CPrefix CFinal CFinalHow */
 #
 # The function definitions use /* ! */ which simply skips that instance.
-while (<>) {
+while (<C_FILE>) {
     if ($cline == -1) {
         if (m/c_bitmap_to_ocaml_list|ocaml_list_to_c_bitmap/) {
             $cline = 0;
@@ -37,7 +37,8 @@ while (<>) {
         }
     } else {
         $cline++;
-        m{^\s+/\* \s+ ! \s+ (.*?) \s* \*/\s*$}x or die "$cline $_ ?";
+        m{^\s+/\* \s+ ! \s+ (.*?) \s* \*/\s*$}x or
+            die "at line $cline of annotation, did not expect $_ ?";
         my @vals = split /\s+/, $1;
         if ($cline == 1 && !@vals) {
             $cline = -1;
@@ -45,7 +46,7 @@ while (<>) {
             $ei->{$_} = shift @vals foreach qw(OType OPrefix Mangle);
         } elsif ($cline == 2 && @vals == 3) {
             $ei->{$_} = shift @vals foreach qw(CPrefix CFinal CFinalHow);
-            die if $enums{ $ei->{OType} };
+            die "redefining OType $ei->{OType}" if $enums{ $ei->{OType} };
             $enums{ $ei->{OType} } = $ei;
             $cline = -1;
         } else {
@@ -58,13 +59,14 @@ sub expect ($$) {
     printf "BUILD_BUG_ON( %-30s != %-10s );\n", @_ or die $!;
 }
 
-open STDIN, "<", $o or die $!;
+open OCAML_FILE, "<", $o or die $!;
 my $cval;
 $ei = undef;
 my $bitnum = 0;
-while (<>) {
+while (<OCAML_FILE>) {
     if (!$ei) {
         if (m{^type \s+ (\w+) \s* \= \s* $/}x && $enums{$1}) {
+            print "// found ocaml type $1 at $o:$.\n" or die $!;
             $ei = $enums{$1};
             $cval = '';
             $bitnum = 0;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 08/12] tools/ocaml: abi-check: Cope with multiple conversions of same type
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
                   ` (6 preceding siblings ...)
  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 ` Ian Jackson
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 09/12] tools/ocaml: Reformat domain_create_flag Ian Jackson
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Ian Jackson, Christian Lindig, Wei Liu, David Scott

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/libs/xc/abi-check | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/ocaml/libs/xc/abi-check b/tools/ocaml/libs/xc/abi-check
index 9450676429..abcd6ce6f1 100755
--- a/tools/ocaml/libs/xc/abi-check
+++ b/tools/ocaml/libs/xc/abi-check
@@ -27,6 +27,8 @@ our $ei;
 # followed by anotations of the following form:
 #   /* ! OType OPrefix Mangle */
 #   /* ! CPrefix CFinal CFinalHow */
+# or, for subsequent invocations for the same OType, just
+#   /* ! OType */
 #
 # The function definitions use /* ! */ which simply skips that instance.
 while (<C_FILE>) {
@@ -42,6 +44,9 @@ while (<C_FILE>) {
         my @vals = split /\s+/, $1;
         if ($cline == 1 && !@vals) {
             $cline = -1;
+        } elsif ($cline == 1 && @vals == 1) {
+            my ($otype) = @vals;
+            die "reference to undefined OType $otype" unless $enums{$otype};
         } elsif ($cline == 1 && @vals == 3) {
             $ei->{$_} = shift @vals foreach qw(OType OPrefix Mangle);
         } elsif ($cline == 2 && @vals == 3) {
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 09/12] tools/ocaml: Reformat domain_create_flag
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
                   ` (7 preceding siblings ...)
  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 ` Ian Jackson
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 10/12] tools/ocaml: abi-check: Check properly Ian Jackson
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Ian Jackson, Christian Lindig, Wei Liu, David Scott

From: Andrew Cooper <andrew.cooper3@citrix.com>

This will allow us to apply the abi checker soon.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/libs/xc/xenctrl.ml  | 4 +++-
 tools/ocaml/libs/xc/xenctrl.mli | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 097f39d5ce..17174debb8 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -57,7 +57,9 @@ type arch_domainconfig =
 	| ARM of xen_arm_arch_domainconfig
 	| X86 of xen_x86_arch_domainconfig
 
-type domain_create_flag = CDF_HVM | CDF_HAP
+type domain_create_flag =
+	| CDF_HVM
+	| CDF_HAP
 
 type domctl_create_config =
 {
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index 957c9fdc2e..228bc00a1c 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -50,7 +50,9 @@ type arch_domainconfig =
   | ARM of xen_arm_arch_domainconfig
   | X86 of xen_x86_arch_domainconfig
 
-type domain_create_flag = CDF_HVM | CDF_HAP
+type domain_create_flag =
+  | CDF_HVM
+  | CDF_HAP
 
 type domctl_create_config = {
   ssidref: int32;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 10/12] tools/ocaml: abi-check: Check properly.
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
                   ` (8 preceding siblings ...)
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 09/12] tools/ocaml: Reformat domain_create_flag Ian Jackson
@ 2019-09-10 12:02 ` Ian Jackson
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 11/12] tools/ocaml: tools/ocaml: Add missing CDF_* values Ian Jackson
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Ian Jackson, Christian Lindig, Wei Liu, David Scott

Fix a broken regexp which would mention `$/' when it ought to have
mentioned `$'.  The result would be that it would match lines like
    type some_ocaml_type = Thing | Other_Thing
but ignore everything but the type name, giving wrong answers.

Check that we check mentioned types.  Otherwise if we fail to spot
some suitable thing in the ocaml, we would just omit checking this
type !

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/libs/xc/abi-check | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tools/ocaml/libs/xc/abi-check b/tools/ocaml/libs/xc/abi-check
index abcd6ce6f1..d532f37271 100755
--- a/tools/ocaml/libs/xc/abi-check
+++ b/tools/ocaml/libs/xc/abi-check
@@ -47,6 +47,7 @@ while (<C_FILE>) {
         } elsif ($cline == 1 && @vals == 1) {
             my ($otype) = @vals;
             die "reference to undefined OType $otype" unless $enums{$otype};
+            $cline = -1;
         } elsif ($cline == 1 && @vals == 3) {
             $ei->{$_} = shift @vals foreach qw(OType OPrefix Mangle);
         } elsif ($cline == 2 && @vals == 3) {
@@ -70,7 +71,7 @@ $ei = undef;
 my $bitnum = 0;
 while (<OCAML_FILE>) {
     if (!$ei) {
-        if (m{^type \s+ (\w+) \s* \= \s* $/}x && $enums{$1}) {
+        if (m{^type \s+ (\w+) \s* \= \s* $}x && $enums{$1}) {
             print "// found ocaml type $1 at $o:$.\n" or die $!;
             $ei = $enums{$1};
             $cval = '';
@@ -96,6 +97,7 @@ while (<OCAML_FILE>) {
             } else {
                 die Dumper($ei)." ?";
             }
+            $ei->{Checked} = 1;
             $ei = undef;
         } elsif (!m{\S}) {
         } else {
@@ -104,4 +106,9 @@ while (<OCAML_FILE>) {
     }
 }
 
+foreach $ei (values %enums) {
+    next if $ei->{Checked};
+    die "did not find ocaml type definition for $ei->{OType} in $o";
+}
+
 close STDOUT or die $!;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 11/12] tools/ocaml: tools/ocaml: Add missing CDF_* values
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
                   ` (9 preceding siblings ...)
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 10/12] tools/ocaml: abi-check: Check properly Ian Jackson
@ 2019-09-10 12:02 ` Ian Jackson
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 12/12] tools/ocaml: abi: Use formal conversion and check in more places Ian Jackson
  2019-09-10 13:24 ` [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
  12 siblings, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Andrew Cooper, Ian Jackson, Christian Lindig, Wei Liu, David Scott

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 tools/ocaml/libs/xc/xenctrl.ml  | 3 +++
 tools/ocaml/libs/xc/xenctrl.mli | 3 +++
 2 files changed, 6 insertions(+)

diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 17174debb8..e544ef84da 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -60,6 +60,9 @@ type arch_domainconfig =
 type domain_create_flag =
 	| CDF_HVM
 	| CDF_HAP
+	| CDF_S3_INTEGRITY
+	| CDF_OOS_OFF
+	| CDF_XS_DOMAIN
 
 type domctl_create_config =
 {
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index 228bc00a1c..5a35000761 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -53,6 +53,9 @@ type arch_domainconfig =
 type domain_create_flag =
   | CDF_HVM
   | CDF_HAP
+  | CDF_S3_INTEGRITY
+  | CDF_OOS_OFF
+  | CDF_XS_DOMAIN
 
 type domctl_create_config = {
   ssidref: int32;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [Xen-devel] [PATCH v3 12/12] tools/ocaml: abi: Use formal conversion and check in more places
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
                   ` (10 preceding siblings ...)
  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
  2019-09-10 12:18   ` Jan Beulich
  2019-09-10 13:24 ` [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
  12 siblings, 1 reply; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:02 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Julien Grall, Christian Lindig, Jan Beulich, David Scott

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

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

* Re: [Xen-devel] [PATCH v3 03/12] tools/ocaml: Introduce xenctrl ABI build-time checks
  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
  0 siblings, 1 reply; 25+ messages in thread
From: Jan Beulich @ 2019-09-10 12:17 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Stefano Stabellini, WeiLiu, Konrad Rzeszutek Wilk, George Dunlap,
	Andrew Cooper, Tim Deegan, Julien Grall, Christian Lindig,
	DavidScott, xen-devel

On 10.09.2019 14:01, Ian Jackson wrote:
> c/s f089fddd941 broke the Ocaml ABI by renumering
> XEN_SYSCTL_PHYSCAP_directio without adjusting the Ocaml
> physinfo_cap_flag enumeration.
> 
> Add build machinery which will check the ABI correspondence.
> 
> This will result in a compile time failure whenever constants get
> renumbered/added without a compatible adjustment to the Ocaml ABI.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> Acked-by: Christian Lindig <christian.lindig@citrix.com>

Just in case you want an extra ack for the tiny sysctl.h addition:
Acked-by: Jan Beulich <jbeulich@suse.com>

> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -90,6 +90,10 @@ struct xen_sysctl_tbuf_op {
>   /* The platform supports direct access to I/O devices with IOMMU. */
>  #define _XEN_SYSCTL_PHYSCAP_directio     2
>  #define XEN_SYSCTL_PHYSCAP_directio  (1u<<_XEN_SYSCTL_PHYSCAP_directio)
> +
> +/* Max XEN_SYSCTL_PHYSCAP_* constant.  Used for ABI checking. */
> +#define XEN_SYSCTL_PHYSCAP_MAX XEN_SYSCTL_PHYSCAP_directio

I don't particularly like such "max" values put in (public) headers
(as they require constant updating), but I can't see a good
alternative either.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 03/12] tools/ocaml: Introduce xenctrl ABI build-time checks
  2019-09-10 12:17   ` Jan Beulich
@ 2019-09-10 12:18     ` Andrew Cooper
  0 siblings, 0 replies; 25+ messages in thread
From: Andrew Cooper @ 2019-09-10 12:18 UTC (permalink / raw)
  To: Jan Beulich, Ian Jackson
  Cc: Stefano Stabellini, WeiLiu, Konrad Rzeszutek Wilk, George Dunlap,
	Tim Deegan, Julien Grall, Christian Lindig, DavidScott,
	xen-devel

On 10/09/2019 13:17, Jan Beulich wrote:
> On 10.09.2019 14:01, Ian Jackson wrote:
>> c/s f089fddd941 broke the Ocaml ABI by renumering
>> XEN_SYSCTL_PHYSCAP_directio without adjusting the Ocaml
>> physinfo_cap_flag enumeration.
>>
>> Add build machinery which will check the ABI correspondence.
>>
>> This will result in a compile time failure whenever constants get
>> renumbered/added without a compatible adjustment to the Ocaml ABI.
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
>> Acked-by: Christian Lindig <christian.lindig@citrix.com>
> Just in case you want an extra ack for the tiny sysctl.h addition:
> Acked-by: Jan Beulich <jbeulich@suse.com>
>
>> --- a/xen/include/public/sysctl.h
>> +++ b/xen/include/public/sysctl.h
>> @@ -90,6 +90,10 @@ struct xen_sysctl_tbuf_op {
>>   /* The platform supports direct access to I/O devices with IOMMU. */
>>  #define _XEN_SYSCTL_PHYSCAP_directio     2
>>  #define XEN_SYSCTL_PHYSCAP_directio  (1u<<_XEN_SYSCTL_PHYSCAP_directio)
>> +
>> +/* Max XEN_SYSCTL_PHYSCAP_* constant.  Used for ABI checking. */
>> +#define XEN_SYSCTL_PHYSCAP_MAX XEN_SYSCTL_PHYSCAP_directio
> I don't particularly like such "max" values put in (public) headers
> (as they require constant updating), but I can't see a good
> alternative either.

This is the best I could come up with.  At least it is in a
tools-restricted header.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 12/12] tools/ocaml: abi: Use formal conversion and check in more places
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 12/12] tools/ocaml: abi: Use formal conversion and check in more places Ian Jackson
@ 2019-09-10 12:18   ` Jan Beulich
  0 siblings, 0 replies; 25+ messages in thread
From: Jan Beulich @ 2019-09-10 12:18 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Tim Deegan, Julien Grall,
	Christian Lindig, David Scott, xen-devel

On 10.09.2019 14:02, Ian Jackson wrote:
> 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>

Same as for the sysctl one - if you want it, here you are:
Acked-by: Jan Beulich <jbeulich@suse.com>

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 04/12] xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm
  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
  1 sibling, 2 replies; 25+ messages in thread
From: Andrew Cooper @ 2019-09-10 12:20 UTC (permalink / raw)
  To: Ian Jackson, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Tim Deegan, Marek Marczykowski-Górecki,
	Julien Grall, Jan Beulich, Anthony PERARD, Volodymyr Babchuk,
	Roger Pau Monné

On 10/09/2019 13:01, Ian Jackson wrote:
> From: Andrew Cooper <andrew.cooper3@citrix.com>
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

I should probably have finished writing my commit message before handing
the branch off.

"The suffix is redundant, and dropping it helps to simplify the Ocaml/C
ABI checking."

or something suitable.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 06/12] tools/ocaml: abi handling: Provide ocaml->C conversion/check
  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
  0 siblings, 1 reply; 25+ messages in thread
From: Andrew Cooper @ 2019-09-10 12:22 UTC (permalink / raw)
  To: Ian Jackson, xen-devel; +Cc: Christian Lindig, Wei Liu, David Scott

On 10/09/2019 13:02, Ian Jackson wrote:
> From: Andrew Cooper <andrew.cooper3@citrix.com>
>
> No users of this yet so no overall change.
>
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>

I'm afraid this doesn't bisect.  It needs to be in the same patch as one
of its callers.

~Andrew

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 04/12] xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm
  2019-09-10 12:20   ` Andrew Cooper
@ 2019-09-10 12:41     ` Ian Jackson
  2019-09-10 13:44     ` Julien Grall
  1 sibling, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:41 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk, Tim (Xen.org),
	George Dunlap, Marek Marczykowski-Górecki, Julien Grall,
	Jan Beulich, Anthony Perard, xen-devel, Volodymyr Babchuk,
	Roger Pau Monne

Andrew Cooper writes ("Re: [PATCH v3 04/12] xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm"):
> I should probably have finished writing my commit message before handing
> the branch off.

No problem.  If you had left an XXX in it I would have known to ask
you for the rest...

> "The suffix is redundant, and dropping it helps to simplify the Ocaml/C
> ABI checking."

I have c&p that into my branch, thanks.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 06/12] tools/ocaml: abi handling: Provide ocaml->C conversion/check
  2019-09-10 12:22   ` Andrew Cooper
@ 2019-09-10 12:50     ` Ian Jackson
  0 siblings, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 12:50 UTC (permalink / raw)
  To: Andrew Cooper; +Cc: xen-devel, Christian Lindig, Wei Liu, David Scott

Andrew Cooper writes ("Re: [PATCH v3 06/12] tools/ocaml: abi handling: Provide ocaml->C conversion/check"):
> On 10/09/2019 13:02, Ian Jackson wrote:
> > From: Andrew Cooper <andrew.cooper3@citrix.com>
> >
> > No users of this yet so no overall change.
> >
> > Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
> 
> I'm afraid this doesn't bisect.  It needs to be in the same patch as one
> of its callers.

Oops.  I will fix this with a temporary #if 0, since I don't like to
mix up the general with the specific.

While checking for bisectability I discovered my `make clean' target
was not working right.  I have added
   GENERATED_FILES += xenctrl_abi_check.h
to the Makefile patch.  I trust that it's OK to keep everyone's acks.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 00/12] ocaml abi fixes
  2019-09-10 12:01 [Xen-devel] [PATCH v3 00/12] ocaml abi fixes Ian Jackson
                   ` (11 preceding siblings ...)
  2019-09-10 12:02 ` [Xen-devel] [PATCH v3 12/12] tools/ocaml: abi: Use formal conversion and check in more places Ian Jackson
@ 2019-09-10 13:24 ` Ian Jackson
  2019-09-10 13:27   ` Christian Lindig
  2019-09-10 13:45   ` Ian Jackson
  12 siblings, 2 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 13:24 UTC (permalink / raw)
  To: Christian Lindig, David Scott, Jan Beulich, George Dunlap,
	Wei Liu, Julien Grall, Konrad Rzeszutek Wilk, Stefano Stabellini,
	Tim (Xen.org)
  Cc: Andrew Cooper, Marek Marczykowski-Górecki, Anthony Perard,
	xen-devel, Volodymyr Babchuk, Roger Pau Monne

Ian Jackson writes ("[PATCH v3 00/12] ocaml abi fixes"):
> This now has further updates and improvements.  Patches 1-3 are as
> before.  Patches 4-12 are new.  Thanks to Andy for his work (in
> particular, some debugging and commentary for my script) which I have
> incorporated here.

I have fixed a few minor issues as discussed in this thread, and
incorporated acks so far.

Andrew gave me his acked/reviewed-by on irc and I have added my own
R-B to the patches of his I incorporated (and, in some cases wrote
commit messages for).

The result is here:
  https://xenbits.xen.org/gitweb/?p=people/iwj/xen.git;a=summary
  -b wip.ocaml.v3.1
I can repost it if anyone thinks that would be useful.

Christian, are you happy with my other changes in tools/ocaml ?
I don't feel I need a formal ocaml ack for the changes to add the
missing entries to the enum types (since those are supposed to follow
the hypervisor ABI) but I think I need your ack for the further script
and xenctrl_stubs changes in v3 (or v3.1) of this series.

And I think there is one patch from Andy that could do with an ack
from a hypervisor maintainer (hence THE REST in my "To" field):
  xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm

Thanks,
Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 00/12] ocaml abi fixes
  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
  1 sibling, 0 replies; 25+ messages in thread
From: Christian Lindig @ 2019-09-10 13:27 UTC (permalink / raw)
  To: Ian Jackson, David Scott, Jan Beulich, George Dunlap, Wei Liu,
	Julien Grall, Konrad Rzeszutek Wilk, Stefano Stabellini,
	Tim (Xen.org)
  Cc: Andrew Cooper, Marek Marczykowski-Górecki, Anthony Perard,
	xen-devel, Volodymyr Babchuk, Roger Pau Monne



On 10/09/2019 14:24, Ian Jackson wrote:
> Christian, are you happy with my other changes in tools/ocaml ?
> I don't feel I need a formal ocaml ack for the changes to add the
> missing entries to the enum types (since those are supposed to follow
> the hypervisor ABI) but I think I need your ack for the further script
> and xenctrl_stubs changes in v3 (or v3.1) of this series.

Acked-by: Christian Lindig <christian.lindig@citrix.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 04/12] xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm
  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 13:32   ` Jan Beulich
  1 sibling, 0 replies; 25+ messages in thread
From: Jan Beulich @ 2019-09-10 13:32 UTC (permalink / raw)
  To: Ian Jackson
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Tim Deegan,
	Marek Marczykowski-Górecki, Julien Grall, Anthony PERARD,
	xen-devel, Volodymyr Babchuk, Roger Pau Monné

On 10.09.2019 14:01, Ian Jackson wrote:
> From: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 04/12] xen/domctl: Drop guest suffix from XEN_DOMCTL_CDF_hvm
  2019-09-10 12:20   ` Andrew Cooper
  2019-09-10 12:41     ` Ian Jackson
@ 2019-09-10 13:44     ` Julien Grall
  1 sibling, 0 replies; 25+ messages in thread
From: Julien Grall @ 2019-09-10 13:44 UTC (permalink / raw)
  To: Andrew Cooper, Ian Jackson, xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Tim Deegan, Marek Marczykowski-Górecki,
	Jan Beulich, Anthony PERARD, Volodymyr Babchuk,
	Roger Pau Monné

Hi,

On 9/10/19 1:20 PM, Andrew Cooper wrote:
> On 10/09/2019 13:01, Ian Jackson wrote:
>> From: Andrew Cooper <andrew.cooper3@citrix.com>
>>
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> I should probably have finished writing my commit message before handing
> the branch off.
> 
> "The suffix is redundant, and dropping it helps to simplify the Ocaml/C
> ABI checking."
> 
> or something suitable.

With the commit message updated:

Acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

-- 
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [Xen-devel] [PATCH v3 00/12] ocaml abi fixes
  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
  1 sibling, 0 replies; 25+ messages in thread
From: Ian Jackson @ 2019-09-10 13:45 UTC (permalink / raw)
  To: Christian Lindig, David Scott, Jan Beulich, George Dunlap,
	Wei Liu, Julien Grall, Konrad Rzeszutek Wilk, Stefano Stabellini,
	Tim (Xen.org),
	xen-devel, Anthony Perard, Marek Marczykowski-Górecki,
	Volodymyr Babchuk, Roger Pau Monne, Andrew Cooper

Ian Jackson writes ("Re: [PATCH v3 00/12] ocaml abi fixes"):
> The result is here:
>   https://xenbits.xen.org/gitweb/?p=people/iwj/xen.git;a=summary
>   -b wip.ocaml.v3.1
> I can repost it if anyone thinks that would be useful.

Thanks for the acks, all.  Now pushed.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2019-09-10 13:45 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [Xen-devel] [PATCH v3 12/12] tools/ocaml: abi: Use formal conversion and check in more places Ian Jackson
2019-09-10 12:18   ` 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

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