IP Library Granted Patent US 9,946,566
Granted Patent B2
US 9,946,566 · App. 14/867,761 · Granted Apr 17, 2018

Method and apparatus for light-weight virtualization contexts

Inventors: Deepak K. Gupta (Hillsboro, OR); Ravi L. Sahita (Beaverton, OR); Barry E. Huntley (Hillsboro, OR)
Assignee: Intel Corporation
G06F9/45558G06F2009/4557
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,946,566
App. No.
14/867,761
Granted
Apr 17, 2018
Kind
B2
Abstract

A processor comprises a register to store a first pointer to a context data structure specifying a virtual machine context, the context data structure comprising a first field to store a second pointer to a plurality of realm switch control structures (RSCSs), and an execution unit comprising a logic circuit to execute a virtual machine (VM) according to the virtual machine context, wherein the VM comprises a guest operating system (OS) comprising a plurality of kernel components, and wherein each RSCS of the plurality of RSCSs specifies a respective component context associated with a respective kernel component of the plurality of kernel components, and execute a first kernel component of the plurality of kernel components using a first component context specified by a first RSCS of the plurality of RSCSs.

Claims (81)

1. A processor comprising:

a register to store a first pointer to a context data structure specifying a virtual machine context, the context data structure comprising a first field to store a second pointer to a plurality of realm switch control structures (RSCSs); and

an execution unit comprising a logic circuit to:

execute a virtual machine (VM) according to the virtual machine context, wherein the VM comprises a guest operating system (OS) comprising a plurality of kernel components, and wherein each RSCS of the plurality of RSCSs specifies a respective component context associated with a respective kernel component of the plurality of kernel components; and

execute a first kernel component of the plurality of kernel components using a first component context identified by a first RSCS of the plurality of RSCSs.

2. The processor of claim 1 , wherein the context data structure further comprises at least one of a second field to store an extended page table pointer (EPTP), a third field to store content of a control register (CR), a forth field to store content of an instruction pointer (IP) register, or a fifth field to store content of a stack pointer (SP) register.

3. The processor of claim 2 , wherein each RSCS comprises at least one of a first field to store an identifier associated with the respective kernel component specified by the each RSCS, a second field to store the extended page table pointer (EPTP) associated with the each kernel component, a third field content of the control register (CR) associated with the each kernel component, a forth field to store content of the instruction pointer (IP) register associated with the each kernel component, or a fifth field to store content of the stack pointer (SP) register associated with the each kernel component.

4. The processor of claim 3 , wherein the logic circuit is to execute a virtual machine monitor (VMM), and wherein in response to receiving a VM entry instruction, the VMM is to populate data stored in the context data structure into the EPTP, the control register, the instruction pointer register, and the stack pointer register associated with the processor, and to start the VM according to the VM context specified by the context data structure.

5. The processor of claim 1 , wherein the logic circuit is further to:

without exiting the VM, switch from the first kernel component to a second kernel component using a second component context specified by a second RSCS of the plurality of RSCSs.

6. The processor of claim 5 , wherein to execute the first kernel component, the logic circuit is to:

load data stored in second to fifth fields of the first RSCS correspondingly into second to fifth fields of the context data structure; and

execute the first kernel component using the first component context in the context data structure.

7. The processor of claim 6 , wherein the execution unit is to execute the guest OS to:

store, in a first register, an index value assigned to the second kernel component;

store, in a second register, an identifier assigned to the second kernel component; and

store, in a third register, a leaf value associated with an instruction implemented in the logic circuit to switch between two kernel components.

8. The processor of claim 7 , wherein the logic circuit is to:

receive the leaf value associated with the instruction;

read the first register to retrieve the index value and determine if the index value is within a range of available RSCSs;

in response to determining that the index value is within the range, retrieve the second RSCS from the plurality of RSCSs based on the index value;

read the second register to retrieve the identifier associated with the second kernel component; and

determine if the identifier matches data stored in the first field of the second RSCS.

9. The processor of claim 8 , wherein the logic circuit if further to:

in response to determining that the identifier matches the data stored in the first field of the second RSCS, determine if data stored in the second field of the second RSCS is valid;

in response to determining that the data stored in the second field of the second RSCS is valid, swap the data stored in the second field of the second RSCS with the data stored in the second field of the context data structure;

in response to swapping the data stored in the second field of the second RSCS with the data stored in the second field of the context data structure, determine if the data stored in the third field of the second RSCS is valid;

in response to determining the data stored in the third field of the second RSCS is valid, swap the data stored in the third field of the second RSCS with the data stored in the third field of the context data structure;

in response to swapping the data stored in the third field of the second RSCS with the data stored in the third field of the context data structure, determine if data stored in the fourth field of the second RSCS is valid;

in response to determining the data stored in the fourth field of the second RSCS is valid, swap the data stored in the fourth field of the second RSCS with the data stored in the fourth field of the context data structure;

in response to swapping the data stored in the fourth field of the second RSCS with the data stored in the fourth field of the context data structure, determine if data stored in the fifth field of the second RSCS is valid;

in response to determining the data stored in the fifth field of the second RSCS is valid, swap the data stored in the fifth field of the second RSCS with the data stored in the fifth field of the context data structure; and

execute the second kernel component using the second component context loaded into the context data structure.

10. The processor of claim 6 , wherein the execution unit is further to:

retrieve, from the second field, an access permission to a host physical space associated with a memory associated with processor; and

associate the second component with the access permission to the host physical space.

11. A system-on-a-chip (SoC) comprising:

a memory; and

