linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Patrick Mochel <mochel@osdl.org>
Cc: Nigel Cunningham <ncunningham@clear.net.nz>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: SWSUSP Discontiguous pagedir patch
Date: Mon, 3 Mar 2003 13:30:29 +0100	[thread overview]
Message-ID: <20030303123029.GC20929@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <Pine.LNX.4.33.0303021731510.1120-100000@localhost.localdomain>

Hi!

> > Thus, I still think we can go with the patch I submitted before. I've
> > rediffed it against 2.5.63 (less the bits already applied).
> 
> I've spent the last week reading, reviewing, and rewriting major portions 
> of swsusp. I've actually been reasonably impressed, once I was able to get 
> the code into a much more readable state. 

:-).

> > diff -ruN linux-2.5.63/arch/i386/kernel/suspend.c linux-2.5.63-01/arch/i386/kernel/suspend.c
> > --- linux-2.5.63/arch/i386/kernel/suspend.c	2003-02-20 08:25:26.000000000 +1300
> > +++ linux-2.5.63-01/arch/i386/kernel/suspend.c	2003-02-20 08:27:36.000000000 +1300
> 
> Thank you for putting this back in C, it's much appreciated. 

Actually, it can not be put back in C. Manipulating stack pointer from
gcc inline assembly is just undefined. Its back in C so we can edit
it, but it needs to get back to assembly before merging with Linus.

> > +	for (loop=0; loop < nr_copy_pages; loop++) {
> > +		/* You may not call something (like copy_page) here: see above */
> > +		for (loop2=0; loop2 < PAGE_SIZE; loop2++) {
> > +			*(((char *)(PAGEDIR_ENTRY(pagedir_nosave,loop)->orig_address))+loop2) =
> > +				*(((char *)(PAGEDIR_ENTRY(pagedir_nosave,loop)->address))+loop2);
> > +			__flush_tlb();
> > +		}
> > +	}
> 
> This is better done as 
> 
> 	for (loop = 0; loop < nr_copy_pagse; loop++) {
> 		memcpy((char *)pagedir_nosave[loop].orig_address,
> 		       (char *)pagedir_nosave[loop].address,
> 		       PAGE_SIZE);
> 		__flush_tlb();
> 	}

Hehe, try it.

You may not do function call at this point, because you are
overwriting your stack. See mails with Andi Kleen. This *needs* to be
in assembly. 

> Is __flush_tlb() really necessary? 

Its there to prevent Heisenbugs.
								Pavel
-- 
Horseback riding is like software...
...vgf orggre jura vgf serr.

  parent reply	other threads:[~2003-03-03 12:20 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1045784829.3821.10.camel@laptop-linux.cunninghams>
     [not found] ` <20030223223757.GA120@elf.ucw.cz>
     [not found]   ` <1046136752.1784.15.camel@laptop-linux.cunninghams>
     [not found]     ` <20030227132024.GB27084@atrey.karlin.mff.cuni.cz>
2003-02-27 18:42       ` SWSUSP Discontiguous pagedirs Nigel Cunningham
2003-03-01  4:22       ` SWSUSP Discontiguous pagedir patch Nigel Cunningham
2003-03-02 23:55         ` Patrick Mochel
2003-03-03  2:06           ` Nigel Cunningham
2003-03-03  2:31           ` Nigel Cunningham
2003-03-03 12:30           ` Pavel Machek [this message]
2003-03-04 20:36             ` Patrick Mochel
2003-03-05 20:50               ` Pavel Machek
2003-03-05 21:52                 ` Linux vs Windows temperature anomaly Jonathan Lundell
2003-03-05 23:11                   ` Herman Oosthuysen
2003-03-05 23:38                     ` Con Kolivas
2003-03-05 23:50                       ` Russell King
2003-03-06  0:29                         ` Ed Sweetman
2003-03-06  0:47                           ` Trever L. Adams
2003-03-06  9:45                             ` Russell King
2003-03-06  1:58                           ` Jonathan Lundell
2003-03-06  7:18                       ` Corvus Corax
2003-03-06  7:57                         ` Ed Sweetman
2003-03-06  8:18                           ` Corvus Corax
2003-03-06  8:58                             ` Ed Sweetman
2003-03-06 15:41                               ` Jesse Pollard
2003-03-06 14:27                         ` Jesse Pollard
2003-03-06  2:57                   ` David Rees
2003-03-06  6:12                   ` Matthias Schniedermeyer
2003-03-06 16:07                     ` Jonathan Lundell
2003-03-07  0:40                   ` Horst von Brand
2003-03-05 18:02           ` SWSUSP Discontiguous pagedir patch Pavel Machek
2003-03-07 17:14             ` Patrick Mochel
2003-03-07 20:27               ` Pavel Machek
2003-03-09 19:39                 ` Benjamin Herrenschmidt
2003-03-09 20:12                   ` Pavel Machek
2003-03-10 16:49                 ` Patrick Mochel
2003-03-10 19:23                   ` Pavel Machek
2003-03-10 19:05                     ` Patrick Mochel
2003-03-10 22:17                     ` Nigel Cunningham
2003-03-10 23:20                       ` Pavel Machek
2003-03-07 20:36               ` Pavel Machek
2003-03-10 16:51                 ` Patrick Mochel
2003-03-10 19:12                   ` Pavel Machek
2003-03-10 18:59                     ` Patrick Mochel
2003-03-07 20:41               ` Pavel Machek

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=20030303123029.GC20929@atrey.karlin.mff.cuni.cz \
    --to=pavel@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=ncunningham@clear.net.nz \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).