xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [XEN][RFC PATCH v2 00/12] dynamic node programming using overlay dtbo
@ 2021-11-09  7:02 Vikram Garhwal
  2021-11-09  7:02 ` [XEN][RFC PATCH v2 01/12] device tree: Remove __init from function type Vikram Garhwal
                   ` (11 more replies)
  0 siblings, 12 replies; 28+ messages in thread
From: Vikram Garhwal @ 2021-11-09  7:02 UTC (permalink / raw)
  To: xen-devel
  Cc: sstabellini, julien, bertrand.marquis, volodymyr_babchuk,
	Vikram Garhwal, Volodymyr Babchuk, Jan Beulich, Paul Durrant,
	Andrew Cooper, George Dunlap, Ian Jackson, Wei Liu,
	Juergen Gross, Anthony PERARD

Hi,
This RFC patch series is for introducing dynamic programming i.e. add/remove the
devices during run time. Using "xl overlay" a device can be added/removed with dtbo.

For adding a node using dynamic programming:
    1. flatten device tree overlay node will be added to a fdt
    2. Updated fdt will be unflattened to a new dt_host_new
    3. Extract the newly added node information from dt_host_new
    4. Add the added node under correct parent in original dt_host.
    3. Map interrupt and iomem region as required.

For removing a node:
    1. Find the node with given path.
    2. Check if the node is used by any of dom0 or domus. Removes the node
only when it's not used by any domain.
    3. Removes IRQ permissions and MMIO access.
    5. Find the node in dt_host and delete the device node entry from dt_host.
    6. Free the overlay_tracker entry which means free dt_host_new also(created
in adding node step).

Question: I am not sure how to enable CONFIG_OVERLAY_DTB in tool stack like the
way we do in xen using menuconfig or editing .config file. Would it be possible
for someone in tool stack expertise to guide me?

Reminder: This patch series has dependency on libfdt v1.6.1. A patch for libfdt
upgrade was already sent earlier with below subject:
    [XEN][PATCH v2 0/1] Update libfdt to v1.6.1

Change Log:
 v1 -> v2:
    Add support for multiple node addition/removal using dtbo.
    Replaced fpga-add and fpga-remove with one hypercall overlay_op.
    Moved common domain_build.c function to device.c
    Add OVERLAY_DTB configuration.
    Renamed overlay_get_target() to fdt_overlay_get_target().
    Split remove_device patch into two patches.
    Moved overlay_add/remove code to sysctl and changed it from domctl to sysctl.
    Added all overlay code under CONFIG_OVERLAY_DTB
    Renamed all tool domains fpga function to overlay
    Addressed code issues from v1 review.

Regards,
Vikram

Vikram Garhwal (12):
  device tree: Remove __init from function type
  xen: arm: Add CONFIG_OVERLAY_DTB
  libfdt: Keep fdt functions after init for CONFIG_OVERLAY_DTB.
  libfdt: Add fdt_ prefix to overlay_get_target()
  device tree: Add _dt_find_node_by_path() to find nodes in device tree
  xen/smmu: Add remove_device callback for smmu_iommu ops
  xen/smmu: Add remove_device callback for smmu_iommu ops
  xen/arm: Implement device tree node removal functionalities
  xen/arm: Implement device tree node addition functionalities
  tools/libs/ctrl: Implement new xc interfaces for dt overlay
  tools/libs/light: Implement new libxl functions for device tree
    overlay ops
  tools/xl: Add new xl command overlay

 tools/include/libxl.h                 |   5 +
 tools/include/xenctrl.h               |   5 +
 tools/libs/ctrl/Makefile              |   1 +
 tools/libs/ctrl/xc_overlay.c          |  51 +++
 tools/libs/light/Makefile             |   3 +
 tools/libs/light/libxl_overlay.c      |  65 ++++
 tools/xl/xl.h                         |   8 +
 tools/xl/xl_cmdtable.c                |   8 +
 tools/xl/xl_vmcontrol.c               |  47 +++
 xen/arch/arm/Kconfig                  |   8 +
 xen/arch/arm/device.c                 | 146 +++++++++
 xen/arch/arm/domain_build.c           | 150 ---------
 xen/common/device_tree.c              | 122 +++++++-
 xen/common/libfdt/Makefile            |   3 +
 xen/common/libfdt/fdt_overlay.c       |  12 +-
 xen/common/sysctl.c                   | 571 ++++++++++++++++++++++++++++++++++
 xen/drivers/passthrough/arm/smmu.c    |  54 ++++
 xen/drivers/passthrough/device_tree.c |  30 ++
 xen/include/asm-arm/domain_build.h    |  10 +
 xen/include/public/sysctl.h           |  23 ++
 xen/include/xen/device_tree.h         |  20 ++
 xen/include/xen/iommu.h               |   2 +
 xen/include/xen/libfdt/libfdt.h       |   3 +
 23 files changed, 1180 insertions(+), 167 deletions(-)
 create mode 100644 tools/libs/ctrl/xc_overlay.c
 create mode 100644 tools/libs/light/libxl_overlay.c

