Lecture 19: Survey of Modern VMs. Housekeeping

Similar documents
Lecture 22: Virtual Memory: Survey of Modern Systems

Lecture 19: Survey of Modern VMs + a Decomposition of Meltdown. James C. Hoe Department of ECE Carnegie Mellon University

Lecture 17: Address Translation. James C. Hoe Department of ECE Carnegie Mellon University

EECS 470. Lecture 16 Virtual Memory. Fall 2018 Jon Beaumont

Lecture 17. Fall 2007 Prof. Thomas Wenisch. row enable. _bitline. Lecture 18 Slide 1 EECS 470

Lecture 20: Virtual Memory, Protection and Paging. Multi-Level Caches

Learning Outcomes. An understanding of page-based virtual memory in depth. Including the R3000 s support for virtual memory.

Learning Outcomes. An understanding of page-based virtual memory in depth. Including the R3000 s support for virtual memory.

18-447: Computer Architecture Lecture 18: Virtual Memory III. Yoongu Kim Carnegie Mellon University Spring 2013, 3/1

Virtual Memory: From Address Translation to Demand Paging

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. November 15, MIT Fall 2018 L20-1

Virtual Memory. Daniel Sanchez Computer Science & Artificial Intelligence Lab M.I.T. April 12, 2018 L16-1

CS162 - Operating Systems and Systems Programming. Address Translation => Paging"

Learning Outcomes. Page Tables Revisited. Two-level Translation. R3000 TLB Refill. Virtual Linear Array page table

CS 318 Principles of Operating Systems

CS 152 Computer Architecture and Engineering. Lecture 11 - Virtual Memory and Caches

A Typical Memory Hierarchy

A Typical Memory Hierarchy

Address Translation. Jinkyu Jeong Computer Systems Laboratory Sungkyunkwan University

CSE 120 Principles of Operating Systems Spring 2017

Virtual Memory: From Address Translation to Demand Paging

Lecture 9 - Virtual Memory

Recap: Set Associative Cache. N-way set associative: N entries for each Cache Index N direct mapped caches operates in parallel

Computer Architecture Lecture 13: Virtual Memory II

CSE 120 Principles of Operating Systems

CS252 Spring 2017 Graduate Computer Architecture. Lecture 17: Virtual Memory and Caches

CS 61C: Great Ideas in Computer Architecture. Lecture 23: Virtual Memory

Multi-level Translation. CS 537 Lecture 9 Paging. Example two-level page table. Multi-level Translation Analysis

Memory Hierarchy Requirements. Three Advantages of Virtual Memory

HY225 Lecture 12: DRAM and Virtual Memory

This training session will cover the Translation Look aside Buffer or TLB

CS 153 Design of Operating Systems Winter 2016

Carnegie Mellon. Bryant and O Hallaron, Computer Systems: A Programmer s Perspective, Third Edition

Another View of the Memory Hierarchy. Lecture #25 Virtual Memory I Memory Hierarchy Requirements. Memory Hierarchy Requirements

CPS104 Computer Organization and Programming Lecture 16: Virtual Memory. Robert Wagner

Virtual Memory. CS61, Lecture 15. Prof. Stephen Chong October 20, 2011

Lecture 11: Interrupt and Exception. James C. Hoe Department of ECE Carnegie Mellon University

Processes and Virtual Memory Concepts

CPS 104 Computer Organization and Programming Lecture 20: Virtual Memory

CS5460: Operating Systems Lecture 14: Memory Management (Chapter 8)

CSE 351. Virtual Memory

CS 61C: Great Ideas in Computer Architecture. Lecture 23: Virtual Memory. Bernhard Boser & Randy Katz

Virtual Memory. Virtual Memory

VIRTUAL MEMORY II. Jo, Heeseung

Virtual Memory. Today. Handling bigger address spaces Speeding translation

CS 152 Computer Architecture and Engineering. Lecture 9 - Address Translation

