From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZD9ae-0005LB-4W for qemu-devel@nongnu.org; Thu, 09 Jul 2015 07:02:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZD9aZ-0007Uc-40 for qemu-devel@nongnu.org; Thu, 09 Jul 2015 07:02:04 -0400 Received: from mail-wg0-x22e.google.com ([2a00:1450:400c:c00::22e]:35833) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZD9aY-0007Td-Rw for qemu-devel@nongnu.org; Thu, 09 Jul 2015 07:01:59 -0400 Received: by wgjx7 with SMTP id x7so220004230wgj.2 for ; Thu, 09 Jul 2015 04:01:58 -0700 (PDT) Date: Thu, 9 Jul 2015 12:01:55 +0100 From: Stefan Hajnoczi Message-ID: <20150709110155.GF28530@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="GLp9dJVi+aaipsRk" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] using MSIX for virtio-blk List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Naredula Janardhana Reddy Cc: qemu-devel@nongnu.org --GLp9dJVi+aaipsRk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 07, 2015 at 10:50:59PM +0530, Naredula Janardhana Reddy wrote: > How to enable MSIX for virtio-blk, this is to avoid extra use of > VIRTIO_PCI_ISR port reads. > This is for qemu 2.3.0 with virtio-blk-pci with x-data-plane is on. I tried the following with QEMU 2.3.0: qemu-system-x86_64 -enable-kvm -m 1024 \ -drive if=none,id=drive0,file=test.img,format=raw,aio=native,cache=none \ -object iothread,id=iothread0 \ -device virtio-blk-pci,drive=drive0,iothread=iothread0 Inside the guest I checked /proc/interrupts and found that the virtio-pci/virtio-blk driver is using MSI. I also checked /proc/ioports and found the virtio-pci registers at 0xc040. Then I used "perf record -a -e kvm:kvm_pio" on the host to record all PIO accesses. Inside the guest I ran "dd if=/dev/vda of=/dev/null iflag=direct bs=4k" for about 30 seconds. Afterwards I ran "perf script" on the host and subtracted the 0xc040 base address from the PIO accesses to identify the virtio-pci registers. I didn't see any accesses to the ISR register, only writes to the QUEUE_NOTIFY register. Either your guest operating system is not enabling MSI or you are using QEMU command-line options that prevent MSI. --GLp9dJVi+aaipsRk Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJVnlSjAAoJEJykq7OBq3PI288IAJyUsYDHc94XaXjGP+B77So6 gbPDWvIHIY4uw9vusbvF/4d1k23ghRPoVZBKmE3/wYAh3oSCzcrTWXx1XsywrogM NuUJpAcAHenvc7whHeZgLMEI8GLCi63WxIsjruMQLdiL73PHVAlcAzxvwfuKc06K XS3UUEBGhHXTDiBLFeZLQw6ngjtZKuWF+7nkYeTfUFdGgzPD0FfKndUTO14lZSWp n8VKmNAqMDtWvTNHAkt6Fa+uupsg5l+ILWVNE9aCMsKPfN3k4i9446VthhsrRjQs QN8e+2H4A4K8gosEkDpMgHjc+9ZfH/MERD3HA7jZxG+u0c+aksRGsyds8e+VtBc= =elEa -----END PGP SIGNATURE----- --GLp9dJVi+aaipsRk--