a processor, operably coupled to the memory, comprising:

a register to store a first pointer to a context data structure specifying a virtual machine context, the context data structure comprising a first field to store a second pointer to a plurality of realm switch control structures (RSCSs); and

an execution unit comprising a logic circuit to:

execute a virtual machine (VM) according to the virtual machine context, wherein the VM comprises a guest operating system (OS) comprising a plurality of kernel components, and wherein each RSCS of the plurality of RSCSs specifies a respective component context associated with a respective kernel component of the plurality of kernel components; and

execute a first kernel component of the plurality of kernel components using a first component context specified by a first RSCS of the plurality of RSCSs.

12. The SoC of claim 11 , wherein the context data structure further comprises at least one of a second field to store an extended page table pointer (EPTP), a third field to store content of a control register (CR), a forth field to store content of an instruction pointer (IP) register, or a fifth field to store content of a stack pointer (SP) register.

13. The SoC of claim 12 , wherein each RSCS comprises at least one of a first field to store an identifier associated with the respective kernel component specified by the each RSCS, a second field to store the extended page table pointer (EPTP) associated with the each kernel component, a third field content of the control register (CR) associated with the each kernel component, a forth field to store content of the instruction pointer (IP) register associated with the each kernel component, or a fifth field to store content of the stack pointer (SP) register associated with the each kernel component.

14. The SoC of claim 13 , wherein the logic circuit is to execute a virtual machine monitor (VMM), and wherein in response to receiving a VM entry instruction, the VMM is to populate data stored in the context data structure into the EPTP, the control register, the instruction pointer register, and the stack pointer register associated with the processor, and to start the VM according to the VM context specified by the context data structure.

15. The SoC of claim 14 , wherein the logic circuit is further to:

without exiting the VM, switch from the first kernel component to a second kernel component using a second component context specified by a second RSCS of the plurality of RSCSs.

16. The SoC of claim 15 , wherein to execute the first component, the logic circuit is to:

load data stored in second to fifth fields of the first RSCS correspondingly in second to fifth fields of the context data structure; and

execute the first kernel component using the first component context in the context data structure.

17. The SoC of claim 16 , wherein the execution unit is to execute the guest OS to:

store, in a first register, an index value assigned to the second kernel component;

store, in a second register, an identifier assigned to the second kernel component; and

store, in a third register, a leaf value associated with an instruction implemented in the logic circuit to switch between two kernel components.

18. The SoC of claim 17 , wherein the logic circuit is to:

receive the leaf value associated with the instruction;

read the first register to retrieve the index value and determine if the index value is within a range of available RSCSs;

in response to determining that the index value is within the range, retrieve the second RSCS from the plurality of RSCSs based on the index value;

read the second register to retrieve the identifier associated with the second component; and

determine if the identifier matches data stored in the first field of the second RSCS.

19. The SoC of claim 18 , wherein the logic circuit if further to:

in response to determining that the identifier matches the data stored in the first field of the second RSCS, determine if data stored in the second field of the second RSCS is valid;

in response to determining that the data stored in the second field of the second RSCS is valid, swap the data stored in the second field of the second RSCS with the data stored in the second field of the context data structure;

in response to swapping the data stored in the second field of the second RSCS with the data stored in the second field of the context data structure, determine if the data stored in the third field of the second RSCS is valid;

in response to determining the data stored in the third field of the second RSCS is valid, swap the data stored in the third field of the second RSCS with the data stored in the third field of the context data structure;

in response to swapping the data stored in the third field of the second RSCS with the data stored in the third field of the context data structure, determine if data stored in the fourth field of the second RSCS is valid;

in response to determining the data stored in the fourth field of the second RSCS is valid, swap the data stored in the fourth field of the second RSCS with the data stored in the fourth field of the context data structure;

in response to swapping the data stored in the fourth field of the second RSCS with the data stored in the fourth field of the context data structure, determine if data stored in the fifth field of the second RSCS is valid;

in response to determining the data stored in the fifth field of the second RSCS is valid, swap the data stored in the fifth field of the second RSCS with the data stored in the fifth field of the context data structure; and

execute the second kernel component using the second component context loaded into the context data structure.

20. A method comprising:

executing a virtual machine (VM) comprising a guest operating system (OS) comprising a plurality of kernel components, wherein each kernel component is specified by a respective one realm switch control structure (RSCS) of a plurality of RSCSs, wherein the guest operating system runs according to a VM context specified by a context data structure;

in response to receiving an indicator to switch to a first kernel component of the guest operating system, selecting a first RSCS from the plurality of RSCSs based on an index value;

determining if an identifier associated with the first kernel component matches an identifier stored in a first field of the first RSCS;

in response to determining that the identifier associated with the first kernel component matches the identifier stored in the first field of the first RSCS, determining if data stored in a second field of the first RSCS is valid;

in response to determining that the data stored in the second field of the first RSCS is valid, swapping the data stored in the second field of the first RSCS with the data stored in a field of the context data structure; and

without exiting the VM, executing the first kernel component of the guest operating system using the context data structure.

21. The method of claim 20 , further comprising:

in response to determining that the identifier associated with the first kernel component does not match the identifier stored in the first field of the first RSCS, exiting the VM; and

in response to determining that the data stored in the second field of the first RSCS is not valid, exiting the VM.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 4, 2015
From: GUPTA, DEEPAK K.; SAHITA, RAVI L.; HUNTLEY, BARRY E.
To: INTEL CORPORATION
Reel/Frame 037043/0700 →
Continuity (1)
Related Publication 20170090966A1 · Mar 30, 2017