From owner-freebsd-smp Sun Sep 24 14: 5:54 2000 Delivered-To: freebsd-smp@freebsd.org Received: from server.baldwin.cx (server.geekhouse.net [64.81.6.52]) by hub.freebsd.org (Postfix) with ESMTP id 3145837B424 for ; Sun, 24 Sep 2000 14:05:47 -0700 (PDT) Received: from john.baldwin.cx (root@john.baldwin.cx [192.168.1.18]) by server.baldwin.cx (8.9.3/8.9.3) with ESMTP id OAA95723; Sun, 24 Sep 2000 14:07:37 -0700 (PDT) (envelope-from john@baldwin.cx) Received: (from john@localhost) by john.baldwin.cx (8.9.3/8.9.3) id OAA53604; Sun, 24 Sep 2000 14:06:53 -0700 (PDT) (envelope-from john) Message-Id: <200009242106.OAA53604@john.baldwin.cx> X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20000924121359.O9141@fw.wintelcom.net> Date: Sun, 24 Sep 2000 14:06:53 -0700 (PDT) From: John Baldwin To: Alfred Perlstein Subject: Re: 'interrupt-level buffer overflows' for sio device? Cc: freebsd-smp@FreeBSD.ORG, Bruce Evans , The Hermit Hacker , Warner Losh , Dag-Erling Smorgrav Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 24-Sep-00 Alfred Perlstein wrote: > * Dag-Erling Smorgrav [000924 11:39] wrote: >> Alfred Perlstein writes: >> > This is basically a result of the entire kernel running at the >> > equivelant of splhigh, all interrupts are blocked until a context >> > switch in kernel land. >> > >> > There's work in progress to mpsafe the drivers (at least for >> > ethernet, more will arrive later). >> >> OK. Assuming I wanted to try and help with this work, where would be a >> good place to start finding out what needs to be done? > > Have a look at what was recently done to the fxp driver, basically > protect the instance of the driver from itself, ie, if you see > splfoo() in the driver, identify what it's trying to protect against > and figure where the mutex needs to be. > > You want to block things like ioctls and user entry points from > interfering with the interrupt context of the driver. > > ATM John Baldwin is working on making some sort of flag for the > newbus interrupt and cdev initilization routines so that a driver > can mark itself mpsafe. Only for cdevsw. newbus interrupt handlers already have the flag, and have had it for a while. > Other things need to be taken care of though, fxp can't have Giant > (the equivelant of splhigh) removed until several things happen: > > ether_input/output is made mpsafe (trivial) > the ifqueue structs have mutexes put into them (trivial) > the mbuf subsystem made made mpsafe (done, but not committed) > malloc made mpsafe (done and committed) > softinterrupt scheduling is made mpsafe (I think this is on John's plate) Err, this should be mpsafe on the x86 already. It will be mpsafe on the alpha shortly. -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message