From owner-freebsd-hackers@FreeBSD.ORG Mon Dec 27 16:27:57 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AAAF116A4CE for ; Mon, 27 Dec 2004 16:27:57 +0000 (GMT) Received: from harmony.village.org (rover.village.org [168.103.84.182]) by mx1.FreeBSD.org (Postfix) with ESMTP id 41C2C43D41 for ; Mon, 27 Dec 2004 16:27:57 +0000 (GMT) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.13.1/8.13.1) with ESMTP id iBRGNvSU005261; Mon, 27 Dec 2004 09:23:58 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Mon, 27 Dec 2004 09:24:28 -0700 (MST) Message-Id: <20041227.092428.38703876.imp@bsdimp.com> To: alsbergt@cs.huji.ac.il From: "M. Warner Losh" In-Reply-To: <20041227075616.GA9502@cs.huji.ac.il> References: <20041227075616.GA9502@cs.huji.ac.il> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: freebsd-hackers@freebsd.org Subject: Re: i386_set_ioperm on FreeBSD 5.3 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2004 16:27:57 -0000 In message: <20041227075616.GA9502@cs.huji.ac.il> Tom Alsberg writes: : Hi there. : : I'm trying to use some code I wrote quite a while ago using Doug : White's FreeBSD IPMI code (kcs.c, send-kcs-command.c, etc.). : : It still works as it did back then on FreeBSD 4.10. On FreeBSD 5.3 it : does not. : : Problem seems to be, that i386_set_ioperm isn't doing what it should. : The program gets SIGBUS when doing outb, while it shouldn't. : : I looked in /usr/src/sys/i386/i386/sys_machdep.c, not many changes : from 4.10 - all except one are additions that would return an error in : case of failure. One seems to be quite modest (struct change): : : - if (p->p_addr->u_pcb.pcb_ext == 0) : - if ((error = i386_extend_pcb(p)) != 0) : + if (td->td_pcb->pcb_ext == 0) : + if ((error = i386_extend_pcb(td)) != 0) : : Yet, clearly something fails on FreeBSD 5.3. I can confirm that this : is indeed the problem with a few-line program that will : i386_set_ioperm and then try to do outb. Any idea if i386_set_ioperm : broke somehow in 5.3? Haven't checked much, but it seems that the : data it is changing is not being used after all. : : Thanks, any help appreciated, We had problems with multiple people opening /dev/io and threads in 4.x. It was a timing related thing. Maybe you're seeing a different timing thing in your program? Warner