Processor Emulation via Dual Binary Translation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing processor emulation systems employing just-in-time compilation are slow, insecure, and unsuitable for many emulation environments, particularly those with strict security models that prohibit dynamically generated machine code.

Innovation Solution

The system generates two translations of a source binary: a highly optimized first translation and a conservative second translation that includes all possible machine instructions, allowing the processor to fail over to the second translation when the target address is not addressable in the first, thereby avoiding runtime compilation and ensuring security and performance.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If just-in-time compilation is used for processor emulation, then the target architecture can execute source binary code, but the system becomes slow and insecure due to runtime code generation

Engineering Contradiction:
Improveemulation capabilityVSAvoidsecurity
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent pre-translates the source binary into multiple target binary versions before runtime execution. Each translation uses different optimization levels and instruction set selections, creating a set of pre-prepared executables that can be immediately deployed without runtime compilation, thus eliminating security risks while maintaining emulation capability

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system generates multiple translations of the source binary with varying parameters such as optimization levels, instruction set architectures, and code structures. By changing these translation parameters, the system creates diverse binary versions that can be selected based on security requirements and performance needs, resolving the contradiction between security and adaptability

Inventive Principle:
Principle #35Parameter changes

2Adaptability or versatility

If just-in-time compilation is used for processor emulation, then code can be generated dynamically, but the system becomes slow due to compilation overhead at runtime

Engineering Contradiction:
Improvedynamic code generationVSAvoidexecution speed
Core Design Contradiction:
Adaptability or versatilityVSProductivity

Solution Approach 1:

All translation and compilation work is performed beforehand during a preprocessing stage, producing multiple ready-to-execute binary versions. At runtime, the system simply loads and executes one of the pre-compiled binaries, eliminating compilation overhead and maximizing execution speed while retaining the ability to adapt through binary selection

Inventive Principle:
Principle #10Preliminary action

3Productivity

If a single optimized translation is used, then execution speed is improved, but security is compromised due to aggressive optimizations

Engineering Contradiction:
Improveprocessing speedVSAvoidsecurity
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent segments the translation process into multiple versions with different optimization levels. One version prioritizes speed with aggressive optimizations, while another prioritizes security with conservative, verified transformations. The system can select or combine these segments based on security requirements, resolving the contradiction between speed and security

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system creates a composite translation approach by combining multiple binary versions with different optimization characteristics. This composite structure allows the system to leverage both highly optimized code for performance and conservatively translated code for security, achieving both speed and reliability simultaneously

Inventive Principle:
Principle #40Composite materials

4Reliability

If multiple translations are generated, then reliability and security are improved through failover capability, but memory consumption increases

Engineering Contradiction:
Improveemulation reliabilityVSAvoidmemory usage
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

The multiple translations are segmented into distinct binary files or code sections that can be independently loaded and managed. This segmentation allows the system to load only the necessary translation version into memory at any given time, reducing overall memory consumption while maintaining the reliability benefits of having multiple translations available

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

Different regions or sections of the translated code have different qualities and optimization levels. Critical security-sensitive sections use conservative translations, while non-critical sections use highly optimized versions. This local differentiation reduces the need to maintain multiple complete binary versions in memory, lowering memory usage while preserving reliability

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS10809988B2Processor emulation using multiple translations
Publication Date: 2020.10.20 MICROSOFT TECHNOLOGY LICENSING LLC
  • US10809988B2 patent drawing
  • US10809988B2 patent drawing
  • US10809988B2 patent drawing

AI summary

Examples described herein emulate a processing architecture using multiple translations of the same source binary. A first translation binary includes compiler optimizations not present in a second translation binary. During runtime, a dispatcher directs control flow of a CPU when branch instructions are reached. Specifically, a dispatcher directs a CPU to execute instructions in the first translation binary, and accesses the second translation binary when an instruction is to a target that is not addressable in the first translation binary. The first and second translation binaries enable a target processing architecture to emulate a source processing architecture without just-in-time compilation or other runtime interpretation.