From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43273) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAH3i-0003Yw-6C for qemu-devel@nongnu.org; Wed, 01 Jul 2015 08:24:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAH3e-0002ry-Q2 for qemu-devel@nongnu.org; Wed, 01 Jul 2015 08:24:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAH3e-0002rS-Jt for qemu-devel@nongnu.org; Wed, 01 Jul 2015 08:24:06 -0400 Message-ID: <1435753442.4160.35.camel@redhat.com> From: Gerd Hoffmann Date: Wed, 01 Jul 2015 14:24:02 +0200 In-Reply-To: <20150701133437-mutt-send-email-mst@redhat.com> References: <1435653553-7728-1-git-send-email-kraxel@redhat.com> <1435653553-7728-8-git-send-email-kraxel@redhat.com> <20150701133437-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 07/22] virtio: find version 1.0 virtio capabilities List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: seabios@seabios.org, qemu-devel@nongnu.org Hi, > Hmm this seems to violate this rule in the spec: > > > The driver SHOULD use the first instance of each virtio structure type > they can support. > > "can support" here means that bios was able to allocate > it during enumeration. > > For example there could be both IO and memory, in this order > you need to check that IO/memory got enabled (in theory, > also that they are within parent bridge's windows - used > by some guests, but > seabios doesn't disable memmory/io in this strange way). Yes, seabios always allocates both mem and io. So this incremental fix ... @@ -234,7 +234,7 @@ void vp_init_simple(struct vp_device *vp, struct pci_device *pci) vp_cap = NULL; break; } - if (vp_cap) { + if (vp_cap && !vp_cap->cap) { vp_cap->cap = cap; vp_cap->bar = pci_config_readb(pci->bdf, cap + offsetof(struct virtio_pci_cap, bar)); ... makes seabios use the first not the last and should do the trick, right? cheers, Gerd