Re: Help port swsusp to ppc.

From: Benjamin Herrenschmidt
Date: Mon Jan 19 2004 - 06:45:22 EST



> It should contain the .S equivalent to the swsusp2.c file. It would be
> best if swsusp2.c could simply be compiled, but it appears that it can't
> at the moment on x86 (I need to learn x86 assembly so I can understand
> why).

I see no reason why this would be needed on ppc, only the last step,
that is the actual CPU state save, should matter.

> That idea is to have a section that doesn't get replaced when we copy
> the original kernel back. Thus, small amounts of data that suspend uses
> or stores can be given the __nosave attribute. An example is the cpu
> frequency value, which should match the boot kernel, not the value at
> suspend time.

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.

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.

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.

Ben.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/