From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Alon Levy <alevy@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 04/10] hw/qxl: ignore guest from guestbug until reset
Date: Fri, 22 Jun 2012 11:25:12 +0200 [thread overview]
Message-ID: <1340357118-17562-5-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1340357118-17562-1-git-send-email-kraxel@redhat.com>
From: Alon Levy <alevy@redhat.com>
soft_reset is called from any of:
* QXL_IO_RESET
* vga io
* pci reset handler
Signed-off-by: Alon Levy <alevy@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
hw/qxl.c | 13 ++++++++++++-
hw/qxl.h | 3 +++
2 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/hw/qxl.c b/hw/qxl.c
index 5a7be60..b5e53ce 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -141,6 +141,7 @@ static void qxl_ring_set_dirty(PCIQXLDevice *qxl);
void qxl_set_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
{
qxl_send_events(qxl, QXL_INTERRUPT_ERROR);
+ qxl->guest_bug = 1;
if (qxl->guestdebug) {
va_list ap;
va_start(ap, msg);
@@ -151,6 +152,10 @@ void qxl_set_guest_bug(PCIQXLDevice *qxl, const char *msg, ...)
}
}
+static void qxl_clear_guest_bug(PCIQXLDevice *qxl)
+{
+ qxl->guest_bug = 0;
+}
void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id,
struct QXLRect *area, struct QXLRect *dirty_rects,
@@ -572,7 +577,7 @@ static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
case QXL_MODE_NATIVE:
case QXL_MODE_UNDEFINED:
ring = &qxl->ram->cmd_ring;
- if (SPICE_RING_IS_EMPTY(ring)) {
+ if (qxl->guest_bug || SPICE_RING_IS_EMPTY(ring)) {
return false;
}
SPICE_RING_CONS_ITEM(qxl, ring, cmd);
@@ -980,6 +985,7 @@ static void qxl_soft_reset(PCIQXLDevice *d)
{
trace_qxl_soft_reset(d->id);
qxl_check_state(d);
+ qxl_clear_guest_bug(d);
if (d->id == 0) {
qxl_enter_vga_mode(d);
@@ -1297,6 +1303,10 @@ static void ioport_write(void *opaque, target_phys_addr_t addr,
qxl_async_io async = QXL_SYNC;
uint32_t orig_io_port = io_port;
+ if (d->guest_bug && !io_port == QXL_IO_RESET) {
+ return;
+ }
+
switch (io_port) {
case QXL_IO_RESET:
case QXL_IO_SET_MODE:
@@ -1749,6 +1759,7 @@ static int qxl_init_common(PCIQXLDevice *qxl)
qemu_mutex_init(&qxl->track_lock);
qemu_mutex_init(&qxl->async_lock);
qxl->current_async = QXL_UNDEFINED_IO;
+ qxl->guest_bug = 0;
switch (qxl->revision) {
case 1: /* spice 0.4 -- qxl-1 */
diff --git a/hw/qxl.h b/hw/qxl.h
index f2d4fdc..a4ab7cc 100644
--- a/hw/qxl.h
+++ b/hw/qxl.h
@@ -31,6 +31,9 @@ typedef struct PCIQXLDevice {
uint32_t debug;
uint32_t guestdebug;
uint32_t cmdlog;
+
+ uint32_t guest_bug;
+
enum qxl_mode mode;
uint32_t cmdflags;
int generation;
--
1.7.1
next prev parent reply other threads:[~2012-06-22 9:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-22 9:25 [Qemu-devel] [PULL 00/10] spice patch queue: qxl & vga bits Gerd Hoffmann
2012-06-22 9:25 ` [Qemu-devel] [PATCH 01/10] ui/spice-display.c: add missing initialization for valgrind Gerd Hoffmann
2012-06-22 9:25 ` [Qemu-devel] [PATCH 02/10] hw/qxl: s/qxl_guest_bug/qxl_set_guest_bug/ Gerd Hoffmann
2012-06-22 9:25 ` [Qemu-devel] [PATCH 03/10] qxl: stop dirty loging when not in vga mode Gerd Hoffmann
2012-06-22 9:25 ` Gerd Hoffmann [this message]
2012-06-22 9:25 ` [Qemu-devel] [PATCH 05/10] qxl: reset current_async on qxl_soft_reset Gerd Hoffmann
2012-06-22 9:25 ` [Qemu-devel] [PATCH 06/10] vga: raise xres+yres limits Gerd Hoffmann
2012-06-22 9:25 ` [Qemu-devel] [PATCH 07/10] vga: make vram size configurable Gerd Hoffmann
2012-06-22 9:25 ` [Qemu-devel] [PATCH 08/10] qxl: add vgamem_size_mb and vgamem_size Gerd Hoffmann
2012-06-22 9:25 ` [Qemu-devel] [PATCH 09/10] add pc-1.2 Gerd Hoffmann
2012-06-22 9:25 ` [Qemu-devel] [PATCH 10/10] vga: raise default vgamem size Gerd Hoffmann
-- strict thread matches above, loose matches on Subject: below --
2012-06-12 7:51 [Qemu-devel] [PATCH 00/10] spice/vga: make vga memory size configurable Gerd Hoffmann
2012-06-12 7:51 ` [Qemu-devel] [PATCH 04/10] hw/qxl: ignore guest from guestbug until reset Gerd Hoffmann
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=1340357118-17562-5-git-send-email-kraxel@redhat.com \
--to=kraxel@redhat.com \
--cc=alevy@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).