Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Verified just-in-time compiler on x86

Published: 17 January 2010 Publication History

Abstract

This paper presents a method for creating formally correct just-in-time (JIT) compilers. The tractability of our approach is demonstrated through, what we believe is the first, verification of a JIT compiler with respect to a realistic semantics of self-modifying x86 machine code. Our semantics includes a model of the instruction cache. Two versions of the verified JIT compiler are presented: one generates all of the machine code at once, the other one is incremental i.e. produces code on-demand. All proofs have been performed inside the HOL4 theorem prover.

References

[1]
HOL4 proof scripts, verified x86 code and other supporting material: http://www.cl.cam.ac.uk/~mom22/jit/.
[2]
Andrew W. Appel. Foundational proof-carrying code. In Logic in Computer Science (LICS). IEEE, 2001.
[3]
John Aycock. A brief history of just-in-time. ACM Computing Surveys, 35:97--113, 2003.
[4]
R. S. Boyer and J S. Moore. Proving theorems about pure LISP functions. JACM, 22(1):129--144, 1975.
[5]
Robert S. Boyer and Yuan Yu. Automated proofs of object code for a widely used microprocessor. J. ACM, 43(1):166--192, 1996.
[6]
Hongxu Cai, Zhong Shao, and Alexander Vaynberg. Certified selfmodifying code. In Jeanne Ferrante and Kathryn S. McKinley, editors, Programming Language Design and Implementation (PLDI), pages 66--77. ACM, 2007.
[7]
Maulik A. Dave. Compiler verification: a bibliography. SIGSOFT Softw. Eng. Notes, 28(6):2--2, 2003.
[8]
R. Gerth. Formal verification of self modifying code. In Int. Conf. for Young Computer Scientists, pages 305--313. International Academic Publishers, China, 1991.
[9]
Michael J. C. Gordon. Mechanizing programming logics in higher order logic. In Current Trends in Hardware Verification and Automated Theorem Proving. Springer, 1989.
[10]
David S. Hardin, Eric W. Smith, and William D. Young. A robust machine code proof framework for highly secure applications. In Panagiotis Manolios and Matthew Wilding, editors, Proceedings of the Sixth International Workshop on the ACL2 Theorem Prover and Its Applications, 2006.
[11]
C. A. R. Hoare. An axiomatic basis for computer programming. Communications of the ACM, 12(10):576--580, 1969.
[12]
Intel. Intel 64 and IA-32 Architectures Software Developers Manual. Intel Corporation, March 2009.
[13]
Xavier Leroy. Formal certification of a compiler back-end, or: programming a compiler with a proof assistant. In Principles of Programming Languages (POPL), pages 42--54. ACM Press, 2006.
[14]
John Matthews, J. Strother Moore, Sandip Ray, and Daron Vroon. Verification condition generation via theorem proving. In Logic Programming and Automated Reasoning (LPAR), volume 4246 of LNCS, pages 362--376. Springer, 2006.
[15]
John McCarthy. Recursive functions of symbolic expressions and their computation by machine, part I. Communications of the ACM, 1960.
[16]
Andrew McCreight, Zhong Shao, Chunxiao Lin, and Long Li. A general framework for certifying garbage collectors and their mutators. In Jeanne Ferrante and Kathryn S. McKinley, editors, Proceedings of the Conference on Programming Language Design and Implementation (PLDI), pages 468--479. ACM, 2007.
[17]
J Strother Moore. Symbolic simulation: An ACL2 approach. In Ganesh Gopalakrishnan and Phillip J. Windley, editors, Formal Methods in Computer-Aided Design (FMCAD), pages 334--350, 1998.
[18]
J. Gregory Morrisett, DavidWalker, Karl Crary, and Neal Glew. From System F to typed assembly language. In Principles of Programming Languages (POPL), pages 85--97. ACM Press, 1998.
[19]
Magnus O. Myreen. Formal verification of machine-code programs. PhD thesis, University of Cambridge, 2009.
[20]
Magnus O. Myreen and Michael J.C. Gordon. Verified LISP implementations on ARM, x86 and PowerPC. In Stefan Berghofer, Tobias Nipkow, Christian Urban, and MakariusWenzel, editors, Theorem Proving in Higher Order Logics (TPHOLs), LNCS. Springer, 2009.
[21]
Magnus O. Myreen, Konrad Slind, and Michael J. C. Gordon. Machine-code verification for multiple architectures -- An application of decompilation into logic. In Alessandro Cimatti and Robert B. Jones, editors, Formal Methods in Computer Aided Design (FMCAD). IEEE, 2008.
[22]
Magnus O. Myreen, Konrad Slind, and Michael J.C. Gordon. Extensible proof-producing compilation. In Michael I. Schwartzbach Oege de Moor, editor, Compiler Construction (CC), LNCS. Springer, 2009.
[23]
George C. Necula. Proof-carrying code. In Principles of Programming Languages (POPL), pages 106--119. ACM, 1997.
[24]
John Reynolds. Separation logic: A logic for shared mutable data structures. In Proceedings of Logic in Computer Science (LICS). IEEE Computer Society, 2002.
[25]
Susmit Sarkar, Pater Sewell, Francesco Zappa Nardelli, Scott Owens, Tom Ridge, Thomas Braibant Magnus O. Myreen, and Jade Alglave. The semantics of x86-CC multiprocessor machine code. In Principles of Programming Languages (POPL). ACM, 2009.
[26]
Konrad Slind and Michael Norrish. A brief overview of HOL4. In Otmane Aït Mohamed, César Muñoz, and Sofiène Tahar, editors, Theorem Proving in Higher Order Logics (TPHOLs), LNCS, pages 28--32. Springer, 2008.
[27]
Gang Tan and Andrew W. Appel. A compositional logic for control flow. In E. Allen Emerson and Kedar S. Namjoshi, editors, Proceedings of Verification, Model Checking and Abstract Interpretation (VMCAI), LNCS. Springer, 2006.
[28]
Paul Tyma. Why are we using Java again? Commun. ACM, 41(6):38--42, 1998.
[29]
Dachuan Yu, Nadeem A. Hamid, and Zhong Shao. Building certified libraries for PCC: Dynamic storage allocation. Science of Computer Programming, 50(1-3):101--127, 2004.

