Skip to main content

Modular Verification of SPARCv8 Code

  • Conference paper
  • First Online:
Programming Languages and Systems (APLAS 2018)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 11275))

Included in the following conference series:

Abstract

Inline assembly code is common in system software to interact with the underlying hardware platforms. Safety and correctness of the assembly code is crucial to guarantee the safety of the whole system. In this paper we propose a practical Hoare-style program logic for verifying SPARC assembly code. The logic supports modular reasoning about the main features of SPARCv8 ISA, including delayed control transfers, delayed writes to special registers, and register windows. We have applied it to verify the main body of a context switch routine in a realistic embedded OS kernel. All of the formalization and proofs have been mechanized in Coq.

This work is supported in part by grants from National Natural Science Foundation of China (NSFC) under Grant Nos. 61632005, 61502442 and 61502031.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Program logic for SPARCv8 implementation in Coq (project code). https://github.com/jpzha/VeriSparc

  2. SPARC. https://gaisler.com/doc/sparcv8.pdf

  3. Appel, A.W.: Foundational proof-carrying code. In: Proceedings of 16th Annual IEEE Symposium on Logic in Computer Science, pp. 85–97, January 1998

    Google Scholar 

  4. Berdine, J., Calcagno, C., O’Hearn, P.W.: Smallfoot: modular automatic assertion checking with separation logic. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2005. LNCS, vol. 4111, pp. 115–137. Springer, Heidelberg (2006). https://doi.org/10.1007/11804192_6

    Chapter  Google Scholar 

  5. Berdine, J., Calcagno, C., O’Hearn, P.W.: Symbolic execution with separation logic. In: Yi, K. (ed.) APLAS 2005. LNCS, vol. 3780, pp. 52–68. Springer, Heidelberg (2005). https://doi.org/10.1007/11575467_5

    Chapter  Google Scholar 

  6. Feng, X., Ni, Z., Shao, Z., Guo, Y.: An open framework for foundational proof-carrying code. In: TLDI, pp. 67–78 (2007)

    Google Scholar 

  7. Feng, X., Shao, Z., Vaynberg, A., Xiang, S., Ni, Z.: Modular verification of assembly code with stack-based control abstractions. In: PLDI, June 2006

    Google Scholar 

  8. Gu, R., et al.: Deep specifications and certified abstraction layers. In: POPL, pp. 595–608, January 2015

    Article  Google Scholar 

  9. Klein, G., et al.: seL4: formal verification of an OS kernel. In: SOSP, pp. 207–220, October 2009

    Google Scholar 

  10. Morrisett, G.: TALx86: a realistic typed assembly language. In: 1999 ACM SIGPLAN Workshop on Compiler Support for System Software, pp. 25–35, May 1996

    Google Scholar 

  11. Morrisett, G., Walker, D., Crary, K., Glew, N.: From system F to typed assembly language. In: POPL, pp. 85–97, January 1998

    Google Scholar 

  12. Myreen, M.O., Gordon, M.J.C.: Hoare logic for realistically modelled machine code. In: Grumberg, O., Huth, M. (eds.) TACAS 2007. LNCS, vol. 4424, pp. 568–582. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-71209-1_44

    Chapter  MATH  Google Scholar 

  13. Necula, G.C., Lee, P.: Safe kernel extensions without run-time checking. In: Proceedings of 2nd USENIX Symposium on Operating System Design and Implementation, pp. 229–243 (1996)

    Google Scholar 

  14. Ni, Z., Shao, Z.: Certified assembly programming with embedded code pointers. In: POPL, pp. 320–333 (2006)

    Article  Google Scholar 

  15. Ni, Z., Yu, D., Shao, Z.: Using XCAP to certify realistic systems code: machine context management. In: Schneider, K., Brandt, J. (eds.) TPHOLs 2007. LNCS, vol. 4732, pp. 189–206. Springer, Heidelberg (2007). https://doi.org/10.1007/978-3-540-74591-4_15

    Chapter  Google Scholar 

  16. Tan, G., Appel, A.W.: A compositional logic for control flow. In: Emerson, E.A., Namjoshi, K.S. (eds.) VMCAI 2006. LNCS, vol. 3855, pp. 80–94. Springer, Heidelberg (2005). https://doi.org/10.1007/11609773_6

    Chapter  Google Scholar 

  17. Wang, J., Fu, M., Qiao, L., Feng, X.: Formalizing SPARCv8 instruction set architecture in Coq. In: Larsen, K.G., Sokolsky, O., Wang, J. (eds.) SETTA 2017. LNCS, vol. 10606, pp. 300–316. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-69483-2_18

    Chapter  Google Scholar 

  18. Xu, F., Fu, M., Feng, X., Zhang, X., Zhang, H., Li, Z.: A practical verification framework for preemptive OS kernels. In: Chaudhuri, S., Farzan, A. (eds.) CAV 2016. LNCS, vol. 9780, pp. 59–79. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-41540-6_4

    Chapter  Google Scholar 

  19. Yang, J., Hawblitzel, C.: Safe to the last instruction: automated verification of a type-safe operating system. In: PLDI, pp. 99–110 (2010)

    Google Scholar 

  20. Yu, D., Nadeem, A.H., Shao, Z.: Building certified libraries for PCC: dynamic storage allocation. Sci. Comput. Program. 50(1–3), 101–127 (2004)

    Article  MathSciNet  Google Scholar 

  21. Hou, Z., Sanan, D., Tiu, A., Liu, Y., Hoa, K.C.: An executable formalisation of the SPARCv8 instruction set architecture: a case study for the LEON3 processor. In: Fitzgerald, J., Heitmeyer, C., Gnesi, S., Philippou, A. (eds.) FM 2016. LNCS, vol. 9995, pp. 388–405. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-48989-6_24

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Xinyu Feng .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zha, J., Feng, X., Qiao, L. (2018). Modular Verification of SPARCv8 Code. In: Ryu, S. (eds) Programming Languages and Systems. APLAS 2018. Lecture Notes in Computer Science(), vol 11275. Springer, Cham. https://doi.org/10.1007/978-3-030-02768-1_14

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-02768-1_14

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-02767-4

  • Online ISBN: 978-3-030-02768-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics