fixup sysctl/libxl: choose a sane default for HAP
diff mbox series

Message ID 20190909134701.12477-1-andrew.cooper3@citrix.com
State New
Headers show
Series
  • fixup sysctl/libxl: choose a sane default for HAP
Related show

Commit Message

Andrew Cooper Sept. 9, 2019, 1:47 p.m. UTC
This delta wants folding to keep the Ocaml stubs in line.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Ian Jackson <Ian.Jackson@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Christian Lindig <christian.lindig@citrix.com>
CC: Rob Hoes <Rob.Hoes@citrix.com>
---
 tools/ocaml/libs/xc/xenctrl.ml      | 1 +
 tools/ocaml/libs/xc/xenctrl.mli     | 1 +
 tools/ocaml/libs/xc/xenctrl_stubs.c | 3 ++-
 xen/include/public/sysctl.h         | 2 +-
 4 files changed, 5 insertions(+), 2 deletions(-)

Comments

Ian Jackson Sept. 9, 2019, 2:29 p.m. UTC | #1
Andrew Cooper writes ("[PATCH] fixup sysctl/libxl: choose a sane default for HAP"):
> This delta wants folding to keep the Ocaml stubs in line.

Gnagh.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich Sept. 10, 2019, 2:43 p.m. UTC | #2
On 09.09.2019 15:47, Andrew Cooper wrote:
> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
> @@ -690,7 +690,8 @@ CAMLprim value stub_xc_physinfo(value xch)
>  	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_hvm      != (1u <<  0));
>  	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_pv       != (1u <<  1));
>  	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_directio != (1u <<  2));
> -	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_MAX      != XEN_SYSCTL_PHYSCAP_directio);
> +	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_hap      != (1u <<  3));
> +	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_MAX      != XEN_SYSCTL_PHYSCAP_hap);
>  	cap_list = c_bitmap_to_ocaml_list(c_physinfo.capabilities);
>  
>  	physinfo = caml_alloc_tuple(10);

I'm afraid in particular this hunk doesn't apply anymore, and
I'm not confident that simply dropping it is the right answer.
I'd therefore like to ask for a proper re-base, or for someone
else to apply the result of folding these additions into the
base patch.

Jan
Andrew Cooper Sept. 10, 2019, 2:44 p.m. UTC | #3
On 10/09/2019 15:43, Jan Beulich wrote:
> On 09.09.2019 15:47, Andrew Cooper wrote:
>> --- a/tools/ocaml/libs/xc/xenctrl_stubs.c
>> +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
>> @@ -690,7 +690,8 @@ CAMLprim value stub_xc_physinfo(value xch)
>>  	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_hvm      != (1u <<  0));
>>  	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_pv       != (1u <<  1));
>>  	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_directio != (1u <<  2));
>> -	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_MAX      != XEN_SYSCTL_PHYSCAP_directio);
>> +	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_hap      != (1u <<  3));
>> +	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_MAX      != XEN_SYSCTL_PHYSCAP_hap);
>>  	cap_list = c_bitmap_to_ocaml_list(c_physinfo.capabilities);
>>  
>>  	physinfo = caml_alloc_tuple(10);
> I'm afraid in particular this hunk doesn't apply anymore, and
> I'm not confident that simply dropping it is the right answer.
> I'd therefore like to ask for a proper re-base, or for someone
> else to apply the result of folding these additions into the
> base patch.

Roger is currently working on a rebase.  There is also a logical error
which requires the addition of CAP_SHADOW.

~Andrew

Patch
diff mbox series

diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index cd7e95a6fa..5da7c96cee 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -101,6 +101,7 @@  type physinfo_cap_flag =
 	| CAP_HVM
 	| CAP_PV
 	| CAP_DirectIO
+	| CAP_HAP
 
 type physinfo =
 {
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index 0bd06ed920..b4e76b827e 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -86,6 +86,7 @@  type physinfo_cap_flag =
   | CAP_HVM
   | CAP_PV
   | CAP_DirectIO
+  | CAP_HAP
 type physinfo = {
   threads_per_core : int;
   cores_per_socket : int;
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c
index ce8dbba437..10b306f9f8 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -690,7 +690,8 @@  CAMLprim value stub_xc_physinfo(value xch)
 	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_hvm      != (1u <<  0));
 	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_pv       != (1u <<  1));
 	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_directio != (1u <<  2));
-	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_MAX      != XEN_SYSCTL_PHYSCAP_directio);
+	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_hap      != (1u <<  3));
+	BUILD_BUG_ON(XEN_SYSCTL_PHYSCAP_MAX      != XEN_SYSCTL_PHYSCAP_hap);
 	cap_list = c_bitmap_to_ocaml_list(c_physinfo.capabilities);
 
 	physinfo = caml_alloc_tuple(10);
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index c325ae496c..d4b455619c 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -95,7 +95,7 @@  struct xen_sysctl_tbuf_op {
 #define XEN_SYSCTL_PHYSCAP_hap           (1u<<_XEN_SYSCTL_PHYSCAP_hap)
 
 /* Max XEN_SYSCTL_PHYSCAP_* constant.  Used for ABI checking. */
-#define XEN_SYSCTL_PHYSCAP_MAX XEN_SYSCTL_PHYSCAP_directio
+#define XEN_SYSCTL_PHYSCAP_MAX XEN_SYSCTL_PHYSCAP_hap
 
 struct xen_sysctl_physinfo {
     uint32_t threads_per_core;