From owner-freebsd-mobile@FreeBSD.ORG Wed Oct 4 18:56:13 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 7FCE916A412; Wed, 4 Oct 2006 18:56:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id E82F543D68; Wed, 4 Oct 2006 18:56:01 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k94Itg8o036809; Wed, 4 Oct 2006 14:55:45 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Andrea Bittau Date: Wed, 4 Oct 2006 13:41:33 -0400 User-Agent: KMail/1.9.1 References: <20060921000628.GA1832@shorty.sorbonet.org> <4522D023.9090501@root.org> <20061003213356.GA6149@shorty.sorbonet.org> In-Reply-To: <20061003213356.GA6149@shorty.sorbonet.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200610041341.34231.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 04 Oct 2006 14:55:46 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1997/Wed Oct 4 11:20:43 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: freebsd-acpi@freebsd.org, freebsd-mobile@freebsd.org, Nate Lawson 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: Wed, 04 Oct 2006 18:56:13 -0000 On Tuesday 03 October 2006 17:33, Andrea Bittau wrote: > On Tue, Oct 03, 2006 at 02:03:31PM -0700, Nate Lawson wrote: > > I agree. The standard switch to protected mode, paging, etc. needs to > > be performed and then resume from the saved register context. > > I guess my point was that there are two pieces of code that do that: > 1) mpboot.s bootMP() used by system bootstrap and what my current patch uses. I > think this is what you guys are suggesting to use, and I'm doing it anyway in > my patch, but I just want to be the devil's advocate =D. > > 2) acpi_wakecode.S wakeup_16() used by the BSP to wake itself up. This is what > I was suggesting should be generalized and used by the other cores too. The > difference of this code as opposed to #1 is that #2 can "cheat". That is, we > can create the code for #2 on the fly and do stuff like mov old_eax,eax etc > and don't have to be smart about figuring out where the CPU should land and > how it should initialize itself [as in the case of #1]. > > I'm just wondering whether we should do something about the assembly "code > duplication" in #1 and #2. I understand they serve a different purpose, but > arguably, they do the same thing: real-mode -> jump in kernel. What is > different is what happens once in kernel mode: boot or resume? That difference > could be coded in the C part of the kernel leaving a single asm entry point both > for bootstrap and wakeup code. Am I making any sense? =D 1) is already tailored to work with starting up an extra AP based on the STARTUP IPI, so I think we should reuse it for starting up the cores. I need to think about it more though. First we need to get APIC with UP working though. -- John Baldwin