Skip to main content

A Better x86 Memory Model: x86-TSO

  • Conference paper
Theorem Proving in Higher Order Logics (TPHOLs 2009)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 5674))

Included in the following conference series:

Abstract

Real multiprocessors do not provide the sequentially consistent memory that is assumed by most work on semantics and verification. Instead, they have relaxed memory models, typically described in ambiguous prose, which lead to widespread confusion. These are prime targets for mechanized formalization. In previous work we produced a rigorous x86-CC model, formalizing the Intel and AMD architecture specifications of the time, but those turned out to be unsound with respect to actual hardware, as well as arguably too weak to program above. We discuss these issues and present a new x86-TSO model that suffers from neither problem, formalized in HOL4. We believe it is sound with respect to real processors, reflects better the vendor’s intentions, and is also better suited for programming. We give two equivalent definitions of x86-TSO: an intuitive operational model based on local write buffers, and an axiomatic total store ordering model, similar to that of the SPARCv8. Both are adapted to handle x86-specific features. We have implemented the axiomatic model in our memevents tool, which calculates the set of all valid executions of test programs, and, for greater confidence, verify the witnesses of such executions directly, with code extracted from a third, more algorithmic, equivalent version of the definition.

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 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

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. AMD64 Architecture Programmer’s Manual (3 vols). Advanced Micro Devices, rev. 3.14 (September 2007)

    Google Scholar 

  2. Intel 64 and IA-32 Architectures Software Developer’s Manual (5 vols). Intel Corporation, rev. 29 (November 2008)

    Google Scholar 

  3. Adve, S., Gharachorloo, K.: Shared memory consistency models: A tutorial. IEEE Computer 29(12), 66–76 (1996)

    Article  Google Scholar 

  4. Ahamad, M., Neiger, G., Burns, J., Kohli, P., Hutto, P.: Causal memory: Definitions, implementation, and programming. Distributed Computing 9(1), 37–49 (1995)

    Article  MathSciNet  Google Scholar 

  5. Aspinall, D., Ševčík, J.: Formalising Java’s data race free guarantee. In: Schneider, K., Brandt, J. (eds.) TPHOLs 2007. LNCS, vol. 4732, pp. 22–37. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  6. Boehm, H.-J., Adve, S.: Foundations of the C++ concurrency memory model. In: Proc. PLDI (2008)

    Google Scholar 

  7. Boudol, G., Petri, G.: Relaxed memory models: an operational approach. In: Proc. POPL, pp. 392–403 (2009)

    Google Scholar 

  8. Burckhardt, S., Musuvathi, M.: Effective program verification for relaxed memory models. Technical Report MSR-TR-2008-12, Microsoft Research (2008); Gupta, A., Malik, S. (eds.) CAV 2008. LNCS, vol. 5123, pp. 107–120. Springer, Heidelberg (2008)

    Google Scholar 

  9. Dice, D.: Java memory model concerns on Intel and AMD systems (January 2008), http://blogs.sun.com/dave/entry/java_memory_model_concerns_on

  10. Hangal, S., Vahia, D., Manovit, C., Lu, J.-Y.J., Narayanan, S.: TSOtool: A program for verifying memory systems using the memory consistency model. In: Proc. ISCA, pp. 114–123 (2004)

    Google Scholar 

  11. The HOL 4 system, http://hol.sourceforge.net/

  12. Intel. Intel 64 architecture memory ordering white paper. SKU 318147-001 (2007)

    Google Scholar 

  13. Higham, L., Kawash, J., Verwaal, N.: Defining and comparing memory consistency models. PDCS, Full version as TR #98/612/03, U. Calgary (1997)

    Google Scholar 

  14. Loewenstein, P.: Personal communication (November 2008)

    Google Scholar 

  15. Loewenstein, P.N., Chaudhry, S., Cypher, R., Manovit, C.: Multiprocessor memory model verification. In: Proc. AFM (Automated Formal Methods), FLoC workshop (August 2006), http://fm.csl.sri.com/AFM06/

  16. Owens, S., Sarkar, S., Sewell, P.: A better x86 memory model: x86-TSO (extended version). Technical Report UCAM-CL-TR-745, Univ. of Cambridge (2009), Supporting material at, www.cl.cam.ac.uk/users/pes20/weakmemory/

  17. Roy, A., Zeisset, S., Fleckenstein, C.J., Huang, J.C.: Fast and generalized polynomial time memory consistency verification. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, pp. 503–516. Springer, Heidelberg (2006)

    Chapter  Google Scholar 

  18. Saraswat, V., Jagadeesan, R., Michael, M., von Praun, C.: A theory of memory models. In: Proc. PPoPP (2007)

    Google Scholar 

  19. Sarkar, S., Sewell, P., Zappa Nardelli, F., Owens, S., Ridge, T., Braibant, T., Myreen, M., Alglave, J.: The semantics of x86-CC multiprocessor machine code. In: Proc. POPL 2009 (January 2009)

    Google Scholar 

  20. Sindhu, P.S., Frailong, J.-M., Cekleov, M.: Formal specification of memory models. In: Scalable Shared Memory Multiprocessors, pp. 25–42. Kluwer, Dordrecht (1991)

    Google Scholar 

  21. SPARC International, Inc. The SPARC architecture manual, v. 8. Revision SAV080SI9308 (1992), http://www.sparc.org/standards/V8.pdf

  22. Yang, Y., Gopalakrishnan, G., Lindstrom, G., Slind, K.: Nemos: A framework for axiomatic and executable specifications of memory consistency models. In: IPDPS (2004)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2009 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Owens, S., Sarkar, S., Sewell, P. (2009). A Better x86 Memory Model: x86-TSO. In: Berghofer, S., Nipkow, T., Urban, C., Wenzel, M. (eds) Theorem Proving in Higher Order Logics. TPHOLs 2009. Lecture Notes in Computer Science, vol 5674. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-03359-9_27

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-03359-9_27

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-03358-2

  • Online ISBN: 978-3-642-03359-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics