Formal Modelling and Verification of Spinlocks at Instruction Level

Leping Zhang, Qianying Zhang, Guohui Wang, Zhiping Shi, Minhua Wu, Yong Guan
{"title":"Formal Modelling and Verification of Spinlocks at Instruction Level","authors":"Leping Zhang, Qianying Zhang, Guohui Wang, Zhiping Shi, Minhua Wu, Yong Guan","doi":"10.1109/APSEC48747.2019.00055","DOIUrl":null,"url":null,"abstract":"Spinlocks have been widely used as a solution for synchronous accesses to shared resources, and their correctness is critical to guarantee the consistency of concurrent processes. This paper presents formal models and machine-checked verification of the correctness of spinlocks at instruction level. We present the formal verification of two spinlocks, which are spinlocks implemented based on the ARM instructions and the x86 instructions, respectively. Our model formalizes the lowlevel instructions that are necessary to capture the execution of spinlocks, characterizes the processor hardware mechanisms related to each instruction, and considers the context switches on processors and two-level scheduling of processors and processes. We specify the correctness property of our models, that is, accesses of a critical section satisfy mutual exclusion, and verify that the models satisfy the property using the theorem prover Isabelle/HOL. With the verification experience, we give some suggestions on how to implement spinlock leveraging the ARM ISA.","PeriodicalId":325642,"journal":{"name":"2019 26th Asia-Pacific Software Engineering Conference (APSEC)","volume":"22 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2019 26th Asia-Pacific Software Engineering Conference (APSEC)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/APSEC48747.2019.00055","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

Spinlocks have been widely used as a solution for synchronous accesses to shared resources, and their correctness is critical to guarantee the consistency of concurrent processes. This paper presents formal models and machine-checked verification of the correctness of spinlocks at instruction level. We present the formal verification of two spinlocks, which are spinlocks implemented based on the ARM instructions and the x86 instructions, respectively. Our model formalizes the lowlevel instructions that are necessary to capture the execution of spinlocks, characterizes the processor hardware mechanisms related to each instruction, and considers the context switches on processors and two-level scheduling of processors and processes. We specify the correctness property of our models, that is, accesses of a critical section satisfy mutual exclusion, and verify that the models satisfy the property using the theorem prover Isabelle/HOL. With the verification experience, we give some suggestions on how to implement spinlock leveraging the ARM ISA.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
指令级自旋锁的形式化建模与验证
自旋锁已被广泛用作对共享资源的同步访问的解决方案,其正确性对于保证并发进程的一致性至关重要。本文给出了自旋锁在指令级正确性的形式化模型和机器检查验证。本文给出了两种自旋锁的形式化验证,这两种自旋锁分别是基于ARM指令和x86指令实现的。我们的模型形式化了捕获自旋锁执行所必需的低级指令,描述了与每个指令相关的处理器硬件机制,并考虑了处理器上的上下文切换以及处理器和进程的两级调度。我们指定了模型的正确性,即临界段的访问满足互斥性,并利用定理证明者Isabelle/HOL验证了模型满足这一性质。结合验证经验,给出了如何利用ARM ISA实现自旋锁的一些建议。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Detecting Duplicate Questions in Stack Overflow via Deep Learning Approaches An Algebraic Approach to Modeling and Verifying Policy-Driven Smart Devices in IoT Systems Integrating Static Program Analysis Tools for Verifying Cautions of Microcontroller How Compact Will My System Be? A Fully-Automated Way to Calculate LoC Reduced by Clone Refactoring Neural Comment Generation for Source Code with Auxiliary Code Classification Task
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1