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

Re: [Xen-devel] [PATCH 20/34] x86/mtrr: move is_var_mtrr_overlapped



On Tue, Aug 21, 2018 at 01:58:51AM -0600, Jan Beulich wrote:
> >>> On 17.08.18 at 17:12, <wei.liu2@xxxxxxxxxx> wrote:
> > Move it to x86 generic code. While at it, use proper boolean type.
> > 
> > Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
> 
> Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
> with a couple of cosmetic adjustments beyond the bool
> conversion you've already done:
> 
> > +bool is_var_mtrr_overlapped(const struct mtrr_state *m)
> > +{
> > +    unsigned int seg, i;
> > +    unsigned int num_var_ranges = MASK_EXTR(m->mtrr_cap, MTRRcap_VCNT);
> > +
> > +    for ( i = 0; i < num_var_ranges; i++ )
> > +    {
> > +        uint64_t base1 = m->var_ranges[i].base >> PAGE_SHIFT;
> > +        uint64_t mask1 = m->var_ranges[i].mask >> PAGE_SHIFT;
> 
> Here and below I wonder whether PFN_DOWN() wouldn't be
> appropriate to use. I'll leave that up to you though.
> 

Since base and mask aren't really PFN so I think it would be more
appropriate to leave them as-is.

I have fixed up the other two issues you mentioned.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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