[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 03/10] tools/libxl: add vmtrace_pt_size parameter



Hi,

On 30/06/2020 13:33, Michał Leszczyński wrote:
diff --git a/tools/libxl/libxl.h b/tools/libxl/libxl.h
index 71709dc585..891e8e28d6 100644
--- a/tools/libxl/libxl.h
+++ b/tools/libxl/libxl.h
@@ -438,6 +438,14 @@
   */
  #define LIBXL_HAVE_CREATEINFO_PASSTHROUGH 1
+/*
+ * LIBXL_HAVE_VMTRACE_PT_ORDER indicates that
+ * libxl_domain_create_info has a vmtrace_pt_order parameter, which
+ * allows to enable pre-allocation of processor tracing buffers
+ * with the given order of size.
+ */
+#define LIBXL_HAVE_VMTRACE_PT_ORDER 1
+
  /*
   * libxl ABI compatibility
   *
diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
index 75862dc6ed..651d1f4c0f 100644
--- a/tools/libxl/libxl_create.c
+++ b/tools/libxl/libxl_create.c
@@ -608,6 +608,7 @@ int libxl__domain_make(libxl__gc *gc, libxl_domain_config 
*d_config,
              .max_evtchn_port = b_info->event_channels,
              .max_grant_frames = b_info->max_grant_frames,
              .max_maptrack_frames = b_info->max_maptrack_frames,
+            .vmtrace_pt_order = b_info->vmtrace_pt_order,
          };
if (info->type != LIBXL_DOMAIN_TYPE_PV) {
diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
index 9d3f05f399..1c5dd43e4d 100644
--- a/tools/libxl/libxl_types.idl
+++ b/tools/libxl/libxl_types.idl
@@ -645,6 +645,8 @@ libxl_domain_build_info = Struct("domain_build_info",[
      # supported by x86 HVM and ARM support is planned.
      ("altp2m", libxl_altp2m_mode),
+ ("vmtrace_pt_order", integer),

libxl can be used by external projects (such libvirt) for implementing their own toolstack.

While on x86 you always have the same granularity, on Arm the hypervisor and each guest may have a different page granularity (e.g 4KB, 16KB, 64KB). So it is unclear what order one would have to use.

I think it would be best if the external user only specify the number of bytes. You can then sanity check the value and convert to an order (or number of pages) in libxl before passing the value to the hypervisor.

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.