Received: from eggs.gnu.org ([2001:4830:134:3::10]:54079) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2XfL-00072k-RV for qemu-devel@nongnu.org; Tue, 17 May 2016 01:35:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2XfH-00072M-JX for qemu-devel@nongnu.org; Tue, 17 May 2016 01:35:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36242) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2XfH-00072I-Dy for qemu-devel@nongnu.org; Tue, 17 May 2016 01:35:31 -0400 Date: Tue, 17 May 2016 13:35:26 +0800 From: Peter Xu Message-ID: <20160517053526.GA3285@pxdev.xzpeter.org> References: <1463382800-25863-1-git-send-email-peterx@redhat.com> <20160516104802-mutt-send-email-mst@redhat.com> <20160516090005.GB17782@pxdev.xzpeter.org> <20160516121635-mutt-send-email-mst@redhat.com> <20160516095818.GC17782@pxdev.xzpeter.org> <20160516094428.51c641d7@t450s.home> <20160516201944-mutt-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160516201944-mutt-send-email-mst@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2] pci: fix pci_requester_id() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Alex Williamson , qemu-devel@nongnu.org, pbonzini@redhat.com, jan.kiszka@web.de, rkrcmar@redhat.com, Marcel Apfelbaum On Mon, May 16, 2016 at 08:20:46PM +0300, Michael S. Tsirkin wrote: [...] > > > Actually I am curious about how generic PCI system delivers > > > requester ID (if there is)... For PCIe, we have encoded TLP header, > > > and requester ID is filled in the specific field of the header. > > > However for legacy PCI system, all the data is transmitted via the > > > parallel interface (no matter 32/64 bits) and I found no place that > > > the requester ID can be included. I was assuming there is some way > > > for the root complex to know it (when request comes, the root > > > complex should be able to know where the request come from, or say, > > > its connected BDF). Never digger into the details, or am I wrong? > > > > There's no such thing as a requester ID on conventional PCI. We should > > probably be making use of pci_bus_is_express() to determine whether we > > have a valid requester ID and error if we hit pci_bus_is_root() and we > > still don't have an express bus. And as MST says, testing for > > bus number zero is not a valid test for the root bus. Thanks, > > > > Alex > > Well MSI code sticks the requester ID in the MSI message > unconditionally. It's typically later ignored by the the > PC machine type though. Yes, I can first detect root PCI bus type as mentioned by Alex, and fill in SID_INVALID if it's a conventional PCI root complex. -- peterx