xen/domain: Introduce arch_init_idle_domain()

The idle domain causes a large amount of complexity in domain_create() because
of x86's need to initialise d->arch.ctxt_switch in arch_domain_create().

In order to address this, introduce an optional hook to perform extra
initialisation of the idle domain.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Andrew Cooper committed 2024-07-31 11:14:50 +01:00
1 parent 6979e17b3f
commit 694ce812e7
2 files changed
+8

No files matched your search

+3
View File
@@ -686,6 +686,9 @@ struct domain *domain_create(domid_t domid,
rangeset_domain_initialise(d);
if ( is_idle_domain(d) )
arch_init_idle_domain(d);
/* DOMID_{XEN,IO,etc} (other than IDLE) are sufficiently constructed. */
if ( is_system_domain(d) && !is_idle_domain(d) )
return d;
+5
View File
@@ -728,6 +728,11 @@ struct domain *domain_create(domid_t domid,
struct xen_domctl_createdomain *config,
unsigned int flags);
#ifndef arch_init_idle_domain
/* Optional, if there's any construction necessary for DOMID_IDLE */
static inline void arch_init_idle_domain(struct domain *d) {}
#endif
/*
* rcu_lock_domain_by_id() is more efficient than get_domain_by_id().
* This is the preferred function if the returned domain reference
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.