From: "Petr Beneš" <w1benny@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: "Petr Beneš" <w1benny@gmail.com>,
"Christian Lindig" <christian.lindig@citrix.com>,
"David Scott" <dave@recoil.org>,
"Anthony PERARD" <anthony@xenproject.org>,
"Christian Lindig" <christian.lindig@cloud.com>
Subject: [PATCH for-4.19? v3 6/6] tools/ocaml: Add altp2m_count parameter
Date: Thu, 16 May 2024 11:28:13 +0000 [thread overview]
Message-ID: <8537c5deeb409580868ec8d88171146dc7138662.1715858136.git.w1benny@gmail.com> (raw)
In-Reply-To: <cover.1715858136.git.w1benny@gmail.com>
From: Petr Beneš <w1benny@gmail.com>
Allow developers using the OCaml bindings to set the altp2m_count parameter.
Signed-off-by: Petr Beneš <w1benny@gmail.com>
Acked-by: Christian Lindig <christian.lindig@cloud.com>
---
tools/ocaml/libs/xc/xenctrl.ml | 1 +
tools/ocaml/libs/xc/xenctrl.mli | 1 +
tools/ocaml/libs/xc/xenctrl_stubs.c | 11 +++++++----
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/tools/ocaml/libs/xc/xenctrl.ml b/tools/ocaml/libs/xc/xenctrl.ml
index 55923857ec..dfb3d331c9 100644
--- a/tools/ocaml/libs/xc/xenctrl.ml
+++ b/tools/ocaml/libs/xc/xenctrl.ml
@@ -85,6 +85,7 @@ type domctl_create_config =
max_grant_frames: int;
max_maptrack_frames: int;
max_grant_version: int;
+ altp2m_count: int;
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 9b4b45db3a..ff0e309c56 100644
--- a/tools/ocaml/libs/xc/xenctrl.mli
+++ b/tools/ocaml/libs/xc/xenctrl.mli
@@ -77,6 +77,7 @@ type domctl_create_config = {
max_grant_frames: int;
max_maptrack_frames: int;
max_grant_version: int;
+ altp2m_count: int;
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 2b6d3c09df..1f544cd2e4 100644
--- a/tools/ocaml/libs/xc/xenctrl_stubs.c
+++ b/tools/ocaml/libs/xc/xenctrl_stubs.c
@@ -210,9 +210,10 @@ CAMLprim value stub_xc_domain_create(value xch_val, value wanted_domid, value co
#define VAL_MAX_GRANT_FRAMES Field(config, 6)
#define VAL_MAX_MAPTRACK_FRAMES Field(config, 7)
#define VAL_MAX_GRANT_VERSION Field(config, 8)
-#define VAL_VMTRACE_BUF_KB Field(config, 9)
-#define VAL_CPUPOOL_ID Field(config, 10)
-#define VAL_ARCH Field(config, 11)
+#define VAL_ALTP2M_COUNT Field(config, 9)
+#define VAL_VMTRACE_BUF_KB Field(config, 10)
+#define VAL_CPUPOOL_ID Field(config, 11)
+#define VAL_ARCH Field(config, 12)
uint32_t domid = Int_val(wanted_domid);
uint64_t vmtrace_size = Int32_val(VAL_VMTRACE_BUF_KB);
@@ -230,6 +231,7 @@ CAMLprim value stub_xc_domain_create(value xch_val, value wanted_domid, value co
.max_maptrack_frames = Int_val(VAL_MAX_MAPTRACK_FRAMES),
.grant_opts =
XEN_DOMCTL_GRANT_version(Int_val(VAL_MAX_GRANT_VERSION)),
+ .nr_altp2m = Int_val(VAL_ALTP2M_COUNT),
.vmtrace_size = vmtrace_size,
.cpupool_id = Int32_val(VAL_CPUPOOL_ID),
};
@@ -257,7 +259,7 @@ CAMLprim value stub_xc_domain_create(value xch_val, value wanted_domid, value co
#if defined(__i386__) || defined(__x86_64__)
/* Quick & dirty check for ABI changes. */
- BUILD_BUG_ON(sizeof(cfg) != 64);
+ BUILD_BUG_ON(sizeof(cfg) != 68);
/* Mnemonics for the named fields inside xen_x86_arch_domainconfig */
#define VAL_EMUL_FLAGS Field(arch_domconfig, 0)
@@ -288,6 +290,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_MAX_GRANT_VERSION
#undef VAL_MAX_MAPTRACK_FRAMES
#undef VAL_MAX_GRANT_FRAMES
--
2.34.1
prev parent reply other threads:[~2024-05-16 11:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-16 11:28 [PATCH for-4.19? v3 0/6] x86: Make MAX_ALTP2M configurable Petr Beneš
2024-05-16 11:28 ` [PATCH for-4.19? v3 1/6] x86/p2m: Add braces for better code clarity Petr Beneš
2024-05-16 11:28 ` [PATCH for-4.19? v3 2/6] tools/xl: Add altp2m_count parameter Petr Beneš
2024-05-16 11:28 ` [PATCH for-4.19? v3 3/6] docs/man: Add altp2m_count parameter to the xl.cfg manual Petr Beneš
2024-05-16 11:28 ` [PATCH for-4.19? v3 4/6] x86: Make the maximum number of altp2m views configurable Petr Beneš
2024-05-18 1:17 ` Tamas K Lengyel
2024-05-18 10:17 ` Petr Beneš
2024-05-16 11:28 ` [PATCH for-4.19? v3 5/6] tools/libxl: Activate the altp2m_count feature Petr Beneš
2024-05-16 11:28 ` Petr Beneš [this message]
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=8537c5deeb409580868ec8d88171146dc7138662.1715858136.git.w1benny@gmail.com \
--to=w1benny@gmail.com \
--cc=anthony@xenproject.org \
--cc=christian.lindig@citrix.com \
--cc=christian.lindig@cloud.com \
--cc=dave@recoil.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 read-only IMAP folder(s) and NNTP newsgroup(s).