Re: Help port swsusp to ppc.

From: Nigel Cunningham
Date: Mon Jan 19 2004 - 12:54:13 EST


Hi.

On Tue, 2004-01-20 at 00:39, Benjamin Herrenschmidt wrote:
> I see no reason why this would be needed on ppc, only the last step,
> that is the actual CPU state save, should matter.

Besides saving the CPU state, the code copies the original kernel back.
It sort of defeats the purpose to remove that code :>

> That's very hairy... You basically assume the boot kernel and the
> restore kernel are completely identical, which isn't something I would
> do. I didn't have time to dive into it, but I do/did intend to implement
> swsusp on ppc and I would eventually resume the whole environement
> straight from the bootloader without kernel help.

Well, the whole things is pretty hairy :> But I don't think there's
anything wrong with assuming the boot and restored kernels are
identical. After all, we're calling it suspending and resuming, not
kexec. It does sound nice to do it all from the bootloader without
kernel help.

> If you want to pass some infos between the "loader" kernel and the "loaded"
> one, I strongly suggest you define some well specified interface for doing
> so that is immune to kernel versions.

It is a well defined interface: a section of memory marked nosave, with
variables given the matching attribute. Not my idea, by the way. If you
have a problem, you should be taking it up with Pavel or Linus. We
should also note that the interface can't be too well defined - there
has to be room for development over time.

> Also, I haven't looked in details, but when switching to the "new" kernel
> from the "loader" (boot) one, do you shut down all devices properly ?
> This switch could actually be fairly similar to a kexec pass in this
> regard.

Yes. we device_suspend. Regarding the similarities with kexec, I fully
agree. In fact, there is also LKCD to think off. There should be a
synergy here.

Regards,

Nigel
--
My work on Software Suspend is graciously brought to you by
LinuxFund.org.

Attachment: signature.asc
Description: This is a digitally signed message part