PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani...

49
PCI Express In Depth PCI Express In Depth For Windows Vista For Windows Vista And Beyond And Beyond Allen Marshall Allen Marshall Lead Program Manager Lead Program Manager Vinod Mamtani Vinod Mamtani Software Development Engineer Software Development Engineer Core Platform Architecture Core Platform Architecture Microsoft Corporation Microsoft Corporation

Transcript of PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani...

Page 1: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Express In Depth PCI Express In Depth For Windows Vista For Windows Vista And BeyondAnd Beyond

Allen MarshallAllen MarshallLead Program ManagerLead Program ManagerVinod MamtaniVinod MamtaniSoftware Development EngineerSoftware Development EngineerCore Platform ArchitectureCore Platform ArchitectureMicrosoft CorporationMicrosoft Corporation

Page 2: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

AgendaAgenda

PCI Express support in Windows VistaPCI Express support in Windows Vista

PCI Express firmware supportPCI Express firmware supportEnabling native PCI Express supportEnabling native PCI Express support

Enabling flexible resource assignmentEnabling flexible resource assignment

Optimal PCI device resourcesOptimal PCI device resources

Active state power managementActive state power management

MSI supportMSI support

Page 3: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Express FeaturesPCI Express FeaturesSupported in Windows VistaSupported in Windows Vista

Memory mapped CFG space access, extended Memory mapped CFG space access, extended CFG space access, and segment supportCFG space access, and segment support

Active State Power Management (ASPM)Active State Power Management (ASPM)

Native Power Management Events (PME)Native Power Management Events (PME)

Message-Signaled Interrupts (MSI/MSI-X)Message-Signaled Interrupts (MSI/MSI-X)

Native Hot PlugNative Hot Plug

Advanced Error Reporting (AER)Advanced Error Reporting (AER)

Multilevel resource rebalanceMultilevel resource rebalance

Page 4: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Express FeaturesPCI Express FeaturesSupported in Windows VistaSupported in Windows Vista

Miscellaneous base features, includingMiscellaneous base features, includingCapability version field checkingCapability version field checking

PCI Express hardware ID and New compatible devicePCI Express hardware ID and New compatible deviceID identification and matchingID identification and matching

Updated device class code parsingUpdated device class code parsing

Phantom functionsPhantom functions

Device serial numbersDevice serial numbers

PCI Express tree hierarchy checkingPCI Express tree hierarchy checking

Setting of Max Payload Size and Max Request Size fieldsSetting of Max Payload Size and Max Request Size fieldsin the Device Control register to match root port settingsin the Device Control register to match root port settings

Transactions pending supportTransactions pending support

Clock power management (CLK_REQ)Clock power management (CLK_REQ)

Page 5: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Express FeaturesPCI Express FeaturesNot supportedNot supported

Virtual channelVirtual channelFor other than channel 0For other than channel 0

Isochronous transfersIsochronous transfers

Slot power budgetingSlot power budgetingVista will not change the BIOS configuration Vista will not change the BIOS configuration for a devicefor a device

Vista will save and restore the configuration Vista will save and restore the configuration across sleep transitionsacross sleep transitions

Page 6: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Express FeaturesPCI Express FeaturesNon-snoop I/ONon-snoop I/O

Windows Vista will disable non-snoop I/O Windows Vista will disable non-snoop I/O by defaultby default

Windows Vista DMA model assumes cache Windows Vista DMA model assumes cache coherent DMAcoherent DMAExcept for devices on VGA pathExcept for devices on VGA pathWindows Vista clears the Enable Non SnoopWindows Vista clears the Enable Non Snoopbit in the Device Control registerbit in the Device Control register

Device drivers may enable this bitDevice drivers may enable this bitUpdate this register during Start handlingUpdate this register during Start handlingWindows Vista will thereafter preserve this value Windows Vista will thereafter preserve this value across power state transitions across power state transitions

Page 7: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Driver UpdatesPCI Driver UpdatesArchitectural changes in PCIArchitectural changes in PCI

