



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
An introduction to virtual machines, explaining their role in computer systems, key concepts such as virtualization and hypervisors, and the challenges and benefits of using virtual machines. The authors, Lesley Istead and Kevin Lanctot, discuss the history of virtual machines, the role of a CPU, RAM, and other devices, and the concept of a first attempt at virtualization. The document also covers interrupts, privilege, virtual memory, and the use of hypervisors. It explores the differences between Type 1 and Type 2 hypervisors, the concept of privilege rings, and virtual memory management. The document concludes by discussing the benefits of using virtual machines and the role of cloud services like Amazon AWS, Microsoft Azure, and Google Cloud.
What you will learn
Typology: Exercises
1 / 7
This page cannot be seen from the preview
Don't miss anything!
David R. Cheriton School of Computer Science University of Waterloo
Sys/161 is an emulation of a MIPS R sys161.conf is used to configure the virtual hardware
the OS and programs should not be aware of the virtualized hardware and operate normally —without modification, patching, etc.
Virtual machines date back to the 1960s, but performance was typi- cally very poor. They made a resurgence in 2005, when CPUs offered hardware support.
creates execution environments for user programs handles interrupts and exceptions raised by the CPU interrupts are raised by devices requiring attention i.e., a key was pushed, a packet has arrived, a timer has expired, ... exceptions are raised by software i.t., division by zero, illegal instructions, system calls, ... manages memory implements concurrency
”capture” the instructions meant for this virtual CPU translate these instructions into instructions for the real CPU, where they may be executed as a normal program interrupts? privilege? virtual memory?
OS/161 sys/
guest OS virtual machine linux
host OS Intel i9 CPU
physical CPU
VMs run less privileged modes; they cannot disable interrupts, etc. unprivileged instructions may execute normally privileged instructions trap to the hypervisor, where their behaviour is handled the hypervisor may pass these instructions through for execution and emulate the behaviour of others either way, to the VM, interrupts are turned off
unprivileged instructions can be translated and executed as a normal user process the hypervisor will emulate behaviour of privileged instructions and make system calls to the host OS as appropriate
user programs do so in error or maliciously
”rings” of privilege at the CPU; not just privileged vs. unprivileged the hypervisor runs in the highest privileged mode the guest operating system runs in the next highest mode guest user programs run in the lowest privilege mode when execution of a privileged instruction causes a trap to the hypervisor; it can determine the CPU privilege to determine the source
How might a Type 2 hypervisor differentiate between the operating system and the user process making privileged calls?
the guests are unaware of each other each believe they are the ”king of the castle”
but only one could technically use that page
a shadow page table treats the guest physical pages as another level in the table, and will map it to a physical page that will not collide but then every translation must go through the hypervisor, instead of just the MMU
A virtual addresses on a guest VM is called the guest virtual address, the physical address on the VM is called the guest physical address, and the the real physical address is called the host or machine physical address.
the MMU can translate guest virtual addresses to host physical addresses directly the entries in the guest physical tables are pointers to the shadow page tables containing host physical pages the hypervisor should update the MMU’s page table base register on a world swap (when the VM executing changes)
What if the sum of memory allocated to each guest is greater than the amount of physical memory? How can on-demand paging be used to solve this overcommitment issue?