Virtual machine registers in a computer processor
Through the combination of virtual machine registers, domain registers and super manager status registers, resource isolation and security control between virtual machines and domains are realized, and the resource isolation and security deficiency between virtual machines and domains in the prior art is solved. The problem of improving the security and flexibility of the system.
Patent Information
- Application Number
- CN201980055185.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-07-23
- Filing Date
- 2019-08-23
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2039-08-23
AI Technical Summary
Existing computer processors have insufficient resource isolation and security control between management virtual machines and operating systems, making it difficult to effectively isolate resources and states between different virtual machines and domains, and lacks a flexible security configuration mechanism.
Introduce virtual machine registers and domain registers, through which the virtual machine identifiers and domain identifiers are stored currently executed, combined with the super manager status register, configure the address translation function of the memory management unit to realize resource isolation between the virtual machine and the domain. , and specify permissions in the page table entry to perform access control.
It realizes effective isolation of resources between different virtual machines and domains, improves the security and flexibility of the system, allows fine security control without relying on the traditional trust level, and enhances the security of the processor. and resource management capabilities.
Smart Images

Figure CN112602060B_ABST
Abstract
Description
[0001] Related Applications
[0002] This application claims the benefit of the filing dates of: U.S. Patent Application No. 16 / 520,310, filed on July 23, 2019, and entitled “Virtual Machine Register in a Computer Processor”; U.S. Provisional Patent Application No. 62 / 725,118, filed on August 30, 2018, and entitled “Virtual Machine Register in a Computer Processor”; U.S. Provisional Patent Application No. 62 / 724,896, filed on August 30, 2018, and entitled “Memory Access Control through Permissions Specified in Page Table Entries for Execution Domains”; U.S. Provisional Patent Application No. 62 / 725,118, filed on August 30, 2018, and entitled “Memory Access Control through Permissions Specified in Page Table Entries for Execution Domains”; U.S. Provisional Patent Application No. 62 / 724,896, filed on August 30, 2018, and entitled “Security Configurations in Page Table Entries for Execution Domains” No. 62 / 724,913, filed on August 30, 2018, entitled “Access Control for Processor Registers based on Execution Domains”; No. 62 / 724,929, filed on August 30, 2018, entitled “Access Control for Processor Registers based on Execution Domains”; No. 62 / 724,999, filed on August 30, 2018, entitled “Domain Register for Instructions being Executed in Computer Processors”; and No. 62 / 725,030, filed on August 30, 2018, entitled “Domain Crossing in Executing Instructions in Computer Processors”, the entire disclosures of which are hereby incorporated by reference into this document. Technical Field
[0003] At least some embodiments disclosed herein relate generally to computer architecture, and more particularly, but not limited to, virtual machine registers in a computer processor. Background Art
[0004] Instructions programmed for a computer may be structured in a hierarchical manner. One layer may provide resources and services to another layer. For example, a hypervisor may create or provide a virtual machine implemented on a computer hardware component. An operating system may use resources available in a computer having a predefined architecture to provide resources and services. The computer resources or computer operated by the operating system may be actual computer hardware components or virtual machine components provided by a hypervisor. Applications may use the services and resources provided by the operating system to provide application-specific functionality. BRIEF DESCRIPTION OF THE DRAWINGS
[0005] Embodiments are illustrated by way of example and not limitation in the figures of the accompanying drawings in which like references indicate similar elements.
[0006] Figure 1 A computer processor according to some embodiments is shown having a set of registers configured to control the operation of the computer processor.
[0007] Figure 2 Identification of a table base address of an address translation table in the absence of an operating hypervisor in some embodiments is shown.
[0008] Figure 3 Identification of a table base address of an address translation table in the presence of an operating hypervisor in some embodiments is shown.
[0009] Figure 4 Shows the individual address translation tables for the corresponding domains.
[0010] Figure 5 A technique for retrieving an entry in an address translation table to translate a virtual address is shown.
[0011] Figure 6 A system is shown that controls security operations applied to resources based on domain registers.
[0012] Figure 7 Shows the page table entries with security configuration for an execution domain.
[0013] Figure 8 A computer system is shown having a domain register that controls security operations.
[0014] Fig. 9 A method of performing address translation of a virtual machine based on virtual machine registers is shown. DETAILED DESCRIPTION
[0015] The present disclosure includes a virtual machine register in a computer processor that stores an identifier of a virtual machine in which the computer processor is currently executing instructions. A hypervisor or virtual machine monitor (VMM) creates and manages virtual machines. A hypervisor can control basic functions, such as physical memory and input / output (I / O). In general, a computer can operate with or without a hypervisor. When a hypervisor operates / is present in a computer system (e.g., as indicated by a value stored in a hypervisor status register of a computer processor), the computer processor can configure its operation to impose resource / access restrictions on the operation of the virtual machine in which the computer processor is currently executing instructions assigned by the hypervisor. The virtual machine register allows the processor to isolate state and / or resources used for instruction execution in one virtual machine from state and / or resources used for instruction execution in other virtual machines.
[0016] In conventional systems, different levels of privilege and / or trust may be given to different layers of instructions (e.g., user applications versus operating systems). Typically, protection rings are constructed and implemented in computers to protect data and functions from failures and malicious behavior based on the ring hierarchy. Rings are statically arranged into a hierarchy from the most privileged (and therefore most trusted) to the least privileged (and therefore least trusted). For example, a hierarchy may include an operating system kernel ring with the highest privilege, a device driver ring, and an application ring with the lowest privilege. Programs or routines in lower privileged rings may be restricted by corresponding dedicated hardware-enforced control gates to access resources and services of higher privileged rings in the hierarchy. Gated access between rings may improve security.
[0017] In the technology of the present disclosure, instructions or routines programmed for a computer system can be classified into a set of predefined non-hierarchical domains, such as a domain of a hypervisor, a domain of an operating system, a domain of an application program, etc. Addresses used in different domains can be converted using different address translation tables so that virtual address spaces of different domains can be isolated from each other. If a hypervisor exists (e.g., a machine architecture that operates and controls the lowest level in a computer system), addresses used in different virtual machines managed by the hypervisor can also be converted using different address tables; and therefore, virtual address spaces of different virtual machines can also be isolated from each other. In addition, virtual address spaces of different running processes can also be optionally isolated from each other. For example, a virtual machine register can be configured to store an identifier of a current virtual machine in which a processor is executing instructions; and an address translation function of a memory management unit of a processor can be configured to perform address translation based on an identifier stored in a virtual machine register, an identifier stored in a domain register, and / or a status indication stored in a hypervisor status register to execute a routine in a specific domain of a specific virtual machine.
[0018] Figure 1 A computer processor 169 is shown having a set of registers 183 configured to control the operation of the computer processor 169 according to some embodiments. The set of registers 183 may include at least domain registers 117, virtual machine registers 231, and / or hypervisor state registers 223.
[0019] Domain register 117 is configured to store an identifier or indication of the current domain of instructions being executed in processor 169 .
[0020] For example, Figure 1 The computer processor 169 can be coupled to a physical memory 109. The physical memory 109 can store data and instructions for various routines programmed for the computer system. The routines can be classified into various predefined non-hierarchical domains 101, 103, ..., 105, such as the domain 101 of the hypervisor 102, the domain 103 of the operating system 104, and the domain 105 of the application program 106.
[0021] For example, routines of a hypervisor 102 may be classified in domain A 101; routines of an operating system 104 may be classified in another domain B 103; and routines of an application 106 may be classified in another domain C 105. A hypervisor or virtual machine monitor (VMM) creates and manages virtual machines. A hypervisor may control basic functions such as physical memory and input / output (I / O).
[0022] The computer processor 169 may optionally be used with or without the hyper manager 102 in operation. Figure 1 When the operating system 104 is operated or exists in the computer system, the operating system 104 can control the entire computer system. Figure 1 When the hypervisor 102 is operating or present in a computer system, the hypervisor 102 may provide one or more virtual machines; each virtual machine may run its instance of the operating system 104; and the operating system 104 running in the virtual machine may control the resources of the virtual machine provided by the hypervisor 102, but not the resources not provided to the virtual machine. Therefore, when the hypervisor 102 is present or operating in the computer system, the operating system in the virtual machine hosted on the computer system may not be able to control a portion of the computer system that would be controlled by the operating system when the hypervisor 102 is not present or operating. For example, when the hypervisor 102 provides a portion of the memory 109 to the virtual machine, the operating system 104 running in the virtual machine may access the portion of the memory 109 via a pseudo-physical memory address, wherein the operating system 104 may treat the pseudo-physical memory address as a physical memory address that is actually mapped to the portion of the memory 109 allocated to the virtual machine by the hypervisor 102.
[0023] For example, Figure 1 The computer system may be powered on or booted in a mode in which the computer system does not have the hypervisor 102 in operation. In this mode, the operating system 104 directly controls the hardware resources (e.g., the processor 169 and the memory 109). Alternatively, Figure 1 The computer system can be started in a mode in which the computer system has a hypervisor 102 in operation / running; the hypervisor 102 can create and manage one or more virtual machines; and each virtual machine can run a copy of an operating system 104, wherein the operating system 104 can control the hardware resources that the hypervisor 102 provides to the corresponding virtual machine.
[0024] In some examples, the processor 189 is coupled to the memory 109 with the hypervisor 102; and the computer system may optionally bootstrap operations with or without the hypervisor 102 in operation. In other examples, the processor 189 may optionally be coupled to a memory without the hypervisor 102, and therefore may not run the hypervisor 102.
[0025] The hypervisor status register 233 is configured to store an indicator of whether the hypervisor 102 is present in the computer system. For example, the hypervisor status register 233 may have an initialization value during power-on that indicates that there is no hypervisor 102. If the hypervisor 102 is loaded for execution during the boot process, the hypervisor status register 233 is set to indicate that there is an operating hypervisor 102. The contents of the hypervisor status register 233 allow the processor 189 to customize its operations, such as address translation 235 of the memory management unit (MMU) 181, based on whether the hypervisor 102 is present.
[0026] For example, when the hypervisor status register 233 indicates that the hypervisor 102 is not present, the operating system 104 running in the computer system does not rely on the hypervisor 102 to manage resources and / or services. The domain 101 of the hypervisor 102 is not available for instruction execution in the processor 169; and the operating system 104 has full access to resources, such as the entire physical memory 109.
[0027] However, when the hypervisor status register 233 indicates the presence of the hypervisor 102, the operating system 104 running in the virtual machine is limited to the resources and / or services provided to the virtual machine by the hypervisor 102. Thus, the domain 101 of the hypervisor 102 is related to the execution of instructions in the processor 169. For example, certain operations performed in a routine of the operating system 104 may trigger corresponding operations in the hypervisor 102.
[0028] In general, the hypervisor 102 may exist even if the current execution domain indicated by the domain register 117 is different from the domain 101 of the hypervisor 102. For example, the processor 169 may execute the application 106 in the domain 105 and rely on the operating system 104 to access the memory 109; and the hypervisor 102 may limit the operating system 104 to the portion that the hypervisor 102 provides to the virtual machine in which the operating system 104 is running when accessing the memory 109. Therefore, the execution of the application 106 in the domain 105 may be offset to the execution in the domain 103 of the operating system 104 and / or the execution in the domain 101 of the hypervisor 102.
[0029] Generally speaking, the contents of the hypervisor status register 223 indicate whether the hypervisor 102 is present, which is an indication of whether the domains 103, ..., 105 are operating within the constraints of the hypervisor 102 or a virtual machine.
[0030] When hypervisor 102 is present, virtual machine register 231 may store an identifier of the current virtual machine in which processor 169 is currently running a routine in a domain (e.g., 101, 103, ..., or 105). For example, when processor 169 is executing a routine in domain 103 of operating system 104, virtual machine register 231 stores an identifier of the virtual machine in which the routine is executing in processor 169. For example, when processor 169 is executing a routine in domain 105 of application 106, virtual machine register 231 stores an identifier of the virtual machine in which the application is running.
[0031] In some embodiments, the virtual machine register 231 and the hypervisor state register 233 may be combined. For example, when the virtual machine register 231 has a predetermined value (e.g., zero), the virtual machine register 231 indicates that no hypervisor is present in the computer system; and when the virtual machine register 231 has a value different from the predetermined value, the content of the virtual machine register 231 uniquely identifies the virtual machine in which the processor 169 is currently executing instructions.
[0032] In some embodiments, the virtual machine registers 231 and the hypervisor state registers 233 are separate registers and / or have different access privileges for different domains (e.g., 101, 103, ..., 105). For example, the hypervisor state registers 233 cannot be changed during the boot process without restarting the computer system. For example, the hypervisor state registers 233 can be accessed by domain 101 of the hypervisor 102, but cannot be accessed by domain 103 of the operating system and / or domain 105 of the application program; and the virtual machine registers 231 can be accessed by both domain 101 of the hypervisor 102 and domain 103 of the operating system 104.
[0033] Figure 1The processor 169 includes a memory management unit (MMU) 181 that implements the functionality of the address translation 235. The processor 169 may configure the address translation 235 based on the contents of the hypervisor status register 233.
[0034] For example, when the hypervisor status register 233 has a first value (e.g., 0) indicating that the hypervisor 102 does not exist, the processor 169 configures the address translation 235 to run without using the virtual machine register 231. When the hypervisor status register 233 has a second value (e.g., 1) indicating that the hypervisor 102 exists, the processor 169 configures the address translation 235 to run using the virtual machine register 231, so that the address translation is specific to the virtual machine.
[0035] Figure 1 The processor 169 has an execution unit (e.g., 185), such as an arithmetic logic unit. The processor 169 may include an internal cache 187 as a proxy for a portion of the memory 109. In addition to the domain registers 117, the virtual machine registers 231, and the hypervisor state registers 233, the processor 169 may have other registers 183 to store instructions for execution, data that is an operand of the instruction, and / or the result of the execution of the instruction.
[0036] In general, a routine may include a pre-programmed set of instructions stored in memory 109. A routine may also have input data, output data, and / or temporary data stored in memory 109. A routine may activate or call another routine for a service and / or resource. The calling routine and the called routine may be in the same or different domains (e.g., 101, 103, ..., 105).
[0037] Optionally, the contents of domain registers 117 may control security operations in processor 189, as discussed further below.
[0038] In one embodiment, when a computer system having processor 169 is initially powered on (booted), processor 169 is configured to automatically execute routines of hypervisor 102 or operating system 104 (if a hypervisor is not used) as part of the boot process. Therefore, domain register 117 is initially set to indicate domain 101 of hypervisor 102 or domain 103 of operating system 104. Subsequently, execution control may be moved from one domain to another using instructions identifying the destination domain; and the contents of domain register 117 may be updated according to the processing of such instructions. Some examples and details of domain crossing can be found in U.S. Patent Application No. 62 / 725,030, filed on August 30, 2018, and entitled "Domain Crossing in Executing Instructions in Computer Processors," the entire disclosure of which is hereby incorporated by reference herein.
[0039] Alternatively or in combination, the domain of the currently running routine may be identified based on a memory address, stored attributes of the routine, etc. For example, some techniques for specifying the current domain 123 in the domain register 117 in the computer processor 169 may be found in U.S. Patent Application No. 62 / 724,999, filed on August 30, 2018, and entitled “Domain Register for Instructions being Executed in Computer Processors,” the entire disclosure of which is hereby incorporated by reference herein.
[0040] In some examples, the current domain may be identified based on a memory address used to load the instructions of the routine for execution.
[0041] For example, for processor 169, a virtual memory address (e.g., Figure 5 195) may have a predetermined width (eg, a predetermined number of bits). The memory address may include a representation of an object ID (eg, Figure 5 199) and represents an offset (e.g., Figure 5 For example, the routine may be an object located at the address; and the object ID of the address may be used to identify certain characteristics of the instruction and / or routine; and the current domain may be determined based on the characteristics.
[0042] For example, a static object ID having a predetermined value (e.g., 0) may be used to represent a kernel object of the operating system 104. Thus, a static object ID specified in a memory address may be used to identify the current domain for routine execution. Some details and examples of static object IDs in a memory address of a computer processor that loads instructions for execution may be found in U.S. patent application Ser. No. 16 / 028,840, filed on July 6, 2018, entitled “Static Identifications in Object-based Memory Access,” the entire disclosure of which is hereby incorporated by reference herein.
[0043] In some examples, the memory address and / or the object ID of the memory address (eg, 199) may include a field indicating the object type (eg, Figure 5 198). For example, an object type 198 having a value of 0 to 3 may be used to identify a kernel object of an operating system. For example, an object type 198 having a value of 4 to 5 may be used to specify that an offset is an address having a different width (e.g., a 64-bit address or a 32-bit address contained within a memory address having 128 bits). For example, an object type 198 having a value of 6 to 7 may be used to specify that a predetermined portion of an object ID is to be interpreted as an identifier of an object in a local object or a partitioned global address space (PGAS). For example, an object type 198 having a value of 32 may be used to specify that the remainder of an object ID is to be interpreted as an identifier of an object defined in a server (e.g., 197). For example, an object name server may store data indicating the name of an object represented by an object ID, access control parameters of the object, and / or other attributes of the object.
[0044] For example, an object ID 199 for a memory address used to load a routine for execution may have attributes stored in an object name server; and the attributes may be used to determine or infer the current domain of the routine loaded from the memory address.
[0045] In some examples, a routine to be executed in processor 169 may have attributes stored in association with the routine (e.g., in memory 109, in a page table entry used to determine the physical address of an instruction, in an entry table used to make a call to execute the routine). When the routine is loaded for execution, the attributes of the routine are used to determine the current domain for execution of the routine.
[0046] In one embodiment, when the hypervisor status register 233 indicates that a hypervisor is not present, the processor 169 configures the memory management unit (MMU) 181 to Figure 2Identifies the table base address of the address translation table. However, when the hypervisor status register 233 indicates the presence of the hypervisor 102, the processor 169 configures the memory management unit (MMU) 181 to Figure 3 Identifies the table base address of the address translation table. Figure 5 A technique is shown for retrieving an entry in an address translation table to translate a virtual address into a physical address.
[0047] Figure 2 An identification of a table base address 249 of an address translation table in the absence of an operating hypervisor in some embodiments is shown.
[0048] exist Figure 2 In the embodiment, separate table base address registers 241, 243, ..., 245 are configured for different domains 101, 103, ..., 105 respectively.
[0049] The domain register 117 of the processor 169 stores an identifier of the current domain in which the processor 169 is currently executing instructions. The domain register 117 is coupled to the multiplexer 247 for selecting a table base address 249 of the address translation table to be used in address translation. The table base address 249 identifies the memory location of the address translation table to be used to perform the address translation 235 in the memory management unit (MMU) 181 (e.g., as described below in conjunction with Figure 5 and / or Figure 7 discussed).
[0050] Figure 2 An example of a processor having multiple table base address registers 241, 243, ..., 245 is shown.
[0051] Alternatively or in combination, each domain 101 , 103 , . . . or 105 may have a separate memory area configured to store values of domain-specific registers for execution of instructions in the corresponding domain 101 , 103 , . . . or 105 .
[0052] For example, each domain 101, 103, ... or 105 may have a separate memory area that stores domain-specific values of registers used during the execution of the last executed instruction before execution temporarily transitions to another domain (e.g., via a domain call instruction that executes a routine in another domain). Such a separate memory area for storing values of registers specific to a particular domain (e.g., 101) is accessible for instruction execution in the corresponding domain (e.g., 101), but is not accessible for instruction execution in other domains (e.g., 105). Because other domains (e.g., 101) cannot access the register value area of a given domain (e.g., 105), the register state of a given domain (e.g., 105) is isolated and protected from execution in other domains (e.g., 101).
[0053] For example, the memory area of domain-specific values for registers of a particular domain (e.g., 101) may store the value of a program counter (PC) of an instruction being executed in the processor, the value of a stack pointer (SP) of a stack for instruction execution, the value of a frame pointer (FP) of a stack, the value of a variable parameter pointer (AP) of a stack, and / or the value of a processor status word (PSW), etc. The values of table-based registers of a particular domain (e.g., 101) may also be stored in the register value area of the particular domain (e.g., 101). In this embodiment, it is not necessary to configure separate registers 241, 243, ..., 245 for domains 101, 103, ..., 105, respectively. A single register may be used to store the table base address of the current domain (e.g., 101, 103, ..., 105), as indicated by domain register 117; and when execution enters a new domain, the register may be updated using the table base address previously stored in the register value area of the new domain. Alternatively, the contents of domain register 117 may be used as an index into a table of table base addresses to look up the base address 249 of the address translation table.
[0054] In one embodiment, when domain 101 is specifically configured for hypervisor 102, the absence of the hypervisor as indicated by hypervisor status register 233 allows processor 169 to skip the table base address register of domain 101 for hypervisor 102; and domain 101 for hypervisor 102 becomes irrelevant to subsequent operation of processor 169 (e.g., until hypervisor status register 233 is changed during a subsequent power-on / boot process).
[0055] Figure 3 An identification of a table base address 249 of an address translation table in the presence of an operating hypervisor 102 in some embodiments is shown.
[0056] exist Figure 3 In the example, the intermediate base address 248 is selected by the multiplexer 247 as the output of the table base address registers 241, 243, ..., 245. The intermediate base address 248 is further combined with the content of the virtual machine register 231 to generate the table base address 249 of the address translation table.
[0057] Generally speaking, for each execution domain 101, 103, ..., 105 and the Figure 1Each virtual machine in the computer system may create a separate address translation table for translating virtual addresses assigned by the operating system 104 to physical addresses. When the hypervisor 102 is in operation in the computer system, the operating system 104 running in the virtual machine uses pseudo-physical addresses because the operating system 104 assigns pseudo-addresses to virtual memory addresses as if the pseudo-addresses were physical addresses because the operating system 104 cannot distinguish the virtual machine provided by the hypervisor 102 from the physical machine. The hypervisor 102 may translate the pseudo-physical addresses assigned by the operating system 104 running in the virtual machine into the physical addresses assigned by the computer system (e.g., Figure 1 The physical address of the memory 109 in FIG. 1 is shown.
[0058] Preferably, the hypervisor 102 performs conversion when creating a page table entry that maps a virtual memory address page and a physical address page. Because the operating system 104 running in the virtual machine operates on a pseudo-physical address, the page table entry specified by the operating system maps the virtual memory address page to the pseudo-physical address page. The hypervisor 102 can convert the pseudo-physical address page into a physical address page assigned to the virtual machine, so that the page table entry can be used to convert the virtual address directly into the physical address assigned to the virtual machine. Such page table entries modified by the hypervisor 102 can improve memory access performance by no longer needing to convert the pseudo-physical address in the virtual machine into the physical address of the physical memory 109 separately when using the virtual address in the presence of the hypervisor 102 in operation.
[0059] For example, when the operating system 104 executes an instruction to create a page table entry to map a virtual memory page to a pseudo-physical memory page, the instruction can be captured to cause the hypervisor 102 to convert the pseudo-physical memory page to a physical memory page and modify the page table entry to map the virtual memory page to the converted physical memory page. Subsequently, the page table entry can be used to directly convert the virtual memory page to a physical memory page.
[0060] The contents of virtual machine registers 231 may be combined with base address 248 via a table to look up a base address 249 specific to the virtual machine identified by virtual machine registers 231. Alternatively, the contents of virtual machine registers 231 may be used as a hash function (e.g., Figure 5 121) as shown in the input portion, to index the table at base address 248, thereby retrieving the virtual machine-specific entry in the address translation table 249, as described below in conjunction with Figure 5 Further discussion.
[0061] For example, for a particular domain (e.g., 103), the processor 169 may store a table of table base addresses for virtual machines hosted in the computer system. The table base register (e.g., 243) of the domain (e.g., 103) may store a base address 248 of the table of table base addresses for the virtual machines. The contents of the virtual machine register 231 may be used as an index into the table at base address 248 to find a base address 249 of the address translation table specified for the domain (e.g., 103) and the virtual machine identified by the virtual machine register 231.
[0062] Figure 3 An example of a processor having multiple table base address registers 241, 243, ..., 245 is shown.
[0063] Alternatively or in combination, each domain 101, 103, ... or 105 may have a separate memory area configured to store domain-specific values of registers for execution of instructions in the corresponding domain 101, 103, ... or 105, as described above in conjunction with Figure 2 As discussed. The values of the table base registers 241, 243, ..., 245 can be stored in the register value area of the corresponding domain (e.g., 101, 103, ..., 105). In this embodiment, it is not necessary to configure separate registers 241, 243, ..., 245 for the domains 101, 103, ..., 105, respectively. A single register can be used to store the base address 248 retrieved in the register value area of the corresponding domain (e.g., 101, 103, ..., 105). In some embodiments, the base address 248 is further combined with the content of the virtual machine register 231 to obtain the base address 249 of the address translation table and update the register to save the base address 249 for address translation 235. Alternatively, a separate register is used to store the intermediate base address 248 and the base address 249 of the address translation table to avoid the need to reload the base address 248 from the register value area of the corresponding domain (e.g., 101, 103, ..., 105) when the content of the virtual machine register 231 changes. The register value region of domains 101, 103, ..., 105 will be cached in internal cache 187 to facilitate processor 169 to make effective state changes in response to changes in domain registers 117 and / or virtual machine registers 231. Alternatively, the contents of domain registers 117 and the contents of virtual machine registers 231 may be combined as an index into a table of table base addresses to look up the base address 249 of the address translation table.
[0064] Figure 4 Individual address translation tables 217, ..., 227 for respective domains 101, ..., 105 are shown.
[0065] exist Figure 4 In the domain register 117, the domain register 117 can store Figure 1The contents of domain register 117 may identify domain A 101 or domain C 105.
[0066] Each of the domains 101 , . . . , 105 has a corresponding table base address 219 , . . . , 229 that identifies the memory location of a corresponding address translation table 217 , . . . , 227 .
[0067] For example, when the hypervisor status register 233 indicates that there is no operating hypervisor 102 in the computer system, the table base address 219, ..., 229 can be loaded from the register value area of the corresponding domain 101, ..., 105 and / or retrieved from the corresponding register 241, ..., 245, as described above in conjunction with Figure 2 Discussed.
[0068] When the hypervisor status register 233 indicates that there is an operating hypervisor 102 in the computer system, the following steps may be performed in a manner similar to the above combined method. Figure 3 The discussed approach loads the table base address 219, ..., 229 for a specific virtual machine identified by virtual machine register 231 from the register value area of corresponding domain 101, ..., 105 and / or uses the table base address retrieved in corresponding register 241, ..., 245 to look up the table base address 219, ..., 229 for the specific virtual machine.
[0069] Alternatively, when the hypervisor status register 233 indicates that there is an operating hypervisor 102 in the computer system, the table base addresses 219, ..., 229 can be loaded from the register value areas of the corresponding domains 101, ..., 105; and the contents of the virtual machine registers 231 can be used to generate indexes to the address translation tables 217, ..., 227 at the table base addresses 219, ..., 229.
[0070] exist Figure 4 , each address translation table 217, ... or 227 stores the number of entries / count 211, ... or 221 that the corresponding table 217, ... or 227 has. The number / count 211, ... or 221 allows the processor 169 to check whether the index used on the address translation table 217, ... or 227 is within the valid limits defined by the number / count 211, ... or 221.
[0071] During translation of a virtual address to a physical address, an index is generated from and / or for the virtual address to retrieve an entry that facilitates translation of the virtual address to a physical address. Figure 5 An example of the generation of indexes in address translation 235 is shown.
[0072] Figure 5 A technique for retrieving entry 250 in address translation table 217 to translate virtual address 195 is shown.
[0073] Virtual address 195 may include object ID 199, object type 198, and offset 196. For example, virtual address 195 may have a width of 128 bits; a number of bits (e.g., 59 or 58) of virtual address 195 may be used to store object ID 199, another number of bits (e.g., 5 or 6) of virtual address 195 may be used to store object type 198, and the remaining bits (e.g., 64) of the virtual address may be used to store offset 196 relative to an object having type 198 and ID 199. For example, virtual address 195 may be an address stored in memory 109 as configured, programmed, and / or seen by a programmer or user of a routine in a domain (e.g., 105).
[0074] exist Figure 5 , hash 121 is applied to object ID 199 to produce index 125. Index 125 has fewer bits than object ID 199, and therefore reduces the size of address translation table 217, thereby facilitating the search of entries (e.g., 213, ..., 215) in table 217. However, when multiple items hash to the same index, hash collisions may occur. Chaining is a technique for resolving hash collisions. The index generated by the collision can be used to retrieve a list / chain of key-value pairs. Each item hashed to the index can be configured as a key in a corresponding key-value pair in the list; and the search result for the item can be configured as a value in the corresponding key-value pair. In order to retrieve a search result for one of the items hashed to the same index, the list / chain of key-value pairs identified by the index can be searched to find a key-value pair in which the key matches the item. The value of the matching key-value pair provides the search result. When there is no hash collision at index 125, the entry (e.g., 213, ..., or 215) at index 125 in address translation table 217 can be retrieved as a resultant entry 250. When there is a hash collision at index 125, the entry (e.g., 213, ..., or 215) at index 125 in address translation table 217 identifies a conflict chain 260. Conflict chain 260 has a list / chain of entries (e.g., 262, 264, ...) showing object IDs (e.g., 261, 263) that hash 121 to the same index 125. Conflict chain 260 can be searched to locate an entry (e.g., 262 or 264) that specifies an object ID (e.g., 261 or 263) that matches object ID 199 before hash 121. The located entry (e.g., 262 or 264) is shown as a resultant entry 250.
[0075] In general, hash 121 may be applied to a combination of object ID 199, optionally object type 198, a portion of the offset, the contents of virtual machine registers 231, and / or other information, such as the processor ID of the current process running in processor 169 and / or the contents of domain registers 117. In some examples, the contents of domain registers 117 and / or the contents of virtual machine registers 231 may be appended / added to the result of hash 121 to produce index 125.
[0076] A typical entry 250 found in the address translation table 217 using index 125 may have fields used for subsequent operations in the address translation 235. For example, a valid field 251 may have a value indicating whether the entry 250 is valid for address translation; a type field 253 may have a value indicating the type of translation to be performed using the entry; a page size field 255 may have a value indicating the memory page size used to determine the page table entry; an address field 257; and so on. For example, an entry 250 may further include fields identifying a page table structure and / or specifying a security configuration for accessing a memory region corresponding to the entry 250 (e.g., Figure 6 107) field shown in .
[0077] The address 257 provided in the entry 250 of the address translation table 217 may be a memory address of a page table or page directory. At least a portion of the offset 196 may be used as a virtual page number and index into the page table or page directory for locating the next page table or page directory. The process of locating the next page table or page directory may be repeated until the entry found using the last virtual page number in the offset 196 is used to locate the page table entry (e.g., Figure 7 The base address 157 of the physical memory page identified in the page table entry 153 may be combined with the remainder of the offset 196 (e.g., as shown in FIG. Figure 7 ) to generate a physical address (e.g., Figure 7 159) as shown in FIG.
[0078] Optionally, hash 121 may be applied to the entire virtual address 195 so that address 257 found using index 125 is a physical address. In this embodiment, entry 250 may be viewed as a page table entry and may contain a security configuration for the memory address (e.g., Figure 6 107 shown in FIG. 107 ). However, this implementation may require a larger address translation table 217.
[0079] Alternatively, hash 121 may be applied to a combination of object ID 199, optionally object type 198, and a portion of offset 196; and address 257 looked up using index 125 is the base address of the physical address page (e.g., Figure 7157 shown in FIG. 157). The remainder of offset 196 may be different from the base address (e.g., Figure 7 ) are combined to generate a physical address (e.g., 159). In this embodiment, the address translation table 217 can be viewed as a page table (e.g., Figure 7 151 shown in ); the portion of address 195 used to generate index 125 from hash 121 can be considered an entry ID (e.g., Figure 7 145) or a virtual page number (VPN); and entry 250 may be viewed as a page table entry (eg, Figure 7 153 shown in ), and may optionally include security configuration of the memory address (e.g., 107).
[0080] Alternatively, hash 121 may be applied to a combination of object ID 199, optionally object type 198, and a portion of offset 196; and address 257 in entry 250 looked up using index 125 is the address of the page table (e.g., Figure 7 Because entry 250 identifies a page table (e.g., 153), the portion of address 195 used to generate index 125 from hash 121 can be considered a table ID (e.g., Figure 7 143 shown in FIG. 144 ). A portion of offset 196 may be used as an entry ID 145 or virtual page number (VPN) in a page table (e.g., 153) to locate a page table entry (e.g., 153) containing a base address 157 of a memory page or memory region 137; and the remainder of offset 196 may be combined with base address 157 to produce physical address 159.
[0081] Alternatively, hash 121 may be applied to a combination of object ID 199, optionally object type 198, and a portion of offset 196; and address 257 in entry 250 found using index 125 is the address of a page directory. Offset 196 may have one or more virtual page numbers for one or more page directories or page tables. The virtual page numbers (VPNs) in offset 196 are used to index the page directory to find the base address of a subsequent page directory or page table. The last virtual page number (VPN) in offset 196 is used to index the page table (e.g., 153) to retrieve the page table entry 153 containing the base address 157 of memory region 137. In this embodiment, the leading portion of address 195 (including the virtual page numbers (VPNs) before the last virtual page number (VPN)) may be considered to be table ID 143.
[0082] In some examples, when different object IDs are hashed to produce the same index 125, a conflict chain 260 may be used to identify a unique address associated with each of the object IDs. In this case, address 257 may be used to identify a table, list, or chain of conflict chains 260 storing a unique entry (e.g., 262 or 264) from which an address translation for object ID 199 may be located. The unique entry (e.g., 262 or 264) found from conflict chain 260 may have a structure similar to entry 250 found directly from address translation table 217 without a conflict.
[0083] In some embodiments, Figure 1 Different processes running in the illustrated computer system may have different virtual address spaces and therefore different entries in address translation table 217. In this case, the process ID may be combined with a portion of address 195 used for hash 121 to produce index 125. Optionally, object ID 199 includes or indicates the process ID.
[0084] In some embodiments, different virtual machines use different page tables or page directories that are looked up from address translation table 217. Thus, the contents of virtual machine registers 231 may be combined with object ID 199 and / or another portion of virtual address 195 to generate index 125 via a function of hash 121.
[0085] The domain register 117 of the computer processor 169 may be used to store the domain identifier of the routine currently being executed in the computer processor 169. For example, after executing an instruction that causes a domain crossover, the contents of the domain register 117 may be updated to store the domain identifier specified in the instruction after the instruction is successfully processed. The contents of the domain register may control various security operations of the processor 169.
[0086] For example, when execution of an instruction results in a request to access a memory location identified using a virtual memory address, the virtual memory address can be converted to a physical memory address using one or more page tables. The contents of the domain register can be used to select permission bits in a page table entry for memory accesses made in the current domain. The selected permission bits can control the processing of requests to access a memory location identified by a virtual memory address.
[0087] For example, when a routine with a virtual memory address is called for execution, the contents of the domain register may be used to select a security bit in the page table entry for translating the virtual memory address into a physical memory address. The selected security bit is used to execute the routine while servicing the current domain identified by the domain register. The selected security bit controls security operations that separate resources and / or data between the called routine and the calling routine.
[0088] For example, when the execution of an instruction generates a request to access a privileged register, the contents of the domain register may be used to select permission bits in, for example, a permission register for the current domain to access the privileged register. The permission bits may control the acceptance or rejection of the request to access the privileged register.
[0089] Figure 6 A system is shown that controls security operations applied to resources (eg, 131 ) according to domain register 117 .
[0090] exist Figure 6 , security control 119 is implemented based on current domain 123 specified in domain register 117 and security configuration 107 having settings 111, 113, ..., 115 individually specified for predefined domains 101, 103, ..., 105. Security control 119 is applied to resource 131, which may be privileged register 133, called routine 135, memory area 137, etc.
[0091] The security configuration 107 may have settings 111 , 113 , . . . , 115 for the domains 101 , 103 , . . . , 105 , respectively, without relying on a static trust hierarchy among the domains 101 , 103 , . . . , 105 .
[0092] When the routine is being executed in the processor 169, the domain register 117 causes the security control 119 to select a setting (e.g., 111, 113, ..., or 115) that is previously associated with a domain (e.g., 101, 103, ..., or 105) that matches the current domain 123. The selected setting (e.g., 111, 113, ..., or 115) is used by the security control 119 to customize the security operation of the resource 131.
[0093] For example, when execution of instructions of a routine in processor 169 requests memory access to memory area 137, a selected setting (e.g., 111, 113, ... or 115) that matches its pre-associated domain (e.g., 101, 103, ..., 105) with the current domain 123 is used by security control 119 to determine whether memory access is permitted.
[0094] For example, different regions (e.g., 137) in memory 109 may be configured with different security configurations (e.g., 107); and each security configuration (e.g., 107) may include different permissions (e.g., 111, 113, ..., 115) for different domains 101, 103, ..., 105. For example, security configuration 107 may be specified in a page table entry for logical to physical address translation of a virtual memory address, so that the structure of a memory region may correspond to a memory page structure, as described below in conjunction with Figure 7 Further discussion.
[0095] For example, physical memory 109 may be divided into multiple regions; each region (eg, 137) may be a page of physical memory 109 or a group of pages of physical memory 109 used for memory management.
[0096] For example, a typical memory area 137 may have a corresponding security configuration 107 specified for the set of predefined domains 101, 103, ..., 105. The security configuration 107 explicitly identifies the permissions (e.g., 111, 113, ..., 115) of each domain 101, 103, ..., 105. Therefore, the privileges of a routine accessing the memory area 137 do not depend on the hierarchy of the domains 102, 103, ..., 105.
[0097] In one example, when a routine executed in the current domain 123 accesses memory to the memory region 137 for instruction reading, writing, or execution, the domain register 117 causes the security control 119 to check the permissions specified in the settings 111, 113, ..., or 115 corresponding to the current domain 123. Whether access to the memory region 137 is blocked (or denied) for a particular operation type (e.g., read, write, execute) by executing instructions of the routine in the current domain 123 can be determined based on the corresponding permission bits selected for the operation type according to the current domain 123 of the memory region 137. Some details and examples of permissions for memory access to the memory region 137 can be found in U.S. Patent Application No. 62 / 724,896, filed on August 30, 2018, and entitled "Memory Access Control through Permissions Specified in Page Table Entries for Execution Domains", the entire disclosure of which is hereby incorporated by reference herein.
[0098] In general, different routines of the same domain (eg, 103) may be configured in different memory areas, and therefore configured to have different permissions and security settings for the same domain (eg, 103).
[0099] Furthermore, a routine may be configured to store different portions of its data in different memory areas (eg, 137), and therefore configured to have different permissions to access from the same domain (eg, 101, 103, ... or 105).
[0100] In another example, when a routine executing in the current domain 123 calls a called routine 135 stored in the memory area 137 for execution, the domain register 117 causes the security control 119 to check the permissions specified in the settings 111, 113, ..., or 115 corresponding to the current domain 123. Whether to deploy security measures to protect the resources of the calling routine from the called routine 135 and / or to protect the resources of the called routine 135 from the calling routine can be determined based on the corresponding permission bits specified for the current domain 123 and the memory area 137.
[0101] Security measures may include sandboxing. Sandboxing generally includes computer security measures that isolate the execution of a set of instructions (e.g., an application) from certain system resources and / or other instruction / program sets. For example, sandboxing can be implemented using a shadow stack structure, in which the calling routine and the called routine are configured to use separate stacks and stack-related control registers, and the calling routine may not be able to access the stack assigned to the called routine, and the called routine may not be able to access the stack assigned to the calling routine. Some details and examples of the shadow stack structure can be found in U.S. Patent Application No. 62 / 724,913, filed on August 30, 2018 and entitled "Security Configurations in Page Table Entries for Execution Domains", the entire disclosure of which is hereby incorporated by reference herein.
[0102] For example, the security configuration 107 of the typical memory area 137 may have sandboxing settings (e.g., 111, 113, ..., 115) specified for the set of predefined domains (e.g., 101, 103, ..., 105), respectively. The sandboxing configuration 107 explicitly identifies whether a call to execute a callee routine 135 stored in the area 137 requires a sandboxing operation. Calls to execute the same routine 135 from routines executed in different domains 101, 103, ..., 105 may have different settings 111, 113, ..., 115; and the settings 111, 113, ..., 115 specify whether calls from the respective domains 101, 103, ..., 105 require sandboxing (e.g., protecting the callee routine 135 and the calling routine from affecting each other). Thus, based on the current domain 123 identified in the domain register 117 and the explicit settings (e.g., 111, 113, ..., 115) configured for the corresponding domains 101, 103, ..., 105, sandboxing operations can be selectively applied to execute the called routine 135 stored in the memory area 137 without relying on a predefined hierarchy of domains 102, 103, ..., 105.
[0103] For example, a calling routine in the current domain 123 may call a called routine 135. Whether a sandboxing operation is activated for executing a call to the called routine 135 stored in the memory area 137 may be determined based on a sandbox setting (e.g., 111, 113, ..., or 115) specified for a corresponding domain (e.g., 101, 103, ..., or 105) of the current domain 123 that matches the memory area 137. Thus, the sandboxing operation may be activated independent of the relative hierarchy between the domain of the called routine 135 and the current calling domain 123.
[0104] For example, the sandbox settings 107 for a routine stored in the memory region 137 may be specified in a page table entry for logical to physical address translation of a virtual memory address, such that the structure of the memory region may correspond to a memory page structure, as described below in conjunction with Figure 7 Further discussion.
[0105] In another example, when a routine executing in the current domain 123 requests access to the privileged register 133, the domain register 117 causes the security control 119 to check the permissions specified in the settings 111, 113, ..., or 115 of the privileged register 133. Whether access is granted or blocked can be determined based on the corresponding permission bits specified for the current domain 123 and the privileged register 133.
[0106] For example, the privilege register 133 may have different permissions 111, 113, ..., 115 for different domains 101, 103, ..., 105, respectively. When an instruction executed in the current domain 123 requests access to the privilege register 133, the domain register 117 enables the security control 119 to select a corresponding permission (e.g., 111, 113, ... or 115) corresponding to the current domain 123 to control the access.
[0107] , 105 (eg, non-hierarchical) without relying on a predefined trust hierarchy of domains 102 , 103 , . . . , 105 .
[0108] In some examples, privileged register 133 may be accessed for different operation types, such as read, write, execute, etc. The permission (e.g., 111, 113, ..., or 115) of a particular domain (e.g., 101, 103, ..., or 105) to access privileged register 133 may have separate permission bits for the corresponding operation type (e.g., read, write, and / or execute).
[0109] Security configuration 107 may be configured to allow instructions executing in one domain (eg, 101, 103, ..., 105) to access registers 133 for one operation type (eg, read), but not for another operation type (eg, write).
[0110] The security configuration 107 may be configured to allow instructions executed in one domain (e.g., 103) to access registers (e.g., 133) via one permission setting (e.g., 113) of the domain (e.g., 103), but prohibit the same instructions running in another domain (e.g., 101) from accessing registers 133 via another parallel setting (e.g., 111) of the domain (e.g., 101), even though in a conventional protection ring, the disallowed domain (e.g., 101) may have higher privileges (and therefore be more trusted) than the allowed domain (e.g., 103).
[0111] In one embodiment, security configuration 107 is hardwired in the processor in privileged registers 133. In another embodiment, security configuration 107 may be set via firmware in the processor's registers 133 during the computer system's startup / boot process. In another embodiment, security configuration 107 may be changed during normal operation of the computer system via privileged software.
[0112] For example, the security configuration 107 of the privileged registers 133 may change when the processor 169 switches from running a program in one domain (eg, 101 ) to running a program in another domain (eg, 103 ).
[0113] For example, the security configuration 107 of the privileged registers 133 may be changed upon request when the computer system switches from running one routine to another, where the routines may be in the same domain (eg, 101).
[0114] For example, the security configuration 107 of the privileged register 133 can be configured in a permission register, which uses the permission bits stored in the permission register to control access to the privileged register 133; and the content of the permission register can be updated by an authorized process that adjusts / customizes the security level of the computer system for the current calculation. Alternatively, the permission bits of different domains 101, 103, ..., 105 can be specified in separate registers corresponding to domains 101, 103, ..., 105 respectively. Some details and examples of permission registers can be found in U.S. Patent Application No. 62 / 724,929, filed on August 30, 2018 and entitled "Access Control for Processor Registers based on Execution Domains", the entire disclosure of which is hereby incorporated by reference into this document.
[0115] because Figure 6 The security control system does not rely on a predefined domain trust hierarchy (ie, is non-hierarchical), so it can provide better flexibility and finer control granularity than conventional protection rings.
[0116] Figure 7 Page table entries 153 with security configuration 107 for execution domains (eg, 101 , 103 , . . . , 105 ) are shown.
[0117] For example, the security configuration 107 in the page table entry may be a sandboxing configuration for permissions to access the memory region 137 identified by the page table entry 153 and / or for calling routines stored in the memory region 137 identified by the page table entry 153 .
[0118] A typical virtual address 141 in virtual address space 127 may be translated into a corresponding physical address 159 in physical address space 129 using page table 151. In general, multiple page tables (eg, 151) may be used to map virtual address space 127 to physical address space 129.
[0119] Virtual address 141 may include table ID 143, entry ID 145, and offset 147. Table ID 143 may be used to identify a page table 151 containing a page table entry 153 for a page containing a memory cell identified by virtual address 141 and physical address 159. Entry ID 145 is used as an index into page table 151 to efficiently locate page table entry 153. Page table entry 153 provides a base address 157 for physical address 159. Physical addresses in the same memory page share the same base address 157. Thus, base address 157 identifies region 137 in memory 109. Offset 147 of virtual address 141 is used as a corresponding offset 147 for page or region 137 in memory 109. The combination of base address 157 and offset 147 provides a physical address 159 corresponding to virtual address 141.
[0120] exist Figure 7 In FIG. 1 , page table entry 153 specifies not only a base address 157 of page or region 137, but also a security configuration 107 for page or memory region 137, such as permission to read data into memory region 137 corresponding to base address 157, permission to write data into memory region 137, permission to execute instructions stored in memory region 137, and sandboxing requirements for calling routines stored in memory region 137. Security configuration 107 may have permissions for Figure 1 and 6 , 105. The current domain 137 in the domain register 117 controls which of the settings 111, 113, ..., 115 is used for the current memory access or current call to the routine 135 stored in the memory area 137.
[0121] Optionally, the page table entry 153 may specify other attributes 155 of the physical memory page, such as whether the data in the page is valid, whether the page is in main memory, whether the page is invalid (e.g., changes to the data in the physical memory page have not yet been flushed to long-term memory / storage relative to the memory area 137). For example, the attributes 155 may include a page fault bit indicating whether the page is in the main memory of the computer or in the storage device of the computer. If the permissions of the security configuration 107 allow current access to the memory page and the page fault bit indicates that the page is not currently in the main memory of the computer, then the memory management unit 181 may swap the page from the storage device into the main memory of the computer to facilitate access to the page identified by the page table entry 153. However, if the permissions of the security configuration 107 deny current access to the page for the current execution domain, then it is not necessary to evaluate the page fault bit and / or swap in the page corresponding to the page table entry 153.
[0122] In general, table ID 143 may be divided into multiple fields for locating page table 151. For example, table ID 143 may include a top table ID that identifies a top-level page table and a top table entry ID that is used as an index into the top-level page table to retrieve a page table entry containing an identifier for page table 151 (similar to how entry ID 145 indexes page table 151 to identify page table entry 153 containing base address 157).
[0123] In general, entry ID 145 may be considered a virtual page number in page table 151 ; and the virtual page number (eg, 145 ) may be used in page table 151 to look up a page table entry 153 containing base address 157 .
[0124] For example, table ID 143 may include a set of virtual page numbers that can be used to identify a series of page tables, such as 151. Each virtual page number is used as an index in a page table (or page directory) to identify a page table entry (or page directory entry) containing the identification or base address of the next level of page table (or page directory).
[0125] In some instances, different running processes in a computer may have different virtual address spaces (e.g., 127); and the process ID of the running process may be used to determine the top-level page table (or page directory). In some instances, a hash of a portion of virtual address 141, the process ID, and / or an identification of a virtual machine hosted in the computer system may be used to locate the top-level page table (or page directory). In some instances, the hash is used as an index or key to look up a page table entry. Regardless of how page table entry 153 is located (e.g., via indexing through multiple page tables, via use of a hash as an index or key), the contents of page table entry 153 may be Figure 7 The manner shown in FIG. 1 is configured to provide a security configuration 107 for different domains 101 , 103 , . . . , 105 to access pages / memory areas 137 corresponding to base addresses 157 and / or routines stored in memory areas 137 .
[0126] exist Figure 7 , the security configuration 107 for a page or region 137 is specified in an underlying page table 151 , where a page table entry 153 in the underlying page table 151 provides a base address 157 for a physical address 159 .
[0127] Alternatively or in combination, a higher-level page table (or page directory) may also have security configurations for its page table entries (or page directory entries). For example, a page table entry (or page directory entry) identifying page table 151 may have security configurations for all pages in page table 151; and therefore, domain permission data in the page table entry may apply to the memory region defined by page table 151. The hierarchy of security configurations in the series of page table entries leading to page table 151 and the security configuration 107 in the bottom page table entry 153 may be combined via a logical AND operation or a logical OR operation.
[0128] For example, if all permission bits in the series of page table entries leading to base address 157 (including bottom table entry 153) have values that allow access, then a routine running in a domain (e.g., 101, 103, ..., 105) may be allowed to access a page identified by base address 157. Alternatively, if any permission bit in the series of page table entries leading to base address 157 (including bottom table entry 153) has a value that allows access, then a routine running in a domain (e.g., 101, 103, ..., 105) may be allowed to access a page identified by base address 157.
[0129] For example, if any permission bit in the series of page table entries leading to base address 157 (including bottom table entry 153) has a value that denies access, then a routine running in a domain (e.g., 101, 103, ..., 105) may be denied access to a page identified by base address 157. Alternatively, a routine running in a domain (e.g., 101, 103, ..., 105) may be denied access to a page identified by base address 157 only if all permission bits in the series of page table entries leading to base address 157 (including bottom table entry 153) have a value that denies access.
[0130] For example, when a non-lower level page table entry (or page directory entry) indicates that memory access is prohibited, the operation of translating from virtual address 141 to physical address 159 may be interrupted to deny memory access associated with virtual address 141. In response to the denial, a software trap designated to handle the denial is used.
[0131] For example, the security configuration 107 may include a set of sandbox setting bits (e.g., 111, 113, ..., 115) respectively for the set of domains 101, 103, ..., 105. When the sandbox setting bit (e.g., 111, 113, ..., or 115) corresponding to the current domain 123 in the domain register 117 is set to have a first value (e.g., 1 or 0), a current call from a routine in the current domain 123 to a called routine 135 stored in the area 137 is implemented to protect the calling routine and the called routine 135 from each other using a sandboxing operation (e.g., by using a shadow stack to separate the caller and the called program in stack usage). When the sandbox setting bit (e.g., 111, 113, . . . or 115) corresponding to the current domain 123 in the domain register 117 is set to have a second value (e.g., 0 or 1), a call from a routine in the current domain 123 to a called routine 135 stored in the memory area 123 is implemented without using a sandboxing operation to isolate the caller and the callee from each other (e.g., without using a shadow stack).
[0132] Optionally, the security configuration (eg, 107) is specified in the bottom level page table 151 rather than in a higher level page table (directory).
[0133] Figure 8 A computer system is shown having a domain register 117 that controls security operations.
[0134] For example, Figure 8 The computer system may optionally have storage for Figure 1 and 6 The routine access in the predefined domains 101, 103, ..., 105 shown in FIG. Figure 7 The page table entry 153 of the memory region identified by the security configuration 107 of the page table (eg, 151). In addition, Figure 8 The computer system may optionally have Figure 1 and 2 Domain access tables 217, ..., 227 are provided to facilitate and protect domain crossing.
[0135] For example, Figure 8 A computer system may have storage for accessing Figure 1 and 6 One or more permission registers of the security configuration 107 of the privileged registers 133 of the predefined domains 101, 103, ..., 105 shown in FIG.
[0136] The domain register 117 of the processor 169 stores an identifier of the current domain 123. The contents of the domain register 117 select a set of applicable settings in the security configuration 107 corresponding to the current domain 123.
[0137] Figure 8 The computer system has a host system 165 coupled to a memory system 161 via one or more buses 163. The memory system 161 has memory components 171, . . . , 173.
[0138] For example, bus 163 may include a memory bus connected to one or more memory modules and / or include a peripheral Internet connected to one or more storage devices. Some of the memory components 171, ..., 173 may provide random access; and some of the memory components 171, ..., 173 may provide permanent storage capabilities. Some of the memory components 171, ..., 173 may be volatile, because when the power supply to the memory component is temporarily disconnected, the data stored in the memory component will be damaged and / or erased. Some of the memory components 171, ..., 173 may be non-volatile, because the memory component is able to retain the contents stored therein for a long period of time without power.
[0139] In general, the memory system 161 may also be referred to as a memory device. An example of a memory device is a memory module connected to a central processing unit (CPU) via a memory bus. Examples of memory modules include dual in-line memory modules (DIMMs), small outline DIMMs (SO-DIMMs), non-volatile dual in-line memory modules (NVDIMMs), etc. Another example of a memory device is a storage device connected to a central processing unit (CPU) via a peripheral interconnect (e.g., an input / output bus, a storage area network). Examples of storage devices include solid-state drives (SSDs), flash drives, universal serial bus (USB) flash drives, and hard disk drives (HDDs). In some examples, the memory device is a hybrid memory / storage system that provides memory functions and storage functions.
[0140] Memory components 171, ..., 173 may include any combination of different types of non-volatile memory components and / or volatile memory components. Examples of non-volatile memory components include NAND-type flash memory having one or more memory cell arrays, such as single-level cells (SLC) or multi-level cells (MLC), such as triple-level cells (TLC) or quad-level cells (QLC). In some examples, a particular memory component may include an SLC portion and an MLC portion of a memory cell. Each memory cell may store one or more data bits (e.g., a data block) for use by the host system 165. Alternatively or in combination, memory components 171, ... or 173 may include a type of volatile memory. In some examples, memory components 171, ..., or 173 may include, but are not limited to, random access memory (RAM), read-only memory (ROM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), phase change memory (PCM), magnetic random access memory (MRAM), spin transfer torque (STT)-MRAM, ferroelectric random access memory (FeTRAM), ferroelectric RAM (FeRAM), conductive bridge RAM (CBRAM), resistive random access memory (RRAM), oxide-based RRAM (OxRAM), or non-(NOR) flash memory, electrically erasable programmable read-only memory (EEPROM), nanowire-based nonvolatile memory, memory with memristor technology, and / or a cross-point array of nonvolatile memory cells. The cross-point array of nonvolatile memory can be combined with a stackable cross-grid data access array to perform bit storage based on changes in bulk resistance. Additionally, in contrast to many flash-based memories, cross-point non-volatile memories can perform write-in-place operations, where non-volatile memory cells can be programmed without previously erasing the non-volatile memory cells.
[0141] In general, host system 165 can utilize memory system 161 as physical memory 109 including one or more memory components 171, ..., 173. Host system 165 can load instructions from memory system 161 for execution, provide data to be stored at memory system 161, and request data to be retrieved from memory system 161.
[0142] exist Figure 8In the embodiment of the present invention, the host system 165 includes a memory management unit (MMU) 181 and a processor 169. The processor 169 has an execution unit (e.g., 185), such as an arithmetic logic unit. The processor 169 has a register 183 (e.g., 133) to save instructions for execution, data as operands of instructions, and / or results of instruction execution. The processor 169 may have an internal cache 187 as a proxy for part of the memory system 161.
[0143] In some examples, host system 165 may include multiple processors (eg, 169 ) integrated as multiple processing cores of a central processing unit (CPU) on the same silicon die.
[0144] Routines programmed for execution in processor 169 may be initially stored in memory system 161. Routines may include instructions for hypervisor 102, operating system 104, and application programs 106. Routines initially stored in memory system 161 may be loaded into internal cache 187 and / or registers 183 (e.g., 133) for execution in execution unit 185.
[0145] The running instances of the routines form an execution 167 of the hypervisor 102, the operating system 104, and the application programs 106. In some instances, the hypervisor 102 is not used; and the operating system 104 controls the hardware components (e.g., the memory system 161, peripheral input / output devices, and / or network interface cards) without the hypervisor.
[0146] Execution 167 of hypervisor 102, operating system 104, and / or application 106 accesses memory 137 (e.g., in memory components 171, ..., 173) using virtual memory addresses (e.g., 141) defined in one or more virtual memory spaces (e.g., 127). At least one page table 151 (e.g., such as Figure 7 ) converts a virtual memory address (eg, 141) used in execution into a physical memory address (eg, 159) of a memory component (eg, 171, ..., 173).
[0147] like Figure 1As shown in , the execution of routines of the hypervisor 102, the operating system 104, and the application 106 can be organized into multiple domains 101, 103, ..., 105. For each of the execution domains 101, 103, ..., 105 and the memory region 137 identified by the page table entry 153, the page table entry 153 identifies the setting of the security configuration bits (e.g., 111, 113, ..., 115) for accessing the region 137 in a predefined operation type (e.g., read, write, execute, etc.). The configuration bits of the corresponding security configuration (e.g., 107) control the corresponding type of memory access in the corresponding execution domain (e.g., 101) and / or control the sandboxing operation for isolating the calling routine and the called routine (e.g., 135).
[0148] The security configuration 107 of the privileged register 133 can be stored in a separate permission register. Each of the permission registers is pre-associated with a domain (e.g., 101, 103, ..., 105). The permission register stores permission bits for accessing the privileged register 133 from the corresponding domain (e.g., 101, 103, ... or 105). Different permission bits in the permission register can be configured for different privileged registers (e.g., 133). In some instances, the privileged register 133 may have multiple permission bits in the permission register for different access types (e.g., read, write, execute).
[0149] Alternatively, the permission bits of privilege register 133 may be specified in the same permission register. In addition, the permission bits of different privilege registers (eg, 133) may be stored in different portions of the same permission register.
[0150] Fig. 9 A method of performing address translation of a virtual machine based on virtual machine registers is shown.
[0151] For example, Fig. 9 The method can be Figure 1 or 8. Fig. 9 The method can be Figure 2-5 and 7 address translation techniques and / or Figure 6-8 It is executed in a combination of security technologies.
[0152] At box 301 , the memory 109 stores at least a set of instructions for routines of predefined domains 101 , 103 , . . . , 105 .
[0153] For example, a set of predefined domains may include at least one of a hypervisor's domain, an operating system's domain, or an application's domain, or any combination thereof.
[0154] At block 303 , the computer system provides a virtual machine register 231 in the processor 169 coupled to the memory 109 .
[0155] At block 305 , the processor 169 stores in the virtual machine register 231 an identifier of the virtual machine in which the processor 169 is currently executing instructions in one of the domains.
[0156] At block 307 , the processor 169 enforces resource limits of the virtual machine based on the identifier stored in the virtual machine register 231 when executing instructions in the virtual machine.
[0157] For example, the processor 169 may be configured to capture an operation performed when executing the operating system 104 running in the virtual machine when generating a page table entry that maps a virtual address page to a pseudo-physical address page. In response to the operation of the operating system 104 running in the virtual machine being captured, the processor 169 is configured to execute a routine of the hypervisor 102 to identify a physical address page corresponding to the pseudo-physical address page in the virtual machine. The processor 169 is configured to modify the page table entry that maps the virtual address page to the pseudo-physical address page to a page table entry that maps the virtual address page to the physical address page, so that the virtual address page can be exempted from the subsequent conversion from the pseudo-physical address in the virtual machine to the physical address in the memory 109.
[0158] At block 309 , the processor 169 converts the virtual memory address 195 or 141 to the physical memory address 129 based at least in part on the identifier stored in the virtual machine register 231 .
[0159] For example, the processor 169 may use the identifier stored in the virtual machine register to look up the address translation table, as described above in conjunction with Figure 3 Discussed.
[0160] For example, processor 169 may generate index 125 based at least in part on an identifier stored in virtual machine register 231 and use index 125 to retrieve entry 250 in address translation table 217 to translate virtual address 195 or 141 into physical address 159 .
[0161] For example, processor 169 may combine a portion of virtual address 195 or 141 and an identifier stored in virtual machine register 231 and hash 121 the combination to generate index 125. The portion of virtual address 195 or 141 used to generate the index via hash 121 may include a portion of object identifier 199, object type 196, and / or offset 196 within the object identified by object identifier 199. In some examples, the combination hashed 121 to generate index 125 may further include a process identifier and / or an identifier of a current domain 123 stored in domain register 117.
[0162] The technology disclosed herein may be applicable at least to a computer system in which a processor is separated from a memory and the processor communicates with the memory and storage device via a communication bus and / or a computer network. In addition, the technology disclosed herein may be applicable to a computer system in which processing capabilities are integrated into a memory / storage device. For example, a processing circuit including an execution unit and / or a register of a typical processor may be implemented in an integrated circuit and / or an integrated circuit package of a memory medium to perform processing in a memory device. Therefore, the processor (e.g., 101) as discussed above and shown in the accompanying drawings is not necessarily a central processing unit in a von Neumann architecture. The processor may be a unit integrated into a memory to overcome a von Neumann bottleneck, which limits computing performance because of throughput limitations caused by latency in data movement between a central processing unit and a memory configured separately according to a von Neumann architecture.
[0163] The description and drawings of the present disclosure are illustrative and should not be construed as limiting. Many specific details are described to provide a thorough understanding. However, in some instances, well-known or conventional details are not described to avoid obscuring the description. Reference to one or a certain embodiment in the present disclosure is not necessarily a reference to the same embodiment; and such reference means at least one.
[0164] In the foregoing description, the present disclosure has been described with reference to specific exemplary embodiments of the present disclosure. It will be apparent that various modifications may be made thereto without departing from the broader spirit and scope as set forth in the appended claims. Therefore, the description and drawings should be regarded as illustrative rather than restrictive.
Claims
1. A computer system comprising: a memory configured to store at least instructions for a set of routines for a predefined domain; as well as a processor coupled to the memory, the processor comprising: a memory management unit configured to store an entry to perform an address translation using a first base address of an address translation table; as well as A virtual machine register is independent of the memory management unit and is configured to store an identifier of a virtual machine in which the processor is currently executing instructions in a current domain in the set of domains, the processor being configured to implement resource limits based on the identifier of the virtual machine.
2. The computer system of claim 1 , wherein the set of predefined domains comprises at least one of a hypervisor's domain, an operating system's domain, or an application's domain, or any combination thereof; and wherein the domains do not have a predefined trust level. 3 . The computer system of claim 2 , wherein the processor is further configured to perform address translation based at least in part on the identifier stored in the virtual machine register. 4 . The computer system of claim 3 , wherein the processor is configured to look up an address translation table using the identifier stored in the virtual machine register.
5. The computer system of claim 3, wherein the processor is configured to generate an index based at least in part on the identifier stored in the virtual machine register and use the index to retrieve an entry in an address translation table to translate a virtual address into a physical address. 6 . The computer system of claim 5 , wherein the processor is configured to combine a portion of the virtual address and the identifier stored in the virtual machine register to generate the index.
7. The computer system of claim 6, wherein the processor is configured to hash a combination of the portion of the virtual address and the identifier to generate the index.
8. The computer system of claim 7, wherein the portion of the virtual address includes an object identifier specified in the virtual address.
9. The computer system of claim 2, wherein the processor is configured to convert a pseudo physical address used in the virtual machine into a physical address in the memory based on the identifier stored in the virtual machine register.
10. The computer system of claim 9, wherein the processor is configured to convert a page table entry that maps a virtual memory page to a pseudo physical memory page in the virtual machine to a page table entry that maps the virtual memory page to a physical memory page in the memory.
11. A method comprising: storing in a memory instructions for at least a set of routines for a predefined domain; In a processor coupled to the memory, there is provided: a memory management unit configured to store an entry to perform an address translation using a first base address of an address translation table; and Virtual machine registers; storing, independently of the memory management unit, in the virtual machine register, an identifier of a virtual machine in which the processor is currently executing instructions in one of the domains; as well as A virtual memory address is converted to a physical memory address based at least in part on the identifier stored in the virtual machine register.
12. The method according to claim 11, further comprising: When executing instructions in the virtual machine, resource restrictions are enforced based on the identifier of the virtual machine.
13. The method of claim 12, wherein said implementing said resource restriction comprises: A page table entry that maps a virtual memory page to a pseudo-physical memory page in the virtual machine is converted into a page table entry that maps the virtual memory page to a physical memory page in the memory.
14. The method of claim 13, wherein the converting the virtual memory address into the physical memory address comprises: A page table is identified using an index generated at least in part based on the identifier stored in the virtual machine register.
15. The method according to claim 14, further comprising: The index is generated by hashing a combination of the identifier stored in the virtual machine register and at least a portion of the virtual memory address.
16. A computer processor comprising: at least one execution unit configured to execute instructions of a set of predefined domains; a memory management unit configured to store an entry to perform an address translation using a first base address of an address translation table; and A virtual machine register is independent of the memory management unit and is configured to store an identifier of a virtual machine in which the computer processor is currently executing instructions in a current domain in the set of domains.
17. The computer processor of claim 16, further configured to implement resource limits based on the identifier stored in the virtual machine register.
18. The computer processor of claim 17, further comprising: A memory management unit is configured to perform a translation of a virtual memory address to a physical memory address based at least in part on the identifier stored in the virtual machine register.
19. The computer processor of claim 18, wherein the memory management unit is configured to hash a combination of the identifier stored in the virtual machine register and at least a portion of the virtual memory address to generate an index, and apply the index to locate a page table entry to convert the virtual memory address to the physical memory address.
20. The computer processor of claim 19, further configured to translate a page table entry that maps a virtual memory page to a pseudo-physical memory page in the virtual machine into a page table entry that maps the virtual memory page to a physical memory page.
