# US 2021/0173931 A1 · Speculative side-channel attack mitigations

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0173931 A1
- Document ID: US20210173931A1
- Status: Published application
- Kind: A1
- Application number: 17/182,062
- Filed: 2021-02-22
- Published: 2021-06-10
- Earliest claimed: 2017-10-12
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Kenneth D. JOHNSON; Jonathan E. LANGE
- Web page: https://patentgrep.com/patent/US20210173931A1

## CPC

- G06F 21/566: {Dynamic detection, i.e. detection performed at run-time, e.g. emulation, suspicious activities}
- G06F 9/30043: {LOAD or STORE instructions; Clear instruction}
- G06F 9/30058: {Conditional branch instructions}
- G06F 9/30098: {Register arrangements}
- G06F 9/30105: {Register structure}
- G06F 9/3842: {Speculative instruction execution}
- G06F 9/3865: {using deferred exception handling, e.g. exception flags}
- G06F 12/0811: with multilevel cache hierarchies
- G06F 12/14: Protection against unauthorised use of memory {or access to memory}
- G06F 21/52: during program execution, e.g. stack integrity {; Preventing unwanted data erasure; Buffer overflow}
- G06F 21/75: by inhibiting the analysis of circuitry or operation
- H04L 9/003: {for power analysis, e.g. differential power analysis [DPA] or simple power analysis [SPA]}
- G06F 2212/1052: Security improvement
- G06F 2212/452: Instruction code
- G06F 2212/507: using speculative control
- G06F 2221/034: Test or assess a computer or a system
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

Preventing the observation of the side effects of mispredicted speculative execution flows using speculation buffering. A microprocessor comprises one or more speculation buffers that are separated from and correspond to one or more conventional buffers. The microprocessor records first effects of one or more speculatively-executed instructions to the one or more speculation buffers, and records second effects of non-speculatively-executed instructions to the one or more conventional buffers. The microprocessor commits the first effects from the one or more speculation buffers to the one or more conventional buffers when the one or more speculatively-executed instructions that generated the first effects are committed, and discards the first effects from the one or more speculation buffers when the one or more speculatively-executed instructions are cancelled.

## Claims

### Claim 1

A microprocessor, comprising:
one or more speculation buffers that are separated from and correspond to one or more conventional buffers;
first logic that records first effects of one or more speculatively-executed instructions to the one or more speculation buffers, and that records second effects of non-speculatively-executed instructions to the one or more conventional buffers; and
second logic that (i) commits the first effects from the one or more speculation buffers to the one or more conventional buffers when the one or more speculatively-executed instructions that generated the first effects are committed, and that (ii) discards the first effects from the one or more speculation buffers when the one or more speculatively-executed instructions are cancelled.

### Claim 2 (depends on 1)

The microprocessor of claim 1, wherein,
the one or more speculation buffers comprise a speculative translation lookaside buffer (TLB), and the one or more conventional buffers comprise a TLB;
the first effects of the one or more speculatively-executed instructions comprise a memory address translation; and
committing the first effects from the one or more speculation buffers to the one or more conventional buffers comprises committing the memory address translation from the speculative TLB to the TLB.

### Claim 3 (depends on 1)

The microprocessor of claim 1, wherein,
the one or more speculation buffers comprise a speculative data cache, and the one or more conventional buffers comprise a data cache;
the first effects of the one or more speculatively-executed instructions comprise a cache line; and
committing the first effects from the one or more speculation buffers to the one or more conventional buffers comprises committing the cache line from the speculative data cache to the data cache.

### Claim 4 (depends on 1)

The microprocessor of claim 1, wherein,
the one or more speculation buffers comprise a speculative data cache;
the first logic fills the speculative data cache with a cache line from system memory, without filling an intermediary cache; and
committing the first effects comprises filling the intermediary cache with the cache line.

### Claim 5 (depends on 1)

The microprocessor of claim 1, wherein,
the one or more speculation buffers comprise a speculative data cache;
the first logic fills the speculative data cache with a cache line from a first intermediary cache, without filling a second intermediary cache that is between the data cache and the first intermediary cache in a memory hierarchy; and
committing the first effects comprises filling the second intermediary cache with the cache line.

### Claim 6 (depends on 1)

