IP Library › Granted Patent US 9,772,870
Granted Patent B2
US 9,772,870 · App. 14/608,513 · Granted Sep 26, 2017

Delivering interrupts to virtual machines executing privileged virtual machine functions

Inventors: Michael Tsirkin (Yokneam Yillit, IL); Paolo Bonzini (Turate, IT)
Assignee: Red Hat Israel, Ltd.
G06F9/45558G06F9/4812G06F2009/45575
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 9,772,870
App. No.
14/608,513
Granted
Sep 26, 2017
Kind
B2
Abstract

Systems and methods for delivering certain types of interrupts to virtual machines executing privileged virtual machine functions. An example method may comprise: receiving, by a hypervisor being executed by a processing device of a host computer system, a request to send an interrupt to a virtual central processing unit (vCPU) of a virtual machine; responsive to detecting that the vCPU is executing a virtual machine (VM) function, monitoring the vCPU for completion of the VM function; and responsive to detecting that execution of the VM function is complete, delivering the interrupt to the vCPU.

Claims (41)

1. A method, comprising:

receiving, by a processing device executing a hypervisor of a host computer system, a request to deliver an interrupt to a virtual central processing unit (vCPU) of a virtual machine;

virtualizing the interrupt to generate a virtualized interrupt directed to the vCPU;

refraining from delivering the virtualized interrupt to the vCPU while the vCPU is executing a virtual machine (VM) function;

monitoring the vCPU for completion of the VM function, wherein the VM function represents a privileged operation invoked by the virtual machine without performing a VM exit;

in view of the monitoring of the vCPU for completion of the VM function, modifying a code of the VM function to cause the VM function to exit; and

responsive to detecting that execution of the VM function is complete, delivering the virtualized interrupt to the vCPU.

2. The method of claim 1 , wherein the interrupt is represented by one of: a non-maskable interrupt (NMI), an external interrupt, a processor exception, a software-generated interrupt, a software trap, a system management interrupt, an initialization interrupt, a reset interrupt, or an inter-processor interrupt.

3. The method of claim 1 , wherein detecting that the vCPU is executing a virtual machine (VM) function comprises inspecting an extended page table pointer (EPTP).

4. The method of claim 1 , wherein detecting that the vCPU is executing a virtual machine (VM) function comprises inspecting a memory location accessible by the virtual machine.

5. The method of claim 1 , further comprising:

in view of monitoring of the vCPU for completion of the VM function, modifying a virtual machine control structure (VMCS) associated with the virtual machine to cause the VM function to exit.

6. The method of claim 1 , further comprising:

in view of monitoring of the vCPU for completion of the VM function, modifying a memory accessible by the virtual machine to cause the VM function to exit.

7. The method of claim 1 , further comprising:

in view of monitoring of the vCPU for completion of the VM function, running the VM function by the hypervisor until the VM function completes.

8. The method of claim 1 , further comprising suspending VM function exits responsive to delivering the interrupt.

9. A system comprising:

a memory; and

a processing device, operatively coupled to the memory, to:

receive, by a hypervisor being executed by the processing device, a request to deliver an interrupt to a virtual central processing unit (vCPU) of a virtual machine;

virtualize the interrupt to generate a virtualized interrupt directed to the vCPU;

refrain from delivering the virtualized interrupt to the vCPU while the vCPU is executing a virtual machine (VM) function;

monitor the vCPU for completion of the VM function, wherein the VM function represents a privileged operation invoked by the virtual machine without performing a VM exit;

modify a code of the VM function to cause the VM function to exit; and

responsive to detecting that execution of the VM function is complete, deliver the virtualized interrupt to the vCPU.

10. The system of claim 9 , wherein the interrupt is represented by one of: a non-maskable interrupt (NMI), an external interrupt, a processor exception, a software-generated interrupt, a software trap, a system management interrupt, an initialization interrupt, a reset interrupt, or an inter-processor interrupt.

11. The system of claim 9 , wherein to detect that the vCPU is executing a virtual machine (VM) function the processing device is further to inspect an extended page table pointer (EPTP).

12. The system of claim 9 , wherein to detect that the vCPU is executing a virtual machine (VM) function the processing device is further to inspect a memory location accessible by the virtual machine.

13. The system of claim 9 , wherein the processing device is further to modify a virtual machine control structure (VMCS) associated with the virtual machine to cause the VM function to exit.

14. The system of claim 9 , wherein the processing device is further to modify a code of the VM function to cause the VM function to exit.

15. The system of claim 9 , wherein the processing device is further to run the VM function by the hypervisor until the VM function completes.

16. The system of claim 9 , wherein the processing device is further to suspend VM function exits responsive to delivering the interrupt.

17. A computer-readable non-transitory storage medium comprising executable instructions that, when executed by a processing device, cause the processing device to:

receive, by a hypervisor being executed by the processing device, a request to deliver an interrupt to a virtual central processing unit (vCPU) of a virtual machine;

virtualize the interrupt to generate a virtualized interrupt directed to the vCPU;

refrain from delivering the virtualized interrupt to the vCPU while the vCPU is executing a virtual machine (VM) function;

monitor the vCPU for completion of the VM function, wherein the VM function represents a privileged operation invoked by the virtual machine without performing a VM exit;

modify a code of the VM function to cause the VM function to exit; and

responsive to detecting that execution of the VM function is complete, deliver the virtualized interrupt to the vCPU.

18. The computer-readable non-transitory storage medium of claim 17 , wherein the interrupt is represented by one of: a non-maskable interrupt (NMI), an external interrupt, a processor exception, a software-generated interrupt, a software trap, a system management interrupt, an initialization interrupt, a reset interrupt, or an inter-processor interrupt.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 29, 2015
From: TSIRKIN, MICHAEL; BONZINI, PAOLO
To: RED HAT ISRAEL, LTD.
Reel/Frame 034849/0747 →
Continuity (1)
Related Publication 20160224362A1 · Aug 4, 2016