CONTENTS
viii Vol. 3A
PAGE
CHAPTER 8
MULTIPLE-PROCESSOR MANAGEMENT
8.1 LOCKED ATOMIC OPERATIONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-2
8.1.1 Guaranteed Atomic Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
8.1.2 Bus Locking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-3
8.1.2.1 Automatic Locking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-4
8.1.2.2 Software Controlled Bus Locking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-5
8.1.3 Handling Self- and Cross-Modifying Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-6
8.1.4 Effects of a LOCK Operation on Internal Processor Caches . . . . . . . . . . . . . . . . . . . . . . . . 8-7
8.2 MEMORY ORDERING. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-8
8.2.1 Memory Ordering in the Intel
®
Pentium
®
and Intel486
™
Processors. . . . . . . . . . . . . 8-8
8.2.2 Memory Ordering in P6 and More Recent Processor Families . . . . . . . . . . . . . . . . . . . . . . 8-9
8.2.3 Examples Illustrating the Memory-Ordering Principles. . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-11
8.2.3.1 Assumptions, Terminology, and Notation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-11
8.2.3.2 . . . . . . . . . . . . . . . . Neither Loads Nor Stores Are Reordered with Like Operations8-12
8.2.3.3 Stores Are Not Reordered With Earlier Loads. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-13
8.2.3.4 Loads May Be Reordered with Earlier Stores to Different Locations . . . . . . . . . . . 8-13
8.2.3.5 Intra-Processor Forwarding Is Allowed . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-14
8.2.3.6 Stores Are Transitively Visible. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-15
8.2.3.7 Stores Are Seen in a Consistent Order by Other Processors . . . . . . . . . . . . . . . . . . . 8-15
8.2.3.8 Locked Instructions Have a Total Order . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-16
8.2.3.9 . . . . . . . . . . . . . . . . Loads and Stores Are Not Reordered with Locked Instructions8-16
8.2.4 Out-of-Order Stores For String Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-18
8.2.4.1 Memory-Ordering Model for String Operations on Write-back (WB) Memory . . . . 8-18
8.2.4.2 Examples Illustrating Memory-Ordering Principles for String Operations. . . . . . . . 8-19
8.2.5 Strengthening or Weakening the Memory-Ordering Model. . . . . . . . . . . . . . . . . . . . . . . . 8-22
8.3 SERIALIZING INSTRUCTIONS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-24
8.4 MULTIPLE-PROCESSOR (MP) INITIALIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-26
8.4.1 BSP and AP Processors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-27
8.4.2 MP Initialization Protocol Requirements and Restrictions. . . . . . . . . . . . . . . . . . . . . . . . . 8-27
8.4.3 MP Initialization Protocol Algorithm for Intel Xeon Processors . . . . . . . . . . . . . . . . . . . . 8-28
8.4.4 MP Initialization Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-29
8.4.4.1 Typical BSP Initialization Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-30
8.4.4.2 Typical AP Initialization Sequence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-32
8.4.5 Identifying Logical Processors in an MP System. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-33
8.5 INTEL
®
HYPER-THREADING TECHNOLOGY AND INTEL
®
MULTI-CORE TECHNOLOGY. 8-35
8.6 DETECTING HARDWARE MULTI-THREADING SUPPORT AND TOPOLOGY. . . . . . . . . . . . . . 8-35
8.6.1 Initializing Processors Supporting Hyper-Threading Technology . . . . . . . . . . . . . . . . . . 8-36
8.6.2 Initializing Multi-Core Processors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-37
8.6.3 Executing Multiple Threads on an Intel
®
64 or IA-32 Processor Supporting Hardware
Multi-Threading. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-37
8.6.4 Handling Interrupts on an IA-32 Processor Supporting Hardware Multi-Threading . 8-37
8.7 INTEL
®
HYPER-THREADING TECHNOLOGY ARCHITECTURE . . . . . . . . . . . . . . . . . . . . . . . . . 8-38
8.7.1 State of the Logical Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-39
8.7.2 APIC Functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-40
8.7.3 Memory Type Range Registers (MTRR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-40
8.7.4 Page Attribute Table (PAT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-41
8.7.5 Machine Check Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-41
8.7.6 Debug Registers and Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-41
8.7.7 Performance Monitoring Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-42
8.7.8 IA32_MISC_ENABLE MSR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-42