From: "Jan Beulich" Subject: Re: [PATCH] ioreq-server: handle IOREQ_TYPE_PCI_CONFIG in assist function Date: Wed, 28 Jan 2015 09:26:28 +0000 Message-ID: <54C8B954020000780005A354@mail.emea.novell.com> References: <1422385589-17316-1-git-send-email-wei.liu2@citrix.com> <54C7E85E.2090100@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YGOtO-0001Ge-38 for xen-devel@lists.xenproject.org; Wed, 28 Jan 2015 09:26:34 +0000 In-Reply-To: <54C7E85E.2090100@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper , Wei Liu Cc: xen-devel , Paul Durrant List-Id: xen-devel@lists.xenproject.org >>> On 27.01.15 at 20:34, wrote: > On 27/01/15 19:06, Wei Liu wrote: >> QEMU stubdom will read PCI config space when enumerating PCI devices. >> Xen should return ~0 when there is no suitable ioreq server to dispatch >> the request. >> >> Without this patch, QEMU stubdom will fail to start because hvmloader >> fails following assertion: >> >> 118 ASSERT((devfn != PCI_ISA_DEVFN) || >> 119 ((vendor_id == 0x8086) && (device_id == 0x7000))); >> >> because vendor_id and device_id are 0. >> >> This fixes a regression for QEMU stubdom. It should be backported to 4.5 >> as well. >> >> Signed-off-by: Wei Liu >> Cc: Jan Beulich >> Cc: Paul Durrant >> Cc: Andrew Cooper > > The patch is clearly a good bugfix, but I am not sure the commit message > is accurate. Nor am I convinced that this is the only place to fix. hvmloader assuming to get back ~0 is contrary to various other code also taking 0 in vendor or device IDs as a sign to skip the device. (Looking at the surrounding code I'm also puzzled by all the pci_write?()-s in that bus scanning loop: Most if not all of them should be done by the BIOS, not hvmloader. But of course that's the case for the BAR setup further down too.) Jan