Topics: Memory Management (SGG, Chapter 08) 8.1, 8.2, 8.3, 8.5, 8.6 CS 3733 Operating Systems

Computer Architecture and Engineering. CS152 Quiz #3. March 18th, Professor Krste Asanovic. Name:

CS 152 Computer Architecture and Engineering. Lecture 9 - Virtual Memory

Opera&ng Systems ECE344

Virtual Memory Virtual memory first used to relive programmers from the burden of managing overlays.

Virtual Memory. Patterson & Hennessey Chapter 5 ELEC 5200/6200 1

Virtual Memory 2. Today. Handling bigger address spaces Speeding translation

ECE232: Hardware Organization and Design

CS 61C: Great Ideas in Computer Architecture Virtual Memory. Instructors: John Wawrzynek & Vladimir Stojanovic

Virtual Memory 2. To do. q Handling bigger address spaces q Speeding translation

Chapter 8 Memory Management

ECE 571 Advanced Microprocessor-Based Design Lecture 12

Virtual Memory. Computer Systems Principles

Virtual Memory. Stefanos Kaxiras. Credits: Some material and/or diagrams adapted from Hennessy & Patterson, Hill, online sources.

Motivation, Concept, Paging January Winter Term 2008/09 Gerd Liefländer Universität Karlsruhe (TH), System Architecture Group

CSE 451: Operating Systems Winter Page Table Management, TLBs and Other Pragmatics. Gary Kimura

Virtual Memory. CS 3410 Computer System Organization & Programming

Virtual Memory. Study Chapters something I understand. Finally! A lecture on PAGE FAULTS! doing NAND gates. I wish we were still

Computer Systems. Virtual Memory. Han, Hwansoo

Virtual Memory. Samira Khan Apr 27, 2017

Agenda. CS 61C: Great Ideas in Computer Architecture. Virtual Memory II. Goals of Virtual Memory. Memory Hierarchy Requirements

Modern Virtual Memory Systems. Modern Virtual Memory Systems

CSE 153 Design of Operating Systems

Fast access ===> use map to find object. HW == SW ===> map is in HW or SW or combo. Extend range ===> longer, hierarchical names

5DV118 Computer Organization and Architecture Umeå University Department of Computing Science Stephen J. Hegner

Virtual Memory. CS 351: Systems Programming Michael Saelee

CSE 560 Computer Systems Architecture

Lecture 9 Virtual Memory

Memory Hierarchy. Mehran Rezaei

Operating Systems. Paging... Memory Management 2 Overview. Lecture 6 Memory management 2. Paging (contd.)

CS 537 Lecture 6 Fast Translation - TLBs

Virtual Memory. Motivations for VM Address translation Accelerating translation with TLBs

CS 152 Computer Architecture and Engineering. Lecture 8 - Address Translation

CS 152 Computer Architecture and Engineering. Lecture 9 - Address Translation

Computer Science 146. Computer Architecture

John Wawrzynek & Nick Weaver

Translation Buffers (TLB s)

virtual memory Page 1 CSE 361S Disk Disk

Virtual memory - Paging

The process. one problem

UC Berkeley CS61C : Machine Structures

ECE 598 Advanced Operating Systems Lecture 14

Lecture 15: Virtual Memory

CS 152 Computer Architecture and Engineering. Lecture 8 - Address Translation

Virtual Memory. CS 3410 Computer System Organization & Programming. [K. Bala, A. Bracy, E. Sirer, and H. Weatherspoon]

Virtual Memory. Motivation:

EITF20: Computer Architecture Part 5.1.1: Virtual Memory

Virtual Memory, Address Translation

Lecture 16: Cache in Context (Uniprocessor) James C. Hoe Department of ECE Carnegie Mellon University

CS 61C: Great Ideas in Computer Architecture. Virtual Memory

Memory Management. Disclaimer: some slides are adopted from book authors slides with permission 1

