PCI: Difference between revisions

m
→‎Enabling MSI-X: Clean up section
[unchecked revision][unchecked revision]
m (→‎Enabling MSI: Clean up section)
m (→‎Enabling MSI-X: Clean up section)
Line 1,204:
! register !! offset !! bits 31-24 !! bits 23-16 !! bits 15-8 !! bits 7-3 !! bits 2-0
|-
| capCap +00 0x0
| capCap +00 0x0
| colspan="2" | Message Control
| Next ptrPointer
| colspan="2" | Capability ID = 11
|-
| capCap +01 0x1
| capCap +04 0x4
| colspan="4" | Table Offset
| colspan="1" | BIR
|-
| capCap +02 0x2
| capCap +08 0x8
| colspan="4" | Pending Bit Offset
| colspan="1" | Pending Bit BIR
|}
 
Unlike MSI, MSI-X supports 2048 interrupts. This is achieved by maintaining a table of interrupts in the PCI device's address space. The wording of the PCI 3.0 specspecification indicates that this ''must'' be via a Memory BAR.
 
'''BIR''' specifies which BAR is used for the Message Table. This may be a 64 -bit BAR, and is zero-indexed (so BIR=0, BAR0, offset 10h0x10 into the header).
 
'''Table Offset''' is an offset into that BAR where the Message Table lives. Note that it is 8 -byte aligned - so simply mask BIR.
 
The format of Message Control is as follows:
{| {{wikitable}}
|-
! Bit 15 !! Bit 14 !! BitBits 13-11 !! BitBits 10-0
|-
| Enable
Line 1,238:
|}
 
'''Table Size''' is N - 1 encoded, and is the number of entries in the MSI-X table. This field is Read-Only.
 
Now you have all the information you need to find the MSI-X table:
{| {{wikitable}}
|-
! BitBits 127-96 !! BitBits 95-64 !! BitBits 63-32 !! BitBits 31-0
|-
| Vector Control (0)
Line 1,260:
| ...
|-
| Vector Control (N - 1)
| Message Data (N - 1)
| Message Address High (N - 1)
| Message Address Low (N - 1)
|}
 
Line 1,269:
{| {{wikitable}}
|-
! BitBits 31-1 !! Bit 0
|-
| Reserved
Line 1,275:
|}
 
Note that '''Message Address''' is is DWORD4-byte aligned, so, again, mask the low bits. The interrupt is masked if '''Masked''' is set to 1.
 
Message Address and Data are as they were for MSI - architecture specific. However, unlike with MSI, you can specify independent vectors for all the interrupts, only limited by having the same upper 32 -bit message address.
 
== Multifunction Devices ==
73

edits