Enforcing deterministic execution of threads of guest operating systems running in a virtual machine hosted on a multiprocessor machine
AssigneeMicrosoft Technology Licensing, LLC
InventorsJonathan R. Howell, Eric Traut, Jacob R. Lorch, John R. Douceur
Life of this patent
Estimating the term…
Abstract
A virtual machine monitor (VMM) is configured to enforce deterministic execution of virtual machines in a multiprocessor machine. The VMM is configured to ensure that any communication by physical processors via shared memory is deterministic. When such VMMs are implemented in a distributed environment of multiprocessor machines coupled via a logical communication link, non-deterministic server applications running on virtual machines using the VMM may be replicated.
Claims17
A method for enforcing deterministic execution of a thread of a guest operating system (OS) running in a virtual machine (VM) by a virtual machine monitor (VMM) on a host computer having two physical processors, the method comprising:
- receiving from the guest OS of the VM, by the VM, a first mapping and associated permissions between a virtual address space of the thread of the guest OS and a virtual address space of the VM;
- installing, by the VM, the first mapping and associated permissions into a virtual memory management unit (MMU) of a virtual processor of the VM;
- determining a second mapping and associated permissions between the virtual address space of the thread of the guest OS and a physical address space of the host computer, the second mapping and associated permissions being indicative of a policy that enforces a deterministic order of execution for a first instruction stream of the guest OS relative to a second instruction stream of the guest OS, the first instruction stream executing on a first physical processor of the two physical processors concurrently with the second instruction stream executing on a second physical processor of the two physical processors;
- installing, by the VMM, a third mapping and associated permissions into a physical MMU of the host computer that establishes memory access permissions generated by the VMM and specific to the physical MMU's associated physical processor, the third mapping and associated permissions being a composition of the first mapping and associated permissions and the second mapping and associated permissions;
- and
- in response to determining that the thread of the guest OS is attempting to read from or write to a memory page of the physical address space in violation of the third mapping and associated permissions, preventing the thread of the guest OS from reading from or writing to the memory page.
A system for enforcing deterministic execution of a thread of a guest operating system (OS) running in a virtual machine (VM) by a virtual machine monitor (VMM), the system comprising:
- a host computer comprising at least two physical processors;
- a physical memory communicatively coupled to the processors when the system is operational, the physical memory bearing processor-executable instructions that, when executed upon the processors, cause the system at least to:
- receive from the guest OS of the VM, by the VM, a first mapping and associated permissions between a virtual address space of the thread of the guest OS and a virtual address space of the VM;
- install, by the VM, the first mapping and associated permissions into a virtual memory management unit (MMU) of a virtual processor of the VM;
- determine a second mapping and associated permissions between the virtual address space of the thread of the guest OS and a physical address space of the host computer, the second mapping or permissions being indicative of a policy that enforces a deterministic order of execution for a first instruction stream of the guest OS relative to a second instruction stream of the guest OS, the first instruction stream executing on a first physical processor of the two physical processors concurrently with the second instruction stream executing on a second physical processors of the two physical processors;
- install, by the VMM, a third mapping and associated permissions into a physical MMU of the host computer establishing memory access permissions generated by the VMM specific to the physical MMU's associated physical processor, the third mapping or permissions comprising a composition of the first mapping and associated permissions and the second mapping and associated permissions;
- and
- in response to determining that the thread of the guest OS is attempting to read from or write to a memory page of the physical address space in violation of the third mapping or permissions, prevent the thread of the guest OS from reading from or writing to the memory page.
A computer-readable storage device, excluding signals per se, for enforcing deterministic execution of a thread of a guest operating system (OS) running in a virtual machine (VM) by a virtual machine monitor (VMM) on a host computer comprising two physical processors, bearing computer-readable instructions that, when executed by a processor, cause the host computer at least to:
- receive from the guest OS of the VM, by the VM, a first mapping and associated permissions between a virtual address space of the thread of the guest OS and a virtual address space of the VM;
- install, by the VM, the first mapping and associated permissions into a virtual memory management unit (MMU) of a virtual processor of the VM;
- determining a second mapping and associated permissions between the virtual address space of the thread of the guest OS and a physical address space of the host computer, the second mapping and associated permissions being indicative of a policy that enforces a deterministic order of execution for a first instruction stream of the guest OS relative to a second instruction stream of the guest OS, the first instruction stream executing on a first physical processor of the two physical processors concurrently with the second instruction stream executing on a second physical processors of the two physical processors;
- install, by the VMM, a third mapping and associated permissions into a physical MMU of the host computer establishing memory access permissions generated by the VMM specific to the physical MMU's associated physical processor, the third mapping and associated permissions comprising a composition of the first mapping and associated permissions and the second mapping and associated permissions;
- and
- prevent the VM from reading from or writing to a memory page of the physical address space, the preventing based at least in part on determining that an attempt by the thread of the guest OS to read from or write to the memory page of the physical address space violates the policy that enforces deterministic execution of the thread of the guest OS on the physical processors.
Dependencies are inferred from the claim text.