Re: [PATCH][RFC] swsusp: speed up image restoring on x86-64

From: Rafael J. Wysocki (rjw_at_sisk.pl)
Date: 01/21/05

  • Next message: Ingo Molnar: "Re: seccomp for 2.6.11-rc1-bk8"
    To: Pavel Machek <pavel@suse.cz>
    Date:	Fri, 21 Jan 2005 13:43:40 +0100
    
    

    On Friday, 21 of January 2005 11:06, Pavel Machek wrote:
    > 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.

    Which is not a big problem on x86-64. :-)

    > Plus assembly is always subtle ;-).

    And that's what makes it interesting.

    Greets,
    RJW

    -- 
    - Would you tell me, please, which way I ought to go from here?
    - That depends a good deal on where you want to get to.
    		-- Lewis Carroll "Alice's Adventures in Wonderland"
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Ingo Molnar: "Re: seccomp for 2.6.11-rc1-bk8"

    Relevant Pages

    • Re: [PATCH][RFC] swsusp: speed up image restoring on x86-64
      ... > and pbe, end, n are registers. ... as memory changes under its hands. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [discuss] booting a kernel compiled with -mregparm=0
      ... > this one) and even if GCC produced valid code by miracle, ... That's the default for a 'C' compiler (not to pass parameters ... This forced some parameters to be passed in registers, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Semaphore assembly-code bug
      ... registers (ie the old code often caused gcc to first generate the value ... generating it into %eax in the first place). ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • NMI lockup in fib_sync_down
      ... NMI Watchdog detected LOCKUP on CPU1, eip c026a8d4, registers: ... inlined prefetch function (offsets do not match the registers ... extern inline void prefetch ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: Being more anal about iospace accesses..
      ... No longer true. ... that large silicon manufacturer has released with 32-bit wide registers ... If clauses will still be needed, the only difference is that instead ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)