Binary Translation Shared Object Level Performance
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current binary translation methods are resource-intensive and inefficient, particularly in full machine emulation, where the entire guest machine hardware is emulated, leading to slow performance and high resource consumption, while system call emulation lacks precise guest emulation.
Innovation Solution
The approach involves binary translation on a shared object level, where only application-specific dynamic libraries and system calls are emulated, using trampolines for late binding and ABI translation, and leveraging common dynamic libraries on the host platform to avoid translating vendor and system libraries, thus optimizing performance by reducing unnecessary binary translation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Adaptability or versatility
If full machine emulation is used to translate binary code from guest platform to host platform, then compatibility with different hardware architectures is improved, but resource consumption increases and execution speed decreases
Solution Approach 1:
The patent segments the binary translation process by identifying and separating frequently executed code paths (hot paths) from less frequently executed code. The translator applies aggressive optimization techniques specifically to hot paths, while using more conservative translation for other code regions. This segmentation allows the system to achieve high performance for critical operations without incurring the full overhead of optimizing entire binary images, thus resolving the contradiction between compatibility and execution speed.
Solution Approach 2:
The patent implements partial action by applying binary translation selectively rather than translating entire binary images. The system identifies only the necessary portions of code that need translation for the current execution context, translating and executing these partial segments directly on the host platform. This approach maintains compatibility for required functionality while significantly reducing the resource consumption and execution overhead associated with full binary translation.
2Adaptability or versatility
If entire binary images are translated and executed on host platform, then guest program compatibility is improved, but memory consumption increases
Solution Approach 1:
The patent segments binary image processing by dividing large binary images into smaller manageable blocks or segments. The system translates and loads only those segments that are currently needed for execution, rather than translating and loading entire binary images into memory simultaneously. This segmentation strategy maintains guest program compatibility by enabling complete binary execution while significantly reducing peak memory consumption through on-demand segment loading.
Solution Approach 2:
The patent implements partial action by translating and loading only the necessary portions of binary images rather than complete images. The system performs selective translation of code segments based on execution requirements, loading these partial translations into memory for execution. This approach ensures guest program compatibility is maintained for required functionality while reducing memory consumption by avoiding unnecessary translation and loading of unused binary image portions.
3Reliability
If binary translation is applied to all shared objects including system libraries, then complete guest environment emulation is achieved, but translation overhead and execution time increase
Solution Approach 1:
The patent segments the set of shared objects by categorizing them into different types: system libraries, vendor libraries, and application-specific libraries. The translation process is selectively applied based on this segmentation - system libraries that have native equivalents on the host platform are executed natively without translation, while only application-specific shared objects requiring guest environment semantics are translated. This segmentation maintains emulation accuracy for critical guest-specific functionality while minimizing translation overhead by avoiding unnecessary translation of common system libraries.
Solution Approach 2:
The patent implements partial action by applying binary translation selectively to only those shared objects that require guest environment emulation rather than translating all shared objects uniformly. The system identifies and translates only the necessary application-specific shared objects while executing native system libraries directly on the host platform. This selective approach maintains complete guest environment emulation accuracy where needed while significantly reducing translation overhead and execution time by avoiding redundant translation of system libraries with native equivalents.
Data Source
Figure 1A
Figure 1B
Figure 2
AI summary
Techniques for binary translation are disclosed. A host platform receives a program for a guest platform different from the host. The program uses a set of shared objects or dynamically loaded libraries and is not compatible with the host platform. The host platform determines whether the host platform has a corresponding shared object or dynamically loaded library that implements a common external interface with a specified shared object or dynamically loaded library from within the set. If the host platform has the corresponding shared object or dynamically loaded library, the host platform uses the corresponding shared object or dynamically loaded library in place of the specified shared object or dynamically loaded library for execution of the program. If the host platform lacks the corresponding shared object or dynamically loaded library, the host platform performs binary translation of the specified shared object or dynamically loaded library for execution of the program.