OSDN Git Service

pci: remove hard-coded bar size in msix_init_exclusive_bar()
authorJason Wang <jasowang@redhat.com>
Thu, 23 Apr 2015 06:21:49 +0000 (14:21 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Mon, 27 Apr 2015 19:02:41 +0000 (21:02 +0200)
commita0ccd2123ee2f83a1f081e4c39013c3316f9ec7a
treea725055c1c60171140587dfe95f056c81b309d77
parent851c2a75a6e80c8aa5e713864d98cfb512e7229b
pci: remove hard-coded bar size in msix_init_exclusive_bar()

This patch lets msix_init_exclusive_bar() can calculate the bar and
pba size based on the number of MSI-X vectors other than using a
hard-coded limit 4096. This is needed to allow device to have more
than 128 MSI_X vectors. To keep migration compatibility, keep using
4096 as bar size and 2048 for pba offset.

Notes: We don't care about the case that using vectors > 128 for
legacy machine type. Since we limit the queue max to 64, so vectors >=
65 is meaningless.

Virtio device will be the first user for this.

Cc: Keith Busch <keith.busch@intel.com>
Cc: Kevin Wolf <kwolf@redhat.com>
Cc: Stefan Hajnoczi <stefanha@redhat.com>
Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/pci/msix.c