All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Orzel <michal.orzel@amd.com>
To: Jan Beulich <jbeulich@suse.com>, Vikram Garhwal <vikram.garhwal@amd.com>
Cc: <julien@xen.org>, <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	"Anthony PERARD" <anthony.perard@citrix.com>,
	<xen-devel@lists.xenproject.org>
Subject: Re: [XEN][PATCH v12 20/20] tools/xl: Add new xl command overlay for device tree overlay support
Date: Wed, 6 Sep 2023 09:32:31 +0200	[thread overview]
Message-ID: <6a3bcb64-2416-225e-8a5e-5ea7823d3c29@amd.com> (raw)
In-Reply-To: <3ee81557-50d2-1ae0-e700-9f20672ef15e@suse.com>



On 06/09/2023 08:55, Jan Beulich wrote:
> 
> 
> On 06.09.2023 03:16, Vikram Garhwal wrote:
>> --- a/tools/xl/xl_vmcontrol.c
>> +++ b/tools/xl/xl_vmcontrol.c
>> @@ -1265,6 +1265,58 @@ int main_create(int argc, char **argv)
>>      return 0;
>>  }
>>
>> +int main_dt_overlay(int argc, char **argv)
>> +{
>> +    const char *overlay_ops = NULL;
>> +    const char *overlay_config_file = NULL;
>> +    void *overlay_dtb = NULL;
>> +    int rc;
>> +    uint8_t op;
>> +    int overlay_dtb_size = 0;
>> +    const int overlay_add_op = 1;
>> +    const int overlay_remove_op = 2;
>> +
>> +    if (argc < 2) {
>> +        help("dt_overlay");
>> +        return EXIT_FAILURE;
>> +    }
>> +
>> +    overlay_ops = argv[1];
>> +    overlay_config_file = argv[2];
>> +
>> +    if (strcmp(overlay_ops, "add") == 0)
>> +        op = overlay_add_op;
>> +    else if (strcmp(overlay_ops, "remove") == 0)
>> +        op = overlay_remove_op;
>> +    else {
>> +        fprintf(stderr, "Invalid dt overlay operation\n");
>> +        return EXIT_FAILURE;
>> +    }
>> +
>> +    if (overlay_config_file) {
>> +        rc = libxl_read_file_contents(ctx, overlay_config_file,
>> +                                      &overlay_dtb, &overlay_dtb_size);
>> +
>> +        if (rc) {
>> +            fprintf(stderr, "failed to read the overlay device tree file %s\n",
>> +                    overlay_config_file);
>> +            free(overlay_dtb);
>> +            return ERROR_FAIL;
>> +        }
>> +    } else {
>> +        fprintf(stderr, "overlay dtbo file not provided\n");
>> +        return ERROR_FAIL;
>> +    }
>> +
>> +    rc = libxl_dt_overlay(ctx, overlay_dtb, overlay_dtb_size, op);
> 
> Because of this being Arm-only (as validly pointed out by osstest), I expect
> the entire function here as well as its entry in cmd_table[] want to be
> Arm-specific, too? Of course it would be nice to not key this to __arm__ /
> __aarch64__, but to something that would not need touching again if the
> underlying infrastructure was made available to, say, RISC-V as well. But of
> course - right now the goal needs to be to address the CI and osstest
> breakage.
I agree. I would suggest to guard it with LIBXL_HAVE_DT_OVERLAY which is for now
only defined for arm32/arm64. This way the code will not need to be modified if other
arch gain support for the feature.
If you agree, I can send a patch to unbreak CI unless you want to do this.

~Michal


  reply	other threads:[~2023-09-06  7:33 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-06  1:16 [XEN][PATCH v12 00/20] dynamic node programming using overlay dtbo Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 01/20] common/device_tree: handle memory allocation failure in __unflatten_device_tree() Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 02/20] common/device_tree.c: unflatten_device_tree() propagate errors Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 03/20] xen/arm/device: Remove __init from function type Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 04/20] common/device_tree: Export __unflatten_device_tree() Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 05/20] xen/arm: Add CONFIG_OVERLAY_DTB Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 06/20] libfdt: Keep fdt functions after init for CONFIG_OVERLAY_DTB Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 07/20] libfdt: overlay: change overlay_get_target() Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 08/20] xen/device-tree: Add dt_find_node_by_path_from() to find nodes in device tree Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 09/20] xen/iommu: Move spin_lock from iommu_dt_device_is_assigned to caller Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 10/20] xen/iommu: protect iommu_add_dt_device() with dtdevs_lock Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 11/20] xen/iommu: Introduce iommu_remove_dt_device() Vikram Garhwal
2023-09-06  6:33   ` Jan Beulich
2023-09-06  1:16 ` [XEN][PATCH v12 12/20] xen/smmu: Add remove_device callback for smmu_iommu ops Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 13/20] asm/smp.h: Fix circular dependency for device_tree.h and rwlock.h Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 14/20] common/device_tree: Add rwlock for dt_host Vikram Garhwal
2023-09-06  1:28   ` Stefano Stabellini
2023-09-06  1:16 ` [XEN][PATCH v12 15/20] arm/asm/setup.h: Update struct map_range_data to add rangeset Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 16/20] xen/arm: Implement device tree node removal functionalities Vikram Garhwal
2023-09-06  6:37   ` Jan Beulich
2023-09-06  1:16 ` [XEN][PATCH v12 17/20] xen/arm: Implement device tree node addition functionalities Vikram Garhwal
2023-09-06  1:30   ` Stefano Stabellini
2023-09-06  1:16 ` [XEN][PATCH v12 18/20] tools/libs/ctrl: Implement new xc interfaces for dt overlay Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 19/20] tools/libs/light: Implement new libxl functions for device tree overlay ops Vikram Garhwal
2023-09-06  1:16 ` [XEN][PATCH v12 20/20] tools/xl: Add new xl command overlay for device tree overlay support Vikram Garhwal
2023-09-06  6:55   ` Jan Beulich
2023-09-06  7:32     ` Michal Orzel [this message]
2023-09-06  7:57       ` Jan Beulich
2023-09-06  8:06         ` Michal Orzel
2023-09-06  8:26           ` Jan Beulich

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=6a3bcb64-2416-225e-8a5e-5ea7823d3c29@amd.com \
    --to=michal.orzel@amd.com \
    --cc=anthony.perard@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=vikram.garhwal@amd.com \
    --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.