skip to main content
article

Efficient asynchronous interrupt handling in a full-system instruction set simulator

Published:13 June 2016Publication History
Skip Abstract Section

Abstract

Instruction set simulators (ISS) have many uses in embedded software and hardware development and are typically based on dynamic binary translation (DBT), where frequently executed regions of guest instructions are compiled into host instructions using a just-in-time (JIT) compiler. Full-system simulation, which necessitates handling of asynchronous interrupts from e.g. timers and I/O devices, complicates matters as control flow is interrupted unpredictably and diverted from the current region of code. In this paper we present a novel scheme for handling of asynchronous interrupts, which integrates seamlessly into a region-based dynamic binary translator. We first show that our scheme is correct, i.e. interrupt handling is not deferred indefinitely, even in the presence of code regions comprising control flow loops. We demonstrate that our new interrupt handling scheme is efficient as we minimise the number of inserted checks. Interrupt handlers are also presented to the JIT compiler and compiled to native code, further enhancing the performance of our system. We have evaluated our scheme in an ARM simulator using a region-based JIT compilation strategy. We demonstrate that our solution reduces the number of dynamic interrupt checks by 73%, reduces interrupt service latency by 26% and improves throughput of an I/O bound workload by 7%, over traditional per-block schemes.

References

  1. Argollo, E., Falcón, A., Faraboschi, P., Monchiero, M., and Ortega, D. (2009). COTSon: infrastructure for full system simulation. SIGOPS Oper. Syst. Rev., 43(1), 52–61. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. ARM Ltd. (2005–2009). ARM security technology building a secure system using TrustZone technology.Google ScholarGoogle Scholar
  3. Ball, T. and Larus, J. R. (1994). Optimally profiling and tracing programs. ACM Transactions on Programming Languages and Systems (TOPLAS), 16(4), 1319–1360. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Bellard, F. (2005). QEMU, a fast and portable dynamic translator. In Proceedings of the Annual Conference on USENIX, ATEC ’05, pages 41–41, Berkeley, CA, USA. USENIX Association. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Binkert, N., Beckmann, B., Black, G., Reinhardt, S. K., Saidi, A., Basu, A., Hestness, J., Hower, D. R., Krishna, T., Sardashti, S., Sen, R., Sewell, K., Shoaib, M., Vaish, N., Hill, M. D., and Wood, D. A. (2011). The gem5 simulator. SIGARCH Comput. Archit. News, 39(2), 1–7. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Böhm, I., Edler von Koch, T. J., Kyle, S. C., Franke, B., and Topham, N. (2011). Generalized just-in-time trace compilation using a parallel task farm in a dynamic binary translator. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI ’11, pages 74–85, New York, NY, USA. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Brandner, F. (2009). Precise simulation of interrupts using a rollback mechanism. In Proceedings of the 12th International Workshop on Software and Compilers for Embedded Systems, SCOPES ’09, pages 71–80, New York, NY, USA. ACM. Google ScholarGoogle ScholarCross RefCross Ref
  8. Charbit, P., Thomassé, S., and Yeo, A. (2007). The minimum feedback arc set problem is NP-hard for tournaments. Comb. Probab. Comput., 16(1), 1–4. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Even, G., (Seffi) Naor, J., Schieber, B., and Sudan, M. (1998). Approximating minimum feedback sets and multicuts in directed graphs. Algorithmica, 20(2), 151–174.Google ScholarGoogle ScholarCross RefCross Ref
  10. Forin, A., Neekzad, B., and Lynch, N. L. (2006). Giano: The twoheaded system simulator. Technical Report MSR-TR-2006-130, Microsoft Research, WA.Google ScholarGoogle Scholar
  11. Gutierrez, A., Pusdesris, J., Dreslinski, R., Mudge, T., Sudanthi, C., Emmons, C., Hayenga, M., and Paver., N. (2014). Sources of error in full-system simulation. In Proceedings of 2014 IEEE International Symposium on Performance Analysis of Systems and Software, ISPASS, pages pp. 13–22.Google ScholarGoogle ScholarCross RefCross Ref
  12. Hardavellas, N., Somogyi, S., Wenisch, T. F., Wunderlich, R. E., Chen, S., Kim, J., Falsafi, B., Hoe, J. C., and Nowatzyk, A. G. (2004).Google ScholarGoogle Scholar
  13. SimFlex: A fast, accurate, flexible full-system simulation framework for performance evaluation of server architecture. SIGMETRICS Perform. Eval. Rev., 31(4), 31–34. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Henning, J. L. (2006). SPEC CPU2006 benchmark descriptions. SIGARCH Comput. Archit. News, 34(4), 1–17. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Jikes RVM (2007). Threading and yieldpoints.Google ScholarGoogle Scholar
  16. Karp, R. M. (1972). Reducibility among combinatorial problems. Springer.Google ScholarGoogle Scholar
  17. Lattner, C. and Adve, V. (2004). Llvm: A compilation framework for lifelong program analysis & transformation. In Code Generation and Optimization, 2004. CGO 2004. International Symposium on, pages 75–86. IEEE. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Lee, S., Yang, B.-S., and Moon, S.-M. (2004). Efficient Java exception handling in just-in-time compilation. Softw. Pract. Exper., 34(15), 1463–1480. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Lv, M., Deng, Q., Guan, N., Xie, Y., and Yu, G. (2008). ARMISS: An instruction set simulator for the ARM architecture. In International Conference on Embedded Software and Systems, ICESS ’08, pages 548–555. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Magnusson, P. S., Christensson, M., Eskilson, J., Forsgren, D., Hållberg, G., Högberg, J., Larsson, F., Moestedt, A., and Werner, B. (2002). Simics: A full system simulation platform. Computer, 35(2), 50–58. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Mark Lord (2012). hdparm(8): get/set sata/ide device parameters.Google ScholarGoogle Scholar
  22. Miller, J., Kasture, H., Kurian, G., Gruenwald, C., Beckmann, N., Celio, C., Eastep, J., and Agarwal, A. (2010). Graphite: A distributed parallel simulator for multicores. In High Performance Computer Architecture (HPCA), 2010 IEEE 16th International Symposium on, pages 1–12.Google ScholarGoogle ScholarCross RefCross Ref
  23. Patel, A., Afram, F., Chen, S., and Ghose, K. (2011). MARSSx86: A Full System Simulator for x86 CPUs. In Proceedings of the Design Automation Conference, DAC ’11. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Russell, R. (2008). Virtio: Towards a de-facto standard for virtual I/O devices. SIGOPS Oper. Syst. Rev., 42(5), 95–103. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ryckbosch, F., Polfliet, S., and Eeckhout, L. (2010). Fast, accurate, and validated full-system software simulation of x86 hardware. IEEE Micro, 30(6), 46–56. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Spink, T., Wagstaff, H., Franke, B., and Topham, N. (2014). Efficient code generation in a region-based dynamic binary translator. In Proceedings of the 2014 SIGPLAN/SIGBED Conference on Languages, Compilers and Tools for Embedded Systems, pages 3–12. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Tarjan, R. (1972). Depth first search and linear graph algorithms. SIAM Journal on Computing.Google ScholarGoogle Scholar
  28. Wagstaff, H., Gould, M., Franke, B., and Topham, N. (2013). Early partial evaluation in a JIT-compiled, retargetable instruction set simulator generated from a high-level architecture description. In Proceedings of the Annual Design Automation Conference, DAC ’13, pages 21:1–21:6, New York, NY, USA. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Efficient asynchronous interrupt handling in a full-system instruction set simulator

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!