Re: [PATCH qxl-wddm-dod v4 04/10] Code Analysis fix

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

 



> 
> The PAGED_CODE macro ensures that the calling thread is running at an
> IRQL that is low enough to permit paging. A call to this macro should
> be made at the beginning of every driver routine that either contains
> pageable code or accesses pageable code.
> 
> Based on a patch by Sandy Stutsman <sstutsma@xxxxxxxxxx>
> 
> Signed-off-by: Sameeh Jubran <sameeh@xxxxxxxxxx>
> ---
>  qxldod/QxlDod.cpp | 89
>  ++++++++++++++++++++++++++++++++++++++++++++++++++-----
>  1 file changed, 81 insertions(+), 8 deletions(-)
> 
> diff --git a/qxldod/QxlDod.cpp b/qxldod/QxlDod.cpp
> index 93fd8c6..5659e87 100755
> --- a/qxldod/QxlDod.cpp
> +++ b/qxldod/QxlDod.cpp
> @@ -3,7 +3,7 @@
>  #include "qxl_windows.h"
>  
>  #pragma code_seg(push)
> -#pragma code_seg()
> +#pragma code_seg("PAGE")
>  
>  #define WIN_QXL_INT_MASK ((QXL_INTERRUPT_DISPLAY) | \
>                            (QXL_INTERRUPT_CURSOR) | \
> @@ -61,6 +61,7 @@ QxlDod::QxlDod(_In_ DEVICE_OBJECT* pPhysicalDeviceObject) :
> m_pPhysicalDevice(pP
>                                                              m_MonitorPowerState(PowerDeviceD0),
>                                                              m_AdapterPowerState(PowerDeviceD0)
>  {
> +    PAGED_CODE();
>      DbgPrint(TRACE_LEVEL_INFORMATION, ("---> %s\n", __FUNCTION__));
>      *((UINT*)&m_Flags) = 0;
>      RtlZeroMemory(&m_DxgkInterface, sizeof(m_DxgkInterface));

Looking at the final file looks like that code segments are not
set correctly.
In particular before this method there is a

  #pragma code_seg(pop)

line that reverts the segment to the default one which is non-paged
while this method is supposed to be paged.

Maybe using __declspec(code_seg...) could help? (or maybe I'm wrong).

Frediano
_______________________________________________
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]