Multilevel resource rebalanceMultilevel resource rebalance

Reduced I/O space supportReduced I/O space support

Optimal default PCI bridge resource Optimal default PCI bridge resource window sizeswindow sizes

Subtractive decode PCI bridgesSubtractive decode PCI bridges

Support for 64-bit resourcesSupport for 64-bit resources

Greater integration of PCMCIA support in PCIGreater integration of PCMCIA support in PCIRe-structure of legacy R2 card interrupt detectionRe-structure of legacy R2 card interrupt detection

Page 8: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

By default, Windows Vista starts in PCI By default, Windows Vista starts in PCI compatibility modecompatibility mode

No PCI Express features assumed or enabledNo PCI Express features assumed or enabled

_OSC is used by firmware and the operating _OSC is used by firmware and the operating system tosystem to

Report OS capabilities to the platformReport OS capabilities to the platform

Report platform capabilities to the OSReport platform capabilities to the OS

Transfer control of PCI Express features from Transfer control of PCI Express features from firmware to the operating systemfirmware to the operating system

PCI Express Firmware PCI Express Firmware Enabling native PCI Express supportEnabling native PCI Express support

Page 9: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Express Firmware PCI Express Firmware Reporting Windows Vista capabilitiesReporting Windows Vista capabilities

Windows Vista reports support for the Windows Vista reports support for the following capabilities to the firmwarefollowing capabilities to the firmwarevia _OSC methodvia _OSC method

Extended PCI config spaceExtended PCI config space

Message-signaled interruptsMessage-signaled interrupts

Clock power managementClock power management

PCI segment groupsPCI segment groups

Page 10: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Express Firmware PCI Express Firmware Negotiating control of native featuresNegotiating control of native features

Dependencies exist between Dependencies exist between PCI Express featuresPCI Express features

Windows Vista requires the platform to grant Windows Vista requires the platform to grant control to the OS over control to the OS over allall of of

AERAER

Native PMENative PME

Hot plugHot plug

Express capabilityExpress capability

Otherwise, Windows Vista will not assume Otherwise, Windows Vista will not assume control of any of these featurescontrol of any of these features

Page 11: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Express Firmware PCI Express Firmware Negotiating control of native featuresNegotiating control of native features

Control negotiated via _OSC methodControl negotiated via _OSC method

When granting control of nativeWhen granting control of nativefeatures, firmware should grantfeatures, firmware should grantcontrol of unimplemented featurescontrol of unimplemented features

This signals Windows Vista that it is safe to This signals Windows Vista that it is safe to assume control of the implemented featuresassume control of the implemented features

Page 12: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Address space constraintsAddress space constraints

Physical address space below 4GB Physical address space below 4GB continues to face increased demandcontinues to face increased demand

MCFG introduces large memory holeMCFG introduces large memory hole

Larger amounts of system RAMLarger amounts of system RAM

Greater numbers of PCI or Greater numbers of PCI or PCI Express devicesPCI Express devices

Increasing device resource requirementsIncreasing device resource requirements

Devices limited to 32-bit DMA supportDevices limited to 32-bit DMA support

Page 13: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Address space constraintsAddress space constraints

This problem is mitigated byThis problem is mitigated byPCI Express 64-bit prefetchable BARsPCI Express 64-bit prefetchable BARs

Required by WHQL logo programRequired by WHQL logo program

Allows Windows to assign resources above 4 GBAllows Windows to assign resources above 4 GB

Emergence of mainstream 64-bit platformsEmergence of mainstream 64-bit platforms

Page 14: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources PCI Resource ArbitrationPCI Resource Arbitration

Windows configures and starts a PCI bridge Windows configures and starts a PCI bridge before scanning the secondary side of the bridge before scanning the secondary side of the bridge for PCI devicesfor PCI devicesAll devices on the bridge are arbitrated All devices on the bridge are arbitrated with resources that fall inside the bridge’s with resources that fall inside the bridge’s resource windowresource window

