SlideShare a Scribd company logo
Background Existing Memory Model New Memory Model Closing
A Memory Model for Expanded LLVM Semantics
in Isabelle
Presented by: David Bergvelt
University of Illinois
Friday 6 November 2015
Background Existing Memory Model New Memory Model Closing
Background
Background Existing Memory Model New Memory Model Closing
From last time
Expand LLVM semantics in Isabelle to allow complex data
structures
Background Existing Memory Model New Memory Model Closing
From last time
Expand LLVM semantics in Isabelle to allow complex data
structures
getelementptr is used to index through structures
Background Existing Memory Model New Memory Model Closing
getelementptr
getelementptr
Allows us to index through structures by performing address
calculation
Background Existing Memory Model New Memory Model Closing
getelementptr
getelementptr
Allows us to index through structures by performing address
calculation
Pass in pointer and list of indices
Background Existing Memory Model New Memory Model Closing
getelementptr
getelementptr
Allows us to index through structures by performing address
calculation
Pass in pointer and list of indices
Inbounds checking
Background Existing Memory Model New Memory Model Closing
getelementptr
getelementptr
Allows us to index through structures by performing address
calculation
Pass in pointer and list of indices
Inbounds checking
Works as general memory traversal tool when inbounds
checking is disabled
Background Existing Memory Model New Memory Model Closing
getelementptr
getelementptr
Allows us to index through structures by performing address
calculation
Pass in pointer and list of indices
Inbounds checking
Works as general memory traversal tool when inbounds
checking is disabled
Int to pointer, pointer to int bitcasting ”flavor”
Background Existing Memory Model New Memory Model Closing
getelementptr
getelementptr
Allows us to index through structures by performing address
calculation
Pass in pointer and list of indices
Inbounds checking
Works as general memory traversal tool when inbounds
checking is disabled
Int to pointer, pointer to int bitcasting ”flavor”
Problem: how do we perform inbounds checks?
Background Existing Memory Model New Memory Model Closing
Existing Memory Model
Background Existing Memory Model New Memory Model Closing
Memory access datatype
Background Existing Memory Model New Memory Model Closing
Base memory model
Background Existing Memory Model New Memory Model Closing
New Memory Model
Background Existing Memory Model New Memory Model Closing
What do we need to change?
Sized memory access datatype
Background Existing Memory Model New Memory Model Closing
What do we need to change?
Sized memory access datatype
Raw addresses represented as ’a words
Background Existing Memory Model New Memory Model Closing
What do we need to change?
Sized memory access datatype
Raw addresses represented as ’a words
to allow for non-inbounds traversal with getelementptr
Background Existing Memory Model New Memory Model Closing
Implementation (Structures)
allocation::(raw_block set)
raw_block = {start::raw_address, length::(’a uword),
memory::((’a word) -> value)}
raw_address::(’a word)
Background Existing Memory Model New Memory Model Closing
Implementation (Assumptions)
good_allocation::(allocation->bool)
good_allocation RBS = (for all rb in RBS and all rb2 in RBS,
good_rb_pair rb1 rb2)
good_rb_pair::(raw_block -> raw_block->bool)
good_rb_pair rb1 rb2 = (good_block rb1) &
((rb1.start = rb2.start) -> (rb1 = rb2)) &
((rb1.start < rb2.start) -> (rb1.start+rb1.length <= rb2.start))
good_block::(raw_block -> bool)
good_block rb = ((rb.start + rb.length) < (max uword)) &
(rb.length>=1)
Background Existing Memory Model New Memory Model Closing
Closing
Background Existing Memory Model New Memory Model Closing
Thank you!
Sources:
Concrete Semantics
http://www.concrete-semantics.org/concrete-semantics.pdf
Background Existing Memory Model New Memory Model Closing
Thank you!
Sources:
Concrete Semantics
http://www.concrete-semantics.org/concrete-semantics.pdf
LLVM Language Reference Manual
http://llvm.org/docs/LangRef.html

More Related Content

Viewers also liked

Applause jan
Applause janApplause jan
Applause jan
Gladys Ferreira
 
9 febr 2014 ogg vrylating!!!
9 febr 2014 ogg vrylating!!!9 febr 2014 ogg vrylating!!!
9 febr 2014 ogg vrylating!!!Ernest Potgieter
 
Viaje por el mundo con friski
Viaje por el mundo con friskiViaje por el mundo con friski
Viaje por el mundo con friski
jose antonio iglesias encalado
 
Clase otro domingo
Clase otro domingoClase otro domingo
Clase otro domingo
Mario Nahuel
 
