qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alon Levy <alevy@redhat.com>
To: qemu-devel@nongnu.org, kraxel@redhat.com
Subject: [Qemu-devel] [post 1.1 PATCH] hw/qxl: disallow non sync io for revision >= 3
Date: Wed,  9 May 2012 14:26:06 +0300	[thread overview]
Message-ID: <1336562766-25682-1-git-send-email-alevy@redhat.com> (raw)

The guest drivers should already know how to use async for revision 3.
But since it's still possible to have an older driver with revision 3
that doesn't check for the revision, require a new parameter
"force_async", which we can later turn to 1 by default.

Signed-off-by: Alon Levy <alevy@redhat.com>
---
 hw/qxl.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/hw/qxl.c b/hw/qxl.c
index 6c11e70..451e8e5 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1316,6 +1316,23 @@ static void ioport_write(void *opaque, target_phys_addr_t addr,
         return;
     }
 
+    if (d->force_async && d->revision >= 3) {
+        switch (io_port) {
+        case QXL_IO_UPDATE_AREA:
+        case QXL_IO_MEMSLOT_ADD:
+        case QXL_IO_CREATE_PRIMARY:
+        case QXL_IO_DESTROY_PRIMARY:
+        case QXL_IO_DESTROY_SURFACE_WAIT:
+        case QXL_IO_DESTROY_ALL_SURFACES:
+            qxl_guest_bug(d, "sync io %d not supported for revision >= 3",
+                          io_port);
+            return;
+            break;
+        default:
+            break;
+        }
+    }
+
     /* we change the io_port to avoid ifdeffery in the main switch */
     orig_io_port = io_port;
     switch (io_port) {
@@ -2036,6 +2053,7 @@ static Property qxl_properties[] = {
         DEFINE_PROP_UINT32("ram_size_mb",  PCIQXLDevice, ram_size_mb, -1),
         DEFINE_PROP_UINT32("vram_size_mb", PCIQXLDevice, vram32_size_mb, -1),
         DEFINE_PROP_UINT32("vram64_size_mb", PCIQXLDevice, vram_size_mb, -1),
+        DEFINE_PROP_UINT32("force_async", PCIQXLDevice, force_async, 0),
         DEFINE_PROP_END_OF_LIST(),
 };
 
-- 
1.7.10.1

             reply	other threads:[~2012-05-09 11:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-09 11:26 Alon Levy [this message]
2012-05-09 12:51 ` [Qemu-devel] [post 1.1 PATCH] hw/qxl: disallow non sync io for revision >= 3 Gerd Hoffmann
2012-05-09 13:16   ` Alon Levy

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=1336562766-25682-1-git-send-email-alevy@redhat.com \
    --to=alevy@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).