[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH 01/12] xen: introduce xen_dom_flags
On 15.04.2020 03:02, Stefano Stabellini wrote: > We are passing an extra special boolean flag at domain creation to > specify whether we want to the domain to be privileged (i.e. dom0) or > not. Another flag will be introduced later in this series. > > Introduce a new struct xen_dom_flags and move the privileged flag to it. > Other flags will be added to struct xen_dom_flags. I'm unsure whether introducing a 2nd structure is worth it here. We could as well define some internal-use-only flags for struct xen_domctl_createdomain's respective field. > --- a/xen/arch/x86/domain.c > +++ b/xen/arch/x86/domain.c > @@ -529,7 +529,8 @@ static bool emulation_flags_ok(const struct domain *d, > uint32_t emflags) > } > > int arch_domain_create(struct domain *d, > - struct xen_domctl_createdomain *config) > + struct xen_domctl_createdomain *config, > + struct xen_dom_flags *flags) const (also elsewhere)? > --- a/xen/arch/x86/setup.c > +++ b/xen/arch/x86/setup.c > @@ -706,6 +706,7 @@ void __init noreturn __start_xen(unsigned long mbi_p) > .max_maptrack_frames = -1, > }; > const char *hypervisor_name; > + struct xen_dom_flags flags = { !pv_shim }; Here and elsewhere please use field designators right away, even if there's only a single field now. > @@ -363,7 +363,7 @@ struct domain *domain_create(domid_t domid, > ASSERT(is_system_domain(d) ? config == NULL : config != NULL); > > /* Sort out our idea of is_control_domain(). */ > - d->is_privileged = is_priv; > + d->is_privileged = flags ? flags->is_priv : false; Stray double blanks. > --- a/xen/common/domctl.c > +++ b/xen/common/domctl.c > @@ -364,6 +364,7 @@ long do_domctl(XEN_GUEST_HANDLE_PARAM(xen_domctl_t) > u_domctl) > bool_t copyback = 0; > struct xen_domctl curop, *op = &curop; > struct domain *d; > + struct xen_dom_flags flags ={ false }; Missing blank. > --- a/xen/include/xen/domain.h > +++ b/xen/include/xen/domain.h > @@ -63,8 +63,13 @@ void arch_vcpu_destroy(struct vcpu *v); > int map_vcpu_info(struct vcpu *v, unsigned long gfn, unsigned offset); > void unmap_vcpu_info(struct vcpu *v); > > +struct xen_dom_flags { > + bool is_priv; Use a single bit bitfield instead? May even want to consider passing this struct by value then. Jan
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |