How to catch SINTx interrupt sent by Windows Server 2008 hypervisor?

Hi, all NT driver experts,

I’m doing some hypercall experiments on Windows Server 2008. Although from another discussion thread (titled “WinHV WDK Library”) I knew that it is not recommended (by Jake) that we use hypercall to build end-to-end tasks due to VM state issue, I’m still doing the experiment just to have a feeling how hypercall is used.

My question is, according to the documents, hypervisor will signal a SINTx interrupt after it posts a message to a partition. But how do I catch that interrupt in my driver?

More specifically, I read that the SINTx is associated with an interrupt vector. So it looks like I should somehow get an unused interrupt vector, register my ISR with the vector, and fill that vector in the SINTx register. Right?

But, there are some facts with my driver. My driver which calls the hypercall is a KMDF driver. Moreover, because its only purpose is to call the hypercalls, it is written as a software-only, non-PnP driver which does not manage any hardware (and whose device object is created as a KMDF control device object). Therefore, the EvtDevicePrepareHardware callback, which a PnP driver gets its device hardware resource information from PnP Manager, won’t get called for my non-PnP driver, and therefore my driver cannot get the “assigned” hardware resources, including the interrupt vector.

On the other hand, I also read that IoReportResourceForDetection and IoReportDetectedDevice could be used for non-PnP driver to request for hardware resources, but my question is how do I know which interrupt vector is unused for me to fill in the CM_RESOURCE_LIST structure?

Lastly, I’m thinking since my purpose is to register my ISR with some interrupt vector, maybe there is some simpler way to bypass the above mechanisms? For example, any simpler, more direct kernel routines which can achieve this purpose?

Thanks a lot for any input!

Best regards,
Chengwei

If the interrupts are associated with the virtualized APIC then you can
define an inf file for a virtualized device that claims the interrupt
resource, if it is enumerated in the enum registry key. Too bad the docs
aren’t clearer. This WinHec presentation certainly (despite Jake’s
knowledgeable assertions otherwise) leads one to believe that all of this HV
stuff is exposed to us outside the campus types:
http://download.microsoft.com/download/5/b/9/5b97017b-e28a-4bae-ba48-174cf47d23cd/VIR046_WH06.ppt

On Wed, Jun 18, 2008 at 1:29 AM, wrote:

> Hi, all NT driver experts,
>
> I’m doing some hypercall experiments on Windows Server 2008. Although from
> another discussion thread (titled “WinHV WDK Library”) I knew that it is not
> recommended (by Jake) that we use hypercall to build end-to-end tasks due to
> VM state issue, I’m still doing the experiment just to have a feeling how
> hypercall is used.
>
> My question is, according to the documents, hypervisor will signal a SINTx
> interrupt after it posts a message to a partition. But how do I catch that
> interrupt in my driver?
>
> More specifically, I read that the SINTx is associated with an interrupt
> vector. So it looks like I should somehow get an unused interrupt vector,
> register my ISR with the vector, and fill that vector in the SINTx register.
> Right?
>
> But, there are some facts with my driver. My driver which calls the
> hypercall is a KMDF driver. Moreover, because its only purpose is to call
> the hypercalls, it is written as a software-only, non-PnP driver which does
> not manage any hardware (and whose device object is created as a KMDF
> control device object). Therefore, the EvtDevicePrepareHardware callback,
> which a PnP driver gets its device hardware resource information from PnP
> Manager, won’t get called for my non-PnP driver, and therefore my driver
> cannot get the “assigned” hardware resources, including the interrupt
> vector.
>
> On the other hand, I also read that IoReportResourceForDetection and
> IoReportDetectedDevice could be used for non-PnP driver to request for
> hardware resources, but my question is how do I know which interrupt vector
> is unused for me to fill in the CM_RESOURCE_LIST structure?
>
> Lastly, I’m thinking since my purpose is to register my ISR with some
> interrupt vector, maybe there is some simpler way to bypass the above
> mechanisms? For example, any simpler, more direct kernel routines which can
> achieve this purpose?
>
> Thanks a lot for any input!
>
> Best regards,
> Chengwei
>
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy

Hi, all,

In case there are people interested in this thread, I’ve seemed to find the way to catch the SINTx interrupt and read the SINTx messages. But as it took me a whole week of tries and errors, I need some time to clear it up before I can post my experiences here.

Best regards,
Chengwei