SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
National School of Computer Sciences

Translation cache policies for dynamic binary translation
Saber FERJANI
TIMA Laboratory - SLS Group

18 Avril 2013

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

1 / 25
Who I am ?
Academic & Professional Cursus
2010-2013 : Student at National School of Computer Sciences - Tunisia.
2011/2012 : Robotic team leader, participation to many competitions.
June-July 2011 : Intern at Alpha Technology, Design of many PCB layout
including QFP, SO, SMT and through hole components.
July-August 2012 : Intern at STMicroelectronics : Developing software for a
Hygrometer and an Altimeter, for STM32F3 microcontroller

http ://about.me/ferjani
Saber F. (TIMA SLS )

ENSI

18 Avril 2013

2 / 25
Context

Why ?
Hardware design is taking more and more time,
Software development should start earlier,
Instruction Set Simulators (ISS) handles the simulation of processors, named
target, on a machine with a different architecture, named host.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

3 / 25
Context

Why ?
Hardware design is taking more and more time,
Software development should start earlier,
Instruction Set Simulators (ISS) handles the simulation of processors, named
target, on a machine with a different architecture, named host.

How ?
Cross Compilation.
Interpretive translation.
Dynamic Binary Translation.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

3 / 25
Terminology

Simulator : just duplicate the behavior of the system.
Emulator : duplicate the inner workings of the system.
TB : Translated Bloc.
IR : Intermediate representation (also called op-code)

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

4 / 25
Outline

1

Introduction

2

Cache Algorithms

3

Qemu internals

4

Preliminary Results

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

5 / 25
I- Introduction

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

6 / 25
Qemu Overview
Generic and open source machine emulator and virtualizer,
Created by Fabrice Bellard in 2003,
uses portable dynamic translation,
Supported Targets : x86, arm, mips, sh4, cris, sparc, powerpc, nds32...

Qemu Features
Just-in-time (JIT) compilation support,
Self-modifying code support,
Direct block chaining.
Saber F. (TIMA SLS )

ENSI

18 Avril 2013

7 / 25
Subject

Problematic
Simulation speed is mainly affected by reuse of TB,
Current policy just flush the entire cache when it is full,
We need to enhance translation cache policy in order to maximize TB reuse.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

8 / 25
II- Cache Algorithms

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

9 / 25
Optimal cache algorithm
Evict entry that will not be used for the longest time.
Unfeasible in practice, since we cannot really know future !

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

10 / 25
Optimal cache algorithm
Evict entry that will not be used for the longest time.
Unfeasible in practice, since we cannot really know future !

First In First Out
Most simple cache replacement policy,
Entry remain in memory a constant duration.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

10 / 25
Optimal cache algorithm
Evict entry that will not be used for the longest time.
Unfeasible in practice, since we cannot really know future !

First In First Out
Most simple cache replacement policy,
Entry remain in memory a constant duration.

Least Recently Used
Enhancement to FIFO.
Each time an entry is referenced, it is moved to the end of the queue.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

10 / 25
Optimal cache algorithm
Evict entry that will not be used for the longest time.
Unfeasible in practice, since we cannot really know future !

First In First Out
Most simple cache replacement policy,
Entry remain in memory a constant duration.

Least Recently Used
Enhancement to FIFO.
Each time an entry is referenced, it is moved to the end of the queue.

Least Frequently Used
Exploit the overall popularity rather than temporal locality.
Least referenced entry is always chosen for eviction.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

10 / 25
III- Qemu internals

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

11 / 25
Dynamic Binary Translation in Qemu

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

12 / 25
Dynamic Binary Translation in Qemu

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

12 / 25
Dynamic Binary Translation in Qemu

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

12 / 25
Bloc chaining

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

13 / 25
Bloc chaining

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

13 / 25
lookup tb
by target pc

no Translate one
basic block

Cached ?
yes

execute tb

chain it
to existed
basic block

Exception
handling
Saber F. (TIMA SLS )

ENSI

18 Avril 2013

14 / 25
lookup tb
by target pc

no Translate one
basic block

Cached ?
yes

execute tb

chain it
to existed
basic block

Exception
handling
Saber F. (TIMA SLS )