Subtractive bridges that also do positive decoding Subtractive bridges that also do positive decoding have resources arbitrated from the bridge windowhave resources arbitrated from the bridge windowLegacy and non-PCI devices will be arbitrated with Legacy and non-PCI devices will be arbitrated with resources outside bridge windowresources outside bridge window

Page 15: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Bridge window configurationBridge window configuration

Windows XP and Windows Server 2003 do not reconfigureWindows XP and Windows Server 2003 do not reconfigurethe bridge windows based on the requirements of a devicethe bridge windows based on the requirements of a devicebehind the bridgebehind the bridge

May lead to a PCI device not starting due to lack of resourcesMay lead to a PCI device not starting due to lack of resourcesEven though enough device resources are available to the systemEven though enough device resources are available to the system

In some cases, boot configuration of PCI devices by firmwareIn some cases, boot configuration of PCI devices by firmwareworks best for Windows versions prior to Windows Vistaworks best for Windows versions prior to Windows Vista

Mobile PCs that don’t expose PCI expansion slotsMobile PCs that don’t expose PCI expansion slots

Server PCs that support device hot plug Server PCs that support device hot plug

Large server configurations with extensive I/OLarge server configurations with extensive I/OPlatform has better visibility into specific resource requirementsPlatform has better visibility into specific resource requirementsthan the OS can ascertain during bootthan the OS can ascertain during boot

Page 16: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Bridge window configurationBridge window configuration

Windows Vista supports multi-level resource rebalanceWindows Vista supports multi-level resource rebalanceAllows Vista to dynamically reconfigure resource assignmentsAllows Vista to dynamically reconfigure resource assignmentsacross multiple hierarchical levels in a device treeacross multiple hierarchical levels in a device tree

Windows Vista default bridge resource windows sizes are optimizedWindows Vista default bridge resource windows sizes are optimizedfor deep PCI Express hierarchiesfor deep PCI Express hierarchies

I/O windows default to 4 KI/O windows default to 4 K

Memory windows default to 1 MBMemory windows default to 1 MB

If a PCI device’s resource requirement cannot be arbitrated inside the If a PCI device’s resource requirement cannot be arbitrated inside the current bridge resource window, Vista reconfigures the PCI bridge withcurrent bridge resource window, Vista reconfigures the PCI bridge witha new set of resources to accommodate the PCI device requirements a new set of resources to accommodate the PCI device requirements

Avoiding boot configuration of all PCI devices works best on VistaAvoiding boot configuration of all PCI devices works best on Vista

Platform must boot configure required boot devicesPlatform must boot configure required boot devices

If device requiring boot configuration are behind a bridge,If device requiring boot configuration are behind a bridge,you must boot config all devices behind the bridgeyou must boot config all devices behind the bridge

Page 17: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Properly define MMCFG spaceProperly define MMCFG space

Windows Vista parses MCFG table forWindows Vista parses MCFG table formemory mapped config accessmemory mapped config access

This memory is marked off-limits for device This memory is marked off-limits for device resource assignmentresource assignment

Bus number range must match bus rangeBus number range must match bus rangefor PCI root busfor PCI root bus

Earlier versions of Windows should have an Earlier versions of Windows should have an ACPI motherboard resource which claims the ACPI motherboard resource which claims the exact same MM config regionexact same MM config region

Place motherboard resource at correct location Place motherboard resource at correct location in namespacein namespace

Page 18: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Properly define MMCFG spaceProperly define MMCFG space

_SEG method must be defined for PCI_SEG method must be defined for PCIRoot Bus that matches segment in MCFGRoot Bus that matches segment in MCFG

Segment number encoded in bus numberSegment number encoded in bus numberrange for module devicesrange for module devices

Avoid common pitfallsAvoid common pitfallsDefine memory region accurately, don’t overlapDefine memory region accurately, don’t overlapother devices (like local APIC)!other devices (like local APIC)!

