Selective Branch Target Buffer Flushing Against Poisoning

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional branch target buffer (BTB) flushing methods to prevent branch target buffer poisoning are inefficient and performance-impacting, particularly in trusted execution environments where the management layer (hypervisor or operating system) is not trusted, leading to potential information leakage and performance degradation during world switches.

Innovation Solution

Implementing a mechanism to store identifiers of processes that modify branch prediction structures and selectively flush the BTB based on comparisons during mode changes, ensuring only trusted processes can modify the BTB, thereby preventing unauthorized modifications and reducing unnecessary flushing.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the BTB is flushed during every world switch to prevent poisoning, then security is improved, but system performance deteriorates due to unnecessary flushing

Engineering Contradiction:
ImprovesecurityVSAvoidsystem performance
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent applies local quality by differentiating the treatment of BTB entries based on their ownership. Instead of flushing the entire BTB during world switches, the system tracks which entries belong to which process and only flushes entries associated with processes that are no longer executing. This selective approach maintains security by removing potentially poisoned entries while preserving performance by retaining valid predictions from still-executing processes.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent implements preliminary action by establishing process-BTB entry mappings before world switches occur. The system records which process created each BTB entry and uses this information during mode changes to determine whether to flush specific entries. This advance preparation allows the system to make informed decisions about BTB management without unnecessary flushing operations.

Inventive Principle:
Principle #10Preliminary action

2Productivity

If the BTB is not flushed during world switches, then system performance is maintained, but security deteriorates due to potential poisoning by management layer

Engineering Contradiction:
Improvesystem performanceVSAvoidsecurity
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent employs feedback mechanisms to monitor mode changes and process identifiers. During world switches, the system receives feedback about which process is executing and uses this information to dynamically manage BTB entries. The feedback loop ensures that the system can distinguish between trusted and untrusted processes, allowing selective flushing only when necessary to maintain security without impacting performance.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent segments the BTB into process-specific portions by tracking which process created each entry. This segmentation allows the system to manage different parts of the BTB independently, flushing only the portions associated with processes that have exited or been terminated, while preserving entries from currently executing processes. This approach maintains both security and performance.

Inventive Principle:
Principle #1Segmentation

3Measurement precision

If process identifiers are tracked to enable selective flushing, then accuracy of BTB management is improved, but device complexity increases

Engineering Contradiction:
Improveaccuracy of BTB managementVSAvoidcomplexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent makes the process identifier tracking mechanism universal by using the same infrastructure that already exists for process management and mode change handling. The system leverages existing registers and control structures to store and compare process identifiers, rather than introducing entirely new hardware components. This multi-functional approach achieves accurate BTB management while minimizing additional complexity.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS12443702B1Protection against branch target buffer poisoning by a management layer
Publication Date: 2025.10.14 ADVANCED MICRO DEVICES INC
  • US12443702B1 patent drawing
  • US12443702B1 patent drawing
  • US12443702B1 patent drawing

AI summary

A processing system includes a branch prediction structure storing information used to predict the outcome of a branch instruction. The processing system also includes a register storing a first identifier of a first process in response to the processing system changing from a first mode that allows the first process to modify the branch prediction structure to a second mode in which the branch prediction structure is not modifiable. The processing system further includes a processor core that selectively flushes the branch prediction structure based on a comparison of a second identifier of a second process and the first identifier stored in the register. The comparison is performed in response to the second process causing a change from the second mode to the first mode.