From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mvc6r-0002A6-II for qemu-devel@nongnu.org; Wed, 07 Oct 2009 15:23:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mvc6m-00028w-IT for qemu-devel@nongnu.org; Wed, 07 Oct 2009 15:23:36 -0400 Received: from [199.232.76.173] (port=48404 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mvc6m-00028i-7e for qemu-devel@nongnu.org; Wed, 07 Oct 2009 15:23:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36281) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mvc6l-0004xC-PB for qemu-devel@nongnu.org; Wed, 07 Oct 2009 15:23:32 -0400 Date: Wed, 7 Oct 2009 21:21:27 +0200 From: "Michael S. Tsirkin" Message-ID: <20091007192127.GA3796@redhat.com> References: <20091007123348.GA31537@redhat.com> <4ACC9133.9060903@redhat.com> <20091007134853.GA9769@redhat.com> <4ACCA4AD.7050606@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4ACCA4AD.7050606@redhat.com> Subject: [Qemu-devel] Re: [PATCH] qemu/pci: optimize pci config handling List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Isaku Yamahata , qemu-devel@nongnu.org On Wed, Oct 07, 2009 at 04:24:45PM +0200, Paolo Bonzini wrote: >> I'm actively trying to get out of range-checking address. > > I don't understand what you mean, sorry. > >> What you porpose here is certainly more code than we had. >> So why is this a good idea? > > Because it avoids the memcpy/memcmp most of the time (when the memcmp > would surely succeed). Yes :) But at the cost of more code. I don't think speed matters there, so less code is good. But even if it did, extra read of a single cache line might be cheaper than an extra branch, and generated code will be more compact. > I supposed that would also matter more as the > config space size increases---correct me and dismiss the patch if I am > mistaken. No, we'll always only look need to look at the header, whatever the size of the config space. That's the point of the patch I posted - future proof against config space size increases, not optimization. > Paolo