From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36768) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a47UD-000788-BI for qemu-devel@nongnu.org; Wed, 02 Dec 2015 08:30:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a47U7-0006LX-MW for qemu-devel@nongnu.org; Wed, 02 Dec 2015 08:30:21 -0500 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:38369) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a47U7-0006LR-Fp for qemu-devel@nongnu.org; Wed, 02 Dec 2015 08:30:15 -0500 Received: by wmec201 with SMTP id c201so57959383wme.1 for ; Wed, 02 Dec 2015 05:30:14 -0800 (PST) Date: Wed, 2 Dec 2015 15:30:12 +0200 From: Shmulik Ladkani Message-ID: <20151202153012.08b80fd9@pixies> In-Reply-To: <565EBF32.80803@redhat.com> References: <1448987005-28335-1-git-send-email-shmulik.ladkani@ravellosystems.com> <565DCC97.5020504@redhat.com> <20151201213007.2b41e810@halley> <565E0729.9060603@redhat.com> <20151202100109.72be507a@pixies> <565EBF32.80803@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] virtio-pci: Set the QEMU_PCI_CAP_EXPRESS capability early in its DeviceClass realize method List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" Hi, On Wed, 2 Dec 2015 11:51:46 +0200, marcel@redhat.com wrote: > 2. We still have pci_is_express returning true, this is error prone because > one can use this function assuming the device is express. Maybe we should > call it "can_be_express" ? > > If you think this is good enough, you can simply do the same: > - Instead of replacing the realize method, just advertise it with > "is_express" (meaning it can be express) > - Leave all the conditions as they were in prev patch. > As a result, the pci config space will have the right length. Oh but we can't do so, as the change of config space size is guest visible and breaks migration; it must depend on your x-pcie-disable flag :) As I can't decide what's better, I'm following your initial suggestion and submit for maintainers to review. However, do note that there are few more evidence that 'pci_is_express' is true while not necessarily placed on a pcie bus: - pcie_endpoint_cap_init: it tests for 'pci_bus_is_express' although 'dev' is guaranteed to be 'pci_is_express' (assertion in pcie_cap_init) - 058fdcf 'xhci: add endpoint cap on express bus only' Thanks, Shmulik