Hi Marco, > -----Original Message----- > From: Xen-devel <[email protected]> On Behalf Of > Marco Solieri > Sent: Saturday, March 5, 2022 1:47 AM > To: [email protected] > Cc: Marco Solieri <[email protected]>; Andrew Cooper > <[email protected]>; George Dunlap <[email protected]>; > Jan Beulich <[email protected]>; Julien Grall <[email protected]>; Stefano > Stabellini <[email protected]>; Wei Liu <[email protected]>; Marco Solieri > <[email protected]>; Andrea Bastoni > <[email protected]>; Luca Miccio <[email protected]> > Subject: [PATCH 10/36] xen/arch: check color selection function > > From: Luca Miccio <[email protected]> > > Dom0 color configuration is parsed in the Xen command line. Add an > helper function to check the user selection. If no configuration is > provided by the user, all the available colors supported by the > hardware will be assigned to dom0. > > Signed-off-by: Luca Miccio <[email protected]> > Signed-off-by: Marco Solieri <[email protected]>
For the first 10 commits: Tested-by: Henry Wang <[email protected]> > --- > xen/arch/arm/coloring.c | 17 +++++++++++++++++ > xen/arch/arm/include/asm/coloring.h | 8 ++++++++ > 2 files changed, 25 insertions(+) > > diff --git a/xen/arch/arm/coloring.c b/xen/arch/arm/coloring.c > index f6e6d09477..382d558021 100644 > --- a/xen/arch/arm/coloring.c > +++ b/xen/arch/arm/coloring.c > @@ -179,6 +179,23 @@ uint32_t *setup_default_colors(uint32_t *col_num) > return NULL; > } > > +bool check_domain_colors(struct domain *d) > +{ > + int i; > + bool ret = false; > + > + if ( !d ) > + return ret; > + > + if ( d->max_colors > max_col_num ) > + return ret; > + > + for ( i = 0; i < d->max_colors; i++ ) > + ret |= (d->colors[i] > (max_col_num - 1)); > + > + return !ret; > +} > + > bool __init coloring_init(void) > { > int i; > diff --git a/xen/arch/arm/include/asm/coloring.h > b/xen/arch/arm/include/asm/coloring.h > index 8f24acf082..fdd46448d7 100644 > --- a/xen/arch/arm/include/asm/coloring.h > +++ b/xen/arch/arm/include/asm/coloring.h > @@ -26,8 +26,16 @@ > #define MAX_COLORS_CELLS 4 > > #ifdef CONFIG_COLORING > +#include <xen/sched.h> > + > bool __init coloring_init(void); > > +/* > + * Check colors of a given domain. > + * Return true if check passed, false otherwise. > + */ > +bool check_domain_colors(struct domain *d); > + > /* > * Return an array with default colors selection and store the number of > * colors in @param col_num. The array selection will be equal to the dom0 > -- > 2.30.2 >