Каменский С.Ю. Актуализация археологического наследия в современных социально...
Каменский С.Ю. Актуализация археологического наследия в современных социально...Каменский С.Ю. Актуализация археологического наследия в современных социально...
Каменский С.Ю. Актуализация археологического наследия в современных социально...
URFU
 
Revista Applause Dez 2011
Revista Applause Dez 2011Revista Applause Dez 2011
Revista Applause Dez 2011
Gladys Ferreira
 
Automated Online Extraction and Chromatography with Supercritical Fluids
Automated Online Extraction and  Chromatography with Supercritical FluidsAutomated Online Extraction and  Chromatography with Supercritical Fluids
Automated Online Extraction and Chromatography with Supercritical Fluids
Shimadzu Scientific Instruments
 
Проектная деятельность музея
Проектная деятельность музеяПроектная деятельность музея
Проектная деятельность музея
URFU
 
Big Bang Theory: The Evolution of a Recruitment Process
Big Bang Theory: The Evolution of a Recruitment ProcessBig Bang Theory: The Evolution of a Recruitment Process
Big Bang Theory: The Evolution of a Recruitment Process
Sonru
 
CONTRATOS INFORMATICOS
CONTRATOS INFORMATICOSCONTRATOS INFORMATICOS
CONTRATOS INFORMATICOS
Malú Mf
 
PAINEL SOLAR | ENERGIA EÓLICA
PAINEL SOLAR |  ENERGIA EÓLICAPAINEL SOLAR |  ENERGIA EÓLICA
PAINEL SOLAR | ENERGIA EÓLICA
Diego Silvério, MBA, Eng.
 
Уусах чанар
Уусах чанарУусах чанар
Уусах чанарdawaakhuu_od
 

Viewers also liked (17)

Applause jan
Applause janApplause jan
Applause jan
 
9 febr 2014 ogg vrylating!!!
9 febr 2014 ogg vrylating!!!9 febr 2014 ogg vrylating!!!
9 febr 2014 ogg vrylating!!!
 
Viaje por el mundo con friski
Viaje por el mundo con friskiViaje por el mundo con friski
Viaje por el mundo con friski
 
Clase otro domingo
Clase otro domingoClase otro domingo
Clase otro domingo
 
Каменский С.Ю. Актуализация археологического наследия в современных социально...
Каменский С.Ю. Актуализация археологического наследия в современных социально...Каменский С.Ю. Актуализация археологического наследия в современных социально...
Каменский С.Ю. Актуализация археологического наследия в современных социально...
 
Revista Applause Dez 2011
Revista Applause Dez 2011Revista Applause Dez 2011
Revista Applause Dez 2011
 
Automated Online Extraction and Chromatography with Supercritical Fluids
Automated Online Extraction and  Chromatography with Supercritical FluidsAutomated Online Extraction and  Chromatography with Supercritical Fluids
Automated Online Extraction and Chromatography with Supercritical Fluids
 
Проектная деятельность музея
Проектная деятельность музеяПроектная деятельность музея
Проектная деятельность музея
 
Big Bang Theory: The Evolution of a Recruitment Process
Big Bang Theory: The Evolution of a Recruitment ProcessBig Bang Theory: The Evolution of a Recruitment Process
Big Bang Theory: The Evolution of a Recruitment Process
 
Angi negdel ajil
Angi negdel ajilAngi negdel ajil
Angi negdel ajil
 
Key new
Key newKey new
Key new
 
Yysah chanar
Yysah chanarYysah chanar
Yysah chanar
 
Bio test
Bio testBio test
Bio test
 
CONTRATOS INFORMATICOS
CONTRATOS INFORMATICOSCONTRATOS INFORMATICOS
CONTRATOS INFORMATICOS
 
PAINEL SOLAR | ENERGIA EÓLICA
PAINEL SOLAR |  ENERGIA EÓLICAPAINEL SOLAR |  ENERGIA EÓLICA
PAINEL SOLAR | ENERGIA EÓLICA
 
Уусах чанар
Уусах чанарУусах чанар
Уусах чанар
 
хөнгөн
хөнгөнхөнгөн
хөнгөн
 

Similar to Bergvelt memory model presentation

NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandra
rantav
 
Java Basics
Java BasicsJava Basics
Java Basics
shivamgarg_nitj
 
CMPE-255 Term Project.pptx
CMPE-255 Term Project.pptxCMPE-255 Term Project.pptx
CMPE-255 Term Project.pptx
SoumyendraShrivastav
 
may2016presentation
may2016presentationmay2016presentation
may2016presentation
David Bergvelt
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with Elasticsearch
Taylor Lovett
 
