From: Vikram Garhwal <vikram.garhwal@amd.com>
To: Julien Grall <julien@xen.org>
Cc: xen-devel@lists.xenproject.org, michal.orzel@amd.com,
sstabellini@kernel.org, jbeulich@suse.com,
Bertrand Marquis <bertrand.marquis@arm.com>,
Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
Subject: Re: [XEN][PATCH v9 03/19] xen/arm/device: Remove __init from function type
Date: Thu, 24 Aug 2023 17:52:39 -0700 [thread overview]
Message-ID: <ZOf7V_FsJ_CgeL64@amd.com> (raw)
In-Reply-To: <734587ea-4066-4f60-8903-7f43a10bb1b6@xen.org>
Hi Julien,
On Tue, Aug 22, 2023 at 07:59:13PM +0100, Julien Grall wrote:
> Hi Vikram,
>
> On 19/08/2023 01:28, Vikram Garhwal wrote:
> > Remove __init from following function to access during runtime:
> > 1. map_irq_to_domain()
> > 2. handle_device_interrupts()
> > 3. map_range_to_domain()
> > 4. unflatten_dt_node()
>
> We are at v9 now, so this is more a remark for the future. In general we are
> trying to avoid modifying the same code multiple time within the series
> because this makes it more difficult to review. In this case, you could have
> removed the __init in patch #4 where you also export it.
>
> >
> > Move map_irq_to_domain() prototype from domain_build.h to setup.h.
> >
> > To avoid breaking the build, following changes are also done:
>
> I am guessing by "breaking the build", you mean that you will get an error
> because an non-init function is implemented in domain_build.c. Right? If so,
> I think this should be spelled out.
Yeah, i will change the commit with right reasoning.
>
> > 1. Move map_irq_to_domain(), handle_device_interrupts() and map_range_to_domain()
> > to device.c. After removing __init type, these functions are not specific
> > to domain building, so moving them out of domain_build.c to device.c.
> > 2. Remove static type from handle_device_interrupt().
>
> Typo: s/interrupt/interrupts/ to match the function name. But I don't link
> the name when it is exported as it leads to think this is dealing with real
> interrupt.
With using handle_device() in overlay as your below suggestion will anyway need
this handle_device_interrupts() function here.
>
> Looking at the overlay code, the caller (i.e. add_resources()) is very
> similar to handle_device(). AFAICT the only differences are:
> 1/ add_resources() doesn't deal with mapping (you said it will in the
> future)
> 2/ You need to update some rangeset
>
> For 1/ it means this is a superset. For 2/, I think this could be abstracted
> by adding a pointer to the rangesets in map_range_data. They could be NULL
> for the domain build case.
>
> So can you look at abstracting? This will make easier to maintain a single
> place to parse a device node and map it.
>
> A possible name for the function would be dt_map_resources_to_domain().
For this part of dynamic overlay programming this function can be used.
I updated the overlay code to use handle_device() as per your suggestions. Moved
handle_device() and other relevant function out of domain_build.
About renaming the function name to dt_map_resource_to_domain(): I will see if
i can come with better name else will keep your suggestion.
Now with this case, overlay device tree needs to have "xen,passthrough" enabled
else it will try to map and fail as Xen supports irq_route and mapping only at
the domain creation. In earlier patches this worked fine as we were always skip
the routing and map. Anyway, I will add this in overlay commit message.
I will send v10 tonight. Testing a few things.
>
> Cheers,
>
> --
> Julien Grall
next prev parent reply other threads:[~2023-08-25 0:53 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-19 0:28 [XEN][PATCH v9 00/19] dynamic node programming using overlay dtbo Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 01/19] common/device_tree: handle memory allocation failure in __unflatten_device_tree() Vikram Garhwal
2023-08-22 19:06 ` Julien Grall
2023-08-19 0:28 ` [XEN][PATCH v9 02/19] common/device_tree.c: unflatten_device_tree() propagate errors Vikram Garhwal
2023-08-22 18:11 ` Julien Grall
2023-08-19 0:28 ` [XEN][PATCH v9 03/19] xen/arm/device: Remove __init from function type Vikram Garhwal
2023-08-22 18:59 ` Julien Grall
2023-08-25 0:52 ` Vikram Garhwal [this message]
2023-08-25 8:02 ` Julien Grall
2023-08-19 0:28 ` [XEN][PATCH v9 04/19] common/device_tree: Export __unflatten_device_tree() Vikram Garhwal
2023-08-22 19:05 ` Julien Grall
2023-08-25 0:54 ` Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 05/19] xen/arm: Add CONFIG_OVERLAY_DTB Vikram Garhwal
2023-08-22 19:10 ` Julien Grall
2023-08-25 3:17 ` Vikram Garhwal
2023-08-25 8:05 ` Julien Grall
2023-08-19 0:28 ` [XEN][PATCH v9 06/19] libfdt: Keep fdt functions after init for CONFIG_OVERLAY_DTB Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 07/19] libfdt: overlay: change overlay_get_target() Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 08/19] xen/device-tree: Add device_tree_find_node_by_path() to find nodes in device tree Vikram Garhwal
2023-08-22 19:21 ` Julien Grall
2023-08-25 4:08 ` Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 09/19] xen/iommu: Move spin_lock from iommu_dt_device_is_assigned to caller Vikram Garhwal
2023-08-21 6:53 ` Jan Beulich
2023-08-21 19:41 ` Vikram Garhwal
2023-08-22 19:43 ` Julien Grall
2023-08-25 5:09 ` Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 10/19] xen/iommu: protect iommu_add_dt_device() with dtdevs_lock Vikram Garhwal
2023-08-22 19:47 ` Julien Grall
2023-08-25 4:44 ` Vikram Garhwal
2023-08-25 8:09 ` Julien Grall
2023-08-19 0:28 ` [XEN][PATCH v9 11/19] xen/iommu: Introduce iommu_remove_dt_device() Vikram Garhwal
2023-08-22 20:01 ` Julien Grall
2023-08-19 0:28 ` [XEN][PATCH v9 12/19] xen/smmu: Add remove_device callback for smmu_iommu ops Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 13/19] asm/smp.h: Fix circular dependency for device_tree.h and rwlock.h Vikram Garhwal
2023-08-23 21:41 ` Julien Grall
2023-08-19 0:28 ` [XEN][PATCH v9 14/19] common/device_tree: Add rwlock for dt_host Vikram Garhwal
2023-08-23 22:06 ` Julien Grall
2023-08-25 6:22 ` Vikram Garhwal
2023-08-25 7:52 ` Vikram Garhwal
2023-08-25 8:15 ` Julien Grall
2023-08-19 0:28 ` [XEN][PATCH v9 15/19] xen/arm: Implement device tree node removal functionalities Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 16/19] xen/arm: Implement device tree node addition functionalities Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 17/19] tools/libs/ctrl: Implement new xc interfaces for dt overlay Vikram Garhwal
2023-08-21 16:18 ` Anthony PERARD
2023-08-21 18:53 ` Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 18/19] tools/libs/light: Implement new libxl functions for device tree overlay ops Vikram Garhwal
2023-08-19 0:28 ` [XEN][PATCH v9 19/19] tools/xl: Add new xl command overlay for device tree overlay support Vikram Garhwal
2023-08-23 22:18 ` [XEN][PATCH v9 00/19] dynamic node programming using overlay dtbo Julien Grall
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=ZOf7V_FsJ_CgeL64@amd.com \
--to=vikram.garhwal@amd.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=sstabellini@kernel.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.