qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>,
	Peter Maydell <peter.maydell@linaro.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PULL 1/4] qdev: fix 64 bit properties
Date: Mon, 13 Jul 2015 15:23:39 +0300	[thread overview]
Message-ID: <1436790197-18666-2-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1436790197-18666-1-git-send-email-mst@redhat.com>

From: Cornelia Huck <cornelia.huck@de.ibm.com>

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")
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/hw/qdev-properties.h | 2 +-
 hw/core/qdev-properties.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/hw/qdev-properties.h b/include/hw/qdev-properties.h
index 0cfff1c..77538a8 100644
--- a/include/hw/qdev-properties.h
+++ b/include/hw/qdev-properties.h
@@ -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)),       \
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index e9e686f..04fd80a 100644
--- a/hw/core/qdev-properties.c
+++ b/hw/core/qdev-properties.c
@@ -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;
 }
 
-- 
MST

  reply	other threads:[~2015-07-13 12:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-13 12:23 [Qemu-devel] [PULL 0/4] pc,virtio: fixes for 2.4 Michael S. Tsirkin
2015-07-13 12:23 ` Michael S. Tsirkin [this message]
2015-07-13 12:23 ` [Qemu-devel] [PULL 2/4] virtio-pci: don't crash on illegal length Michael S. Tsirkin
2015-07-13 12:23 ` [Qemu-devel] [PULL 3/4] Revert "virtio-net: enable virtio 1.0" Michael S. Tsirkin
2015-07-13 12:23 ` [Qemu-devel] [PULL 4/4] pc: fix reuse of pc-i440fx-2.4 in pc-i440fx-2.3 Michael S. Tsirkin
2015-07-13 13:42 ` [Qemu-devel] [PULL 0/4] pc,virtio: fixes for 2.4 Peter Maydell
  -- strict thread matches above, loose matches on Subject: below --
2015-07-13 12:04 Michael S. Tsirkin
2015-07-13 12:04 ` [Qemu-devel] [PULL 1/4] qdev: fix 64 bit properties Michael S. Tsirkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436790197-18666-2-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=armbru@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).