On 24.07.2025 18:23, Andrew Cooper wrote: > Right now, domains start with no colouring information and depend on a > XEN_DOMCTL_set_llc_colors(nr=0) hypercall in order to get default colours. > > This in turn forces the toolstack to make a hypercall for all VMs even those > without colouring configured, and to ignore errors if Xen doesn't have > colouring active. > > Introduce domain_llc_coloring_init(), replacing domain_set_default_colors(), > and call it during the trivial initialisation in domain_create(). Leave two > comments explaining the positioning. > > The -EEXISTs condition in domain_set_llc_colors() needs adjusting as a > consequence, but that's easy enough to keep working as before. > > Fixes: 6cdea3444eaf ("xen/arm: add Dom0 cache coloring support") > Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>
Reviewed-by: Jan Beulich <jbeul...@suse.com> preferably with ... > --- a/xen/common/domain.c > +++ b/xen/common/domain.c > @@ -878,6 +878,12 @@ struct domain *domain_create(domid_t domid, > rwlock_init(&d->pci_lock); > #endif > > + /* > + * Doesn't allocate memory itself, but does set up data relevant for > + * memory allocations. > + */ > + domain_llc_coloring_init(d); ... the word "default" added to the comment here. Jan