Device access method and apparatus
By dividing the security attributes of memory and accelerator in heterogeneous devices and establishing a confidential computing environment, the shortcomings of confidential computing requirements in heterogeneous computing scenarios are solved, security and efficiency are improved, and cost and power consumption are reduced.
Patent Information
- Application Number
- PCT/CN2024/081130
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-16
- Filing Date
- 2024-03-12
- Publication Date
- 2024-11-21
AI Technical Summary
The current confidential computing architecture cannot meet the confidential computing needs in heterogeneous computing scenarios, and there are shortcomings in terms of security, work efficiency and ease of use.
Provides a method and device for accessing devices, by dividing memory and accelerator security attributes in heterogeneous devices, establishing a confidential computing environment, ensuring the security of data channels, and reducing costs and power consumption.
It realizes the confidential computing needs of tenants under a heterogeneous computing architecture, improves the security and work efficiency of computing, reduces cost and power consumption, and simplifies the implementation process of confidential computing.
Smart Images

Figure CN2024081130_21112024_PF_FP_ABST
Abstract
Description
Device access method and device
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on May 16, 2023, with application number 202310551446.2 and application name “A method and apparatus for accessing a device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of cloud computing, and more specifically, to a method and apparatus for accessing a device. Background Art
[0003] Virtualization technology is a mainstream technology in current cloud computing platforms. Through virtualization, tenants can deploy multiple computing instances (e.g., virtual machines) within a cloud computing platform, sharing hardware resources through time-sharing. Under the current virtualization framework, the virtual machine manager (VMM) manages all memory resources, meaning the VMM has access to the code and data of all tenant VMs. When tenants deploy cloud computing services on a cloud platform, cloud service providers can insert malicious code into the VMM to access tenant data. To prevent this, confidential computing technology has emerged.
[0004] Confidential computing technology is a computing model based on trusted hardware, combined with firmware and software to create an encrypted, isolated, and provable computing environment, ensuring the confidentiality and integrity of data, code integrity, and the confidentiality of computations within the environment. Currently, confidential computing environments are based on a central processing unit (CPU)-centric confidential computing architecture, where confidential data completes all computations within the CPU and returns the final results. While this confidential computing architecture can effectively protect tenants' data security, it cannot meet tenants' confidential computing needs in heterogeneous computing architectures. Furthermore, this confidential computing architecture still needs to be improved in terms of computing security, efficiency, and usability.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a device access method and apparatus that can meet the confidential computing needs of tenants in heterogeneous computing architecture scenarios.
[0007] In a first aspect, a memory access method is provided. The method is applied to a first device, where the first device includes a secure world and a non-secure world. The method includes: the first device receiving a first request message sent by a server, where the first request message is used to request the first device to determine a first memory address, where the first memory address corresponds to a first memory mapped input / output (MMIO) address in the secure world of the server; and the first device determining the first memory address in the secure world of the first device based on the first request message.
[0008] Optionally, the first memory address may be a memory address with a physical page as the granularity, or the first memory address may be a memory address with a physical memory segment as the granularity.
[0009] It should be understood that the secure world may also be referred to as a confidential domain or a trusted execution environment in this application, and the non-secure world may also be referred to as a normal domain or a non-trusted execution environment in this application; the first device may be referred to as a confidential device or a heterogeneous device (Device) in this application, and the server may be referred to as a host (HOST) in this application.
[0010] In an embodiment of the present application, the first device can divide the first memory address according to the first request information, so as to facilitate the server to access the first memory address through the first MMIO address. In this way, the data channel established between the server and the first device cannot be stolen by software in the non-secure world, thereby meeting the confidential computing needs of the tenant in the heterogeneous computing architecture scenario.
[0011] In combination with the first aspect, in certain implementations of the first aspect, the first device determines the first memory address in the secure world of the first device based on the first request information, including: the first device divides the second memory address in the non-secure world of the first device into the first memory address based on the first request information.
[0012] Optionally, the first memory address and the second memory address may be the same memory address, but have different security attributes.
[0013] Optionally, dividing the second memory address in the non-secure world of the first device into the first memory address can also be understood as: the first device divides the memory attribute of the second memory address into secure and sets the corresponding page table.
[0014] In an embodiment of the present application, the first device can divide the second memory address in the non-secure world of the first device into the first memory address according to the instruction of the first request information, thereby facilitating the server to access the first memory address based on the first MMIO address.
[0015] In combination with the first aspect, in certain implementations of the first aspect, the first memory address is a memory address with physical memory segment as the granularity. Before the first device divides the second memory address in the non-secure world of the first device into the first memory address based on the first request information, the method also includes: the first device divides the memory of the first device according to a fixed memory division method to obtain the second memory address.
[0016] For example, when the first device has a total memory of 64GB, the first device can divide the memory according to a fixed memory division method (for example, 8GB, 16GB, 32GB), and the first device can authorize the divided memory according to the instruction of the first request information. For example, the first request information requests the first device to grant the right to use 8GB of memory to the secure world of the first device. The first device can divide the 64GB of memory in 8GB manner and authorize the divided 8GB of memory to be used by the secure world of the first device. Among them, the address corresponding to the divided 8GB of memory before it is authorized for use by the secure world of the first device can be called the second memory address, and the address corresponding to the divided 8GB of memory after it is authorized for use by the secure world of the first device can be called the first memory address.
[0017] In an embodiment of the present application, the first device can divide the second memory address according to a fixed memory partitioning method. In this way, the first device can simply and efficiently divide the first memory address, thereby reducing the cost and power consumption of confidential computing under a heterogeneous computing architecture.
[0018] In combination with the first aspect, in certain implementations of the first aspect, the first device determines the first memory address in the secure world of the first device based on the first request information, including: the first device checks the legitimacy of the first request information; when the first request information is legit, the first device determines the first memory address based on the first request information.
[0019] Optionally, the first device checks the legitimacy of the first request information, including: the first device checks whether the second memory address has been used by the secure world of the first device; if the second memory address is not used by the secure world of the first device, the first request information is confirmed to be legal; otherwise, the first request information is confirmed to be illegal.
[0020] In the embodiment of the present application, the first device can check the validity of the first request information before determining the first memory address. In this way, the first request information can be prevented from being tampered with, ensuring the security of the server accessing the first memory address through the first MMIO address.
[0021] In combination with the first aspect, in some implementations of the first aspect, the method also includes: the first device receives a second request message sent by the server, the second request message being used to request the first device to divide one or more accelerators into the secure world of the first device; and the first device divides one or more accelerators in the non-secure world of the first device into the secure world of the first device based on the second request message.
[0022] Optionally, the first device may divide one or more accelerators into the secure world of the first device according to preset rules. For example, the first device includes 8 accelerators. The first device may divide 1, 2, or 4 of the accelerators into the secure world of the first device for use according to the instructions of the second request information.
[0023] Optionally, before being divided into the secure world of the first device, the one or more accelerators may be located in the non-secure world of the first device.
[0024] It should be understood that the accelerator in this application may also be referred to as a heterogeneous accelerator, which may be used to perform cyclic calculations on the resource-consuming portion of the CPU in the server or the first device, thereby saving the computing resources of the CPU.
[0025] In the embodiment of the present application, the first device may allocate one or more accelerators to the secure world of the first device for use according to the second request information, thereby facilitating the server to access the one or more accelerators based on the first MMIO address.
[0026] In combination with the first aspect, in certain implementations of the first aspect, the first device divides one or more accelerators in the non-secure world of the first device into the secure world of the first device based on the second request information, including: the first device checks the legitimacy of the second request information; if the second request information is legal, the first device divides one or more accelerators in the non-secure world of the first device into the secure world of the first device based on the second request information.
[0027] Optionally, the first device checks the legitimacy of the second request information, including: the first device checks whether the one or more accelerators divided this time have been used by the secure world of the first device. If the one or more accelerators have been used by the secure world of the first device, the second request information is determined to be illegal; otherwise, the second request information can be determined to be legal.
[0028] In an embodiment of the present application, before the first device divides one or more accelerators into the secure world of the first device, the first device may check the legitimacy of the second request information, thereby ensuring the security of the divided one or more accelerators.
[0029] In combination with the first aspect, in some implementations of the first aspect, the method also includes: the first device negotiates a session key with the server according to a key negotiation protocol, and the session key is used to encrypt or decrypt communication data between the server and the first device; the first device stores the session key.
[0030] In an embodiment of the present application, the first device can store a session key, so that the first device can use the session key to encrypt or decrypt communication data between the first device and the server. In this way, the communication security between the server and the first device can be further guaranteed, thereby meeting the tenant's confidential computing needs in a heterogeneous computing architecture scenario.
[0031] In a second aspect, a device access method is provided. The method is applied to a server, the server including a secure world and a non-secure world. The method includes: the server determining a first MMIO address in the secure world of the server; the server sending a first request message to a first device, the first request message being used to request the first device to determine a first memory address in the secure world of the first device, the first memory address corresponding to the first MMIO address; and the server accessing the first memory address through the first MMIO address.
[0032] Optionally, after receiving a response message indicating that the first device has allocated the first memory address, the server may access the first memory address through the first MMIO address.
[0033] In an embodiment of the present application, the server can send a first request message to the first device, requesting the first device to divide the first memory address, and the server can access the first memory address through the first MMIO address. In this way, the data channel established between the server and the first device cannot be stolen by software in the non-secure world, and can meet the confidential computing needs of tenants in heterogeneous computing architecture scenarios.
[0034] In combination with the second aspect, in some implementations of the second aspect, the method further includes: the server sending a second request message to the first device, where the second request message is used to request the first device to partition one or more accelerators into the secure world of the first device; and the server accessing the one or more accelerators through the first MMIO address.
[0035] Optionally, after receiving the response message sent by the first device indicating that one or more accelerators have been divided, the server may access the one or more accelerators through the first MMIO address.
[0036] In an embodiment of the present application, the server can send a second request message to the first device, requesting the first device to divide out one or more accelerators. The server can access the one or more accelerators based on the first MMIO address, thereby facilitating the server to send confidential computing tasks to the one or more accelerators.
[0037] In combination with the second aspect, in some implementations of the second aspect, the server determining the first MMIO address includes: the server dividing a second MMIO address in the non-secure world of the server into the first MMIO address.
[0038] Optionally, the first MMIO address and the second MMIO address may be the same memory address, but have different security attributes.
[0039] In combination with the second aspect, in certain implementations of the second aspect, the method further includes: the server negotiates a session key with the first device according to a key negotiation protocol, and the session key is used to encrypt or decrypt communication data between the server and the first device; and the server stores the session key.
[0040] In an embodiment of the present application, the server can store a session key, so that the server can use the session key to encrypt or decrypt communication data between the first device and the server. In this way, the communication security between the server and the first device can be further guaranteed, thereby meeting the tenant's confidential computing needs in a heterogeneous computing architecture scenario.
[0041] In combination with the second aspect, in some implementations of the second aspect, the first memory address is a memory address with a physical page as the granularity, or the first memory address is a memory address with a physical memory segment as the granularity.
[0042] According to a third aspect, a device access apparatus is provided, which is applied to a first device, wherein the first device includes a secure world and a non-secure world, and the apparatus includes a transceiver module and a processing module; the transceiver module is used to receive a first request message sent by a server, wherein the first request message is used to request the first device to determine a first memory address, and the first memory address corresponds to a first MMIO address in the secure world of the server; the processing module is used to determine the first memory address in the secure world of the first device according to the first request message.
[0043] In combination with the third aspect, in certain implementations of the third aspect, the processing module is specifically used to divide the second memory address in the non-secure world of the first device into the first memory address according to the first request information.
[0044] In combination with the third aspect, in certain implementations of the third aspect, the first memory address is a memory address with physical memory segments as the granularity; the processing module is also used to divide the memory of the first device according to a fixed memory partitioning method to obtain the second memory address.
[0045] In combination with the third aspect, in certain implementations of the third aspect, the processing module is specifically used to: check the legality of the first request information; and if the first request information is legal, divide the second memory address of the non-secure world of the first device into the first memory address according to the first request information.
[0046] In combination with the third aspect, in certain implementations of the third aspect, the transceiver module is further used to receive a second request message sent by the server, where the second request message is used to request the first device to divide one or more accelerators into the secure world of the first device; the processing module is further used to divide one or more accelerators in the non-secure world of the first device into the secure world of the first device based on the second request message.
[0047] In combination with the third aspect, in certain implementations of the third aspect, the processing module is specifically used to: check the legality of the second request information; if the second request information is legal, divide one or more accelerators in the non-secure world of the first device into the secure world of the first device according to the second request information.
[0048] In combination with the third aspect, in certain implementations of the third aspect, the processing module is further used to: negotiate a session key with the server according to a key negotiation protocol, wherein the session key is used to encrypt or decrypt communication data between the server and the first device; and store the session key.
[0049] In a fourth aspect, a device access device is provided, which is applied to a first device, wherein the first device includes: a secure world and a non-secure world, and the device includes: a transceiver module and a processing module; the transceiver module is used to receive a first request information sent by a server, and the first request information is used to request the first device to determine a first memory address, and the first memory address corresponds to the first MMIO address in the secure world of the server; the processing module is used to determine the first memory address in the secure world of the first device based on the first request information.
[0050] In combination with the fourth aspect, in certain implementations of the fourth aspect, the transceiver module is further used to send a second request message to the first device, where the second request message is used to request the first device to partition one or more accelerators into the secure world of the first device; and the processing module accesses the one or more accelerators through the first MMIO address.
[0051] In combination with the fourth aspect, in certain implementations of the fourth aspect, the processing module is specifically configured to divide the second MMIO address in the non-secure world of the server into the first MMIO address.
[0052] In combination with the fourth aspect, in certain implementations of the fourth aspect, the processing module is further used to negotiate a session key with the first device according to a key negotiation protocol, wherein the session key is used to encrypt or decrypt communication data between the server and the first device; and store the session key.
[0053] In a fifth aspect, an embodiment of the present application provides an access device for a device, which includes a processor, which is used to couple with a memory, read and execute instructions and / or program codes in the memory to execute the method in the first aspect and its various implementations or the second aspect and its various implementations.
[0054] In a sixth aspect, an embodiment of the present application provides a chip system, which includes a logic circuit, which is used to couple with an input / output interface and transmit data through the input / output interface to execute the method in the first aspect and its various implementations or the second aspect and its various implementations.
[0055] In the seventh aspect, an embodiment of the present application provides a computer-readable storage medium, which stores program code. When the computer storage medium runs on a computer, it enables the computer to execute the method in the first aspect and its various implementations or the second aspect and its various implementations.
[0056] In an eighth aspect, an embodiment of the present application provides a computer program product, which includes: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect and its various implementations or the second aspect and its various implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] FIG1 is a schematic diagram of a virtualization technology framework provided by an embodiment of the present application;
[0058] FIG2 is a schematic diagram of another virtualization technology framework provided by an embodiment of the present application;
[0059] FIG3 is a confidential computing architecture based on an authorization mechanism provided in an embodiment of the present application;
[0060] FIG4 is a requester-responder model provided by an embodiment of the present application;
[0061] FIG5 is a system architecture applicable to the device access method provided in an embodiment of the present application;
[0062] FIG6 is a method for accessing a device provided in an embodiment of the present application;
[0063] FIG7 is another system architecture applicable to the device access method provided in an embodiment of the present application;
[0064] FIG8 is another device access method provided by an embodiment of the present application;
[0065] FIG9 is a system architecture applicable to a computing environment destruction method provided in an embodiment of the present application;
[0066] FIG10 is a method for destroying a confidential computing environment provided by an embodiment of the present application;
[0067] FIG11 is a schematic diagram of a control CPU supporting an authorization mechanism deployed on a heterogeneous device according to an embodiment of the present application;
[0068] FIG12 is a construction process of a heterogeneous confidential computing environment provided in an embodiment of the present application;
[0069] FIG13 is a schematic diagram of deploying simple partitioning logic on heterogeneous devices according to an embodiment of the present application;
[0070] FIG14 is a construction process in another heterogeneous confidential computing environment provided by an embodiment of the present application;
[0071] FIG15 is a structural diagram illustrating an access device of a device provided in an embodiment of the present application;
[0072] FIG16 is a structural diagram illustrating an access device of another device provided in an embodiment of the present application;
[0073] FIG17 is an example diagram of a computer program product provided in an embodiment of the present application. DETAILED DESCRIPTION
[0074] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
[0075] Virtualization technology is a mainstream technology in current cloud computing platforms. Through virtualization, tenants can deploy multiple computing instances (e.g., virtual machines) on the cloud platform and use hardware resources through time-sharing. As shown in Figure 1, in this virtualization technology framework, tenants provide computing services, cloud service providers provide VMM software, and hardware providers provide CPUs that support virtualization. The VMM uses the virtualization support provided by the CPU to provide resource management, dynamic scheduling, and other functions for upper-level virtual machines. For example, the VMM can configure different access control lists for memory access by different virtual machines, preventing a virtual machine from accessing the memory resources of another virtual machine without authorization.
[0076] Confidential computing is a computing model that uses trusted hardware, combined with firmware and software, to create an encrypted, isolated, and provable computing environment, guaranteeing the confidentiality and integrity of data, code, and operations within the environment. The need for confidential computing stems from tenants' distrust of virtual machine (VMM) software. Under current virtualization technology, the VMM manages all memory resources, meaning it has access to the code and data of all tenant virtual machines. When tenants deploy cloud computing services on a cloud platform, cloud service providers can inject malicious code into the VMM to access tenant data. Confidential computing uses isolation mechanisms to separate the general computing environment from the confidential computing environment, preventing unauthorized applications from accessing the confidential computing environment. Confidential computing can verify the integrity and legitimacy of applications running in the confidential computing environment through remote attestation. Furthermore, encryption mechanisms ensure that in-memory computations are encrypted, preventing snooping by privileged software or even hardware.
[0077] The foundation of confidential computing technology lies in the hardware-based trusted execution environment (TEE). Through hardware-based isolation mechanisms, the code and data running in the TEE cannot be accessed or tampered with by untrusted code. Confidential computing's advantage over other privacy technologies lies in its balance of security, versatility, and efficiency. It seamlessly supports common computing frameworks and applications, while offering computing performance comparable to that of plaintext computing. It can be used independently to protect data in a computational state or combined with other technologies. It is a crucial technical tool for scenarios involving big data, high performance, and general privacy computing, such as secure and trusted cloud computing, large-scale data confidentiality collaboration, and privacy-preserving deep learning.
[0078] On the other hand, artificial intelligence (AI) technologies, represented by machine learning and deep neural networks, are characterized by large-scale data parallel computing. From a hardware architecture perspective, AI computing is more suitable for heterogeneous computing architectures such as graphics processing units (GPUs) or neural network processing units (NPUs). Heterogeneous computing units like GPUs / NPUs are characterized by high bandwidth and high concurrency, making them suitable for simple computational logic, such as matrix operations. Compared to CPU architectures, GPUs / NPUs have strong computing power but weak control capabilities (conditional judgment and speculative execution). Therefore, current heterogeneous computing is characterized by the CPU analyzing and splitting computing tasks into individual tasks through control logic. These tasks are then dispatched to the GPU / NPU for computation, and the CPU then combines the computational results and returns the final result. As shown in Figure 2, a confidential virtual machine (also called a confidential virtual machine) on the server (host) side issues instructions and distributes data to heterogeneous devices using memory-mapped input and output (MMIO) addresses. System software can access heterogeneous devices as if they were memory. After completing heterogeneous computing, the heterogeneous device writes the data back to the physical address memory space and notifies the host CPU. After receiving the notification, the host CPU can read the data from the memory space. Both the MMIO address space and the physical address memory space are part of the address space accessible to the CPU. The MMIO address space represents the access space for heterogeneous devices, while the physical address space represents the access space for dynamic random access memory (DRAM).
[0079] Figure 3 is a confidential computing architecture based on the authorization mechanism provided in an embodiment of the present application.
[0080] The architecture shown in Figure 3 includes a secure world and a non-secure world. As shown in Figure 4, this architecture is based on a requester-responder model. The requester (i.e., the virtual machine management module in the non-secure world in Figure 3) initiates a memory space authorization request, granting the secure world access to the memory space in the non-secure world. The responder (i.e., the RMM in the secure world in Figure 3) verifies the legitimacy of the request and, if it passes, performs subsequent operations. Confidential virtual machines built in the secure world can access confidential data through page table entries constructed by the RMM. Furthermore, because the memory space is authorized to the secure world, malware in the non-secure world cannot steal confidential data in memory. The advantage of this authorization mechanism is that the responder in the secure world only needs to verify the legitimacy of the request. The original management logic for virtual machine scheduling, page faults, and other tasks can maximize the reuse of existing code while meeting the data protection requirements of confidential computing.
[0081] However, the development of heterogeneous computing architecture has brought new challenges to the above-mentioned CPU-centric confidential computing architecture. This confidential computing architecture cannot meet the confidential computing needs of tenants in heterogeneous computing architecture scenarios. Moreover, this confidential computing architecture needs to be improved in terms of computing security, work efficiency and ease of use.
[0082] The embodiments of the present application provide a method for accessing a device, which can build a confidential computing environment in a heterogeneous scenario to meet the confidential computing needs of tenants in a heterogeneous computing scenario.
[0083] FIG5 is a system architecture applicable to the device access method provided in an embodiment of the present application.
[0084] As shown in Figure 5, the virtual function (VF) driver module is authorized to the secure world. Based on this, the confidential VM in the server can use the VF module to dispatch confidential computing tasks to the secure memory and secure accelerator in the heterogeneous device. The data channel established between the server and the heterogeneous device cannot be eavesdropped by malware in the non-secure world, thus meeting the confidential computing needs of tenants in heterogeneous computing architectures.
[0085] FIG6 is a device access method provided by an embodiment of the present application. Method 600 can be applied to the architecture shown in FIG5 . Method 600 can include the following steps.
[0086] S601: The server sends first request information to the first device.
[0087] The first request information is used to request the first device to determine a first memory address, where the first memory address corresponds to a first memory mapped input / output (MMIO) address in the secure world of the server.
[0088] Optionally, the first memory address may be a memory address with a physical page as the granularity, or the first memory address may be a memory address with a physical memory segment as the granularity. The first device includes: a secure world and a non-secure world, and the server includes: a secure world and a non-secure world.
[0089] Optionally, the secure world in the server and the secure world in the first device may not be the same secure world, and accordingly, the non-secure world in the server and the non-secure world in the first device may not be the same non-secure world.
[0090] It should be understood that the secure world may also be referred to as a confidential domain or a trusted execution environment in this application, and the non-secure world may also be referred to as a normal domain or a non-trusted execution environment in this application; the first device may be referred to as a confidential device or a heterogeneous device (Device) in this application, and the server may be referred to as a host (Host) in this application.
[0091] In one embodiment, before step S601 , the method 600 further includes: the server determining a first MMIO address in the secure world of the server.
[0092] Alternatively, the server may partition the second MMIO address in the non-secure world of the server into the first MMIO address.
[0093] Optionally, the first MMIO address and the second MMIO address may be the same memory address, but have different security attributes.
[0094] S602: The first device determines a first memory address in the secure world of the first device according to the first request information.
[0095] In one embodiment, the first device may divide the second memory address in the non-secure world of the first device into the first memory address according to the first request information, thereby facilitating the server to access the first memory address based on the first MMIO address.
[0096] Optionally, the first memory address and the second memory address may be the same memory address, but have different security attributes.
[0097] Alternatively, classifying the second memory address in the non-secure world of the first device as the first memory address can also be understood as: the first device setting the memory attribute of the second memory address to secure and configuring a corresponding page table. For example, the memory attribute of the second memory address can be set to secure by modifying the tag of the physical address of the second memory address, thereby classifying the second memory address as the first memory address.
[0098] In one embodiment, the first memory address is a memory address with a physical memory segment granularity. Before the first device partitions the second memory address in the non-secure world of the first device into the first memory address based on the first request information, method 600 may further include: the first device partitioning the memory of the first device according to a fixed memory partitioning method to obtain the second memory address. In this way, the first device can simply and efficiently partition the first memory address, thereby reducing the cost and power consumption of confidential computing in a heterogeneous computing architecture.
[0099] For example, when the first device has a total memory of 64GB, the first device can divide the memory in a fixed memory division method (for example, 8GB, 16GB, 32GB), and the first device can authorize the divided memory according to the instructions of the first request information. For example, the first request information requests the first device to grant the right to use 8GB of memory to the secure world of the first device. The first device can divide the 64GB of memory in 8GB manner and authorize the divided 8GB of memory to be used by the secure world of the first device. Among them, the address corresponding to the divided 8GB of memory before it is authorized for use by the secure world of the first device can be called the second memory address, and the address corresponding to the divided 8GB of memory after it is authorized for use by the secure world of the first device can be called the first memory address.
[0100] In one embodiment, before step S602, the first device may check the validity of the first request information. If the first request information is valid, the first device may determine the first memory address based on the first request information. This prevents tampering with the first request information and ensures the security of the server accessing the first memory address through the first MMIO address.
[0101] Optionally, the first device checks the legitimacy of the first request information, including: the first device checks whether the second memory address has been used by the secure world of the first device; if the second memory address is not used by the secure world of the first device, the first request information is confirmed to be legal; otherwise, the first request information is confirmed to be illegal.
[0102] S603: The server accesses the first memory address through the first MMIO address.
[0103] Optionally, after receiving a response message from the first device indicating that the first memory address has been allocated, the server may access the first memory address through the first MMIO address.
[0104] In an embodiment of the present application, the server can send a first request message to the first device, requesting the first device to divide the first memory address, and the server can access the first memory address through the first MMIO address. In this way, the data channel established between the server and the first device cannot be stolen by software in the non-secure world, and can meet the confidential computing needs of tenants in heterogeneous computing architecture scenarios.
[0105] The first device may not only divide the security attributes of the memory in the first device based on the request information sent by the server, but may also divide the security attributes of the accelerator in the first device based on the request information sent by the server.
[0106] In one embodiment, method 600 further includes: the server sending a second request message to the first device, the second request message being used to request the first device to partition one or more accelerators into the secure world of the first device; the first device receiving the second request message sent by the server, and the first device partitioning the one or more accelerators in the non-secure world of the first device into the secure world of the first device based on the second request message, and the server accessing the one or more accelerators through the first MMIO address. This facilitates the server to issue confidential computing tasks to the one or more accelerators.
[0107] Optionally, the first device may divide one or more accelerators into the secure world of the first device according to preset rules. For example, the first device includes 8 accelerators. The first device may divide 1, 2 or 4 of the accelerators into the secure world of the first device for use according to the instructions of the second request information.
[0108] Optionally, before being divided into the secure world of the first device, the one or more accelerators may be located in the non-secure world of the first device.
[0109] Optionally, after receiving the response message sent by the first device indicating that one or more accelerators have been divided, the server may access the one or more accelerators through the first MMIO address.
[0110] It should be understood that the accelerator may include a heterogeneous accelerator, which may be used to perform cyclic calculations on a resource-consuming portion of a CPU in the server or the first device, thereby saving computing resources of the CPU.
[0111] In one embodiment, the first device partitions one or more accelerators in the non-secure world of the first device into the secure world of the first device based on the second request information. This includes: the first device checks the validity of the second request information; if the second request information is valid, the first device partitions the one or more accelerators in the non-secure world of the first device into the secure world of the first device based on the second request information. This ensures the security of the partitioned one or more accelerators.
[0112] Optionally, the first device checks the legitimacy of the second request information, including: the first device checks whether the one or more accelerators divided this time have been used by the secure world of the first device. If the one or more accelerators have been used by the secure world of the first device, the second request information is determined to be illegal; otherwise, the second request information can be determined to be legal.
[0113] In one embodiment, method 600 further includes: the first device negotiating a session key with the server according to a key agreement protocol; the session key is used to encrypt or decrypt communication data between the server and the first device; and the first device and the server storing the session key. This further ensures communication security between the server and the first device, thereby meeting tenants' confidential computing needs in heterogeneous computing architecture scenarios.
[0114] FIG7 is another system architecture applicable to the device access method provided in an embodiment of the present application.
[0115] In Figure 7, the host side can be divided into a normal domain and a confidential domain, and confidential VMs can run in the confidential domain. On the heterogeneous device side, memory attributes and heterogeneous accelerator attributes can be securely partitioned, and secure memory can only be accessed by confidential VMs and secure heterogeneous accelerators on the host side.
[0116] Among them, the normal domain can be the non-secure world in method 600, the confidential domain can be the secure world in method 600, and the heterogeneous accelerator can be used to perform cyclic calculations on the resource-consuming part of the CPU, thereby saving the CPU's computing resources.
[0117] The following describes in detail the device access process in conjunction with the flowchart shown in FIG8 . Method 800 may be a more specific implementation of method 600 . Method 800 may include the following steps.
[0118] S801: Build a confidential virtual machine on the host side.
[0119] Step S801 may correspond to step ① in FIG. 7 , and may include the following two sub-steps:
[0120] S801a: After receiving the confidential VM establishment request, the host-side VM management module authorizes the host-side non-secure memory to the confidential domain. The memory management module within the confidential domain verifies the validity of the memory authorization request in the establishment request. If the verification passes, the memory management module classifies the non-secure memory as secure and sets the corresponding page table. Once the memory management module completes all confidential memory divisions and data loading, the confidential VM can be started in the host-side confidential domain.
[0121] Exemplarily, the memory management module performing a validity check on the memory authorization request may include: checking whether the memory to be authorized has been authorized, and / or checking whether the memory to be authorized has been used by the confidentiality domain.
[0122] It should be understood that the page table can be a special data structure stored in the page table area of the system space, which stores the correspondence between logical pages and physical pages. The server or confidential device can translate the virtual address it accesses through the page table.
[0123] S801b, the host-side confidential domain kernel module performs integrity measurement on the confidential virtual machine in the confidential domain. The measurement value can be submitted to the tenant for verification to ensure that the confidential virtual machine code loaded in the confidential domain meets the tenant's expectations.
[0124] Among them, integrity measurement can verify the integrity of code and data in the confidential domain. The integrity measurement process can be: generate a signature (measurement value) based on the hash value (Hash) and random number of the code to be tested, and then submit the signature to a third party for verification.
[0125] S802: The host side builds a confidential computing environment on the heterogeneous device side.
[0126] The host may be the server in method 600, the heterogeneous device may be the first device in method 600, step S802 may correspond to step ② in FIG. 7, and step S802 may include the following four sub-steps:
[0127] S802a, the host-side virtual machine management module receives the establishment request from the confidential device management module (not shown in Figure 7)
[0128] , authorize the non-secure MMIO address space on the host side to the confidential domain. The memory management module of the confidential domain performs a legitimacy check on the memory authorization request in the establishment request. After the check passes, the memory management module of the confidential domain classifies the MMIO address space attribute as secure.
[0129] S802b: The host-side physical device driver module receives the establishment request from the confidential device management module, and the host issues a memory authorization request to the heterogeneous device. The host-side scheduling module forwards the memory authorization request to the memory management module of the confidential domain on the heterogeneous device. The memory management module on the heterogeneous device verifies the validity of the request. If the request passes the verification, the memory management module of the confidential domain on the heterogeneous device classifies the memory attributes as secure and sets the corresponding page table. This memory authorization request may be the first request information in method 600.
[0130] Exemplarily, the memory management module performing a validity check on the memory authorization request may include: checking whether the memory to be authorized has been authorized, and / or checking whether the memory to be authorized has been used by a common domain.
[0131] S802c: The host sends an accelerator authorization request to the heterogeneous device. The heterogeneous device scheduling module forwards the request to the hardware resource management module of the confidentiality domain on the heterogeneous device. The hardware resource management module of the confidentiality domain on the heterogeneous device verifies the validity of the request. If the request passes the verification, the hardware resource management module of the confidentiality domain on the heterogeneous device sets the security attribute of the heterogeneous accelerator to secure. This accelerator authorization request may be the second request information in method 600.
[0132] Exemplarily, the hardware resource management's legitimacy check on the accelerator authorization request may include: checking whether the currently divided accelerator has been allocated to the confidential domain, and / or checking whether the currently divided accelerator has been used by the common domain.
[0133] S802d, the confidential domain memory management module on the heterogeneous device side obtains the security configuration on the heterogeneous device side (for example, loaded code, register status, etc.) for integrity measurement, and the measurement value is submitted to the tenant for verification to ensure that the configuration in the confidential domain on the heterogeneous device side meets the tenant's expectations.
[0134] S803: Establish an encrypted channel between the host and the heterogeneous device.
[0135] Exemplarily, the key management module in the confidentiality domain on the host side and the key management module in the confidentiality domain on the heterogeneous device side can negotiate a session key through a key exchange protocol, and manage and store the key through their respective key management modules.
[0136] After completing steps S801 to S803, the confidential VM can issue confidential computing tasks to the secure memory and secure accelerator on the heterogeneous device through the virtual device driver module. Furthermore, it should be noted that step S803 can be omitted in method 800. Specifically, when an attacker physically sniffs or intercepts data on the transmission bus, the encrypted channel must be enabled. When there are no potential physical attackers, the confidential VM can issue confidential data in plain text.
[0137] In an embodiment of the present application, the MMIO address space can be divided for use by the confidential domain through the authorization mechanism of the memory space. The confidential virtual machine can access heterogeneous devices through the divided MMIO address. The data channel cannot be stolen by software in the non-secure world, thereby meeting the confidential computing needs of tenants in heterogeneous computing architecture scenarios.
[0138] FIG9 is a system architecture applicable to a computing environment destruction method provided in an embodiment of the present application.
[0139] In Figure 9, the host side can be divided into a common domain and a confidential domain, and confidential VMs can run in the confidential domain. On the heterogeneous device side, memory attributes and heterogeneous accelerator attributes can be securely partitioned, and secure memory can only be accessed by confidential VMs and secure heterogeneous accelerators on the host side.
[0140] Among them, the normal domain can be the non-secure world in method 600, the confidential domain can be the secure world in method 600, and the heterogeneous accelerator can be used to perform cyclic calculations on the resource-consuming part of the CPU, thereby saving the CPU's computing resources.
[0141] The following describes a method for destroying a confidential computing environment in conjunction with FIG10 . Method 1000 may include the following steps.
[0142] S1001, destroy the confidential VM on the host side.
[0143] Among them, step S1001 can correspond to ① in Figure 9.
[0144] Exemplarily, when the host-side virtual machine management module receives a confidential virtual machine destruction request, it can send a memory deauthorization request to the host-side confidential domain memory management module. The confidential domain memory management module can perform a legitimacy check on the memory deauthorization request and check whether the current confidential virtual machine is in an inactive state. The confidential virtual machine being in an inactive state can be understood as a state in which the confidential virtual machine is not executing any tasks. When the legitimacy check passes and the confidential virtual machine is in an inactive state, the host-side confidential domain memory management module can clear the data in the memory and deauthorize the memory to the non-secure world. In this process, if a session key is constructed, the host side can simultaneously destroy the session key used by the confidential virtual machine.
[0145] S1002, destroy the confidential computing environment on the heterogeneous device side.
[0146] Among them, step S1002 corresponds to ② in FIG. 9 , and step S1002 may include the following three sub-steps.
[0147] S1002a: After receiving the destruction request from the confidential device management module (not shown in FIG9 ), the host-side virtual machine management module deauthorizes the host-side secure MMIO address space to the common domain. The confidential domain memory management module performs a validity check on the memory deauthorization request. If the request passes the validation check, the confidential domain memory management module may classify the MMIO address space as non-secure.
[0148] S1002b: After the physical device driver module on the host side receives the destruction request from the decryption device management module, the host side sends a memory deauthorization request to the heterogeneous device side. The scheduling module on the heterogeneous device side forwards the request to the memory management module of the confidential domain on the heterogeneous device side. The memory management module of the confidential domain on the heterogeneous device side checks the legitimacy of the memory deauthorization request. After the check passes, the memory management module of the confidential domain on the heterogeneous device side can clear the data in the memory, classify the memory attributes as non-secure, and set the corresponding page table. During this process, if the heterogeneous device side has a session key, the session key used by the heterogeneous device side can be destroyed at the same time.
[0149] S1002c: The host sends an accelerator deauthorization request to the heterogeneous device. The heterogeneous device scheduling module forwards the request to the hardware resource management module of the confidentiality domain on the heterogeneous device. The hardware resource management module of the confidentiality domain on the heterogeneous device verifies the legitimacy of the accelerator deauthorization request and checks whether the heterogeneous accelerator is in an inactive state. The inactive state of the heterogeneous accelerator can be understood as a state in which the heterogeneous accelerator is not executing any tasks. If the check request passes and the heterogeneous accelerator is in an inactive state, the hardware resource management module of the confidentiality domain on the heterogeneous device can clear the data in the heterogeneous accelerator and set the security attribute of the heterogeneous accelerator to non-secure.
[0150] In an embodiment of the present application, the MMIO address can be deauthorized to the non-secure world through the authorization mechanism of the memory space, thereby completing the destruction of the constructed confidential computing environment.
[0151] FIG11 is a schematic diagram of a control CPU supporting an authorization mechanism deployed on heterogeneous devices provided by an embodiment of the present application.
[0152] As shown in Figure 11, a CPU that supports authorization mechanisms can be deployed on heterogeneous devices. This CPU supports the division of secure and non-secure worlds, and supports memory switching between secure and non-secure worlds at a page granularity (e.g., 2MB). In this case, the confidentiality domain management module (including the memory management module and the hardware resource management module) in Figure 7 can be deployed in the secure world of this CPU, namely, the device trusted management module. This CPU can be called the control CPU.
[0153] The following describes the device access process using FIG. 12 as an example. Method 1200 may be a more specific implementation of method 600 and method 800 . Method 1200 may include the following steps.
[0154] S1201: The host-side virtual machine management module receives a confidential virtual machine establishment request and authorizes the host-side non-secure memory to the confidential domain.
[0155] The host-side host trusted management module performs a validity check on the memory authorization request in the setup request. If the request passes the check, the confidential domain host trusted management module classifies the memory as secure and sets up the corresponding page table. Once all required confidential memory is partitioned and data loaded, the confidential VM is started in the host-side confidential domain.
[0156] S1202: The host trusted management module performs integrity measurement on the confidential virtual machine of the confidential domain.
[0157] After the measurement is performed, the measurement value can be submitted to the tenant for verification to ensure that the confidential VM code loaded in the confidential domain meets the tenant's expectations.
[0158] S1203: The virtual machine management module receives the establishment request from the confidential device management module, and the virtual machine management module authorizes the host-side non-secure MMIO address space to the confidential domain.
[0159] The host trusted management module may perform a validity check on the memory authorization request in the establishment request. After the check passes, the host trusted management module may classify the MMIO address space attribute as safe.
[0160] S1204 : The physical device driver module on the host side receives the establishment request from the confidential device management module and sends a memory authorization request to the heterogeneous device side. The memory authorization request may be the first request information in method 600 .
[0161] The scheduling module on the heterogeneous device side forwards the memory authorization request to the non-secure world interface (Home OS) of the control CPU. After receiving the memory authorization request, the non-secure world interface Home OS can forward the memory authorization request to the device trusted management module. The device trusted management module can classify the memory attributes as secure and set the corresponding page table on the heterogeneous device side.
[0162] The scheduling module sends a memory authorization request to the Home OS, which controls the CPU, and then forwards the request to the device trusted management module to simplify management logic. The device trusted management module, which controls the CPU, is a new addition to the existing device logic. In the existing logic, after the scheduling module sends a request to the Home OS, the Home OS can directly manage the memory and heterogeneous accelerators on the heterogeneous device side. By adding the security attributes of the device trusted management module, memory, and heterogeneous accelerators in the secure world, additional signal processing logic can be added to the Home OS to forward the memory authorization request to the device trusted management module. Furthermore, from a code implementation perspective, adding an additional signal handler to the Home OS does not significantly increase code complexity. From a security perspective, the scheduling module directly sending signals to the device trusted management module offers the same or similar security as this forwarding strategy; in both cases, the device trusted management module performs security checks on the memory authorization request.
[0163] S1205: The physical device driver module sends an accelerator authorization request to the heterogeneous device side.
[0164] The accelerator authorization request may be the second request information in method 600 .
[0165] Optionally, the scheduling module on the heterogeneous device side may directly forward the accelerator authorization request to the device trusted management module of the confidentiality domain on the heterogeneous device side.
[0166] Optionally, the heterogeneous device-side scheduling module forwards the accelerator authorization request to the non-secure world Home OS of the control CPU. Upon receiving the accelerator authorization request, the non-secure world Home OS of the control CPU can forward the accelerator authorization request to the device trusted management module. The device trusted management module can perform a validity check on the accelerator authorization request. If the check passes, the device trusted management module can classify the accelerator's attributes as secure. Heterogeneous accelerators classified as secure can form a hardware cluster, which can be a partition of the heterogeneous accelerator management logic on the heterogeneous device side.
[0167] The authorization request for a heterogeneous accelerator must meet at least one of the following requirements:
[0168] (1) When the attribute of a heterogeneous accelerator in a hardware cluster is set to secure, the attributes of other heterogeneous accelerators in the hardware cluster (including newly authorized heterogeneous accelerators) should also be set to secure.
[0169] (2) The attributes of a heterogeneous accelerator in a hardware cluster are set to secure. When the trusted device management receives a request to reset the heterogeneous accelerator (for example, to deauthorize it as non-secure and assign it to another hardware cluster), it is necessary to ensure that the status of the heterogeneous accelerator is inactive, that is, no security tasks are running.
[0170] (3) After a heterogeneous accelerator is divided into security attributes, the heterogeneous accelerator can only be assigned to one hardware cluster.
[0171] S1206: The device trusted management module obtains the security configuration on the heterogeneous device side, performs integrity measurement, and submits the measurement value to the tenant for verification, thereby ensuring that the configuration in the confidential domain on the heterogeneous device side meets the tenant's expectations.
[0172] Optionally, the above security configuration may include: trusted device management code and register status, etc.
[0173] S1207: The host trusted management module and the device trusted management module negotiate a session key through a key exchange protocol, and store the key in their respective data integrity and data encryption (IDE) acceleration modules through their respective key management modules.
[0174] In an embodiment of the present application, by deploying a CPU that supports the authorization mechanism on the heterogeneous device side, the heterogeneous device side can perform fine-grained partitioning of memory and heterogeneous accelerators, thereby facilitating the host to access the partitioned secure memory and secure accelerators to meet the tenant's confidential computing needs in a heterogeneous computing architecture scenario.
[0175] FIG13 is a schematic diagram of deploying simple partitioning logic on heterogeneous devices provided in an embodiment of the present application.
[0176] As shown in Figure 13, in some cases, due to cost or power consumption considerations, it is impossible to deploy a control CPU that supports the authorization mechanism on the heterogeneous device side. In this case, the confidential domain management module (including the memory management module and the hardware resource management module) in Figure 9 can be deployed in the scheduling module on the heterogeneous device side. In a specific implementation, the scheduling module can be a CPU with basic functions, responsible for scheduling the computing tasks issued by the host side within the heterogeneous device. However, the scheduling module does not have complex functions such as secure world partitioning and memory authorization. In another implementation, the scheduling module can be an application specific integrated circuit (ASIC). After receiving the computing tasks issued by the host side, the scheduling module can send the computing tasks to the heterogeneous accelerator according to the preset scheduling policy. The CPU on the host side is a CPU that supports the authorization mechanism.
[0177] The following describes the device access process using FIG. 14 as an example. Method 1400 may be a more specific implementation of method 600 and method 800 . Method 1400 may include the following steps.
[0178] S1401: The host-side virtual machine management module receives a confidential virtual machine establishment request and authorizes the host-side non-secure memory to the confidential domain.
[0179] The host-side VM management module performs a validity check on the memory authorization request in the setup request. If the request passes the check, the confidential domain trusted server management module classifies the memory as secure and sets up the corresponding page table. Once all required confidential memory is allocated and data loaded, the confidential VM is started in the host-side confidential domain.
[0180] S1402: The host trusted management module performs integrity measurement on the confidential virtual machine of the confidential domain.
[0181] The measurement values can be verified by the tenant to ensure that the confidential virtual machine code loaded in the confidential domain meets the tenant's expectations.
[0182] S1403: The virtual machine management module receives the establishment request from the confidential device management module, and the virtual machine management module authorizes the host-side non-secure MMIO address space to the confidential domain.
[0183] The host trusted management module can perform a validity check on the memory authorization request. After the check passes, the trusted server management module can classify the MMIO address space attribute as safe.
[0184] S1404 : The host-side physical device driver module receives the establishment request from the confidential device management module and sends a memory authorization request to the heterogeneous device side. The memory authorization request may be the first request information in method 600 .
[0185] The scheduling module on the heterogeneous device side performs coarse-grained partitioning of memory. For example, when the memory on the heterogeneous device side is 64GB in total, fixed-size memory partitioning methods such as 8GB, 16GB, and 32GB can be provided. The heterogeneous device side can authorize the partitioned memory according to one of the above partitioning methods based on the instructions issued by the host physical device driver module.
[0186] S1405: The scheduling module divides the security attributes of the heterogeneous accelerators in equal proportions according to the proportion of the secure memory to the total memory.
[0187] For example, when the heterogeneous device side memory has a total of 64GB and 8 vector accelerators, the scheduling module can divide 1, 2 or 4 vector accelerators into security attributes according to the ratio.
[0188] S1406: The device trusted management module obtains the security configuration on the heterogeneous device side, performs integrity measurement, and submits the measurement value to the tenant for verification, thereby ensuring that the configuration in the confidential domain on the heterogeneous device side meets the tenant's expectations.
[0189] Optionally, the above security configuration may include: trusted device management code and register status, etc.
[0190] S1407: The host trusted management module and the device trusted management module negotiate a session key through a key exchange protocol, and store the key in their respective IDE acceleration modules through their respective key management modules.
[0191] In an embodiment of the present application, the heterogeneous device side can perform coarse-grained partitioning of memory and heterogeneous accelerators, thereby facilitating host access to the partitioned secure memory and heterogeneous accelerators. In this way, secure memory and heterogeneous accelerators can be partitioned simply and efficiently, thereby reducing the cost and power consumption of confidential computing under a heterogeneous computing architecture.
[0192] The above describes the access method of the device according to the embodiment of the present application. The following describes the apparatus and device according to the embodiment of the present application in conjunction with Figures 15 and 16 respectively.
[0193] Figure 15 is a structural example diagram of an access device 1500 of a device provided in an embodiment of the present application. The access device of the device includes a transceiver module 1510 and a processing module 1520. The transceiver module 1510 is used to send and receive instructions and / or data. The transceiver module 1510 can also be called a communication interface or communication module. The processing module 1520 is used to process data. Optionally, the device 1500 also includes a storage module, which is used to implement a corresponding storage function and store corresponding instructions and / or data. The processing module 1520 can read the instructions and / or data in the storage module so that the device 1500 implements the access method of the aforementioned device.
[0194] As a design, apparatus 1500 may execute the actions executed by the first device in the above method embodiment.
[0195] The apparatus 1500 includes: a transceiver module 1510 and a processing module 1520; the transceiver module 1510 is used to receive a first request message sent by a server, where the first request message is used to request a first device to determine a first memory address, where the first memory address corresponds to a first MMIO address in the secure world of the server; the processing module 1520 is used to determine the first memory address in the secure world of the first device based on the first request message.
[0196] In a possible implementation, the processing module 1520 is specifically configured to divide the second memory address in the non-secure world of the first device into the first memory address according to the first request information.
[0197] In a possible implementation, the first memory address is a memory address with a physical memory segment as the granularity; the processing module 1520 is further configured to divide the memory of the first device according to a fixed memory partitioning method to obtain the second memory address.
[0198] In one possible implementation, the processing module 1520 is specifically used to: check the legitimacy of the first request information; if the first request information is legal, divide the second memory address of the non-secure world of the first device into the first memory address according to the first request information.
[0199] In one possible implementation, the transceiver module 1510 is further used to receive a second request message sent by the server, where the second request message is used to request the first device to partition one or more accelerators into the secure world of the first device; the processing module 1520 is further used to partition one or more accelerators in the non-secure world of the first device into the secure world of the first device based on the second request message.
[0200] In one possible implementation, the processing module 1520 is specifically used to: check the legitimacy of the second request information; if the second request information is valid, divide one or more accelerators in the non-secure world of the first device into the secure world of the first device according to the second request information.
[0201] In a possible implementation, the processing module 1520 is further configured to: negotiate a session key with the server according to a key negotiation protocol, where the session key is used to encrypt or decrypt communication data between the server and the first device; and store the session key.
[0202] As another design, the device 1500 can execute the actions performed by the server in the above method embodiment.
[0203] The apparatus 1500 includes: a transceiver module 1510 and a processing module 1520; the transceiver module 1510 is used to receive a first request message sent by a server, where the first request message is used to request a first device to determine a first memory address, where the first memory address corresponds to a first MMIO address in the secure world of the server; the processing module 1520 is used to determine the first memory address in the secure world of the first device based on the first request message.
[0204] In one possible implementation, the transceiver module 1510 is further configured to send a second request message to the first device, where the second request message is configured to request the first device to partition one or more accelerators into the secure world of the first device; and the processing module 1520 accesses the one or more accelerators through the first MMIO address.
[0205] In a possible implementation, the processing module 1520 is specifically configured to divide the second MMIO address in the non-secure world of the server into the first MMIO address.
[0206] In a possible implementation, the processing module 1520 is further configured to negotiate a session key with the first device according to a key negotiation protocol, where the session key is used to encrypt or decrypt communication data between the server and the first device; and store the session key.
[0207] An embodiment of the present application further provides a computer storage medium having program instructions stored therein. When the program is executed, the program may include some or all steps of the device access method in the corresponding embodiments of Figures 6, 8, 10, 12, and 14.
[0208] FIG16 is a diagram illustrating a structure of another access device 1600 provided in an embodiment of the present application. The device 1600 includes a processor 1601, a communication interface 1602, and a memory 1603. An example of the device 1600 is a chip. Another example of the device 1600 is a computing device.
[0209] The methods disclosed in the above embodiments of the present application can be applied to or implemented by processor 1601. Processor 1601 can be a CPU, or other general-purpose processor, digital signal processor (DSP), ASIC, field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, etc. The general-purpose processor can be a microprocessor or any conventional processor. During implementation, each step of the above method can be completed by hardware integrated logic circuits in processor 1601 or instructions in software form. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor.
[0210] Memory 1603 may be volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. Nonvolatile memory may be read-only memory (ROM), programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0211] The processor 1601, the memory 1603 and the communication interface 1602 can communicate with each other via a bus. The memory 1603 stores executable code, and the processor 1601 reads the executable code in the memory 1603 to execute the corresponding method. The memory 1603 may also include an operating system and other software modules required for running processes. The operating system may be LINUX TM , UNIX TM , WINDOWS TM wait.
[0212] For example, the executable code in the memory 1603 is used to implement the methods shown in Figures 6, 8, 10, 12, and 14, and the processor 1601 reads the executable code in the memory 1603 to execute the methods shown in Figures 6, 8, 10, 12, and 14.
[0213] In some embodiments of the present application, the disclosed methods may be implemented as computer program instructions encoded in a machine-readable format on a computer-readable storage medium or on other non-transitory media or articles of manufacture.
[0214] Figure 17 schematically illustrates a conceptual partial view of an example computer program product arranged in accordance with at least some of the embodiments presented herein, the example computer program product comprising a computer program for executing a computer process on a computing device. In one embodiment, the example computer program product 1700 is provided using a signal-bearing medium 1701. The signal-bearing medium 1701 may include one or more program instructions 1702 that, when executed by one or more processors, may provide the functionality or portions of the functionality described above with respect to the methods illustrated in Figures 6, 8, 10, 12, and 14. Thus, for example, with reference to the embodiments illustrated in Figures 6, 8, 10, 12, and 14, one or more features thereof may be borne by one or more instructions associated with the signal-bearing medium 1701.
[0215] In some examples, signal-bearing medium 1701 may include computer-readable media 1703, such as, but not limited to, a hard drive, a compact disc (CD), a digital video disc (DVD), a digital tape, a memory, a read-only memory (ROM), or a random access memory (RAM), etc. In some embodiments, signal-bearing medium 1701 may include computer-recordable media 1704, such as, but not limited to, a memory, a read / write (R / W) CD, a R / W DVD, etc. In some embodiments, signal-bearing medium 1701 may include communication media 1705, such as, but not limited to, digital and / or analog communication media (e.g., fiber optic cables, waveguides, wired communication links, wireless communication links, etc.). Thus, for example, signal-bearing medium 1701 may be communicated via a wireless form of communication medium 1705 (e.g., a wireless communication medium that complies with the IEEE 802.11 standard or other transmission protocol). One or more program instructions 1702 may be, for example, computer-executable instructions or logic-implemented instructions. In some examples, the aforementioned computing device can be configured to provide various operations, functions, or actions in response to one or more program instructions 1702 communicated to the computing device by computer-readable media 1703, computer-recordable media 1704, and / or communication media 1705. It should be understood that the arrangement described herein is merely for illustrative purposes. Thus, it will be understood by those skilled in the art that other arrangements and other elements (e.g., machines, interfaces, functions, sequences, and functional groups, etc.) can be used instead, and some elements can be omitted altogether according to the desired result. In addition, many of the described elements can be implemented as discrete or distributed components or in any appropriate combination and position to implement functional entities in conjunction with other components.
[0216] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0217] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0218] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0219] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0220] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0221] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0222] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for accessing a device, It is characterized in that The method is applied to a first device, the first device comprising: a secure world and a non-secure world, and the method comprises: The first device receives first request information sent by the server, where the first request information is used to request the first device to determine a first memory address, where the first memory address corresponds to a first memory mapped input / output (MMIO) address in the secure world of the server; The first device determines a first memory address in the secure world of the first device according to the first request information.
2. The method according to claim 1, It is characterized in that The first device determines, according to the first request information, a first memory address in the secure world of the first device, including: The first device divides the second memory address in the non-secure world of the first device into the first memory address according to the first request information.
3. The method according to claim 2, It is characterized in that The first memory address is a memory address with a physical memory segment as a granularity. Before the first device divides the second memory address in the non-secure world of the first device into the first memory address according to the first request information, the method further includes: The first device divides the memory of the first device according to a fixed memory division method to obtain the second memory address.
4. The method according to any one of claims 1 to 3, It is characterized in that The first device determines, according to the first request information, a first memory address in the secure world of the first device, including: The first device checks the legitimacy of the first request information; When the first request information is legal, the first device determines the first memory address according to the first request information.
5. The method according to any one of claims 1 to 4, It is characterized in that The method further comprises: The first device receives second request information sent by the server, where the second request information is used to request the first device to divide one or more accelerators into the security world of the first device; The first device divides one or more accelerators in the non-secure world of the first device into the secure world of the first device according to the second request information.
6. The method according to claim 5, It is characterized in that The first device divides, according to the second request information, one or more accelerators in the non-secure world of the first device into the secure world of the first device, including: The first device checks the legitimacy of the second request information; If the second request information is legal, the first device divides one or more accelerators in the non-secure world of the first device into the secure world of the first device according to the second request information.
7. The method according to any one of claims 1 to 6, It is characterized in that The method further comprises: The first device negotiates a session key with the server according to a key negotiation protocol, where the session key is used to encrypt or decrypt communication data between the server and the first device; The first device stores the session key.
8. A method for accessing a device, It is characterized in that The method is applied in a server, the server includes: a secure world and a non-secure world, and the method includes: The server determines a first MMIO address in the secure world of the server; The server sends a first request message to the first device, where the first request message is used to request the first device to determine a first memory address in the secure world of the first device, where the first memory address corresponds to the first MMIO address; The server accesses the first memory address through the first MMIO address.
9. The method according to claim 8, It is characterized in that The method further comprises: The server sends second request information to the first device, where the second request information is used to request the first device to divide one or more accelerators into the secure world of the first device; The server accesses the one or more accelerators through the first MMIO address.
10. The method according to claim 8 or 9, It is characterized in that The server determines a first MMIO address, including: The server divides a second MMIO address in a non-secure world of the server into the first MMIO address.
11. The method according to any one of claims 8 to 10, It is characterized in that The method further comprises: The server negotiates a session key with the first device according to a key negotiation protocol, and the session key is used to encrypt or decrypt the server. communication data between the server and the first device; The server stores the session key.
12. The method according to any one of claims 8 to 11, It is characterized in that The first memory address is a memory address with a physical page as the granularity, or the first memory address is a memory address with a physical memory segment as the granularity.
13. An access device for a device, It is characterized in that include: A module for executing the method according to any one of claims 1 to 7.
14. An access device for a device, It is characterized in that include: A module for executing the method according to any one of claims 8 to 12.
15. An access device for a device, It is characterized in that include: A processor, wherein the processor is used to be coupled to a memory, read and execute instructions and / or program codes in the memory, so as to perform the method according to any one of claims 1 to 7.
16. An access device for a device, It is characterized in that include: A processor, wherein the processor is used to be coupled to a memory, read and execute instructions and / or program codes in the memory, so as to perform the method according to any one of claims 8 to 12.
17. A chip system, It is characterized in that include: A logic circuit, wherein the logic circuit is used to be coupled to an input / output interface and transmit data through the input / output interface to execute the method according to any one of claims 1 to 12.
18. A computer readable medium, It is characterized in that The computer-readable medium stores a program code, and when the computer program code is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 12.
Citation Information
Patent Citations
Equipment access method and device
CN119004554A
Method for providing trusted services using trusted execution environment system
CN111382445A
Device access method and system for secure container
CN114816655A
Method, equipment and device for dynamically configuring secure memory and storage medium
CN115544585A
System and methods for input / output device emulation
US20220391235A1
Cited By
Memory management method and heterogeneous computing system
CN119576585A
Data processing method and apparatus, chip, and cluster
WO2026145389A1