Cited By

View all
  • (2024)End-to-End Mechanized Proof of a JIT-Accelerated eBPF Virtual Machine for IoTComputer Aided Verification10.1007/978-3-031-65627-9_16(325-347)Online publication date: 26-Jul-2024
  • (2022)End-to-End Mechanized Proof of an eBPF Virtual Machine for Micro-controllersComputer Aided Verification10.1007/978-3-031-13188-2_15(293-316)Online publication date: 6-Aug-2022
  • (2019)Establishing a refinement relation between binaries and abstract codeProceedings of the 17th ACM-IEEE International Conference on Formal Methods and Models for System Design10.1145/3359986.3361215(1-5)Online publication date: 9-Oct-2019
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 45, Issue 1
POPL '10
January 2010
500 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1707801
Issue’s Table of Contents
  • cover image ACM Conferences
    POPL '10: Proceedings of the 37th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
    January 2010
    520 pages
    ISBN:9781605584799
    DOI:10.1145/1706299
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 17 January 2010
Published in SIGPLAN Volume 45, Issue 1

Check for updates

Author Tags

  1. compiler verification
  2. just in time
  3. self-modifying code

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)27
  • Downloads (Last 6 weeks)1
Reflects downloads up to 28 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2024)End-to-End Mechanized Proof of a JIT-Accelerated eBPF Virtual Machine for IoTComputer Aided Verification10.1007/978-3-031-65627-9_16(325-347)Online publication date: 26-Jul-2024
  • (2022)End-to-End Mechanized Proof of an eBPF Virtual Machine for Micro-controllersComputer Aided Verification10.1007/978-3-031-13188-2_15(293-316)Online publication date: 6-Aug-2022
  • (2019)Establishing a refinement relation between binaries and abstract codeProceedings of the 17th ACM-IEEE International Conference on Formal Methods and Models for System Design10.1145/3359986.3361215(1-5)Online publication date: 9-Oct-2019
  • (2019)Formal Approaches to Secure CompilationACM Computing Surveys10.1145/328098451:6(1-36)Online publication date: 4-Feb-2019
  • (2014)Verified Abstract Interpretation Techniques for Disassembling Low-level Self-modifying CodeInteractive Theorem Proving10.1007/978-3-319-08970-6_9(128-143)Online publication date: 2014
  • (2012)Efficient and Trustworthy Tool Qualification for Model-Based Testing ToolsTesting Software and Systems10.1007/978-3-642-34691-0_3(8-23)Online publication date: 2012
  • (2010)Unconditional self-modifying code elimination with dynamic compiler optimizations2010 5th International Conference on Malicious and Unwanted Software10.1109/MALWARE.2010.5665795(47-54)Online publication date: Oct-2010
  • (2023)Formally Verified Native Code Generation in an Effectful JIT: Turning the CompCert Backend into a Formally Verified JIT CompilerProceedings of the ACM on Programming Languages10.1145/35712027:POPL(249-277)Online publication date: 11-Jan-2023
  • (2022)Compiler Testing using Template Java ProgramsProceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering10.1145/3551349.3556958(1-13)Online publication date: 10-Oct-2022
  • (2022)Just-In-Time Compilation on ARM—A Closer Look at Call-Site Code ConsistencyACM Transactions on Architecture and Code Optimization10.1145/354656819:4(1-23)Online publication date: 16-Sep-2022
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media