The microprocessor of claim 1, wherein,
the one or more speculation buffers comprise a speculative data cache corresponding to a first processing element;
the first logic fills the speculative data cache for a speculatively-executed instruction by employing a cache probe in accordance with a cache coherence protocol (CCP) to obtain data from a second processing element; and
the speculatively-executed instruction is held without filling the speculative data cache if the cache probe would result in a state change in a data cache of the second processing element.

### Claim 7 (depends on 1)

The microprocessor of claim 1, wherein a speculatively-executed instruction is held when a speculation buffer is full.

### Claim 8 (depends on 1)

The microprocessor of claim 1, wherein branch predictors are updated only with results from committed instructions.

### Claim 9 (depends on 1)

The microprocessor of claim 1, wherein the one or more speculation buffers include a first speculation buffer that is used by first speculatively-executed instructions from a first context, and a second speculation buffer that is used by second speculatively-executed instructions from a second context.

### Claim 10 (depends on 1)

The microprocessor of claim 1, wherein the first logic fills a speculation buffer entry based on execution of a first speculatively-executed instruction, and a second speculatively-executed instruction retrieves data from the speculation buffer entry prior to the first speculatively-executed instruction completing.

### Claim 11 (depends on 1)

The microprocessor of claim 1, wherein a speculatively-executed instruction causes invalidation of at least a portion of a specified cache line, and the invalidation is deferred until retiring of the speculatively-executed instruction.

### Claim 12

A method, implemented at a microprocessor that comprises one or more speculation buffers that are separated from and correspond to one or more conventional buffers, the method comprising:
recording first effects of one or more speculatively-executed instructions to the one or more speculation buffers;
recording second effects of non-speculatively-executed instructions to the one or more conventional buffers;
committing the first effects from the one or more speculation buffers to the one or more conventional buffers when the one or more speculatively-executed instructions that generated the first effects are committed; and
discarding the first effects from the one or more speculation buffers when the one or more speculatively-executed instructions are cancelled.

### Claim 13 (depends on 12)

The method of claim 12, wherein,
the one or more speculation buffers comprise a speculative translation lookaside buffer (TLB), and the one or more conventional buffers comprise a TLB;
the first effects of the one or more speculatively-executed instructions comprise a memory address translation; and
committing the first effects from the one or more speculation buffers to the one or more conventional buffers comprises committing the memory address translation from the speculative TLB to the TLB.

### Claim 14 (depends on 12)

The method of claim 12, wherein,
the one or more speculation buffers comprise a speculative data cache, and the one or more conventional buffers comprise a data cache;
the first effects of the one or more speculatively-executed instructions comprise a cache line; and
committing the first effects from the one or more speculation buffers to the one or more conventional buffers comprises committing the cache line from the speculative data cache to the data cache.

### Claim 15 (depends on 12)

The method of claim 12, wherein,
the one or more speculation buffers comprise a speculative data cache;
the method fills the speculative data cache with a cache line from system memory, without filling an intermediary cache; and
committing the first effects comprises filling the intermediary cache with the cache line.

### Claim 16 (depends on 12)

The method of claim 12, wherein,
the one or more speculation buffers comprise a speculative data cache;
the method fills the speculative data cache with a cache line from a first intermediary cache, without filling a second intermediary cache that is between the data cache and the first intermediary cache in a memory hierarchy; and
committing the first effects comprises filling the second intermediary cache with the cache line.

### Claim 17 (depends on 12)

The method of claim 12, wherein,
the one or more speculation buffers comprise a speculative data cache corresponding to a first processing element;
the method fills the speculative data cache for a speculatively-executed instruction by employing a cache probe in accordance with a cache coherence protocol (CCP) to obtain data from a second processing element; and
the speculatively-executed instruction is held without filling the speculative data cache if the cache probe would result in a state change in a data cache of the second processing element.

### Claim 18 (depends on 12)

The method of claim 12, wherein a speculatively-executed instruction is held when a speculation buffer is full.

### Claim 19 (depends on 12)

The method of claim 12, wherein branch predictors are updated only with results from committed instructions.

### Claim 20

A processing unit comprising one or more speculation buffers that are separated from and correspond to one or more conventional buffers, and control logic that configures the processing unit to:
record first effects of one or more speculatively-executed instructions to the one or more speculation buffers;
record second effects of non-speculatively-executed instructions to the one or more conventional buffers;
commit the first effects from the one or more speculation buffers to the one or more conventional buffers when the one or more speculatively-executed instructions that generated the first effects are committed; and
discard the first effects from the one or more speculation buffers when the one or more speculatively-executed instructions are cancelled.
