IP Library Granted Patent US 11,042,495
Granted Patent B2
US 11,042,495 · App. 16/578,165 · Granted Jun 22, 2021

Providing interrupts from an input-output memory management unit to guest operating systems

Inventors: Maggie Chan (Toronto, CA); Philip Ng (Toronto, CA); Paul Blinzer (Bellevue, WA)
Assignees: ADVANCED MICRO DEVICES, INC.; ATI TECHNOLOGIES ULC
G06F13/24G06F9/45558G06F13/1668G06F2009/45579
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,042,495
App. No.
16/578,165
Granted
Jun 22, 2021
Kind
B2
Abstract

An electronic device includes a processor that executes a guest operating system; a memory having a guest portion that is reserved for storing data and information to be accessed by the guest operating system; and an input-output memory management unit (IOMMU). The IOMMU performs operations for signaling an interrupt to the guest operating system. For these operations, the IOMMU acquires, from an entry in an interrupt remapping table associated with the guest operating system, a location in a virtual advanced programmable interrupt controller (APIC) backing page for the guest operating system in the guest portion of the memory. The IOMMU then writes information about the interrupt to the location in the virtual APIC backing page. The IOMMU next communicates an indication of the interrupt to the guest operating system.

Claims (83)

1. An electronic device, comprising:

a processor that executes a guest operating system;

a memory, the memory having a guest portion that is reserved for storing data and information to be accessed by the guest operating system; and

an input-output memory management unit (IOMMU) configured to:

signal an interrupt to the guest operating system by:

acquiring, from an entry in an interrupt remapping table associated with the guest operating system, a location in a virtual advanced programmable interrupt controller (APIC) backing page for the guest operating system in the guest portion of the memory;

writing information about the interrupt to the location in the virtual APIC backing page; and

communicating an indication of the interrupt to the guest operating system.

2. The electronic device of claim 1 , wherein, when acquiring the location in the virtual APIC backing page from the entry in the interrupt remapping table, the IOMMU is configured to:

acquire, from a device table entry associated with the IOMMU, a base address of the interrupt remapping table;

use the base address and a guest operating system identifier (ID) to determine the entry in the interrupt remapping table; and

retrieve, from the entry in the interrupt remapping table, an address of the location in the virtual APIC backing page.

3. The electronic device of claim 2 , wherein:

the virtual APIC backing page in the guest portion of the memory includes a plurality of locations, each location among the plurality of locations associated with a different type of interrupt, and the interrupt remapping table includes a separate entry for storing an indicator of each of the plurality of locations; and

when acquiring the location in the virtual APIC backing page from the interrupt remapping table entry, the IOMMU is configured to:

use a type of the interrupt along with the base address and the guest operating system ID to determine the entry in the interrupt remapping table.

4. The electronic device of claim 2 , wherein:

the interrupt remapping table includes a hierarchy of at least two sub-tables, each sub-table other than a final sub-table in the hierarchy of sub-tables including an identifier for a next sub-table in the hierarchy, and the final sub-table including the address of the location in the virtual APIC backing page; and

when using the base address and a guest operating system ID to determine the entry in the interrupt remapping table, the IOMMU is configured to use corresponding portions of the base address and/or the guest operating system ID to proceed through the hierarchy of sub-tables to the final sub-table.

5. The electronic device of claim 1 , wherein the IOMMU is further configured to:

determine whether the interrupt is permitted to be communicated directly from the IOMMU to the guest operating system; and

when the interrupt is permitted to be communicated directly, signaling the interrupt to the guest operating system; and

when the interrupt is not permitted to be communicated directly, using one or more intermediary interrupt communication mechanisms for indirectly signaling the interrupt to the guest operating system.

6. The electronic device of claim 5 , wherein, when determining whether the interrupt is permitted to be communicated directly, the IOMMU is configured to:

check one or more settings in a device table entry associated with the IOMMU to determine whether:

IOMMU communication of interrupts is enabled; and/or

the guest operating system is configured to receive interrupts from the IOMMU.

7. The electronic device of claim 5 , wherein the one or more intermediary interrupt communication mechanisms include a guest interrupt log and the IOMMU is further configured to:

store information about the interrupt in the guest interrupt log;

wherein a hypervisor executed by the processor detects or is informed of the IOMMU's storage of the information about the interrupt in the guest interrupt log and indicates the interrupt to the guest operating system.

8. The electronic device of claim 1 , wherein the processor executes a hypervisor that initializes and maintains the interrupt remapping table by storing, in corresponding entries in the interrupt remapping table, identifiers for locations in virtual APIC backing pages for guest operating systems in respective guest portions of the memory.

9. The electronic device of claim 1 , wherein communicating the indication of the interrupt to the guest operating system comprises:

when the guest operating system is presently active:

sending an interrupt to the processor.

10. The electronic device of claim 1 , wherein communicating the indication of the interrupt to the guest operating system comprises:

when the guest operating system is not presently active:

adding an entry to a guest virtual APIC log; and

sending an indication of the addition of the entry to the guest virtual APIC log to the processor.

11. The electronic device of claim 1 , wherein, based on receiving the indication of the interrupt on behalf of the guest operating system, the processor is configured to process the interrupt for the guest operating system by:

