From owner-freebsd-mobile@FreeBSD.ORG Tue Oct 3 07:21:01 2006 Return-Path: X-Original-To: freebsd-mobile@freebsd.org Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0428316A407; Tue, 3 Oct 2006 07:21:01 +0000 (UTC) (envelope-from a.bittau@cs.ucl.ac.uk) Received: from darkircop.org (tapir.cs.ucl.ac.uk [128.16.66.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8572B43D5A; Tue, 3 Oct 2006 07:21:00 +0000 (GMT) (envelope-from a.bittau@cs.ucl.ac.uk) Received: by darkircop.org (Postfix, from userid 0) id 131DD5C5C6E; Tue, 3 Oct 2006 08:20:45 +0100 (BST) Date: Tue, 3 Oct 2006 08:20:45 +0100 From: Andrea Bittau To: Nate Lawson Message-ID: <20061003072044.GA9182@shorty.sorbonet.org> References: <20060921000628.GA1832@shorty.sorbonet.org> <200610021424.18562.jhb@freebsd.org> <20061002223055.GA8217@shorty.sorbonet.org> <4521AF05.50208@root.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4521AF05.50208@root.org> User-Agent: Mutt/1.4.2.1i X-Echelon: Bush Bomb War KGB Cc: freebsd-acpi@freebsd.org, freebsd-mobile@freebsd.org Subject: Re: hack for getting suspend/resume to half work on an IBM Thinkpad x60s [SMP] X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Oct 2006 07:21:01 -0000 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.