From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57743) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHRpP-0000CK-Va for qemu-devel@nongnu.org; Wed, 13 Aug 2014 02:14:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHRpI-00041g-G3 for qemu-devel@nongnu.org; Wed, 13 Aug 2014 02:14:31 -0400 Received: from thoth.sbs.de ([192.35.17.2]:54039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHRpI-00041X-5V for qemu-devel@nongnu.org; Wed, 13 Aug 2014 02:14:24 -0400 Received: from mail1.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.14.3/8.14.3) with ESMTP id s7D6ELeA032450 for ; Wed, 13 Aug 2014 08:14:21 +0200 Message-ID: <53EB023C.5050305@siemens.com> Date: Wed, 13 Aug 2014 08:14:20 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <72E8820D80E4B94AB8DA5A287D013A7C1B2DD792@DENBGAT9EI5MSX.ww902.siemens.net> In-Reply-To: <72E8820D80E4B94AB8DA5A287D013A7C1B2DD792@DENBGAT9EI5MSX.ww902.siemens.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] MSI-X interrupt emulation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Danzer, Uwe" Cc: "qemu-devel@nongnu.org" On 2014-08-01 08:22, Danzer, Uwe wrote: > Hi there, > > I'm implementing an emulated PCIe Memory class device, but can't get MSI-X interrupt emulation working. > > So far, the card appears in the guest system and the driver for the card recognises it and the emulation of 1MB of accessible r/w registers works as desired. > > As the real card is connected to the outside world, it can signal events from there to the software via 5 MSI-X interrupts. Though I do not manage do get MSI-X emulation working in my implementation. > > The guest OS is QNX and works just fine on the real hardware. Running QNX as guest inside QEMU, the command pci -vvv (QNX equivalent of lspci on Linux) shows my card and that it says it's able to do the desired 5 MSI-X interrupts, but the QNX driver doesn't activate MSI-X for the card. > I suppose the config space layouts are identical between emulated and real card? Just in case the QNX driver has hard-coded capability offsets (it shouldn't, but who knows). Do you have the source code of the driver? > In my init function of the PCIe card, I try to make MSI-X available with this code: > > ret = msix_init_exclusive_bar (dev, 5, 1); > if (ret) { > printf("msix_init() failed\n"); > } else { > int i; > > for (i = 0; i < 5; i++) { > msix_vector_use (dev, i); > } > > msix = 1; > } > > Can someone tell me, what is wrong or missing in my code or does somebody have a minimal example for a (pseudo)device with MSI-X? If the problem still persists and you can't share your code here, drop me an email directly, and I can have a look or suggest further instrumentations. Jan -- Siemens AG, Corporate Technology, CT RTC ITP SES-DE Corporate Competence Center Embedded Linux