-- 
2.7.4



^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2021-12-24  0:46 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09  7:02 [XEN][RFC PATCH v2 00/12] dynamic node programming using overlay dtbo Vikram Garhwal
2021-11-09  7:02 ` [XEN][RFC PATCH v2 01/12] device tree: Remove __init from function type Vikram Garhwal
2021-11-09  7:02 ` [XEN][RFC PATCH v2 02/12] xen: arm: Add CONFIG_OVERLAY_DTB Vikram Garhwal
2021-12-22 14:02   ` Julien Grall
2021-11-09  7:02 ` [XEN][RFC PATCH v2 03/12] libfdt: Keep fdt functions after init for CONFIG_OVERLAY_DTB Vikram Garhwal
2021-11-09 11:10   ` Jan Beulich
2021-12-22 14:03   ` Julien Grall
2021-11-09  7:02 ` [XEN][RFC PATCH v2 04/12] libfdt: Add fdt_ prefix to overlay_get_target() Vikram Garhwal
2021-12-22 14:07   ` Julien Grall
2021-11-09  7:02 ` [XEN][RFC PATCH v2 05/12] device tree: Add _dt_find_node_by_path() to find nodes in device tree Vikram Garhwal
2021-11-09  7:02 ` [XEN][RFC PATCH v2 06/12] xen/smmu: Add remove_device callback for smmu_iommu ops Vikram Garhwal
2021-12-22 14:31   ` Julien Grall
2021-11-09  7:02 ` [XEN][RFC PATCH v2 07/12] " Vikram Garhwal
2021-12-22 14:38   ` Julien Grall
2021-11-09  7:02 ` [XEN][RFC PATCH v2 08/12] xen/arm: Implement device tree node removal functionalities Vikram Garhwal
2021-11-09 11:16   ` Jan Beulich
2021-12-22 16:13   ` Julien Grall
2021-12-24  0:45     ` Stefano Stabellini
2021-11-09  7:02 ` [XEN][RFC PATCH v2 09/12] xen/arm: Implement device tree node addition functionalities Vikram Garhwal
2021-11-09 11:19   ` Jan Beulich
2021-11-09 17:55     ` Vikram Garhwal
2021-11-09  7:02 ` [XEN][RFC PATCH v2 10/12] tools/libs/ctrl: Implement new xc interfaces for dt overlay Vikram Garhwal
2021-11-11 16:54   ` Anthony PERARD
2021-11-11 19:46     ` Vikram Garhwal
2021-11-12 14:21       ` Anthony PERARD
2021-11-09  7:02 ` [XEN][RFC PATCH v2 11/12] tools/libs/light: Implement new libxl functions for device tree overlay ops Vikram Garhwal
2021-11-11 16:44   ` Anthony PERARD
2021-11-09  7:02 ` [XEN][RFC PATCH v2 12/12] tools/xl: Add new xl command overlay Vikram Garhwal

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 NNTP newsgroup(s).