I have a piece of logic in my test platform that needs to be allocated a MSI address and data register.
Unfortunately, my logic is not a PCI function so I cannot use IoConnectInterruptEx. Other than not being a PCI function, the interrupt behaves exactly the same as a MSI interrupt.
How do I allocate an interrupt vector in Windows kernel mode?.
I see this structure called PCI_MSIX_TABLE_CONFIG_INTERFACE that looks like the one I might want.
Would this structure and the associated infrastructure (IRP_MN_QUERY_INTERFACE) allow me to do what I want?.
I am willing to restrict myself to windows 7, vista and server 2008.
>Unfortunately, my logic is not a PCI function so I cannot use
What do you mean non PCI function? To use MSI / MSI-X interrupt your device need to be a PCI base. And to get a PCI_MSIX_TABLE_CONFIG_INTERFACE your driver has to send a IRP_MN_QUERY_INTERFACE request to a PCI bus driver. Could you clarify what kind of device you using?
Igor Sharovar
There are really two answers to your question.
-
You can add MSI resource requirements either by changing the bus driver
which enumerates your driver to add them in response to
IRP_MN_QUERY_RESOURCE_REQUIREMENTS or you can add them in your FDO in
response to IRP_MN_FILTER_RESOURCE_REQUIREMENTS. This will cause the PnP
manager to allocate MSI resources to your device (if the underlying
processors and chipset support them.) Then you call IoConnectInterruptEx
with your PDO and you’ll get your ISR attached to the IDT entries that you
now own.
-
There is no such thing as “MSI” or “MSI-X” outside of the PCI specs.
When the machine is running with an IOMMU (AMD’s or Intel’s, makes no
difference) the IOMMU may filter any interrupts which haven’t been
specifically permitted. And since the permissions are based on the PCI
Requester ID (RID) which is observed at the IOMMU, your device which has no
RID (or has one which you’re not exposing) can’t be enabled and your driver
will fail.
For now, there are no versions of Windows for sale which enable the IOMMUs
which are present in most of today’s chipsets. This has to change if we
decide to allow virtual machines to own PCI Express devices (or just virtual
functions.) So your device may function for another version of Windows
simply because we haven’t yet brought this sort of technology to market.
Don’t expect this to last.
–
Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group
This post implies no warranties and confers no rights.
wrote in message news:xxxxx@ntdev…
> I have a piece of logic in my test platform that needs to be allocated a
> MSI address and data register.
>
> Unfortunately, my logic is not a PCI function so I cannot use
> IoConnectInterruptEx. Other than not being a PCI function, the interrupt
> behaves exactly the same as a MSI interrupt.
>
> How do I allocate an interrupt vector in Windows kernel mode?.
>
> I see this structure called PCI_MSIX_TABLE_CONFIG_INTERFACE that looks
> like the one I might want.
>
> Would this structure and the associated infrastructure
> (IRP_MN_QUERY_INTERFACE) allow me to do what I want?.
>
> I am willing to restrict myself to windows 7, vista and server 2008.
>
Jake, thanks for the reply.
Actually, i kind of misspoke. The device can access PCI bus and present bus mastering and interrupt requests. It is just not visible in the PCI configuration or enumeration tree so I cannot load a function driver to create a PDO for it.
The device has a MSR data and address register that it expects software to program that it will then use to inject interrupts when certain events happen in the system.
Given the above, how would I requests a MSI vector from the OS(I know the chipset and platform support it)?.
Thanks,
RK
I believe your device has to be in PCI driver stack to get MSI vector. Otherwise I don’t know how PCI bus driver would control your device.
Igor Sharovar
Make your device enumerate on pci and all of your problems are solved
d
Sent from my phone with no t9, all spilling mistakes are not intentional.
-----Original Message-----
From: xxxxx@hotmail.com
Sent: Saturday, September 26, 2009 10:50 AM
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Allocating MSI / MSI-X interrupt vectors for non-PCI devices
Jake, thanks for the reply.
Actually, i kind of misspoke. The device can access PCI bus and present bus mastering and interrupt requests. It is just not visible in the PCI configuration or enumeration tree so I cannot load a function driver to create a PDO for it.
The device has a MSR data and address register that it expects software to program that it will then use to inject interrupts when certain events happen in the system.
Given the above, how would I requests a MSI vector from the OS(I know the chipset and platform support it)?.
Thanks,
RK
—
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
That doesn’t change the answers. If your device isn’t PCI compliant, then
it might as well not be PCI at all.
–
Jake Oshins
Hyper-V I/O Architect
Windows Kernel Group
This post implies no warranties and confers no rights.
wrote in message news:xxxxx@ntdev…
> Jake, thanks for the reply.
>
> Actually, i kind of misspoke. The device can access PCI bus and present
> bus mastering and interrupt requests. It is just not visible in the PCI
> configuration or enumeration tree so I cannot load a function driver to
> create a PDO for it.
>
> The device has a MSR data and address register that it expects software to
> program that it will then use to inject interrupts when certain events
> happen in the system.
>
> Given the above, how would I requests a MSI vector from the OS(I know the
> chipset and platform support it)?.
>
> Thanks,
> RK
>
> The device can access PCI bus and present bus mastering and interrupt requests. It is just not visible
in the PCI configuration or enumeration tree
But how is it accessible by the OS then??? Let’s face it - it has to be detected somehow somewhere, because otherwise there is no chance for the OS to discover its memory or IO space range and find out which pin it signals interrupts via (or discover its MSI capability)…
so I cannot load a function driver to create a PDO for it.
Function drivers don’t create PDOs - if a driver creates PDO it is already a bus driver as far as its child PDO is concerned, although it will be a function driver in a stack where its FDO is attached.
In this context , PDO will be created by whoever enumerates your device (although, judging from what your are saying, it is not so obvious to me who does it and whether your device gets recongnized by the OS at all), and you will have to attach your FDO, map its memory, connect interrupts,etc…
Anton Bassov