pci,virtio fixes for 1.6

This includes some last-minute bugfixes for 1.6.
 All very small patches that also look very safe to me.
 
 Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.13 (GNU/Linux)
 
 iQEcBAABAgAGBQJSCKrZAAoJECgfDbjSjVRpzWsH/2vJswTENyE1ws/fgs3QIxM/
 YNGpOkxXGtfLB8EgkSchdEFytFidDE7VJZA/maRS3jY1/vZbd54qjlfBSaoWa27l
 eaLMqjr5vdFQXJMn4WS1Fhv2HEiTRame8RxvCkLvv3SU87QzDxbwdvgTNUsDSREJ
 OUBZLqEpyK5mf7e/qdFxxFUWuOGAfbQhMw3A8jYYxNbmczbSvawA/qthTgsXiyW4
 t5Kak2GzQ5W5yLhhe3PhdoD/9XnG0qFKP2ZGha/PcrQjAi+7oCZl2qJ55V5MTHl8
 mh8Q1Qpp/5SDeo6kKNVBQ5ysF9iUbrPxog44LnkVgX4F8/282/birt6VfeyKZbg=
 =U+hn
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'mst/tags/for_anthony' into staging

pci,virtio fixes for 1.6

This includes some last-minute bugfixes for 1.6.
All very small patches that also look very safe to me.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>

# gpg: Signature made Mon 12 Aug 2013 04:28:57 AM CDT using RSA key ID D28D5469
# gpg: Can't check signature: public key not found

# By Michael S. Tsirkin (2) and others
# Via Michael S. Tsirkin
* mst/tags/for_anthony:
  vhost: clear signalled_used_valid on vhost stop
  virtio: clear signalled_used_valid when switching from dataplane
  i82801b11: Fix i82801b11 PCI host bridge config space
  pc: disable pci-info for 1.6

Message-id: 1376308831-19978-1-git-send-email-mst@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Anthony Liguori 2013-08-12 08:32:55 -05:00
commit 3ee1ee80d2
7 changed files with 23 additions and 4 deletions

View File

@ -249,12 +249,17 @@ static void pc_init_pci(QEMUMachineInitArgs *args)
initrd_filename, cpu_model, 1, 1);
}
static void pc_init_pci_1_5(QEMUMachineInitArgs *args)
static void pc_init_pci_1_6(QEMUMachineInitArgs *args)
{
has_pci_info = false;
pc_init_pci(args);
}
static void pc_init_pci_1_5(QEMUMachineInitArgs *args)
{
pc_init_pci_1_6(args);
}
static void pc_init_pci_1_4(QEMUMachineInitArgs *args)
{
has_pvpanic = false;
@ -340,7 +345,7 @@ static QEMUMachine pc_i440fx_machine_v1_6 = {
.name = "pc-i440fx-1.6",
.alias = "pc",
.desc = "Standard PC (i440FX + PIIX, 1996)",
.init = pc_init_pci,
.init = pc_init_pci_1_6,
.hot_add_cpu = pc_hot_add_cpu,
.max_cpus = 255,
.is_default = 1,

View File

@ -217,12 +217,17 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
}
}
static void pc_q35_init_1_5(QEMUMachineInitArgs *args)
static void pc_q35_init_1_6(QEMUMachineInitArgs *args)
{
has_pci_info = false;
pc_q35_init(args);
}
static void pc_q35_init_1_5(QEMUMachineInitArgs *args)
{
pc_q35_init_1_6(args);
}
static void pc_q35_init_1_4(QEMUMachineInitArgs *args)
{
has_pvpanic = false;
@ -234,7 +239,7 @@ static QEMUMachine pc_q35_machine_v1_6 = {
.name = "pc-q35-1.6",
.alias = "q35",
.desc = "Standard PC (Q35 + ICH9, 2009)",
.init = pc_q35_init,
.init = pc_q35_init_1_6,
.hot_add_cpu = pc_hot_add_cpu,
.max_cpus = 255,
DEFAULT_MACHINE_OPTIONS,

View File

@ -90,6 +90,7 @@ static void i82801b11_bridge_class_init(ObjectClass *klass, void *data)
k->device_id = PCI_DEVICE_ID_INTEL_82801BA_11;
k->revision = ICH9_D2P_A2_REVISION;
k->init = i82801b11_bridge_initfn;
k->config_write = pci_bridge_write_config;
set_bit(DEVICE_CATEGORY_BRIDGE, dc->categories);
}

View File

@ -52,6 +52,7 @@ bool vring_setup(Vring *vring, VirtIODevice *vdev, int n)
void vring_teardown(Vring *vring, VirtIODevice *vdev, int n)
{
virtio_queue_set_last_avail_idx(vdev, n, vring->last_avail_idx);
virtio_queue_invalidate_signalled_used(vdev, n);
hostmem_finalize(&vring->hostmem);
}

View File

@ -762,6 +762,7 @@ static void vhost_virtqueue_stop(struct vhost_dev *dev,
fflush(stderr);
}
virtio_queue_set_last_avail_idx(vdev, idx, state.num);
virtio_queue_invalidate_signalled_used(vdev, idx);
assert (r >= 0);
cpu_physical_memory_unmap(vq->ring, virtio_queue_get_ring_size(vdev, idx),
0, virtio_queue_get_ring_size(vdev, idx));

View File

@ -1065,6 +1065,11 @@ void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx)
vdev->vq[n].last_avail_idx = idx;
}
void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n)
{
vdev->vq[n].signalled_used_valid = false;
}
VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n)
{
return vdev->vq + n;

View File

@ -237,6 +237,7 @@ hwaddr virtio_queue_get_used_size(VirtIODevice *vdev, int n);
hwaddr virtio_queue_get_ring_size(VirtIODevice *vdev, int n);
uint16_t virtio_queue_get_last_avail_idx(VirtIODevice *vdev, int n);
void virtio_queue_set_last_avail_idx(VirtIODevice *vdev, int n, uint16_t idx);
void virtio_queue_invalidate_signalled_used(VirtIODevice *vdev, int n);
VirtQueue *virtio_get_queue(VirtIODevice *vdev, int n);
uint16_t virtio_get_queue_index(VirtQueue *vq);
int virtio_queue_get_id(VirtQueue *vq);