From owner-freebsd-mobile@FreeBSD.ORG Tue Oct 3 21:03:46 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 6238F16A412; Tue, 3 Oct 2006 21:03:46 +0000 (UTC) (envelope-from nate@root.org) Received: from ylpvm29.prodigy.net (ylpvm29-ext.prodigy.net [207.115.57.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7765E43D7E; Tue, 3 Oct 2006 21:03:36 +0000 (GMT) (envelope-from nate@root.org) X-ORBL: [67.119.74.222] Received: from [10.0.0.44] (adsl-67-119-74-222.dsl.sntc01.pacbell.net [67.119.74.222]) by ylpvm29.prodigy.net (8.13.7 out spool5000 dk/8.13.7) with ESMTP id k93L2WOB022442; Tue, 3 Oct 2006 17:02:32 -0400 Message-ID: <4522D023.9090501@root.org> Date: Tue, 03 Oct 2006 14:03:31 -0700 From: Nate Lawson User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: John Baldwin References: <20060921000628.GA1832@shorty.sorbonet.org> <200610021424.18562.jhb@freebsd.org> <20061002223055.GA8217@shorty.sorbonet.org> <200610031302.34835.jhb@freebsd.org> In-Reply-To: <200610031302.34835.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-acpi@freebsd.org, Andrea Bittau , 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 21:03:46 -0000 John Baldwin wrote: > On Monday 02 October 2006 18:30, Andrea Bittau wrote: >>> resuming the darn things. Do you know what mode the CPUs come back up in? >>> It looks like we need to resend startup IPIs to them from your patch. >> Yea it all comes back in real mode. I've tried using the standard > freebsd "boot >> code" for waking up the second CPU. There were some issues with the BSP not >> using PTD_Idle. I don't know enough about computers and freebsd to know > what >> exactly that means. Also, when the second CPU came back, if it entered the >> scheduler, it would die, so I had to leave it in the idle loop by setting > the >> cpu_hlt mask. >> >> Anyway, the correct way to do it I think is to generalize the save state & >> wakeup code used by the BSP in acpi_sleep_machdep(). That is, the second > core >> should save its state and wake up the same way as the BSP does. It should > not >> use the "come to life mechanism" used at boot-time. The reason is that the >> memory is setup properly and the second core should have saved registers > which >> make sense so less "initialization and setup" needs to be performed. > > No, the CPUs are going to come back into real mode, so we will need to > bootstrap them back into the kernel, etc. Once you've done that you can make > sure of stoppcbs[] (assuming you use stop_cpus to shut them down) to restore > enough state to get them back into the threads they were in when the suspend > happened. > I agree. The standard switch to protected mode, paging, etc. needs to be performed and then resume from the saved register context. -- Nate