Ensure regions are the same for Windows VistaEnsure regions are the same for Windows Vistaand earlier versions of Windowsand earlier versions of Windows

Implement SAL revision >= 3.2 for Itanium Implement SAL revision >= 3.2 for Itanium platforms for extended config accessplatforms for extended config access

Page 19: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Device resources above 4 GBDevice resources above 4 GB

Devices with boot configurations above 4 GB areDevices with boot configurations above 4 GB arehandled differently across Windows versionshandled differently across Windows versions

Windows Vista always respects boot configurationWindows Vista always respects boot configurationof devices above 4 GBof devices above 4 GB

If the processor and operating system version supportIf the processor and operating system version supportaccessing addresses > 4 GBaccessing addresses > 4 GB

Windows XP and Window Server 2003 ignoresWindows XP and Window Server 2003 ignoresboot configurations above 4 GBboot configurations above 4 GB

If resources cannot be allocated below 4 GB, a rangeIf resources cannot be allocated below 4 GB, a rangeabove 4 GB will be assignedabove 4 GB will be assigned

Regardless of the processor or Windows addressingRegardless of the processor or Windows addressingcapability, which may leave the device inoperablecapability, which may leave the device inoperable

Page 20: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Firmware resource allocationFirmware resource allocation

The different behaviors of Windows The different behaviors of Windows versions present conflicting requirements versions present conflicting requirements to platform firmwareto platform firmware

This necessitates a flexible approachThis necessitates a flexible approachto firmware developmentto firmware development

See whitepaper for details on how to See whitepaper for details on how to enable optimal resource assignment enable optimal resource assignment for Windows Vista and earlier versions for Windows Vista and earlier versions of Windowsof Windows

Page 21: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Need ability to ignore boot configNeed ability to ignore boot config

A mechanism is needed for the platform to A mechanism is needed for the platform to indicate to the OS that boot configurationsindicate to the OS that boot configurationscan be ignored for a device hierarchycan be ignored for a device hierarchyEnables Windows Vista to ignore boot Enables Windows Vista to ignore boot configured device resourcesconfigured device resources

Provides for greater resource allocation flexibilityProvides for greater resource allocation flexibility

Allows firmware to boot configure devicesAllows firmware to boot configure devicesfor best compatibility with Windows XP and for best compatibility with Windows XP and Windows Server 2003Windows Server 2003

This allows backward compatibility and smooth This allows backward compatibility and smooth transition to future operating systemstransition to future operating systems

Page 22: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources _DSM for Ignoring Boot Config_DSM for Ignoring Boot Config

_DSM is an optional ACPI control method that _DSM is an optional ACPI control method that enables devices to provide device-specific enables devices to provide device-specific control functionscontrol functions

_DSM usage for PCI is defined in the PCI Firmware _DSM usage for PCI is defined in the PCI Firmware Specification, Rev. 3.0Specification, Rev. 3.0

The _DSM method for PCI devices is optional on The _DSM method for PCI devices is optional on Windows Vista and is not evaluated on Windows Windows Vista and is not evaluated on Windows XP and Windows Server 2003XP and Windows Server 2003

Microsoft has proposed an ECR to the PCI Microsoft has proposed an ECR to the PCI Firmware Specification to add an additional Firmware Specification to add an additional function definition to ignore boot configuration function definition to ignore boot configuration of PCI devicesof PCI devices

Page 23: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Platform usage of _DSMPlatform usage of _DSM

Assign root bridge resources spanning Assign root bridge resources spanning 4 GB boundary4 GB boundary

All devices in the path must support 64-bit All devices in the path must support 64-bit prefetchable BARsprefetchable BARs

Apply boot configurations to all devices for Apply boot configurations to all devices for compatibility with earlier versions of Windowscompatibility with earlier versions of Windows

Implement _DSM allowing boot configurationImplement _DSM allowing boot configurationto be ignoredto be ignored

Windows Vista will place all resources Windows Vista will place all resources above 4 GB above 4 GB

