]> git.karo-electronics.de Git - karo-tx-linux.git/commit
kvm tools: Fix MSI-X table size set up
authorAsias He <asias.hejun@gmail.com>
Thu, 27 Oct 2011 13:14:33 +0000 (21:14 +0800)
committerPekka Enberg <penberg@kernel.org>
Thu, 27 Oct 2011 13:59:50 +0000 (16:59 +0300)
commit77060db6b083715ec28115248c1b0effe429281e
tree3660d49e072c7586d20b39587f357d7cc1956e85
parent27a91b385edbaf29c3cce644650eb75028fc9d3c
kvm tools: Fix MSI-X table size set up

We at most have VIRTIO_PCI_MAX_VQ entries for virt queue,
VIRTIO_PCI_MAX_CONFIG entries for config.

To quote the PCI spec:

    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.

So, we should set table size to

    VIRTIO_PCI_MAX_VQ + VIRTIO_PCI_MAX_CONFIG - 1

not

    VIRTIO_PCI_MAX_VQ + VIRTIO_PCI_MAX_CONFIG

Acked-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Asias He <asias.hejun@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/include/kvm/virtio-pci.h
tools/kvm/virtio/pci.c