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

Re: [XEN][PATCH v6 15/19] xen/arm: Implement device tree node removal functionalities


  • To: Vikram Garhwal <vikram.garhwal@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 3 May 2023 09:59:36 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=TnfPxbd9O5raFiv4FU6HklW0GmRoH0bxmZ8WkaI26WQ=; b=NSJn5XY9hPeXqzUMPLTlzkz/WjjqRUTcP+/ZBOzFu87gaRU7NR9fBARdZnxbR4CIQ6PWWov1rJOv+dI69J+epm3ILj85PhTT3LjL88Bc/WsGNS3QDUNUxSi1a0HAGvRZarOskBWNnYc4lE9OXP9Um3l2SLlFwc/Djvx8Yc9uajS9+hQVk5/Ptrk7XemJp9o+SytVTJiWbB4pPWaOgLWSVqLOI2KuuYTXFBQMS58O/LxkUvi6tGv+9Jf5XNTcmkCmv3oCutLrJc8IuyK2hpPdw+dN4sVWLF17/67XOrB9Hdqy/6ZSsYsmL7g7LncyT9lvDh3DOx8vovettHZzZPGBEQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iBifMORxsMWiuSuej3g989o3uQq5ekhk2Dl3I/xiM5dG0UOk1BUw25p+/kJSuyGu+5t0yNlNONNFhGKUt7VPdWYFxhYnfp+w/n1sW0uwTTzZ6obBTK5KYgBzMLVdZUnOXEKjICXEr8VLZnTjbBq2cURz3sku6wouuLtr7gKkwJ1LsyzvhV33fgPU/Rosm/4At0MhIIpl8TSrZjLE+RpyQE3DkR7X3rO3VB94h/k84PqmyzXTgOc+temXuEAfnINF+ynwk0uFmEKw7u6SZ6Gd4ksGRbnJTZUYuXzRG3ntPrIy0o5SNA8H59hJTV/ExW/xTMDGbyxROMdKWZH5T3OgzA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: sstabellini@xxxxxxxxxx, michal.orzel@xxxxxxx, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Wed, 03 May 2023 07:59:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.05.2023 01:36, Vikram Garhwal wrote:
> --- a/xen/include/public/sysctl.h
> +++ b/xen/include/public/sysctl.h
> @@ -1057,6 +1057,24 @@ typedef struct xen_sysctl_cpu_policy 
> xen_sysctl_cpu_policy_t;
>  DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpu_policy_t);
>  #endif
>  
> +#if defined(__arm__) || defined (__aarch64__)
> +/*
> + * XEN_SYSCTL_dt_overlay
> + * Performs addition/removal of device tree nodes under parent node using 
> dtbo.
> + * This does in three steps:
> + *  - Adds/Removes the nodes from dt_host.
> + *  - Adds/Removes IRQ permission for the nodes.
> + *  - Adds/Removes MMIO accesses.
> + */
> +struct xen_sysctl_dt_overlay {
> +    XEN_GUEST_HANDLE_64(void) overlay_fdt;  /* IN: overlay fdt. */
> +    uint32_t overlay_fdt_size;              /* IN: Overlay dtb size. */
> +#define XEN_SYSCTL_DT_OVERLAY_ADD                   1
> +#define XEN_SYSCTL_DT_OVERLAY_REMOVE                2
> +    uint8_t overlay_op;                     /* IN: Add or remove. */
> +};

I think you want to make padding explicit here and also check it to
be zero when incoming.

> --- /dev/null
> +++ b/xen/include/xen/dt-overlay.h
> @@ -0,0 +1,58 @@
> + /* SPDX-License-Identifier: GPL-2.0 */
> + /*
> + * xen/dt-overlay.h
> + *
> + * Device tree overlay support in Xen.
> + *
> + * Copyright (C) 2023, Advanced Micro Devices, Inc. All Rights Reserved.
> + * Written by Vikram Garhwal <vikram.garhwal@xxxxxxx>
> + *
> + */
> +#ifndef __XEN_DT_OVERLAY_H__
> +#define __XEN_DT_OVERLAY_H__
> +
> +#include <xen/list.h>
> +#include <xen/libfdt/libfdt.h>
> +#include <xen/device_tree.h>
> +#include <xen/rangeset.h>
> +
> +/*
> + * overlay_node_track describes information about added nodes through dtbo.
> + * @entry: List pointer.
> + * @dt_host_new: Pointer to the updated dt_host_new unflattened 'updated 
> fdt'.
> + * @fdt: Stores the fdt.
> + * @nodes_fullname: Stores the full name of nodes.
> + * @nodes_irq: Stores the IRQ added from overlay dtb.
> + * @node_num_irq: Stores num of IRQ for each node in overlay dtb.
> + * @num_nodes: Stores total number of nodes in overlay dtb.
> + */
> +struct overlay_track {
> +    struct list_head entry;
> +    struct dt_device_node *dt_host_new;
> +    void *fdt;
> +    void *overlay_fdt;
> +    unsigned long *nodes_address;
> +    unsigned int num_nodes;
> +};
> +
> +struct xen_sysctl_dt_overlay;
> +
> +#ifdef CONFIG_OVERLAY_DTB
> +long dt_sysctl(struct xen_sysctl_dt_overlay *op);
> +#else
> +static inline long dt_sysctl(struct xen_sysctl_dt_overlay *op)
> +{
> +    return -ENOSYS;

Pretty certainly -EOPNOTSUPP.

Jan



 


Rackspace

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