Page 24: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power ManagementActive State Power ManagementOverviewOverview

ASPM is required for PCI Express devicesASPM is required for PCI Express devicesSerial links remain active toSerial links remain active tomaintain synchronizationmaintain synchronizationASPM offers significant power savings ASPM offers significant power savings

≈ ≈ 1W to 3W, depending on device or 1W to 3W, depending on device or lane widthlane widthThis is especially important on mobile PCsThis is especially important on mobile PCs

Roadmap includes enabling ASPM on as many Roadmap includes enabling ASPM on as many devices as possibledevices as possible

Page 25: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power ManagementActive State Power ManagementASPM in Windows VistaASPM in Windows Vista

Enabling ASPM in Windows Vista is based onEnabling ASPM in Windows Vista is based onHardware capabilitiesHardware capabilities

L0s is required as per the PCI Express Base specificationL0s is required as per the PCI Express Base specification

L1 is required for ExpressCardL1 is required for ExpressCard

Exit time latenciesExit time latencies

System power policySystem power policy

System-level controlsSystem-level controls

Device-level ASPM controlsDevice-level ASPM controls

Page 26: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power Management Active State Power Management ASPM hardware capabilitiesASPM hardware capabilities

Hardware must be capable of ASPMHardware must be capable of ASPMas reported in its Link Capabilities registeras reported in its Link Capabilities registerWindows Vista checks this registerWindows Vista checks this registerfor all PCI Express devices in thefor all PCI Express devices in thehierarchy, includinghierarchy, including

Root PortsRoot PortsSwitch PortsSwitch PortsPCI Express-to-PCI or -PCI-X BridgesPCI Express-to-PCI or -PCI-X BridgesDevice Endpoints Device Endpoints

Page 27: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power Management Active State Power Management ASPM exit time latenciesASPM exit time latencies

L0s or L1 is always enabled for a Switch or Root L0s or L1 is always enabled for a Switch or Root Port when a device is present on the linkPort when a device is present on the link

To enable ASPM for endpoints Windows Vista To enable ASPM for endpoints Windows Vista must first calculate exit latenciesmust first calculate exit latencies

To ensure that the overall hierarchy latencyTo ensure that the overall hierarchy latencyis within the links requirements for an endpoint is within the links requirements for an endpoint

Windows Vista calculates exit time latencyWindows Vista calculates exit time latencyin accordance with the in accordance with the PCI Express PCI Express Base SpecificationBase Specification

Page 28: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power Management Active State Power Management ASPM exit time latenciesASPM exit time latencies

Windows Vista first calculates latencies separatelyWindows Vista first calculates latencies separatelyfor both L0s and L1for both L0s and L1L0s is managed independently for both Root-facingL0s is managed independently for both Root-facingand Endpoint-facing Linksand Endpoint-facing LinksWindows Vista computes overall latency starting atWindows Vista computes overall latency starting atthe Root Port, progressing to the Endpoint, and then the Root Port, progressing to the Endpoint, and then returning from the Endpoint back up to the Root Portreturning from the Endpoint back up to the Root PortIHVs must reflect the L1 exit latency timing accuratelyIHVs must reflect the L1 exit latency timing accuratelyin the Link Capabilities register in the Link Capabilities register

So that Windows Vista can calculate exit latencies as precisely So that Windows Vista can calculate exit latencies as precisely as possible as possible

Page 29: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power Management Active State Power Management System power policySystem power policy

ASPM settings are linked to overall system ASPM settings are linked to overall system power policy settings in the operating systempower policy settings in the operating system

Windows Vista power policy settings allowWindows Vista power policy settings allowfor negotiation of these ASPM statesfor negotiation of these ASPM states

Off (L0)Off (L0)

Moderate Power Savings (L0s)Moderate Power Savings (L0s)

Maximum Power Savings (L0s or L1)Maximum Power Savings (L0s or L1)

Page 30: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power ManagementActive State Power ManagementSystem power policySystem power policy

