All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: bbpetkov@yahoo.de
Cc: Pavel Machek <pavel@suse.cz>, linux-kernel@vger.kernel.org
Subject: Re: [RFC] swap image signature check upon resume
Date: Sat, 8 Dec 2007 23:50:33 +0100	[thread overview]
Message-ID: <200712082350.33626.rjw@sisk.pl> (raw)
In-Reply-To: <20071208113306.GA7573@gollum.tnic>

On Saturday, 8 of December 2007, Borislav Petkov wrote:
> On Fri, Dec 07, 2007 at 09:19:09PM +0100, Rafael J. Wysocki wrote:
> 
> ...
> 
> > > > Well, there's a patchset in the current mainline that allows you to use
> > > > arbitrary (sufficiently new) kernel to load the image and then restore the
> > > > image kernel.  So, you can hibernate 2.6.24-rc3 and use 2.6.24-rc2 to restore
> > > > it, for example.
> > > > 
> > > > I'm going to do that for i386 too.
> > > right, this is d307c4a8e826c44f9633bd3f7e60d0491e7d885a (Hibernation: Arbitrary
> > > boot kernel support - generic code), i should've seen that. What's the status of
> > > those bits, from a quick scan it seems they need some rewiring (Kconfig, e.g.
> > > CONFIG_ARCH_HIBERNATION_HEADER etc..) and arch-specific save and restore
> > > functions?
> > 
> > No, this code is fully functional. :-)
> > 
> > The arch save and restore functions are in arch/x86/kernel/suspend_64.c .
> > 
> > As I said, i386 is not yet supported.
> 
> nice, holler if you need a tester when you have some prototypes ready. By the way,
> what do you do when the suspend image header mismatches and it is unsafe to continue booting?

If the image header doesn't match, we don't load it and return an error code,
which usually results in the boot kernel continuing to boot.

> Also, there's a freakishly long comment in suspend_64.c, might wanna shorten it:

Ah, OK.

I'll take your patch for 2.6.25, thanks.


> Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de>
> 
> diff --git a/arch/x86/kernel/suspend_64.c b/arch/x86/kernel/suspend_64.c
> index db284ef..0a23e5f 100644
> --- a/arch/x86/kernel/suspend_64.c
> +++ b/arch/x86/kernel/suspend_64.c
> @@ -118,7 +118,12 @@ void fix_processor_context(void)
>  	int cpu = smp_processor_id();
>  	struct tss_struct *t = &per_cpu(init_tss, cpu);
>  
> -	set_tss_desc(cpu,t);	/* This just modifies memory; should not be necessary. But... This is necessary, because 386 hardware has concept of busy TSS or some similar stupidity. */
> +	/*
> +	 * This just modifies memory; should not be necessary. But... This
> +	 * is necessary, because 386 hardware has concept of busy TSS or some
> +	 * similar stupidity.
> +	 */
> +	set_tss_desc(cpu,t);
>  
>  	cpu_gdt(cpu)[GDT_ENTRY_TSS].type = 9;
>  
> @@ -138,7 +143,6 @@ void fix_processor_context(void)
>                  loaddebug(&current->thread, 6);
>                  loaddebug(&current->thread, 7);
>  	}
> -
>  }
>  
>  #ifdef CONFIG_HIBERNATION
> 

  reply	other threads:[~2007-12-08 22:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-06 21:13 [RFC] swap image signature check upon resume Borislav Petkov
2007-12-06 21:46 ` Rafael J. Wysocki
2007-12-07  7:12   ` Borislav Petkov
2007-12-07 20:19     ` Rafael J. Wysocki
2007-12-08 11:33       ` Borislav Petkov
2007-12-08 22:50         ` Rafael J. Wysocki [this message]
2007-12-09  6:55           ` Borislav Petkov
2007-12-09 14:27             ` Rafael J. Wysocki
2007-12-09 14:32               ` Rafael J. Wysocki
2007-12-09 16:09               ` Borislav Petkov
2007-12-09 21:46                 ` Rafael J. Wysocki
2007-12-10  4:51                   ` Borislav Petkov

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=200712082350.33626.rjw@sisk.pl \
    --to=rjw@sisk.pl \
    --cc=bbpetkov@yahoo.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.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.