Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3240719.3241792acmconferencesArticle/Chapter ViewAbstractPublication PagesicfpConference Proceedingsconference-collections
research-article

Implementing resource-aware safe assembly for kernel probes as a dependently-typed DSL

Published: 27 September 2018 Publication History

Abstract

We present construction of resource-aware safe typed assembly language as an EDSL in dependently-typed Idris language. We use this assembly language to compile Linux kernel probes — small pieces of instrumentation code injected directly into the kernel and thus having to satisfy strict safety properties. We believe that the techniques presented can be generally applied to embedding a typed assembly language into a functional language with dependent types.

References

[1]
Guillaume Allais, James Chapman, Conor McBride, and James McK-inna. 2017. Type-and-scope safe programs and their proofs. In Proceedings of the 6th ACM SIGPLAN Conference on Certified Programs and Proofs, CPP 2017, Paris, France, January 16-17, 2017, Yves Bertot and Viktor Vafeiadis (Eds.). ACM, 195–207.
[2]
Thorsten Altenkirch and Ambrus Kaposi. 2016. Type theory in type theory using quotient inductive types. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, St. Petersburg, FL, USA, January 20 -22, 2016, Rastislav Bodík and Rupak Majumdar (Eds.). ACM, 18–29.
[3]
Robert Atkey. 2009. Parameterised notions of computation. J. Funct. Program. 19, 3-4 (2009), 335–376.
[4]
Lennart Augustsson and Magnus Carlsson. 1999. An exercise in dependent types: A well-typed interpreter. In Workshop on Dependent Types in Programming, Gothenburg .
[5]
Edwin Brady. 2013. Idris, a general-purpose dependently typed programming language: Design and implementation. Journal of Functional Programming 23, 5 (2013), 552–593.
[6]
Edwin Brady. 2013. Programming and Reasoning with Algebraic Effects and Dependent Types. In Proceedings of the 18th ACM SIGPLAN International Conference on Functional Programming (ICFP ’13) . ACM, New York, NY, USA, 133–144.
[7]
Edwin Brady. 2016. State Machines All The Way Down. (2016). preprint on webpage at https://www.idris-lang.org/drafts/sms.pdf .
[8]
Edwin Brady and Kevin Hammond. 2006. A dependently typed framework for static analysis of program execution costs. Implementation and Application of Functional Languages (2006), 74–90.
[9]
Edwin Brady and Kevin Hammond. 2012. Resource-safe systems programming with embedded domain specific languages. In Practical Aspects of Declarative Languages . Springer, 242–257.
[10]
Edwin C Brady. 2011. IDRIS — systems programming meets full dependent types. In Proceedings of the 5th ACM workshop on Programming languages meets program verification . ACM, 43–54.
[11]
Bryan M. Cantrill, Michael W. Shapiro, and Adam H. Leventhal. 2004. Dynamic Instrumentation of Production Systems. In Proceedings of the Annual Conference on USENIX Annual Technical Conference (ATEC ’04) . USENIX Association, Berkeley, CA, USA, 15–28. http://dl.acm.org/ citation.cfm?id=1247415.1247417
[12]
Ajay Chander, David Espinosa, Nayeem Islam, Peter Lee, and George C. Necula. 2007. Enforcing resource bounds via static verification of dynamic checks. ACM Trans. Program. Lang. Syst. 29, 5 (2007). http:// dblp.uni-trier.de/db/journals/toplas/toplas29.html#ChanderEILN07
[13]
Karl Crary and Stephnie Weirich. 2000. Resource bound certification. In Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages . ACM, 184–198.
[14]
Nils Anders Danielsson. 2008. Lightweight semiformal time complexity analysis for purely functional data structures. ACM SIGPLAN Notices 43, 1 (2008), 133–144.
[15]
Paul Hudak, Simon L. Peyton Jones, Philip Wadler, Brian Boutel, Jon Fairbairn, Joseph H. Fasel, María M. Guzmán, Kevin Hammond, John Hughes, Thomas Johnsson, Richard B. Kieburtz, Rishiyur S. Nikhil, Will Partain, and John Peterson. 1992. Report on the Programming Language Haskell, A Non-strict, Purely Functional Language. SIGPLAN Notices 27, 5 (1992), 1.
[16]
Simon P. Jones. 2001. Tackling the Awkward Squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell. In Engineering theories of software construction, Tony Hoare, Manfred Broy, and Ralf Steinbruggen (Eds.). IOS Press, 47–96.
[17]
Andrew Kennedy, Nick Benton, Jonas Braband Jensen, and PierreÉvariste Dagand. 2013. Coq: the world’s best macro assembler?. In 15th International Symposium on Principles and Practice of Declarative Programming, PPDP ’13, Madrid, Spain, September 16-18, 2013, Ricardo Peña and Tom Schrijvers (Eds.). ACM, 13–24.
[18]
Oleg Kiselyov and Hiromi Ishii. 2015. Freer monads, more extensible effects. In Proceedings of the 8th ACM SIGPLAN Symposium on Haskell, Haskell 2015, Vancouver, BC, Canada, September 3-4, 2015, Ben Lippmeier (Ed.). ACM, 94–105.
[19]
Oleg Kiselyov, Amr Sabry, and Cameron Swords. 2013. Extensible effects: an alternative to monad transformers. In Proceedings of the 2013 ACM SIGPLAN Symposium on Haskell, Boston, MA, USA, September 23-24, 2013, Chung-chieh Shan (Ed.). ACM, 59–70.
[20]
Chris Lattner and Vikram Adve. 2004. LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation. In Proceedings of the 2004 International Symposium on Code Generation and Optimization (CGO’04) . Palo Alto, California.
[21]
John Launchbury and Simon L. Peyton Jones. 1994. Lazy Functional State Threads. In Proceedings of the ACM SIGPLAN’94 Conference on Programming Language Design and Implementation (PLDI), Orlando, Florida, USA, June 20-24, 1994, Vivek Sarkar, Barbara G. Ryder, and Mary Lou Soffa (Eds.). ACM, 24–35.
[22]
Ananth Mavinakayanahalli, Prasanna Panchamukhi, Jim Keniston, Anil Keshavamurthy, and Masami Hiramatsu. 2006. Probing the guts of kprobes. In Linux Symposium, Vol. 6.
[23]
Frank Pfenning and Conal Elliott. 1988. Higher-Order Abstract Syntax. In Proceedings of the ACM SIGPLAN’88 Conference on Programming Language Design and Implementation (PLDI), Atlanta, Georgia, USA, June 22-24, 1988, Richard L. Wexelblat (Ed.). ACM, 199–208.
[24]
Vara Prasad, William Cohen, FC Eigler, Martin Hunt, Jim Keniston, and Brad Chen. 2005. Locating system problems using dynamic instrumentation. In 2005 Ottawa Linux Symposium. 49–64.
[25]
Thorsten Von Eicken, Chi-Chao Chang, Grzegorz Czajkowski, Chris Hawblitzel, Deyu Hu, and Dan Spoonhower. 1999. J-Kernel: A capability-based operating system for Java. Secure Internet Programming (1999), 369–393.
[26]
Robert Wahbe, Steven Lucco, Thomas E Anderson, and Susan L Graham. 1994. Efficient software-based fault isolation. ACM SIGOPS Operating Systems Review 27, 5 (1994), 203–216.
[27]
Geoffrey Washburn and Stephanie Weirich. 2008. Boxes go bananas: Encoding higher-order abstract syntax with parametric polymorphism. J. Funct. Program. 18, 1 (2008), 87–140.

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
TyDe 2018: Proceedings of the 3rd ACM SIGPLAN International Workshop on Type-Driven Development
September 2018
90 pages
ISBN:9781450358255
DOI:10.1145/3240719
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 27 September 2018

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. dependent types
  2. edsl
  3. low-level code safety

Qualifiers

  • Research-article

Funding Sources

Conference

ICFP '18
Sponsor:

Upcoming Conference

ICFP '25
ACM SIGPLAN International Conference on Functional Programming
October 12 - 18, 2025
Singapore , Singapore

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 98
    Total Downloads
  • Downloads (Last 12 months)3
  • Downloads (Last 6 weeks)1
Reflects downloads up to 13 Nov 2024

Other Metrics

Citations

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media