OSMC 2023 | Experiments with OpenSearch and AI by Jochen Kressin & Leanne La...
OSMC 2023 | Experiments with OpenSearch and AI by Jochen Kressin &  Leanne La...OSMC 2023 | Experiments with OpenSearch and AI by Jochen Kressin &  Leanne La...
OSMC 2023 | Experiments with OpenSearch and AI by Jochen Kressin & Leanne La...
NETWAYS
 
Chapter 5 b
Chapter 5  bChapter 5  b
Chapter 5 b
ececourse
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
Ankur Dongre
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
Ankur Dongre
 
Elasticsearch and Spark
Elasticsearch and SparkElasticsearch and Spark
Elasticsearch and Spark
Audible, Inc.
 
Hfile
HfileHfile
Granular Archival and Nearline Storage Using MySQL, S3, and SQS
Granular Archival and Nearline Storage Using MySQL, S3, and SQSGranular Archival and Nearline Storage Using MySQL, S3, and SQS
Granular Archival and Nearline Storage Using MySQL, S3, and SQS
waltjones
 
Write better python code with these 10 tricks | by yong cui, ph.d. | aug, 202...
Write better python code with these 10 tricks | by yong cui, ph.d. | aug, 202...Write better python code with these 10 tricks | by yong cui, ph.d. | aug, 202...
Write better python code with these 10 tricks | by yong cui, ph.d. | aug, 202...
amit kuraria
 
Java Symmetric
Java SymmetricJava Symmetric
Java Symmetric
phanleson
 
Cloud forensics putting the bits back together
Cloud forensics putting the bits back togetherCloud forensics putting the bits back together
Cloud forensics putting the bits back together
Shakacon
 
Entity Query API
Entity Query APIEntity Query API
Entity Query API
marcingy
 
CoreML for NLP (Melb Cocoaheads 08/02/2018)
CoreML for NLP (Melb Cocoaheads 08/02/2018)CoreML for NLP (Melb Cocoaheads 08/02/2018)
CoreML for NLP (Melb Cocoaheads 08/02/2018)
Hon Weng Chong
 
Inside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTPInside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTP
Bob Ward
 
Get full visibility and find hidden security issues
Get full visibility and find hidden security issuesGet full visibility and find hidden security issues
Get full visibility and find hidden security issues
Elasticsearch
 
Apache Cassandra, part 2 – data model example, machinery
Apache Cassandra, part 2 – data model example, machineryApache Cassandra, part 2 – data model example, machinery
Apache Cassandra, part 2 – data model example, machinery
Andrey Lomakin
 

Similar to Bergvelt memory model presentation (20)

NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandra
 
Java Basics
Java BasicsJava Basics
Java Basics
 
CMPE-255 Term Project.pptx
CMPE-255 Term Project.pptxCMPE-255 Term Project.pptx
CMPE-255 Term Project.pptx
 
may2016presentation
may2016presentationmay2016presentation
may2016presentation
 
Modernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with ElasticsearchModernizing WordPress Search with Elasticsearch
Modernizing WordPress Search with Elasticsearch
 
OSMC 2023 | Experiments with OpenSearch and AI by Jochen Kressin & Leanne La...
OSMC 2023 | Experiments with OpenSearch and AI by Jochen Kressin &  Leanne La...OSMC 2023 | Experiments with OpenSearch and AI by Jochen Kressin &  Leanne La...
OSMC 2023 | Experiments with OpenSearch and AI by Jochen Kressin & Leanne La...
 
Chapter 5 b
Chapter 5  bChapter 5  b
Chapter 5 b
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 
Ejb3 Struts Tutorial En
Ejb3 Struts Tutorial EnEjb3 Struts Tutorial En
Ejb3 Struts Tutorial En
 
Elasticsearch and Spark
Elasticsearch and SparkElasticsearch and Spark
Elasticsearch and Spark
 
Hfile
HfileHfile
Hfile
 
Granular Archival and Nearline Storage Using MySQL, S3, and SQS
Granular Archival and Nearline Storage Using MySQL, S3, and SQSGranular Archival and Nearline Storage Using MySQL, S3, and SQS
Granular Archival and Nearline Storage Using MySQL, S3, and SQS
 
Write better python code with these 10 tricks | by yong cui, ph.d. | aug, 202...
Write better python code with these 10 tricks | by yong cui, ph.d. | aug, 202...Write better python code with these 10 tricks | by yong cui, ph.d. | aug, 202...
Write better python code with these 10 tricks | by yong cui, ph.d. | aug, 202...
 
Java Symmetric
Java SymmetricJava Symmetric
Java Symmetric
 
Cloud forensics putting the bits back together
Cloud forensics putting the bits back togetherCloud forensics putting the bits back together
Cloud forensics putting the bits back together
 
Entity Query API
Entity Query APIEntity Query API
Entity Query API
 