acquiring the information about the interrupt from the location in the virtual APIC backing page; and

using the information about the interrupt to process or handle the interrupt.

12. The electronic device of claim 1 , wherein the interrupt is an IOMMU-sourced interrupt.

13. A method for signaling interrupts in an electronic device that comprises a processor that executes a guest operating system; a memory having a guest portion that is reserved for storing data and information to be accessed by the guest operating system; and an input-output memory management unit (IOMMU), the method comprising:

signaling, by the IOMMU, an interrupt to the guest operating system by:

acquiring, by the IOMMU, from an entry in an interrupt remapping table associated with the guest operating system, a location in a virtual advanced programmable interrupt controller (APIC) backing page for the guest operating system in the guest portion of the memory;

writing, by the IOMMU, information about the interrupt to the location in the virtual APIC backing page; and

communicating, by the IOMMU, an indication of the interrupt to the guest operating system.

14. The method of claim 13 , wherein acquiring the location in the virtual APIC backing page from the entry in the interrupt remapping table comprises:

acquiring, by the IOMMU, from a device table entry associated with the IOMMU, a base address of the interrupt remapping table;

using, by the IOMMU, the base address and a guest operating system identifier (ID) to determine the entry in the interrupt remapping table; and

retrieving, by the IOMMU, from the entry in the interrupt remapping table, an address of the location in the virtual APIC backing page.

15. The method of claim 14 , wherein:

the virtual APIC backing page in the guest portion of the memory includes a plurality of locations, each location among the plurality of locations associated with a different type of interrupt, and the interrupt remapping table includes a separate entry for storing an indicator of each of the plurality of locations; and

acquiring the location in the virtual APIC backing page from the interrupt remapping table entry comprises:

using, by the IOMMU, a type of the interrupt along with the base address and the guest operating system ID to determine the entry in the interrupt remapping table.

16. The method of claim 14 , wherein:

the interrupt remapping table includes a hierarchy of at least two sub-tables, each sub-table other than a final sub-table in the hierarchy of sub-tables including an identifier for a next sub-table in the hierarchy, and the final sub-table including the address of the location in the virtual APIC backing page; and

using the base address and a guest operating system ID to determine the entry in the interrupt remapping table comprises:

using, by the IOMMU, corresponding portions of the base address and/or the guest operating system ID to proceed through the hierarchy of sub-tables to the final sub-table.

17. The method of claim 13 , further comprising:

determining, by the IOMMU, whether the interrupt is permitted to be communicated directly from the IOMMU to the guest operating system; and

when the interrupt is permitted to be communicated directly, signaling, by the IOMMU, the interrupt to the guest operating system; and

when the interrupt is not permitted to be communicated directly, using one or more intermediary interrupt communication mechanisms for indirectly signaling, by the IOMMU, the interrupt to the guest operating system.

18. The method of claim 17 , wherein determining whether the interrupt is permitted to be communicated directly comprises:

checking, by the IOMMU, one or more settings in a device table entry associated with the IOMMU to determine whether:

IOMMU communication of interrupts is enabled; and/or

the guest operating system is configured to receive interrupts from the IOMMU.

19. The method of claim 17 , wherein the one or more intermediary interrupt communication mechanisms include a guest interrupt log and the method further comprises:

storing, by the IOMMU, information about the interrupt in the guest interrupt log;

wherein a hypervisor executed by the processor detects or is informed of the IOMMU's storage of the information about the interrupt in the guest interrupt log and indicates the interrupt to the guest operating system.

20. The method of claim 13 , wherein the processor executes a hypervisor and the method further comprises:

initializing and maintaining, by the hypervisor, the interrupt remapping table by storing, in corresponding entries in the interrupt remapping table, identifiers for locations in virtual APIC backing pages for guest operating systems in respective guest portions of the memory.

21. The method of claim 13 , wherein communicating the indication of the interrupt to the guest operating system comprises:

when the guest operating system is presently active:

sending, by the IOMMU, an interrupt to the processor.

22. The method of claim 13 , wherein communicating the indication of the interrupt to the guest operating system comprises:

when the guest operating system is not presently active:

adding, by the IOMMU, an entry to a guest virtual APIC log; and

sending, by the IOMMU, an indication of the addition of the entry to the guest virtual APIC log to the processor.

23. The method of claim 13 , wherein, based on receiving the indication of the interrupt on behalf of the guest operating system, the processor is configured to process the interrupt for the guest operating system by:

acquiring the information about the interrupt from the location in the virtual APIC backing page; and

using the information about the interrupt to process or handle the interrupt.

24. The method of claim 13 , wherein the interrupt is an IOMMU-sourced interrupt.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 20, 2019
From: BLINZER, PAUL
To: ADVANCED MICRO DEVICES, INC.
Reel/Frame 050449/0907 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 20, 2019
From: CHAN, MAGGIE; NG, PHILIP
To: ATI TECHNOLOGIES ULC
Reel/Frame 050449/0927 →
Continuity (1)
Related Publication 20210089480A1 · Mar 25, 2021
Cited By (2)
US 12,455,755 US 12,572,377