lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200708252232.43478.rjw@sisk.pl>
Date:	Sat, 25 Aug 2007 22:32:42 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	Andrew Morton <akpm@...ux-foundation.org>
Cc:	Andi Kleen <ak@...e.de>, LKML <linux-kernel@...r.kernel.org>,
	Pavel Machek <pavel@....cz>,
	pm list <linux-pm@...ts.linux-foundation.org>
Subject: Re: [PATCH -mm 2/2] Hibernation: Arbitrary boot kernel support on x86_64

On Saturday, 25 August 2007 01:23, Andrew Morton wrote:
> On Fri, 24 Aug 2007 12:11:54 +0200
> "Rafael J. Wysocki" <rjw@...k.pl> wrote:
> 
> > Index: linux-2.6.23-rc3/include/asm-x86_64/suspend.h
> > ===================================================================
> > --- linux-2.6.23-rc3.orig/include/asm-x86_64/suspend.h	2007-08-21 20:36:49.000000000 +0200
> > +++ linux-2.6.23-rc3/include/asm-x86_64/suspend.h	2007-08-21 20:37:47.000000000 +0200
> > @@ -43,4 +43,10 @@ extern void fix_processor_context(void);
> >  /* routines for saving/restoring kernel state */
> >  extern int acpi_save_state_mem(void);
> >  
> > +#define ARCH_HAS_HIBERNATION_HEADER
> 
> The preferred way of doing this is via Kconfig, please.  ie: add a
> CONFIG_HIBERNATION_HEADER to arch/x86_64/Kconfig.

OK

> > +
> > +/* arch/x86_64/kernel/suspend.c */
> > +extern int arch_hibernation_header_save(void *addr, unsigned int max_size);
> > +extern int arch_hibernation_header_restore(void *addr);
> 
> Given that these are called from non-arch-specific code, they must have the
> same signature across all architectures.  So there's no point in putting
> the prototypes into an arch-specific header file.
> 
> It would be better to do something like this in (say) suspend.h:
> 
> #ifdef CONFIG_HIBERNATION_HEADER
> extern int arch_hibernation_header_save(void *addr, unsigned int max_size);
> extern int arch_hibernation_header_restore(void *addr);
> #else
> static inline int arch_hibernation_header_save(void *addr,
> 						unsigned int max_size)
> {
> 	return 0;
> }
> 
> static inline int arch_hibernation_header_restore(void *addr)
> {
> 	return 0;
> }
> #endif
> 
> then go nuke some ifdefs from the .c files.

The ifdefs in snapshot.c are necessary anyway, because they are around some
code that is only compiled when the CONFIG_HIBERNATION_HEADER is undefined.

I'll post the reworked patches in a new thread once again after the other issue
raised by Pavel gets settled.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