mirror of https://github.com/xemu-project/xemu.git
pc,virtio: fixes for 2.4
pc and virtio changes, bugfixes only. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJVo6kaAAoJECgfDbjSjVRpEvcH/jiNHGHD+AzFSJ6+vcKH8MHY GVyWxvnFimyusnv74c7nwTsRGjRycKCPFy8GN/ZX+VWpIpPwK9mysBQ97zM45xeM T+w1eT4zXafZESr6coAaUu6AvPnVPmsx2im6j5LxBnyIzj41D7dydOM0dU/OHOSI gUS2DlhqqRPqkB2LscIrkkCmiWpizxTACzZzrko+AuTZ6YVTOEWcnRps9gqR+MWF o24uppNPIkkmKoWBbXEiTfTqy7rcWydCb/BiM0UMo2cTOeXESNiaQNbKL2ED8K5d 187sL9XCkBrImh4NOFMy4ZKsJ7Uy9zg+zpk03XbjMF+7S155Fcacp2ahDtuCoDA= =DITH -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/mst/tags/for_upstream' into staging pc,virtio: fixes for 2.4 pc and virtio changes, bugfixes only. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> # gpg: Signature made Mon Jul 13 13:03:38 2015 BST using RSA key ID D28D5469 # gpg: Good signature from "Michael S. Tsirkin <mst@kernel.org>" # gpg: aka "Michael S. Tsirkin <mst@redhat.com>" * remotes/mst/tags/for_upstream: pc: fix reuse of pc-i440fx-2.4 in pc-i440fx-2.3 Revert "virtio-net: enable virtio 1.0" virtio-pci: don't crash on illegal length qdev: fix 64 bit properties Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
f3a1b5068c
|
@ -130,7 +130,7 @@ PropertyInfo qdev_prop_bit = {
|
|||
|
||||
static uint64_t qdev_get_prop_mask64(Property *prop)
|
||||
{
|
||||
assert(prop->info == &qdev_prop_bit);
|
||||
assert(prop->info == &qdev_prop_bit64);
|
||||
return 0x1ull << prop->bitnr;
|
||||
}
|
||||
|
||||
|
|
|
@ -492,7 +492,7 @@ DEFINE_I440FX_MACHINE(v2_4, "pc-i440fx-2.4", NULL,
|
|||
|
||||
static void pc_i440fx_2_3_machine_options(MachineClass *m)
|
||||
{
|
||||
pc_i440fx_machine_options(m);
|
||||
pc_i440fx_2_4_machine_options(m);
|
||||
m->alias = NULL;
|
||||
m->is_default = 0;
|
||||
SET_MACHINE_COMPAT(m, PC_COMPAT_2_3);
|
||||
|
|
|
@ -466,7 +466,6 @@ static uint64_t virtio_net_get_features(VirtIODevice *vdev, uint64_t features)
|
|||
}
|
||||
|
||||
if (!get_vhost_net(nc->peer)) {
|
||||
virtio_add_feature(&features, VIRTIO_F_VERSION_1);
|
||||
return features;
|
||||
}
|
||||
return vhost_net_get_features(get_vhost_net(nc->peer), features);
|
||||
|
|
|
@ -546,7 +546,8 @@ static void virtio_write_config(PCIDevice *pci_dev, uint32_t address,
|
|||
off = le32_to_cpu(cfg->cap.offset);
|
||||
len = le32_to_cpu(cfg->cap.length);
|
||||
|
||||
if (len <= sizeof cfg->pci_cfg_data) {
|
||||
if (len == 1 || len == 2 || len == 4) {
|
||||
assert(len <= sizeof cfg->pci_cfg_data);
|
||||
virtio_address_space_write(&proxy->modern_as, off,
|
||||
cfg->pci_cfg_data, len);
|
||||
}
|
||||
|
@ -570,7 +571,8 @@ static uint32_t virtio_read_config(PCIDevice *pci_dev,
|
|||
off = le32_to_cpu(cfg->cap.offset);
|
||||
len = le32_to_cpu(cfg->cap.length);
|
||||
|
||||
if (len <= sizeof cfg->pci_cfg_data) {
|
||||
if (len == 1 || len == 2 || len == 4) {
|
||||
assert(len <= sizeof cfg->pci_cfg_data);
|
||||
virtio_address_space_read(&proxy->modern_as, off,
|
||||
cfg->pci_cfg_data, len);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ extern PropertyInfo qdev_prop_arraylen;
|
|||
}
|
||||
#define DEFINE_PROP_BIT64(_name, _state, _field, _bit, _defval) { \
|
||||
.name = (_name), \
|
||||
.info = &(qdev_prop_bit), \
|
||||
.info = &(qdev_prop_bit64), \
|
||||
.bitnr = (_bit), \
|
||||
.offset = offsetof(_state, _field) \
|
||||
+ type_check(uint64_t, typeof_field(_state, _field)), \
|
||||
|
|
Loading…
Reference in New Issue