CoreML for NLP (Melb Cocoaheads 08/02/2018)
CoreML for NLP (Melb Cocoaheads 08/02/2018)CoreML for NLP (Melb Cocoaheads 08/02/2018)
CoreML for NLP (Melb Cocoaheads 08/02/2018)
 
Inside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTPInside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTP
 
Get full visibility and find hidden security issues
Get full visibility and find hidden security issuesGet full visibility and find hidden security issues
Get full visibility and find hidden security issues
 
Apache Cassandra, part 2 – data model example, machinery
Apache Cassandra, part 2 – data model example, machineryApache Cassandra, part 2 – data model example, machinery
Apache Cassandra, part 2 – data model example, machinery
 

Bergvelt memory model presentation

  • 1. Background Existing Memory Model New Memory Model Closing A Memory Model for Expanded LLVM Semantics in Isabelle Presented by: David Bergvelt University of Illinois Friday 6 November 2015
  • 2. Background Existing Memory Model New Memory Model Closing Background
  • 3. Background Existing Memory Model New Memory Model Closing From last time Expand LLVM semantics in Isabelle to allow complex data structures
  • 4. Background Existing Memory Model New Memory Model Closing From last time Expand LLVM semantics in Isabelle to allow complex data structures getelementptr is used to index through structures
  • 5. Background Existing Memory Model New Memory Model Closing getelementptr getelementptr Allows us to index through structures by performing address calculation
  • 6. Background Existing Memory Model New Memory Model Closing getelementptr getelementptr Allows us to index through structures by performing address calculation Pass in pointer and list of indices
  • 7. Background Existing Memory Model New Memory Model Closing getelementptr getelementptr Allows us to index through structures by performing address calculation Pass in pointer and list of indices Inbounds checking
  • 8. Background Existing Memory Model New Memory Model Closing getelementptr getelementptr Allows us to index through structures by performing address calculation Pass in pointer and list of indices Inbounds checking Works as general memory traversal tool when inbounds checking is disabled
  • 9. Background Existing Memory Model New Memory Model Closing getelementptr getelementptr Allows us to index through structures by performing address calculation Pass in pointer and list of indices Inbounds checking Works as general memory traversal tool when inbounds checking is disabled Int to pointer, pointer to int bitcasting ”flavor”
  • 10. Background Existing Memory Model New Memory Model Closing getelementptr getelementptr Allows us to index through structures by performing address calculation Pass in pointer and list of indices Inbounds checking Works as general memory traversal tool when inbounds checking is disabled Int to pointer, pointer to int bitcasting ”flavor” Problem: how do we perform inbounds checks?
  • 11. Background Existing Memory Model New Memory Model Closing Existing Memory Model
  • 12. Background Existing Memory Model New Memory Model Closing Memory access datatype
  • 13. Background Existing Memory Model New Memory Model Closing Base memory model
  • 14. Background Existing Memory Model New Memory Model Closing New Memory Model
  • 15. Background Existing Memory Model New Memory Model Closing What do we need to change? Sized memory access datatype
  • 16. Background Existing Memory Model New Memory Model Closing What do we need to change? Sized memory access datatype Raw addresses represented as ’a words
  • 17. Background Existing Memory Model New Memory Model Closing What do we need to change? Sized memory access datatype Raw addresses represented as ’a words to allow for non-inbounds traversal with getelementptr
  • 18. Background Existing Memory Model New Memory Model Closing Implementation (Structures) allocation::(raw_block set) raw_block = {start::raw_address, length::(’a uword), memory::((’a word) -> value)} raw_address::(’a word)
  • 19. Background Existing Memory Model New Memory Model Closing Implementation (Assumptions) good_allocation::(allocation->bool) good_allocation RBS = (for all rb in RBS and all rb2 in RBS, good_rb_pair rb1 rb2) good_rb_pair::(raw_block -> raw_block->bool) good_rb_pair rb1 rb2 = (good_block rb1) & ((rb1.start = rb2.start) -> (rb1 = rb2)) & ((rb1.start < rb2.start) -> (rb1.start+rb1.length <= rb2.start)) good_block::(raw_block -> bool) good_block rb = ((rb.start + rb.length) < (max uword)) & (rb.length>=1)
  • 20. Background Existing Memory Model New Memory Model Closing Closing
  • 21. Background Existing Memory Model New Memory Model Closing Thank you! Sources: Concrete Semantics http://www.concrete-semantics.org/concrete-semantics.pdf
  • 22. Background Existing Memory Model New Memory Model Closing Thank you! Sources: Concrete Semantics http://www.concrete-semantics.org/concrete-semantics.pdf LLVM Language Reference Manual http://llvm.org/docs/LangRef.html