ISA Semantics for ARMv8-A, RISC-V, and CHERI-MIPS

被引:67
作者
Armstrong, Alasdair [1 ]
Bauereiss, Thomas [1 ]
Campbell, Brian [2 ]
Reid, Alastair [3 ]
Gray, Kathryn E. [1 ]
Norton, Robert M. [1 ]
Mundkur, Prashanth [4 ]
Wassell, Mark [1 ]
French, Jon [1 ]
Pulte, Christopher [1 ]
Flur, Shaked [1 ]
Stark, Ian [2 ]
Krishnaswami, Neel [1 ]
Sewell, Peter [1 ]
机构
[1] Univ Cambridge, Cambridge, England
[2] Univ Edinburgh, Edinburgh, Midlothian, Scotland
[3] ARM Ltd, Cambridge, England
[4] SRI Int, 333 Ravenswood Ave, Menlo Pk, CA 94025 USA
来源
PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL | 2019年 / 3卷 / POPL期
基金
欧洲研究理事会; 英国工程与自然科学研究理事会;
关键词
Instruction Set Architectures; Semantics; Theorem Proving;
D O I
10.1145/3290384
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Architecture specifications notionally define the fundamental interface between hardware and software: the envelope of allowed behaviour for processor implementations, and the basic assumptions for software development and verification. But in practice, they are typically prose and pseudocode documents, not rigorous or executable artifacts, leaving software and verification on shaky ground. In this paper, we present rigorous semantic models for the sequential behaviour of large parts of the mainstream ARMv8-A, RISC-V, and MIPS architectures, and the research CHERI-MIPS architecture, that are complete enough to boot operating systems, variously Linux, FreeBSD, or seL4. Our ARMv8-A models are automatically translated from authoritative ARM-internal definitions, and (in one variant) tested against the ARM Architecture Validation Suite. We do this using a custom language for ISA semantics, Sail, with a lightweight dependent type system, that supports automatic generation of emulator code in C and OCaml, and automatic generation of proof-assistant definitions for Isabelle, HOL4, and (currently only for MIPS) Coq. We use the former for validation, and to assess specification coverage. To demonstrate the usability of the latter, we prove (in Isabelle) correctness of a purely functional characterisation of ARMv8-A address translation. We moreover integrate the RISC-V model into the RMEM tool for (user-mode) relaxed-memory concurrency exploration. We prove (on paper) the soundness of the core Sail type system. We thereby take a big step towards making the architectural abstraction actually well-defined, establishing foundations for verification and reasoning.
引用
收藏
页数:31
相关论文
共 63 条
[1]   Herding Cats: Modelling, Simulation, Testing, and Data Mining for Weak Memory [J].
Alglave, Jade ;
Maranget, Luc ;
Tautschnig, Michael .
ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS, 2014, 36 (02)
[2]   Fences in Weak Memory Models [J].
Alglave, Jade ;
Maranget, Luc ;
Sarkar, Susmit ;
Sewell, Peter .
COMPUTER AIDED VERIFICATION, PROCEEDINGS, 2010, 6174 :258-+
[3]   Certified Complexity (CerCo) [J].
Amadio, Roberto M. ;
Ayache, Nicolas ;
Bobot, Francois ;
Boender, Jaap P. ;
Campbell, Brian ;
Garnier, Ilias ;
Madet, Antoine ;
McKinna, James ;
Mulligan, Dominic P. ;
Piccolo, Mauro ;
Pollack, Randy ;
Regis-Gianas, Yann ;
Coen, Claudio Sacerdoti ;
Stark, Ian ;
Tranquilli, Paolo .
FOUNDATIONAL AND PRACTICAL ASPECTS OF RESOURCE ANALYSIS, FOPARA 2013, 2014, 8552 :1-18
[4]  
[Anonymous], 2017
[5]  
[Anonymous], 2017, THE GEM5 SIMULATOR
[6]  
[Anonymous], 2017, RISC V INSTRUCTION S
[7]  
[Anonymous], 2017, Arm architecture reference manual
[8]  
Appel Andrew W., 2017, VERIFIED SOFTWARE TO
[9]  
Baumann C, 2016, 2016 EUROPEAN CONFERENCE ON NETWORKS AND COMMUNICATIONS (EUCNC), P210, DOI 10.1109/EuCNC.2016.7561034
[10]   Boomerang: Resourceful Lenses for String Data [J].
Bohannon, Aaron ;
Foster, J. Nathan ;
Pierce, Benjamin C. ;
Pilkiewicz, Alexandre ;
Schmitt, Alan .
POPL'08: PROCEEDINGS OF THE 35TH ANNUAL ACM SIGPLAN-SIGACT SYMPOSIUM ON PRINCIPLES OF PROGRAMMING LANGUAGES, 2008, :407-419