Article may be outdated

This article is 54 days old. Some details may have changed since publication.

Hacker News·3 min read·hard

Assembly Hall of Shame

P
piotrgrabowski
Assembly Hall of Shame
✦AI Summary

This article explores the "Assembly Hall of Shame," a project dedicated to finding the absolute slowest single-instruction performance on x86 architecture, rather than optimizing for speed. It details strategies for instructions like `fxrstor64` and `nop` to achieve extremely high latency by exploiting memory access patterns and system contention. The goal is to push the boundaries of how long a single CPU instruction can be made to take.

Why it matters

This highly technical exploration provides insights into the intricate workings and potential bottlenecks of CPU architecture, which can be valuable for low-level system programmers, security researchers, or those interested in extreme performance analysis. It highlights how seemingly simple operations can be manipulated to consume vast amounts of CPU cycles, potentially revealing vulnerabilities or design quirks.

✦Dive DeeperCreate a free account to unlock

Instruction latency analysis usually focuses on performance optimization —making code run as fast as possible. The Assembly Hall of Shame takes the opposite approach: searching for the absolute floor of single-instruction performance.

x86 : fxrstor64 Strategy : Use fxrstor64 to load 512-byte FPU/MMX/XMM state from a high-latency MMIO region in the PCIe fabric, then starve the fabric while the load is in flight — a fleet of hammer cores pounds a different high-latency MMIO register with tight 4-byte reads, saturating the PCIe root complex and endpoint with non-posted transactions, so CPU 0's 512-byte fxrstor64 must queue behind all that contending traffic.

; CPU 0 — timed instruction movl $ 0xfcc68830 , % rsi fxrstor64 % rsi ; CPUs 1..N — hammer loop against a different high-latency location movl 0xfcc68858 , % eax 🏆 Score : 198,002,498,236 cycles

Continue reading on Headlinne

Create a free account to read the full article.

Read full article →
technologyscience
✦

Get smarter about the news

Sign up free for a feed built around what you actually care about, Dive Deeper research on any story, and the full text of every article.

Create free account

Already have an account? Sign in