From owner-freebsd-current@FreeBSD.ORG Wed Apr 5 20:28:12 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 92A9716A41F for ; Wed, 5 Apr 2006 20:28:12 +0000 (UTC) (envelope-from minimarmot@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.197]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0F3C843D6B for ; Wed, 5 Apr 2006 20:28:03 +0000 (GMT) (envelope-from minimarmot@gmail.com) Received: by zproxy.gmail.com with SMTP id l8so59542nzf for ; Wed, 05 Apr 2006 13:28:03 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=BN4nvHcXkbb6r4jHU78wsMOIqsI4HE6G2pb/ppeeRhQ2ipf5xKj/8SZwS4QHDPybn8lRN/lKN06TDBjiL4BV/Sgx8rPAzzdaD9UoeNFzHagtc7u0eHZuVnEK8UbdtwqHsfeduEpbCI8gb/RkpDuvktD7wi/q6lTL9tSqM+dFajo= Received: by 10.36.68.7 with SMTP id q7mr47974nza; Wed, 05 Apr 2006 13:28:03 -0700 (PDT) Received: by 10.36.75.9 with HTTP; Wed, 5 Apr 2006 13:28:03 -0700 (PDT) Message-ID: <47d0403c0604051328l7c6fba8ob2719dfedf1b7110@mail.gmail.com> Date: Wed, 5 Apr 2006 15:28:03 -0500 From: "Ben Kaduk" To: "Nate Lawson" In-Reply-To: <443423FC.2070201@root.org> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <47d0403c0604051112wf30426bt2c3a7c9b2909c8c1@mail.gmail.com> <443423FC.2070201@root.org> Cc: current@freebsd.org Subject: Re: acpi: bad write: (was: Re: My snd_ich working well) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 05 Apr 2006 20:28:12 -0000 On 4/5/06, Nate Lawson wrote: > Ben Kaduk wrote: > > On 4/4/06, Nate Lawson wrote: > >> /* > >> * Some BIOS vendors use AML to read/write directly to IO space. Thi= s > >> * can cause a problem if such accesses interfere with the OS's acces= s to > >> * the same ports. Windows XP and newer systems block accesses to ce= rtain > >> * IO ports. We print a message or block accesses based on a tunable= . > >> */ > >> static int illegal_bios_ports[] =3D { > >> 0x000, 0x00f, /* DMA controller 1 */ > >> 0x020, 0x021, /* PIC */ > >> 0x040, 0x043, /* Timer 1 */ > >> 0x048, 0x04b, /* Timer 2 failsafe */ > >> 0x070, 0x071, /* CMOS and RTC */ > >> 0x074, 0x076, /* Extended CMOS */ > >> 0x081, 0x083, /* DMA1 page registers */ > >> 0x087, 0x087, /* DMA1 ch0 low page */ > >> 0x089, 0x08b, /* DMA2 ch2 (0x89), ch3 low page (0x8a, 0x8b) = */ > >> 0x08f, 0x091, /* DMA2 low page refresh (0x8f) */ > >> /* Arb ctrl port, card select feedback (0x90, = 0x91) */ > >> 0x093, 0x094, /* System board setup */ > >> 0x096, 0x097, /* POS channel select */ > >> 0x0a0, 0x0a1, /* PIC (cascaded) */ > >> 0x0c0, 0x0df, /* ISA DMA */ > >> 0x4d0, 0x4d1, /* PIC ELCR (edge/level control) */ > >> 0xcf8, 0xcff, /* PCI config space. Microsoft adds 0xd00 also= but > >> that seems incorrect. */ > >> -1, -1 > >> }; > >> > > > > Hi Nate, > > > > As posted earlier, I'm getting these acpi: bad write > > messages spamming my console, with port 0x086 instead of Angka's > > 0x073. I don't see 0x086 in the above list, though, so I'm a bit > > confused. > > This message would have been triggered by the off-by-one error before my > fix (86 is just below 87, which is on the list). > > The check is now: > if ((addr >=3D port[0] && addr <=3D port[1]) || > (addr < port[0] && addr + (width / 8) > port[0])) > > Which gives (with addr =3D 86 and width =3D 8): > 86 >=3D 87 ... FALSE > 86 < 87 (TRUE) && 86 + 1 > 87 (FALSE) ... FALSE > > You can try it yourself with (play around with addr and width): > > main() > { > int addr =3D 0x86; > int width =3D 8; > int port[2] =3D { 0x87, 0x87 }; > > if ((addr >=3D port[0] && addr <=3D port[1]) || > (addr < port[0] && addr + (width / 8) > port[0])) > printf("BUGGY BUGGY BIOS\n"); > else > printf("KRAD!\n"); > } > > So the code is correct. Please be sure you have the right version that > matches this code snippet above and recompile your acpi module (or > entire kernel) and reinstall it. > > > I have revision 1.120 of src/sys/dev/acpica/Osd/OsdHardware.c > > The correct version is 1.20. > > Thanks, > -- > Nate > Well, I went back and checked my build log, and it seems that my sleepy fingers typed "buildkernel" instead of "kernel", so I'm running a kernel from april 3, (with the old OsdHardware.c), instead of the new one. I currently have v. 1.20 (1.120 was a typo), so when I can get at the machine later tonight, I will install the new kernel and reboot, and report back if the problem remains (but I highly doubt that it will). Terribly sorry about the noise -- I guess I shouldn't be so excited about the chance to report a bug and get some sleep before sending something off. -Ben Kaduk