MemTracker Efficient and Programmable Support for Memory Access Monitoring and Debugging Guru Venkataramani, Brandyn Roemer, Yan Solihin, Milos Prvulovic.

Slides:



Advertisements
Similar presentations
Virtual Memory Basics.
Advertisements

Chapter 4 Memory Management Basic memory management Swapping
1 A Hybrid Adaptive Feedback Based Prefetcher Santhosh Verma, David Koppelman and Lu Peng Louisiana State University.
Multi-Level Caches Vittorio Zaccaria. Preview What you have seen: Data organization, Associativity, Cache size Policies -- how to manage the data once.
Chapter 12 CPU Structure and Function. CPU Sequence Fetch instructions Interpret instructions Fetch data Process data Write data.
Computer Organization and Architecture
Efficient and Flexible Architectural Support for Dynamic Monitoring YUANYUAN ZHOU, PIN ZHOU, FENG QIN, WEI LIU, & JOSEP TORRELLAS UIUC.
Computer ArchitectureFall 2008 © November 10, 2007 Nael Abu-Ghazaleh Lecture 23 Virtual.
Computer ArchitectureFall 2007 © November 21, 2007 Karem A. Sakallah Lecture 23 Virtual Memory (2) CS : Computer Architecture.
Multiprocessing Memory Management
Translation Buffers (TLB’s)
Memory Management 1 CS502 Spring 2006 Memory Management CS-502 Spring 2006.
Virtual Memory and Paging J. Nelson Amaral. Large Data Sets Size of address space: – 32-bit machines: 2 32 = 4 GB – 64-bit machines: 2 64 = a huge number.
Computer Organization and Architecture
Secure Embedded Processing through Hardware-assisted Run-time Monitoring Zubin Kumar.
Operating System Chapter 7. Memory Management Lynn Choi School of Electrical Engineering.
Review of Memory Management, Virtual Memory CS448.
15-740/ Oct. 17, 2012 Stefan Muller.  Problem: Software is buggy!  More specific problem: Want to make sure software doesn’t have bad property.
Page Overlays An Enhanced Virtual Memory Framework to Enable Fine-grained Memory Management Vivek Seshadri Gennady Pekhimenko, Olatunji Ruwase, Onur Mutlu,
File System Implementation Chapter 12. File system Organization Application programs Application programs Logical file system Logical file system manages.
July 30, 2001Systems Architecture II1 Systems Architecture II (CS ) Lecture 8: Exploiting Memory Hierarchy: Virtual Memory * Jeremy R. Johnson Monday.
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming  To allocate scarce memory resources.
Chapter 8 – Main Memory (Pgs ). Overview  Everything to do with memory is complicated by the fact that more than 1 program can be in memory.
Chapter 4 Memory Management Virtual Memory.
Fundamentals of Programming Languages-II Subject Code: Teaching SchemeExamination Scheme Theory: 1 Hr./WeekOnline Examination: 50 Marks Practical:
By Teacher Asma Aleisa Year 1433 H.   Goals of memory management  To provide a convenient abstraction for programming.  To allocate scarce memory.
Operating Systems Lecture 14 Segments Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software Engineering.
1 Memory Management. 2 Fixed Partitions Legend Free Space 0k 4k 16k 64k 128k Internal fragmentation (cannot be reallocated) Divide memory into n (possible.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Virtual Memory Hardware.
Review °Apply Principle of Locality Recursively °Manage memory to disk? Treat as cache Included protection as bonus, now critical Use Page Table of mappings.
Processes and Virtual Memory
Protection of Processes Security and privacy of data is challenging currently. Protecting information – Not limited to hardware. – Depends on innovation.
Memory Management Continued Questions answered in this lecture: What is paging? How can segmentation and paging be combined? How can one speed up address.
OS Memory Addressing. Architecture CPU – Processing units – Caches – Interrupt controllers – MMU Memory Interconnect North bridge South bridge PCI, etc.
G. Venkataramani, I. Doudalis, Y. Solihin, M. Prvulovic HPCA ’08 Reading Group Presentation 02/14/2008.
Operating Systems Lecture 9 Introduction to Paging Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
CDA 5155 Virtual Memory Lecture 27. Memory Hierarchy Cache (SRAM) Main Memory (DRAM) Disk Storage (Magnetic media) CostLatencyAccess.
Running Commodity Operating Systems on Scalable Multiprocessors Edouard Bugnion, Scott Devine and Mendel Rosenblum Presentation by Mark Smith.
Memory Management memory hierarchy programs exhibit locality of reference - non-uniform reference patterns temporal locality - a program that references.
CS161 – Design and Architecture of Computer
Lecture 11 Virtual Memory
Kernel Design & Implementation
Memory Management.
Non Contiguous Memory Allocation
Free Transactions with Rio Vista
Cache Organization of Pentium
Lecture: Large Caches, Virtual Memory
CS161 – Design and Architecture of Computer
Memory Caches & TLB Virtual Memory
Chapter 8: Main Memory.
CSCI206 - Computer Organization & Programming
Memory Management 11/17/2018 A. Berrached:CS4315:UHD.
Reducing Memory Reference Energy with Opportunistic Virtual Caching
Page Replacement.
Lecture: Cache Innovations, Virtual Memory
Free Transactions with Rio Vista
Virtual Memory Hardware
Effective and Efficient memory Protection Using Dynamic Tainting
Translation Buffers (TLB’s)
Operating System Chapter 7. Memory Management
Virtual Memory Overcoming main memory size limitation
CSE451 Virtual Memory Paging Autumn 2002
Lecture 3: Main Memory.
Lecture 8: Efficient Address Translation
System calls….. C-program->POSIX call
Virtual Memory Use main memory as a “cache” for secondary (disk) storage Managed jointly by CPU hardware and the operating system (OS) Programs share main.
COMP755 Advanced Operating Systems
Virtual Memory.
Presentation transcript:

MemTracker Efficient and Programmable Support for Memory Access Monitoring and Debugging Guru Venkataramani, Brandyn Roemer, Yan Solihin, Milos Prvulovic

Venkataramani HPCA’07 2 Introduction Software is increasingly complex More complexity means more bugs Memory bugs are most common –Many are security vulnerabilities How to catch them efficiently?

Venkataramani HPCA’07 3 Debugging and Monitoring Maintain Information/state about memory Low performance overhead in “always-on” mode –Hard problem Flexible/Programmable –Even harder!!

Venkataramani HPCA’07 4 Challenges Software Approach –Flexible –Large (2X to 30X) slowdown Hardware approach –Faster –Most are checker specific –Others need Software intervention too often

Venkataramani HPCA’07 5 Related Work DISE [ISCA’03] + Pattern matches instructions, dynamically injects instrumentation –Modifies front end of pipeline –Adds extra code to instruction stream Mondrian [ASPLOS’02] + Fine grain protection- different permissions for adjacent words –Software intervention for permission updates –Complex hardware (trie structure)

Venkataramani HPCA’07 6 Objectives MemTracker * Maintains state for every memory word * No software intervention for most state checks and updates * Efficient checks and updates even when nearby locations have different states * Programmable (can implement different checkers)

Venkataramani HPCA’07 7 What is MemTracker? A programmable state machine –(State, event) → (State, Exception) Supports upto 16 states (4 state bits/word) –Not any fundamental limit; Can be extended All memory actions are events –Memory accesses : Loads, Stores –User events (affect only state)

Venkataramani HPCA’07 8 Example Heap Checker Load/ Store NON- HEAP Malloc/ Free ERROR UNALLOC ALLOC, UNINIT INIT Load/ Store/ Free ERROR Malloc Free Load ERROR Store Free Malloc ERROR Load/ Store

Venkataramani HPCA’07 9 MemTracker State Table UEVT0 (Alloc) UEVT1 (Free) LOADSTORE 0 (Non-Heap) 1 (UnAlloc) 2 (UnInit) 3 (Init) State↓ Event →

Venkataramani HPCA’07 10 MemTracker State Table UEVT0 (Alloc) UEVT1 (Free) LOADSTORE 0 (Non-Heap) 0 E 00 1 (UnAlloc) 2 (UnInit) 3 (Init) State↓ Event →

Venkataramani HPCA’07 11 MemTracker State Table UEVT0 (Alloc) UEVT1 (Free) LOADSTORE 0 (Non-Heap) 0 E 00 1 (UnAlloc) 21 E 2 (UnInit) 3 (Init) State↓ Event →

Venkataramani HPCA’07 12 MemTracker State Table UEVT0 (Alloc) UEVT1 (Free) LOADSTORE 0 (Non-Heap) 0 E 00 1 (UnAlloc) 21 E 2 (UnInit) 2 E1 3 3 (Init) 3 E133 State↓ Event →

Venkataramani HPCA’07 13 State Storage Application’s Virtual Address Space Protected, Reserved Virtual Space for State Data Normal Virtual Memory Space for code, data, stack and heap State Code, Data, Heap and Stack

Venkataramani HPCA’07 14 State Base RegData address (0xABCD) + State address (0xF0000ABC) Cache MUX State (11) 2 Number of State Bits State Lookup – Word access only xF

Venkataramani HPCA’07 15 Caching State information Shared Caching No additional resources for state Data and state blocks compete for cache lines in existing caches Load/Stores already have data lookups, now they also need state lookups These state lookups double the L1 port contention

Venkataramani HPCA’07 16 Caching State information Interleaved Caching Expand cache line to store state for its data +One lookup finds both data and state - L1 cache larger and slower even when no checking

Venkataramani HPCA’07 17 Caching State information Split Caching Dedicated (small) state L1 cache Provides separate ports for state lookups Leaves data L1 cache alone When NOT checking, turn SL1 off

Venkataramani HPCA’07 18 Caching State information Shared Caching Split Caching Interleaved Caching L2 and below use shared caching (no addt’l space for state) L2 single ported, rarely a contention problem (L1 filters out most acceses) State smaller than data, so needs less bandwidth and capacity We use Split L1 and Shared L2 and below in the rest of the talk

Venkataramani HPCA’07 19 Pipeline IFIDRENREGEXEMEMWB CMT Data L1 Front EndOut of OrderBack end

Venkataramani HPCA’07 20 Pipeline Modifications IFIDRENREGEXEMEMWB Pre- CMT CHKCMT State L1 Data L1 State Forwarding Prefetch

Venkataramani HPCA’07 21 Other Issues OS issues –Context switches (Fast) –Paging (same as data) Multiprocessor implementation –Coherence State information treated same as data –Consistency Key issue: atomicity of state and data –Example: Same instruction accesses new data, old state More details in paper !

Venkataramani HPCA’07 22 Evaluation Platform SESC, Out of Order, 5 GHz. L1 Data cache –16 KB, 2-way, 2-ports, 32B block L1 State cache (split caching) –2KB, 2-way, 2-ports, 32B block L2 cache - 2 MB, 4-way, 1-port, 32B block

Venkataramani HPCA’07 23 Checkers used in Evaluation Heap Checker (Example seen before) –4 states – NonHeap, UnAlloc, Alloc, Init Return Address Checker –Detects return address modifications –3 states – NotRA, GoodRA, BadRA HeapChunks Checker –Detects sequential Heap Buffer overflows –2 states – Delimit, NotDelimit Combined Checker –Combines all the above –7 states,4 (although actually 3) state bits per word –Most demanding; Default in evaluation

Venkataramani HPCA’07 24 Performance of Checkers on SPEC Run time Overhead 2.7%

Venkataramani HPCA’07 25 Sensitivity - Prefetching Run time Overhead

Venkataramani HPCA’07 26 MemTracker vs. other schemes Run time Overhead

Venkataramani HPCA’07 27 Conclusions MemTracker –Monitors and checks memory accesses –Can be programmed to implement different checkers –Low performance overheads 2.7% average and 4.7% worst for combined checker on SPEC –Tested on injected bugs – it finds them! More Details in paper

Venkataramani HPCA’07 28 Thank you! Questions?

Venkataramani HPCA’07 29 BACKUP SLIDES

Venkataramani HPCA’07 30 Sensitivity – State Cache Size Run time Overhead

Venkataramani HPCA’07 31 Caching Configurations on SPEC Run time Overhead