From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LsM5M-0002dz-0i for qemu-devel@nongnu.org; Fri, 10 Apr 2009 15:08:20 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LsM5H-0002dZ-I7 for qemu-devel@nongnu.org; Fri, 10 Apr 2009 15:08:19 -0400 Received: from [199.232.76.173] (port=47551 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LsM5H-0002dW-A8 for qemu-devel@nongnu.org; Fri, 10 Apr 2009 15:08:15 -0400 Received: from hartman.uits.indiana.edu ([129.79.1.194]:52959) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LsM5G-0003PA-S1 for qemu-devel@nongnu.org; Fri, 10 Apr 2009 15:08:15 -0400 Received: from mail-relay.iu.edu (burns.uits.indiana.edu [129.79.1.202]) by hartman.uits.indiana.edu (8.14.2/8.13.8/IU Messaging Team) with ESMTP id n3AJ8D2N028758 for ; Fri, 10 Apr 2009 15:08:13 -0400 Received: from [129.79.35.119] (nibbler.dlib.indiana.edu [129.79.35.119]) (authenticated bits=0) by mail-relay.iu.edu (8.14.2/8.13.8/IU Messaging Team Submission) with ESMTP id n3AJ8CXx003187 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 10 Apr 2009 15:08:13 -0400 Subject: Re: [Qemu-devel] [PATCH] two level table for IO port lookup From: Brian Wheeler In-Reply-To: <49DF6DD0.3090508@codemonkey.ws> References: <1239374905.28083.21.camel@nibbler.dlib.indiana.edu> <49DF6DD0.3090508@codemonkey.ws> Content-Type: text/plain Date: Fri, 10 Apr 2009 15:08:12 -0400 Message-Id: <1239390492.20162.63.camel@nibbler.dlib.indiana.edu> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Fri, 2009-04-10 at 11:03 -0500, Anthony Liguori wrote: > Brian Wheeler wrote: > > The alpha architecture uses 24 bits for the io port address so this > > patch adds a two level table and puts the IO port data into a > > struct...because sizeof(void *) * 7 * 16777216 is nearly a 1G on my > > workstation. > > > > I've set the alpha target to use a 12/12 split and everything else to > > use 8/8. > > > > The table lookups really kill performance. It's probably a better idea > just to switch to a linear list of IO ports. There's usually going to > be a small number of registered IO regions (certainly, less than 100). Well, on ioport_read the hot path does 2 lookups and a null check. The new one does 3 lookups, and two null checks. Its probably slower, but I don't know if it would kill performance, per se...especially since IO port access isn't the fastest in real life anyway. Brian