Re: [PATCH][RFC] swsusp: speed up image restoring on x86-64
From: Pavel Machek
Date: Fri Jan 21 2005 - 05:26:12 EST
Hi!
> > Well, I know that current code works. It was produced by C compiler,
> > btw. Now, new code works for you, but it was not in kernel for 4
> > releases, and... this code is pretty subtle.
>
> Now, I'm confused. :-) It's roughly this:
>
> struct pbe *pbe = pagedir_nosave, *end;
> unsigned n = nr_copy_pages;
> if (n) {
> end = pbe + n;
> do {
> memcpy((void *)pbe->orig_address, (void *)pbe->address, PAGE_SIZE);
> pbe++;
> } while (pbe < end);
> }
>
> where memcpy() is of course a hand-written inline that includes the cr3 manipulation,
> and pbe, end, n are registers.
For example it may not use any variable in memory, and may not use
stack, as memory changes under its hands. Plus assembly is always
subtle ;-).
Pavel
--
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/