JP2015179318A - バイナリコードの実行を制御する装置及び方法 - Google Patents
バイナリコードの実行を制御する装置及び方法 Download PDFInfo
- Publication number
- JP2015179318A JP2015179318A JP2014055409A JP2014055409A JP2015179318A JP 2015179318 A JP2015179318 A JP 2015179318A JP 2014055409 A JP2014055409 A JP 2014055409A JP 2014055409 A JP2014055409 A JP 2014055409A JP 2015179318 A JP2015179318 A JP 2015179318A
- Authority
- JP
- Japan
- Prior art keywords
- binary code
- code
- rewriting
- self
- trace
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/52—Binary to binary
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/52—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/0703—Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/55—Detecting local intrusion or implementing counter-measures
- G06F21/56—Computer malware detection or handling, e.g. anti-virus arrangements
- G06F21/568—Computer malware detection or handling, e.g. anti-virus arrangements eliminating virus, restoring damaged files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline, look ahead
- G06F9/3861—Recovery, e.g. branch miss-prediction, exception handling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
Abstract
【解決手段】DBTのランタイム50では、SMC検出部51が、オリジナルバイナリコードのSMCによる書き換えの発生を検出し、トレース特定部54が、SMCによる書き換えの発生の検出に応じて、オリジナルバイナリコードを最適化して得られた最適化バイナリコードのSMCによる書き換えの影響を受けるトレースを特定し、トレース修正部55が、複数のスレッドのうちのこのトレースを実行したスレッドが例外を発生するようにこのトレースを修正し、スレッド実行制御部56が、例外が発生した際に、SMCにより書き換えられたオリジナルバイナリコードのトレースを、例外を発生したスレッドが実行するように制御する。
【選択図】図6
Description
図1は、本実施の形態におけるバイナリ変換装置(命令エミュレータ)1の機能構成例を示した図である。図示するように、このバイナリ変換装置1は、オリジナルコードキャッシュ10と、最適化コードキャッシュ20と、DBT(Dynamic Binary Translator)30とを含む。DBT30は、オプティマイザ40と、ランタイム50とを含む。
バイナリ変換装置1でSMCに対処するのに、普通に考えられる手法ではコストがかかる。以下、このことについて具体的に説明する。
そこで、本実施の形態では、SMCによる書き換えを発生させたスレッドを用いて、無効になったトレースに対して、ソフトウェア割込み命令を書き込む修正を行う。本実施の形態では、この修正のことを「ポイズニング」と呼ぶ。
図6は、以上のような概略動作を行うランタイム50の機能構成例を示した図である。図示するように、このランタイム50は、SMC検出部51と、マッピング処理部52と、フラグ設定部53と、トレース特定部54と、トレース修正部55と、スレッド実行制御部56とを備える。
図7は、本実施の形態におけるランタイム50の動作例を示したフローチャートである。
図8は、本実施の形態におけるDBT30のハードウェア構成例を示した図である。図示するように、DBT30は、演算手段であるCPU(Central Processing Unit)30aと、M/B(マザーボード)チップセット30bを介してCPU30aに接続されたメインメモリ30cと、同じくM/Bチップセット30bを介してCPU30aに接続された表示機構30dとを備える。また、M/Bチップセット30bには、ブリッジ回路30eを介して、ネットワークインターフェイス30fと、磁気ディスク装置(HDD)30gと、音声機構30hと、キーボード/マウス30iと、フレキシブルディスクドライブ30jとが接続されている。
Claims (8)
- 複数のスレッドによるバイナリコードの実行を制御する装置であって、
第1のバイナリコードの部分である第1の部分の自己書き換えコードによる書き換えの発生を検出する検出部と、
前記第1の部分の前記自己書き換えコードによる書き換えの発生の検出に応じて、前記第1のバイナリコードを変換して得られた第2のバイナリコードの当該第1の部分に対応する部分である第2の部分を特定する特定部と、
前記複数のスレッドのうちの前記第2のバイナリコードの前記第2の部分を実行した特定スレッドが例外を発生するように当該第2の部分を修正する修正部と
を含む、装置。 - 前記修正部は、前記第2の部分に含まれる複数の命令のうち、前記第1の部分に含まれる前記自己書き換えコードにより書き換えられた命令に対応する少なくとも1つの命令を、割り込み命令で置き換えることにより、当該第2の部分を修正する、請求項1の装置。
- 前記例外が発生した際に、前記自己書き換えコードにより書き換えられた前記第1のバイナリコードの前記第1の部分を前記特定スレッドが実行するように制御する制御部を更に含む、請求項1又は請求項2の装置。
- 前記制御部は、前記第2のバイナリコードの前記第2の部分以外の部分から当該第2の部分へのリンクを切り離した後に、前記第1のバイナリコードの前記第1の部分を前記特定スレッドが実行するように制御する、請求項3の装置。
- 前記第1の部分の少なくとも一部が記憶されたメモリ領域であって前記自己書き換えコードにより書き換えられた命令を含むメモリ領域であるページが、ページ保護がかかっておらず使用されていない仮想ページにマッピングされた状態を、前記特定部が前記第2の部分を特定し、前記修正部が当該第2の部分を修正する間、維持する維持部を更に含む、請求項1乃至請求項4の何れかの装置。
- 複数のスレッドによるバイナリコードの実行を制御する装置であって、
オリジナルバイナリコードを最適化することにより、最適化バイナリコードを生成する生成部と、
前記最適化バイナリコードを複数のスレッドが実行中に、前記オリジナルバイナリコードの部分である第1の部分の自己書き換えコードによる書き換えの発生を検出する検出部と、
前記第1の部分の前記自己書き換えコードによる書き換えの発生の検出に応じて、前記最適化バイナリコードの当該第1の部分に対応する部分である第2の部分を特定する特定部と、
前記複数のスレッドのうちの前記最適化バイナリコードの前記第2の部分を実行した特定スレッドが例外を発生するように当該第2の部分を修正する修正部と、
前記例外が発生した際に、前記自己書き換えコードにより書き換えられた前記オリジナルバイナリコードの前記第1の部分を前記特定スレッドが実行するように制御する制御部と
を含む、装置。 - 複数のスレッドによるバイナリコードの実行を制御する方法であって、
第1のバイナリコードの部分である第1の部分の自己書き換えコードによる書き換えの発生を検出するステップと、
前記第1の部分の前記自己書き換えコードによる書き換えの発生の検出に応じて、前記第1のバイナリコードを変換して得られた第2のバイナリコードの当該第1の部分に対応する部分である第2の部分を特定するステップと、
前記複数のスレッドのうちの前記第2のバイナリコードの前記第2の部分を実行した特定スレッドが例外を発生するように当該第2の部分を修正するステップと
を含む、方法。 - 複数のスレッドによるバイナリコードの実行を制御する装置として、コンピュータを機能させるプログラムであって、
前記コンピュータを、
第1のバイナリコードの部分である第1の部分の自己書き換えコードによる書き換えの発生を検出する検出部と、
前記第1の部分の前記自己書き換えコードによる書き換えの発生の検出に応じて、前記第1のバイナリコードを変換して得られた第2のバイナリコードの当該第1の部分に対応する部分である第2の部分を特定する特定部と、
前記複数のスレッドのうちの前記第2のバイナリコードの前記第2の部分を実行した特定スレッドが例外を発生するように当該第2の部分を修正する修正部と
して機能させる、プログラム。
Priority Applications (5)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014055409A JP6103541B2 (ja) | 2014-03-18 | 2014-03-18 | バイナリコードの実行を制御する装置及び方法 |
US14/634,018 US9430205B2 (en) | 2014-03-18 | 2015-02-27 | Controlling execution of binary code |
US14/746,875 US9626169B2 (en) | 2014-03-18 | 2015-06-23 | Controlling execution of binary code |
US15/057,340 US9760357B2 (en) | 2014-03-18 | 2016-03-01 | Controlling execution of binary code |
US15/437,530 US10241768B2 (en) | 2014-03-18 | 2017-02-21 | Controlling execution of binary code |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2014055409A JP6103541B2 (ja) | 2014-03-18 | 2014-03-18 | バイナリコードの実行を制御する装置及び方法 |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2015179318A true JP2015179318A (ja) | 2015-10-08 |
JP6103541B2 JP6103541B2 (ja) | 2017-03-29 |
Family
ID=54142176
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2014055409A Active JP6103541B2 (ja) | 2014-03-18 | 2014-03-18 | バイナリコードの実行を制御する装置及び方法 |
Country Status (2)
Country | Link |
---|---|
US (4) | US9430205B2 (ja) |
JP (1) | JP6103541B2 (ja) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7483950B2 (ja) | 2020-06-22 | 2024-05-15 | アップル インコーポレイテッド | バイナリ変換を実行するためのシステム及び方法 |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6103541B2 (ja) | 2014-03-18 | 2017-03-29 | インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation | バイナリコードの実行を制御する装置及び方法 |
EP3931330A4 (en) | 2019-02-25 | 2023-03-15 | Ginkgo Bioworks, Inc. | BIOSYNTHESIS OF CANNABINOIDS AND CANNABINOID PRECURSORS |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001519955A (ja) * | 1997-08-11 | 2001-10-23 | トランスメタ・コーポレーション | 先進のプロセッサのための変換メモリ保護装置 |
US20100333090A1 (en) * | 2009-06-30 | 2010-12-30 | Sun Microsystems, Inc. | Method and apparatus for protecting translated code in a virtual machine |
JP2012198657A (ja) * | 2011-03-18 | 2012-10-18 | Fujitsu Ltd | 命令処理方法、命令処理装置、及び命令処理プログラム |
Family Cites Families (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5896522A (en) | 1996-12-31 | 1999-04-20 | Unisys Corporation | Selective emulation interpretation using transformed instructions |
EP1151374B1 (en) | 1999-01-28 | 2017-08-02 | Advanced Silicon Technologies, LLC | Executing programs for a first computer architecture on a computer of a second architecture |
US6820255B2 (en) * | 1999-02-17 | 2004-11-16 | Elbrus International | Method for fast execution of translated binary code utilizing database cache for low-level code correspondence |
US20020016601A1 (en) * | 2000-01-03 | 2002-02-07 | Shadduck John H. | Instruments and techniques for inducing neocollagenesis in skin treatments |
US6820254B2 (en) * | 2001-03-19 | 2004-11-16 | International Business Machines Corporation | Method and system for optimizing code using an optimizing coprocessor |
CA2346766A1 (en) * | 2001-05-07 | 2002-11-07 | Ibm Canada Limited-Ibm Canada Limitee | Efficient locking for thread-safe self-modifying code |
US7934204B2 (en) | 2003-07-15 | 2011-04-26 | International Business Machines Corporation | Partitioning code in program code conversion |
US7707578B1 (en) * | 2004-12-16 | 2010-04-27 | Vmware, Inc. | Mechanism for scheduling execution of threads for fair resource allocation in a multi-threaded and/or multi-core processing system |
JP3938580B2 (ja) | 2004-12-21 | 2007-06-27 | 株式会社ソニー・コンピュータエンタテインメント | 情報処理装置、情報処理方法、半導体装置、コンピュータプログラム |
US7577826B2 (en) * | 2006-01-30 | 2009-08-18 | Sony Computer Entertainment Inc. | Stall prediction thread management |
US20080005269A1 (en) * | 2006-06-29 | 2008-01-03 | Knighton Mark S | Method and apparatus to share high quality images in a teleconference |
CA2557343C (en) * | 2006-08-28 | 2015-09-22 | Ibm Canada Limited-Ibm Canada Limitee | Runtime code modification in a multi-threaded environment |
GB2448523B (en) | 2007-04-19 | 2009-06-17 | Transitive Ltd | Apparatus and method for handling exception signals in a computing system |
US8850574B1 (en) * | 2011-02-28 | 2014-09-30 | Google Inc. | Safe self-modifying code |
US8813227B2 (en) * | 2011-03-29 | 2014-08-19 | Mcafee, Inc. | System and method for below-operating system regulation and control of self-modifying code |
US8856789B2 (en) * | 2012-09-06 | 2014-10-07 | Assured Information Security, Inc. | Facilitating execution of a self-modifying executable |
JP2014052969A (ja) | 2012-09-10 | 2014-03-20 | Renesas Electronics Corp | クロック周波数制御装置、半導体装置 |
GB2518827A (en) | 2013-09-30 | 2015-04-08 | Ibm | Reading from a tape storage medium |
JP6103541B2 (ja) | 2014-03-18 | 2017-03-29 | インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation | バイナリコードの実行を制御する装置及び方法 |
-
2014
- 2014-03-18 JP JP2014055409A patent/JP6103541B2/ja active Active
-
2015
- 2015-02-27 US US14/634,018 patent/US9430205B2/en not_active Expired - Fee Related
- 2015-06-23 US US14/746,875 patent/US9626169B2/en not_active Expired - Fee Related
-
2016
- 2016-03-01 US US15/057,340 patent/US9760357B2/en not_active Expired - Fee Related
-
2017
- 2017-02-21 US US15/437,530 patent/US10241768B2/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001519955A (ja) * | 1997-08-11 | 2001-10-23 | トランスメタ・コーポレーション | 先進のプロセッサのための変換メモリ保護装置 |
US20100333090A1 (en) * | 2009-06-30 | 2010-12-30 | Sun Microsystems, Inc. | Method and apparatus for protecting translated code in a virtual machine |
JP2012198657A (ja) * | 2011-03-18 | 2012-10-18 | Fujitsu Ltd | 命令処理方法、命令処理装置、及び命令処理プログラム |
Non-Patent Citations (1)
Title |
---|
JPN6017001941; 中島康彦,外3名: '動的命令変換手法によるMアーキテクチャ・エミュレーション' 情報処理学会論文誌 第38巻,第11号, 19971115, Pages:2309〜2320, 社団法人情報処理学会 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7483950B2 (ja) | 2020-06-22 | 2024-05-15 | アップル インコーポレイテッド | バイナリ変換を実行するためのシステム及び方法 |
Also Published As
Publication number | Publication date |
---|---|
US20160179492A1 (en) | 2016-06-23 |
US20150293754A1 (en) | 2015-10-15 |
US9430205B2 (en) | 2016-08-30 |
US9760357B2 (en) | 2017-09-12 |
US20170161041A1 (en) | 2017-06-08 |
US20150268942A1 (en) | 2015-09-24 |
JP6103541B2 (ja) | 2017-03-29 |
US10241768B2 (en) | 2019-03-26 |
US9626169B2 (en) | 2017-04-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7757221B2 (en) | Apparatus and method for dynamic binary translator to support precise exceptions with minimal optimization constraints | |
CN1103079C (zh) | 用于高级微处理器的门控存储缓冲器 | |
US8495337B2 (en) | Translated memory protection | |
US5832205A (en) | Memory controller for a microprocessor for detecting a failure of speculation on the physical nature of a component being addressed | |
JP6006248B2 (ja) | 命令エミュレーションプロセッサ、方法、およびシステム | |
US7596781B2 (en) | Register-based instruction optimization for facilitating efficient emulation of an instruction stream | |
US8990786B2 (en) | Program optimizing apparatus, program optimizing method, and program optimizing article of manufacture | |
TWI733717B (zh) | 從亂序處理器中的不良儲存-至-負載轉發復原的方法與設備 | |
US8839218B2 (en) | Diagnosing alias violations in memory access commands in source code | |
WO2019236294A1 (en) | Storing incidental branch predictions to reduce latency of misprediction recovery | |
JP6103541B2 (ja) | バイナリコードの実行を制御する装置及び方法 | |
CN103942082A (zh) | 一种消除冗余的内存访问操作的编译优化方法 | |
JP3621116B2 (ja) | 先進のプロセッサのための変換メモリ保護装置 | |
JP2009134565A (ja) | 仮想計算機システム及び仮想計算機システムの制御方法 | |
US9383935B1 (en) | Secondary CPU MMU initialization using page fault exception | |
US10922180B2 (en) | Handling uncorrected memory errors inside a kernel text section through instruction block emulation | |
JP2001519954A (ja) | 一時的にターゲット・プロセッサの状態を保持する装置を備えたホスト・マイクロプロセッサ | |
US8352714B2 (en) | Executing watchpoint instruction in pipeline stages with temporary registers for storing intermediate values and halting processing before updating permanent registers | |
CN104166633B (zh) | 用于存储器访问保护的方法和系统 | |
US20100077145A1 (en) | Method and system for parallel execution of memory instructions in an in-order processor | |
JP6300512B2 (ja) | 判定装置、判定方法、及び、プログラム | |
JP2015115052A (ja) | マイクロプロセッサ、コンピュータ、異常対応方法、及び異常対策プログラム | |
JP2005284647A (ja) | 並列処理装置、命令再試行方法、およびプログラム | |
JP2005078131A (ja) | プログラム実行方法およびマイクロコントローラ |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160115 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20161227 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20170131 |
|
RD14 | Notification of resignation of power of sub attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7434 Effective date: 20170131 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170221 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6103541 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |