Skip to contentSkip to conversation

qdev: fix 64 bit properties

PATCH In review Cornelia Huck 4 participants 6 messages Jul 9, 2015 – Jul 13, 2015

lore
Share & tools
lore
#0 lore raw

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.

Fixes fdba6d96 ("qdev: add 64bit properties")
---
 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
index e9e686f..04fd80a 100644
@@ -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
index 0cfff1c..77538a8 100644
@@ -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
Tested-by on v1 1/1
#1 lore raw

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 0x31000000000006d4 which is obviously bogus). Fix this.

Fixes fdba6d96 ("qdev: add 64bit properties")

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
index e9e686f..04fd80a 100644
@@ -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
index 0cfff1c..77538a8 100644
@@ -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)),       \
#2 lore raw
In reply to 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 0x31000000000006d4 which is obviously bogus). Fix this.

Fixes fdba6d96 ("qdev: add 64bit properties")
---
 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
index e9e686f..04fd80a 100644
@@ -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
index 0cfff1c..77538a8 100644
@@ -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)),       \
#3 lore raw
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 0x31000000000006d4 which is obviously bogus). Fix this.

Quoted 8 lines
Quoted 6 lines
Fixes fdba6d96 ("qdev: add 64bit properties")
---
 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

#4 lore raw
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 0x31000000000006d4 which is obviously bogus). Fix this.

Fixes fdba6d96 ("qdev: add 64bit properties")
---
 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
Acked-by
#5 lore raw
Quoted 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 0x31000000000006d4 which is obviously bogus). Fix this.

Fixes fdba6d96 ("qdev: add 64bit properties")
---
 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,