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

Re: [PATCH v4 26/30] xen/riscv: add minimal stuff to mm.h to build full Xen



> 
> > +        } free;
> > +    } u;
> > +
> > +    union {
> > +        /* Page is in use, but not as a shadow. */
> 
> I'm also pretty sure I asked before what shadow this comment alludes
> to.
I missed your request about 'shadow' before.

The comment arrived from Arm.

I tried to find out the answer by investigation how 'inuse' is used,
and, unfortunately, I couldn't find an answer what 'shadow' alludes to.

> 
> > +/*
> > + * Common code requires get_page_type and put_page_type.
> > + * We don't care about typecounts so we just do the minimum to
> > make it
> > + * happy.
> > + */
> > +static inline int get_page_type(struct page_info *page, unsigned
> > long type)
> > +{
> > +    return 1;
> > +}
> > +
> > +static inline void put_page_type(struct page_info *page)
> > +{
> > +}
> > +
> > +static inline void put_page_and_type(struct page_info *page)
> > +{
> > +    put_page_type(page);
> > +    put_page(page);
> > +}
> > +
> > +/*
> > + * RISC-V does not have an M2P, but common code expects a handful
> > of
> > + * M2P-related defines and functions. Provide dummy versions of
> > these.
> > + */
> > +#define INVALID_M2P_ENTRY        (~0UL)
> > +#define SHARED_M2P_ENTRY         (~0UL - 1UL)
> > +#define SHARED_M2P(_e)           ((_e) == SHARED_M2P_ENTRY)
> > +
> > +#define set_gpfn_from_mfn(mfn, pfn) do { (void)(mfn), (void)(pfn);
> > } while (0)
> > +#define mfn_to_gfn(d, mfn) ((void)(d), _gfn(mfn_x(mfn)))
> > +
> > +#define PDX_GROUP_SHIFT (16 + 5)
> 
> Where are these magic numbers coming from? None of the other three
> architectures use literal numbers here, thus making clear what
> values are actually meant. If you can't use suitable constants,
> please add a comment.
This numbers are incorrect for RISC-V, it should be 12 + 9 ( PAGE_SHIFT
+ VPN_BITS ).
I did some comparision of how some macros are defined in PPC and missed
to update that.

~ Oleksii




 


Rackspace

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