All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vikram Garhwal <fnu.vikram@xilinx.com>
To: <xen-devel@lists.xenproject.org>
Cc: <sstabellini@kernel.org>, <julien@xen.org>,
	Vikram Garhwal <fnu.vikram@xilinx.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Jan Beulich <jbeulich@suse.com>, Paul Durrant <paul@xen.org>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>,
	Juergen Gross <jgross@suse.com>,
	Anthony PERARD <anthony.perard@citrix.com>
Subject: [XEN][RFC PATCH 00/13] Add Support for dynamic Programming
Date: Wed, 1 Sep 2021 23:05:50 -0700	[thread overview]
Message-ID: <1630562763-390068-1-git-send-email-fnu.vikram@xilinx.com> (raw)

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

fdt_overlay.c file is taken from Linux and other existing fdt files are modified
to accommodate the fdt_overlay. The changes w.r.t. existing fdt are kept minimal
i.e. only the required library file/functions from Linux fdt are pulled in.

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).

fpga-add and fpga-del are probably not the best names for these commands. This
was done initially for xilinx FPGA programmable logic block dynamic programming.
I am okay with replacing fpga-add and fpga-del with better names if there are
any suggestions.

Regards,
Vikram

Vikram Garhwal (13):
  device tree: Remove __init from function type
  libfdt: Keep fdt functions after init.
  libfdt: import fdt_overlay from Linux
  libfdt: Copy required libfdt functions from Linux
  libfdt: Change overlay_get_target() type
  device tree: Add dt_print_node_names()
  device tree: Add _dt_find_node_by_path() to find nodes in device tree
  xen/iommu: Introduce iommu_remove_dt_devices function
  xen/arm: Implement device tree node removal functionalities
  xen/arm: Implement device tree node addition functionalities
  tools/libs/ctrl: Implement new xc interfaces for fpga-add and fpga-del
  tools/libs/light: Implement new libxl functions for fpga-add and
    fpga-del
  tools/xl: Add new xl commands fpga-add and fpga-del

 tools/include/libxl.h                 |   5 +
 tools/include/xenctrl.h               |   4 +
 tools/libs/ctrl/Makefile              |   1 +
 tools/libs/ctrl/xc_fpga.c             |  82 ++++
 tools/libs/light/Makefile             |   1 +
 tools/libs/light/libxl_fpga.c         |  73 +++
 tools/xl/xl.h                         |   2 +
 tools/xl/xl_cmdtable.c                |  12 +
 tools/xl/xl_vmcontrol.c               |  51 ++
 xen/arch/arm/Makefile                 |   2 +-
 xen/arch/arm/domain_build.c           |  15 +-
 xen/arch/arm/domctl.c                 | 445 +++++++++++++++++
 xen/common/device_tree.c              | 143 +++++-
 xen/common/libfdt/Makefile            |   1 -
 xen/common/libfdt/Makefile.libfdt     |   2 +-
 xen/common/libfdt/fdt.c               |  35 ++
 xen/common/libfdt/fdt_overlay.c       | 884 ++++++++++++++++++++++++++++++++++
 xen/common/libfdt/fdt_ro.c            |  52 +-
 xen/common/libfdt/fdt_rw.c            |  81 +++-
 xen/common/libfdt/fdt_wip.c           |  20 +
 xen/common/libfdt/libfdt_internal.h   | 130 +++++
 xen/drivers/passthrough/arm/smmu.c    |  53 ++
 xen/drivers/passthrough/device_tree.c |  30 ++
 xen/include/asm-arm/domain_build.h    |  10 +
 xen/include/public/domctl.h           |  16 +
 xen/include/xen/device_tree.h         |  21 +
 xen/include/xen/iommu.h               |   2 +
 xen/include/xen/libfdt/libfdt.h       | 232 ++++++++-
 28 files changed, 2363 insertions(+), 42 deletions(-)
 create mode 100644 tools/libs/ctrl/xc_fpga.c
 create mode 100644 tools/libs/light/libxl_fpga.c
 create mode 100644 xen/common/libfdt/fdt_overlay.c

-- 
2.7.4



             reply	other threads:[~2021-09-02  6:51 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-02  6:05 Vikram Garhwal [this message]
2021-09-02  6:05 ` [XEN][RFC PATCH 01/13] device tree: Remove __init from function type Vikram Garhwal
2021-10-20 17:55   ` Julien Grall
2021-09-02  6:05 ` [XEN][RFC PATCH 02/13] libfdt: Keep fdt functions after init Vikram Garhwal
2021-10-20 18:00   ` Julien Grall
2021-09-02  6:05 ` [XEN][RFC PATCH 03/13] libfdt: import fdt_overlay from Linux Vikram Garhwal
2021-10-20 18:05   ` Julien Grall
2021-09-02  6:05 ` [XEN][RFC PATCH 04/13] libfdt: Copy required libfdt functions " Vikram Garhwal
2021-09-02  6:05 ` [XEN][RFC PATCH 05/13] libfdt: Change overlay_get_target() type Vikram Garhwal
2021-10-20 18:09   ` Julien Grall
2021-09-02  6:05 ` [XEN][RFC PATCH 06/13] device tree: Add dt_print_node_names() Vikram Garhwal
2021-10-21  9:04   ` Julien Grall
2021-09-02  6:05 ` [XEN][RFC PATCH 07/13] device tree: Add _dt_find_node_by_path() to find nodes in device tree Vikram Garhwal
2021-09-02  6:05 ` [XEN][RFC PATCH 08/13] xen/iommu: Introduce iommu_remove_dt_devices function Vikram Garhwal
2021-10-21  9:34   ` Julien Grall
2021-09-02  6:05 ` [XEN][RFC PATCH 09/13] xen/arm: Implement device tree node removal functionalities Vikram Garhwal
2021-09-02  6:06 ` [XEN][RFC PATCH 10/13] xen/arm: Implement device tree node addition functionalities Vikram Garhwal
2021-10-21 18:30   ` Julien Grall
2021-09-02  6:06 ` [XEN][RFC PATCH 11/13] tools/libs/ctrl: Implement new xc interfaces for fpga-add and fpga-del Vikram Garhwal
2021-09-02  6:06 ` [XEN][RFC PATCH 12/13] tools/libs/light: Implement new libxl functions " Vikram Garhwal
2021-09-02  6:06 ` [XEN][RFC PATCH 13/13] tools/xl: Add new xl commands " Vikram Garhwal

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=1630562763-390068-1-git-send-email-fnu.vikram@xilinx.com \
    --to=fnu.vikram@xilinx.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=iwj@xenproject.org \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=julien@xen.org \
    --cc=paul@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.