[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [PATCH 04/10] viridian: use hypercall_vpmask in hvcall_ipi()



> -----Original Message-----
> From: Jan Beulich <jbeulich@xxxxxxxx>
> Sent: 12 November 2020 08:50
> To: Paul Durrant <paul@xxxxxxx>
> Cc: Paul Durrant <pdurrant@xxxxxxxxxx>; Wei Liu <wl@xxxxxxx>; Andrew Cooper
> <andrew.cooper3@xxxxxxxxxx>; Roger Pau Monné <roger.pau@xxxxxxxxxx>; 
> xen-devel@xxxxxxxxxxxxxxxxxxxx
> Subject: Re: [PATCH 04/10] viridian: use hypercall_vpmask in hvcall_ipi()
> 
> On 11.11.2020 21:07, Paul Durrant wrote:
> > --- a/xen/arch/x86/hvm/viridian/viridian.c
> > +++ b/xen/arch/x86/hvm/viridian/viridian.c
> > @@ -533,6 +533,21 @@ static bool vpmask_test(struct hypercall_vpmask 
> > *vpmask, unsigned int vp)
> >      return test_bit(vp, vpmask->mask);
> >  }
> >
> > +static unsigned int vpmask_first(struct hypercall_vpmask *vpmask)
> > +{
> > +    return find_first_bit(vpmask->mask, HVM_MAX_VCPUS);
> > +}
> > +
> > +static unsigned int vpmask_next(struct hypercall_vpmask *vpmask, unsigned 
> > int vp)
> > +{
> > +    return find_next_bit(vpmask->mask, HVM_MAX_VCPUS, vp + 1);
> 
> Perhaps again assert on vp's range?
> 

Ok.

> > +}
> > +
> > +#define for_each_vp(vpmask, vp) \
> > +   for ((vp) = vpmask_first(vpmask); \
> > +        (vp) < HVM_MAX_VCPUS; \
> > +        (vp) = vpmask_next(vpmask, vp))
> 
> Nit again: Missing blanks here and ...

Oh yes.

> 
> > @@ -669,17 +693,20 @@ static int hvcall_ipi(union hypercall_input *input,
> >      if ( vector < 0x10 || vector > 0xff )
> >          return -EINVAL;
> >
> > -    for_each_vcpu ( currd, v )
> > +    vpmask_empty(vpmask);
> > +    for (vp = 0; vp < 64; vp++)
> 
> ... here. I also wonder if the literal 64 couldn't be expressed in
> some suitable way.
> 

Ok. I'll see if I can suitably macrotize it.

  Paul

> Jan




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.