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

Re: [XEN][PATCH v9 00/19] dynamic node programming using overlay dtbo



On 19/08/2023 01:28, Vikram Garhwal wrote:
Hi,

Hi Vikram,

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

Do you have any pointer where one can find more details about the dtbo? How can it be created? What's the internal device-tree format?


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

The main purpose of this series to address first part of the dynamic programming
i.e. making Xen aware of new device tree node which means updating the dt_host
with overlay node information. Here we are adding/removing node from dt_host,
and checking/set IOMMU and IRQ permission but never mapping them to any domain.
Right now, mapping/Un-mapping will happen only when a new domU is
created/destroyed using "xl create".

I am ok with this restriction. However are you planning to handle it because this goes out of tech preview?

The reason I am asking is, AFAICT, your code will not even look at the xen,passthrough (which is used to indicate that only permissions will be given). So if the ABI becomes stable, then we would need to invent a new property to say "Please map the device resources".

I would rather want the behavior of the dt-overlay to act the same as for the host DT. IOW, the device would be mapped to dom0 by default unless the propery "xen,passthrough" is added.

I would be OK to say that we don't currently support DT overlay if the property "xen,passthrough" is not present in the top-level node.

Cheers,

--
Julien Grall



 


Rackspace

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