IP Library Granted Patent US 8,032,897
Granted Patent B2
US 8,032,897 · App. 11/831,119 · Granted Oct 4, 2011

Placing virtual machine monitor (VMM) code in guest context to speed memory mapped input/output virtualization

Assignee: GLOBALFOUNDRIES Inc.
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 8,032,897
App. No.
11/831,119
Granted
Oct 4, 2011
Kind
B2
Abstract

In one embodiment, a method comprises: obtaining use of one or more pages in a guest physical address space of a guest; storing handler code to process one or more input/output (I/O) and/or interrupt events in the one or more pages; and redirecting a first event of the one or more I/O events from guest handler code that would process the first event to the handler code in the one or more pages. Also contemplated is a computer accessible medium comprising a plurality of instructions, which, when executed by a computer, implement the method.

Claims (55)

1. A method comprising:

obtaining use of one or more pages in a guest physical address space of a guest;

storing handler code to process one or more input/output (I/O) events in the one or more pages; and

redirecting a first event of the one or more I/O events from guest handler code that would process the first event to the handler code in the one or more pages.

2. The method as recited in claim 1 further comprising:

determining, in the handler code, that the handler code cannot complete processing of the first event; and

exiting the guest to a virtual machine monitor (VMM) to complete processing of the first event.

3. The method as recited in claim 1 further comprising:

completing the processing of the event in the handler code without exiting to a virtual machine monitor (VMM); and

continuing execution of the guest.

4. The method as recited in claim 1 wherein the first event comprises an access to an address in the guest that is memory-mapped to I/O, and wherein the method further comprises marking a translation from a guest virtual page to a memory-mapped I/O page that includes the memory-mapped I/O address not present in the guest page table, wherein an attempt to access the memory-mapped I/O address from the guest causes a page fault, and wherein the handler code is executed to handle the page fault.

5. The method as recited in claim 4 further comprising:

determining, in the handler code, that a second page fault is a page fault experienced in the guest that is not an I/O event; and

reflecting the second page fault back to the guest for handling.

6. The method as recited in claim 4 further comprising:

completing processing of the page fault in the handler code; and

returning from the handler code to the source of the page fault.

7. The method as recited in claim 4 further comprising:

determining, in the handler code, that the handler code cannot complete processing of the first event; and

exiting the guest to a virtual machine monitor (VMM) to complete processing of the first event.

8. The method as recited in claim 7 wherein the exiting comprises executing a VMMCALL instruction.

9. The method as recited in claim 7 wherein the exiting comprises a virtual machine (VM) exit.

10. The method as recited in claim 1 wherein the redirecting comprises:

copying a guest data structure that maps I/O events to various handlers to a shadow data structure;

modifying the shadow data structure to map the first event to the handler code; and

causing the guest to use the shadow data structure during execution instead of the guest data structure.

11. The method as recited in claim 10 wherein the data structure comprises an interrupt descriptor table (IDT).

12. The method as recited in claim 11 wherein modifying the shadow data structure comprises modifying a page fault entry of the IDT to indicate a task switch to the handler code.

13. The method as recited in claim 11 wherein another event of the I/O events is an interrupt.

14. A computer accessible storage medium storing a plurality of instructions which are executable to perform a method comprising:

obtaining use of one or more pages in a guest physical address space of a guest;

storing handler code to process one or more input/output (I/O) events in the one or more pages; and

redirecting a first event of the one or more I/O events from guest handler code that would process the first event to the handler code in the one or more pages.

15. The computer accessible storage medium as recited in claim 14 wherein the plurality of instructions comprises the handler code, and the method further comprises:

determining, in the handler code, that the handler code cannot complete processing of the first event; and

exiting the guest to a virtual machine monitor (VMM) to complete processing of the first event.

16. The computer accessible storage medium as recited in claim 14 wherein the wherein the redirecting comprises:

copying a guest data structure that maps I/O events to various handlers to a shadow data structure;

modifying the shadow data structure to map the first event to the handler code; and

causing the guest to use the shadow data structure during execution instead of the guest data structure.

17. The computer accessible storage medium as recited in claim 16 wherein the data structure comprises an interrupt descriptor table (IDT), and wherein the modifying comprises modifying a page fault entry of the IDT to indicate a task switch to the handler code.

18. A computer accessible storage medium storing a plurality of instructions which are executable to perform a method comprising:

obtaining use of one or more pages in a guest physical address space of a guest;

storing handler code to process one or more input/output (I/O) events in the one or more pages;

redirecting a first event of the one or more I/O events from guest handler code that would process the first event to the handler code in the one or more pages, wherein the first event comprises an access to an address in the guest that is memory-mapped to I/O; and

marking a translation from a guest virtual page to a memory-mapped I/O page that includes the memory-mapped I/O address not present in the guest page table, wherein an attempt to access the memory-mapped I/O address from the guest causes a page fault, and wherein the handler code is executed to handle the page fault.

19. The computer accessible storage medium as recited in claim 18 wherein the method further comprises:

determining, in the handler code, that a second page fault is a page fault experienced in the guest that is not an I/O event; and

reflecting the second page fault back to the guest for handling.

20. The computer accessible storage medium as recited in claim 18 wherein the method further comprises:

completing processing of the page fault in the handler code; and

returning from the handler code to the source of the page fault.

21. The computer accessible storage medium as recited in claim 18 wherein the method further comprises:

determining, in the handler code, that the handler code cannot complete processing of the first event; and

exiting the guest to a virtual machine monitor (VMM) to complete processing of the first event.

Assignments (6)
RELEASE OF SECURITY INTEREST Recorded May 12, 2021
From: WILMINGTON TRUST, NATIONAL ASSOCIATION
To: GLOBALFOUNDRIES U.S. INC.
Reel/Frame 056987/0001 →
RELEASE OF SECURITY INTEREST Recorded Nov 20, 2020
From: WILMINGTON TRUST, NATIONAL ASSOCIATION
To: GLOBALFOUNDRIES INC.
Reel/Frame 054636/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 2, 2020
From: GLOBALFOUNDRIES INC.
To: GLOBALFOUNDRIES U.S. INC.
Reel/Frame 054633/0001 →
SECURITY AGREEMENT Recorded Nov 29, 2018
From: GLOBALFOUNDRIES INC.
To: WILMINGTON TRUST, NATIONAL ASSOCIATION
Reel/Frame 049490/0001 →
AFFIRMATION OF PATENT ASSIGNMENT Recorded Aug 18, 2009
From: ADVANCED MICRO DEVICES, INC.
To: GLOBALFOUNDRIES INC.
Reel/Frame 023120/0426 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jul 31, 2007
From: SEREBRIN, BENJAMIN C.
To: ADVANCED MICRO DEVICES, INC.
Reel/Frame 019624/0699 →
Continuity (1)
Related Publication 20090037936A1 · Feb 5, 2009