|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [xen staging] tools/ocaml: Add altp2m_count parameter
commit 5699554de9a934d986e9b2a400deda03dd883d98
Author: Petr Beneš <w1benny@xxxxxxxxx>
AuthorDate: Mon Aug 25 12:51:35 2025 +0200
Commit: Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Mon Aug 25 12:51:35 2025 +0200
tools/ocaml: Add altp2m_count parameter
Allow developers using the OCaml bindings to set the altp2m_count parameter.
Signed-off-by: Petr Beneš <w1benny@xxxxxxxxx>
Acked-by: Christian Lindig <christian.lindig@xxxxxxxxx>
---
tools/ocaml/libs/xc/xenctrl.ml | 1 +
tools/ocaml/libs/xc/xenctrl.mli | 1 +
tools/ocaml/libs/xc/xenctrl_stubs.c | 19 +++++++++++++++----
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 7e1aabad6c..97108b9d86 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -87,6 +87,7 @@ type domctl_create_config =
max_maptrack_frames: int;
max_grant_version: int;
altp2m_opts: int32;
+ altp2m_count: int32;
vmtrace_buf_kb: int32;
cpupool_id: int32;
arch: arch_domainconfig;
diff --git a/tools/ocaml/libs/xc/xenctrl.mli b/tools/ocaml/libs/xc/xenctrl.mli
index f44dba61ae..9fccb2c2c2 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -79,6 +79,7 @@ type domctl_create_config = {
max_maptrack_frames: int;
max_grant_version: int;
altp2m_opts: int32;
+ altp2m_count: int32;
vmtrace_buf_kb: int32;
cpupool_id: int32;
arch: arch_domainconfig;
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c
b/tools/ocaml/libs/xc/xenctrl_stubs.c
index b51fd66788..ac2a7537d6 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -205,13 +205,22 @@ CAMLprim value stub_xc_domain_create(value xch_val, value
wanted_domid, value co
#define VAL_MAX_MAPTRACK_FRAMES Field(config, 7)
#define VAL_MAX_GRANT_VERSION Field(config, 8)
#define VAL_ALTP2M_OPTS Field(config, 9)
-#define VAL_VMTRACE_BUF_KB Field(config, 10)
-#define VAL_CPUPOOL_ID Field(config, 11)
-#define VAL_ARCH Field(config, 12)
+#define VAL_ALTP2M_COUNT Field(config, 10)
+#define VAL_VMTRACE_BUF_KB Field(config, 11)
+#define VAL_CPUPOOL_ID Field(config, 12)
+#define VAL_ARCH Field(config, 13)
uint32_t domid = Int_val(wanted_domid);
+ uint32_t altp2m_opts = Int32_val(VAL_ALTP2M_OPTS);
+ uint32_t altp2m_nr = Int32_val(VAL_ALTP2M_COUNT);
uint64_t vmtrace_size = Int32_val(VAL_VMTRACE_BUF_KB);
+ if ( altp2m_opts != (uint16_t)altp2m_opts )
+ caml_invalid_argument("altp2m_opts");
+
+ if ( altp2m_nr != (uint16_t)altp2m_nr )
+ caml_invalid_argument("altp2m_count");
+
vmtrace_size = ROUNDUP(vmtrace_size << 10, XC_PAGE_SHIFT);
if ( vmtrace_size != (uint32_t)vmtrace_size )
caml_invalid_argument("vmtrace_buf_kb");
@@ -226,7 +235,8 @@ CAMLprim value stub_xc_domain_create(value xch_val, value
wanted_domid, value co
.grant_opts =
XEN_DOMCTL_GRANT_version(Int_val(VAL_MAX_GRANT_VERSION)),
.altp2m = {
- .opts = Int32_val(VAL_ALTP2M_OPTS),
+ .opts = altp2m_opts,
+ .nr = altp2m_nr,
},
.vmtrace_size = vmtrace_size,
.cpupool_id = Int32_val(VAL_CPUPOOL_ID),
@@ -286,6 +296,7 @@ CAMLprim value stub_xc_domain_create(value xch_val, value
wanted_domid, value co
#undef VAL_ARCH
#undef VAL_CPUPOOL_ID
#undef VAL_VMTRACE_BUF_KB
+#undef VAL_ALTP2M_COUNT
#undef VAL_ALTP2M_OPTS
#undef VAL_MAX_GRANT_VERSION
#undef VAL_MAX_MAPTRACK_FRAMES
--
generated by git-patchbot for /home/xen/git/xen.git#staging
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |