From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2IfH-00005x-TX for qemu-devel@nongnu.org; Tue, 09 Jun 2015 08:30:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z2IfD-00056X-CJ for qemu-devel@nongnu.org; Tue, 09 Jun 2015 08:29:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z2IfD-00056C-5f for qemu-devel@nongnu.org; Tue, 09 Jun 2015 08:29:55 -0400 Date: Tue, 9 Jun 2015 14:29:51 +0200 From: "Michael S. Tsirkin" Message-ID: <20150609142110-mutt-send-email-mst@redhat.com> References: <1433798332-5830-1-git-send-email-dslutz@verizon.com> <20150609111039-mutt-send-email-mst@redhat.com> <9AAE0902D5BC7E449B7C8E4E778ABCD0259414CB@AMSPEX01CL01.citrite.net> <20150609115025-mutt-send-email-mst@redhat.com> <9AAE0902D5BC7E449B7C8E4E778ABCD0259418F0@AMSPEX01CL01.citrite.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD0259418F0@AMSPEX01CL01.citrite.net> Subject: Re: [Qemu-devel] [PATCH v2 0/4] Fix device listener interface for PCI to PCI bridges List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Durrant Cc: Stefano Stabellini , "qemu-devel@nongnu.org" , Don Slutz , "xen-devel@lists.xen.org" On Tue, Jun 09, 2015 at 10:58:26AM +0000, Paul Durrant wrote: > > -----Original Message----- > > From: Michael S. Tsirkin [mailto:mst@redhat.com] > > Sent: 09 June 2015 11:52 > > To: Paul Durrant > > Cc: Don Slutz; qemu-devel@nongnu.org; xen-devel@lists.xen.org; Stefano > > Stabellini > > Subject: Re: [PATCH v2 0/4] Fix device listener interface for PCI to PCI bridges > > > > On Tue, Jun 09, 2015 at 09:18:49AM +0000, Paul Durrant wrote: > > > > -----Original Message----- > > > > From: Michael S. Tsirkin [mailto:mst@redhat.com] > > > > Sent: 09 June 2015 10:13 > > > > To: Don Slutz > > > > Cc: qemu-devel@nongnu.org; xen-devel@lists.xen.org; Paul Durrant; > > > > Stefano Stabellini > > > > Subject: Re: [PATCH v2 0/4] Fix device listener interface for PCI to PCI > > bridges > > > > > > > > On Mon, Jun 08, 2015 at 05:18:48PM -0400, Don Slutz wrote: > > > > > changes v1 to v2: > > > > > Split v1 patch into 3. > > > > > > > > > > Added a BUG FIX patch (#1: "exec: Do not use MemoryRegion after > > > > > free"). > > > > > > > > > > Technically this bug fix should be a separate patch, however this > > > > > issue only seems to reproduce when this patch set is applied. > > > > > > > > > > > > > > > Michael S. Tsirkin: > > > > > "You need some other API that makes sense, probably PCI specific." > > > > > This is basically patch #2: "Extend device listener interface..." > > > > > > > > > > "This is relying on undocumented assumptions and how specific > > > > > firmware works. There's nothing special about bus number 255, > > > > > and 0 is not very special either (except it happens to be the > > > > > reset value)." > > > > > Dropped all checking of 0 and 255. > > > > > > > > > > > > > > > Open question by Michael S. Tsirkin: > > > > > > > > > > >>>> On Thu, May 28, 2015 at 07:25:50AM -0400, Don Slutz wrote: > > > > > ... > > > > > >>>> It is not clear to me that the complexity of tracking bus > > > > > >>>> visibility make sense. Clearly you do. > > > > > >>> Well what was the point of the change? > > > > > > > > > > > > To get config cycles that are valid that you do not get today. > > > > > > > > > > > >>> If you don't care that we get irrelevant config cycles why not > > > > > >>> just send them all to QEMU? > > > > > >>> > > > > > > > > > > > > That would need to be answered by Paul Durrant and/or other > > people > > > > (see > > > > > > below) > > > > > > > > > > > > > > > > We could broadcast config space ioreqs to all emulators, the problem > > > > > is how do we know (in the case of a read) which emulator is actually > > > > > the one supplying the data? At some level Xen needs to know who is > > > > > implementing what. > > > > > > > > > > Paul Durrant > > > > > > > > Can irrelevant emulators all respond with some kind of nack? > > > > Xen would pick the one that did respond correctly. > > > > > > > > > > I guess that's possible if we add an extra bit to the ioreq_t, but QEMU > > would still need to know when to nack and when to ack. > > > > It's simple: ack if we find a device handling the specific BDF. > > The result would at least be contained. > > OTOH detecting master aborts in core is useful since it would > > let us implement error reporting correctly. > > > > > > > It's still much simpler if qemu updates Xen with exact set of (S)BDFs it's > > handling. > > > > > > Paul > > > > > > I suspect this calls for a bigger change, you need to re-scan > > all of the tree to detect visible devices. > > Maybe just write some xen-specific code to do this on each > > config access. > > Well, that's the thing really... what triggers the re-scan. Do we really need to scan on each access or is there a way to know when the topology is changed? Doing the former doesn't really sound wonderfully efficient and, if the answer to the second is yes, then that's the time to update Xen with the currently valid set of BDFs. > > Paul Several things can trigger a topology change. One other option is switching to a memory API for config accesses, then using a memory listener to detect topology changes. That would be a lot of work I'm afraid. -- MST