18-447: Computer Architecture Lecture 16: Virtual Memory

Virtual Memory Oct. 29, 2002

Virtual Memory: Concepts

Transcription:

S 17 L19 1 18 447 Lecture 19: Survey of Modern VMs James C. Hoe Department of ECE Carnegie Mellon University Housekeeping S 17 L19 2 Your goal today see the many realizations of VM, focusing on deviation from textbook conceptual norms based on: B. Jacob and T. Mudge, Virtual Memory in Contemporary Processors, IEEE Micro, vol. 18, no. 4, 1998 Notices Midterm 2 on Monday 4/10 (cover L11~19) Lab 4, status check next week HW 4, due on Wednesday Readings should have read Jacob and Mudge for today start reading P&H Ch 6

EA, VA and PA (IBM Power view) S 17 L19 3 EA 0 divided into X fixedsize segments PA divided into W pages (Z>>W) EA 1 divided into X fixedsize segments segmented EA: private, contiguous + sharing VA divided into Y segments (Y>>X); also divided as Z pages (Z>>Y) Swap disk divided into V pages (Z>>V, V>>W) demand paged VA: size of swap, speed of DRAM EA, VA and PA (almost everyone else) S 17 L19 4 EA 0 with unique ASID=0 PA divided into W pages (Z>>W) EA i with unique ASID=i Swap disk divided into V pages (Z>>V, V>>W) EA and VA almost synonymous VA divided into N address space indexed by ASID; also divided as Z pages (Z>>Y) how do processes share pages?

SPARC V9 PTE/TLB Entry 64 bit Virtual Address an implementation can choose not to map the highorder bits (must be sign extended from the highest mapped bit) e.g., UltraSPARC 1 maps only the lower 44 bits physical address space size set by implementation 64 entry fully associative I TLB and D TLB S 17 L19 5 g context 13 VA<63:13> 51 Tag 64 v size nfo IE Soft diag PA<40:13> Soft L CP CV e p w g Data 64 context TLB Miss Handling SPARC V8 (32 bit) defines a 3 level hierarchical page table for HW MMU page table walk context table descriptors +VA [31:24] L1 Table: L2 Table: 256 +VA [23:18] 64 +VA [17:12] descriptors (1024 byte) descriptors (256 byte) SPARC V9 (64 bit) defines Translation Storage Buffer a software managed, direct mapped cache of PTEs Think hashed page table HW assisted address generation on a TLB miss, e.g., for 8 k pages {TSBbase63:21, Logic(TSBbase20:13,VA32:22,size,split?), VA21:13,0000} TLB miss handler (SW) searches TSB. If TSB misses, a slower TSB miss handler takes over S 17 L19 6 L3 Table: 64 PTEs (256 byte)

IBM PowerPC (32 bit) segments 256MB regions S 17 L19 7 seg# 4 seg offset 16 page offset 12 EA 32 16 entry segment table Protection seg ID 24 seg offset 16 page offset 12 VA 52 128 2 way ITLB and DTLB VM+paging PPN 20 page offset 12 PA 32 64 bit PowerPC = 64 bit EA > 80 bit VA 64 bit PA How many segments in EA? IBM PowerPC Hashed Page Table S 17 L19 8 VPN 40 Hash Function table base + Hashed Page Table 8 PTE s per group recommend at least N PTEG s for a system with 2N physical pages HW table walk VPN hashes into a PTE group (PTEG) of 8 8 PTEs searched sequentially for tag match if not found in first PTE group search a second PTE group if not found in 2 nd PTE group, trap to software handler Hashed table structure also used for EA to VA mapping in 64 bit implementations

