From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KlJ4n-0000wG-M8 for qemu-devel@nongnu.org; Thu, 02 Oct 2008 03:58:21 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KlJ4i-0000vo-3z for qemu-devel@nongnu.org; Thu, 02 Oct 2008 03:58:20 -0400 Received: from [199.232.76.173] (port=39958 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KlJ4h-0000vl-Tu for qemu-devel@nongnu.org; Thu, 02 Oct 2008 03:58:15 -0400 Received: from mx20.gnu.org ([199.232.41.8]:52800) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KlJ4h-0000ua-3l for qemu-devel@nongnu.org; Thu, 02 Oct 2008 03:58:15 -0400 Received: from mx2.redhat.com ([66.187.237.31]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KlJ4f-0003bM-Sv for qemu-devel@nongnu.org; Thu, 02 Oct 2008 03:58:14 -0400 Message-ID: <48E47E93.5000605@redhat.com> Date: Thu, 02 Oct 2008 09:56:03 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 4/4] pci: use pci_config_header in pci.c References: <1222870375-13489-1-git-send-email-kraxel@redhat.com> <1222870375-13489-4-git-send-email-kraxel@redhat.com> <48E3A5BD.8010000@codemonkey.ws> <48E3CAF9.5040207@redhat.com> <48E3CF33.3050702@codemonkey.ws> In-Reply-To: <48E3CF33.3050702@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-1 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: Anthony Liguori Cc: qemu-devel@nongnu.org, Paul Brook Anthony Liguori wrote: > Because the config structure is loaded after pci_register device and > because the MMIO callbacks into the config space? If you look at > pci_default_read_config(), it actually does conversion from le to host > CPU because that's what MMIO callbacks expect. Yep. > If you simply removed > this, it would work. Ah, *now* I see what you mean. Well. That assumes the guests always use the correct in{b,w,l} instruction to access the config space values, i.e. never ever try to use two inb reads for a 16bit value for example. Or a inw for the lower 16 bits of a 32bit value because they know the high bits are zero anyway. I have my doubts that this is a sane expectation. > Of course, you'll have to audit each caller of > pci_register_device() and make sure their config's get changed too. Sure, that would be a *big* task & patch. cheers, Gerd