All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kiper <daniel.kiper@oracle.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5] x86/setup: properly update PTEs if src/dst overlaps when relocating Xen image
Date: Thu, 19 Apr 2018 11:28:31 +0200	[thread overview]
Message-ID: <20180419092831.GD6312@olila.local.net-space.pl> (raw)
In-Reply-To: <5AD76BB502000078001BC74D@prv1-mh.provo.novell.com>

On Wed, Apr 18, 2018 at 10:00:53AM -0600, Jan Beulich wrote:
> >>> On 18.04.18 at 12:26, <daniel.kiper@oracle.com> wrote:
> > @@ -1019,6 +1020,12 @@ void __init noreturn __start_xen(unsigned long mbi_p)
> >              bootsym(trampoline_xen_phys_start) = e;
> >
> >              /*
> > +             * All PTEs with PFNs above pte_update_limit
> > +             * were updated earlier. Skip them.
> > +             */
> > +            pte_update_limit = PFN_DOWN(e + XEN_IMG_OFFSET);
>
> I don't understand the comment: No PTE updates happen before this point
> afaict. It is just that PTEs pointing above that address are not candidates
> for relocation. I think the comment should at least mention the overlap
> scenario your trying to deal with, with the important point being that there
> may actually be PTEs pointing into [e, e + XEN_IMG_OFFSET).

What do you think about that:

  All PTEs pointing above that address are not candidates for relocation.
  Due to possibility of partial overlap of the end of source image and the
  beginning of region for destination image some PTEs may point to
  addresses in range [e, e + XEN_IMG_OFFSET).

> The actual code adjustments look fine to me now, albeit I wonder whether
> >= wouldn't be more appropriate to use.

You are right. Currently first 2 MiB mapping of the image, in the worst case,
can be relocated twice. I will fix this.

Daniel

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

  reply	other threads:[~2018-04-19  9:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-18 10:26 [PATCH v5] x86/setup: properly update PTEs if src/dst overlaps when relocating Xen image Daniel Kiper
2018-04-18 16:00 ` Jan Beulich
2018-04-19  9:28   ` Daniel Kiper [this message]
2018-04-19 12:05     ` Jan Beulich

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=20180419092831.GD6312@olila.local.net-space.pl \
    --to=daniel.kiper@oracle.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=xen-devel@lists.xenproject.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.