MIPS R10K 64 bit virtual address top 2 bits set kernel/supervisor/user mode additional bits set cache and translation behavior bit 61 40 not translate at all (holes in the VA??) 8 bit ASID (address space ID) distinguishes between processes 40 bit physical address Translation 64 bit VA and 8 bit ASID 40 bit PA 1 GB mapped (kseg) 0.5 GB unmapped uncached 0.5 GB unmapped cached Bottom 2 GB Mapped (normal) S 17 L19 9 simplified example from 32 bit VA in R2000/3000 MIPS TLB 64 entry fully associative unified TLB paired: each entry maps 2 consecutive VPNs to 2 different PPNs software managed 7 instruction page table walk in the best case TLB Write Random: chooses a random entry for TLB replacement OS can exclude some number of TLB entry (low range) to be excluded from the random selection, to hold translations that cannot miss or should not miss VPN 20 ASID 6 0 6 TLB entry R2000 PPN 20 ndvg 0 8 N: noncacheable D: dirty (actually a write enable bit) V: valid G: global entry, i.e., ignore ASID matching S 17 L19 10

S 17 L19 11 MIPS Bottom Up Hierarchical Table TLB miss vectors to a SW handler page table organization is not hardcoded in ISA ISA only defines HW features to speedup a certain reference page table scheme Bottom Up Table start with a basic 2 level hierarchical table (32 bit case) map all of the L2 tables (empty or not) linearly in the mapped kseg VPN is the index into this linear table in VA A linear translation table that scales with VA size Is this okay? Bottom Up Table Walk S 17 L19 12 PTEBase VPN VPN mem load 0s PO VA on TLB Miss, trap which address VA of PTE space? (generated automatically by HW after TLB miss) PPN status PTE loaded from mem Can this load miss in the TLB? What happens if it misses? Notice translation also eats up TLB entries!

User TLB Miss Handling S 17 L19 13 mfc0 k0,tlbcxt mfc0 k1,epc lw k0,0(k0) mtc0 k0,entry_lo tlbwr j k1 rfe # move the contents of TLB # context register into k0 # move PC of faulting load # instruction into k1 # load thru address that was # in TLB context register # move the loaded value # into the EntryLo register # write entry into the TLB # at a random slot number # jump to PC of faulting # load instruction to retry # RESTORE FROM # EXCEPTION HP PA RISC: PID and AID S 17 L19 14 2 level translation: 64bit EA 96bit VA (global) 64bit PA Variable sized segmented EA to VA A different take on protection everyone else: limit what can be named by a process in PowerPC, OS controls what VA can be reached by a process by controlling what s in the segment registers HP RISC: rights based access control user controls segment registers, i.e., user can generate any VA it wants each virtual page has an access ID (not related to ownership by a processes) assigned by the OS each process has 8 active protection IDs in special HW registers controlled by the OS aprocess can only access a page if it has the key (PID) that fits the lock (AID)

Intel 80386 S 17 L19 15 Intended for two level address translation with segments for naming and protection (similar to PPC) user private 48 bit effective address 16 bit segment number (implicit) + 32 bit segment offset each addr register has a corresponding segment register a global 32 bit virtual address 20 bit page number + 12 bit page offset an implementation defined paged physical address space What is strange about this? 32 bit VA too small to be shared by multiple processes OS did not use segmentation for protection code, data, stack segments always mapped to 0~(2 32 1) time multiplex VA between processes for naming and protection set MMU to use a different table on context switch must flush TLB on context switch because TLB entries are not defined to have ASIDs Later IA32e added PCID as fix Format of the Quiz S 17 L19 16 Coverage lectures (L11~L19), HWs, projects, assigned readings (textbooks and papers) Types of questions freebies: can you remember the materials probing: did you understand the materials applied: can you apply the materials in original thoughts 100 minutes, 100 points if a question is worth 5 points, don t spend 20 minutes on it skip questions you can t do and come back to them later closed book, one 2 sided 8½x11 in 2 hand written cribsheet no calculators, no cell phone call, no electronics *** Use pencil or black/blue ink only *** Be on time, 12:30 sharp!!!