# US 8,789,069 B2 · On-the-fly replacement of physical hardware with emulation

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 8,789,069 B2
- Document ID: US8789069B2
- Status: Granted
- Kind: B2
- Application number: 13/547,416
- Filed: 2012-07-12
- Published: 2012-11-01
- Granted: 2014-07-22
- Earliest claimed: 2008-09-30
- Assignees: Microsoft Corporation
- Applicants: Dustin L. Green; Jacob Oshins
- Inventors: Dustin L. Green; Jacob Oshins
- Web page: https://patentgrep.com/patent/US8789069B2

## CPC

- G06F 9/45533: {Hypervisors; Virtual machine monitors}
- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 2009/45579: {I/O management, e.g. providing access to device drivers or storage}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Various aspects are disclosed herein for replacing the hardware backing the memory locations associated with a virtual machine with a backing mechanism. The backing mechanism may have the memory locations appear to contain data convenient to the driver in the virtual machine, typically containing what the hardware would have returned if the hardware had been read from. The data image being returned from the memory locations may travel with the virtual machine even if the virtual machine moves to a different physical machine that does not contain hardware equivalent to the hardware that was recently removed from the virtual machine.

## Claims

### Claim 1

A method of managing hardware resources in a virtual machine environment, comprising:
emulating functionality of a hardware resource in the virtual machine environment; and
maintaining accessibility to said emulated functionality when said hardware resource has been removed from said virtual machine environment.

### Claim 2 (depends on 1)

The method according to claim 1, further comprising configuring a hardware control interface portion of a memory region corresponding to said hardware resource, wherein the functionality is emulated with code and data.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the code and data is operable to emulate said functionality when said hardware resource has been removed from said virtual machine environment.

### Claim 4 (depends on 3)

The method according to claim 3, wherein said maintaining accessibility comprises maintaining accessibility to said memory region for a driver corresponding to said hardware resource when said driver attempts to access said memory region.

### Claim 5 (depends on 1)

The method according to claim 1, wherein said virtual machine environment shares said hardware resource with at least one other virtual machine environment.

### Claim 6 (depends on 1)

The method according to claim 1, wherein the accessibility is not allowed after a first period of time, wherein the first period of time allows completion of a pending transaction.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the accessibility is allowed for a second period of time, wherein the second period of time allows continued accessibility until the accessibility is relinquished.

### Claim 8 (depends on 4)

The method according to claim 4, wherein said emulated functionality provides per-bit information to said driver.

### Claim 9 (depends on 1)

The method according to claim 1, wherein said emulated functionality comprises emulation behavior by a virtualizing mechanism.

### Claim 10 (depends on 1)

The method according to claim 1, wherein said virtual machine environment is a child virtual machine of a parent virtual machine.

### Claim 11 (depends on 4)

The method according to claim 4, further comprising:
pausing virtual processors of said virtual machine environment;
mapping virtual machine environment addresses to a memory region with said code and data; and
un-pausing said virtual processors of said virtual machine environment.

### Claim 12 (depends on 11)

The method according to claim 11, further comprising recording the state of said hardware resource, wherein said state comprises information additional to said code and data.

### Claim 13 (depends on 12)

The method according to claim 12, wherein software executing outside of the virtual machine environment reads said state of said hardware resource.

### Claim 14 (depends on 2)

The method according to claim 2, further comprising effectuating software emulation of said hardware control interface.

### Claim 15 (depends on 4)

The method according to claim 4, further comprising:
using a memory sub-region within said hardware control interface portion to determine whether said hardware control interface is backed by said hardware device or whether said hardware device has been removed; and
updating said memory sub-region to indicate that the hardware device has been removed when said hardware control interface portion has been replaced with said code and data.

### Claim 16

A system adapted to disassociate a hardware resource from a virtual machine environment, comprising:
a computing device comprising at least one processor;
a memory communicatively coupled to said processor when said system is operational; said memory having stored therein computer instructions that upon execution by the at least one processor cause:
emulating functionality of a hardware resource in the virtual machine environment; and
maintaining accessibility to said emulated functionality when said hardware resource has been removed from said virtual machine environment.

### Claim 17 (depends on 16)

The system of claim 16, further comprising configuring a hardware control interface portion of a memory region corresponding to said hardware resource with code and data emulating functionality associated with said hardware control interface, wherein the code and data is operable to emulate said functionality when said hardware resource has been removed from said virtual machine environment.

### Claim 18

A computer readable storage medium storing thereon computer executable instructions for disassociating a hardware resource from a virtual machine environment, comprising instructions for:
emulating functionality of a hardware resource in the virtual machine environment; and
maintaining accessibility to said emulated functionality when said hardware resource has been removed from said virtual machine environment.

### Claim 19 (depends on 18)

The computer readable storage medium of claim 18, further comprising instructions for:
configuring a hardware control interface portion of a memory region corresponding to said hardware resource with code and data emulating functionality associated with said hardware control interface, wherein the code and data is operable to emulate said functionality when said hardware resource has been removed from said virtual machine environment; and
using said code and data, maintaining accessibility to said memory region for a driver residing in the virtual machine environment when said driver attempts to access said memory region when said hardware resource has been removed from said virtual machine environment.

### Claim 20 (depends on 19)

The computer readable storage medium of claim 19, further comprising instructions for:
waiting for a predetermined period of time for a message from the driver indicating that the driver has completed extracting data from the hardware device control interface;
when the predetermined period of time expires before receiving said message from the driver, reading unextracted data from the hardware control interface and ignoring said message from the driver when the message is received after expiration of said predetermined period;
pausing virtual processors of said virtual machine environment before said hardware control interface portion of said memory region is replaced with said code and data;
replacing said hardware control interface portion of said memory region with said code and data;
mapping virtual machine environment addresses to said portion of said memory region via said functionality;
effectuating a hardware device presence value within said hardware control interface portion of said memory region to indicate whether said hardware control interface is backed by said hardware resource or whether said hardware resource has been removed;
changing the hardware device presence value from present to absent;
un-pausing said virtual processors of said virtual machine environment; and
when said driver reports that it is finished accessing said hardware control interface portion of said memory region, removing said code and data.
