[PATCH qxl-wddm-dod v5 7/7] Fixing possible BSOD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Interrupts seem to arrive to the driver before the initialization phase
is over (m_pHWDevice = NULL), in that case we can't handle interrupts yet. Even
when m_pHWDevice isn't NULL, other fields aren't necessarly fully intialized till
the StartDevice function has finished initialization, thus the flag
DriverStarted should be checked upon interrupts.

Note: There is no way provided by microsoft to disable interrupts in WDDM
drivers.

Signed-off-by: Sameeh Jubran <sameeh@xxxxxxxxxx>
---
 qxldod/QxlDod.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
index 3fb30ce..7de64e9 100755
--- a/qxldod/QxlDod.cpp
+++ b/qxldod/QxlDod.cpp
@@ -62,6 +62,7 @@ QxlDod::QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject) : m_pPhysicalDevice(pP
     PAGED_CODE();
     DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s\n", __FUNCTION__));
     *((UINT*)&m_Flags) = 0;
+    m_Flags.DriverStarted = FALSE;
     RtlZeroMemory(&m_DxgkInterface, sizeof(m_DxgkInterface));
     RtlZeroMemory(&m_DeviceInfo, sizeof(m_DeviceInfo));
     RtlZeroMemory(m_CurrentModes, sizeof(m_CurrentModes));
@@ -1684,7 +1685,10 @@ VOID QxlDod::DpcRoutine(VOID)
 BOOLEAN QxlDod::InterruptRoutine(_In_  ULONG MessageNumber)
 {
     DbgPrint(TRACE_LEVEL_INFORMATION, ("<--> 0 %s\n", __FUNCTION__));
-    return m_pHWDevice->InterruptRoutine(&m_DxgkInterface, MessageNumber);
+    if (m_Flags.DriverStarted) {
+        return m_pHWDevice ? m_pHWDevice->InterruptRoutine(&m_DxgkInterface, MessageNumber) : FALSE;
+    }
+    return FALSE;
 }
 
 VOID QxlDod::ResetDevice(VOID)
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]