# US 2016/0253193 A1 · Dynamic virtual machine function enabling

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

- Number: US 2016/0253193 A1
- Document ID: US20160253193A1
- Status: Published application
- Kind: A1
- Application number: 14/632,644
- Filed: 2015-02-26
- Published: 2016-09-01
- Earliest claimed: 2015-02-26
- Assignees: Red Hat Israel, Ltd.
- Applicants: Red Hat Israel, Ltd.
- Inventors: Michael Tsirkin
- Web page: https://patentgrep.com/patent/US20160253193A1

## CPC

- G06F 9/45558: {Hypervisor-specific management and integration aspects}
- G06F 9/5011: {the resources being hardware resources other than CPUs, Servers and Terminals}
- G06F 2009/45583: {Memory management, e.g. access or allocation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method performed by a physical computing system includes, with a guest, requesting execution of a virtual machine function instruction, determining that virtual machine function ability for the guest is in a disabled state, in response to the requesting execution of a virtual machine function instruction and determining that the virtual machine function ability for the guest is in a disabled state, exiting a context of the guest, after a page table that maps guest virtual addresses to guest physical addresses is validated, determining that the virtual machine function ability is enabled, and in response to determining that the virtual machine function ability for the guest is in an enabled state, executing the virtual machine function instruction.

## Claims

### Claim 1

A method performed by a physical computing system, the method comprising:
with a guest, requesting execution of a virtual machine function instruction, the virtual machine function instruction allowing the guest to access a protected portion of memory without exiting a context of the guest;
determining that virtual machine function ability for the guest is in a disabled state;
in response to the requesting execution of a virtual machine function instruction and determining that the virtual machine function ability for the guest is in a disabled state, exiting the context of the guest;
after a page table that maps guest virtual addresses to guest physical addresses is validated, determining that the virtual machine function ability is enabled; and
in response to determining that the virtual machine function ability for the guest is in an enabled state, executing the virtual machine function instruction.

### Claim 2 (depends on 1)

The method of claim 1, further comprising, with a hypervisor, in response to the exiting the context of the guest, validating the page table; and
after validating the page table, switching the virtual machine function ability for the guest to the enabled state.

### Claim 3 (depends on 2)

The method of claim 2, wherein the switching the virtual machine function ability to the enabled state is in response to detecting a threshold number of virtual machine function instructions within a predefined period of time.

### Claim 4 (depends on 3)

The method of claim 3, wherein validating the page table comprises determining that the page table correctly maps guest virtual addresses to guest physical addresses.

### Claim 5 (depends on 1)

The method of claim 1, further comprising, in response to determining that a page table related modification has occurred while the virtual machine function ability is in the enabled state, switching the virtual machine function ability to the disabled state.

### Claim 6 (depends on 5)

The method of claim 5, wherein the page table related modification comprises changing a value stored in a page table base register.

### Claim 7 (depends on 5)

The method of claim 5, wherein the page table related modification comprises changing an entry within the page table.

### Claim 8 (depends on 1)

The method of claim 1, wherein the virtual machine function instruction provides access to privileged pages without a virtual machine exit.

### Claim 9

A method performed by a computing system, the method comprising:
while in a context of a guest managed by a hypervisor of the computing system, requesting execution of a first VMFUNC instruction;
determining that VMFUNC ability is in a disabled state;
exiting the context of the guest in response to detecting the requesting execution of the first VMFUNC instruction while the VMFUNC ability is in the disabled state;
while out of the context of the guest, validating a page table that maps guest virtual addresses to guest physical addresses; and
after validating the page table, switching the VMFUNC ability to an enabled state.

### Claim 10 (depends on 9)

The method of claim 9, further comprising, with VMFUNC ability in the enabled state, disabling VMFUNC ability in response to detecting a page table related modification.

### Claim 11 (depends on 10)

The method of claim 10, wherein the page table related modification comprises a change to a value stored in a page table base register.

### Claim 12 (depends on 10)

The method of claim 10, wherein the page table related modification comprises a change to an entry within the page table.

### Claim 13 (depends on 9)

The method of claim 9, wherein the switching the VMFUNC ability to the enabled state is in response to detecting a threshold number of VMFUNC on calls within a predefined time limit.

### Claim 14 (depends on 13)

The method of claim 13, wherein the threshold is based on historical data.

### Claim 15 (depends on 9)

The method of claim 9, wherein validating the page table is performed while in a context of the hypervisor.

### Claim 16 (depends on 9)

The method of claim 9, wherein validating the page table comprises determining that the page table correctly maps guest virtual addresses to guest physical addresses.

### Claim 17

A system comprising:
a processor; and
memory comprising machine readable instructions that comprise a hypervisor configured to manage a number of guests, wherein a guest of the number of guests is configured to:
request execution of a virtual machine function instruction, the virtual machine function instruction allowing the guest to access a protected portion of memory without exiting a context of the guest;
determine that virtual machine function ability is in a disabled state;
exiting a context of the guest in response to detecting the request for execution of the first virtual machine function instruction while the virtual machine function ability is in the disabled state;
after a page table that maps guest virtual addresses to guest physical addresses has been validated, determining that the virtual machine function ability is enabled; and
in response to determining that the virtual machine function ability is in an enabled state, executing a virtual machine function instruction.

### Claim 18 (depends on 17)

The system of claim 17, wherein the hypervisor is configured to, in response to the exiting the context of the guest, validating a page table that maps guest virtual addresses to guest physical addresses.

### Claim 19 (depends on 18)

The system of claim 18, wherein the hypervisor is configured to switch the virtual machine function ability for the guest to the enabled state after validating the page table.

### Claim 20 (depends on 19)

The system of claim 19, wherein to switch the virtual machine function ability to the enabled state is in response to detecting a threshold number of virtual machine function calls within a predefined time limit.
