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

Re: [XEN][RFC PATCH v4 15/16] tools/libs/light: Implement new libxl functions for device tree overlay ops


  • To: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • From: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • Date: Wed, 1 Feb 2023 09:22:57 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vT3+Q0FqEUI+MrO5MSmCjiNIjXIEaPuJjz3zdnfZubw=; b=EWQM8suds/988UpY2pt1GuoIWtyAntHq5bLYXusU7zQi6wApCmwg6UxKYm3mC9lCDK9Cir21KVNthzuk1iGDg21RDzsoZEsutiKdcqMiIx6R8ALysbm3NXir2ql62oZQgSvDTvYgHUCqtnwAa73yxm0Ppv4sgfLHJkEMfU2UUodco/wwk/v8gIpPANxa+yv6Jl60PzT/j79Zto9bSxkvD5K4mhs+mrX8wplA6g9NMu+5Bx2a0t3W9mNemmvxmkGwlCi8m0vurhrcZGPwk5bqEcsZ38CcphAQB9KWQH4+jEI1S3azx9Yn9TZTjzGVTMuLHWcgSe7gfKf0PjFvBWII3w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aadjURwlSwYvRmgmN8Vt8w9rYNvlnAYHAWjjzf0M4f4rDD/tnkHRcegt6RxbJ5z3AJAfuux/+P7GQb4yUrMkO8btu6YjZnjhvitboayctBOqh2cuF8EowDmkGnTX9WJliu5rqKC5IS8e/9v9rZsn7CN+ZUb591I3jTDl4f9ho0t1YLtdfDN796LfuL4ZuOzOY2FuPA5agaa8XJNExaudTzdTczMqkqdJEqZVIbFQo6OnU7wku/gVrw1jR73CnRNQfX2X1OqDFvF1497Awc3KIJO+daVF54NxaP0pjhjwoPwIGfXEBUi6mFC+RVy1pvrool++Zu1hHOXl+u8AxphnLw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com;
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, julien@xxxxxxx, Luca.Fancellu@xxxxxxx, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
  • Delivery-date: Wed, 01 Feb 2023 17:23:17 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Hi Anthony,

On 12/9/22 8:59 AM, Anthony PERARD wrote:
On Tue, Dec 06, 2022 at 10:18:14PM -0800, Vikram Garhwal wrote:
diff --git a/tools/include/libxl.h b/tools/include/libxl.h
index 2321a648a5..82fc7ce6b9 100644
--- a/tools/include/libxl.h
+++ b/tools/include/libxl.h
@@ -245,6 +245,11 @@
   */
  #define LIBXL_HAVE_DEVICETREE_PASSTHROUGH 1
+/**
+ * This means Device Tree Overlay is supported.
+ */
+#define LIBXL_HAVE_DT_OVERLAY 1
+
  /*
   * libxl_domain_build_info has device_model_user to specify the user to
   * run the device model with. See docs/misc/qemu-deprivilege.txt.
@@ -2448,6 +2453,9 @@ libxl_device_pci *libxl_device_pci_list(libxl_ctx *ctx, 
uint32_t domid,
                                          int *num);
  void libxl_device_pci_list_free(libxl_device_pci* list, int num);
+int libxl_dt_overlay(libxl_ctx *ctx, void *overlay,
+                     uint32_t overlay_size, uint8_t overlay_op);
+
Could you guard both the LIBXL_HAVE_* macro and this prototype with "#if
arm"? Since the dt_overlay operation to libxl built on arm.
Will do this in v5

  /*
   * Turns the current process into a backend device service daemon
   * for a driver domain.
diff --git a/tools/libs/light/Makefile b/tools/libs/light/Makefile
index 374be1cfab..2fde58246e 100644
--- a/tools/libs/light/Makefile
+++ b/tools/libs/light/Makefile
@@ -111,6 +111,9 @@ OBJS-y += _libxl_types.o
  OBJS-y += libxl_flask.o
  OBJS-y += _libxl_types_internal.o
+# Device tree overlay is enabled only for ARM architecture.
+OBJS-$(CONFIG_ARM) += libxl_dt_overlay.o
+
  ifeq ($(CONFIG_LIBNL),y)
  CFLAGS_LIBXL += $(LIBNL3_CFLAGS)
  endif
diff --git a/tools/libs/light/libxl_dt_overlay.c 
b/tools/libs/light/libxl_dt_overlay.c
new file mode 100644
index 0000000000..38cab880a0
--- /dev/null
+++ b/tools/libs/light/libxl_dt_overlay.c
+#include "libxl_osdeps.h" /* must come before any other headers */
+#include "libxl_internal.h"
+#include <libfdt.h>
+#include <xenguest.h>
+#include <xenctrl.h>
Don't you need just xenctrl.h and not xenguest.h? (They both already are
libxl_internal.h so I'm not sure if xenguest.h is needed., but
xc_dt_overlay() is in xenctrl.h)
Thanks for spotting this. I will remove xenguest.h

Thanks,




 


Rackspace

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