From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LzYw4-00070v-Us for qemu-devel@nongnu.org; Thu, 30 Apr 2009 12:16:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LzYw0-00070e-2W for qemu-devel@nongnu.org; Thu, 30 Apr 2009 12:16:32 -0400 Received: from [199.232.76.173] (port=52830 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LzYvz-00070b-VZ for qemu-devel@nongnu.org; Thu, 30 Apr 2009 12:16:28 -0400 Received: from mx2.redhat.com ([66.187.237.31]:51177) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LzYvw-00052b-PH for qemu-devel@nongnu.org; Thu, 30 Apr 2009 12:16:27 -0400 Date: Thu, 30 Apr 2009 19:15:08 +0300 From: "Michael S. Tsirkin" Message-ID: <20090430161508.GA15893@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] questions on default_config_write in hw/pci.c List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Anthony Liguori , Marcelo Tosatti , qemu-devel@nongnu.org Hi, I've been looking at hw/pci.c, specifically at how config read/write are implemented, and have a couple of questions about default_config_write: 1. The code at the beginning (if len == 4 ...) seems to only update pci base registers if a dword write is performed. I think it's legal for the guest to perform 4 single-byte writes. Should this be supported? 2. The large switch statement at the end of this function uses hard-coded register offsets. Would it make sense to change it to use macros from hw/pci.h? 3. Still there I see: switch(d->config[0x0e]) { case 0x00: case 0x80: register 0x0e is header type, which has defined values of 0x00 (device or host bridge), 0x01 (pci to pci bridge) and 0x02 (cardbus bridge). What is 0x80 and when is it used? Would it make sense to remove this? 4. Still there, there's some handling done for type 1 devices. This support seems imcomplete. Are there any PCI-to-PCI bridges emulated by qemu? Would it make sense to remove this code? Thanks, MST -- MST