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

Re: [Xen-devel] [PATCH v1] tools/libxc: use superpages during restore of HVM guest



On Fri, Aug 04, 2017 at 07:43:47AM +0200, Olaf Hering wrote:
> On Wed, Aug 02, Olaf Hering wrote:
> 
> > +++ b/tools/libxc/xc_sr_restore_x86_hvm.c
> 
> > +#define SUPERPAGE_2MB_SHIFT   9
> > +#define SUPERPAGE_2MB_NR_PFNS (1UL << SUPERPAGE_2MB_SHIFT)
> > +#define SUPERPAGE_1GB_SHIFT   18
> > +#define SUPERPAGE_1GB_NR_PFNS (1UL << SUPERPAGE_1GB_SHIFT)
> 
> I think these can be moved to a header file. xc_dom_x86.c and
> xc_sr_restore_x86_hvm.c use xc_dom.h.
> 
> > +static int x86_hvm_populate_pfns(struct xc_sr_context *ctx, unsigned count,
> > +                                 const xen_pfn_t *original_pfns,
> > +                                 const uint32_t *types)
> > +{
> > +    xc_interface *xch = ctx->xch;
> > +    xen_pfn_t min_pfn = original_pfns[0], max_pfn = original_pfns[0];
> > +    unsigned i;
> > +    int rc = -1;
> > +
> > +    for ( i = 0; i < count; ++i )
> > +    {
> > +        if (original_pfns[i] < min_pfn)
> > +            min_pfn = original_pfns[i];
> > +        if (original_pfns[i] > max_pfn)
> > +            max_pfn = original_pfns[i];
> > +        if ( (types[i] != XEN_DOMCTL_PFINFO_XTAB &&
> > +              types[i] != XEN_DOMCTL_PFINFO_BROKEN) &&
> > +             !pfn_is_populated(ctx, original_pfns[i]) )
> 
> Are these types used at all for a HVM domU? Otherwise this condition can
> be simplified to just check the populated state.

I *think* XTAB is PV only but BROKEN applies to both PV and HVM.

Maybe someone more familiar with the bit can chime in to provide more
information.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

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