IP Library Granted Patent US 9,690,495
Granted Patent B2
US 9,690,495 · App. 14/931,612 · Granted Jun 27, 2017

Emulating memory mapped I/O for coherent accelerators in error state

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,690,495
App. No.
14/931,612
Granted
Jun 27, 2017
Kind
B2
Abstract

Embodiments disclose techniques for emulating memory mapped I/O (MMIO) for coherent accelerators in an error state. In one embodiment, once an operating system determines that a processor is unable to access a coherent accelerator via a MMIO operation, the operating system deletes one or more page table entries associated with MMIO of one or more hardware contexts of the coherent accelerator. After deleting the page table entries, the operating system can detect a page fault associated with execution of a process by the processor. Upon determining that the page fault was caused by the process attempting to access one of the deleted page table entries while executing a MMIO operation, the operating system emulates the execution of the MMIO operation for the faulting process, giving the process the illusion that its requested MMIO operation was successful.

Claims (47)

1. A method for emulating a memory mapped I/O (MMIO) operation for a coherent accelerator, the method comprising:

upon determining that a processor is unable to access the coherent accelerator via a MMIO operation, deleting one or more page table entries associated with MMIO of one or more hardware contexts of the coherent accelerator;

detecting a page fault associated with execution of a process by the processor after deleting the page table entries; and

upon determining that the page fault was caused by the process attempting to access one of the deleted page table entries while executing a MMIO operation, emulating the execution of the MMIO operation for the faulting process.

2. The method of claim 1 , further comprising, upon detecting the page fault, receiving information that specifies at least one of an effective address that triggered the page fault, and a program counter for the faulting process.

3. The method of claim 2 , wherein determining that the page fault was caused by the process attempting to access one of the deleted page table entries comprises identifying that the effective address belongs to a range of addresses used for MMIO between the processor and the coherent accelerator.

4. The method of claim 2 , wherein emulating execution of the MMIO operation comprises:

locating an instruction for the MMIO operation based on the program counter; and

parsing a bit pattern for the instruction to determine one or more characteristics of the MMIO operation, wherein the one or more characteristics indicate at least one of a type of MMIO instruction, a source memory location, and a destination memory location.

5. The method of claim 4 , further comprising:

upon determining that the instruction is for a MMIO read operation to the coherent accelerator, returning an outcome of the emulated execution to the faulting process, wherein the outcome comprises invalid data, and incrementing the program counter to a subsequent instruction.

6. The method of claim 4 , further comprising:

upon determining that the instruction is for a MMIO write operation to the coherent accelerator, ignoring the instruction and incrementing the program counter to a subsequent instruction.

7. The method of claim 5 , wherein a value of the invalid data is negative one, and wherein the invalid data indicates to the faulting process that the coherent accelerator is inaccessible, via MMIO, from the processor.

8. The method of claim 7 , wherein the process ceases requests to perform MMIO operations to the coherent accelerator upon indication of the invalid data.

9. A system, comprising:

a processor;

a coherent accelerator; and

a memory storing program code, which, when executed on the processor, performs an operation comprising:

upon determining that the processor is unable to access the coherent accelerator via a MMIO operation, deleting one or more page table entries associated with MMIO of one or more hardware contexts of the coherent accelerator;

detecting a page fault associated with execution of a process by the processor after deleting the page table entries; and

upon determining that the page fault was caused by the process attempting to access one of the deleted page table entries while executing a MMIO operation, emulating the execution of the MMIO operation for the faulting process.

10. The system of claim 9 , wherein the operation further comprises:

upon detecting the page fault, receiving information that specifies at least one of an effective address that triggered the page fault, and a program counter for the faulting process.

11. The system of claim 10 , wherein determining that the page fault was caused by the process attempting to access one of the deleted page table entries comprises identifying that the effective address belongs to a range of addresses used for MMIO between the processor and the coherent accelerator.

12. The system of claim 10 , wherein emulating execution of the MMIO operation comprises:

locating an instruction for the MMIO operation based on the program counter; and

parsing a bit pattern for the instruction to determine one or more characteristics of the MMIO operation, wherein the one or more characteristics indicate at least one of a type of MMIO instruction, a source memory location, and a destination memory location.

13. The system of claim 12 , wherein the operation further comprises:

upon determining that the instruction is for a MMIO read operation to the coherent accelerator, returning an outcome of the emulated execution to the faulting process, wherein the outcome comprises invalid data, and incrementing the program counter to a subsequent instruction.

14. The system of claim 12 , wherein the operation further comprises:

upon determining that the instruction is for a MMIO write operation to the coherent accelerator, ignoring the instruction and incrementing the program counter to a subsequent instruction.

15. The system of claim 13 , wherein a value of the invalid data is negative one, wherein the invalid data indicates to the faulting process that the coherent accelerator is inaccessible, via MMIO, from the processor, and wherein the faulting process ceases requests to perform MMIO operations to the coherent accelerator upon indication of the invalid data.

16. A computer program product, comprising:

a non-transitory computer-readable storage medium having computer-readable program code embodied therewith, the computer-readable program code executable by one or more computer processors to perform an operation comprising:

upon determining that a processor is unable to access a coherent accelerator via a MMIO operation, deleting one or more page table entries associated with MMIO of one or more hardware contexts of the coherent accelerator;

detecting a page fault associated with execution of a process by the processor after deleting the page table entries; and

upon determining that the page fault was caused by the process attempting to access one of the deleted page table entries while executing a MMIO operation, emulating the execution of the MMIO operation for the faulting process.

17. The computer program product of claim 16 , wherein the operation further comprises:

upon detecting the page fault, receiving information that specifies at least one of an effective address that triggered the page fault, and a program counter for the faulting process.

18. The computer program product of claim 17 , wherein determining that the page fault was caused by the process attempting to access one of the deleted page table entries comprises identifying that the effective address belongs to a range of addresses used for MMIO between the processor and the coherent accelerator.

19. The computer program product of claim 16 , wherein emulating execution of the MMIO operation comprises:

locating an instruction for the MMIO operation based on the program counter; and

parsing a bit pattern for the instruction to determine one or more characteristics of the MMIO operation, wherein the one or more characteristics indicate at least one of a type of MMIO instruction, a source memory location, and a destination memory location.

20. The computer program product of claim 19 , the operation further comprising:

upon determining that the instruction is for a MMIO read operation to the coherent accelerator, returning an outcome of the emulated execution to the faulting process and incrementing the program counter to a subsequent instruction, wherein the outcome comprises invalid data, and wherein the process ceases requests to perform MMIO operations to the coherent accelerator upon indication of the invalid data; and

upon determining that the instruction is for a MMIO write operation to the coherent accelerator, ignoring the instruction and incrementing the program counter to a subsequent instruction.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 15, 2021
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: AIRBNB, INC.
Reel/Frame 056427/0193 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 3, 2015
From: ALBOT, ANDRE L; ASLOT, VISHAL C; MEALEY, BRUCE; STILWELL, NICHOLAS
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 037041/0687 →