ENSI

18 Avril 2013

15 / 25
Focus on (Translate one basic block)

try to allocate
space for tb

sucess ?

no

Flush entire
translation
cache

yes

allocate
space for tb
(cannot fail!)

generate op
& host code

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

16 / 25
Implementation constraints

Variable TB size
In basics cache algorithms, evicting one entry is always sufficient to bring an other,
but in our case, TB size is not only variable, but also unknown during allocation.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

17 / 25
Implementation constraints

Variable TB size
In basics cache algorithms, evicting one entry is always sufficient to bring an other,
but in our case, TB size is not only variable, but also unknown during allocation.

Self modifying code
When the executed code modify it self, the TB is re-translated into different
space. thus result in many memory allocation while only the last one is needed.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

17 / 25
Implementation constraints

Variable TB size
In basics cache algorithms, evicting one entry is always sufficient to bring an other,
but in our case, TB size is not only variable, but also unknown during allocation.

Self modifying code
When the executed code modify it self, the TB is re-translated into different
space. thus result in many memory allocation while only the last one is needed.

Low overhead
We need to predict if the the replacement cache overhead remain below the cost
of cache flush, otherwise, we should simply flush the entire cache.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

17 / 25
IV- Preliminary Results

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

18 / 25
Goals
Simulate LRU & LFU Algorithms,
Compare cache hit ratio,
Evaluate overhead of each algorithm.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

19 / 25
Goals
Simulate LRU & LFU Algorithms,
Compare cache hit ratio,
Evaluate overhead of each algorithm.

Assumptions
We ignore TB size & cache size,
Quota of retained entries is 1/5,
Cache size is just limited by number of TB,

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

19 / 25
Execution ratio = (executions/translation)

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

20 / 25
LFU cache hit ratio

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

21 / 25
LRU cache hit ratio

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

22 / 25
Perspectives

find a suitable cache replacement policy that take care of implementation
constraints.
use a dynamically variable quota for retained entries.
add small op-code buffer to optimize re-translation of self modifying code.
divide translation cache into multiple space to optimize partial cache flush.

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

23 / 25
Bibliography

QEMU Just-In-Time Code Generator and System Emulation - cmchao
(March 15,2010).
QEMU internals - Chad D. Kersey (January 28, 2009).
QEMU, a Fast and Portable Dynamic Translator - Fabrice Bellard (USENIX
2005 Annual).
Performance Evaluation of Traditional Caching Policies on A Large System
with Petabytes of Data - 2012 IEEE Seventh International Conference on
Networking, Architecture, and Storage

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

24 / 25
Thanks for your attention !

Feel free to ask any question !

Saber F. (TIMA SLS )

ENSI

18 Avril 2013

25 / 25

Contenu connexe

Similaire à Translation Cache Policies for Dynamic Binary Translation

Symmetrix local replication
Symmetrix local replicationSymmetrix local replication
Symmetrix local replicationSundeep Rao
 
Iaetsd march c algorithm for embedded memories in fpga
Iaetsd march c algorithm for embedded memories in fpgaIaetsd march c algorithm for embedded memories in fpga
Iaetsd march c algorithm for embedded memories in fpgaIaetsd Iaetsd
 
Boston meetup : MySQL Innodb Cluster - May 1st 2017
Boston meetup : MySQL Innodb Cluster - May 1st  2017Boston meetup : MySQL Innodb Cluster - May 1st  2017
Boston meetup : MySQL Innodb Cluster - May 1st 2017Frederic Descamps
 
Low memory footprint programs-iSeries
Low memory footprint programs-iSeriesLow memory footprint programs-iSeries
Low memory footprint programs-iSeriesPrithiviraj Damodaran
 
07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W mattersAlexandre Moneger
 
Firebird2.5 Benchmarks(English)20091031
Firebird2.5 Benchmarks(English)20091031Firebird2.5 Benchmarks(English)20091031
Firebird2.5 Benchmarks(English)20091031Tsutomu Hayashi
 
Jstorm introduction-0.9.6
Jstorm introduction-0.9.6Jstorm introduction-0.9.6
Jstorm introduction-0.9.6longda feng
 
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersDefcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersAlexandre Moneger
 
