From a3e69910c4381ef1543da98e010223f407ee3eb9 Mon Sep 17 00:00:00 2001 From: Sheng Yang <sheng@linux.intel.com> Date: Thu, 21 May 2009 17:08:57 -0700 Subject: [PATCH 19/25] kvm: qemu: Fix wrong counting of MSI-X table size MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit The PCI spec says... System software reads this field to determine the MSI-X Table Size *N*, which is encoded as *N-1*. For example, a returned value of “00000000011” indicates a table size of 4. Signed-off-by: Sheng Yang <sheng@linux.intel.com> Signed-off-by: Avi Kivity <avi@redhat.com> (cherry picked from commit f321d497b6e53903a37e26989d95e1620c7c78ac) Signed-off-by: Chris Wright <chrisw@redhat.com> Bugzilla: 498085 Message-Id: <1242950943-30180-20-git-send-email-chrisw@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> RH-Upstream-status: applied Acked-by: Juan Quintela <quintela@redhat.com> Acked-by: Marcelo Tosatti <mtosatti@redhat.com> Acked-by: Don Dutile <ddutile@redhat.com> --- qemu/hw/device-assignment.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/qemu/hw/device-assignment.c b/qemu/hw/device-assignment.c index 09228f4..5476daf 100644 --- a/qemu/hw/device-assignment.c +++ b/qemu/hw/device-assignment.c @@ -818,6 +818,7 @@ static int assigned_dev_update_msix_mmio(PCIDevice *pci_dev) entries_max_nr = pci_dev->config[pos + 2]; entries_max_nr &= PCI_MSIX_TABSIZE; + entries_max_nr += 1; /* Get the usable entry number for allocating */ for (i = 0; i < entries_max_nr; i++) { -- 1.6.3.rc4.29.g8146