Windows Vista default ASPM power policy settingsWindows Vista default ASPM power policy settings

  System power policy

Power sourc

e

High performan

ceBalanced Power saver

AC OffModerate power savings

(L0s)Maximum power savings

(L0s/L1)

DC OffMaximum power savings

(L0s/L1)Maximum power savings

(L0s/L1)

Page 31: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power Management Active State Power Management System-level controlsSystem-level controls

Windows Vista enables ASPM based on Windows Vista enables ASPM based on two mechanismstwo mechanisms

The version of The version of PCI Express Base PCI Express Base SpecificationSpecification with which PCI Express devices with which PCI Express devices in the system complyin the system comply

Platform firmware override mechanisms Platform firmware override mechanisms

Page 32: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power Management Active State Power Management System-level controlsSystem-level controls

Microsoft encountered some devices that comply with Microsoft encountered some devices that comply with PCI Express Base Specification 1.0PCI Express Base Specification 1.0 but did not implement but did not implement ASPM correctlyASPM correctly

Too many broken devices to enable ASPM by default on all PCI Too many broken devices to enable ASPM by default on all PCI Express devicesExpress devices

Device Device PCI Express Base SpecificationPCI Express Base Specification Revision Revision Compliance determines whether ASPM is enabled Compliance determines whether ASPM is enabled by defaultby default

Devices which support revision 1.1 have ASPM enabled by defaultDevices which support revision 1.1 have ASPM enabled by defaultRole-based Error Reporting capability bit in the Device Role-based Error Reporting capability bit in the Device Capabilities register used to determine 1.1 revision compliance Capabilities register used to determine 1.1 revision compliance

Page 33: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power Management Active State Power Management Firmware override mechanismsFirmware override mechanisms

System BIOS may also control ASPM operationSystem BIOS may also control ASPM operationon Windows Vistaon Windows Vista

The BIOS may enable ASPM on pre-1.1 devices viaThe BIOS may enable ASPM on pre-1.1 devices viaboot configurationboot configuration

Windows Vista may override this settingWindows Vista may override this settingBased on the result of the device version and deviceBased on the result of the device version and device.inf file opt-in/opt-out directives.inf file opt-in/opt-out directives

The BIOS may disable ASPM system-wideThe BIOS may disable ASPM system-wideMicrosoft has proposed a new ACPI flag to allow firmwareMicrosoft has proposed a new ACPI flag to allow firmwareto convey to OSPM that ASPM should not be enabled onto convey to OSPM that ASPM should not be enabled ona non-compliant platforma non-compliant platform

Page 34: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power Management Active State Power Management Device level ASPM controlsDevice level ASPM controls

For systems with pre-1.1 hardware, an For systems with pre-1.1 hardware, an “opt-in” flag has been defined to allow “opt-in” flag has been defined to allow bypassing the pre-1.1 checkbypassing the pre-1.1 check

Skipping this check allows specific devices Skipping this check allows specific devices known to work to use ASPMknown to work to use ASPM

A device “opt-out” mechanism allows a driver A device “opt-out” mechanism allows a driver to specify that a device it controls does not to specify that a device it controls does not properly support ASPMproperly support ASPM

This targets post-1.1 devices This targets post-1.1 devices

Page 35: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power ManagementActive State Power ManagementDevice level ASPM controlsDevice level ASPM controls

This value can be populated by the device driver This value can be populated by the device driver INF file at install timeINF file at install time

The machine.inf file contains a section to set the valueThe machine.inf file contains a section to set the valueDevice INFs need include only this section by Device INFs need include only this section by using using IncludeInclude and and NeedsNeeds directives to get the directives to get the desired behavior desired behavior

[PciASPMOptIn]AddReg=PciASPMOptIn.RegHW[PciASPMOptIn.RegHW]HKR,e5b3b5ac-9725-4f78-963f-03dfb1d828c7,ASPMOptIn,0x10001,1