SymfonyCon 2019: Head first into Symfony Cache, Redis & Redis Cluster
SymfonyCon 2019:   Head first into Symfony Cache, Redis & Redis ClusterSymfonyCon 2019:   Head first into Symfony Cache, Redis & Redis Cluster
SymfonyCon 2019: Head first into Symfony Cache, Redis & Redis ClusterAndré Rømcke
 
Presto At Arm Treasure Data - 2019 Updates
Presto At Arm Treasure Data - 2019 UpdatesPresto At Arm Treasure Data - 2019 Updates
Presto At Arm Treasure Data - 2019 UpdatesTaro L. Saito
 
Embedded application designed by ATS language
Embedded application designed by ATS languageEmbedded application designed by ATS language
Embedded application designed by ATS languageKiwamu Okabe
 
microprocessor Lec 01 mic
microprocessor Lec 01 micmicroprocessor Lec 01 mic
microprocessor Lec 01 miciqbal ahmad
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterTim Ellison
 
Comparative Performance Analysis of AWS EC2 Instance Types Commonly Used for ...
Comparative Performance Analysis of AWS EC2 Instance Types Commonly Used for ...Comparative Performance Analysis of AWS EC2 Instance Types Commonly Used for ...
Comparative Performance Analysis of AWS EC2 Instance Types Commonly Used for ...DataWorks Summit
 
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud WorldPolicy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud WorldApcera
 
SFSCON23 - Chris Mair - Self-hosted, Open Source Large Language Models (LLMs)
SFSCON23 - Chris Mair - Self-hosted, Open Source Large Language Models (LLMs)SFSCON23 - Chris Mair - Self-hosted, Open Source Large Language Models (LLMs)
SFSCON23 - Chris Mair - Self-hosted, Open Source Large Language Models (LLMs)South Tyrol Free Software Conference
 
OSDC 2019 | Storage Wars – Using Ceph since Firefly by Achim Ledermüller
OSDC 2019 | Storage Wars – Using Ceph since Firefly by Achim LedermüllerOSDC 2019 | Storage Wars – Using Ceph since Firefly by Achim Ledermüller
OSDC 2019 | Storage Wars – Using Ceph since Firefly by Achim LedermüllerNETWAYS
 

Similaire à Translation Cache Policies for Dynamic Binary Translation (20)

Symmetrix local replication
Symmetrix local replicationSymmetrix local replication
Symmetrix local replication
 
Iaetsd march c algorithm for embedded memories in fpga
Iaetsd march c algorithm for embedded memories in fpgaIaetsd march c algorithm for embedded memories in fpga
Iaetsd march c algorithm for embedded memories in fpga
 
Boston meetup : MySQL Innodb Cluster - May 1st 2017
Boston meetup : MySQL Innodb Cluster - May 1st  2017Boston meetup : MySQL Innodb Cluster - May 1st  2017
Boston meetup : MySQL Innodb Cluster - May 1st 2017
 
Low memory footprint programs-iSeries
Low memory footprint programs-iSeriesLow memory footprint programs-iSeries
Low memory footprint programs-iSeries
 
07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters07 - Bypassing ASLR, or why X^W matters
07 - Bypassing ASLR, or why X^W matters
 
Firebird2.5 Benchmarks(English)20091031
Firebird2.5 Benchmarks(English)20091031Firebird2.5 Benchmarks(English)20091031
Firebird2.5 Benchmarks(English)20091031
 
Syntutic
SyntuticSyntutic
Syntutic
 
P.I.Z.Z.A.: Rationale Behind FPGA
P.I.Z.Z.A.: Rationale Behind FPGAP.I.Z.Z.A.: Rationale Behind FPGA
P.I.Z.Z.A.: Rationale Behind FPGA
 
Jstorm introduction-0.9.6
Jstorm introduction-0.9.6Jstorm introduction-0.9.6
Jstorm introduction-0.9.6
 
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbersDefcon 22 - Stitching numbers - generating rop payloads from in memory numbers
Defcon 22 - Stitching numbers - generating rop payloads from in memory numbers
 
