IP Library › Granted Patent US 11,726,807
Granted Patent B2
US 11,726,807 · App. 15/588,392 · Granted Aug 15, 2023

Safe execution of virtual machine callbacks in a hypervisor

Inventors: Nadav Amit (Mountain View, CA); Michael Wei (Palo Alto, CA); Cheng Chun Tu (Redwood City, CA)
Assignee: VMware, Inc.
G06F9/45558G06F21/53G06F21/60G06F2009/45587
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 11,726,807
App. No.
15/588,392
Granted
Aug 15, 2023
Kind
B2
Abstract

A hypervisor communicates with a guest operating system running in a virtual machine supported by the hypervisor using a hyper-callback whose functions are based on the particular guest operating system running the virtual machine and are triggered by one or more events in the guest operating system. The functions are modified to make sure they are safe to execute and to allow only limited access to the guest operating system. Additionally, the functions are converted to byte code corresponding to a simplified CPU and memory model and are safety checked by the hypervisor when registered with the hypervisor. The functions are executed by the hypervisor without any context switch between the hypervisor and guest operating system, and when executed, provide information about the particular guest operating system, allowing the hypervisor to improve operations such as page reclamation, virtual CPU scheduling, I/O operations, and tracing of the guest operating system.

Claims (38)

1. In a system having one or more processors and a memory coupled to the one or more processors and containing a hypervisor that supports a virtual machine running a guest operating system, a method for communicating information specific to the guest operating system to the hypervisor, said method comprising:

upon an occurrence of a specified event,

obtaining, by the hypervisor, callback byte code that has been registered by the guest operating system with the hypervisor for the specified event;

assembling, by the hypervisor, the callback byte code into executable code that runs on the one or more processors; and

executing, by the hypervisor, the assembled callback executable code to obtain information regarding the guest operating system running in the virtual machine; and

in response to executing the assembled callback executable code, obtaining, by the hypervisor, the information regarding the guest operating system running in the virtual machine.

2. The method according to claim 1 , wherein the callback byte code is based on a simplified CPU and memory architecture.

3. The method according to claim 1 , wherein the callback byte code is derived and prepared from one or more functions of the guest operating system.

4. The method according to claim 3 , wherein preparation of the callback byte code includes unrolling loops and removing branches in the one or more functions.

5. The method according to claim 1 , wherein the callback byte code is registered with the hypervisor prior to the occurrence of the specified event, and the assembled callback executable code is executed without a context switch responsive to the occurrence of the specified event.

6. The method according to claim 1 , wherein the callback byte code is prepared so as to permit the hypervisor to access only a range of addresses in the guest operating system.

7. The method according to claim 6 , wherein the range of addresses is registered with the hypervisor prior to the occurrence of the specified event.

8. The method according to claim 7 , wherein the range of addresses registered with the hypervisor is registered as guest virtual addresses.

9. The method according to claim 7 , wherein the range of addresses registered with the hypervisor is registered as guest physical addresses.

10. The method according to claim 1 , wherein the hypervisor is further configured to check for valid inputs in the assembled callback executable code.

11. The method according to claim 1 , wherein the hypervisor is further configured to hook in hypervisor functions to the assembled callback executable code.

12. The method according to claim 1 , wherein the callback byte code has been safety checked by the hypervisor to ensure that the callback byte code complies with one or more safety properties.

13. A non-transitory computer-readable medium comprising computer program code executable in a system having one or more processors and a memory coupled to the one or more processors and containing a hypervisor that supports a virtual machine running a guest operating system, wherein the computer program code when executed carries out a method for communicating information specific to the guest operating system to the hypervisor, said method comprising:

upon an occurrence of a specified event,

obtaining, by the hypervisor, callback byte code that has been registered by the guest operating system with the hypervisor for the specified event;

assembling, by the hypervisor, the callback byte code into executable code that runs on the one or more processors; and

executing, by the hypervisor, the assembled callback executable code to obtain information regarding the guest operating system running in the virtual machine; and

in response to executing the assembled callback executable code, obtaining, by the hypervisor, the information regarding the guest operating system running in the virtual machine.

14. The non-transitory computer-readable medium according to claim 13 , wherein the callback byte code is a based on a simplified CPU and memory architecture.

15. The non-transitory computer-readable medium according to claim 13 , wherein the callback byte code is prepared from one or more functions of the guest operating system.

16. The non-transitory computer-readable medium according to claim 13 , wherein the callback byte code is registered with the hypervisor prior to the occurrence of the specified event, and the assembled callback executable code is executed without a context switch responsive to the occurrence of the specified event.

17. The non-transitory computer-readable medium according to claim 13 , wherein the callback byte code is prepared so as to permit the hypervisor to access only a range of addresses in the guest operating system.

18. The non-transitory computer-readable medium according to claim 13 , wherein the hypervisor is further configured to check for valid inputs in the assembled callback executable code.

19. The non-transitory computer-readable medium according to claim 13 , wherein the hypervisor is further configured to hook in hypervisor functions to the assembled callback executable code.

20. A system comprising:

one or more processors; and

a memory coupled to the one or more processors and containing a hypervisor that supports a virtual machine running a guest operating system, wherein the hypervisor is configured to perform a method, the method comprising:

upon an occurrence of a specified event,

obtaining, by the hypervisor, callback byte code that has been registered by the guest operating system with the hypervisor for the specified event;

assembling, by the hypervisor, the callback byte code into executable code that runs on the one or more processors; and

executing, by the hypervisor, the assembled callback executable code to obtain information regarding the guest operating system running in the virtual machine; and

in response to executing the assembled callback executable code, obtaining, by the hypervisor, the information regarding the guest operating system running in the virtual machine.

21. The system according to claim 20 , wherein the callback byte code is prepared from one or more functions of the guest operating system and is registered with the hypervisor prior to the occurrence of the event.

Assignments (2)
CHANGE OF NAME Recorded Apr 15, 2024
From: VMWARE, INC.
To: VMWARE LLC
Reel/Frame 067102/0395 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 5, 2017
From: AMIT, NADAV; WEI, MICHAEL; TU, CHENG CHUN
To: VMWARE, INC.
Reel/Frame 042261/0044 →
Continuity (1)
Related Publication 20180321963A1 · Nov 8, 2018
Cited By (1)
US 12,657,048