[PciASPMOptOut]AddReg=PciASPMOptOut.RegHW[PciASPMOptOut.RegHW]HKR,e5b3b5ac-9725-4f78-963f-03dfb1d828c7,ASPMOptOut,0x10001,1

Page 36: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power Management Active State Power Management Device level ASPM controlsDevice level ASPM controls

Enabling ASPM on Pre-1.1 DevicesEnabling ASPM on Pre-1.1 DevicesThe driver developer must place the following The driver developer must place the following entry in the device driver’s INF fileentry in the device driver’s INF file

[DDInstall.HW]Include=machine.infNeeds=PciASPMOptIn

Page 37: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Power Management Active State Power Management Device level ASPM controlsDevice level ASPM controls

Disabling ASPMDisabling ASPMThe driver developer must place the following The driver developer must place the following entry in the device driver’s INF fileentry in the device driver’s INF file

[DDInstall.HW]Include=machine.infNeeds=PciASPMOptOut

Page 38: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Message Signaled Interrupts Message Signaled Interrupts MSI/MSI-X overviewMSI/MSI-X overview

Device drivers should opt-in to get MSI and MSI-X Device drivers should opt-in to get MSI and MSI-X messages assigned to the devicemessages assigned to the device

Device drivers must use the Device drivers must use the IoConnectInterruptEx IoConnectInterruptEx call to attach a message service routine (MSR) for call to attach a message service routine (MSR) for these messagesthese messages

Windows Vista allows 16 MSI messages and up to 2048 Windows Vista allows 16 MSI messages and up to 2048 MSI-X messages per device.MSI-X messages per device.

It is possible to attached separate MSRs for It is possible to attached separate MSRs for each messageeach message

See whitepaper for detailed samplesSee whitepaper for detailed samples

Page 39: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Message Signaled Interrupts Message Signaled Interrupts When fewer messages are availableWhen fewer messages are available

PCI driver programs all assigned MSI-X PCI driver programs all assigned MSI-X messages to a device MSI-X tablemessages to a device MSI-X table

When a device assigned fewer thanWhen a device assigned fewer thanrequested messages, PCI driver fills tablerequested messages, PCI driver fills tablewith duplicate messageswith duplicate messages

Single MSI-X message programmed for each entrySingle MSI-X message programmed for each entry

All assigned messages programmed in sequence,All assigned messages programmed in sequence,then fill remaining set with first messagethen fill remaining set with first message

Driver can change the MSI-X table entries and Driver can change the MSI-X table entries and disable/enable them as it deems appropriatedisable/enable them as it deems appropriate

Page 40: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Call To ActionCall To Action

Consider PCI resource allocation when Consider PCI resource allocation when designing firmware for platforms that are designing firmware for platforms that are running Windows operating systems running Windows operating systems

Implement and validate ASPM in yourImplement and validate ASPM in yourPCI Express devicesPCI Express devices

Test and validate native PCI Express Test and validate native PCI Express features and firmware with Windows Vistafeatures and firmware with Windows Vista

Implement MSI aware device driversImplement MSI aware device drivers

Page 41: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Additional ResourcesAdditional Resources

Web ResourcesWeb ResourcesWhitepapersWhitepapershttp://www.microsoft.com/whdc/system/bus/pci/defaulthttp://www.microsoft.com/whdc/system/bus/pci/default.mspx.mspx

Related sessionsRelated sessionsCPA002 ACPI in Windows VistaCPA002 ACPI in Windows Vista

CPA060 Kernel Plug and Play in Windows VistaCPA060 Kernel Plug and Play in Windows Vista

PCI supportPCI supportSend e-mail to Microsoft PCI Express Support atSend e-mail to Microsoft PCI Express Support atpciesup @ microsoft.compciesup @ microsoft.com

Page 42: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

BackupBackup

Page 43: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Express Firmware PCI Express Firmware ACPI _OSC methodACPI _OSC method

Required for host bridges that originate a PCI Required for host bridges that originate a PCI Express hierarchyExpress hierarchy

