On 23.04.2025 13:22, Julien Grall wrote: > On 22/04/2025 22:54, dm...@proton.me wrote: >> --- a/xen/common/domain.c >> +++ b/xen/common/domain.c >> @@ -66,6 +66,57 @@ DEFINE_RCU_READ_LOCK(domlist_read_lock); >> static struct domain *domain_hash[DOMAIN_HASH_SIZE]; >> struct domain *domain_list; >> >> +/* Domain ID allocator */ >> +static unsigned int domid_last; >> + >> +static inline bool is_free_domid(domid_t dom) >> +{ >> + struct domain *d = rcu_lock_domain_by_id(dom); >> + >> + if ( d ) >> + rcu_unlock_domain(d); >> + >> + return !d; >> +} >> + >> +/* >> + * Allocate new domain ID based on the hint. > > Maybe clarify this should not be used for system domains?
But those don't have their IDs allocated; they're pre-determined and outside of the range available for allocation. Jan