All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v8 3/3] tools/libxc: use superpages during restore of HVM guest
Date: Fri, 1 Sep 2017 10:37:36 +0200	[thread overview]
Message-ID: <20170901083736.GC21663@aepfle.de> (raw)
In-Reply-To: <20170901082149.6355-4-olaf@aepfle.de>


[-- Attachment #1.1: Type: text/plain, Size: 1074 bytes --]

On Fri, Sep 01, Olaf Hering wrote:

> +static int x86_hvm_populate_pfns(struct xc_sr_context *ctx, unsigned count,

> +            /*
> +             * If this next pfn is within another 1GB superpage it is required
> +             * to scan the entire previous superpage because there might be
> +             * holes between max_pfn and the end of the superpage.
> +             */
> +            if ( idx1G_prev != idx1G )
> +            {
> +                order = SUPERPAGE_1GB_SHIFT;
> +                max_pfn = (((max_pfn >> order) + 1) << order) - 1;
> +            }
> +            if ( x86_hvm_punch_hole(ctx, max_pfn) == false )


And thinking about this part: with this variant it is still possible
that Over-allocation happens. If the previous pfn was within a 2MB
range, and this pfn is in another 2MB range, then the hole after max_pfn
would not be covered. This part needs an 'else' with
SUPERPAGE_2MB_SHIFT.

This "reset to max" may trigger a bug in xc_sr_test_and_clear_bit(). It
has to check the size of the bitmap, just as xc_sr_test_bit() does.

Olaf

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

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

      reply	other threads:[~2017-09-01  8:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-01  8:21 [PATCH v8 0/3] tools/libxc: use superpages Olaf Hering
2017-09-01  8:21 ` [PATCH v8 1/3] tools/libxc: move SUPERPAGE macros to common header Olaf Hering
2017-09-01  8:21 ` [PATCH v8 2/3] tools/libxc: add API for bitmap access for restore Olaf Hering
2017-09-01  8:21 ` [PATCH v8 3/3] tools/libxc: use superpages during restore of HVM guest Olaf Hering
2017-09-01  8:37   ` Olaf Hering [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170901083736.GC21663@aepfle.de \
    --to=olaf@aepfle.de \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.