<s>
Message	O
Signalled	O
Interrupts	B-Application
(	O
MSI	O
)	O
are	O
an	O
alternative	O
in-band	O
method	O
of	O
signalling	O
an	O
interrupt	B-Application
,	O
using	O
special	O
in-band	O
messages	O
to	O
replace	O
traditional	O
out-of-band	B-Protocol
assertion	O
of	O
dedicated	O
interrupt	B-Application
lines	I-Application
.	O
</s>
<s>
While	O
more	O
complex	O
to	O
implement	O
in	O
a	O
device	O
,	O
message	O
signalled	O
interrupts	B-Application
have	O
some	O
significant	O
advantages	O
over	O
pin-based	O
out-of-band	B-Protocol
interrupt	B-Application
signalling	O
.	O
</s>
<s>
Message	B-Architecture
signaled	I-Architecture
interrupts	I-Architecture
are	O
supported	O
in	O
PCI	B-Protocol
bus	I-Protocol
since	O
its	O
version	O
2.2	O
,	O
and	O
in	O
later	O
available	O
PCI	B-Protocol
Express	O
bus	O
.	O
</s>
<s>
Some	O
non-PCI	O
architectures	O
also	O
use	O
message	O
signalled	O
interrupts	B-Application
.	O
</s>
<s>
Traditionally	O
,	O
a	O
device	O
has	O
an	O
interrupt	B-Application
line	I-Application
(	O
pin	O
)	O
which	O
it	O
asserts	O
when	O
it	O
wants	O
to	O
signal	O
an	O
interrupt	B-Application
to	O
the	O
host	O
processing	O
environment	O
.	O
</s>
<s>
This	O
traditional	O
form	O
of	O
interrupt	B-Application
signalling	O
is	O
an	O
out-of-band	B-Protocol
form	O
of	O
control	O
signalling	O
since	O
it	O
uses	O
a	O
dedicated	O
path	O
to	O
send	O
such	O
control	O
information	O
,	O
separately	O
from	O
the	O
main	O
data	O
path	O
.	O
</s>
<s>
MSI	O
replaces	O
those	O
dedicated	O
interrupt	B-Application
lines	I-Application
with	O
in-band	O
signalling	O
,	O
by	O
exchanging	O
special	O
messages	O
that	O
indicate	O
interrupts	B-Application
through	O
the	O
main	O
data	O
path	O
.	O
</s>
<s>
In	O
particular	O
,	O
MSI	O
allows	O
the	O
device	O
to	O
write	O
a	O
small	O
amount	O
of	O
interrupt-describing	O
data	O
to	O
a	O
special	O
memory-mapped	B-Architecture
I/O	I-Architecture
address	O
,	O
and	O
the	O
chipset	O
then	O
delivers	O
the	O
corresponding	O
interrupt	B-Application
to	O
a	O
processor	O
.	O
</s>
<s>
A	O
common	O
misconception	O
with	O
MSI	O
is	O
that	O
it	O
allows	O
the	O
device	O
to	O
send	O
data	O
to	O
a	O
processor	O
as	O
part	O
of	O
the	O
interrupt	B-Application
.	O
</s>
<s>
The	O
data	O
that	O
is	O
sent	O
as	O
part	O
of	O
the	O
memory	O
write	O
transaction	O
is	O
used	O
by	O
the	O
chipset	O
to	O
determine	O
which	O
interrupt	B-Application
to	O
trigger	O
on	O
which	O
processor	O
;	O
that	O
data	O
is	O
not	O
available	O
for	O
the	O
device	O
to	O
communicate	O
additional	O
information	O
to	O
the	O
interrupt	B-General_Concept
handler	I-General_Concept
.	O
</s>
<s>
As	O
an	O
example	O
,	O
PCI	B-Protocol
Express	O
does	O
not	O
have	O
separate	O
interrupt	B-Application
pins	O
at	O
all	O
;	O
instead	O
,	O
it	O
uses	O
special	O
in-band	O
messages	O
to	O
allow	O
pin	O
assertion	O
or	O
deassertion	O
to	O
be	O
emulated	O
.	O
</s>
<s>
Some	O
non-PCI	O
architectures	O
also	O
use	O
MSI	O
;	O
as	O
another	O
example	O
,	O
HP	O
GSC	B-Architecture
devices	O
do	O
not	O
have	O
interrupt	B-Application
pins	O
and	O
can	O
generate	O
interrupts	B-Application
only	O
by	O
writing	O
directly	O
to	O
the	O
processor	O
's	O
interrupt	B-Application
register	O
in	O
memory	O
space	O
.	O
</s>
<s>
The	O
HyperTransport	B-Device
protocol	O
also	O
supports	O
MSI	O
.	O
</s>
<s>
While	O
more	O
complex	O
to	O
implement	O
in	O
a	O
device	O
,	O
message	O
signalled	O
interrupts	B-Application
have	O
some	O
significant	O
advantages	O
over	O
pin-based	O
out-of-band	B-Protocol
interrupt	B-Application
signalling	O
.	O
</s>
<s>
While	O
this	O
is	O
no	O
advantage	O
to	O
the	O
standard	O
PCI	B-Protocol
connector	O
,	O
PCI	B-Protocol
Express	O
takes	O
advantage	O
of	O
these	O
savings	O
.	O
</s>
<s>
MSI	O
increases	O
the	O
number	O
of	O
interrupts	B-Application
that	O
are	O
possible	O
.	O
</s>
<s>
While	O
conventional	B-Protocol
PCI	I-Protocol
was	O
limited	O
to	O
four	O
interrupts	B-Application
per	O
card	O
(	O
and	O
,	O
</s>
<s>
because	O
they	O
were	O
shared	O
among	O
all	O
cards	O
,	O
most	O
are	O
using	O
only	O
one	O
)	O
,	O
message	O
signalled	O
interrupts	B-Application
allow	O
dozens	O
of	O
interrupts	B-Application
per	O
card	O
,	O
when	O
that	O
is	O
useful	O
.	O
</s>
<s>
In	O
software	O
,	O
a	O
pin-based	O
interrupt	B-Application
could	O
race	B-Operating_System
with	O
a	O
posted	B-Architecture
write	I-Architecture
to	O
memory	O
.	O
</s>
<s>
That	O
is	O
,	O
the	O
PCI	B-Protocol
device	O
would	O
write	O
data	O
to	O
memory	O
and	O
then	O
send	O
an	O
interrupt	B-Application
to	O
indicate	O
the	O
DMA	B-General_Concept
write	O
was	O
complete	O
.	O
</s>
<s>
However	O
,	O
a	O
PCI	B-Protocol
bridge	I-Protocol
or	O
memory	O
controller	O
might	O
buffer	O
the	O
write	O
in	O
order	O
to	O
not	O
interfere	O
with	O
some	O
other	O
memory	O
use	O
.	O
</s>
<s>
The	O
interrupt	B-Application
could	O
arrive	O
before	O
the	O
DMA	B-General_Concept
write	O
was	O
complete	O
,	O
and	O
the	O
processor	O
could	O
read	O
stale	O
data	O
from	O
memory	O
.	O
</s>
<s>
To	O
prevent	O
this	O
race	B-Operating_System
,	O
interrupt	B-General_Concept
handlers	I-General_Concept
were	O
required	O
to	O
read	O
from	O
the	O
device	O
to	O
ensure	O
that	O
the	O
DMA	B-General_Concept
write	O
had	O
finished	O
.	O
</s>
<s>
An	O
MSI	O
write	O
cannot	O
pass	O
a	O
DMA	B-General_Concept
write	O
,	O
so	O
the	O
race	B-Operating_System
is	O
eliminated	O
.	O
</s>
<s>
PCI	B-Protocol
defines	O
two	O
optional	O
extensions	O
to	O
support	O
Message	O
Signalled	O
Interrupts	B-Application
,	O
MSI	O
and	O
MSI-X	O
.	O
</s>
<s>
PCI	B-Protocol
Express	O
defines	O
its	O
own	O
message-based	O
mechanism	O
to	O
emulate	O
legacy	O
PCI	B-Protocol
interrupts	B-Application
.	O
</s>
<s>
MSI	O
(	O
first	O
defined	O
in	O
PCI	B-Protocol
2.2	I-Protocol
)	O
permits	O
a	O
device	O
to	O
allocate	O
1	O
,	O
2	O
,	O
4	O
,	O
8	O
,	O
16	O
or	O
32	O
interrupts	B-Application
.	O
</s>
<s>
The	O
device	O
is	O
programmed	O
with	O
an	O
address	O
to	O
write	O
to	O
(	O
generally	O
a	O
control	O
register	O
in	O
an	O
interrupt	B-Architecture
controller	I-Architecture
)	O
,	O
and	O
a	O
16-bit	O
data	O
word	O
to	O
identify	O
it	O
.	O
</s>
<s>
The	O
interrupt	B-Application
number	O
is	O
added	O
to	O
the	O
data	O
word	O
to	O
identify	O
the	O
interrupt	B-Application
.	O
</s>
<s>
Some	O
platforms	O
such	O
as	O
Windows	O
do	O
not	O
use	O
all	O
32	O
interrupts	B-Application
but	O
only	O
use	O
up	O
to	O
16	O
interrupts	B-Application
.	O
</s>
<s>
MSI-X	O
(	O
first	O
defined	O
in	O
PCI	B-Protocol
3.0	I-Protocol
)	O
permits	O
a	O
device	O
to	O
allocate	O
up	O
to	O
2048	O
interrupts	B-Application
.	O
</s>
<s>
In	O
particular	O
,	O
it	O
made	O
it	O
difficult	O
to	O
target	O
individual	O
interrupts	B-Application
to	O
different	O
processors	O
,	O
which	O
is	O
helpful	O
in	O
some	O
high-speed	O
networking	O
applications	O
.	O
</s>
<s>
MSI-X	O
allows	O
a	O
larger	O
number	O
of	O
interrupts	B-Application
and	O
gives	O
each	O
one	O
a	O
separate	O
target	O
address	O
and	O
data	O
word	O
.	O
</s>
<s>
Devices	O
with	O
MSI-X	O
do	O
not	O
necessarily	O
support	O
2048	O
interrupts	B-Application
.	O
</s>
<s>
Optional	O
features	O
in	O
MSI	O
(	O
64-bit	O
addressing	O
and	O
interrupt	B-Application
masking	O
)	O
are	O
also	O
mandatory	O
with	O
MSI-X	O
.	O
</s>
<s>
PCI	B-Protocol
Express	O
does	O
not	O
have	O
physical	O
interrupt	B-Application
pins	O
,	O
but	O
emulates	O
the	O
4	O
physical	O
interrupt	B-Application
pins	O
of	O
PCI	B-Protocol
via	O
dedicated	O
PCI	B-Protocol
Express	O
Messages	O
such	O
as	O
Assert_INTA	O
and	O
Deassert_INTC	O
.	O
</s>
<s>
Being	O
message-based	O
(	O
at	O
the	O
PCI	B-Protocol
Express	O
layer	O
)	O
,	O
this	O
mechanism	O
provides	O
some	O
,	O
but	O
not	O
all	O
,	O
of	O
the	O
advantages	O
of	O
the	O
PCI	B-Protocol
layer	O
MSI	O
mechanism	O
:	O
the	O
4	O
virtual	O
pins	O
per	O
device	O
are	O
no	O
longer	O
shared	O
on	O
the	O
bus	O
(	O
although	O
PCI	B-Protocol
Express	O
controllers	O
may	O
still	O
combine	O
legacy	O
interrupts	B-Application
internally	O
)	O
,	O
and	O
interrupt	B-Application
changes	O
no	O
longer	O
inherently	O
suffer	O
from	O
race	B-Operating_System
conditions	I-Operating_System
.	O
</s>
<s>
PCI	B-Protocol
Express	O
permits	O
devices	O
to	O
use	O
these	O
legacy	O
interrupt	B-Application
messages	O
,	O
retaining	O
software	O
compatibility	O
with	O
PCI	B-Protocol
drivers	O
,	O
but	O
they	O
are	O
required	O
to	O
also	O
support	O
MSI	O
or	O
MSI-X	O
in	O
the	O
PCI	B-Protocol
layer	O
.	O
</s>
<s>
On	O
Intel	O
systems	O
,	O
the	O
LAPIC	O
must	O
be	O
enabled	O
for	O
the	O
PCI	B-Protocol
(	O
and	O
PCI	B-Protocol
Express	O
)	O
MSI/MSI	O
-X	O
to	O
work	O
,	O
even	O
on	O
uniprocessor	O
(	O
single	O
core	O
)	O
systems	O
.	O
</s>
<s>
In	O
these	O
systems	O
,	O
MSIs	O
are	O
handled	O
by	O
writing	O
the	O
interrupt	B-Application
vector	O
directly	O
into	O
the	O
LAPIC	O
of	O
the	O
processor/core	O
that	O
needs	O
to	O
service	O
the	O
interrupt	B-Application
.	O
</s>
<s>
The	O
Intel	O
LAPICs	O
of	O
2009	O
supported	O
up	O
to	O
224	O
MSI-based	O
interrupts	B-Application
.	O
</s>
<s>
According	O
to	O
a	O
2009	O
Intel	O
benchmark	O
using	O
Linux	B-Operating_System
,	O
using	O
MSI	O
reduced	O
the	O
latency	O
of	O
interrupts	B-Application
by	O
a	O
factor	O
of	O
almost	O
three	O
when	O
compared	O
to	O
I/O	O
APIC	O
delivery	O
.	O
</s>
<s>
In	O
the	O
Microsoft	O
family	O
of	O
operating	O
systems	O
,	O
Windows	B-Application
Vista	I-Application
and	O
later	O
versions	O
have	O
support	O
for	O
both	O
MSI	O
and	O
MSI-X	O
.	O
</s>
<s>
Support	O
was	O
added	O
in	O
the	O
Longhorn	B-General_Concept
development	O
cycle	O
around	O
2004	O
.	O
</s>
<s>
MSI	O
is	O
not	O
supported	O
in	O
earlier	O
versions	O
like	O
Windows	B-Application
XP	I-Application
or	O
Windows	B-Application
Server	I-Application
2003	I-Application
.	O
</s>
<s>
Solaris	B-Application
Express	I-Application
6/05	O
released	O
in	O
2005	O
added	O
support	O
for	O
MSI	O
an	O
MSI-X	O
as	O
part	O
of	O
their	O
new	O
device	B-Application
driver	I-Application
interface	I-Application
(	O
DDI	O
)	O
interrupt	B-Application
framework	O
.	O
</s>
<s>
FreeBSD	B-Operating_System
6.3	O
and	O
7.0	O
released	O
in	O
2008	O
added	O
support	O
for	O
MSI	O
and	O
MSI-X	O
.	O
</s>
<s>
OpenBSD	B-Operating_System
5.0	O
released	O
in	O
2011	O
added	O
support	O
for	O
MSI	O
.	O
</s>
<s>
Linux	B-Operating_System
gained	O
support	O
for	O
MSI	O
and	O
MSI-X	O
around	O
2003	O
.	O
</s>
<s>
Linux	B-Operating_System
kernel	I-Operating_System
versions	O
before	O
2.6.20	O
are	O
known	O
to	O
have	O
serious	O
bugs	O
and	O
limitations	O
in	O
their	O
implementation	O
of	O
MSI/MSI	O
-X	O
.	O
</s>
<s>
Haiku	B-Language
gained	O
support	O
for	O
MSI	O
around	O
2010	O
.	O
</s>
<s>
NetBSD	B-Device
8.0	O
released	O
in	O
2018	O
added	O
support	O
for	O
MSI	O
and	O
MSI-X	O
.	O
</s>
