hack for getting suspend/resume to half work on an IBM Thinkpad x60s [SMP]

Andrea Bittau a.bittau at cs.ucl.ac.uk
Tue Oct 3 00:21:01 PDT 2006


On Mon, Oct 02, 2006 at 05:29:57PM -0700, Nate Lawson wrote:
> I disagree.  Instead of trying to capture all that register state, 
> including MSRs, MTRRs, etc., it seems easier just to reinitialize from 
> scratch.  We'll need to do that anyway once suspend-to-disk is 
> implemented since that kind of resume is equivalent to a hard power cycle.

OK so what's the protocol?  Force the second CPU into the idle loop, boot it up,
and let the scheduler decide what it should run?  I tried doing that.  It sort
of works but the system seemed unstable [page faults] when interrupts were
handled by the second core, or some processes were run.  One thing I noted is
that the CR3 was different from what it was previously.  On wakeup, it's
idle_ptd and i'm not sure what that means and if that's ok.

Also, I don't see how reinitializing from scratch is "easier".  You'd have to
setup all registers anyway.  Furthermore, you'd have to allocate a stack, the
per-cpu pages and stuff like that which is already in RAM.  [If you use the
existing values then it's not "reinitializing from scratch ;D.]  

Anyway, I don't want to argue because I know really little of this stuff---I
just wanted to give a shot at getting s/r working on my laptop ;D  I got it ~75%
working on my laptop.  Now I'm waiting for someone to point out how to wakeup
the second core properly and why my mechanism [albeit being a hack] doesn't
work.


More information about the freebsd-mobile mailing list