Generate a MSI interrupt using memory write
Posted: Wed Feb 08, 2012 4:00 am
Hey folks,
AFAIK, the MSI/MSI-X allows device to generate an interrupt by writing the message data to an address. Instead of using device, is it possible to generate a fake interrupt by CPU doing a memory write to the same address with the assigned data?
My experiment:
I have a NIC card with the msi address:feeff00c and data: 41a2. So I wrote a kernel module mapping the physical address feeff00c to a virtual address and call iowrite32(virt_addr, 0x41a2) in order to generate an interrupt. From my understanding, this msi address is actually mapped to the CPU local apic and I assume a memory write to it will generate an interrupt to the cpu. I assume if it works, I can see a interrupt is generated from /proc/interrupts. However, no interrupt has been seen. Is calling iowrite(addr, data) to the msi addr the same as device doing the same thing? Otherwise why didn't I see any interrupt using CPU memory write?
My device information:
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 05)
Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
Address: feeff00c Data: 41a2
My /proc/iomem
fee00000-fee00fff : Local APIC
ff000000-ffffffff : reserved
Thanks a lot!
--- William
AFAIK, the MSI/MSI-X allows device to generate an interrupt by writing the message data to an address. Instead of using device, is it possible to generate a fake interrupt by CPU doing a memory write to the same address with the assigned data?
My experiment:
I have a NIC card with the msi address:feeff00c and data: 41a2. So I wrote a kernel module mapping the physical address feeff00c to a virtual address and call iowrite32(virt_addr, 0x41a2) in order to generate an interrupt. From my understanding, this msi address is actually mapped to the CPU local apic and I assume a memory write to it will generate an interrupt to the cpu. I assume if it works, I can see a interrupt is generated from /proc/interrupts. However, no interrupt has been seen. Is calling iowrite(addr, data) to the msi addr the same as device doing the same thing? Otherwise why didn't I see any interrupt using CPU memory write?
My device information:
00:19.0 Ethernet controller: Intel Corporation 82579LM Gigabit Network Connection (rev 05)
Capabilities: [90] MSI: Enable+ Count=1/1 Maskable- 64bit-
Address: feeff00c Data: 41a2
My /proc/iomem
fee00000-fee00fff : Local APIC
ff000000-ffffffff : reserved
Thanks a lot!
--- William