Emulating level triggered interrupts of physical devices assigned to virtual machine
AssigneeRed Hat, Inc.
InventorAlex Williamson
Life of this patent
Estimating the term…
Abstract
Systems and methods are disclosed for handling a level triggered interrupt generated by a device assigned to a virtual machine running on a host machine. An example system includes a host machine that hosts a virtual machine and a device coupled to the host machine. The device is assigned to the virtual machine and generates one or more interrupts. The example system also includes an interrupt handler that receives an interrupt generated by the device, masks the interrupt, injects the interrupt into the virtual machine, receives an indication that the virtual machine has attempted to access the device, and in response to the indication that the virtual machine has attempted to access the device, unmasks the interrupt from the device.
Claims18
A system for handling a level triggered interrupt generated by a device assigned to a virtual machine running on a host machine, the system comprising:
- a host machine that hosts a virtual machine;
- a device coupled to the host machine, wherein the device is assigned to the virtual machine and generates one or more interrupts;
- an interrupt handler that includes:
- an inject module that receives an interrupt generated by the device and injects the interrupt into the virtual machine;
- a mask module that masks the interrupt, and in response to an indication that the virtual machine has attempted to access the device, unmasks the interrupt from the device;
- and
- an access module that receives the indication that the virtual machine has attempted to access the device;
- and
- a memory including a memory region that is mapped to the device assigned to the virtual machine, wherein the access module traps an access attempt by the virtual machine to the memory region, and the access module receives the indication that the virtual machine has attempted to access the device based on the trapped access attempt.
A method of handling a level triggered interrupt generated by a device assigned to a virtual machine running on a host machine, the method comprising:
- receiving, by one or more processors, an interrupt generated by a device assigned to a virtual machine running on a host machine;
- masking the interrupt;
- injecting the interrupt into the virtual machine;
- receiving an indication that the virtual machine has attempted to access the device;
- in response to receiving the indication that the virtual machine has attempted to access the device, unmasking the interrupt from the device;
- and
- trapping an access attempt by the virtual machine to a memory region that is mapped to the device, wherein the receiving an indication that the virtual machine has attempted to access the device is based on the trapping an access attempt.
A non-transitory machine-readable medium comprising a plurality of machine-readable instructions that when executed by one or more processors are adapted to cause the one or more processors to perform a method comprising:
- receiving a level triggered interrupt generated by a device assigned to a virtual machine running on a host machine;
- masking the interrupt;
- injecting the interrupt into the virtual machine;
- receiving an indication that the virtual machine has attempted to access the device;
- in response to receiving the indication that the virtual machine has attempted to access the device, unmasking the interrupt from the device;
- and
- trapping an access attempt by the virtual machine to a memory region that is mapped to the device, wherein the receiving an indication that the virtual machine has attempted to access the device is based on the trapping an access attempt.
Dependencies are inferred from the claim text.