From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmJYF-00053k-Nd for qemu-devel@nongnu.org; Wed, 14 Oct 2015 06:44:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZmJYB-00039M-KD for qemu-devel@nongnu.org; Wed, 14 Oct 2015 06:44:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZmJYB-000397-EU for qemu-devel@nongnu.org; Wed, 14 Oct 2015 06:44:51 -0400 Date: Wed, 14 Oct 2015 13:44:47 +0300 From: "Michael S. Tsirkin" Message-ID: <20151014133313-mutt-send-email-mst@redhat.com> References: <20151014112515-mutt-send-email-mst@redhat.com> <00d201d1065c$c1f1eb30$45d5c190$@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00d201d1065c$c1f1eb30$45d5c190$@samsung.com> Subject: Re: [Qemu-devel] [PATCH v2 0/3] Make KVM/MSI code device-ID-aware List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Fedin Cc: 'Peter Maydell' , qemu-devel@nongnu.org, 'Paolo Bonzini' On Wed, Oct 14, 2015 at 11:46:02AM +0300, Pavel Fedin wrote: > Hello! > > > I'm confused by pci changes. It's all arm specific stuff leaking > > out to pci core. > > But... How else would you implement it? I tried to do this as abstract as possible. Just pass device pointer to functions which > will use it. Or, would you like to override all these functions for ARM architecture? That would be a huge code duplication. And, > still, they would need PCI device specifier, which they don't have, and what patch 0003 takes care about. > > > Maybe it was a mistake to put stream id in struct MemTxAttrs: there's > > still nothing using it. > > It will be used by ITS emulation too. Take a look at RFC, ITS code injects it into the kernel together with MSI data. Also, i know > that it has something to do with SMMU too, so, if we ever implement ARM SMMU, we'll likely have to deal with them too. > Presence of device ID pretty well emulates what the hardware does - it just sends this ID along with PCI transaction. > We will use it as soon as we either: > a) Get kernel API approved > b) Get software GICv3 emulation from Shlomo, then i'll be able to rebase my old software-emulated ITS on top of that. > > > How about we stick PCIDevice * (or even DeviceState *) there? > > "there" = where? In MemTxAttrs? Would it be good to have 64-bit pointer instead of 16-bit ID there? It is passed by value, and > current version fits into register even on 32-bit host. OK, so we could rename stream id to requester id. That at least would make sense at the pci level, and would make it unique per hierarchy. But I suspect all these optimizations break later when we need to support multiple root complex devices. > Kind regards, > Pavel Fedin > Expert Engineer > Samsung Electronics Research center Russia >