Lecture: virtual memory Q&A
Single-level paging
- x86 (32-bit): 4M single-level paging
- turn on the
PSE
bit on CR4
- add the
PS
bit to page entries
- VA → PA translation
- linear address
- bits 31-22: page directory index
- bits 21-0: offset into 4M page
- page directory entry
- bits 31-22: physical 4M page address
- bits 21-12: reserved
- bits 11-0: flags
- example
- xv6: used during booting - see
entrypgdir
in main.c
- demo: turn your JOS into using 4M pages
- general concept: superpages (also known as huge pages or large pages)
Four-level paging
- x86_64: 4K four-level paging
- pros & cons
- overhead, performance (what kind of user-space workloads?)
- demo