Data sharing method of secure virtual machine and related device
By generating virtual machine shared keys and using shared memory in the on-chip system of the cloud platform, the problem of data sharing security and efficiency between virtual machines is solved, and safe and efficient data sharing is achieved.
Patent Information
- Application Number
- CN202410683055.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-08-27
AI Technical Summary
In the cloud platform, during the data sharing process between virtual machines, how to ensure data security and efficiency, especially in a multi-tenant environment, it is difficult for existing technology to effectively solve the problems of data sharing security and resource utilization between virtual machines. question.
By using the data sharing method of a secure virtual machine in the system-on-chip, a virtual machine shared key corresponding to the secure virtual machine is generated, and shared memory is used for data sharing to ensure the security and efficiency of data during transmission.
It improves the security and convenience of data sharing between virtual machines, reduces resource waste, avoids the risk of virtual machine monitors stealing data, and improves data sharing efficiency.
Smart Images

Figure CN118550647A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer application technology, in particular, to trusted technology under the field of computer application technology, and more particularly, to a data sharing method and related device for a secure virtual machine. Background Art
[0002] With the continuous development of computer application technology, new types of software delivery models such as SaaS (Software as a Service) have emerged. Cloud platform vendors can provide software services through the Internet, and users do not need to install and maintain software locally. In this model, software vendors will develop and maintain a software application, and multiple tenants (or users) can share this application.
[0003] Cloud platform vendors can provide software services to multiple users in the form of SaaS by running software with architectures such as multi-tenant applications on cloud platforms. Multi-tenant applications are a type of software architecture where multiple tenants share the same software instance and database, but each tenant's data and configuration are isolated to ensure data security and privacy. This architecture can improve resource utilization, reduce maintenance costs, and provide better scalability.
[0004] In a cloud platform, multiple virtual machines may run on the same physical server. By sharing data, the duplication of storage resources can be reduced, costs can be reduced, and resource utilization can be improved. In the process of data sharing, it is necessary to ensure the security of a large amount of data, such as the private data of multiple tenants and the private data of cloud platform vendors. Therefore, it is of great significance to ensure the security of the cloud platform, especially the security of data sharing between virtual machines. Summary of the invention
[0005] The embodiments of this specification provide a data sharing method and related devices for a secure virtual machine to achieve the purpose of improving the security of a cloud platform.
[0006] To achieve the above technical objectives, the embodiments of this specification provide the following technical solutions:
[0007] In a first aspect, an embodiment of the present specification provides a data sharing method for a secure virtual machine, which is applied to a first processor in a system on chip, where the first processor is used to run a secure firmware, and the system on chip also includes a second processor, where the second processor is used to run a secure virtual machine, and the data sharing method for the secure virtual machine includes:
[0008] In response to a configuration operation for a current secure virtual machine, generating a virtual machine shared key corresponding to the current secure virtual machine according to configuration information of the current secure virtual machine; the configuration information of the secure virtual machine includes shared memory information; the shared memory information is used to create a shared memory;
[0009] In response to a data sharing request carrying target secure virtual machine information, the secure firmware uses the shared memory to share the shared data with the target secure virtual machine based on a virtual machine sharing key corresponding to the current secure virtual machine.
[0010] In a second aspect, an embodiment of the present specification provides a data sharing device for a secure virtual machine, which is applied to a first processor in a system on chip, the first processor is used to run a secure firmware, the system on chip also includes a second processor, the second processor is used to run a secure virtual machine, and the data sharing device for the secure virtual machine includes:
[0011] A second shared key module, configured to generate a virtual machine shared key corresponding to the current secure virtual machine in response to a configuration operation for the current secure virtual machine according to configuration information of the current secure virtual machine; the configuration information of the secure virtual machine includes shared memory information; the shared memory information is used to create a shared memory;
[0012] The second data sharing module is used to respond to a data sharing request carrying target secure virtual machine information, and the secure firmware uses the shared memory to share the shared data with the target secure virtual machine based on the virtual machine sharing key corresponding to the current secure virtual machine.
[0013] In a third aspect, an embodiment of the present specification further provides a system on chip, including: a first processor and a second processor; wherein:
[0014] The first processor is used to run the security firmware, and the second processor is used to run the security virtual machine;
[0015] The security firmware is configured to: in response to a configuration operation for a current security virtual machine, generate a virtual machine shared key corresponding to the current security virtual machine according to configuration information of the current security virtual machine; the configuration information of the security virtual machine includes shared memory information; the shared memory information is used to create a shared memory;
[0016] In response to a data sharing request carrying target secure virtual machine information, the secure firmware uses the shared memory to share the shared data with the target secure virtual machine based on a virtual machine sharing key corresponding to the current secure virtual machine.
[0017] In a fourth aspect, an embodiment of the present specification also provides a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the data sharing method of the secure virtual machine as described above when executing the computer program.
[0018] In a fifth aspect, an embodiment of the present specification further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the data sharing method of the secure virtual machine as described above is implemented.
[0019] In a sixth aspect, an embodiment of the present specification provides a computer program product or a computer program, wherein the computer program product includes a computer program, and the computer program is stored in a computer-readable storage medium; the processor of the computer device reads the computer program from the computer-readable storage medium, and the processor implements the steps of the above-mentioned secure virtual machine data sharing method when executing the computer program.
[0020] It can be seen from the above technical solution that the data sharing method of the secure virtual machine provided in the embodiment of this specification meets the data sharing requirements between secure virtual machines through the virtual machine shared key, improves the convenience of data sharing between secure virtual machines, and also ensures the security of data sharing between secure virtual machines based on the virtual machine shared key. At the same time, the configuration information of the secure virtual machine includes shared memory information, and the shared memory information is used to create shared memory. In this way, during the data sharing process, the secure firmware can share the shared data with the target secure virtual machine using the shared memory according to the virtual machine shared key corresponding to the current secure virtual machine, which is conducive to improving the efficiency of data sharing. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0022] Figure 1 A schematic diagram of an application scenario provided for an implementation mode of this specification;
[0023] Figure 2 A flowchart of a key management method provided for one embodiment of this specification;
[0024] Figure 3A schematic diagram of a virtual machine encryption key generation and use process provided for one embodiment of this specification;
[0025] Figure 4 A schematic diagram of a process for generating and using a channel unique key provided for one embodiment of this specification;
[0026] Figure 5 A schematic diagram of a virtual machine disk encryption key generation and use process provided for one embodiment of this specification;
[0027] Figure 6 A flowchart of a key management method for a multi-key secure virtual machine provided for one embodiment of this specification;
[0028] Figure 7 A schematic diagram of a process for generating and using a virtual machine shared key provided for one embodiment of this specification;
[0029] Figure 8 A flowchart of a data sharing method for a secure virtual machine provided in one embodiment of this specification;
[0030] Fig. 9 A schematic diagram of the structure of a key management device provided for one embodiment of this specification;
[0031] Fig.10 A schematic diagram of the structure of another key management device provided for one embodiment of this specification;
[0032] Fig.11 A schematic diagram of the structure of another key management device provided for one embodiment of this specification;
[0033] Fig.12 A schematic diagram of the structure of a system on a chip provided for one embodiment of the present specification;
[0034] Fig.13 A schematic diagram of the structure of a computing device provided for one embodiment of the present specification. DETAILED DESCRIPTION
[0035] Unless otherwise defined, the technical terms or scientific terms used in the embodiments of this specification shall have the common meanings understood by persons with ordinary skills in the field to which this specification belongs. The words "first", "second" and similar words used in the embodiments of this specification do not indicate any order, quantity or importance, but are only used to avoid confusion of constituent elements.
[0036] Unless the context requires otherwise, throughout the specification, "plurality" means "at least two", and "including" is interpreted as an open, inclusive meaning, that is, "including, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments", "examples", "specific examples" or "some examples" are intended to indicate that a particular feature, structure, material or characteristic associated with the embodiment or example is included in at least one embodiment or example of the specification. The schematic representation of the above terms does not necessarily refer to the same embodiment or example.
[0037] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0038] Overview
[0039] A cloud platform is an infrastructure service that can provide on-demand computing resources (such as servers, storage, databases, networks, etc.). It abstracts physical resources through virtualization technology and dynamically schedules them, allowing tenants to obtain the required IT (Information Technology) resources at any time according to demand and pay according to usage.
[0040] When tenants use the software services provided by the cloud platform, they can create virtual machines (VMs) in the cloud platform and use the software services and corresponding resources provided by the cloud platform through virtual machines. This method can achieve resource isolation between tenants, prevent malicious attacks or data leakage between different tenants, and help ensure the resource security of tenants. At the same time, providing software services to tenants by creating virtual machines for them is also conducive to meeting tenants' flexible expansion and customization needs for IT resources. Figure 1 , Figure 1 A schematic diagram showing the relationship between tenants and the cloud platform, multiple tenants (such as Figure 1 When tenants A, B, and C in the example use the cloud platform for the first time, they can create their own virtual machines 1 to 3 based on virtualization technology. These virtual machines can be managed by the cloud platform's virtual machine monitor (Hypervisor). For example, the virtual machine monitor manages the virtual machines in physical memory (e.g. Figure 1 After tenants have established their own virtual machines, they can use the software services and corresponding resources provided by the cloud platform based on their own virtual machines. It is understandable that Figure 1Although 3 tenants and 3 virtual machines corresponding to the 3 tenants are shown in FIG. Figure 1 This is only used for exemplary description. In actual applications, the number of virtual machines and the number of tenants may be more or less, and this specification does not list them all here.
[0041] As described in the background technology, since the cloud platform provides services to tenants in the form of virtual machines by sharing hardware resources, these virtual machines share hardware resources, so the security of the cloud platform cannot be ignored. In order to improve the security of the cloud platform, encryption virtualization technology, which is different from traditional virtualization technology, can be used. Encryption virtualization technology can encrypt and protect virtual machines. The encrypted virtual machines are called secure virtual machines (SVM). Secure virtual machines provide a hardware-level isolation environment. This provides infrastructure for confidential computing, ensuring that sensitive data is protected during the computing process.
[0042] In encryption virtualization technology, multiple keys may be used, including HRK (Hardware Root Key, chip manufacturer root key), HSK (Hardware Series Key, chip product key), HEK (Hardware Endorsement Key, chip unique key), CPK (Cloud Provider Key, cloud manufacturer private key), PUK (Platform Unique Key, cloud platform unique key) and SEK (Session Unique Key, channel unique key), etc. Among them, HRK is the root key pre-burned into the chip by the hardware manufacturer (i.e., chip manufacturer). This root key can be used to verify the identity of the chip or to generate other keys. HSK is a key generated by the hardware manufacturer for a series or model of chips. This key can be used to verify the series or model of the chip, or to generate other keys. HEK is a unique key for each chip. This key can be used to verify the unique identity of the chip or to generate other keys. CPK is a private key generated by a cloud service provider (or cloud platform provider). This key can be used to verify the identity of the cloud service provider or to generate other keys. PUK is a unique key generated by the cloud service provider for each cloud platform (for example, a data center or a server cluster). This key can be used to verify the unique identity of the cloud platform or to generate other keys. The existence of PUK can extend the trust chain from the system on chip to the entire cloud platform, ensuring the uniqueness and reliability of the cloud platform. SEK is a unique key generated for each virtual machine or each communication session. This key can be used to protect the communication between the virtual machine and the host machine to prevent eavesdropping or modification by other virtual machines or attackers. The above keys may be used or generated during the startup process of the cloud platform.In addition to the above keys, in some implementations, in order to ensure the isolation and independence of the secure virtual machine, the keys that may be used include a secure virtual machine encryption key, a secure virtual machine disk encryption key, a secure virtual machine transport key, and a secure virtual machine shared key, etc., wherein the secure virtual machine encryption key is used to encrypt the memory content of the virtual machine. In the encryption virtualization technology, different virtual machines can correspond to different virtual machine encryption keys. The virtual machine encryption keys corresponding to each virtual machine can be generated, allocated and managed by a secure coprocessor (SCP). The virtual machine encryption key can be stored in the private memory of the secure coprocessor and called by the cryptographic engine when used. The secure virtual machine disk encryption key is used to encrypt and decrypt the disk content of the virtual machine, including the virtual hard disk file and the image file of the virtual machine. Encrypting the disk content of the virtual machine can prevent unauthorized access and modification, and provide security protection for data at rest. The secure virtual machine transport key can be used to encrypt the private data and state of the secure virtual machine during the secure virtual machine migration process, which means that even if an attacker can monitor the migration process of the secure virtual machine, the private data and state of the secure virtual machine cannot be read or modified. The secure virtual machine shared key can be used to share data between different secure virtual machines. In some embodiments, a secure virtual machine that can share data between different secure virtual machines based on the secure virtual machine shared key is called a multi-key secure virtual machine (Multi-Key SecureVirtual Machine), and a secure virtual machine that cannot share data between different secure virtual machines is called a single-key secure virtual machine. The secure firmware can use at least part of the above-mentioned keys to control and manage the secure virtual machine.
[0043] In order to improve the security of the cloud platform, in this manual, refer to Figure 1 An application processor (AP) and a secure coprocessor (SCP) are set up in the on-chip system of the cloud platform. The control authority of the virtual machine monitor running in the application processor over the secure virtual machine is transferred to the secure firmware on the secure coprocessor, so that the secure firmware can be responsible for at least one of the lifecycle security of the cloud platform, the lifecycle of the secure virtual machine, key scheduling and management, etc.
[0044] The application processor may refer to a processor that runs the cloud platform operating system (OS) and software application services provided by the cloud platform. The security coprocessor may refer to a processor that is specially set up to be responsible for data security, and the security firmware running on the security coprocessor may refer to firmware that is specially used to be responsible for data security. In some embodiments, the virtual machine monitor may configure an API (Application Programming Interface) for communication with the security coprocessor to realize the interaction between the virtual machine monitor and the security coprocessor. In addition to the application processor and the security coprocessor, in some embodiments, a cryptographic engine specifically used for key management and a key storage unit (Key Slot) for key loading and calling may also be set in the system on chip. In order to improve the independence of the cryptographic engine and the key storage unit and ensure the security of the key, in some embodiments, the cryptographic engine may be hardware independent of the security coprocessor and the application processor, and the key storage unit may be a hardware storage unit in the cryptographic engine. In order to ensure the security of the key loaded in the key storage unit, the key storage unit may be set to a write-only and non-readable state, so that the situation where an attacker reads the key loaded in the key storage unit can be avoided, which is conducive to ensuring the security of the key loaded in the key storage unit, thereby ensuring the security of the key during use. When the key storage unit is in a write-only and non-readable state, when the security firmware needs to call the key loaded in the key storage unit, it can initiate an encryption request or a decryption request to the cryptographic engine through a specific interface, and the encryption and decryption process based on the loaded key is completed by the cryptographic engine. For example, in some embodiments, the key storage unit can be a hardware with access functions such as a register. In some embodiments, the key storage unit may include multiple slots (Key Slot), each of which can be used to load a key, so that the key storage unit can load multiple keys, meeting the security firmware's management and call requirements for the keys of multiple secure virtual machines. In addition, in some embodiments, the security firmware can hit the key loaded in the key storage unit by setting the flag information, so that the key in the key storage unit will not appear in the plain text key-related information (such as key name, key identification, etc.) during the call process, which is conducive to improving the security of the key during use. The flag information may include one or more data bits. For example, in one embodiment, the flag information may include two data bits, and the key loaded in the key storage unit is hit by the value combination of the two data bits.For example, in order to improve the security of key usage, when the key storage unit is configured, during the configuration of the cloud platform, the enable status of flags such as the confidential computing bit and the sharing bit can be set (the enable status can be represented by the value of the flag), so that the security firmware on the security coprocessor can generate keys and manage the keys loaded in the key storage unit according to the enable status of these flags, and the subsequent security firmware can encrypt and decrypt virtual machine data and cloud platform data based on the keys loaded in the key storage unit. In the entire key generation and use process, there is no need for the participation of the virtual machine monitor, which is conducive to ensuring the security of the key. According to the different cryptographic algorithms used by the cryptographic engine, the cryptographic engine can be divided into SM2 engine, SM3 engine and SM4 engine, etc. Among them, the SM2 engine uses the SM2 algorithm to perform data encryption and decryption operations, the SM3 engine uses the SM3 algorithm to perform data encryption and decryption operations, and the SM4 engine uses the SM4 algorithm to perform data encryption and decryption operations. Among them, the SM2 algorithm includes 3 sub-algorithms: elliptic curve digital signature algorithm (SM2-1), elliptic curve key exchange protocol (SM2-2) and elliptic curve public key encryption algorithm (SM2-3). The SM4 algorithm may be an algorithm based on the ISO / IEC 18033-3:2010 / AMD1:2021 "Information Technology Security Technology Cryptographic Algorithms Part 3: Block Cipher Supplement 1: SM4" standard, which is a block algorithm with a block length of 128 bits and a key length of 128 bits. Both the encryption algorithm and the key expansion algorithm use a 32-round nonlinear iterative structure. The SM3 algorithm may be an algorithm based on the GM / T 0004-2012 "SM3 Cryptographic Hash Algorithm" standard, which compresses text of indefinite length into a 32-byte digest value.
[0045] In addition, in addition to ensuring the security of security firmware and the like in a manner independent of the application processor, the security coprocessor can also ensure the security of security firmware and cryptographic engines based on trusted computing technology. For example, in some embodiments, the security coprocessor can build a TEE (Trusted Execution Environment) subsystem, which provides a secure area for processing sensitive data for the security firmware and cryptographic engines, further ensuring the security of the security firmware and cryptographic engines. In contrast, the environment in which the application processor runs can be called a REE (Rich Execution Environment) subsystem, and the operating system and virtual machines of the cloud platform can all run in the REE subsystem.
[0046] In addition to the above structures, the cloud platform may also include peripheral devices such as storage devices, input / output devices, network devices, expansion slots and expansion cards. This manual does not list them all, and the specific details will depend on the actual situation.
[0047] As mentioned above, the virtual machine encryption key, the virtual machine channel unique key, and the virtual machine disk encryption key are very important keys in the entire life cycle of a secure virtual machine.
[0048] Among them, the virtual machine encryption key can be used to encrypt the memory content of the virtual machine. For example, in some embodiments, each secure virtual machine can have a unique virtual machine encryption key, which is used to dynamically encrypt and decrypt the memory content of the secure virtual machine. This key can be managed by the secure firmware running on the security coprocessor and cannot be accessed by the virtual machine monitor, which can prevent the virtual machine monitor or other virtual machines from accessing or modifying the memory content of the virtual machine.
[0049] The virtual machine channel unique key can be used to protect the communication between the virtual machine and the host. For example, when the virtual machine needs to communicate with the host's virtual machine monitor (e.g., hypervisor), the communication channel may be encrypted to prevent eavesdropping or modification by other virtual machines or attackers. This key is usually unique to each virtual machine to ensure isolation between virtual machines.
[0050] The virtual machine disk encryption key can be used to encrypt and decrypt the virtual machine's disk content, including the virtual hard disk file and the virtual machine's image file. Encrypting the virtual machine's disk content can prevent unauthorized access and modification, and provide security protection for data at rest.
[0051] In this specification, in order to ensure the security of the above-mentioned keys, the generation and calling authority of the virtual machine encryption key is handed over to the security firmware, avoiding the security risks such as key leakage or interception that may be caused by managing the virtual machine encryption key through the virtual machine monitor. In addition, when the secure virtual machine is activated, the virtual machine encryption key is loaded into the key storage unit and called by the secure firmware, so that the virtual machine encryption key will not go out of the security boundary of the first processor during the calling process, avoiding the virtual machine monitor from accessing the key loaded in the key storage unit, and improving the security of the virtual machine encryption key during the calling process. In addition, the secure firmware can hit the key loaded in the key storage unit through the flag information, without the need to call the key through the plain text related to the identity information of the key to be called, which is conducive to ensuring the security and independence of the key loaded in the key storage unit.
[0052] Based on the above concept, the key management method provided in the implementation mode of this specification is exemplarily described below.
[0053] Exemplary Methods
[0054] To be applied to Figure 1Taking the first processor in the system on chip as an example, the embodiment of this specification provides a key management method, wherein the first processor is used to run a secure firmware, the system on chip further includes a cryptographic engine, the cryptographic engine includes a key storage unit, and the system on chip further includes a second processor, and the second processor is used to run a secure virtual machine, such as Figure 2 As shown, the key management method includes:
[0055] S201: In response to a startup operation of the secure virtual machine, the secure firmware generates a virtual machine encryption key corresponding to the secure virtual machine, where the virtual machine encryption key is used to encrypt data of the secure virtual machine;
[0056] S202: In response to an activation request of the secure virtual machine, the secure firmware loads the virtual machine encryption key into the key storage unit, and the virtual machine encryption key loaded into the key storage unit is used for being called by the secure firmware.
[0057] The first processor may include Figure 1 The security coprocessor shown, the second processor may include Figure 1 The application processor shown. The number of the first processor and the second processor can be one or more, which is not limited in this specification and depends on the actual situation. The first processor is used to run the security firmware, which may mean that the first processor has the running authority or function of the security firmware, but it does not limit the first processor to be only used for the running of the security firmware. In some embodiments, the first processor may also be configured to run or control other software and hardware, which is not limited in this specification. Similarly, the second processor is used to run the security virtual machine, which may mean that the second processor has the running authority or function of the security virtual machine, but it does not limit the second processor to be only used for the running of the security virtual machine. In some embodiments, the second processor may also be configured to run or control other software and hardware, for example, the second processor may also be configured to run system firmware and user applications (Client Application, CA), etc., which is not limited in this specification. In a feasible embodiment, the cryptographic engine can be set in the memory controller of the system on chip.
[0058] As mentioned above, secure firmware may refer to firmware that runs on a secure coprocessor and is responsible for data security. Secure firmware is different from system firmware that runs on a second processor. Taking an ARM architecture processor as an example, system firmware may include trusted firmware (ATF) and the operating system (OS) of a cloud platform. Trusted firmware divides the privilege levels during the startup and operation of a computing device. These privilege levels are combined with a secure hardware architecture to jointly ensure the security of the startup process of a computing device. Specifically, trusted firmware technology divides four privilege levels from EL0 (Exception Level 0) to EL3. From EL0 to EL3, the privilege levels increase in sequence. From high LE to low EL through the ERET command, from low EL to high EL through exception, so that different privilege levels can be strictly distinguished. Among them, EL0, EL1 and EL2 can be divided into NS-ELx (None Secure ELx, x = 0, 1, 2, i.e., normal world ELx) and S-ELx (Secure ELx, x = 0, 1, 2, i.e., secure world ELx), while EL3 has only one secure world EL3. In some cases, the firmware required to run during the boot process of the computing device may include BL1 firmware, BL2 firmware, BL31 firmware, BL32 firmware, and BL33 firmware.
[0059] Among them, BL1 firmware can be called Trusted Boot ROM (Trusted Boot ROM), which is the earliest firmware running in the boot process and is also the firmware stored in the processor ROM (Read-Only Memory). BL1 firmware is not together with the BIOS of the computing device. In some types of trusted firmware technology, BL1 firmware is the root of trust for everything. BL1 firmware can be used to initialize the core hardware of the computing device (such as Trusted SRAM (Trusted Static Random Access Memory), serial port, etc.) and find BL2 firmware. In some cases, BL1 firmware will verify the signature of the firmware. BL1 firmware runs at the EL3 privilege level.
[0060] BL2 firmware can be called Trusted Boot Firmware. BL2 firmware also runs at the EL3 privilege level. The significant difference between BL2 firmware and BL1 firmware is that BL2 firmware can be stored on an external trusted storage device, and its trust base can be based on the verification of BL1 firmware. BL2 firmware will initialize some key security hardware and software frameworks. After the initialization is completed, BL2 firmware will find BL31.
[0061] BL31 firmware can be called EL3 Runtime Firmware. BL31 firmware also runs at the EL3 privilege level. Unlike BL1 firmware and BL2 firmware, BL31 firmware is not a one-time run. It continuously provides security-related services to the normal world (Non-Secure) through SMC (Secure Monitor Call).
[0062] BL32 firmware can include OPTEE OS (Open Portable Tee Operate System) and trusted applications. OPTEE OS can refer to the operating system of the trusted execution environment Tee. BL32 firmware runs on S-EL1, and the trusted application on BL32 firmware runs on S-EL0. In some cases, after OPTEE OS runs, it returns to EL3's BL31 firmware, BL31 firmware finds BL33 firmware, and BL31 firmware can also verify the signature of BL33 firmware.
[0063] BL33 firmware may include firmware (Non-Trusted Firmware) running in the ordinary world. BL33 firmware may include UEFI (Unified Extensible Firmware Interface) firmware or U-boot (boot loader for embedded fields) for desktops, servers and other fields, and may also include Linux Kernel (Linux kernel) and basic input output system (BIOS) firmware. In the ordinary world, the execution permissions of EL0, EL1, EL2, and EL3 increase in sequence. Among them, UEFI firmware is configured to run at the EL2 level of the ordinary world, and OP-TEE is configured to run at the EL1 level of the secure world. When entering the UEFI (BL33) startup, OP-TEE has completed the startup, and UEFI and OP-TEE can communicate through the secure monitorcall (SMC) interface. Therefore, when performing UEFI booting, when verifying the integrity and security of the image file, the ordinary world can trigger the SMC method to call the corresponding OP-TEE interface of the secure world to implement certain functions. In this way, the verification process involving the image file can be passed to the secure world for verification, and the verification result can be returned to the ordinary world.
[0064] Of course, the above only introduces the types of firmware that may be included in the trusted firmware in an exemplary manner. In some embodiments, the trusted firmware may include a greater or lesser number of firmware. For example, in some embodiments, the trusted firmware may also include firmware such as a standalone management module (STMM). STMM can provide relevant security applications, such security applications include security variable processing, security firmware upgrades, and interaction between the secure and non-secure worlds. STMM can help system administrators process application requests from the non-secure world to the secure world, thereby improving the security of the system. For example, in some embodiments, the trusted firmware may not include BL32 firmware. This specification does not limit the specific types and quantities of firmware that may be included in the trusted firmware, which depends on the actual situation.
[0065] For details about virtual machine encryption keys, see the entire life cycle. Figure 3 Before starting the secure virtual machine, the tenant can first configure the secure virtual machine, such as configuring the resources of the secure virtual machine, whether the data can be shared, etc. The startup operation of the secure virtual machine may refer to the operation of the cloud platform tenant to start the secure virtual machine in the cloud platform. The secure firmware can respond to the startup operation of the secure virtual machine and generate a virtual machine encryption key corresponding to the secure virtual machine. In some embodiments, the virtual machine monitor running on the second processor assigns an unused virtual machine identity (VMID) to the secure virtual machine to be started from the identity pool, and uses the virtual machine identity as the identity of the secure virtual machine. The identity pool can be used to store the virtual machine identity and the usage status of the virtual machine identity. For example, in some embodiments, the identity pool may include an unused identity pool and a used identity pool, the unused identity pool stores unused virtual machine identities, and the used identity pool stores used virtual machine identities. This specification does not limit the identification method of the specific usage status, which depends on the actual situation.
[0066] When the security firmware receives an activation request from a secure virtual machine requesting to enter an activated state, the activation request may carry a virtual machine identity corresponding to the secure virtual machine, and the activation request may be sent by the virtual machine monitor to the security firmware. The security firmware transmits the virtual machine encryption key corresponding to the secure virtual machine that needs to enter the activated state to the cryptographic engine, and loads it into the key storage unit of the cryptographic engine. Thereafter, the security firmware may perform encryption and decryption operations on the private memory data of the secure virtual machine based on the virtual machine encryption key stored in the key storage unit. In some embodiments, the number of keys that can be loaded into the key storage unit may be multiple, that is, the number of slots in the key storage unit may be multiple, to meet the loading requirements of different types of keys or multiple keys of the same type. In addition, in order to further ensure the security of the keys loaded into the key storage unit, in some embodiments, the method by which the security firmware calls the keys loaded into the key storage unit includes:
[0067] The security firmware sets flag information corresponding to the type of the target key according to the type of the target key, and determines the target key from the key storage unit using the flag information, where the target key is the key that the security firmware needs to call.
[0068] That is, the security firmware can hit the key loaded in the key storage unit by setting the flag information, so that during the calling process of the key in the key storage unit, no plain text key-related information (such as key name, key identifier, etc.) will appear, which is beneficial to improve the security of the key use process.
[0069] In some implementations, in order to ensure the security of the image of the secure virtual machine, the key management method further includes:
[0070] During the startup process of the secure virtual machine, the image of the secure virtual machine is encrypted using the virtual machine encryption key.
[0071] A virtual machine image is a file containing the contents of a virtual hard disk, which includes an operating system, pre-installed applications, and configuration information for these programs. This image can be used by a virtual machine monitor to start a secure virtual machine. Encrypting the secure virtual machine image with a virtual machine encryption key can prevent unauthorized access and modification to the secure virtual machine image.
[0072] The following embodiments illustrate the use of virtual machine encryption keys in the state switching and migration process. In one embodiment, the key management method further includes:
[0073] In response to a state switching request for a target secure virtual machine and a current secure virtual machine, replacing a first virtual machine encryption key loaded in the key storage unit with a second virtual machine encryption key, wherein the first virtual machine encryption key includes: a virtual machine encryption key corresponding to the current secure virtual machine, and the second virtual machine encryption key includes: a virtual machine encryption key corresponding to the target secure virtual machine;
[0074] The state switching request is used to request to switch the state of the current secure virtual machine to an inactive state.
[0075] In this embodiment, when the current secure virtual machine needs to switch from an activated state to an inactivated state due to certain circumstances (for example, when the current secure virtual machine runs into an error or encounters an unprocessable matter), the virtual machine monitor can send a state switching request carrying the virtual machine identity of the next secure virtual machine that needs to enter the activated state (i.e., the target secure virtual machine) and the virtual machine identity of the secure virtual machine that needs to be switched to the inactivated state (i.e., the current secure virtual machine) to the secure firmware. In response to the request, the secure firmware replaces the first virtual machine encryption key loaded in the key storage unit with the second virtual machine encryption key. This, on the one hand, avoids the first virtual machine encryption key corresponding to the current secure virtual machine that is switched to the inactivated state from occupying the key storage unit and causing a waste of resources. On the other hand, it avoids the first virtual machine encryption key from being erroneously or illegally called when the current secure virtual machine is in the inactivated state.
[0076] In order to meet the migration requirements of the secure virtual machine, in one embodiment, the key management method further includes:
[0077] In response to a migration request for the secure virtual machine to be migrated, decrypting private memory data of the secure virtual machine to be migrated using a virtual machine encryption key corresponding to the secure virtual machine to be migrated loaded in the key storage unit;
[0078] Sending the decrypted private memory data to a target first processor, where the target first processor and the first processor are located in different systems on a chip;
[0079] The decrypted private memory data is used to request the secure firmware running on the target first processor to encrypt the decrypted private memory data using a new virtual machine encryption key, where the new virtual machine encryption key is generated by the secure firmware running on the target first processor.
[0080] Before decrypting the private memory data of the secure virtual machine to be migrated by using the virtual machine encryption key corresponding to the secure virtual machine to be migrated loaded in the key storage unit, the method further includes:
[0081] If the virtual machine encryption key corresponding to the secure virtual machine to be migrated is not loaded in the key storage unit, the virtual machine encryption key corresponding to the secure virtual machine to be migrated is loaded into the key storage unit.
[0082] When a secure virtual machine needs to be migrated between different physical machines, after the secure firmware on the sending end (i.e., the host machine of the secure virtual machine to be migrated before the migration) confirms the platform security of the receiving end (i.e., the target host machine to which the secure virtual machine to be migrated is migrated, and the target first processor is the processor of the target host machine) (for example, the platform security can be verified by means of the cloud platform unique key PUK, the cloud platform security certificate, etc.), if the virtual machine encryption key corresponding to the secure virtual machine to be migrated is not loaded in the key storage unit, then the virtual machine encryption key corresponding to the secure virtual machine to be migrated is loaded into the key storage unit, and the private memory data of the secure virtual machine to be migrated is decrypted using the virtual machine encryption key loaded in the key storage unit, and the decrypted private memory data is transmitted to the receiving end, and the secure firmware running on the target first processor of the receiving end encrypts the decrypted private memory data using the new virtual machine encryption key, and the new virtual machine encryption key is generated by the secure firmware running on the target first processor. After the migration of the virtual machine to be migrated is completed, the secure firmware of the receiving end deletes the virtual machine encryption key corresponding to the secure virtual machine to be migrated.
[0083] In the secure virtual machine destruction phase, the virtual machine monitor sends a destruction request for the secure virtual machine to be destroyed to the secure firmware on the first processor, and the secure firmware deletes the virtual machine encryption key corresponding to the secure virtual machine to be destroyed.
[0084] In addition to the virtual machine encryption key, the channel unique key can also be used to ensure the communication security between the secure virtual machine and the secure firmware. For the entire life cycle of the channel unique key, please refer to Figure 4 .
[0085] In one embodiment, before responding to the activation request of the secure virtual machine, the key management method further includes:
[0086] The security firmware establishes a secure channel with the secure virtual machine based on the channel unique key loaded in the key storage unit;
[0087] The security firmware performs security measurement on the security virtual machine and transmits the measurement information to the security virtual machine through the secure channel; the measurement information is used to instruct the security virtual machine to request the virtual machine monitor to send the activation request to the security firmware when the measurement information meets the configuration requirements.
[0088] After the cloud platform completes secure boot, the secure firmware can generate a channel-unique key. During the configuration phase of the secure virtual machine, the secure firmware sends the cloud platform's security certificate and channel-unique key to the virtual machine tenant. After completing the configuration file of the secure virtual machine, the virtual machine tenant generates a user channel key and sends it to the secure firmware to implement key exchange. At this point, the secure channel construction is complete. During the measurement phase of the secure virtual machine, the secure firmware sends the measurement information to the tenant of the secure virtual machine through a secure channel. The transmitted measurement information (or measurement results) can be encrypted using the channel-unique key. During the virtual machine activation phase, after confirming that the measurement information meets the configuration requirements, the tenant of the secure virtual machine notifies the virtual machine monitor to activate the secure virtual machine.
[0089] In order to ensure the freshness and security of the channel unique key, in some embodiments, the key management method further includes:
[0090] In response to the completion of the startup of the secure virtual machine, the secure firmware regenerates the channel unique key, and uses the newly generated channel unique key to replace the channel unique key generated after the cloud platform startup is completed.
[0091] In this embodiment, after the cloud platform completes secure startup, the security firmware will generate a channel unique key. After the user completes the configuration and measurement of the virtual machine, the user notifies the virtual machine monitor to start the secure virtual machine when confirming that the measurement information meets the configuration requirements. After the secure virtual machine is started, the security firmware regenerates a new channel unique key corresponding to the secure virtual machine, and uses the newly generated channel unique key to replace the channel unique key generated after the cloud platform is started, ensuring the freshness and security of the channel unique key.
[0092] During the migration phase of the secure virtual machine, the key management method further includes:
[0093] In response to a migration request for the secure virtual machine to be migrated, a secure channel is established between the target first processor and the first processor based on the channel-unique key loaded by the key storage unit, and data transmission is performed based on the established secure channel;
[0094] After the migration of the secure virtual machine to be migrated is completed, the target first processor and the first processor delete the channel unique key.
[0095] Before the virtual machine is migrated, a secure channel is established between the sender and the receiver through the channel-unique key, and the transmission content is encrypted using the virtual machine transmission key (or migration key, which can be generated by the secure firmware after the cloud platform is started). This ensures the security of communication between the secure virtual machine and the secure firmware, and the management and calling authority of the channel-unique key are handed over to the secure firmware, reducing the risk of the virtual machine monitor or attacker intercepting the channel-unique key.
[0096] In addition to the channel-unique key and the virtual machine encryption key, you can also use the virtual machine disk encryption key to ensure the security of the disk content of the secure virtual machine. Figure 5 In one embodiment, the key management method further includes:
[0097] The security firmware receives a virtual machine disk encryption key corresponding to the secure virtual machine;
[0098] The security firmware uses the virtual machine disk encryption key to perform an encryption operation on private data on the disk of the secure virtual machine;
[0099] After the secure virtual machine migration is completed, the secure firmware sends the virtual machine disk encryption key to the target first processor and deletes the saved virtual machine disk encryption key.
[0100] During the virtual machine measurement phase, after the tenant of the secure virtual machine confirms that the secure virtual machine is started as required (measurement result confirmation), the tenant of the secure virtual machine generates a virtual machine disk encryption key and transmits it to the secure firmware on the first processor through a secure channel. The secure firmware uses the disk encryption key to encrypt private data on the secure virtual machine disk. During the virtual machine migration phase, the secure firmware on the first processor at the sending end transmits the disk encryption key to the secure firmware on the first processor at the receiving end after the virtual machine migration is completed, and the secure firmware on the first processor at the sending end deletes the disk encryption key at the same time. During the virtual machine destruction phase, the secure firmware on the first processor deletes the virtual machine disk encryption key of the current secure virtual machine.
[0101] In order to promptly delete the key of the destroyed or migrated secure virtual machine, in one embodiment, the key management method further includes:
[0102] In response to a destruction request for the secure virtual machine or completion of the migration of the secure virtual machine, the key corresponding to the secure virtual machine loaded in the key storage unit is replaced with a default key, and the key corresponding to the secure virtual machine is deleted. The default key is used for data sharing between the secure virtual machine and the virtual machine monitor.
[0103] In this embodiment, a storage unit such as a register can be used as the key storage unit. When the secure virtual machine is destroyed or migrated, the key corresponding to the secure virtual machine loaded in the key storage unit is promptly replaced with the default key using the default key, and the key corresponding to the secure virtual machine (such as a virtual machine encryption key, a channel unique key, and a virtual machine disk encryption key, etc.) is deleted to release the corresponding storage space and avoid misuse of the key of the destroyed or migrated secure virtual machine.
[0104] In traditional secure virtual machine control technology, in order to ensure the security of private data of secure virtual machines to a certain extent, data communication and sharing are usually only allowed between secure virtual machines and virtual machine monitors. When users need to communicate between secure virtual machines, they can only share the data of the first secure virtual machine with the virtual machine monitor, and then the virtual machine monitor shares it with another secure virtual machine. The whole process requires multiple data copies, which is not only inefficient, but also wastes resources. In order to solve this problem, the implementation method of this specification provides a virtual machine shared key based on encrypted virtualization technology. The secure firmware can directly realize data sharing between secure virtual machines based on the virtual machine shared key without going through the virtual machine monitor, which is conducive to improving data sharing efficiency and reducing resource waste. In addition, it can also avoid the situation where the virtual machine monitor steals the private data of the secure virtual machine through data sharing.
[0105] The following is an exemplary description of a virtual machine shared key. In one embodiment of the present specification, a key management method for a multi-key secure virtual machine is provided. Figure 6 As shown, the key management method is applied to a first processor in a system on chip, the first processor is used to run a secure firmware, the system on chip further includes a cryptographic engine, the cryptographic engine includes a key storage unit, the system on chip further includes a second processor, the second processor is used to run a secure virtual machine, and the key management method includes:
[0106] S601: In response to a startup operation of the secure virtual machine, generating a virtual machine shared key corresponding to the secure virtual machine according to configuration information of the secure virtual machine;
[0107] S602: In response to a data sharing request between the secure virtual machine and other secure virtual machines, the secure firmware loads the virtual machine shared key into the key storage unit, and controls the secure virtual machine to share data with other secure virtual machines based on the virtual machine shared key loaded by the key storage unit; after the data sharing is completed, the secure firmware removes the virtual machine shared key from the key storage unit.
[0108] The entire life cycle of the virtual machine shared key can be referenced Figure 7 The configuration information of the secure virtual machine may refer to the relevant information set by the tenant of the secure virtual machine during the virtual machine configuration phase. In this embodiment, for a multi-key secure virtual machine, the configuration information may include whether data sharing between secure virtual machines is allowed. When the configuration information includes allowing data sharing between secure virtual machines, the secure firmware generates a virtual machine shared key corresponding to the secure virtual machine when responding to a startup operation for the secure virtual machine. The virtual machine shared key can be used to share data between secure virtual machines under the management of the secure firmware. After the virtual machine shared key is generated, the policy storage of the virtual machine shared key can be performed based on a certain policy, for example, it can be stored in a cryptographic engine, etc.
[0109] When the secure virtual machine is in an activated state, the secure virtual machine can request to share data with other secure virtual machines (i.e., a sharing application), and the secure firmware performs key scheduling in response to the request. Specifically, for example, the virtual machine sharing key corresponding to the secure virtual machine requesting data sharing can be found based on the virtual machine identity of the secure virtual machine requesting data sharing, and the secure virtual machine sharing key can be loaded into the key storage unit to meet the security firmware's need to call the virtual machine sharing key. When data is shared between secure virtual machines, the secure firmware can use the virtual machine sharing key to encrypt and decrypt the shared data to meet the security requirements when data is shared between secure virtual machines. Since the virtual machine sharing key is only managed by the secure firmware during the data sharing process, the situation where other secure virtual machine tenants, virtual machine monitors, and other attackers steal the virtual machine sharing key is avoided.
[0110] In general, in this embodiment, the key management method meets the data sharing requirements between secure virtual machines through virtual machine shared keys, improves the convenience of data sharing between secure virtual machines, and also ensures the security of data sharing between secure virtual machines based on virtual machine shared keys. At the same time, the generation and calling authority of virtual machine shared keys are handed over to the secure firmware, avoiding the security risks such as key leakage or interception that may be caused by managing virtual machine shared keys through virtual machine monitors, and also avoiding the situation where virtual machine monitors abuse virtual machine shared keys, further improving the data security when data is shared between secure virtual machines. In addition, when data is shared between secure virtual machines, the secure firmware loads the virtual machine shared key into the key storage unit and calls it by the secure firmware, so that the virtual machine shared key can be transmitted through a dedicated secure channel during the calling process, will not go out of the security boundary of the first processor, will not be detected by the second processor or the virtual machine monitor, and improves the security of the virtual machine shared key during the calling process; when the data sharing between secure virtual machines ends, the secure firmware will remove the virtual machine shared key from the key storage unit, further reducing the possibility of interception or misuse of the virtual machine shared key.
[0111] In order to improve the security of the virtual machine shared key during use, similar to the virtual machine encryption key, the security firmware can set flag information corresponding to the type of the target key according to the type of the target key, and use the flag information to determine the target key from the key storage unit, and the target key is the key that the security firmware needs to call.
[0112] In some implementations, in order to distinguish from a virtual machine encryption key or other key, and to conveniently hit the virtual machine shared key through the flag information, the virtual machine shared key, the key storage unit includes a shared key slot;
[0113] The security firmware loads the virtual machine shared key into the key storage unit specifically including:
[0114] The security firmware loads the virtual machine shared key into the shared key slot.
[0115] In order to ensure the security of the virtual machine migration process, in one embodiment, the key management method further includes:
[0116] In response to the platform security confirmation information, the security firmware generates a virtual machine transmission key; the platform security confirmation information is used to indicate that the tenant of the secure virtual machine confirms the security of the cloud platform;
[0117] The security firmware performs security measurement on the secure virtual machine, encrypts measurement information using the virtual machine transmission key, and transmits the encrypted measurement information to the secure virtual machine through a secure channel; the measurement information is used to instruct the secure virtual machine to request the virtual machine monitor to send the activation request to the security firmware when the measurement information meets the configuration requirements.
[0118] The platform security confirmation message is a confirmation message given by the virtual machine tenant after verifying the platform security through the platform unique key, cloud platform security certificate, etc. The security firmware generates a virtual machine transport key in response to the message. During the measurement process, the measurement information is encrypted based on the virtual machine transport key to ensure the security of the measurement information. The process of establishing a secure channel can refer to the relevant description above.
[0119] In addition to the measurement phase, during the virtual machine migration process, data security during the migration process can also be ensured based on the virtual machine transmission key. Specifically, in one embodiment, the key management method further includes:
[0120] In response to a migration request for a secure virtual machine to be migrated, encrypted transmission data is transmitted based on the virtual machine transmission key.
[0121] For details about the secure virtual machine migration process, please refer to Figure 4 and related descriptions.
[0122] Similar to the virtual machine encryption key described above, after the secure virtual machine is destroyed or migrated, the virtual machine shared key and the virtual machine transport key need to be deleted. That is, in one embodiment, the key management method further includes:
[0123] In response to a request to destroy the secure virtual machine or completion of migration of the secure virtual machine, the key corresponding to the secure virtual machine loaded in the key storage unit is replaced with a default key, and the key corresponding to the secure virtual machine is deleted, and the default key is used for data sharing between the secure virtual machine and a virtual machine monitor. In some embodiments, the default key may include a host key.
[0124] In this way, it can be avoided that after the secure virtual machine is destroyed or migrated, its corresponding key still occupies the storage control, causing resource waste and other problems.
[0125] In some embodiments, a feasible and secure virtual machine data sharing method is provided, such as Figure 8 As shown, a first processor applied to a system on chip, the first processor is used to run a security firmware, the system on chip also includes a second processor, the second processor is used to run a security virtual machine, and the data sharing method of the security virtual machine includes:
[0126] S801: In response to a configuration operation for a current secure virtual machine, generating a virtual machine shared key corresponding to the current secure virtual machine according to configuration information of the current secure virtual machine; the configuration information of the secure virtual machine includes shared memory information; the shared memory information is used to create a shared memory;
[0127] S802: In response to a data sharing request carrying target secure virtual machine information, the secure firmware shares the shared data with the target secure virtual machine using the shared memory according to a virtual machine sharing key corresponding to the current secure virtual machine.
[0128] In this embodiment, the data sharing method meets the data sharing requirements between secure virtual machines through the virtual machine shared key, improves the convenience of data sharing between secure virtual machines, and also ensures the security of data sharing between secure virtual machines based on the virtual machine shared key. At the same time, the configuration information of the secure virtual machine includes shared memory information, and the shared memory information is used to create shared memory. In this way, during the data sharing process, the secure firmware can share the shared data with the target secure virtual machine using the shared memory according to the virtual machine shared key corresponding to the current secure virtual machine, which is conducive to improving the efficiency of data sharing.
[0129] In the output stage of secure virtual machine creation, after confirming the security of the cloud platform, the tenant of the secure virtual machine can configure the initial sharing policy of the secure virtual machine. In some embodiments, the initial sharing policy may include: (1) not allowing the current secure virtual machine to share data; (2) allowing the current secure virtual machine to share data between the secure virtual machines of the tenant; (3) allowing the current secure virtual machine to share data between the secure virtual machines of different tenants. When the initial sharing policy does not allow the current secure virtual machine to share data, subsequent sharing-related configuration operations are not performed. These initial sharing policies can be used as part of the configuration information.
[0130] Allowing the current secure virtual machine to share data between the secure virtual machines of the tenant includes: allowing the current secure virtual machine to share data between the secure virtual machines of the tenant of the host machine, and allowing the current secure virtual machine to share data between the secure virtual machines of the tenant of different host machines.
[0131] Allowing the current secure virtual machine to share data between secure virtual machines of different tenants also includes: allowing the current secure virtual machine to share data between secure virtual machines of different tenants of the current host, and allowing the current secure virtual machine to share data between secure virtual machines of different tenants of different hosts. A host may refer to a computer system used to run a secure virtual machine. The current tenant refers to the tenant that owns the current secure virtual machine, and the current host refers to the host that runs the current secure virtual machine.
[0132] The following is an exemplary description of the data sharing method of the secure virtual machine under different initial sharing strategies.
[0133] Regarding the generation of a virtual machine shared key, in one embodiment, generating a virtual machine shared key corresponding to the current secure virtual machine according to the configuration information of the current secure virtual machine includes:
[0134] When the configuration information includes allowing different secure virtual machines in the same host machine to share data, the secure firmware generates a virtual machine shared key corresponding to the current secure virtual machine using a software algorithm or the true random number generator module;
[0135] When the configuration information includes allowing different secure virtual machines in different host machines to share data, the secure firmware uses the true random number generator module to generate a virtual machine shared key corresponding to the current secure virtual machine.
[0136] In this embodiment, when the configuration information configured by the user includes allowing different secure virtual machines in the same host machine to share data (excluding allowing different secure virtual machines in different hosts to share data), since different secure virtual machines in the same host machine are based on the same hardware foundation, the credibility between different secure virtual machines is relatively high. Therefore, when generating a virtual machine shared key, it can be generated by the security firmware using a random number generated by a software algorithm, or it can be generated by the security firmware using a true random number generator module. In this way, tenants are provided with the choice of efficiency priority and security priority, thereby improving the flexibility of the method.
[0137] When the configuration information configured by the user includes allowing different secure virtual machines in different host machines to share data, since the secure virtual machines in different host machines are based on different hardware foundations, the security settings and status of different host machines may be different due to different configurations. Therefore, it is necessary to generate a virtual machine shared key based on a true random number generator module by the secure firmware based on security considerations to avoid security issues that may be caused by the random numbers generated by the software algorithm being predicted.
[0138] For the same host machine, in one embodiment, the system on chip further includes a cryptographic engine, the cryptographic engine including a key storage unit, when the target secure virtual machine and the current secure virtual machine are located in the same host machine;
[0139] The secure firmware uses the shared memory to share the shared data with the target secure virtual machine according to the virtual machine shared key corresponding to the current secure virtual machine, including:
[0140] The data sharing request is checked, and if the check passes, the virtual machine sharing key corresponding to the current secure virtual machine is loaded into the key storage unit; the virtual machine sharing key loaded into the key storage unit is used by the current virtual machine to encrypt the data to be shared after decryption is completed, so as to obtain the shared data and write it into the shared memory;
[0141] In response to the completion of sharing the shared data, the security firmware uses a default key to replace the virtual machine shared key loaded in the key storage unit; the data to be shared is decrypted based on the virtual machine encryption key corresponding to the current secure virtual machine, and the default key is used for data sharing between the secure virtual machine and the virtual machine monitor.
[0142] Checking the data sharing request may include checking the integrity and security of the relevant information in the data sharing request, for example, checking the integrity of the target secure virtual machine information and checking the security of the target secure virtual machine represented by the target secure virtual machine information, etc. In some embodiments, the data sharing request may also include shared memory information, and the check on the data sharing request may also include checking the shared memory information, for example, checking whether the shared memory size, address, etc. are compliant, etc.
[0143] If the check passes, the security firmware loads the virtual machine shared key into the key storage unit. After that, the secure virtual machine decrypts the shared data based on the virtual machine encryption key of the secure virtual machine. After decryption, the shared data is encrypted based on the virtual machine shared key loaded in the key storage unit to obtain the shared data. After the shared data is written into the shared memory, the target secure virtual machine can read and copy the shared data from the shared memory. The target secure virtual machine can also decrypt the shared data based on the virtual machine shared key loaded in the key storage unit, and encrypt it with the virtual machine encryption key corresponding to the target secure virtual machine and store it. At this point, data sharing between different secure virtual machines in the same host is completed.
[0144] After the shared data is shared, the current secure virtual machine can send a sharing completion notification message to the secure firmware. At this time, the secure firmware responds to the message and uses the default key to replace the virtual machine shared key loaded in the key storage unit, thereby uninstalling the virtual machine shared key from the key storage unit. That is, in this embodiment, the key storage unit can be configured to be write-only and not readable. Therefore, by overwriting the key loaded therein with the default key, the security of the key loaded in the key storage unit can be improved, so that an attacker cannot obtain the key by reading the key loaded in the key storage unit.
[0145] When the target secure virtual machine and the current secure virtual machine belong to different tenants, the data sharing request also carries information of the target tenant;
[0146] The checking of the data sharing request comprises:
[0147] A security check is performed on the target tenant's information.
[0148] The security check on the target tenant's information may include checking whether the target tenant's identity is compliant, whether the target tenant corresponds to the target secure virtual machine, etc., to avoid security issues that may be caused by forged target tenant requests for data sharing.
[0149] For data sharing between different secure virtual machines on different hosts, in one embodiment, the system on chip further includes a cryptographic engine, the cryptographic engine including a key storage unit, when the target secure virtual machine and the current secure virtual machine are located in different hosts;
[0150] The data sharing request also includes information of the target host machine;
[0151] The secure firmware uses the shared memory to share the shared data with the target secure virtual machine according to the virtual machine shared key corresponding to the current secure virtual machine, including:
[0152] In the case where the security check of the information of the target host machine passes, the virtual machine shared key corresponding to the current secure virtual machine is loaded into the key storage unit, and the virtual machine shared key corresponding to the current secure virtual machine is sent to the target first processor in the target host machine; the virtual machine shared key loaded in the key storage unit is used for the current virtual machine to encrypt the data to be shared after the decryption is completed, so as to obtain the shared data and write it into the shared memory;
[0153] In response to the shared data being written into the shared memory, the security firmware sends the shared data to the target secure virtual machine through a secure channel; the shared data sent to the target secure virtual machine is used to instruct the security firmware on the target first processor to decrypt the shared data using the virtual machine shared key corresponding to the current virtual machine, and to encrypt the decrypted data using the virtual machine encryption key corresponding to the target secure virtual machine and then store it.
[0154] In this embodiment, when the current secure virtual machine writes shared data into shared memory, the secure firmware can send the shared data to the target secure virtual machine through a secure channel. The secure channel can be established based on a channel-unique key. The specific establishment process can refer to the relevant description above.
[0155] The target secure virtual machine can run on the target second processor, and the secure firmware of the target first processor uses the virtual machine shared key corresponding to the current virtual machine to decrypt the shared data, and uses the virtual machine encryption key corresponding to the target secure virtual machine to encrypt the shared data and store it in the private storage of the target secure virtual machine, thereby completing the cross-host data sharing. Both the target first processor and the target second processor can be located in the target secure virtual machine and can be located in the same system on chip.
[0156] After completing the data sharing across the host machines, in order to ensure the security of the virtual machine shared key, in one embodiment, after the secure firmware sends the shared data to the target secure virtual machine through a secure channel, it also includes:
[0157] In response to a sharing completion command sent by the security firmware on the target first processor, the virtual machine shared key corresponding to the current secure virtual machine is deleted. The sharing completion command can also be used to instruct the target first processor to delete the virtual machine shared key corresponding to the current virtual machine.
[0158] In this way, after the cross-host data sharing is completed, since the virtual machine shared key has actually been known by two different hosts, the risk of the virtual machine shared key being attacked and leaked is increased. Therefore, after the cross-host data sharing is completed, the first processors on the sending end and the receiving end delete the saved virtual machine shared key corresponding to the current secure virtual machine to ensure the data security of the current secure virtual machine. When the current secure virtual machine has a data sharing demand again, the secure firmware can respond to the data sharing request of the current secure virtual machine and regenerate the virtual machine shared key corresponding to the current secure virtual machine. On the basis of ensuring the data security of the current secure virtual machine, the purpose of supporting the current secure virtual machine to continue new data sharing operations is achieved.
[0159] Regarding data sharing across host machines, in some embodiments, the shared data sent to the target secure virtual machine is also used to decrypt the shared data using the virtual machine shared key corresponding to the current virtual machine, and then instruct the virtual machine monitor in the target host machine to start the target secure virtual machine through the secure firmware on the target first processor. After the status check of the target secure virtual machine passes, the step of encrypting the decrypted data using the virtual machine encryption key corresponding to the target secure virtual machine and then storing it is performed.
[0160] In this embodiment, after the security firmware of the target first processor decrypts the shared data, the security firmware of the target first processor is also used to instruct the virtual machine monitor in the target host machine to start the target secure virtual machine, and check the status of the target secure virtual machine to determine whether the target secure virtual machine is in an activated state and whether it meets the data sharing requirements, etc. The decrypted data is encrypted and stored only when the check passes, which is beneficial to ensure data security.
[0161] Exemplary Related Devices
[0162] In an exemplary embodiment of the present specification, a key management device is also provided, which is applied to a first processor in a system on chip, the first processor is used to run a security firmware, the system on chip further includes a cryptographic engine, the cryptographic engine includes a key storage unit, the system on chip further includes a second processor, the second processor is used to run a security virtual machine, such as Fig. 9 As shown, the key management device includes:
[0163] A startup module 801, configured to generate, by the security firmware, a virtual machine encryption key corresponding to the secure virtual machine in response to a startup operation of the secure virtual machine, wherein the virtual machine encryption key is used to encrypt data of the secure virtual machine;
[0164] The activation module 802 is used to respond to the activation request of the secure virtual machine, and the secure firmware loads the virtual machine encryption key into the key storage unit, and the virtual machine encryption key loaded in the key storage unit is used for the secure firmware to call.
[0165] Accordingly, in an exemplary embodiment of the present specification, a key management device is further provided, which is applied to a first processor in a system on chip, the first processor is used to run a security firmware, the system on chip further includes a cryptographic engine, the cryptographic engine includes a key storage unit, the system on chip further includes a second processor, the second processor is used to run a security virtual machine, such as Fig.10 As shown, the key management device includes:
[0166] A shared key module 901, configured to generate a virtual machine shared key corresponding to the secure virtual machine in response to a startup operation of the secure virtual machine and according to configuration information of the secure virtual machine;
[0167] The data sharing module 902 is used to respond to a data sharing request between the secure virtual machine and other secure virtual machines. The secure firmware loads the virtual machine sharing key into the key storage unit, and controls the secure virtual machine to share data with other secure virtual machines based on the virtual machine sharing key loaded by the key storage unit.
[0168] For the specific definition of the key management device, please refer to the definition of the key management method above, which will not be repeated here. Each module in the above-mentioned key management device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0169] Accordingly, in an exemplary embodiment of the present specification, a data sharing device for a secure virtual machine is further provided, which is applied to a first processor in a system on chip, wherein the first processor is used to run a secure firmware, and the system on chip further includes a second processor, wherein the second processor is used to run a secure virtual machine, such as Fig.11 As shown, the data sharing device of the secure virtual machine includes:
[0170] The second shared key module 1101 is used to generate a virtual machine shared key corresponding to the current secure virtual machine in response to a configuration operation for the current secure virtual machine according to the configuration information of the current secure virtual machine; the configuration information of the secure virtual machine includes shared memory information; the shared memory information is used to create a shared memory;
[0171] The second data sharing module 1102 is used to respond to a data sharing request carrying target secure virtual machine information, and the secure firmware uses the shared memory to share the shared data with the target secure virtual machine based on the virtual machine sharing key corresponding to the current secure virtual machine.
[0172] The specific definition of the data sharing device of the secure virtual machine can be found in the definition of the data sharing method of the secure virtual machine mentioned above, which will not be repeated here. Each module in the data sharing device of the secure virtual machine can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.
[0173] In an exemplary embodiment of the present specification, a system on a chip is also provided, such as Fig.12 As shown, it includes: a first processor, a second processor and a cryptographic engine; wherein,
[0174] The first processor is used to run the security firmware, the cryptographic engine includes a key storage unit, and the second processor is used to run the security virtual machine;
[0175] The security firmware is configured to: in response to a startup operation of the security virtual machine, generate a virtual machine encryption key corresponding to the security virtual machine, wherein the virtual machine encryption key is used to encrypt data of the security virtual machine;
[0176] In response to an activation request of the secure virtual machine, the secure firmware loads the virtual machine encryption key into the key storage unit, and the virtual machine encryption key loaded into the key storage unit is used for being called by the secure firmware.
[0177] In another exemplary embodiment of the present specification, a system on chip is also provided, still referring to Fig.12 , comprising: a first processor, a second processor and a cryptographic engine; wherein,
[0178] The first processor is used to run the security firmware, the cryptographic engine includes a key storage unit, and the second processor is used to run the security virtual machine;
[0179] The security firmware is configured to: in response to a startup operation of the security virtual machine, generate a virtual machine shared key corresponding to the security virtual machine according to configuration information of the security virtual machine;
[0180] In response to a data sharing request between the secure virtual machine and other secure virtual machines, the secure firmware loads the virtual machine sharing key into the key storage unit, and controls the secure virtual machine to share data with other secure virtual machines based on the virtual machine sharing key loaded by the key storage unit.
[0181] In another exemplary embodiment of the present specification, a system on chip is also provided, still referring to Fig.12, comprising: a first processor and a second processor; wherein,
[0182] The first processor is used to run the security firmware, and the second processor is used to run the security virtual machine;
[0183] The security firmware is configured to: in response to a configuration operation for a current security virtual machine, generate a virtual machine shared key corresponding to the current security virtual machine according to configuration information of the current security virtual machine; the configuration information of the security virtual machine includes shared memory information; the shared memory information is used to create a shared memory;
[0184] In response to a data sharing request carrying target secure virtual machine information, the secure firmware uses the shared memory to share the shared data with the target secure virtual machine based on a virtual machine sharing key corresponding to the current secure virtual machine.
[0185] For the specific limitations of the secure firmware in the system on chip, please refer to the above limitations on the key management method or the data sharing method of the secure virtual machine, which will not be repeated here.
[0186] Another embodiment of this specification also provides a computing device, see Fig.13 As shown, an exemplary embodiment of the present specification also provides a computing device, including: a memory and a processor, the memory storing a computer program, and the processor executing the computer program when executing the computer program, performs the steps of the key management method or the data sharing method of the secure virtual machine according to various embodiments of the present specification described in the above embodiments of the present specification.
[0187] The internal structure of the computing device can be as follows Fig.13 As shown, the computing device includes a processor, a memory, a network interface and an input device connected through a system bus. Among them, the processor of the computing device is used to provide computing and control capabilities. The memory of the computing device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computing device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in the key management method or the data sharing method of the secure virtual machine according to various embodiments of the present specification described in the above embodiments of the present specification are performed.
[0188] The processor may include a main processor and may also include a baseband chip, a modem, etc.
[0189] The memory stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation command. More specifically, the memory may include a read-only memory (ROM), other types of static storage devices that can store static information and commands, a random access memory (RAM), other types of dynamic storage devices that can store information and commands, a disk storage, a flash, and the like.
[0190] The processor may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component.
[0191] The input device may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0192] Output devices may include means that allow information to be output to a user, such as display screens, printers, speakers, etc.
[0193] The communication interface may include using any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0194] The processor executes the program stored in the memory and calls other devices, which can be used to implement each step of any key management method or secure virtual machine data sharing method provided in the above embodiments of this specification.
[0195] The computing device may also include a display component and a voice component. The display component may be a liquid crystal display or an electronic ink display. The input device of the computing device may be a touch layer covered on the display component, or a button, trackball or touchpad provided on the housing of the computing device, or an external keyboard, touchpad or mouse.
[0196] Those skilled in the art will understand that Fig.13The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of this specification, and does not constitute a limitation on the computing device to which the scheme of this specification is applied. The specific computing device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0197] Exemplary computer program products and storage media
[0198] In addition to the above-mentioned methods and devices, the key management method or data sharing method of a secure virtual machine provided in the embodiments of this specification may also be a computer program product, which includes computer program commands, which, when executed by a processor, enable the processor to execute the steps of the key management method or data sharing method of a secure virtual machine according to various embodiments of this specification described in the above "Exemplary Method" section of this specification.
[0199] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present specification, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0200] In addition, an embodiment of the present specification also provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the key management method or the data sharing method of the secure virtual machine according to various embodiments of the present specification described in the above "Exemplary Method" section of the present specification.
[0201] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by commanding the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this specification can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synch link) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0202] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0203] The above-mentioned embodiments only express several implementation methods of this specification, and the descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the solutions provided by the embodiments of this specification. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of this specification, which all belong to the protection scope of this specification. Therefore, the protection scope of the patent of this specification shall be based on the attached claims.
Claims
1. A data sharing method for a secure virtual machine, characterized in that: A first processor applied to a system on chip, the first processor is used to run a security firmware, the system on chip also includes a second processor, the second processor is used to run a security virtual machine, and the data sharing method of the security virtual machine includes: In response to a configuration operation for a current secure virtual machine, generating a virtual machine shared key corresponding to the current secure virtual machine according to configuration information of the current secure virtual machine; the configuration information of the secure virtual machine includes shared memory information; the shared memory information is used to create a shared memory; In response to a data sharing request carrying target secure virtual machine information, the secure firmware uses the shared memory to share the shared data with the target secure virtual machine based on a virtual machine sharing key corresponding to the current secure virtual machine.
2. The method according to claim 1, characterized in that The first processor also includes a true random number generator module; The generating, according to the configuration information of the current secure virtual machine, a virtual machine shared key corresponding to the current secure virtual machine comprises: When the configuration information includes allowing different secure virtual machines in the same host machine to share data, the secure firmware generates a virtual machine shared key corresponding to the current secure virtual machine using a software algorithm or the true random number generator module; When the configuration information includes allowing different secure virtual machines in different host machines to share data, the secure firmware uses the true random number generator module to generate a virtual machine shared key corresponding to the current secure virtual machine.
3. The method according to claim 1, characterized in that The system on chip further includes a cryptographic engine, the cryptographic engine including a key storage unit, when the target secure virtual machine and the current secure virtual machine are located in the same host machine; The secure firmware uses the shared memory to share the shared data with the target secure virtual machine according to the virtual machine shared key corresponding to the current secure virtual machine, including: The data sharing request is checked, and if the check passes, the virtual machine sharing key corresponding to the current secure virtual machine is loaded into the key storage unit; the virtual machine sharing key loaded into the key storage unit is used by the current virtual machine to encrypt the data to be shared after decryption is completed, so as to obtain the shared data and write it into the shared memory; In response to the completion of sharing the shared data, the security firmware uses a default key to replace the virtual machine shared key loaded in the key storage unit; the data to be shared is decrypted based on the virtual machine encryption key corresponding to the current secure virtual machine, and the default key is used for data sharing between the secure virtual machine and the virtual machine monitor.
4. The method according to claim 3, characterized in that When the target secure virtual machine and the current secure virtual machine belong to different tenants, the data sharing request also carries information of the target tenant; The checking of the data sharing request comprises: A security check is performed on the target tenant's information.
5. The method according to claim 1, characterized in that: The system on chip further includes a cryptographic engine, the cryptographic engine including a key storage unit, when the target secure virtual machine and the current secure virtual machine are located in different host machines; The data sharing request also includes information of the target host machine; The secure firmware uses the shared memory to share the shared data with the target secure virtual machine according to the virtual machine shared key corresponding to the current secure virtual machine, including: In the case where the security check of the information of the target host machine passes, the virtual machine shared key corresponding to the current secure virtual machine is loaded into the key storage unit, and the virtual machine shared key corresponding to the current secure virtual machine is sent to the target first processor in the target host machine; the virtual machine shared key loaded in the key storage unit is used for the current virtual machine to encrypt the data to be shared after the decryption is completed, so as to obtain the shared data and write it into the shared memory; In response to the shared data being written into the shared memory, the security firmware sends the shared data to the target secure virtual machine through a secure channel; the shared data sent to the target secure virtual machine is used to instruct the security firmware on the target first processor to decrypt the shared data using the virtual machine shared key corresponding to the current virtual machine, and to encrypt the decrypted data using the virtual machine encryption key corresponding to the target secure virtual machine and then store it.
6. The method according to claim 5, characterized in that After the security firmware sends the shared data to the target secure virtual machine through a secure channel, the method further includes: In response to a sharing completion command sent by the security firmware on the target first processor, the virtual machine shared key corresponding to the current secure virtual machine is deleted; the sharing completion command is also used to instruct the target first processor to delete the virtual machine shared key corresponding to the current virtual machine.
7. The method according to claim 5, characterized in that The shared data sent to the target secure virtual machine is also used to decrypt the shared data by the secure firmware on the target first processor using the virtual machine shared key corresponding to the current virtual machine, and then instruct the virtual machine monitor in the target host machine to start the target secure virtual machine through the secure firmware on the target first processor. After the status check of the target secure virtual machine passes, the step of encrypting the decrypted data using the virtual machine encryption key corresponding to the target secure virtual machine and then storing it is performed.
8. A data sharing device for a secure virtual machine, characterized in that: A first processor applied to a system on chip, the first processor is used to run a security firmware, the system on chip also includes a second processor, the second processor is used to run a security virtual machine, and the data sharing device of the security virtual machine includes: A second shared key module, configured to generate a virtual machine shared key corresponding to the current secure virtual machine in response to a configuration operation for the current secure virtual machine according to configuration information of the current secure virtual machine; the configuration information of the secure virtual machine includes shared memory information; the shared memory information is used to create a shared memory; The second data sharing module is used to respond to a data sharing request carrying target secure virtual machine information, and the secure firmware uses the shared memory to share the shared data with the target secure virtual machine based on the virtual machine sharing key corresponding to the current secure virtual machine.
9. A system on chip, characterized in that: include: A first processor and a second processor; wherein, The first processor is used to run the security firmware, and the second processor is used to run the security virtual machine; The security firmware is configured to: in response to a configuration operation for a current security virtual machine, generate a virtual machine shared key corresponding to the current security virtual machine according to configuration information of the current security virtual machine; the configuration information of the security virtual machine includes shared memory information; the shared memory information is used to create a shared memory; In response to a data sharing request carrying target secure virtual machine information, the secure firmware uses the shared memory to share the shared data with the target secure virtual machine based on a virtual machine sharing key corresponding to the current secure virtual machine.
10. A computing device, characterized in that The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the data sharing method of the secure virtual machine as claimed in any one of claims 1 to 7 when executing the computer program.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the data sharing method for the secure virtual machine according to any one of claims 1 to 7 is implemented.