_OSC must be present in order for Windows _OSC must be present in order for Windows Vista to enable PCI Express featuresVista to enable PCI Express features

If _OSC is not present, Windows Vista will not If _OSC is not present, Windows Vista will not assume control of any PCI Express featuresassume control of any PCI Express features

Essentially runs in Windows XP modeEssentially runs in Windows XP mode

In Device Manager, PCI Express root ports willIn Device Manager, PCI Express root ports willshow up as PCI to PCI bridgesshow up as PCI to PCI bridges

Page 44: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Update PCI _DSM to ignore boot configUpdate PCI _DSM to ignore boot config

UUID Revision Function Description

E5C937D0-3553-4d7a-9117-EA4D19C3434D 1 1 PCI Express Slot Information

1 2 PCI Express Slot Number

1 3 Vendor-specific Token ID

1 4 PCI Bus Capabilities

1 5 Ignore PCI Boot Configuration

Page 45: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Firmware recommendationsFirmware recommendations

Reserve non-conflicting resources above 4 GBReserve non-conflicting resources above 4 GBin the _CRS method of a PCI root busin the _CRS method of a PCI root bus

Only one PCI root bus may have resources that spansOnly one PCI root bus may have resources that spansthe 4 GB boundarythe 4 GB boundary

Use a QWORD memory descriptor in the _CRS methodUse a QWORD memory descriptor in the _CRS methodof a PCI root bus to define a memory rangeof a PCI root bus to define a memory range

This range is then available as a PCI device memory resourceThis range is then available as a PCI device memory resourceto the entire hierarchy that emanates from the root busto the entire hierarchy that emanates from the root bus

Windows Vista uses this range Windows Vista uses this range If the processor and operating system version allow it If the processor and operating system version allow it

Page 46: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

PCI Device Resources PCI Device Resources Firmware recommendationsFirmware recommendations

Assign boot configurations for PCI devices Assign boot configurations for PCI devices below 4 GB to provide compatibility with below 4 GB to provide compatibility with Windows XP and Windows Server 2003Windows XP and Windows Server 2003

Implement the new _DSM method to Implement the new _DSM method to allow Windows Vista to ignore PCI device allow Windows Vista to ignore PCI device boot configurationsboot configurations

This ensures the most flexible resource This ensures the most flexible resource allocation on Windows Vistaallocation on Windows Vista

Page 47: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

Active State Active State Power Management Power Management Firmware override mechanismsFirmware override mechanisms

Proposed IAPC_BOOT_ARCH flagProposed IAPC_BOOT_ARCH flag

BOOT_ARCHBit

lengthBit

offsetDescription

LEGACY_DEVICES 1 0

If set, indicates that the motherboard supports user-visible devices on the LPC or ISA bus. User-visible devices are devices that have end-user accessible connectors (for example, LPT port), or devices for which the OS must load a device driver so that an end-user application can use a device. If clear, the OS may assume there are no such devices and that all devices in the system can be detected exclusively via industry standard device enumeration mechanisms (including the ACPI namespace).

8042 1 1 If set, indicates that the motherboard contains support for a port 60 and 64 based keyboard controller, usually implemented as an 8042 or equivalent micro-controller.

VGA Not Present 1 2 If set, indicates to OSPM that it must not blindly probe the VGA hardware (that responds to MMIO addresses A0000h-BFFFFh and IO ports 3B0h-3BBh and 3C0h-3DFh) that may cause machine check on this system. If clear, indicates to OSPM that it is safe to probe the VGA hardware..

MSI Not Supported 1 3 If set, indicates to OSPM that it must not enable Message Signaled Interrupts (MSI) on this platform.

PCIe ASPM Controls 1 4 If set, indicates to OSPM that it must not enable ASPM on this platform.

Reserved 11 5 Must be 0.

Page 48: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.

© 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions,

it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Page 49: PCI Express In Depth For Windows Vista And Beyond Allen Marshall Lead Program Manager Vinod Mamtani Software Development Engineer Core Platform Architecture.