SymfonyCon 2019: Head first into Symfony Cache, Redis & Redis Cluster
SymfonyCon 2019:   Head first into Symfony Cache, Redis & Redis ClusterSymfonyCon 2019:   Head first into Symfony Cache, Redis & Redis Cluster
SymfonyCon 2019: Head first into Symfony Cache, Redis & Redis Cluster
 
Presto At Arm Treasure Data - 2019 Updates
Presto At Arm Treasure Data - 2019 UpdatesPresto At Arm Treasure Data - 2019 Updates
Presto At Arm Treasure Data - 2019 Updates
 
Embedded application designed by ATS language
Embedded application designed by ATS languageEmbedded application designed by ATS language
Embedded application designed by ATS language
 
microprocessor Lec 01 mic
microprocessor Lec 01 micmicroprocessor Lec 01 mic
microprocessor Lec 01 mic
 
Prefixing Education
Prefixing EducationPrefixing Education
Prefixing Education
 
Five cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark fasterFive cool ways the JVM can run Apache Spark faster
Five cool ways the JVM can run Apache Spark faster
 
Comparative Performance Analysis of AWS EC2 Instance Types Commonly Used for ...
Comparative Performance Analysis of AWS EC2 Instance Types Commonly Used for ...Comparative Performance Analysis of AWS EC2 Instance Types Commonly Used for ...
Comparative Performance Analysis of AWS EC2 Instance Types Commonly Used for ...
 
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud WorldPolicy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
Policy-based Cloud Storage: Persisting Data in a Multi-Site, Multi-Cloud World
 
SFSCON23 - Chris Mair - Self-hosted, Open Source Large Language Models (LLMs)
SFSCON23 - Chris Mair - Self-hosted, Open Source Large Language Models (LLMs)SFSCON23 - Chris Mair - Self-hosted, Open Source Large Language Models (LLMs)
SFSCON23 - Chris Mair - Self-hosted, Open Source Large Language Models (LLMs)
 
OSDC 2019 | Storage Wars – Using Ceph since Firefly by Achim Ledermüller
OSDC 2019 | Storage Wars – Using Ceph since Firefly by Achim LedermüllerOSDC 2019 | Storage Wars – Using Ceph since Firefly by Achim Ledermüller
OSDC 2019 | Storage Wars – Using Ceph since Firefly by Achim Ledermüller
 

Plus de Saber Ferjani

Localization as a service in an Intelligent Transport System
Localization as a service in an Intelligent Transport SystemLocalization as a service in an Intelligent Transport System
Localization as a service in an Intelligent Transport SystemSaber Ferjani
 
Translation Cache Policies for Dynamic Binary Translation
Translation Cache Policies for Dynamic Binary TranslationTranslation Cache Policies for Dynamic Binary Translation
Translation Cache Policies for Dynamic Binary TranslationSaber Ferjani
 
Management de la qualité
Management de la qualitéManagement de la qualité
Management de la qualitéSaber Ferjani
 
La sécurité informatique
La sécurité informatiqueLa sécurité informatique
La sécurité informatiqueSaber Ferjani
 

Plus de Saber Ferjani (8)

Saber Ferjani
Saber FerjaniSaber Ferjani
Saber Ferjani
 
Localization as a service in an Intelligent Transport System
Localization as a service in an Intelligent Transport SystemLocalization as a service in an Intelligent Transport System
Localization as a service in an Intelligent Transport System
 
Translation Cache Policies for Dynamic Binary Translation
Translation Cache Policies for Dynamic Binary TranslationTranslation Cache Policies for Dynamic Binary Translation
Translation Cache Policies for Dynamic Binary Translation
 
Wireless Meter Bus
Wireless Meter BusWireless Meter Bus
Wireless Meter Bus
 
Future Internet
Future InternetFuture Internet
Future Internet
 
Management de la qualité
Management de la qualitéManagement de la qualité
Management de la qualité
 
SystemC
SystemCSystemC
SystemC
 
La sécurité informatique
La sécurité informatiqueLa sécurité informatique
La sécurité informatique
 

Dernier

EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxElton John Embodo
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 

Dernier (20)

EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docx
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 

Translation Cache Policies for Dynamic Binary Translation

  • 1. National School of Computer Sciences Translation cache policies for dynamic binary translation Saber FERJANI TIMA Laboratory - SLS Group 18 Avril 2013 Saber F. (TIMA SLS ) ENSI 18 Avril 2013 1 / 25
  • 2. Who I am ? Academic & Professional Cursus 2010-2013 : Student at National School of Computer Sciences - Tunisia. 2011/2012 : Robotic team leader, participation to many competitions. June-July 2011 : Intern at Alpha Technology, Design of many PCB layout including QFP, SO, SMT and through hole components. July-August 2012 : Intern at STMicroelectronics : Developing software for a Hygrometer and an Altimeter, for STM32F3 microcontroller http ://about.me/ferjani Saber F. (TIMA SLS ) ENSI 18 Avril 2013 2 / 25
  • 3. Context Why ? Hardware design is taking more and more time, Software development should start earlier, Instruction Set Simulators (ISS) handles the simulation of processors, named target, on a machine with a different architecture, named host. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 3 / 25
  • 4. Context Why ? Hardware design is taking more and more time, Software development should start earlier, Instruction Set Simulators (ISS) handles the simulation of processors, named target, on a machine with a different architecture, named host. How ? Cross Compilation. Interpretive translation. Dynamic Binary Translation. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 3 / 25
  • 5. Terminology Simulator : just duplicate the behavior of the system. Emulator : duplicate the inner workings of the system. TB : Translated Bloc. IR : Intermediate representation (also called op-code) Saber F. (TIMA SLS ) ENSI 18 Avril 2013 4 / 25
  • 6. Outline 1 Introduction 2 Cache Algorithms 3 Qemu internals 4 Preliminary Results Saber F. (TIMA SLS ) ENSI 18 Avril 2013 5 / 25
  • 7. I- Introduction Saber F. (TIMA SLS ) ENSI 18 Avril 2013 6 / 25
  • 8. Qemu Overview Generic and open source machine emulator and virtualizer, Created by Fabrice Bellard in 2003, uses portable dynamic translation, Supported Targets : x86, arm, mips, sh4, cris, sparc, powerpc, nds32... Qemu Features Just-in-time (JIT) compilation support, Self-modifying code support, Direct block chaining. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 7 / 25
  • 9. Subject Problematic Simulation speed is mainly affected by reuse of TB, Current policy just flush the entire cache when it is full, We need to enhance translation cache policy in order to maximize TB reuse. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 8 / 25
  • 10. II- Cache Algorithms Saber F. (TIMA SLS ) ENSI 18 Avril 2013 9 / 25
  • 11. Optimal cache algorithm Evict entry that will not be used for the longest time. Unfeasible in practice, since we cannot really know future ! Saber F. (TIMA SLS ) ENSI 18 Avril 2013 10 / 25
  • 12. Optimal cache algorithm Evict entry that will not be used for the longest time. Unfeasible in practice, since we cannot really know future ! First In First Out Most simple cache replacement policy, Entry remain in memory a constant duration. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 10 / 25
  • 13. Optimal cache algorithm Evict entry that will not be used for the longest time. Unfeasible in practice, since we cannot really know future ! First In First Out Most simple cache replacement policy, Entry remain in memory a constant duration. Least Recently Used Enhancement to FIFO. Each time an entry is referenced, it is moved to the end of the queue. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 10 / 25
  • 14. Optimal cache algorithm Evict entry that will not be used for the longest time. Unfeasible in practice, since we cannot really know future ! First In First Out Most simple cache replacement policy, Entry remain in memory a constant duration. Least Recently Used Enhancement to FIFO. Each time an entry is referenced, it is moved to the end of the queue. Least Frequently Used Exploit the overall popularity rather than temporal locality. Least referenced entry is always chosen for eviction. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 10 / 25
  • 15. III- Qemu internals Saber F. (TIMA SLS ) ENSI 18 Avril 2013 11 / 25
  • 16. Dynamic Binary Translation in Qemu Saber F. (TIMA SLS ) ENSI 18 Avril 2013 12 / 25
  • 17. Dynamic Binary Translation in Qemu Saber F. (TIMA SLS ) ENSI 18 Avril 2013 12 / 25
  • 18. Dynamic Binary Translation in Qemu Saber F. (TIMA SLS ) ENSI 18 Avril 2013 12 / 25
  • 19. Bloc chaining Saber F. (TIMA SLS ) ENSI 18 Avril 2013 13 / 25
  • 20. Bloc chaining Saber F. (TIMA SLS ) ENSI 18 Avril 2013 13 / 25
  • 21. lookup tb by target pc no Translate one basic block Cached ? yes execute tb chain it to existed basic block Exception handling Saber F. (TIMA SLS ) ENSI 18 Avril 2013 14 / 25
  • 22. lookup tb by target pc no Translate one basic block Cached ? yes execute tb chain it to existed basic block Exception handling Saber F. (TIMA SLS ) ENSI 18 Avril 2013 15 / 25
  • 23. Focus on (Translate one basic block) try to allocate space for tb sucess ? no Flush entire translation cache yes allocate space for tb (cannot fail!) generate op & host code Saber F. (TIMA SLS ) ENSI 18 Avril 2013 16 / 25
  • 24. Implementation constraints Variable TB size In basics cache algorithms, evicting one entry is always sufficient to bring an other, but in our case, TB size is not only variable, but also unknown during allocation. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 17 / 25
  • 25. Implementation constraints Variable TB size In basics cache algorithms, evicting one entry is always sufficient to bring an other, but in our case, TB size is not only variable, but also unknown during allocation. Self modifying code When the executed code modify it self, the TB is re-translated into different space. thus result in many memory allocation while only the last one is needed. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 17 / 25
  • 26. Implementation constraints Variable TB size In basics cache algorithms, evicting one entry is always sufficient to bring an other, but in our case, TB size is not only variable, but also unknown during allocation. Self modifying code When the executed code modify it self, the TB is re-translated into different space. thus result in many memory allocation while only the last one is needed. Low overhead We need to predict if the the replacement cache overhead remain below the cost of cache flush, otherwise, we should simply flush the entire cache. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 17 / 25
  • 27. IV- Preliminary Results Saber F. (TIMA SLS ) ENSI 18 Avril 2013 18 / 25
  • 28. Goals Simulate LRU & LFU Algorithms, Compare cache hit ratio, Evaluate overhead of each algorithm. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 19 / 25
  • 29. Goals Simulate LRU & LFU Algorithms, Compare cache hit ratio, Evaluate overhead of each algorithm. Assumptions We ignore TB size & cache size, Quota of retained entries is 1/5, Cache size is just limited by number of TB, Saber F. (TIMA SLS ) ENSI 18 Avril 2013 19 / 25
  • 30. Execution ratio = (executions/translation) Saber F. (TIMA SLS ) ENSI 18 Avril 2013 20 / 25
  • 31. LFU cache hit ratio Saber F. (TIMA SLS ) ENSI 18 Avril 2013 21 / 25
  • 32. LRU cache hit ratio Saber F. (TIMA SLS ) ENSI 18 Avril 2013 22 / 25
  • 33. Perspectives find a suitable cache replacement policy that take care of implementation constraints. use a dynamically variable quota for retained entries. add small op-code buffer to optimize re-translation of self modifying code. divide translation cache into multiple space to optimize partial cache flush. Saber F. (TIMA SLS ) ENSI 18 Avril 2013 23 / 25
  • 34. Bibliography QEMU Just-In-Time Code Generator and System Emulation - cmchao (March 15,2010). QEMU internals - Chad D. Kersey (January 28, 2009). QEMU, a Fast and Portable Dynamic Translator - Fabrice Bellard (USENIX 2005 Annual). Performance Evaluation of Traditional Caching Policies on A Large System with Petabytes of Data - 2012 IEEE Seventh International Conference on Networking, Architecture, and Storage Saber F. (TIMA SLS ) ENSI 18 Avril 2013 24 / 25
  • 35. Thanks for your attention ! Feel free to ask any question ! Saber F. (TIMA SLS ) ENSI 18 Avril 2013 25 / 25