From owner-freebsd-acpi@FreeBSD.ORG Thu Feb 9 16:25:13 2006 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CE10C16A420 for ; Thu, 9 Feb 2006 16:25:13 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C7A743D4C for ; Thu, 9 Feb 2006 16:25:13 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.5b3) with ESMTP id 8095050 for multiple; Thu, 09 Feb 2006 11:23:52 -0500 Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k19GObJM068129; Thu, 9 Feb 2006 11:24:37 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: Nate Lawson Date: Thu, 9 Feb 2006 11:24:02 -0500 User-Agent: KMail/1.9.1 References: <43E7D1A2.1030008@o2.pl> <200602081036.34530.jhb@freebsd.org> <43EA42B6.4000603@root.org> In-Reply-To: <43EA42B6.4000603@root.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200602091124.05153.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1281/Wed Feb 8 14:59:33 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=4.2 tests=ALL_TRUSTED autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx X-Server: High Performance Mail Server - http://surgemail.com r=1653887525 Cc: freebsd-acpi@freebsd.org Subject: Re: Kernel panic with ACPI enabled X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2006 16:25:13 -0000 On Wednesday 08 February 2006 14:12, Nate Lawson wrote: > John Baldwin wrote: > > On Wednesday 08 February 2006 02:59, Nate Lawson wrote: > >>John Baldwin wrote: > >>>On Tuesday 07 February 2006 15:13, Donald J. O'Neill wrote: > >>>>Other things can affect what he's trying to do and cause him to think > >>>> he has an ACPI problem. I had a bad USB mouse that was causing > >>>> problems on one of my computers, in fact anything USB on that computer > >>>> caused a problem with ACPI (it had to be disabled to allow the > >>>> computer to boot-up) if that mouse was plugged in, until I found the > >>>> mouse was bad and switched it with one that was ok. On another > >>>> computer, I could only boot-up if I either disabled ACPI or had the > >>>> USB mouse unplugged. After it was up, the mouse could be plugged back > >>>> in and it would work, ACPI would work, but I would be left wondering > >>>> about the situation. I finally decided to just use a PS-2 mouse and > >>>> wait a while. That works fine, although I hate ball mice. > >>> > >>>Actually, in his case I'm fairly sure MAXMEM is the problem. Several > >>>people have had problems trying to use the tunable equivalent > >>>(hw.physmem=3g and the like) because if the new maxmem value is greater > >>>than the highest memory address we found, we just extend the last > >>> segment of physical memory. However, in the case of modern machines > >>> with SMAPs, this extension can result in including memory that was > >>> specifically marked as unavailable (because it was in use by the BIOS > >>> to store the ACPI tables) suddenly being used by the kernel. As part > >>> of this process, the kernel does test writes to each page, so it would > >>> corrupt the ACPI tables and eventually lead to issues such as this. > >> > >>Can we at least put a printf() in the boot sequence that says "warning: > >>maxmem set and acpi enabled, this may cause problems"? This keeps > >>coming up. > > > > We don't know we are using ACPI when we do the maxmem and hw.physmem > > stuff. > > I was thinking this goes in the ACPI init. if (maxmem != 0) printf() Something like this: Index: dev/acpica/acpi.c =================================================================== RCS file: /usr/cvs/src/sys/dev/acpica/acpi.c,v retrieving revision 1.219 diff -u -r1.219 acpi.c --- dev/acpica/acpi.c 7 Nov 2005 21:52:06 -0000 1.219 +++ dev/acpica/acpi.c 9 Feb 2006 16:22:51 -0000 @@ -30,6 +30,9 @@ #include __FBSDID("$FreeBSD: src/sys/dev/acpica/acpi.c,v 1.219 2005/11/07 21:52:06 jhb Exp $"); +#ifdef __i386__ +#include "opt_maxmem.h" +#endif #include "opt_acpi.h" #include #include @@ -284,6 +287,19 @@ return_VALUE (0); started = 1; +#ifdef __i386__ + /* Warn about MAXMEM or hw.physmem use. */ + do { +#ifndef MAXMEM + u_long tmp; + + if (TUNABLE_ULONG_FETCH("hw.physmem", &tmp)) +#endif + printf("WARNING: Usage of MAXMEM or hw.physmem may cause " + "ACPI to panic!\n"); + } while (0); +#endif + /* Initialise the ACPI mutex */ mtx_init(&acpi_mutex, "ACPI global lock", NULL, MTX_DEF); Index: modules/acpi/acpi/Makefile =================================================================== RCS file: /usr/cvs/src/sys/modules/acpi/acpi/Makefile,v retrieving revision 1.15 diff -u -r1.15 Makefile --- modules/acpi/acpi/Makefile 1 Nov 2005 22:44:08 -0000 1.15 +++ modules/acpi/acpi/Makefile 9 Feb 2006 16:19:25 -0000 @@ -49,7 +49,7 @@ SRCS+= OsdDebug.c SRCS+= OsdHardware.c OsdInterrupt.c OsdMemory.c OsdSchedule.c SRCS+= OsdStream.c OsdSynch.c OsdTable.c OsdEnvironment.c -SRCS+= opt_acpi.h opt_bus.h opt_ddb.h +SRCS+= opt_acpi.h opt_bus.h opt_ddb.h opt_maxmem.h SRCS+= acpi_if.h acpi_quirks.h bus_if.h cpufreq_if.h device_if.h SRCS+= isa_if.h pci_if.h pcib_if.h -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org