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

Re: [PATCH v1 1/3] xen/dom0less: introduce free_phandle in struct kernel_info





On 4/20/26 9:26 AM, Orzel, Michal wrote:
On 16/04/2026 16:20, Oleksii Kurochko wrote:
There are cases where it is necessary to know the next available phandle
number in order to generate phandles for guest device nodes.

When a partial FDT (pfdt) is provided, special care is needed during
initialization of free_phandle, as the pfdt may already contain a dummy
interrupt controller node with a phandle assigned to it.  free_phandle
must therefore be initialized to one past the highest phandle already
present in the pfdt, to avoid collisions.

Since free_phandle may be needed for the very first guest node generated,
I would prefer next_phandle rather than free_phandle given that it always holds
the *next* phandle to be allocated. Free is implied.

I am okay with such naming as I had it before and decided to change at last minute.


domain_handle_dtb_boot_module() is moved earlier in prepare_dtb_domU().
The new call site also aligns better with the existing comment stating
that domain_handle_dtb_boot_module() must be called before the rest of
the device tree is generated.

Introduce get_next_free_phandle() to ensure that phandles allocated for
The name is a bit confusing. It reads as "get the next one after the current
free phandle" but it actually returns the current value of free_phandle and post
increments it. Let's call it alloc_phandle(). This will also make it clear to
use the return value of this function instead of directly kinfo value.

alloc_phandle() sounds good to me.

Thanks.

~ Oleksii



 


Rackspace

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