From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF1JQ-0002rU-Nz for qemu-devel@nongnu.org; Mon, 20 Jun 2016 11:40:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bF1JJ-0002Ke-Ax for qemu-devel@nongnu.org; Mon, 20 Jun 2016 11:40:29 -0400 Received: from mail-pa0-x243.google.com ([2607:f8b0:400e:c03::243]:36355) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bF1JJ-0002KW-3F for qemu-devel@nongnu.org; Mon, 20 Jun 2016 11:40:25 -0400 Received: by mail-pa0-x243.google.com with SMTP id fg1so11257254pad.3 for ; Mon, 20 Jun 2016 08:40:22 -0700 (PDT) Date: Mon, 20 Jun 2016 11:40:17 -0400 From: Ido Yariv Message-ID: <20160620154017.GA12442@WorkStation.localdomain> References: <1466282525-3018-1-git-send-email-ido@wizery.com> <87a99e71-d9b8-4c73-cced-6edf11a485a6@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87a99e71-d9b8-4c73-cced-6edf11a485a6@redhat.com> Subject: Re: [Qemu-devel] [PATCH] i386: pci-assign: Fix MSI-X table size List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" , Richard Henderson , Eduardo Habkost , Alex Williamson Hi Paolo, On Mon, Jun 20, 2016 at 04:54:17PM +0200, Paolo Bonzini wrote: > On 18/06/2016 22:42, Ido Yariv wrote: > > The current code creates a whole page mmio region for the MSI-X table > > size. > > > > However, the page containing the MSI-X table may contain other registers > > not related to MSI-X. Creating an mmio region for the whole page masks > > such registers and may break drivers in the guest OS. > > > > Since maximal number of entries is known, use that instead to deduce the > > table size when setting up the mmio region. > > > > Signed-off-by: Ido Yariv > > I can take this patch, but I'd like to warn you that pci-assign is > deprecated (and replaced by VFIO). I seem to recall VFIO does this > correctly, but it would be great if you could check that. Just gave it a quick shot and everything seems to be working fine with VFIO, thanks! > Also, I would prefer the mmap/munmap to keep using MSIX_PAGE_SIZE, just > to limit the number of things that could break. I believe there might be another issue with this. The number of entries can be up to 2048, so the MSI-X table size can theoretically exceed one page and take up to 8 pages. We can just modify MSIX_PAGE_SIZE to 0x8000, but wouldn't it be better to just map exactly what we need? Cheers, Ido.