All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Pavel Machek <pavel@ucw.cz>
Cc: discuss@x86-64.org, pm list <linux-pm@lists.linux-foundation.org>,
	Nigel Cunningham <nigel@nigel.suspend2.net>
Subject: Re: [RFC][PATCH -mm 4/4] Hibernation: Pass CR3 value in hibernation header on x86_64
Date: Tue, 21 Aug 2007 16:46:20 +0200	[thread overview]
Message-ID: <200708211646.21192.rjw@sisk.pl> (raw)
In-Reply-To: <20070821080118.GH7258@elf.ucw.cz>

On Tuesday, 21 August 2007 10:01, Pavel Machek wrote:
> Hi!
> 
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > Since we already pass the address of restore_registers() in the image header,
> > we can also pass the value of the CR3 register from before the hibernation in
> > the same way.  This will allow us to avoid using init_level4_pgt page tables
> > during the restore.
> > 
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> 
> > @@ -283,7 +290,8 @@ int arch_hibernation_header_save(void *a
> >  	if (max_size < sizeof(struct restore_data_record))
> >  		return -EOVERFLOW;
> >  	rdr->jump_address = restore_jump_address;
> > -	rdr->control = (restore_jump_address ^ RESTORE_MAGIC);
> > +	rdr->cr3 = restore_cr3;
> > +	rdr->control = (restore_jump_address ^ (restore_cr3 ^ RESTORE_MAGIC));
> >  	return 0;
> 
> Does control want to be renamed as "crc"?

I think we should use CRC here, but I need to figure out how to get the
dependencies right.

> Or perphaps we want to just store MAGIC there, w/o any obfuscation, since
> obfuscation does not really buy us anything?

Well, the idea is to avoid using corrupted cr3 value or the jump address ...

Greetings,
Rafael

      reply	other threads:[~2007-08-21 14:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-20 13:10 [RFC][PATCH -mm 0/4] Hibernation: Arbitrary boot kernel support on x86_64 Rafael J. Wysocki
2007-08-20 13:11 ` [RFC][PATCH -mm 1/4] " Rafael J. Wysocki
2007-08-21  7:57   ` Pavel Machek
2007-08-21 14:37     ` [discuss] " Rafael J. Wysocki
2007-08-21 19:30       ` Rafael J. Wysocki
2007-08-21 20:47         ` Rafael J. Wysocki
2007-08-20 13:16 ` [RFC][PATCH -mm 2/4] Hibernation: Turn on ACPI during restore if necessary Rafael J. Wysocki
2007-08-21  7:57   ` Pavel Machek
2007-08-21 14:39     ` Rafael J. Wysocki
2007-08-21 23:36       ` Pavel Machek
2007-08-22 20:47         ` [discuss] " Rafael J. Wysocki
2007-08-20 13:17 ` [RFC][PATCH -mm 3/4] Hibernation: Use temporary kernel text mapping during restore on x86_64 Rafael J. Wysocki
2007-08-21  7:59   ` Pavel Machek
2007-08-21 14:42     ` Rafael J. Wysocki
2007-08-20 13:18 ` [RFC][PATCH -mm 4/4] Hibernation: Pass CR3 value in hibernation header " Rafael J. Wysocki
2007-08-21  8:01   ` Pavel Machek
2007-08-21 14:46     ` Rafael J. Wysocki [this message]

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=200708211646.21192.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=discuss@x86-64.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=nigel@nigel.suspend2.net \
    --cc=pavel@ucw.cz \
    /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.