SlideShare a Scribd company logo
M. S. Ramaiah School of Advanced Studies 1
ESD2528 ASP Presentation
Anshuman Biswal
PT 2012 Batch, Reg. No.: CJB0412001
M. Sc. (Engg.) in Computer Science and Networking
Module Leader: Jishmi Jos Choondal
Module Name: Advanced System Programming
Module Code : ESD2528
Message Signaled Interrupts
M. S. Ramaiah School of Advanced Studies 2
Marking
Head Maximum Score
Technical Content 10
Grasp and Understanding 10
Delivery – Technical and
General Aspects
10
Handling Questions 10
Total 40
M. S. Ramaiah School of Advanced Studies 3
Presentation Outline
• What is interrupt?
• The old way to handle interrupts
• Improvement to be done for faster interrupt handling
• Introduction to MSI and its evolution
• Why MSI?
• PCI express system architecture.
• How to use MSI?
• Using MSI-X
• Handling devices implementing both MSI and MSI-X capabilities
• How to tell whether MSI/MSI-X is enabled on a device?
• How to disable MSI?
• Conclusion
M. S. Ramaiah School of Advanced Studies 4
What is Interrupt
• An interrupt is a hardware signal from a device to a CPU, informing
the CPU that the device needs attention and signalling that the CPU
should stop current processing and respond to the device.
• If the CPU is performing a task that has lower priority than the priority
of the interrupt, the CPU suspends its current thread. The CPU then
invokes the interrupt handler for the device that sent the interrupt
signal. The interrupt handler services the device, and when the
interrupt handler returns, the CPU resumes the processing it was doing
before the interrupt occurred.
• In order to appreciate the benefits of using Message Signaled
Interrupts, let’s first see how devices do interrupts in a legacy PC
M. S. Ramaiah School of Advanced Studies 5
The Old Way
Interrupt
ControllerI/O Device
I/O Device
I/O Device
I/O Device
IRR
IMR
ISR
CPU
INTR
INTA
system bus
main
memory
EFLAGS
ESP
EIP
IVT
ISR
APP
stack
IRQ0
IRQ1
IRQ2
• A device signals that it needs CPU service
• The Interrupt Controller signals the CPU
• The CPU responds with two INTA cycles
First INTA causes bit-changes in IRR and ISR
Second INTA puts ID-number on system bus
• CPU uses ID-number to lookup IVT entry
• CPU saves minimum context on its stack, adjusts EFLAGS, and jumps to specified ISR
M. S. Ramaiah School of Advanced Studies 6
Improvement to be done for faster interrupt handling
• Faster response to interrupts is possible if the old multi-step communication scheme can
be replaced by a single-step protocol
• Less expensive PCs can be manufactured if their total number of signal pins and the
physical interconnections can be reduced
• More devices can have their own ‘private’ interrupt(s) if signal lines aren’t required .
• So this brought the need for the development of a new system for handling interrupts in
a faster and efficient way. So MSI were developed for this. Message Signaling allows all
the needed information to arrive in a single package, and go directly from a device to the
CPU
I/O Device
system bus
CPU
main
memory
EFLAGS
ESP
EIP
IVT
ISR
APP
stackI/O Device
I/O Device
M. S. Ramaiah School of Advanced Studies 7
Introduction to MSI and its Evolution
• The PCI 2.2 specification introduced MSI as an alternative to traditional line-
based interrupts. Instead of using a dedicated pin to trigger interrupts, MSI
enables devices to trigger an interrupt by writing a specific value to a
particular address.
• The message destination address and message data are referred to as the
“vector” in MSI.
• The MSI capability was first specified in PCI 2.2 and was later enhanced
in PCI 3.0 to allow each interrupt to be masked individually. The MSI-X
capability was also introduced with PCI 3.0. It supports more interrupts
per device than MSI and allows interrupts to be independently configured.
• Devices may support both MSI and MSI-X, but only one can be enabled at
a time.
Introduced in
Conventional PCI
2.2
Incorporated into
PCI-X 1.0
Incorporated into
PCI Express Base
1.0
Introduced as
an ECN to
PCI 2.3
Incorporated
into PCI 3.0
Added to
PCI-X PT 2.0
via an EN
Added to PCI
Express Base
1.0a via ECN
MSI
MSI-X
M. S. Ramaiah School of Advanced Studies 8
Why MSI ?
• Pin based PCI interrupts are often shared amongst several devices.
To support this,the kernel must call each interrupt handler associated
with an interrupt,which leads to reduced performance for the system as a whole.
MSIs are never shared, so this problem cannot arise. Since they are not shared, thus an
MSI that is assigned to a device is guaranteed to be unique within the system.
• When a device writes data to memory, then raises a pin-based interrupt, it is possible
that the interrupt may arrive before all the data has arrived in memory (this becomes
more likely with devices behind PCI-PCI bridges). In order to ensure that all the data
has arrived in memory, the interrupt handler must read a register on the device which
raised the interrupt. PCI transaction ordering rules require that all the data arrive in
memory before the value may be returned from the register. Using MSIs avoids this
problem as the interrupt-generating write cannot pass the data writes, so by the time the
interrupt is raised, the driver knows that all the data has arrived in memory. So they can
send data along with the interrupt message and the data payload can vary.
• PCI devices can only support a single pin-based interrupt per function. Often drivers
have to query the device to find out what event has occurred, slowing down interrupt
handling for the common case. With MSI, a device can support more interrupts,
allowing each interrupt to be specialised to a different purpose.
M. S. Ramaiah School of Advanced Studies 9
PCI Express system Architecture
• A PCI function indicates its support for MSI via the MSI capability register. PCI express
specification defines two register format.
1. 64 bit MSI capability register format– required by all native PCI express devices
and optionally implemented by legacy end points.
MSI Control Register Pointer to Next ID Capability ID = 05h
Least Significant 32 bits of Message Address Register 00
Most Significant 32 bits of Message Address Register
Message Data Register
15 8 7 01631
2. 32 bit capability register format
MSI Control Register Pointer to Next ID Capability ID = 05h
Message Address Register 00
Message Data Register
15 8 7 01631
DWORD 0
DWORD 1
DWORD 2
DWORD 3
DWORD 0
DWORD 1
DWORD 2
M. S. Ramaiah School of Advanced Studies 10
PCI Express system Architecture
• The capability ID that identifies the MSI register set is 05h. This is a hardwired, read only
value.
• Point to Next new capability is the second byte of the register set that either points to the
next new capabilities register set or contains 00h if this is the end of the new capabilities
list. This is a hardwired, read only value. If non zero, it must be a dword-aligned value.
• Message Control Register
15 8 7 6 4 3 1 0
RESERVED 1 0 0 0 0 0 0 0
MSI ENABLE
Multiple Message Capable
Multiple Message Enable
64 bit Address Capable
Read only , Always Zero
M. S. Ramaiah School of Advanced Studies 11
PCI Express system Architecture
Bit(s) Field Name Description
15:08Reserved Read Only. Always Zero
764 bit Address Capable
Read Only.
0 = Function does not implement the upper 32 bits of the
message address register and is incapable of generating a
64 bit memory address.
1 = Function implements the upper 32 bits of the Message
Address Register and is capable of generating a 64 bit
memory address.
06:04Multiple Message Enable
Read/Write. After system software reads the Multiple
Message Capable field to determine how many messages
are requested by the device,it programs a 3 bit value into
this field indicating the actual number of messages
allocated to the device. The number allocated can be equal
to or less than the number actually requested. The state of
this field after reset is 000b. The field is encoded as follows:
Value Number of messages requested
000b 1
001b 2
010b 4
011b 8
100b 16
101b 32
110b Reserved
111b Reserved
M. S. Ramaiah School of Advanced Studies 12
Bits Field Name Description
03:01Multiple Message Capable
Read Only. System Software reads this field to
determine how many messages the device would
like to allocate to it. The requested number of
messages is a power of two, therefore a device that
would like three messages must request that four
messages be allocated to it. The field is allocated as
follows:
Value Number of Messages
requested
000b 1
001b 2
010b 4
011b 8
100b 16
101b 32
110b Reserved
111b Reserved
PCI Express system Architecture
M. S. Ramaiah School of Advanced Studies 13
PCI Express system Architecture
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
reserved
63 32
1 1 1 1 1 1 1 0 1 1 1 0
Destination
ID
0 0
D
M
R
H
31 20 19 12 11 4 3 2 1 0
DM = Destination Mode.If RH is 1 and DM is 0, the Destination ID field is in physical destination mode and only the
processor in the system that has the matching APIC ID is considered for delivery of that interrupt (this means no re-
direction). If RH is 1 and DM is 1, the Destination ID Field is interpreted as in logical destination mode and the redirection
is limited to only those processors that are part of the logical group of processors based on the processor’s logical APIC ID
and the Destination ID field in the message.
Specifies which processor in the system will be
the recipient of the Message Signaled Interrupt
RH = Redirection Hint (0 = the interrupt is directed to the processor
listed in the Destination ID field, 1= the interrupt is directed to the
processor with the lowest priority of the processors indicated in the
Destination ID field. Interpreting the Destination ID field for lowest
priority delivery takes the DM bit into account
MSI Address Register
This value locates
interrupts at the
1MB area with a
base address of 4G
– 18M. All
accesses to this
region are directed
as interrupt
messages. Care
must be taken to
ensure that noother
device claims the
region as I/O space.
Has a Constant
value 0xFEE
M. S. Ramaiah School of Advanced Studies 14
reserved
reserved
31 16
15 14 11 8 7 0
vector
Delivery
Mode
T
M
T
L
Trigger Mode (0=Edge, 1=Level)
Trigger Level (1=Assert, 0=Deassert)
Delivery Mode- how the interrupt is handled
000=Fixed 001=Lowest Priority
010=SMI 011=Reserved
100=NMI 101=INIT
110=Reserved 111=ExtINT
PCI Express system Architecture
MSI Data Register
contains the interrupt vector
associated with the message
M. S. Ramaiah School of Advanced Studies 15
• PCI devices are initialised to use pin-based interrupts. The device
driver has to set up the device to use MSI or MSI-X. Not all machines
support MSIs correctly, and for those machines, the APIs described
below will simply fail and the device will continue to use pin-based
interrupts.
• To support MSI or MSI X,
the kernel must be built with the CONFIG_PCI_MSI
option enabled. This option is only available on some architectures,
and it may depend on some other options also being set. For example,
on x86, you must also enable X86_UP_APIC or SMP in order to see
the CONFIG_PCI_MSI option.
• Most of the hard work is done for the driver in the PCI layer. It simply
has to request that the PCI layer set up the MSI capability for this
device.
How to use MSIs ?
M. S. Ramaiah School of Advanced Studies 16
How to use MSI-Programatically ?
• int pci_enable_msi(struct pci_dev *dev) : A successful call allocates ONE interrupt to the device,
regardless of how many MSIs the device supports. The device is switched from pin-based interrupt
mode to MSI mode. The dev->irq number is changed to a new number which represents the
message signaled interrupt; consequently, this function should be called before the driver calls
request_irq(), because an MSI is delivered via a vector that is different from the vector of a pin-
based interrupt.
• int pci_enable_msi_block(struct pci_dev *dev, int count): This call allows a device driver to
request multiple MSIs.The MSI specification only allows interrupts to be allocated in powers of two
upto a maximum of 2^5 (32). If this call returns 0 then it has succeeded in allocating at least as
many interrupts as the driver requested. In this case the function enables MSI on the device and
updates dev->irq to be the lowest of the new interrupts assigned to it. The other interrupts assigned
to the device are in the range dev->irq to dev->irq + count -1. If this functions returns a negative
number it indicates an error and the driver should not attempt to request any more MSI interrupts for
this device.If this function return a positive number ,it is less than count and indicates the number of
interrupts that could have been allocated.In both the case the irq value is not updated and the device
also doesnot switched to MSI mode.
• void pci_disable_msi(struct pci_dev *dev): This function should be used to undo the effect of
pci_enable_msi() orpci_enable_msi_block().Calling it restores dev->irq to the pin-based interrupt
number and frees the previously allocated message signaled interrupt(s).The interrupt may
subsequently be assigned to another device, so drivers should not cache the value of dev->irq.Before
calling this function, a device driver must always call free_irq() on any interrupt for which it
previously called request_irq().
M. S. Ramaiah School of Advanced Studies 17
Using MSI-X
• The MSI-X capability is much more flexible than the MSI capability.
• It supports up to 2048 interrupts, each of which can be controlled independently.To
support this flexibility, drivers must use an array of `struct msix_entry':
struct msix_entry {
u16 vector; /* kernel uses to write alloc vector */
u16 entry; /* driver uses to specify entry */
};
• int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec) :
Calling this function asks the PCI subsystem to allocate 'nvec' MSIs.The 'entries'
argument is a pointer to an array of msix_entry structs which should be at least 'nvec'
entries in size. On success, the device is switched into MSI-X mode and the function
returns 0. The 'vector' member in each entry is populated with the interrupt number;the
driver should then call request_irq() for each 'vector' that it decides to use. The device
driver is responsible for keeping track of the interrupts assigned to the MSI-X vectors so
it can free them again later. If this function returns a negative number, it indicates an
error and the driver should not attempt to allocate any more MSI-X interrupts for this
device. If it returns a positive number, it indicates the maximum number of interrupt
vectors that could have been allocated.
M. S. Ramaiah School of Advanced Studies 18
Using MSI-X
• void pci_disable_msix(struct pci_dev *dev): This function should be
used to undo the effect of pci_enable_msix(). It frees the previously
allocated message signaled interrupts. The interrupts may
subsequently be assigned to another device, so drivers should not
cache the value of the 'vector' elements over a call to
pci_disable_msix().Before calling this function, a device driver must
always call free_irq() on any interrupt for which it previously called
request_irq().Failure to do so results in a BUG_ON(), leaving the
device with MSI-X enabled and thus leaking its vector.
M. S. Ramaiah School of Advanced Studies 19
Handling devices implementing both MSI and MSI-
X capabilities
• If a device implements both MSI and MSI-X capabilities, it can run in
either MSI mode or MSI-X mode, but not both simultaneously. This is
a requirement of the PCI spec, and it is enforced by the PCI layer.
Calling pci_enable_msi() when MSI-X is already enabled or
pci_enable_msix() when MSI is already enabled results in an error. If a
device driver wishes to switch between MSI and MSI-X at runtime, it
must first inactive the device, then switch it back to pin-interrupt
mode, before calling pci_enable_msi() or pci_enable_msix() and
resuming operation.
M. S. Ramaiah School of Advanced Studies 20
How to tell whether MSI/MSI-X is enabled on a device?
• Using 'lspci -v' (as root) may show some devices with "MSI", "Message
Signalled Interrupts" or "MSI-X" capabilities. Each of these capabilities has
an 'Enable' flag which is followed with either "+" (enabled) or "-" (disabled).
• To find why MSIs are disabled on a device your first step should be to
examine your dmesg carefully to determine whether MSIs are enabled for your
machine. You should also check your .config to be sure you have enabled
CONFIG_PCI_MSI.Then, 'lspci -t' gives the list of bridges of a device.
Reading /sys/bus/pci/devices/*/msi_bus will tell you whether MSIs are
enabled (1) or disabled (0).If 0 is found in any of the msi_bus files belonging
to bridges between the PCI root and the device, MSIs are disabled.
M. S. Ramaiah School of Advanced Studies 21
How to disable MSI?
• The PCI stack provides three ways to disable MSIs:
– 1. globally
– 2. on all devices behind a specific bridge
– 3. on a single device
1. Disabling MSIs globally : Some host chipsets simply don't support MSIs properly. The
complete list of these is found near the quirk_disable_all_msi() function in
drivers/pci/quirks.c. If you have a board which has problems with MSIs, you can pass
pci=nomsi on the kernel command line to disable MSIs on all devices.
2. Disabling MSIs below a bridge: If you have a bridge unknown to Linux, you can enable
MSIs in configuration space using whatever method you know works,then enable MSIs on
that bridge by doing: echo 1 > /sys/bus/pci/devices/$bridge/msi_bus
where $bridge is the PCI address of the bridge you've enabled (eg 0000:00:0e.0).To
disable MSIs, echo 0 instead of 1. Changing this value should be done with caution as it
could break interrupt handling for all devices below this bridge.
3. Disabling MSIs on a single device:Some devices are known to have faulty MSI
implementations.Usually this is handled in the individual device driver.Some drivers have an
option to disable use of MSI.While this is a convenient workaround for the driver author,it is
not good practise, and should not be emulated.
M. S. Ramaiah School of Advanced Studies 22
Conclusion
• MSI and MSI-X are features of the PCI standard that deliver improved interrupt
handling especially for today’s multiprocessor and multi-core systems. MSI benefits
end users by:
– Enhancing overall system performance
– Reducing system overhead
– Lowering interrupt latency
– Improving host CPU utilization
– Increasing system reliability
• MSI-X further focuses on performance improvements by enhancing I/O scalability and
enabling better performance.
• If your device supports both MSI-X and MSI capabilities, you should use the MSI-X
facilities in preference to the MSI facilities because MSI-X supports any number of
interrupts between 1 and 2048. In contrast, MSI is restricted to a maximum of 32
interrupts (and must be a power of two). In addition, the MSI interrupt vectors must be
allocated consecutively, so the system might not be able to allocate as many vectors for
MSI as it could for MSI-X. On some platforms, MSI interrupts must all be targeted at
the same set of CPUs whereas MSI-X interrupts can all be targeted at different CPUs.
M. S. Ramaiah School of Advanced Studies 23
References
[1] The MSI driver Guide How To[Online] Available From:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-
2.6.git;a=blob;f=Documentation/PCI/MSI-HOWTO.txt;hb=HEAD
(Accessed:28 January 2013)
[2] IA-32 Intel® ArchitectureSoftware Developer’s Manual,Vol-3,2003
[3] Ravi,B.,Anderson,D.,Shanley,T.,Jow,W.(2003) PCI Express System
Archotecture,Addision-Wesley

More Related Content

What's hot

Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53
Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53
Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53
KarthiSugumar
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
shimosawa
 
Qemu Pcie
Qemu PcieQemu Pcie
Memory model
Memory modelMemory model
Memory model
Yi-Hsiu Hsu
 
PCIe DL_layer_3.0.1 (1)
PCIe DL_layer_3.0.1 (1)PCIe DL_layer_3.0.1 (1)
PCIe DL_layer_3.0.1 (1)
Rakeshkumar Sachdev
 
Introduction to armv8 aarch64
Introduction to armv8 aarch64Introduction to armv8 aarch64
Introduction to armv8 aarch64
Yi-Hsiu Hsu
 
Linux PCI device driver
Linux PCI device driverLinux PCI device driver
Linux PCI device driver
艾鍗科技
 
axi protocol
axi protocolaxi protocol
axi protocol
Azad Mishra
 
XPDDS17: Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...
XPDDS17:  Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...XPDDS17:  Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...
XPDDS17: Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...
The Linux Foundation
 
Pc ie tl_layer (3)
Pc ie tl_layer (3)Pc ie tl_layer (3)
Pc ie tl_layer (3)
Rakeshkumar Sachdev
 
Pci express modi
Pci express modiPci express modi
Pci express modi
proma_goswami
 
RISC-V Introduction
RISC-V IntroductionRISC-V Introduction
RISC-V Introduction
Yi-Hsiu Hsu
 
CXL chapter1 and chapter 2 presentation.pptx
CXL chapter1 and chapter 2 presentation.pptxCXL chapter1 and chapter 2 presentation.pptx
CXL chapter1 and chapter 2 presentation.pptx
kirankumarpalakurthi
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
Michelle Holley
 
SCSI Protocol
SCSI ProtocolSCSI Protocol
SCSI ProtocolRakesh T
 
Interrupts
InterruptsInterrupts
Interrupts
Anil Kumar Pugalia
 
AMBA 5 COHERENT HUB INTERFACE.pptx
AMBA 5 COHERENT HUB INTERFACE.pptxAMBA 5 COHERENT HUB INTERFACE.pptx
AMBA 5 COHERENT HUB INTERFACE.pptx
Sairam Chebrolu
 
Arm Processors Architectures
Arm Processors ArchitecturesArm Processors Architectures
Arm Processors Architectures
Mohammed Hilal
 
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_FinalGopi Krishnamurthy
 

What's hot (20)

Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53
Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53
Architecture Exploration of RISC-V Processor and Comparison with ARM Cortex-A53
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Qemu Pcie
Qemu PcieQemu Pcie
Qemu Pcie
 
Memory model
Memory modelMemory model
Memory model
 
PCIe DL_layer_3.0.1 (1)
PCIe DL_layer_3.0.1 (1)PCIe DL_layer_3.0.1 (1)
PCIe DL_layer_3.0.1 (1)
 
Introduction to armv8 aarch64
Introduction to armv8 aarch64Introduction to armv8 aarch64
Introduction to armv8 aarch64
 
Linux PCI device driver
Linux PCI device driverLinux PCI device driver
Linux PCI device driver
 
axi protocol
axi protocolaxi protocol
axi protocol
 
XPDDS17: Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...
XPDDS17:  Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...XPDDS17:  Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...
XPDDS17: Reworking the ARM GIC Emulation & Xen Challenges in the ARM ITS Emu...
 
Pc ie tl_layer (3)
Pc ie tl_layer (3)Pc ie tl_layer (3)
Pc ie tl_layer (3)
 
Pci express modi
Pci express modiPci express modi
Pci express modi
 
RISC-V Introduction
RISC-V IntroductionRISC-V Introduction
RISC-V Introduction
 
CXL chapter1 and chapter 2 presentation.pptx
CXL chapter1 and chapter 2 presentation.pptxCXL chapter1 and chapter 2 presentation.pptx
CXL chapter1 and chapter 2 presentation.pptx
 
DPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet ProcessingDPDK: Multi Architecture High Performance Packet Processing
DPDK: Multi Architecture High Performance Packet Processing
 
SCSI Protocol
SCSI ProtocolSCSI Protocol
SCSI Protocol
 
Interrupts
InterruptsInterrupts
Interrupts
 
Network Drivers
Network DriversNetwork Drivers
Network Drivers
 
AMBA 5 COHERENT HUB INTERFACE.pptx
AMBA 5 COHERENT HUB INTERFACE.pptxAMBA 5 COHERENT HUB INTERFACE.pptx
AMBA 5 COHERENT HUB INTERFACE.pptx
 
Arm Processors Architectures
Arm Processors ArchitecturesArm Processors Architectures
Arm Processors Architectures
 
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
03_03_Implementing_PCIe_ATS_in_ARM-based_SoCs_Final
 

Viewers also liked

Multipeer Connectivity Framework
Multipeer Connectivity FrameworkMultipeer Connectivity Framework
Multipeer Connectivity Framework
Jorge Ortiz
 
A Swift Path to Productivity
A Swift Path to ProductivityA Swift Path to Productivity
A Swift Path to Productivity
ibmmobile
 
Dyer Medicine 2.0 (2012)
Dyer Medicine 2.0 (2012)Dyer Medicine 2.0 (2012)
Dyer Medicine 2.0 (2012)
Jennifer Shine Dyer MD, MPH
 
Multipeer Connectivity
Multipeer ConnectivityMultipeer Connectivity
Multipeer Connectivity
waynehartman
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)
Kentaro Ebisawa
 
Observer Pattern
Observer PatternObserver Pattern
Observer Pattern
Anshuman Biswal
 
Pervasive Computing
Pervasive ComputingPervasive Computing
Pervasive Computing
Anshuman Biswal
 
Wireless Networking Security
Wireless Networking SecurityWireless Networking Security
Wireless Networking Security
Anshuman Biswal
 
Interconnection Network
Interconnection NetworkInterconnection Network
Interconnection Network
Ali A Jalil
 
SNMP
SNMPSNMP
Lecture 2
Lecture 2Lecture 2
Lecture 2Mr SMAK
 
Parallel Processors (SIMD)
Parallel Processors (SIMD) Parallel Processors (SIMD)
Parallel Processors (SIMD)
Ali Raza
 
Interrupts on xv6
Interrupts on xv6Interrupts on xv6
Interrupts on xv6
Takuya ASADA
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt AffinityについてTakuya ASADA
 

Viewers also liked (17)

Multipeer Connectivity Framework
Multipeer Connectivity FrameworkMultipeer Connectivity Framework
Multipeer Connectivity Framework
 
A Swift Path to Productivity
A Swift Path to ProductivityA Swift Path to Productivity
A Swift Path to Productivity
 
Dyer Medicine 2.0 (2012)
Dyer Medicine 2.0 (2012)Dyer Medicine 2.0 (2012)
Dyer Medicine 2.0 (2012)
 
Multipeer Connectivity
Multipeer ConnectivityMultipeer Connectivity
Multipeer Connectivity
 
20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)20111015 勉強会 (PCIe / SR-IOV)
20111015 勉強会 (PCIe / SR-IOV)
 
Observer Pattern
Observer PatternObserver Pattern
Observer Pattern
 
Pervasive Computing
Pervasive ComputingPervasive Computing
Pervasive Computing
 
Fibonacci Heap
Fibonacci HeapFibonacci Heap
Fibonacci Heap
 
Wireless Networking Security
Wireless Networking SecurityWireless Networking Security
Wireless Networking Security
 
Interconnection Network
Interconnection NetworkInterconnection Network
Interconnection Network
 
SNMP
SNMPSNMP
SNMP
 
Array Processor
Array ProcessorArray Processor
Array Processor
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Parallel Processors (SIMD)
Parallel Processors (SIMD) Parallel Processors (SIMD)
Parallel Processors (SIMD)
 
Parallel processing Concepts
Parallel processing ConceptsParallel processing Concepts
Parallel processing Concepts
 
Interrupts on xv6
Interrupts on xv6Interrupts on xv6
Interrupts on xv6
 
Interrupt Affinityについて
Interrupt AffinityについてInterrupt Affinityについて
Interrupt Affinityについて
 

Similar to Message Signaled Interrupts

Ppt on six month training on embedded system & IOT
Ppt on six month training on embedded system & IOTPpt on six month training on embedded system & IOT
Ppt on six month training on embedded system & IOT
preetigill309
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
Pratik Gohel
 
Low cost embedded system
Low cost embedded systemLow cost embedded system
Low cost embedded system
ece svit
 
VJITSk 6713 user manual
VJITSk 6713 user manualVJITSk 6713 user manual
VJITSk 6713 user manual
kot seelam
 
Intel core i5
Intel core i5Intel core i5
Intel core i5
Abdul-Fattah Mahran
 
Doc32002
Doc32002Doc32002
x86_1.ppt
x86_1.pptx86_1.ppt
x86_1.ppt
jeronimored
 
Area Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips ProcessorArea Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips Processor
IOSR Journals
 
COA Lecture 01(Introduction).pptx
COA Lecture 01(Introduction).pptxCOA Lecture 01(Introduction).pptx
COA Lecture 01(Introduction).pptx
syed rafi
 
Advanced Processor Power Point Presentation
Advanced Processor  Power Point  PresentationAdvanced Processor  Power Point  Presentation
Advanced Processor Power Point Presentation
PrashantYadav931011
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
Imran Sheikh
 
Arm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_armArm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_arm
Prashant Ahire
 
L3 instruction-execution-steps
L3 instruction-execution-stepsL3 instruction-execution-steps
L3 instruction-execution-steps
rsamurti
 
Training report on embedded sys_AVR
Training report on embedded sys_AVRTraining report on embedded sys_AVR
Training report on embedded sys_AVR
Galgotias College of Engg. & Tech.
 
Micro controller and dsp processor
Micro controller and dsp processorMicro controller and dsp processor
Micro controller and dsp processor
ShubhamMishra485
 
Realization of high performance run time loadable mips soft-core processor
Realization of high performance run time loadable mips soft-core processorRealization of high performance run time loadable mips soft-core processor
Realization of high performance run time loadable mips soft-core processor
eSAT Publishing House
 
Free Hardware & Networking Slides by ITE Infotech Private Limited
Free Hardware & Networking Slides by ITE Infotech Private LimitedFree Hardware & Networking Slides by ITE Infotech Private Limited
Free Hardware & Networking Slides by ITE Infotech Private Limited
Hemraj Singh Chouhan
 
M&i(lec#01)
M&i(lec#01)M&i(lec#01)
M&i(lec#01)
Majid Mehmood
 

Similar to Message Signaled Interrupts (20)

Ppt on six month training on embedded system & IOT
Ppt on six month training on embedded system & IOTPpt on six month training on embedded system & IOT
Ppt on six month training on embedded system & IOT
 
Introduction to embedded System.pptx
Introduction to embedded System.pptxIntroduction to embedded System.pptx
Introduction to embedded System.pptx
 
Low cost embedded system
Low cost embedded systemLow cost embedded system
Low cost embedded system
 
VJITSk 6713 user manual
VJITSk 6713 user manualVJITSk 6713 user manual
VJITSk 6713 user manual
 
Intel core i5
Intel core i5Intel core i5
Intel core i5
 
Doc32002
Doc32002Doc32002
Doc32002
 
x86_1.ppt
x86_1.pptx86_1.ppt
x86_1.ppt
 
Area Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips ProcessorArea Optimized Implementation For Mips Processor
Area Optimized Implementation For Mips Processor
 
COA Lecture 01(Introduction).pptx
COA Lecture 01(Introduction).pptxCOA Lecture 01(Introduction).pptx
COA Lecture 01(Introduction).pptx
 
Advanced Processor Power Point Presentation
Advanced Processor  Power Point  PresentationAdvanced Processor  Power Point  Presentation
Advanced Processor Power Point Presentation
 
Embedded system
Embedded systemEmbedded system
Embedded system
 
Embeddedsystem
EmbeddedsystemEmbeddedsystem
Embeddedsystem
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
 
Arm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_armArm cortex-m3 by-joe_bungo_arm
Arm cortex-m3 by-joe_bungo_arm
 
L3 instruction-execution-steps
L3 instruction-execution-stepsL3 instruction-execution-steps
L3 instruction-execution-steps
 
Training report on embedded sys_AVR
Training report on embedded sys_AVRTraining report on embedded sys_AVR
Training report on embedded sys_AVR
 
Micro controller and dsp processor
Micro controller and dsp processorMicro controller and dsp processor
Micro controller and dsp processor
 
Realization of high performance run time loadable mips soft-core processor
Realization of high performance run time loadable mips soft-core processorRealization of high performance run time loadable mips soft-core processor
Realization of high performance run time loadable mips soft-core processor
 
Free Hardware & Networking Slides by ITE Infotech Private Limited
Free Hardware & Networking Slides by ITE Infotech Private LimitedFree Hardware & Networking Slides by ITE Infotech Private Limited
Free Hardware & Networking Slides by ITE Infotech Private Limited
 
M&i(lec#01)
M&i(lec#01)M&i(lec#01)
M&i(lec#01)
 

More from Anshuman Biswal

भक्ति वृक्षा – CHAPTER 1 (1).pptx
भक्ति वृक्षा – CHAPTER 1 (1).pptxभक्ति वृक्षा – CHAPTER 1 (1).pptx
भक्ति वृक्षा – CHAPTER 1 (1).pptx
Anshuman Biswal
 
Ir da in_linux_presentation
Ir da in_linux_presentationIr da in_linux_presentation
Ir da in_linux_presentationAnshuman Biswal
 
Bangalore gayatri pariwar gayatri ashwamedha mahayagya
Bangalore gayatri pariwar gayatri ashwamedha mahayagyaBangalore gayatri pariwar gayatri ashwamedha mahayagya
Bangalore gayatri pariwar gayatri ashwamedha mahayagyaAnshuman Biswal
 
Six Sigma and/For Software Engineering
Six Sigma and/For Software EngineeringSix Sigma and/For Software Engineering
Six Sigma and/For Software EngineeringAnshuman Biswal
 
Fast web development using groovy on grails
Fast web development using groovy on grailsFast web development using groovy on grails
Fast web development using groovy on grailsAnshuman Biswal
 

More from Anshuman Biswal (7)

भक्ति वृक्षा – CHAPTER 1 (1).pptx
भक्ति वृक्षा – CHAPTER 1 (1).pptxभक्ति वृक्षा – CHAPTER 1 (1).pptx
भक्ति वृक्षा – CHAPTER 1 (1).pptx
 
Undecidabality
UndecidabalityUndecidabality
Undecidabality
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Ir da in_linux_presentation
Ir da in_linux_presentationIr da in_linux_presentation
Ir da in_linux_presentation
 
Bangalore gayatri pariwar gayatri ashwamedha mahayagya
Bangalore gayatri pariwar gayatri ashwamedha mahayagyaBangalore gayatri pariwar gayatri ashwamedha mahayagya
Bangalore gayatri pariwar gayatri ashwamedha mahayagya
 
Six Sigma and/For Software Engineering
Six Sigma and/For Software EngineeringSix Sigma and/For Software Engineering
Six Sigma and/For Software Engineering
 
Fast web development using groovy on grails
Fast web development using groovy on grailsFast web development using groovy on grails
Fast web development using groovy on grails
 

Recently uploaded

Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
PedroFerreira53928
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
GeoBlogs
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
AzmatAli747758
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
Jisc
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
Fundacja Rozwoju Społeczeństwa Przedsiębiorczego
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
kaushalkr1407
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
bennyroshan06
 

Recently uploaded (20)

Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 
Fish and Chips - have they had their chips
Fish and Chips - have they had their chipsFish and Chips - have they had their chips
Fish and Chips - have they had their chips
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...Cambridge International AS  A Level Biology Coursebook - EBook (MaryFosbery J...
Cambridge International AS A Level Biology Coursebook - EBook (MaryFosbery J...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdfESC Beyond Borders _From EU to You_ InfoPack general.pdf
ESC Beyond Borders _From EU to You_ InfoPack general.pdf
 
The Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdfThe Roman Empire A Historical Colossus.pdf
The Roman Empire A Historical Colossus.pdf
 
Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......Ethnobotany and Ethnopharmacology ......
Ethnobotany and Ethnopharmacology ......
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 

Message Signaled Interrupts

  • 1. M. S. Ramaiah School of Advanced Studies 1 ESD2528 ASP Presentation Anshuman Biswal PT 2012 Batch, Reg. No.: CJB0412001 M. Sc. (Engg.) in Computer Science and Networking Module Leader: Jishmi Jos Choondal Module Name: Advanced System Programming Module Code : ESD2528 Message Signaled Interrupts
  • 2. M. S. Ramaiah School of Advanced Studies 2 Marking Head Maximum Score Technical Content 10 Grasp and Understanding 10 Delivery – Technical and General Aspects 10 Handling Questions 10 Total 40
  • 3. M. S. Ramaiah School of Advanced Studies 3 Presentation Outline • What is interrupt? • The old way to handle interrupts • Improvement to be done for faster interrupt handling • Introduction to MSI and its evolution • Why MSI? • PCI express system architecture. • How to use MSI? • Using MSI-X • Handling devices implementing both MSI and MSI-X capabilities • How to tell whether MSI/MSI-X is enabled on a device? • How to disable MSI? • Conclusion
  • 4. M. S. Ramaiah School of Advanced Studies 4 What is Interrupt • An interrupt is a hardware signal from a device to a CPU, informing the CPU that the device needs attention and signalling that the CPU should stop current processing and respond to the device. • If the CPU is performing a task that has lower priority than the priority of the interrupt, the CPU suspends its current thread. The CPU then invokes the interrupt handler for the device that sent the interrupt signal. The interrupt handler services the device, and when the interrupt handler returns, the CPU resumes the processing it was doing before the interrupt occurred. • In order to appreciate the benefits of using Message Signaled Interrupts, let’s first see how devices do interrupts in a legacy PC
  • 5. M. S. Ramaiah School of Advanced Studies 5 The Old Way Interrupt ControllerI/O Device I/O Device I/O Device I/O Device IRR IMR ISR CPU INTR INTA system bus main memory EFLAGS ESP EIP IVT ISR APP stack IRQ0 IRQ1 IRQ2 • A device signals that it needs CPU service • The Interrupt Controller signals the CPU • The CPU responds with two INTA cycles First INTA causes bit-changes in IRR and ISR Second INTA puts ID-number on system bus • CPU uses ID-number to lookup IVT entry • CPU saves minimum context on its stack, adjusts EFLAGS, and jumps to specified ISR
  • 6. M. S. Ramaiah School of Advanced Studies 6 Improvement to be done for faster interrupt handling • Faster response to interrupts is possible if the old multi-step communication scheme can be replaced by a single-step protocol • Less expensive PCs can be manufactured if their total number of signal pins and the physical interconnections can be reduced • More devices can have their own ‘private’ interrupt(s) if signal lines aren’t required . • So this brought the need for the development of a new system for handling interrupts in a faster and efficient way. So MSI were developed for this. Message Signaling allows all the needed information to arrive in a single package, and go directly from a device to the CPU I/O Device system bus CPU main memory EFLAGS ESP EIP IVT ISR APP stackI/O Device I/O Device
  • 7. M. S. Ramaiah School of Advanced Studies 7 Introduction to MSI and its Evolution • The PCI 2.2 specification introduced MSI as an alternative to traditional line- based interrupts. Instead of using a dedicated pin to trigger interrupts, MSI enables devices to trigger an interrupt by writing a specific value to a particular address. • The message destination address and message data are referred to as the “vector” in MSI. • The MSI capability was first specified in PCI 2.2 and was later enhanced in PCI 3.0 to allow each interrupt to be masked individually. The MSI-X capability was also introduced with PCI 3.0. It supports more interrupts per device than MSI and allows interrupts to be independently configured. • Devices may support both MSI and MSI-X, but only one can be enabled at a time. Introduced in Conventional PCI 2.2 Incorporated into PCI-X 1.0 Incorporated into PCI Express Base 1.0 Introduced as an ECN to PCI 2.3 Incorporated into PCI 3.0 Added to PCI-X PT 2.0 via an EN Added to PCI Express Base 1.0a via ECN MSI MSI-X
  • 8. M. S. Ramaiah School of Advanced Studies 8 Why MSI ? • Pin based PCI interrupts are often shared amongst several devices. To support this,the kernel must call each interrupt handler associated with an interrupt,which leads to reduced performance for the system as a whole. MSIs are never shared, so this problem cannot arise. Since they are not shared, thus an MSI that is assigned to a device is guaranteed to be unique within the system. • When a device writes data to memory, then raises a pin-based interrupt, it is possible that the interrupt may arrive before all the data has arrived in memory (this becomes more likely with devices behind PCI-PCI bridges). In order to ensure that all the data has arrived in memory, the interrupt handler must read a register on the device which raised the interrupt. PCI transaction ordering rules require that all the data arrive in memory before the value may be returned from the register. Using MSIs avoids this problem as the interrupt-generating write cannot pass the data writes, so by the time the interrupt is raised, the driver knows that all the data has arrived in memory. So they can send data along with the interrupt message and the data payload can vary. • PCI devices can only support a single pin-based interrupt per function. Often drivers have to query the device to find out what event has occurred, slowing down interrupt handling for the common case. With MSI, a device can support more interrupts, allowing each interrupt to be specialised to a different purpose.
  • 9. M. S. Ramaiah School of Advanced Studies 9 PCI Express system Architecture • A PCI function indicates its support for MSI via the MSI capability register. PCI express specification defines two register format. 1. 64 bit MSI capability register format– required by all native PCI express devices and optionally implemented by legacy end points. MSI Control Register Pointer to Next ID Capability ID = 05h Least Significant 32 bits of Message Address Register 00 Most Significant 32 bits of Message Address Register Message Data Register 15 8 7 01631 2. 32 bit capability register format MSI Control Register Pointer to Next ID Capability ID = 05h Message Address Register 00 Message Data Register 15 8 7 01631 DWORD 0 DWORD 1 DWORD 2 DWORD 3 DWORD 0 DWORD 1 DWORD 2
  • 10. M. S. Ramaiah School of Advanced Studies 10 PCI Express system Architecture • The capability ID that identifies the MSI register set is 05h. This is a hardwired, read only value. • Point to Next new capability is the second byte of the register set that either points to the next new capabilities register set or contains 00h if this is the end of the new capabilities list. This is a hardwired, read only value. If non zero, it must be a dword-aligned value. • Message Control Register 15 8 7 6 4 3 1 0 RESERVED 1 0 0 0 0 0 0 0 MSI ENABLE Multiple Message Capable Multiple Message Enable 64 bit Address Capable Read only , Always Zero
  • 11. M. S. Ramaiah School of Advanced Studies 11 PCI Express system Architecture Bit(s) Field Name Description 15:08Reserved Read Only. Always Zero 764 bit Address Capable Read Only. 0 = Function does not implement the upper 32 bits of the message address register and is incapable of generating a 64 bit memory address. 1 = Function implements the upper 32 bits of the Message Address Register and is capable of generating a 64 bit memory address. 06:04Multiple Message Enable Read/Write. After system software reads the Multiple Message Capable field to determine how many messages are requested by the device,it programs a 3 bit value into this field indicating the actual number of messages allocated to the device. The number allocated can be equal to or less than the number actually requested. The state of this field after reset is 000b. The field is encoded as follows: Value Number of messages requested 000b 1 001b 2 010b 4 011b 8 100b 16 101b 32 110b Reserved 111b Reserved
  • 12. M. S. Ramaiah School of Advanced Studies 12 Bits Field Name Description 03:01Multiple Message Capable Read Only. System Software reads this field to determine how many messages the device would like to allocate to it. The requested number of messages is a power of two, therefore a device that would like three messages must request that four messages be allocated to it. The field is allocated as follows: Value Number of Messages requested 000b 1 001b 2 010b 4 011b 8 100b 16 101b 32 110b Reserved 111b Reserved PCI Express system Architecture
  • 13. M. S. Ramaiah School of Advanced Studies 13 PCI Express system Architecture 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 reserved 63 32 1 1 1 1 1 1 1 0 1 1 1 0 Destination ID 0 0 D M R H 31 20 19 12 11 4 3 2 1 0 DM = Destination Mode.If RH is 1 and DM is 0, the Destination ID field is in physical destination mode and only the processor in the system that has the matching APIC ID is considered for delivery of that interrupt (this means no re- direction). If RH is 1 and DM is 1, the Destination ID Field is interpreted as in logical destination mode and the redirection is limited to only those processors that are part of the logical group of processors based on the processor’s logical APIC ID and the Destination ID field in the message. Specifies which processor in the system will be the recipient of the Message Signaled Interrupt RH = Redirection Hint (0 = the interrupt is directed to the processor listed in the Destination ID field, 1= the interrupt is directed to the processor with the lowest priority of the processors indicated in the Destination ID field. Interpreting the Destination ID field for lowest priority delivery takes the DM bit into account MSI Address Register This value locates interrupts at the 1MB area with a base address of 4G – 18M. All accesses to this region are directed as interrupt messages. Care must be taken to ensure that noother device claims the region as I/O space. Has a Constant value 0xFEE
  • 14. M. S. Ramaiah School of Advanced Studies 14 reserved reserved 31 16 15 14 11 8 7 0 vector Delivery Mode T M T L Trigger Mode (0=Edge, 1=Level) Trigger Level (1=Assert, 0=Deassert) Delivery Mode- how the interrupt is handled 000=Fixed 001=Lowest Priority 010=SMI 011=Reserved 100=NMI 101=INIT 110=Reserved 111=ExtINT PCI Express system Architecture MSI Data Register contains the interrupt vector associated with the message
  • 15. M. S. Ramaiah School of Advanced Studies 15 • PCI devices are initialised to use pin-based interrupts. The device driver has to set up the device to use MSI or MSI-X. Not all machines support MSIs correctly, and for those machines, the APIs described below will simply fail and the device will continue to use pin-based interrupts. • To support MSI or MSI X, the kernel must be built with the CONFIG_PCI_MSI option enabled. This option is only available on some architectures, and it may depend on some other options also being set. For example, on x86, you must also enable X86_UP_APIC or SMP in order to see the CONFIG_PCI_MSI option. • Most of the hard work is done for the driver in the PCI layer. It simply has to request that the PCI layer set up the MSI capability for this device. How to use MSIs ?
  • 16. M. S. Ramaiah School of Advanced Studies 16 How to use MSI-Programatically ? • int pci_enable_msi(struct pci_dev *dev) : A successful call allocates ONE interrupt to the device, regardless of how many MSIs the device supports. The device is switched from pin-based interrupt mode to MSI mode. The dev->irq number is changed to a new number which represents the message signaled interrupt; consequently, this function should be called before the driver calls request_irq(), because an MSI is delivered via a vector that is different from the vector of a pin- based interrupt. • int pci_enable_msi_block(struct pci_dev *dev, int count): This call allows a device driver to request multiple MSIs.The MSI specification only allows interrupts to be allocated in powers of two upto a maximum of 2^5 (32). If this call returns 0 then it has succeeded in allocating at least as many interrupts as the driver requested. In this case the function enables MSI on the device and updates dev->irq to be the lowest of the new interrupts assigned to it. The other interrupts assigned to the device are in the range dev->irq to dev->irq + count -1. If this functions returns a negative number it indicates an error and the driver should not attempt to request any more MSI interrupts for this device.If this function return a positive number ,it is less than count and indicates the number of interrupts that could have been allocated.In both the case the irq value is not updated and the device also doesnot switched to MSI mode. • void pci_disable_msi(struct pci_dev *dev): This function should be used to undo the effect of pci_enable_msi() orpci_enable_msi_block().Calling it restores dev->irq to the pin-based interrupt number and frees the previously allocated message signaled interrupt(s).The interrupt may subsequently be assigned to another device, so drivers should not cache the value of dev->irq.Before calling this function, a device driver must always call free_irq() on any interrupt for which it previously called request_irq().
  • 17. M. S. Ramaiah School of Advanced Studies 17 Using MSI-X • The MSI-X capability is much more flexible than the MSI capability. • It supports up to 2048 interrupts, each of which can be controlled independently.To support this flexibility, drivers must use an array of `struct msix_entry': struct msix_entry { u16 vector; /* kernel uses to write alloc vector */ u16 entry; /* driver uses to specify entry */ }; • int pci_enable_msix(struct pci_dev *dev, struct msix_entry *entries, int nvec) : Calling this function asks the PCI subsystem to allocate 'nvec' MSIs.The 'entries' argument is a pointer to an array of msix_entry structs which should be at least 'nvec' entries in size. On success, the device is switched into MSI-X mode and the function returns 0. The 'vector' member in each entry is populated with the interrupt number;the driver should then call request_irq() for each 'vector' that it decides to use. The device driver is responsible for keeping track of the interrupts assigned to the MSI-X vectors so it can free them again later. If this function returns a negative number, it indicates an error and the driver should not attempt to allocate any more MSI-X interrupts for this device. If it returns a positive number, it indicates the maximum number of interrupt vectors that could have been allocated.
  • 18. M. S. Ramaiah School of Advanced Studies 18 Using MSI-X • void pci_disable_msix(struct pci_dev *dev): This function should be used to undo the effect of pci_enable_msix(). It frees the previously allocated message signaled interrupts. The interrupts may subsequently be assigned to another device, so drivers should not cache the value of the 'vector' elements over a call to pci_disable_msix().Before calling this function, a device driver must always call free_irq() on any interrupt for which it previously called request_irq().Failure to do so results in a BUG_ON(), leaving the device with MSI-X enabled and thus leaking its vector.
  • 19. M. S. Ramaiah School of Advanced Studies 19 Handling devices implementing both MSI and MSI- X capabilities • If a device implements both MSI and MSI-X capabilities, it can run in either MSI mode or MSI-X mode, but not both simultaneously. This is a requirement of the PCI spec, and it is enforced by the PCI layer. Calling pci_enable_msi() when MSI-X is already enabled or pci_enable_msix() when MSI is already enabled results in an error. If a device driver wishes to switch between MSI and MSI-X at runtime, it must first inactive the device, then switch it back to pin-interrupt mode, before calling pci_enable_msi() or pci_enable_msix() and resuming operation.
  • 20. M. S. Ramaiah School of Advanced Studies 20 How to tell whether MSI/MSI-X is enabled on a device? • Using 'lspci -v' (as root) may show some devices with "MSI", "Message Signalled Interrupts" or "MSI-X" capabilities. Each of these capabilities has an 'Enable' flag which is followed with either "+" (enabled) or "-" (disabled). • To find why MSIs are disabled on a device your first step should be to examine your dmesg carefully to determine whether MSIs are enabled for your machine. You should also check your .config to be sure you have enabled CONFIG_PCI_MSI.Then, 'lspci -t' gives the list of bridges of a device. Reading /sys/bus/pci/devices/*/msi_bus will tell you whether MSIs are enabled (1) or disabled (0).If 0 is found in any of the msi_bus files belonging to bridges between the PCI root and the device, MSIs are disabled.
  • 21. M. S. Ramaiah School of Advanced Studies 21 How to disable MSI? • The PCI stack provides three ways to disable MSIs: – 1. globally – 2. on all devices behind a specific bridge – 3. on a single device 1. Disabling MSIs globally : Some host chipsets simply don't support MSIs properly. The complete list of these is found near the quirk_disable_all_msi() function in drivers/pci/quirks.c. If you have a board which has problems with MSIs, you can pass pci=nomsi on the kernel command line to disable MSIs on all devices. 2. Disabling MSIs below a bridge: If you have a bridge unknown to Linux, you can enable MSIs in configuration space using whatever method you know works,then enable MSIs on that bridge by doing: echo 1 > /sys/bus/pci/devices/$bridge/msi_bus where $bridge is the PCI address of the bridge you've enabled (eg 0000:00:0e.0).To disable MSIs, echo 0 instead of 1. Changing this value should be done with caution as it could break interrupt handling for all devices below this bridge. 3. Disabling MSIs on a single device:Some devices are known to have faulty MSI implementations.Usually this is handled in the individual device driver.Some drivers have an option to disable use of MSI.While this is a convenient workaround for the driver author,it is not good practise, and should not be emulated.
  • 22. M. S. Ramaiah School of Advanced Studies 22 Conclusion • MSI and MSI-X are features of the PCI standard that deliver improved interrupt handling especially for today’s multiprocessor and multi-core systems. MSI benefits end users by: – Enhancing overall system performance – Reducing system overhead – Lowering interrupt latency – Improving host CPU utilization – Increasing system reliability • MSI-X further focuses on performance improvements by enhancing I/O scalability and enabling better performance. • If your device supports both MSI-X and MSI capabilities, you should use the MSI-X facilities in preference to the MSI facilities because MSI-X supports any number of interrupts between 1 and 2048. In contrast, MSI is restricted to a maximum of 32 interrupts (and must be a power of two). In addition, the MSI interrupt vectors must be allocated consecutively, so the system might not be able to allocate as many vectors for MSI as it could for MSI-X. On some platforms, MSI interrupts must all be targeted at the same set of CPUs whereas MSI-X interrupts can all be targeted at different CPUs.
  • 23. M. S. Ramaiah School of Advanced Studies 23 References [1] The MSI driver Guide How To[Online] Available From: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux- 2.6.git;a=blob;f=Documentation/PCI/MSI-HOWTO.txt;hb=HEAD (Accessed:28 January 2013) [2] IA-32 Intel® ArchitectureSoftware Developer’s Manual,Vol-3,2003 [3] Ravi,B.,Anderson,D.,Shanley,T.,Jow,W.(2003) PCI Express System Archotecture,Addision-Wesley