[Spice-devel] [PATCH 3/3] Fix corrupted ram data (e.g., release_ring), and unsynchronized worker, after driver is disabled and re-enabled.

Yonit Halperin yhalperi at redhat.com
Mon Jul 12 02:15:17 PDT 2010


On logoff in Win7 guest, and on switch user and login into Winxp guest,
the driver is disabled and re-enabled (while the miniport in not reset).
However, before the fix, all the draw objects, e.g., surfaces,
were still alive in the worker and the release ring still contained objects, while all the driver's data
was initialized. This caused blue screens, and panics in the worker.
---
 display/driver.c     |    1 +
 display/qxldd.h      |    1 +
 display/res.c        |    2 ++
 include/qxl_driver.h |    1 +
 miniport/qxl.c       |    1 +
 5 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/display/driver.c b/display/driver.c
index 7dce00e..ccbba11 100644
--- a/display/driver.c
+++ b/display/driver.c
@@ -790,6 +790,7 @@ BOOL PrepareHardware(PDev *pdev)
     pdev->destroy_all_surfaces_port = dev_info.destroy_all_surfaces_port;
     pdev->memslot_add_port = dev_info.memslot_add_port;
     pdev->memslot_del_port = dev_info.memslot_del_port;
+    pdev->reset_ram_draw_data_port = dev_info.reset_ram_draw_data_port;
 
     pdev->create_primary_port = dev_info.create_primary_port;
     pdev->destroy_primary_port = dev_info.destroy_primary_port;
diff --git a/display/qxldd.h b/display/qxldd.h
index ffa8b8c..f072388 100644
--- a/display/qxldd.h
+++ b/display/qxldd.h
@@ -286,6 +286,7 @@ typedef struct PDev {
     UINT32 memslot_add_port;
     UINT32 memslot_del_port;
     UINT32 destroy_all_surfaces_port;
+    UINT32 reset_ram_draw_data_port;
 
     UINT8* primary_memory_start;
     UINT32 primary_memory_size;
diff --git a/display/res.c b/display/res.c
index c769aeb..a87611c 100644
--- a/display/res.c
+++ b/display/res.c
@@ -398,6 +398,8 @@ static void InitRes(PDev *pdev)
     RingInit(&pdev->Res.dynamic->palette_lru);
     pdev->Res.num_palettes = 0;
 
+    WRITE_PORT_UCHAR(pdev->reset_ram_draw_data_port, 0);
+
     ONDBG(pdev->Res.num_outputs = 0);
     ONDBG(pdev->Res.num_path_pages = 0);
     ONDBG(pdev->Res.num_rects_pages = 0);
diff --git a/include/qxl_driver.h b/include/qxl_driver.h
index 09856c4..fba84a6 100644
--- a/include/qxl_driver.h
+++ b/include/qxl_driver.h
@@ -91,6 +91,7 @@ typedef struct QXLDriverInfo {
     UINT32 memslot_add_port;
     UINT32 memslot_del_port;
     UINT32 destroy_all_surfaces_port;
+    UINT32 reset_ram_draw_data_port;
 
     UINT32 dev_id;
 
diff --git a/miniport/qxl.c b/miniport/qxl.c
index 1718913..09ac9a3 100644
--- a/miniport/qxl.c
+++ b/miniport/qxl.c
@@ -983,6 +983,7 @@ BOOLEAN StartIO(PVOID dev_extension, PVIDEO_REQUEST_PACKET packet)
             driver_info->destroy_primary_port = dev_ext->io_port + QXL_IO_DESTROY_PRIMARY;
             driver_info->memslot_add_port = dev_ext->io_port + QXL_IO_MEMSLOT_ADD;
             driver_info->memslot_del_port = dev_ext->io_port + QXL_IO_MEMSLOT_DEL;
+            driver_info->reset_ram_draw_data_port = dev_ext->io_port + QXL_IO_RESET_RAM_DRAW_DATA;
 
             driver_info->primary_surface_create = &dev_ext->ram_header->create_surface;
 
-- 
1.6.6.1



More information about the Spice-devel mailing list