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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200805152105.48820.rjw@sisk.pl>
Date:	Thu, 15 May 2008 21:05:47 +0200
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	"Huang, Ying" <ying.huang@...el.com>
Cc:	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Pavel Machek <pavel@....cz>, nigel@...el.suspend2.net,
	Andrew Morton <akpm@...ux-foundation.org>,
	Vivek Goyal <vgoyal@...hat.com>, linux-kernel@...r.kernel.org,
	linux-pm@...ts.linux-foundation.org,
	Kexec Mailing List <kexec@...ts.infradead.org>
Subject: Re: [PATCH -mm] kexec jump -v9

On Thursday, 15 of May 2008, Huang, Ying wrote:
> On Wed, 2008-05-14 at 15:30 -0700, Eric W. Biederman wrote:
> [...]
> > >  
> > > +	if (image->preserve_context) {
> > > +		KJUMP_MAGIC(control_page) = KJUMP_MAGIC_NUMBER;
> > > +		if (kexec_jump_save_cpu(control_page)) {
> > > +			image->start = KJUMP_ENTRY(control_page);
> > > +			return;
> > 
> > Tricky, and I expect unnecessary.
> > We should be able to just have relocate_new_kernel return?
> 
> OK, I will check this. Maybe we can move CPU state saving code into
> relocate_new_kernel.
> 
> [...]
> > > -static void kernel_kexec(void)
> > > +static int kernel_kexec(void)
> > >  {
> > > +	int ret = -ENOSYS;
> > >  #ifdef CONFIG_KEXEC
> > > -	struct kimage *image;
> > > -	image = xchg(&kexec_image, NULL);
> > > -	if (!image)
> > > -		return;
> > > -	kernel_restart_prepare(NULL);
> > > -	printk(KERN_EMERG "Starting new kernel\n");
> > > -	machine_shutdown();
> > > -	machine_kexec(image);
> > > +	if (xchg(&kexec_lock, 1))
> > > +		return -EBUSY;
> > > +	if (!kexec_image) {
> > > +		ret = -EINVAL;
> > > +		goto unlock;
> > > +	}
> > > +	if (!kexec_image->preserve_context) {
> > > +		kernel_restart_prepare(NULL);
> > > +		printk(KERN_EMERG "Starting new kernel\n");
> > > +		machine_shutdown();
> > > +	}
> > > +	ret = kexec_jump(kexec_image);
> > > +unlock:
> > > +	xchg(&kexec_lock, 0);
> > >  #endif
> > 
> > Ugh.  No.  Not sharing the shutdown methods with reboot and
> > the normal kexec path looks like a recipe for failure to me.
> > 
> > This looks like where we really need to have the conversation.
> > What methods do we use to shutdown the system.
> > 
> > My take on the situation is this.  For proper handling we
> > need driver device_detach and device_reattach methods.
> > 
> > With the following semantics.  The device_detach methods
> > will disable DMA and place the hardware in a sane state
> > from which the device driver can reclaim and reinitialize it,
> > but the hardware will not be touched.
> > 
> > device_reattach reattaches the driver to the hardware.
> 
> Yes. Current device PM callback is not suitable for hibernation (kexec
> based or original). I think we can collaborate with Rafael J. Wysocki on
> the new device drivers hibernation callbacks.

Thanks, I'm also open for collaboration.  There will be a lot of work to do
related to the new callbacks, so any contribution is certainly welcome.

Thanks,
Rafael
--
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