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

Re: [Xen-devel] [PATCH v5] x86/setup: properly update PTEs if src/dst overlaps when relocating Xen image

On Wed, Apr 18, 2018 at 10:00:53AM -0600, Jan Beulich wrote:
> >>> On 18.04.18 at 12:26, <daniel.kiper@xxxxxxxxxx> 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.


Xen-devel mailing list



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