qdev: fix 64 bit properties
PATCH 1/1 qdev: fix 64 bit properties
64 bit props used 32 bit callbacks in two places, leading to broken feature bits on virtio (example: got 0x31000000000006d4 which is obviously bogus). Fix this.
--- hw/core/qdev-properties.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
hw/core/qdev-properties.c +1 -1
@@ -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; }
include/hw/qdev-properties.h +1 -1
@@ -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)), \
Signature · 1 line
2.3.8
Am 09.07.2015 um 13:01 schrieb Cornelia Huck:
Quoted 6 lines
64 bit props used 32 bit callbacks in two places, leading to broken feature bits on virtio (example: got
0x31000000000006d4which is obviously bogus). Fix this.Fixes fdba6d96 ("qdev: add 64bit properties")Signed-off-by Cornelia Huck <[email protected]>
With that patch a pre-v1-patches save file loads and works. (Without this patch the guest loads, but virtio is broken and all I/O hangs)
Quoted 32 lines
--- hw/core/qdev-properties.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)hw/core/qdev-properties.c +1
-1@@ -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; }include/hw/qdev-properties.h +1
-1@@ -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)), \
Quoted 10 lines · On Thu, 9 Jul 2015 13:01:14 +0200 Cornelia Huck <[email protected]>…
64 bit props used 32 bit callbacks in two places, leading to broken feature bits on virtio (example: got
0x31000000000006d4which is obviously bogus). Fix this.Fixes fdba6d96 ("qdev: add 64bit properties")Signed-off-by Cornelia Huck <[email protected]>--- hw/core/qdev-properties.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Ping? I think this should go into 2.4-rc1.
Quoted 27 lines
hw/core/qdev-properties.c +1
-1@@ -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; }include/hw/qdev-properties.h +1
-1@@ -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)), \
Quoted 7 lines · Cornelia Huck
Quoted 4 lines · On Thu, 9 Jul 2015 13:01:14 +0200 Cornelia Huck <[email protected]>…
64 bit props used 32 bit callbacks in two places, leading to broken feature bits on virtio (example: got
0x31000000000006d4which is obviously bogus). Fix this.
Quoted 8 lines
Quoted 6 lines
Fixes fdba6d96 ("qdev: add 64bit properties")Signed-off-by Cornelia Huck <[email protected]>--- hw/core/qdev-properties.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)Ping? I think this should go into 2.4-rc1.
I'll queue it.
Paolo
Quoted 17 lines · Paolo Bonzini
Quoted 14 lines · Cornelia Huck
Quoted 10 lines · On Thu, 9 Jul 2015 13:01:14 +0200 Cornelia Huck <[email protected]>…
64 bit props used 32 bit callbacks in two places, leading to broken feature bits on virtio (example: got
0x31000000000006d4which is obviously bogus). Fix this.Fixes fdba6d96 ("qdev: add 64bit properties")Signed-off-by Cornelia Huck <[email protected]>--- hw/core/qdev-properties.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 5 lines
Quoted 1 line
Ping? I think this should go into 2.4-rc1.
I'll queue it.
Paolo
No need, I already have it queued. Want to send an ack?
Signature · 1 line
MST
Paolo Bonzini
Acked-byQuoted 18 lines · Michael S. Tsirkin
Quoted 17 lines · Paolo Bonzini
Quoted 14 lines · Cornelia Huck
Quoted 10 lines · On Thu, 9 Jul 2015 13:01:14 +0200 Cornelia Huck <[email protected]>…
64 bit props used 32 bit callbacks in two places, leading to broken feature bits on virtio (example: got
0x31000000000006d4which is obviously bogus). Fix this.Fixes fdba6d96 ("qdev: add 64bit properties")Signed-off-by Cornelia Huck <[email protected]>--- hw/core/qdev-properties.c | 2 +- include/hw/qdev-properties.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Ping? I think this should go into 2.4-rc1.
I'll queue it.
Paolo
No need, I already have it queued. Want to send an ack?
Sure,