AUTOMATIC SHADOWING FOR NONVOLATILE MEMORY EXPRESS (NVME) INLINE ENCRYPTION
Various embodiments include methods that may be implemented in an inline cryptographic module of a nonvolatile memory express (NVMe) device. The inline cryptographic module of a processing system for a NVMe device may automatically shadow all active PRPs within the NVMe device. In addition, a computing device may be configured to selectively encrypt data for storage using the inline encryption circuits by distinguishing data communicated over a PCIe link from driver, readout, page and buffer address data communicated over the PCIe link, and encrypting only the data.
This application claims the benefit of priority to India Patent Application No. 202341018627 entitled “AUTOMATIC SHADOWING FOR NONVOLATILE MEMORY EXPRESS (NVME) INLINE ENCRYPTION” filed on Mar. 18, 2023, and to India Patent Application No. 202341032985 entitled “AUTOMATIC SHADOWING FOR NONVOLATILE MEMORY EXPRESS (NVME) INLINE ENCRYPTION” filed on May 10, 2023, the entire contents of all of which are hereby incorporated by reference for all purposes.
BACKGROUNDThe nonvolatile memory express (NVMe) is a protocol designed specifically for solid-state drives (SSDs) to communicate with a computer's central processing unit (CPU) through a high-speed peripheral component interconnect express (PCIe) bus interface. NVMe is different from traditional storage interfaces, such as serial advanced technology attachment (SATA) or serial attached small computer system interface (SAS), because it was developed to take better advantage of the low latency and high throughput of modern SSDs, which may read and write data much faster than traditional hard disk drives (HDDs). NVMe may also support features such as multiple input/output (I/O) queues and parallelism, which may enable it to deliver much faster random read and write performance than traditional storage interfaces. As a result, NVMe drives are becoming increasingly popular in high-performance computing, data centers, and consumer devices that require fast storage access, such as gaming PCs and laptops.
SUMMARYVarious aspects include methods of providing encryption of data in a nonvolatile memory express (NVMe) memory device that may include selectively encrypting data for storage using an inline encryption circuits by distinguishing data communicated over a PCIe link from driver, readout, page and buffer address data communicated over the PCIe link, and encrypting only the data. Some aspects may further include identifying likely address ranges for based on operations being performed in the NVMe memory device, and storing the likely address ranges in memory, in which distinguishing data communicated over a PCIe link from driver, readout, page and buffer address data communicated over the PCIe link may include recognizing as data for encryption any data with addresses that do not fall within the likely address ranges in memory stored in memory. In some aspects, identifying likely address ranges for based on operations being performed in the NVMe memory device may include maintaining a shadow of only those pages that the NVMe memory device has read in from system memory.
Various aspects include methods of providing cryptographic functions for data in nonvolatile memory express (NVMe) protocol by an inline cryptographic module of a processing system that may include identifying a first transaction from an NVMe device for reading a command entry of a command submission queue, reading command entry data of the command entry, generating a shadow of at least one page-level read/write pointer (PRP) of the command entry data in a first data structure, and modifying the command entry data to enable reading of the shadow of the at least one PRP, thereby generating modified command entry data.
In some aspects, generating the shadow of the at least one PRP of the command entry data in the first data structure may include generating an entry for the at least one PRP in the first data structure, the entry for the at least one PRP in the first data structure including an address of the at least one PRP and a security context for the at least one PRP from the command entry data.
In some aspects, modifying the command entry data to enable reading of the shadow of the at least one PRP may include modifying an address of the at least one PRP of the command entry data to point to the shadow of the at least one PRP.
In some aspects, generating the shadow of the at least one PRP of the command entry data in the first data structure may include generating an entry for the at least one PRP in the first data structure, the entry for the at least one PRP in the first data structure including an address of the at least one PRP and a security context for the at least one PRP from a second data structure.
In some aspects, the command entry data includes a reference to an entry for the at least one PRP in the second data structure. Some aspects may further include reading the entry for the at least one PRP in the second data structure, the entry for the at least one PRP in the second data structure including the address of the at least one PRP and the security context for the at least one PRP from the command entry data.
In some aspects, modifying the command entry data to enable reading of the shadow of the at least one PRP may include removing a reference to an entry for the at least one PRP in a second data structure.
Some aspects may further include sending the modified command entry data to the NVMe device, identifying a second transaction from the NVMe device for executing an operation for the shadow of the at least one PRP, and implementing a cryptographic operation for data associated with the shadow of the at least one PRP based on a security context associated with the shadow of the at least one PRP.
Some aspects may further include generating a shadow of a PRP list (PRPL) of the command entry data in the first data structure, and modifying the command entry data to enable reading of the shadow of the PRPL, thereby generating the modified command entry data.
In some aspects, generating the shadow of the PRPL of the command entry data in the first data structure may include generating an entry for the PRPL in the first data structure, the entry for the PRPL in the first data structure including an address of the PRPL and a security context for the PRPL from the command entry data.
Some aspects may further include sending the modified command entry data to the NVMe device, identifying a second transaction from the NVMe device for reading the shadow of the PRPL, generating a shadow of each PRP of the PRPL in the first data structure, and modifying the each PRP of the PRPL to point to the shadow of the each PRP, generating a modified PRPL.
In some aspects, generating the shadow of the each PRP of the PRPL in the first data structure may include generating an entry for the each PRP of the PRPL in the first data structure, the entries for the each PRP of the PRPL in the first data structure including an address of the each PRP of the PRPL from the PRPL and a security context for the each PRP of the PRPL from an entry of the PRPL in the first data structure.
Some aspects may further include sending the modified PRPL to the NVMe device, identifying a third transaction from the NVMe device for executing an operation for at least one of the shadows of the each PRP, and implementing a cryptographic operation for data associated with the at least one of the shadows of the each PRP based on the security context associated with the at least one of the shadows of the each PRP.
In some aspects, modifying the command entry data to enable reading of the shadow of the PRPL may include modifying an address of a PRPL pointer for the PRPL of the command entry data to point to the shadow of the PRPL.
In some aspects, generating the shadow of the PRPL of the command entry data in the first data structure may include generating an entry for a shadow of each PRP of the PRPL in the first data structure, the entries for the shadows the each PRP in the first data structure including an address of the each PRP of the PRPL from the PRPL and a security context for the each PRP from a second data structure.
Some aspects may further include sending the modified command entry data to the NVMe device, identifying a second transaction from the NVMe device for reading the PRPL, in which generating the shadow of the PRPL of the command entry data in the first data structure occurs in response to identifying the second transaction from the NVMe device, and modifying the each PRP of the PRPL to point to the shadow of the each PRP, thereby generating a modified PRPL.
Some aspects may further include sending the modified PRPL to the NVMe device, identifying a third transaction from the NVMe device for executing an operation for at least one of the shadows of the each PRP, and implementing a cryptographic operation for data associated with the at least one of the shadows of the each PRP based on the security context associated with the at least one of the shadows of the each PRP.
In some aspects, modifying the command entry data to enable reading of the shadow of the PRPL may include removing a reference to an entry for the PRPL in a second data structure.
In some aspects, the command entry data includes a reference to an entry in a second data structure, the entry in the second data structure having a security context for the PRPL. Some aspects may further include writing the PRPL pointer to the second data structure at a location associated with the reference to the entry in the second data structure.
In some aspects, the modified command entry data includes a virtual address. Some aspects may further include fetching a virtual address to physical address mapping for the virtual address in parallel with generating the shadow of the at least one PRP of the command entry data in the first data structure.
In some aspects, identifying the first transaction from the NVMe device for reading the command entry of the command submission queue may include identifying an address of the transaction that is within at least one range of addresses for a least one submission queue, the at least one range of addresses stored to a configuration register of the inline cryptographic module.
Various aspects include methods of providing cryptographic functions for data in nonvolatile memory express (NVMe) protocol executed by a processing system, may include acquiring a cryptographic key slot for a command from a secure process, the cryptographic key slot including a cryptographic key slot reference, writing a cryptographic enable to a command entry of the command for a submission queue, writing the cryptographic key slot reference to the command entry of the command for the submission queue, and submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue.
Some aspects may further include acquiring a page-level read/write pointer lookup table (PRPLT) slot for the command from an inline cryptographic module, the PRPLT slot including a PRPLT slot reference, and writing the PRPLT slot reference to the command entry of the command for the submission queue, in which submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue may include submitting the command entry of the command including the cryptographic enable, the cryptographic key slot reference, and the PRPLT slot reference to the submission queue.
In some aspects, the command has more than one page-level read/write pointer (PRP). Some aspects may further include writing a logical block address offset to part of at least one PRP of the command entry of the command for the submission queue, and submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue may include submitting the command entry of the command including the cryptographic enable, the cryptographic key slot reference, and the at least one PRP having the logical block offset.
In some aspects, data of the command is larger than two system memory pages. Some aspects may further include writing a logical block address offset to part of at least one PRP of a PRP list (PRPL).
In some aspects, data of the command is larger than two system memory pages. Some aspects may further include writing a PRPL pointer to the command entry of the command for the submission queue at a location for a PRP, and submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue may include submitting the command entry of the command having the cryptographic enable, the cryptographic key slot reference, and the PRPL pointer.
In some aspects, data of the command is larger than a number system memory pages that may be referenced by a PRP and a PRPL. Some aspects may further include writing a PRPL pointer to a PRP of a PRPL.
Some aspects may further include configuring a first set of one or more registers of an inline cryptographic module corresponding with a number of command submission queues, and setting each of the first set of one or more registers with an address range of a different one of the command submission queues.
In some aspects, setting each of the first set of one or more registers with the address range of a different one of the command submission queues may include setting each of the first set of one or more registers with a start address and a size of a different one of the command submission queues.
In some aspects, setting each of the first set of one or more registers with the address range of a different one of the command submission queues may include setting each of the first set of one or more registers with a start address and an end address of a different one of the command submission queues.
Some aspects may further include configuring a second set of one or more registers of the inline cryptographic module corresponding with a number of command completion queues, and setting each of the second set of one or more registers with a start address and a size of a different one of the command submission queues.
Some aspects may further include configuring a second set of one or more registers of the inline cryptographic module corresponding with a number of exclusive address ranges, and setting each of the second set of one or more registers with a start address and a size of a different one of the exclusive address ranges.
Further aspects include computing devices including a non-volatile memory express (NVMe) inline cryptographic module configured to perform operations of any of the methods summarized above. Further aspects include computing devices including a processing system configured to perform operations of any of the methods summarized above.
The accompanying drawings, which are incorporated herein and constitute part of this specification, illustrate example embodiments of various embodiments, and together with the general description given above and the detailed description given below, serve to explain the features of the claims.
The various embodiments will be described in detail with reference to the accompanying drawings. Wherever possible, the same reference numbers will be used throughout the drawings to refer to the same or like parts. References made to particular examples and implementations are for illustrative purposes and are not intended to limit the scope of the claims.
Various embodiments include methods, and computing devices implementing such methods, for implementing an inline cryptographic module of a processing system for a nonvolatile memory express (NVMe) device. In some embodiments, the inline cryptographic module may be configured to automatically “shadow” all active physical region pages or page-level read/write pointers (PRPs) and/or scatter gather lists (SGLs) within the NVMe device. The NVMe device may also maintain 32 address ranges in registers that are associated with submission queues and programmed by device drivers during initialization. Access from the device in one of these ranges may indicate that it is trying to read commands from the submission queue (SQ). The data returned may be used to extract PRPs and/or SGLs, which may be used to determine the data that should be encrypted and the data that should remain unencrypted and unaltered.
The terms “computing device” and “mobile device” are used interchangeably herein to refer to any one or all of cellular telephones, smartphones, personal or mobile multi-media players, personal data assistants (PDA's), laptop computers, tablet computers, convertible laptops/tablets (2-in-1 computers), smartbooks, ultrabooks, netbooks, palm-top computers, wireless electronic mail receivers, multimedia Internet enabled cellular telephones, mobile gaming consoles, wireless gaming controllers, and similar personal electronic devices that include a memory, and a programmable processor. The term “computing device” may further refer to stationary computing devices including personal computers, desktop computers, all-in-one computers, workstations, super computers, mainframe computers, embedded computers, servers, home theater computers, and game consoles.
Embodiments and examples are described in terms of PRPs for ease of explanation and clarity. However, one of skill in the art would realize that the embodiments and examples described in terms of PRPs may be similarly implemented for and using SGLs in place of PRPs, and that any mention of PRPs are not intended to limit the scope of the claims and specification to exclude SGLs from such embodiments and examples.
A PRP refers to a data structure or mechanism used in memory management to keep track of the current position within a page of memory. The PRP may indicate an offset or location within a page where the next read or write operation should occur, allowing the system to access and manipulate specific portions of memory pages without having to work with the entire page at once. PRPs may be organized in a PRP list (PRPL), which may be a data structure that maintains a collection or list of PRPs. Each entry in the PRPL may correspond to a particular memory page and may contain the PRP associated with that page. The PRPL may be used to manage multiple PRPs, typically for various pages of memory, within a system.
The NVMe protocol for memory devices enables a fast and high throughput communication between an NVMe memory device and a processing system. A peripheral component interface express (PCIe) controller may be configured to implement NVMe protocol communications between an NVMe device and components of a processing system.
There is currently a strong market demand for NVMe inline encryption, which may provide hardware-based encryption of data stored on NVMe-based solid-state drives (SSDs). Inline encryption means that the encryption process happens automatically as data is written to the SSD, without any additional software or hardware intervention. This provides a high level of security without any significant impact on performance. In addition, NVMe Inline Encryption may use Advanced Encryption Standard (AES) with 512-bit or 256-bit keys to encrypt data. The encryption keys may be stored securely in the SSD controller and are not exposed to the host system. This may provide an additional layer of protection against data breaches. In addition, NVMe inline encryption may provide end-to-end encryption of data so that the data is encrypted from the moment it leaves the host system until it is decrypted by the SSD controller. This may help protect data against unauthorized access or theft, both while it is being transferred and while it is stored on the SSD.
There are many challenges with implementing NVMe inline encryption. For example, there currently is no standard way to encrypt data that is being accessed and stored in an NVMe device in-line, with the encryption process occurring at the same time as the data storage and access. Currently, one must either lobby to change the NVMe specifications, impose impractical restrictions on device drivers, or bear the hefty silicon cost of maintaining a large number of descriptors in order to use inline encryption with an NVMe device. Changing the NVMe specification would require significant effort and may not be feasible in the short term. Imposing restrictions on device drivers may limit the functionality of the device and could lead to compatibility issues.
Another option is to simply bear the hefty silicon cost of maintaining a large number of descriptors in order to use inline encryption with an NVMe device. Descriptors are data structures that describe the properties of data stored on the device. Maintaining a large number of descriptors may be resource-intensive. As an example of the significant silicon cost, the NVMe sends out Advanced extensible Interface (AXI) access commands for command fetching, descriptor fetching, and user data buffering. The computing system may be required to identify these commands for encryption. Yet, there are 4 million PRPs in a double data rate (DDR) memory and it may be difficult to search the incoming AXI address from that many choices. A conventional solution would need 4 MB of SRAM in order to store the PRPs, along with complex search logic, resulting in a significant silicon cost.
The embodiments may eliminate the need for the costly silicon cost associated with accessing the descriptors. As mentioned above, some embodiments may automatically “shadow” all active PRPs within the NVMe device, maintain 32 address ranges in registers that are associated with submission queues and programmed by device drivers during initialization, and access from the NVMe device in one of these 32 address ranges could indicate that it is trying to read commands from the submission queue (SQ). The data returned could be used to extract PRPs used to determine the data that should be encrypted.
By maintaining only 32 register address ranges of submission queues, all PRPs may be shadowed inside NVMe device and simplify the search logic for identifying incoming user data buffer accesses. Another benefit or advantage of the embodiments is that the complex search logic of finding PRPs from 4 million possibilities reduces to merely 32 ranges, which may be efficiently implemented in HW. Yet another advantage of the embodiments is that they may significantly reduce the SRAM volume to 8 KB (whereas conventional solutions could require 4 MB SRAM with a complex search logic beforehand). For these and other reasons, the various embodiments may reduce costs significantly. The embodiments may allow access to inline encryption without sacrificing system cost or performance when using an NVMe device.
The term “system-on-chip” (SoC) is used herein to refer to a set of interconnected electronic circuits typically, but not exclusively, including a processing device, a memory, and a communication interface. A processing system 12 may include a variety of different types of processors 14 some of which may include multiple processor cores. Non-limiting examples of processors that may be included in a computing device 10 and implemented in or coupled to a processing system 12 include a general purpose processor, a central processing unit (CPU), a digital signal processor (DSP), a graphics processing unit (GPU), an accelerated processing unit (APU), a secure processing unit (SPU), a neural network processing unit (NPU), a subsystem processor of specific components of the computing device, such as an image processor for a camera subsystem or a display processor for a display, an auxiliary processor, a single-core processor, a multicore processor, a controller, and a microcontroller. A processing system 12 may further embody other hardware and hardware combinations, such as a field programmable gate array (FPGA), an application-specific integrated circuit (ASIC), other programmable logic device, discrete gate logic, transistor logic, performance monitoring hardware, watchdog hardware, and time references. Integrated circuits may be configured such that the components of the integrated circuit reside on a single piece of semiconductor material in what may be referred to as a system-on-chip (SoC).
The processing system 12 may be implemented in an SoC and/or may include circuitry in multiple chips coupled to an SoC. The computing device 10 may include more than one processing system 12, thereby increasing the number of processors 14 any one or more of which may include multiple processor cores. The computing device 10 may also include other processors (not shown) that are not associated with the processing system 12. The processors 14 may each be configured for specific purposes that may be the same as or different from other processors 14 of the computing device 10. One or more of the processors 14 and processor cores of the same or different configurations may be grouped together.
The processing system 12 may be implemented with a bus architecture, represented generally by the bus 32. The bus 32 may include any number of interconnecting buses and bridges depending on the specific application of the processing system 12 and the overall design constraints. The bus 32 links together various circuits including one or more processors 14 and/or hardware components, represented by the processor (or processing circuitry) 14, the illustrated components, and the computer-readable medium/memory (or memory circuitry) 16. The processor(s) 14 may include multiple processors. The memory 16 may include multiple memories. The bus 32 may also link various other circuits, such as a clock controller 30, interface circuitry 18, 20, voltage regulators (not shown), and/or power management circuits (e.g., power manager 28).
The computing device 10 may include any number and combination of memories, such as the memory 16 integral to the processing system 12 and the memory 36 separate from the processing system 12. Any of the memories 16, 36 may be a volatile or non-volatile memory configured for storing data and processor-executable code for access by the processor 14. The computing device 10 and/or the processing system 12 may include one or more memories 16, 36 configured for various purposes. One or more memories 16, 36 may include volatile memories such as random access memory (RAM) or main memory, including static RAM (SRAM), such as the memory 16, dynamic RAM (DRAM), such as the memory 36, or cache memory.
The memories 16, 36 may be configured to temporarily store a limited amount of data. For example, the data may be received from a data sensor or subsystem. As another example, the data may be data and/or processor-executable code instructions that are requested from a non-volatile memory 16, 24, 36 loaded to the memories 16, 36 from the non-volatile memory 16, 24, 36 in anticipation of future access based on a variety of factors. As another example, the data may be intermediary processing data and/or processor-executable code instructions produced by the processor 14 and temporarily stored for future quick access without being stored in non-volatile memory 16, 24, 36.
The memory interface 34 may work in unison with the memory 36 to enable the computing device 10 to store and retrieve data and processor-executable code on and from the memory 36. The memory interface 34 may control access to the storage memory 36 and allow the processor 14 to read data from and write data to the memory 36.
The storage memory interface 20 and the storage memory 24 may work in unison to allow the computing device 10 to store data and processor-executable code on a non-volatile storage medium, such as a nonvolatile memory express (NVMe) memory device. The storage memory 24 may be configured much like an embodiment of the memory 16 in which the storage memory 24 may store the data or processor-executable code for access by one or more of the processors 14. The storage memory 24, being non-volatile, may retain the information after the power of the computing device 10 has been shut off. When the power is turned back on and the computing device 10 reboots, the information stored on the storage memory 24 may be available to the computing device 10. The storage memory interface 20 may control access to the storage memory 24 and allow the processor 14 to read data from and write data to the storage memory 24.
The inline cryptographic module 38 may be configured to implement cryptographic functions, such as encryption and decryption, of data for transactions of the memory storage device 24. Data transmitted between the memory 36 and the storage memory 24 may be encrypted and decrypted by the inline cryptographic module 38 to secure the data stored and the memory storage device 24 by encrypting the data, and make usable, by the SoC, the encrypted data retrieved from the memory storage device 24 by decrypting the data. The inline cryptographic module 38 may be configured to implement hash generation and validation for device hints related to the data transmitted between the memory 36 and the storage memory 24 to assess integrity of the device hints for use in evaluating whether to use the data.
The power manager 28 may be configured to control power states of one or more power rails (not shown) for power delivery to the components of the processing system 12. In some embodiments, the power manager 28 may be configured to control amounts of power provided to the components of the processing system 12. For example, the power manager 28 may be configured to control connections between components of the processing system 12 and the power rails. As another example, the power manager 28 may be configured to control amounts of power on the power rails connected to the components of the processing system 12. The power manager 28 may be configured as a power management integrated circuit (power management ICs or PMIC).
A clock controller 30 may be configured to control clock signals transmitted to the components of the processing system 12. For example, the clock controller 30 may gate a component of the processing system 12 by disconnecting the component of the processing system 12 from a clock signal and may ungate the component of the processing system 12 by connecting the component of the processing system 12 to the clock signal.
The interconnect 32 may be a communication fabric, such as a communication bus, configured to communicatively connect the components of the processing system 12. The interconnect 32 may transmit signals between the components of the processing system 12. In some embodiments, the interconnect 32 may be configured to control signals between the components of the processing system 12 by controlling timing and/or transmission paths of the signals.
Some or all of the components of the computing device 10 and/or the processing system 12 may be arranged differently and/or combined while still serving the functions of the various embodiments. The computing device 10 may not be limited to one of each of the components, and multiple instances of each component may be included in various configurations of the computing device 10.
The processing system 202, which may be implemented as an SoC, may include one or more processors 14, a peripheral component interface express (PCIe) controller 212 (e.g., storage memory interface 20 in
The inline cryptographic module 38 may be a hardware module integral to the processing system 202. The inline cryptographic module 38 may implement cryptographic functions, such as encrypting, decrypting, and/or bypassing, for data of the NVMe commands. For example, the inline cryptographic module 38 may encrypt data sent to the NVMe device 214 and decrypt data received from the NVMe device 214. The cryptographic functions implemented by the inline cryptographic module 38 may be of any known, proprietary, and/or to be developed encryption and decryption methods and/or circuitry. For example, the inline cryptographic module 38 may provide per application, folder-based, and/or file-based cryptographic functions. As another example, the inline cryptographic module 38 may implement cryptographic functions using AES with 512-bit or 256-bit keys.
A software running on the processing system 202, the NVMe driver 208, and/or the application 204, may issue a request to use a specific algorithm for encryption and a set of encryption keys, use a specific security context, and/or ask to send data without encryption. Setting the security context, encryption keys, and/or encryption algorithm may be implemented by any of the software running on the processing system 202, the NVMe driver 208, and/or the application 204 while using a security context, encryption keys, and/or an encryption algorithm to encrypt or decrypt the data can be done by another software entity.
The inline cryptographic module 38 may also support secure key management. In some examples, the inline cryptographic module 38 may function independently of PCIe structures and its different layers, enable scalable storage throughput, and be compliant with NVMe device protocols. In other examples, the inline cryptographic module 38 may be part of the PCIe controller 212. The inline cryptographic module 38 is described further herein.
The buffer address lookup structure 300 may be a data structure, such as a table, array, linked list, graph, etc., configured to store various data in association with each other. For example, the buffer address lookup structure 300 may store data of at least a buffer address of the memory 36, referred to herein as buffer address, and an NVMe security identifier (ID) for an NVMe command in association with each other.
The buffer address may be used for the NVMe command to write out data from the buffer address of the memory 36 to the NVMe device 214 and/or to read in data from the NVMe device 214 to the buffer address of the memory 36.
The NVMe security ID may be a combination of data, such as an NVMe command submission queue identifier and an NVMe command identifier for the NVMe command. The NVMe command submission queue identifier may identify an NVMe command submission queue to which the NVMe driver 208 may write the NVMe command.
The NVMe command submission queue may trigger a doorbell signal configured to indicate to the NVMe device 214 that the NVMe command in the NVMe command submission queue is ready for execution when the NVMe command reaches an end of the NVMe command submission queue. The NVMe command ID may identify the NVMe command.
The buffer address lookup structure 300 may also store data of a sector offset for the NVMe command in association with the buffer address and the NVMe security ID. The sector offset may be used in generation of an initialization vector for a cryptographic function. The initialization vector may be used as input to an encryption algorithm and be configured to affect encryption of data in a manner in which the data encrypted multiple times may result in different encrypted values. The buffer address lookup structure 300 may store any amount of associated data, such as more than one set of associated data for more than one NVMe command.
The security context structure 302 may be a data structure, such as a table, array, linked list, graph, etc., configured to store various data in association with each other. For example, the security context structure 302 may store data of the NVMe security ID and a security context for the NVMe command in association with each other. The NVMe security ID in the buffer address lookup structure 300 and the security context structure 302 for the same NVMe command may be the same. The security context may include a combination of security related information, such as an encryption algorithm, one or more encryption key slots for retrieving one or more encryption keys from an encryption key storage structure, etc. In some examples, the security context may be provided by an application executed by the processor 14 from the execution of which the NVMe command originates. The security context structure 302 may store any amount of associated data, such as more than one set of associated data for more than one NVMe command.
The buffer address lookup structure 300 and the security context structure 302 may be configured at the inline cryptographic module 38 during an NVMe command submission stage. In some examples, the NVMe driver (e.g., NVMe driver 208 in
In some embodiments, the inline cryptographic module 38 may configure the buffer address lookup structure 300 and the security context structure 302 at the inline cryptographic module 38 in response to receiving an NVMe command from the NVMe driver. The inline cryptographic module 38 may process the NVMe command, extracting the data for populating the buffer address lookup structure 300 and the security context structure 302, and the inline cryptographic module 38 may store the data as the buffer address lookup structure 300 and the security context structure 302. The inline cryptographic module 38 configuring the buffer address lookup structure 300 and the security context structure 302, rather than the NVMe driver, eliminates the previously described address redundancy issue and maintains data integrity. Further, overhead on software to configure the buffer address lookup structure 300 in the inline cryptographic module 38 is reduced.
The inline cryptographic module 38 may be configured to forward a doorbell signal configured to indicate to an NVMe device (e.g., storage memory 24 in
In response to receiving an NVMe transaction from the NVMe device, the inline cryptographic module 38 may use information from the NVMe transaction to implement a cryptographic function for the data of the NVMe transaction. For example, the inline cryptographic module 38 may retrieve a buffer address from the NVMe transaction and use the buffer address to retrieve the associated data, such as the NVMe security ID, from the buffer address lookup structure 300. In some examples, the inline cryptographic module 38 may use the buffer address to retrieve the associated sector offset from the buffer address lookup structure 300. The inline cryptographic module 38 may use the retrieved NVMe security ID to retrieve the associated security context for the NVMe command from the security context structure 302.
Using the retrieved information, such as the sector offset and/or the security context, the encryption module 304 and/or the decryption module 306 may implement the cryptographic function for the data of the NVMe transaction. For example, the retrieved information may include the security context from the security context structure 302, which may include an encryption algorithm, one or more encryption key slots for retrieving one or more encryption keys from an encryption key storage structure, etc. The encryption module 304 may use the retrieved information of the security context to encrypt the data to be sent to the NVMe device for the NVMe transaction. The decryption module 306 may use the retrieved information of the security context to decrypt the data received from the NVMe device for the NVMe transaction.
In some embodiments, the retrieved information may include the sector offset from the buffer address lookup structure 300. The encryption module 304 may use the retrieved sector offset to generate an initialization vector, and use the initialization vector with the retrieved information of the security context to encrypt the data to be sent to the NVMe device for the NVMe transaction. The decryption module 306 may use the retrieved sector offset to generate an initialization vector, and use the initialization vector with the information of the retrieved information of the security context to decrypt the data received from the NVMe device for the NVMe transaction. The encryption module 304 may input unencrypted data for the NVMe command, one or more encryption keys, and/or an initialization vector to an encryption algorithm and generate encrypted data for the NVMe command. The decryption module 306 may input encrypted data for the NVMe command, one or more encryption keys, and/or an initialization vector to an encryption algorithm and generate decrypted data for the NVMe command.
With reference to
With reference to
The SQ 404 and the CQ 406 are used to manage communications between the Host 400 and the NVMe device 214. The SQ 404 may be used by the Host 400 to queue commands to be sent to the NVMe device 214. These commands may include any command from the NVMe standard, such as read, write, management commands, etc. The CQ 406 may be used by the NVMe device 214 to notify the Host 400 about a completion status of command processed from the SQ 404, such as successful completion or failure to complete. When a command is executed, the NVMe device controller 214 may place a completion entry in the CQ 406 to inform the Host 400 about the completion of the operation. The SQ 404 and CQ 406 may be circular buffers, arrays, etc. for which locations may be statically or dynamically indicated as a starting location (head) and an ending location (tail). An entry at the head of the SQ 404 may be for a next command to be implemented and an entry at the tail of the SQ 404 may be for a last command to be implemented. An entry at the head of the CQ 404 may be for an oldest completed command and an entry at the tail of the CQ 404 may be for a most recently completed command. The SQ 404 and the CQ 406 may be sized to store at least two entries, including thousands of entries, such as 64,000 entries.
The NVMe-ICE module 500 may provide data security and privacy at the storage level by enabling encryption of data that is sent from the host 400 to the NVMe device 214. This may be achieved by inserting a layer of encryption between the host 400 and the NVMe device 214, which may allow each command issued to be processed as an encrypted command before being passed on to the NVMe device controller 214 for further processing. When a command is written by the host driver and queued onto the submission queue (SQ) 404, it may be first picked up by the NVME-ICE module 500 for encryption/decryption before being passed on to the NVMe device controller 214 for further processing. The NVMe device controller 214 may then process the command and update the SQ head pointer before passing it back to the NVME-ICE module 500 for decryption or encryption as appropriate. The NVMe device controller 214 may then write information to a completion queue (CQ) and generate an MSI-X interrupt for the host driver.
The process flows described above may ensure that all data sent between the host CPU and NVMe device controller 214 are encrypted and secure while providing a performance-efficient solution that maintains low latency regardless of workload or data size due to its position in line with other required steps in the process of sending commands from a host CPU and receiving results back from a NVMe device controller 214. Further, in some embodiments, all data may be secured using hardware-based encryption mechanisms so that no additional software implementation is required on either the host CPU or NVMe device side. As a result, the embodiments may be implemented without any major changes to existing architectures and systems for users looking for improved security solutions for their workloads without sacrificing performance or latency.
With reference to
The CQ head ptr 610 may point to a next completion entry in the completion queue 618, and the CQ tail ptr 612 may point to a last completion entry in the completion queue 618. The SQ head ptr 616 may point to a next command (CMD) 624 in the submission queue 620, and the SQ tail ptr 614 may point to a last command in the submission queue 620. Each command 624 may include multiple PRPs 626 and/or PRPL pointers (ptrs) 628. Each PRP 626 may be a pointer with an association to a location 630 in the system memory space 602, such as a page buffer. Each PRPL pointer 628 may be a pointer with an association to a PRPL 622. Each PRPL 622 may include multiple PRPs 626.
With reference to
Thus, after matching, the system may decide which access needs cyphering. The system may be configured so that any access with matching addresses in SQ, CQ and PRPL tables is control or status related data that does not need to be cyphered. On the other hand, the system may determine that any access with matching addresses in PRP table 802 may need to be cyphered because this may include a user data transfer.
The theoretical maximum size for the databases that hold start and end addresses for each SQ, CQ, PRP List and PRP is 384 KB, 384 KB, 3 TB and 1536 TB, respectively. These sizes may be prohibitive for consumer-grade laptops or desktops, for which the following requirements may be applicable: NVMe device supports 32 SQs and 32 CQs; SQ table holds 32 entries (192 B storage); CQ table holds 32 entries (192 B storage); 8K commands, with 2MB per transaction may enough to keep PCIe links busy; PRPL Table 800 holds 8K entries (8K*1) and thus 48 KB storage; each PRPL may include up to 512 PRP entries, PRP Table 802 may include 4 million entries (8K*512)−24 MB storage.
Another technical challenge is how to keep the PRP Table 802 in internal SRAM, so that it may be accessed quickly and efficiently. To accomplish this, the size of the PRP Table 802 may have to be reduced significantly. One way to do that is by predicting or identifying which user data buffers will be accessed by the NVMe device.
With reference to
Some embodiments may take advantage of reserved fields in an NVMe command structure that hold a PRPL Index of a command entry, so as to create a shadow of all PRPs cached inside the NVMe Device. The system may initiate this process by configuring its submission queues (SQs) with their base addresses and queue size (Qsize) values, then performing the same operations for the completion queues (CQs). As a result, the system may enqueue the commands without requiring PRPLS.
Depending on how much user data needs transferring there may be different processes required for completing a successful transfer. For example, if user data fits into one or two system memory pages, security context information may be written at one or two PRP lookup table (PRPLT) locations (“N”). The system may then proceed with creating the command before pushing the command into an SQ along with maintaining its mapping {SQ identifier (SQID), Command identifier (CID)}->N or {SQID, CID, namespace identifier (NSID)}->N. If user data requires more than 2 system memory pages, up to a threshold of system memory pages, however, then a PRP may be created for a first system memory page and a PRPL would need to be created for all other system memory pages such that for all PRP entries of the PRPL a logical block (LB) offset is put as lower 12 bits and bit[1:0]=2′b00). If user data requires more than the threshold of system memory pages, then multiple chained PRPLs may be created by inserting in a last entry of a PRPL a pointer to a next PRPL entry of another PRPL. The threshold of system memory pages may be configured based on the system memory page size. In some embodiments, the threshold of system memory pages may be the system memory page size divided by 8. For example, for a system memory page size of 4 KB, the threshold of system memory pages may be 512 system memory pages. The threshold of system memory pages may be similarly configured based on any system memory page size, such as 8 KB, 16 KB, etc.
That is, when enqueuing commands, no page-level read/write pointers lists (PRPLs) may be required if user data fits inside one or two system memory pages. However, if more than two pages, up to the threshold of system memory pages are needed, then a PRPL may be used. If more than the threshold of system memory pages are needed, then multiple PRPLs may be required for chaining together (PRPL creation process). For more than 2 pages, LB offset into lower 12 bits may be inserted into each PRP entry after a first PRP entry, including each entry in each PRPL. For more than the threshold of system memory pages a pointer to the next PRPL may be in the last PRP entry(s) of each prior PRPL. When processing commands, security context information may also be written at PRPLT location N. In examples using at least one PRPL, a first PRPL pointer may be inserted into a PRP2 field if its more than, such as when the data requires more than 2 pages while pushing into SQ and maintaining mapping {SQID, CID}->N or {SQID, CID, NSID}->N. These embodiments may reduce the total SRAM requirement for caching all PRP entries down only 8 KB even with a large number of commands present making implementation using internal SRAM possible without sacrificing performance efficiency.
The example illustrated in
The example illustrated in
The examples illustrated in
The examples illustrated in
The information structures may include a PRPLT SRAM 1300 (e.g., memory 16 in
The operations may include the operations illustrated in blocks 1310, 1312, 1314, 1316, 1318, 1410, 1412, 1510, 1610, 1612, 1614, 1710, 1712. Like numbered blocks may be implemented in a similar manner across the examples illustrated in
Another technical challenge is how to read and parse data from a DDR (e.g., memory 16 in
The first stage may include reading the data for this access from a DDR memory. That is, the first stage may include identifying the data that requires access, which includes the physical address of the data, as well as the command structure defining how this access should be handled. The second stage may include parsing the command structure 1000, 1002, 1502 and extracting PRP details so they may be put into the “shadow” of a NVMe device. The “shadow” may be an area within the host memory, such as the PRPLT SRAM 1300 and/or the LUT SRAM 1302, where data shares are kept so that they may be easily accessed when needed without having to go through any other processes such as booting up or accessing another type of file storage system. An item “shadow”, or “shadow” of an item, refers to the data of that item within the “shadow” specifically for the item. To “shadow” an item means to put the data of that item in the “shadow” for the item. In addition, if there is a pointer to PRPL (e.g., PRPL pointer 628 in
As an example, as illustrated in
As an example, as illustrated in
In block 1410, the system may look for a free location in an LUT (e.g., in the LUT SRAM 1302) to enter relevant PRP1 details with a recalculated LBA and/or the NSID that the buffer maps to. The system may delete the pointer related to the PRPLT from command 1002 and make it reserved (“RSVD”) in block 1316 and send the modified command 1400 towards its destination, the NVMe device, in block 1318. These operations may ensure that information present within the shadow corresponds to the information stored in NVMe Device (e.g., the shadow includes the same PRPs as the NVMe device).
As an example, as illustrated in
Continuing from the example illustrated in
Continuing from the examples illustrated in
In block 1712, the system may transfer the pointer to a next PRPL 1100, 1200 from the PRPL 1200 to the PRPLT [N] location in the PRPLT SRAM 1300. The system may delete a logical block offset (“Loffset1”, “Loffset2”) for each PRP from the PRPL 1200 in block 1612, such as by overwriting the Loffset with zeros, and send the modified PRPL 1700 towards its destination, the NVMe device, in block 1614.
In some embodiments, the pointer to a next PRPL in the PRPL 1200 and written to the PRPLT [N] location in the PRPLT SRAM 1300 may point to another PRPL 1200, and the example illustrated in
Thus, some embodiments may trap device accesses, interpret them as per NVMe specification and extract PRPs from it on-the-fly. Some embodiments may maintain 32 address ranges in registers for 32 Submission Queues. In some embodiments, the NVMe device driver (e.g., NVMe driver 208 in
Some embodiments may repurpose a reserved field in NVMe CMD, that holds PRPLT Index of the command entry. As such, the system may now have 100% true shadow of all PRPs, that are dynamically cached inside the NVMe Device.
In some embodiments, the NVMe Driver may configure SQ Table with Base address and Qsize. In some embodiments, the NVMe Driver may configure the CQ Table with Base address and Qsize.
In some embodiments, the NVMe Driver may enqueue a command such that no PRPLs are required. The computing system may acquire a free PRPLT slot from NVMe ICE HW (N), or NVMe inline cryptographic module (N). The computing system may acquire a Crypto Key slot index from secured process.
As an example, in relation to the example illustrated in
As another example, in relation to the example illustrated in
As another example, in relation to the examples illustrated in
The PRPL creation process may include for each PRP entry (the PRPs are all Page boundary aligned), insert LB offset into lower 12 bits (bit[1:0]=2′b00) in the PRPL 1100. The command processing may include writing Security Context information at PRPLT location N in the PRPLT SRAM 1300, writing PRPLT_Index=N and inserting a PRPL Pointer in a PRP2 field in the command 1502, proceeding with other steps for Command creation and pushing the command 1502 into an SQ, and maintaining a mapping of {SQID, CID}->N or {SQID, CID, NSID}->N.
As another example, in relation to the examples illustrated in
In some embodiments, when the Read data for this access arrives from DDR, the system may parse the Command structure 1000, 1002, 1502 and extract the PRP details and put into the shadow, such as the PRPLT SRAM 1300 and/or the LUT SRAM 1302. If the Command 1502 includes a pointer to PRPL, the system may cache it in a temporary small storage, such as the PRPLT SRAM 1300 and/or the LUT SRAM 1302.
As an example, if the command (CMD) 1000, 1002, 1502 has PRP1 valid, the system may use PRPLT Index field of command to read PRPLT [N] (it has SLBA and/or a namespace identifier (NSID)). The system may find a free location in the LUT, in the LUT SRAM 1302, and enter PRP1 into that LUT location. The system may (re)calculate LBA for which the LBA and/or the NSID map to this buffer, delete PRPLT Pointer from Command 1000, 1002, 1502 and make is RSVD, and send the modified Command 1304, 1400, 1500 to NVMe device. The final result may be that the system includes in its shadow the same PRP that the NVMe device has.
When the NVMe device issues a read address (N) for reading a PRPL 1100, 1200, the system may perform a content search on the PRPLT, in the PRPLT SRAM 1300. It may hit for location N. This read access may be for reading PRPs from that PRPL 1100, 1200. The system may insert “N” into a Read Tracking FIFO (not shown), and forward the read access to the system memory. When the Read data for this access arrives from system memory, the system may pop the Read tracking FIFO, such as by using a get “N” operation. The system may parse the PRPL structure 1100, 1200 and extract the PRP details and put into the shadow, such as the PRPLT SRAM 1300 and/or the LUT SRAM 1302.
When the NVMe device issues an access that hits one of the shadowed PRPs in the LUT SRAM 1302, it may be for user data access. The system may execute a Cypher operation for data associated with PRPs of the ranges of shadowed PRPs. When access to a data (e.g., 4 KB, 16 KB, 64 KB, etc.) associated with a PRP is completed, the system may evict the PRP from the shadow. They system now has 100% true shadow of all PRPs, that are dynamically maintained inside the NVMe Device using only 8 KB.
Some embodiments may be implemented using an LUT (e.g., PRP Table 802 in
Oher components of the NVMe inline cryptographic module 38 may include a cryptographic datapath 1802, including cryptographic engines 1810 (e.g., encryption module 304 and decryption module 306 in
The NVMe device (e.g., storage memory 24 in
The NVMe inline cryptographic module 38 may update the LUT 1800 with PRP entries from the command 1900 and/or the PRP list and security context that may be parsed and read from the command 1900.
The NVMe inline cryptographic module 38 may perform on the fly PRP address modification at the data of the command 1900, replacing PRP address bits (e.g., PRP1 and/or PRP2) with the corresponding LUT index. For example, the NVMe inline cryptographic module 38 may replace some of the address bits, such as in the range of bits 63:12. Replacing some of the address bits may enable maintaining an original PRP address offset within a page, such as 4 KB page. In some examples, the NVMe inline cryptographic module 38 may tag the PRP address as modified through setting of one or more specific bits of the PRP address, such as bit 63. In some embodiments, the PRP address may be modified such that the modified address may be within a range defined by a software (e.g., application 204, kernel 206, NVMe driver 208, PCIe driver 210 in
The host software 2100 may enumerate one or more NVMe devices 214 by implementing a process 2102 and detect the PCIe root complex 212 and an NVMe device 214 by implementing a process(es) 2104. The host software 2100 may load an NVMe driver (e.g., NVMe driver 208 in
The host software 2100 and NVMe inline cryptographic module 38 may initialize the NVMe inline cryptographic module 38 by implementing various processes 2110. These processes may include configuring various registers of the NVMe inline cryptographic module 38. These processes may include configuring exclusive address range registers 1804 by implementing a process 2112. The exclusive address range registers 1804 may be configured for any number of exclusive address ranges, such as 8, 16, 32, 64, etc. These processes may include configuring SQ address range registers 1806 by implementing a process 2114, and configure CQ address range registers 1806 by implementing a process 2116. The SQ and CQ address range registers 1806 may be configured for any number of exclusive address ranges, such as 8, 16, 32, 64, etc. for any number of submission queues (e.g., SQ 404 in
The host software 2100 and NVMe inline cryptographic module 38 may configure other aspects of the NVMe inline cryptographic module 38, including administrative functions (Admin), input/output functions (IO), and SQ and CQ entries by implementing a process 2120. The processes may also include writing start and/or end address and/or address range sizes to the SQ and CQ address range registers 1806 by implementing a process 2122.
The host software 2100 may execute a command creation stage in which the host software 2100 may create a command (e.g., command 902, 1000, 1002, 1102, 1202, 1502, 1900 in
The host software 2100 may submit the command to the host memory 36 for addition to the submission queue (e.g., SQ 404 in
The embodiment illustrated in
The NVMe device 214 may implement a transaction with the NVMe inline cryptographic module 38 for reading a command entry from the command submission queue (e.g., SQ 404 in
In the embodiment illustrated in
In the embodiment illustrated in
The NVMe inline cryptographic module 38 may return the modified data of the command submission entry to the NVMe device 214 by implementing a process 2310.
When the entry read from the command submission queue (e.g., SQ 404 in
The NVMe inline cryptographic module 38 may update the LUT 1800 and modify the data from the command submission entry for each PRP entry of the PRP list on the fly by implementing a process 2608. For example, with reference to
The NVMe device 214 may transmit a transaction to the NVMe inline cryptographic module 38 for writing data from the host memory 36 by implementing a process 2900. In some embodiments, the transaction may be an AXI transaction. The transaction may specify the LUT index for the corresponding PRP (e.g., PRP 626 in
The NVMe device 214 may transmit a transaction to the NVMe inline cryptographic module 38 for reading data from an NVMe device logical block address to write the host memory 36 by implementing a process 3000. In some embodiments, the transaction may be an AXI transaction. The transaction may specify the LUT index for the corresponding PRP (e.g., PRP 626 in
The NVMe device 214 may a write a command completion entry to the command queue (e.g., CQ 406 in
The processes of the examples illustrated in
The NVMe inline cryptographic module 38 may fetch a virtual address to physical address mapping from the MMU 3200 for the addresses of PRPs (e.g., PRP 626 in
Various embodiments (including, but not limited to, embodiments described above with reference to
The mobile computing device 3300 may have one or more radio signal transceivers 3308 (e.g., Peanut, Bluetooth, ZigBee, Wi-Fi, RF radio) and antennae 3310, for sending and receiving communications, coupled to each other and/or to the processor 3302. The transceivers 3308 and antennae 3310 may be used with the above-mentioned circuitry to implement the various wireless transmission protocol stacks and interfaces. The mobile computing device 3300 may include a cellular network wireless modem chip 3316 that enables communication via a cellular network and is coupled to the processor.
The mobile computing device 3300 may include a peripheral device connection interface 3318 coupled to the processor 3302. The peripheral device connection interface 3318 may be singularly configured to accept one type of connection or may be configured to accept various types of physical and communication connections, common or proprietary, such as Universal Serial Bus (USB), Fire Wire, Thunderbolt, or PCIe. The peripheral device connection interface 3318 may also be coupled to a similarly configured peripheral device connection port (not shown).
The mobile computing device 3300 may also include speakers 3314 for providing audio outputs. The mobile computing device 3300 may also include a housing 3320, constructed of a plastic, metal, or a combination of materials, for containing all or some of the components described herein. The mobile computing device 3300 may include a power source 3322 coupled to the processor 3302, such as a disposable or rechargeable battery. The rechargeable battery may also be coupled to the peripheral device connection port to receive a charging current from a source external to the mobile computing device 3300. The mobile computing device 3300 may also include a physical button 3324 for receiving user inputs. The mobile computing device 3300 may also include a power button 3326 for turning the mobile computing device 3300 on and off.
The various embodiments (including, but not limited to, embodiments described above with reference to
The various embodiments (including, but not limited to, embodiments described above with reference to
Computer program code or “program code” for execution on a programmable processor for carrying out operations of the various embodiments may be written in a high-level programming language such as C, C++, C#, Smalltalk, Java, Javascript, Visual Basic, a Structured Query Language (e.g., Transact-SQL), Perl, or in various other programming languages. Program code or programs stored on a computer readable storage medium as used in this application may refer to machine language code (such as object code) whose format is understandable by a processor.
Implementation examples are described in the following paragraphs. While some of the following implementation examples are described in terms of example systems, devices, or methods, further example implementations may include: the example systems or devices discussed in the following paragraphs implemented as a method executing operations of the example systems or devices; the example systems, devices, or methods discussed in the following paragraphs implemented by a computing device comprising an NVMe inline cryptographic module configured to perform operations of the example systems, devices, or methods; the example systems, devices, or methods discussed in the following paragraphs implemented by a computing device comprising a processing system configured with processing device-executable instructions to perform operations of the example systems, devices, or methods; a computing device including means for performing functions of the example systems, devices, or methods; and the example systems, devices, or methods discussed in the following paragraphs implemented as a non-transitory processor-readable storage medium having stored thereon processor-executable instructions configured to cause a processor of a computing device to perform the operations of the example systems, devices, or methods.
-
- Example 1. A method of providing encryption of data in a nonvolatile memory express (NVMe) memory device, including selectively encrypting data for storage using an inline encryption circuits by: distinguishing data communicated over a PCIe link from driver, readout, page and buffer address data communicated over the PCIe link; and encrypting only the data.
- Example 2. The method of example 1, further including: identifying likely address ranges for based on operations being performed in the NVMe memory device; and storing the likely address ranges in memory, in which distinguishing data communicated over a PCIe link from driver, readout, page and buffer address data communicated over the PCIe link includes recognizing as data for encryption data with addresses that do not fall within the likely address ranges in memory stored in memory.
- Example 3. The method of example 2, in which identifying likely address ranges for based on operations being performed in the NVMe memory device includes maintaining a shadow of only those pages that the NVMe memory device has read in from system memory.
- Example 4. A method implemented in an inline cryptographic module of a system on chip (SoC) for a nonvolatile memory express (NVMe) device, including: automatically shadowing all active PRPs within the NVMe device.
- Example 5. The method of example 4, further including: maintaining 32 address ranges in registers that are associated with submission queues and programmed by device drivers during initialization; determining, based on access from the NVMe device in one of 32 address ranges, whether the NVMe device requested to read commands from the submission queue (SQ); determining, based on extracted PRPs, whether to encrypt access data.
- Example 6. The method of any of examples 4-5, further including: shadowing all PRPs inside NVMe device in 32 register address ranges of submission queues to simplify the search logic for identifying incoming user data buffer accesses.
- Example 7. The method of any of examples 4-6, further including: comparing an incoming address from the NVMe device against a database of addresses stored in memory that includes a start and end address of a submission queue (SQ) table, completion queues (CQs) table, PRP list table, and a PRP table; and determining whether to encrypt data based on whether the incoming address matches an entry in the database of addresses stored in memory.
- Example 8. The method of any of examples 4-7, further including: trapping device accesses for interpretation as per the NVMe specification; and extracting PRPs from each request on-the-fly and evaluating each access request to determine whether it is legitimate.
- Example 9. The method of any of examples 4-8, further including: configuring registers with submission queue start and end addresses in order to identify whether a read address falls within one of 32 address ranges; determining the PRPs that are cached in the NVMe device; storing in a reserved field in an NVMe command a PRP list (PRPL) Index of a command entry that provides an accurate shadow of all PRPs that are dynamically cached inside the NVMe device.
- Example 10. The method of any of examples 4-9, further including: configuring a submission queue (SQ) with base addresses and Qsize values; configuring a completion queue (CQ) with base addresses and Qsize values; and using fields in an NVMe command structure to store a PRPL Index of a command entry so as to create a shadow of all PRPs cached inside the NVMe Device.
- Example 11. The method of any of examples 4-10, in which in response to determining that user data fits into one system memory page: writing security context information at physical region page list table (PRPLT) location N; writing PRPLT Index=N in the command; creating the command and pushing into SQ; and maintaining the mapping of ({SQID, CommandID}->N).
- Example 12. The method of any of examples 4-11, in which in response to determining that user data fits into two system memory pages: writing security context information at physical region page list table (PRPLT) location N; inserting LB offset into lower 12 bits of PRP2 (page boundary aligned); creating the command and pushing into SQ; and maintaining the mapping of ({SQID, CID}->N).
- Example 13. The method of any of examples 4-12, in which in response to determining that user data fits into more than 2 but less than 512 system memory pages: for each page boundary aligned PRP entry inserting LB offset into lower 12 bits and setting bit[1:0]=2′b00; writing security context information at physical region page list table (PRPLT) location N inserting PRPL pointer in PRP2 field; creating the command and pushing into SQ; and maintaining the mapping of ({SQID, CID}->N).
- Example 14. The method of any of examples 4-13, in which in response to determining that user data fits into more than 512 system memory pages: for all but the last page boundary aligned PRP entry inserting LB offset into lower 12 bits, setting bit[1:0]=2′b00, and putting a pointer to next PRPL in to the last PRP entry; writing security context information at physical region page list table (PRPLT) location N inserting a first PRPL pointer in PRP2 field; creating the command and pushing into SQ; and maintaining the mapping of ({SQID, CID}->N).
- Example 15. The method of any of examples 4-14, further including: using PRPLT Index field of command, read PRPLT [N] (SLBA); finding a free location in LUT and entering PRP1 into that LUT location; calculating LBA to which this buffer maps; deleting PRPLT Pointer from Command and make it RSVD; and sending the modified Command to NVMe device.
- Example 16. The method of any of examples 4-15, further including: receiving a command; parsing a command structure of the command, extracting the PRP details, and adding the extracted PRP details into the shadow in response to receiving read data for an access from memory; and storing a pointer to PRPL included in the command.
- Example 17. The method of any of examples 4-16, further including: performing a content search on a PRPLT in response to determining that the device issued a request to read address (N) for reading PRPL to get a hit for location N; insert “N” into Read Tracking FIFO; forwarding the read access to system memory; popping the Read tracking FIFO to get “N” in response to determining that a read data for the access arrives from system memory; parsing the PRPL structure to extract the PRP details; and adding the PRP details to the shadow.
- Example 18. The method of example 17, further including retrieving the PRP details from the shadow in response to receiving a request for user data access that hits one of the shadowed PRP.
- Example 19. A method of providing cryptographic functions for data in nonvolatile memory express (NVMe) protocol by an inline cryptographic module of a processing system, including: identifying a first transaction from an NVMe device for reading a command entry of a command submission queue; reading command entry data of the command entry; generating a shadow of at least one page-level read/write pointer (PRP) of the command entry data in a first data structure; and modifying the command entry data to enable reading of the shadow of the at least one PRP, thereby generating modified command entry data.
- Example 20. The method of example 19, in which generating the shadow of the at least one PRP of the command entry data in the first data structure includes generating an entry for the at least one PRP in the first data structure, the entry for the at least one PRP in the first data structure including an address of the at least one PRP and a security context for the at least one PRP from the command entry data.
- Example 21. The method of either of examples 19 or 20, in which modifying the command entry data to enable reading of the shadow of the at least one PRP includes modifying an address of the at least one PRP of the command entry data to point to the shadow of the at least one PRP.
- Example 22. The method of example 19, in which generating the shadow of the at least one PRP of the command entry data in the first data structure includes generating an entry for the at least one PRP in the first data structure, the entry for the at least one PRP in the first data structure including an address of the at least one PRP and a security context for the at least one PRP from a second data structure.
- Example 23. The method of example 22, in which the command entry data includes a reference to an entry for the at least one PRP in the second data structure, the method further including reading the entry for the at least one PRP in the second data structure, the entry for the at least one PRP in the second data structure including the address of the at least one PRP and the security context for the at least one PRP from the command entry data.
- Example 24. The method of any of examples 19, 22, or 23, in which modifying the command entry data to enable reading of the shadow of the at least one PRP includes removing a reference to an entry for the at least one PRP in a second data structure.
- Example 25. The method of any of examples 19-24, further including: sending the modified command entry data to the NVMe device; identifying a second transaction from the NVMe device for executing an operation for the shadow of the at least one PRP; and implementing a cryptographic operation for data associated with the shadow of the at least one PRP based on a security context associated with the shadow of the at least one PRP.
- Example 26. The method of any of examples 19-25, further including: generating a shadow of a PRP list (PRPL) of the command entry data in the first data structure; and modifying the command entry data to enable reading of the shadow of the PRPL, thereby generating the modified command entry data.
- Example 27. The method of any of examples 19-21, 25, or 26, in which generating the shadow of the PRPL of the command entry data in the first data structure includes generating an entry for the PRPL in the first data structure, the entry for the PRPL in the first data structure including an address of the PRPL and a security context for the PRPL from the command entry data.
- Example 28. The method of any of examples 19-21 or 25-27, further including: sending the modified command entry data to the NVMe device; identifying a second transaction from the NVMe device for reading the shadow of the PRPL; generating a shadow of each PRP of the PRPL in the first data structure; and modifying the each PRP of the PRPL to point to the shadow of the each PRP, generating a modified PRPL.
- Example 29. The method of example 28, in which generating the shadow of the each PRP of the PRPL in the first data structure includes generating an entry for the each PRP of the PRPL in the first data structure, the entries for the each PRP of the PRPL in the first data structure including an address of the each PRP of the PRPL from the PRPL and a security context for the each PRP of the PRPL from an entry of the PRPL in the first data structure.
- Example 30. The method of either of examples 28 or 29, further including: sending the modified PRPL to the NVMe device; identifying a third transaction from the NVMe device for executing an operation for at least one of the shadows of the each PRP; and implementing a cryptographic operation for data associated with the at least one of the shadows of the each PRP based on the security context associated with the at least one of the shadows of the each PRP.
- Example 31. The method of any of examples 28-30, in which modifying the command entry data to enable reading of the shadow of the PRPL includes modifying an address of a PRPL pointer for the PRPL of the command entry data to point to the shadow of the PRPL.
- Example 32. The method of any of examples 19 or 22-26, in which generating the shadow of the PRPL of the command entry data in the first data structure includes generating an entry for a shadow of each PRP of the PRPL in the first data structure, the entries for the shadows the each PRP in the first data structure including an address of the each PRP of the PRPL from the PRPL and a security context for the each PRP from a second data structure.
- Example 33. The method of example 32, further including: sending the modified command entry data to the NVMe device; identifying a second transaction from the NVMe device for reading the PRPL, in which generating the shadow of the PRPL of the command entry data in the first data structure occurs in response to identifying the second transaction from the NVMe device; and modifying the each PRP of the PRPL to point to the shadow of the each PRP, thereby generating a modified PRPL.
- Example 34. The method of example 33, further including: sending the modified PRPL to the NVMe device; identifying a third transaction from the NVMe device for executing an operation for at least one of the shadows of the each PRP; and implementing a cryptographic operation for data associated with the at least one of the shadows of the each PRP based on the security context associated with the at least one of the shadows of the each PRP.
- Example 35. The method of any of examples 19, 22-26, or 33-34, in which modifying the command entry data to enable reading of the shadow of the PRPL includes removing a reference to an entry for the PRPL in a second data structure.
- Example 36. The method of any of examples 19, 22-26, or 33-35, in which the command entry data includes a reference to an entry in a second data structure, the entry in the second data structure having a security context for the PRPL, the method further including writing the PRPL pointer to the second data structure at a location associated with the reference to the entry in the second data structure.
- Example 37. The method of any of examples 19-36, in which the modified command entry data includes a virtual address, the method further including fetching a virtual address to physical address mapping for the virtual address in parallel with generating the shadow of the at least one PRP of the command entry data in the first data structure.
- Example 38. The method of any of examples 19-37, in which identifying the first transaction from the NVMe device for reading the command entry of the command submission queue includes identifying an address of the transaction that is within at least one range of addresses for a least one submission queue, the at least one range of addresses stored to a configuration register of the inline cryptographic module.
- Example 39. A method of providing cryptographic functions for data in nonvolatile memory express (NVMe) protocol executed by a processing system, including: acquiring a cryptographic key slot for a command from a secure process, the cryptographic key slot including a cryptographic key slot reference; writing a cryptographic enable to a command entry of the command for a submission queue; writing the cryptographic key slot reference to the command entry of the command for the submission queue; and submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue.
- Example 40. The method of example 39, further including: acquiring a page-level read/write pointer lookup table (PRPLT) slot for the command from an inline cryptographic module, the PRPLT slot including a PRPLT slot reference; and writing the PRPLT slot reference to the command entry of the command for the submission queue, in which submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue includes submitting the command entry of the command including the cryptographic enable, the cryptographic key slot reference, and the PRPLT slot reference to the submission queue.
- Example 41. The method of either of examples 39 or 40, in which: the command has more than one page-level read/write pointer (PRP); the method further including writing a logical block address offset to part of at least one PRP of the command entry of the command for the submission queue; and submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue includes submitting the command entry of the command including the cryptographic enable, the cryptographic key slot reference, and the at least one PRP having the logical block offset.
- Example 42. The method of either of examples 39 or 40, in which data of the command is larger than two system memory pages, the method further including writing a logical block address offset to part of at least one PRP of a PRP list (PRPL).
- Example 43. The method of any of examples, 39, 40, or 42, in which: data of the command is larger than two system memory pages; the method further including writing a PRPL pointer to the command entry of the command for the submission queue at a location for a PRP; and submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue includes submitting the command entry of the command having the cryptographic enable, the cryptographic key slot reference, and the PRPL pointer.
- Example 44. The method of any of examples, 39, 40, 42, or 43, in which data of the command is larger than a number system memory pages that may be referenced by a PRP and a PRPL, the method further including writing a PRPL pointer to a PRP of a PRPL.
- Example 45. The method of any of examples 39-44, further including: configuring a first set of one or more registers of an inline cryptographic module corresponding with a number of command submission queues; and setting each of the first set of one or more registers with an address range of a different one of the command submission queues.
- Example 46. The method of example 45, in which setting each of the first set of one or more registers with the address range of a different one of the command submission queues includes setting each of the first set of one or more registers with a start address and a size of a different one of the command submission queues.
- Example 47. The method of example 45, in which setting each of the first set of one or more registers with the address range of a different one of the command submission queues includes setting each of the first set of one or more registers with a start address and an end address of a different one of the command submission queues.
- Example 48. The method of any of examples 45-47, further including: configuring a second set of one or more registers of the inline cryptographic module corresponding with a number of command completion queues; and setting each of the second set of one or more registers with a start address and a size of a different one of the command submission queues.
- Example 47. The method of examples 45-47, further including: configuring a second set of one or more registers of the inline cryptographic module corresponding with a number of exclusive address ranges; and setting each of the second set of one or more registers with a start address and a size of a different one of the exclusive address ranges.
The foregoing method descriptions and the process flow diagrams are provided merely as illustrative examples and are not intended to require or imply that the operations of the various embodiments must be performed in the order presented. As will be appreciated by one of skill in the art the order of operations in the foregoing embodiments may be performed in any order. Words such as “thereafter,” “then,” “next,” etc. are not intended to limit the order of the operations; these words are simply used to guide the reader through the description of the methods. Further, any reference to claim elements in the singular, for example, using the articles “a,” “an” or “the” is not to be construed as limiting the element to the singular.
The various illustrative logical blocks, modules, circuits, and algorithm operations described in connection with the various embodiments may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and operations have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the claims.
The hardware used to implement the various illustrative logics, logical blocks, modules, and circuits described in connection with the embodiments disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general-purpose processor may be a microprocessor, but, in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration. Alternatively, some operations or methods may be performed by circuitry that is specific to a given function.
In one or more embodiments, the functions described may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored as one or more instructions or code on a non-transitory computer-readable medium or a non-transitory processor-readable medium. The operations of a method or algorithm disclosed herein may be embodied in a processor-executable software module that may reside on a non-transitory computer-readable or processor-readable storage medium. Non-transitory computer-readable or processor-readable storage media may be any storage media that may be accessed by a computer or a processor. By way of example but not limitation, such non-transitory computer-readable or processor-readable media may include RAM, ROM, EEPROM, FLASH memory, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, or any other medium that may be used to store desired program code in the form of instructions or data structures and that may be accessed by a computer. Disk and disc, as used herein, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, and Blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers. Combinations of the above are also included within the scope of non-transitory computer-readable and processor-readable media. Additionally, the operations of a method or algorithm may reside as one or any combination or set of codes and/or instructions on a non-transitory processor-readable medium and/or computer-readable medium, which may be incorporated into a computer program product.
The preceding description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the claims. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments and implementations without departing from the scope of the claims. Thus, the present disclosure is not intended to be limited to the embodiments and implementations described herein but is to be accorded the widest scope consistent with the following claims and the principles and novel features disclosed herein.
Claims
1. A method of providing cryptographic functions for data in nonvolatile memory express (NVMe) protocol by an inline cryptographic module of a processing system, comprising:
- identifying a first transaction from an NVMe device for reading a command entry of a command submission queue;
- reading command entry data of the command entry;
- generating a shadow of at least one page-level read/write pointer (PRP) of the command entry data in a first data structure; and
- modifying the command entry data to enable reading of the shadow of the at least one PRP, thereby generating modified command entry data.
2. The method of claim 1, wherein generating the shadow of the at least one PRP of the command entry data in the first data structure comprises generating an entry for the at least one PRP in the first data structure, the entry for the at least one PRP in the first data structure including an address of the at least one PRP and a security context for the at least one PRP from the command entry data.
3. The method of claim 1, wherein modifying the command entry data to enable reading of the shadow of the at least one PRP comprises modifying an address of the at least one PRP of the command entry data to point to the shadow of the at least one PRP.
4. The method of claim 1, wherein generating the shadow of the at least one PRP of the command entry data in the first data structure comprises generating an entry for the at least one PRP in the first data structure, the entry for the at least one PRP in the first data structure including an address of the at least one PRP and a security context for the at least one PRP from a second data structure.
5. The method of claim 4, wherein the command entry data includes a reference to an entry for the at least one PRP in the second data structure, the method further comprising reading the entry for the at least one PRP in the second data structure, the entry for the at least one PRP in the second data structure including the address of the at least one PRP and the security context for the at least one PRP from the command entry data.
6. The method of claim 1, wherein modifying the command entry data to enable reading of the shadow of the at least one PRP comprises removing a reference to an entry for the at least one PRP in a second data structure.
7. The method of claim 1, further comprising:
- sending the modified command entry data to the NVMe device;
- identifying a second transaction from the NVMe device for executing an operation for the shadow of the at least one PRP; and
- implementing a cryptographic operation for data associated with the shadow of the at least one PRP based on a security context associated with the shadow of the at least one PRP.
8. The method of claim 1, further comprising:
- generating a shadow of a PRP list (PRPL) of the command entry data in the first data structure; and
- modifying the command entry data to enable reading of the shadow of the PRPL, thereby generating the modified command entry data.
9. The method of claim 8, wherein generating the shadow of the PRPL of the command entry data in the first data structure comprises generating an entry for the PRPL in the first data structure, the entry for the PRPL in the first data structure including an address of the PRPL and a security context for the PRPL from the command entry data.
10. The method of claim 8, further comprising:
- sending the modified command entry data to the NVMe device;
- identifying a second transaction from the NVMe device for reading the shadow of the PRPL;
- generating a shadow of each PRP of the PRPL in the first data structure; and
- modifying the each PRP of the PRPL to point to the shadow of the each PRP, generating a modified PRPL.
11. The method of claim 10, wherein generating the shadow of the each PRP of the PRPL in the first data structure comprises generating an entry for the each PRP of the PRPL in the first data structure, the entries for the each PRP of the PRPL in the first data structure including an address of the each PRP of the PRPL from the PRPL and a security context for the each PRP of the PRPL from an entry of the PRPL in the first data structure.
12. The method of claim 10, further comprising:
- sending the modified PRPL to the NVMe device;
- identifying a third transaction from the NVMe device for executing an operation for at least one of the shadows of the each PRP; and
- implementing a cryptographic operation for data associated with the at least one of the shadows of the each PRP based on the security context associated with the at least one of the shadows of the each PRP.
13. The method of claim 8, wherein modifying the command entry data to enable reading of the shadow of the PRPL comprises modifying an address of a PRPL pointer for the PRPL of the command entry data to point to the shadow of the PRPL.
14. The method of claim 8, wherein generating the shadow of the PRPL of the command entry data in the first data structure comprises generating an entry for a shadow of each PRP of the PRPL in the first data structure, the entries for the shadows the each PRP in the first data structure including an address of the each PRP of the PRPL from the PRPL and a security context for the each PRP from a second data structure.
15. The method of claim 14, further comprising:
- sending the modified command entry data to the NVMe device;
- identifying a second transaction from the NVMe device for reading the PRPL, wherein generating the shadow of the PRPL of the command entry data in the first data structure occurs in response to identifying the second transaction from the NVMe device; and
- modifying the each PRP of the PRPL to point to the shadow of the each PRP, thereby generating a modified PRPL.
16. The method of claim 15, further comprising:
- sending the modified PRPL to the NVMe device;
- identifying a third transaction from the NVMe device for executing an operation for at least one of the shadows of the each PRP; and
- implementing a cryptographic operation for data associated with the at least one of the shadows of the each PRP based on the security context associated with the at least one of the shadows of the each PRP.
17. The method of claim 8, wherein modifying the command entry data to enable reading of the shadow of the PRPL comprises removing a reference to an entry for the PRPL in a second data structure.
18. The method of claim 8, wherein the command entry data includes a reference to an entry in a second data structure, the entry in the second data structure having a security context for the PRPL, the method further comprising writing the PRPL pointer to the second data structure at a location associated with the reference to the entry in the second data structure.
19. The method of claim 1, wherein the modified command entry data includes a virtual address, the method further comprising fetching a virtual address to physical address mapping for the virtual address in parallel with generating the shadow of the at least one PRP of the command entry data in the first data structure.
20. The method of claim 1, wherein identifying the first transaction from the NVMe device for reading the command entry of the command submission queue comprises identifying an address of the transaction that is within at least one range of addresses for a least one submission queue, the at least one range of addresses stored to a configuration register of the inline cryptographic module.
21. A method of providing cryptographic functions for data in nonvolatile memory express (NVMe) protocol executed by a processing system, comprising:
- acquiring a cryptographic key slot for a command from a secure process, the cryptographic key slot including a cryptographic key slot reference;
- writing a cryptographic enable to a command entry of the command for a submission queue;
- writing the cryptographic key slot reference to the command entry of the command for the submission queue; and
- submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue.
22. The method of claim 21, further comprising:
- acquiring a page-level read/write pointer lookup table (PRPLT) slot for the command from an inline cryptographic module, the PRPLT slot including a PRPLT slot reference; and
- writing the PRPLT slot reference to the command entry of the command for the submission queue,
- wherein submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue comprises submitting the command entry of the command including the cryptographic enable, the cryptographic key slot reference, and the PRPLT slot reference to the submission queue.
23. The method of claim 21, wherein:
- the command has more than one page-level read/write pointer (PRP);
- the method further comprises writing a logical block address offset to part of at least one PRP of the command entry of the command for the submission queue; and
- submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue comprises submitting the command entry of the command including the cryptographic enable, the cryptographic key slot reference, and the at least one PRP having the logical block offset.
24. The method of claim 21, wherein data of the command is larger than two system memory pages, the method further comprising writing a logical block address offset to part of at least one PRP of a PRP list (PRPL).
25. The method of claim 21, wherein:
- data of the command is larger than two system memory pages;
- the method further comprises writing a PRPL pointer to the command entry of the command for the submission queue at a location for a PRP; and
- submitting the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue comprises submitting the command entry of the command having the cryptographic enable, the cryptographic key slot reference, and the PRPL pointer.
26. The method of claim 21, wherein data of the command is larger than a number system memory pages that may be referenced by a PRP and a PRPL, the method further comprising writing a PRPL pointer to a PRP of a PRPL.
27. The method of claim 21, further comprising:
- configuring a first set of one or more registers of an inline cryptographic module corresponding with a number of command submission queues; and
- setting each of the first set of one or more registers with an address range of a different one of the command submission queues.
28. The method of claim 27, wherein setting each of the first set of one or more registers with the address range of a different one of the command submission queues comprises setting each of the first set of one or more registers with a start address and a size of a different one of the command submission queues.
29. The method of claim 27, wherein setting each of the first set of one or more registers with the address range of a different one of the command submission queues comprises setting each of the first set of one or more registers with a start address and an end address of a different one of the command submission queues.
30. The method of claim 27, further comprising:
- configuring a second set of one or more registers of the inline cryptographic module corresponding with a number of command completion queues; and
- setting each of the second set of one or more registers with a start address and a size of a different one of the command submission queues.
31. The method of claim 27, further comprising:
- configuring a second set of one or more registers of the inline cryptographic module corresponding with a number of exclusive address ranges; and
- setting each of the second set of one or more registers with a start address and a size of a different one of the exclusive address ranges.
32. A computing device, comprising:
- a processing system; and
- a nonvolatile memory express (NVMe) inline cryptographic module coupled to the processing system, the NVMe inline cryptographic module configured to: identify a first transaction from an NVMe device for reading a command entry of a command submission queue; read command entry data of the command entry; generate a shadow of at least one page-level read/write pointer (PRP) of the command entry data in a first data structure; and modify the command entry data to enable reading of the shadow of the at least one PRP, thereby generating modified command entry data.
33. The computing device of claim 32, wherein the NVMe inline cryptographic module is further configured to generate an entry for the at least one PRP in the first data structure, the entry for the at least one PRP in the first data structure including an address of the at least one PRP and a security context for the at least one PRP from the command entry data, to generate the shadow of the at least one PRP of the command entry data in the first data structure.
34. The computing device of claim 32, wherein the NVMe inline cryptographic module is further configured to modify an address of the at least one PRP of the command entry data to point to the shadow of the at least one PRP to modify the command entry data to enable reading of the shadow of the at least one PRP.
35. The computing device of claim 32, wherein the NVMe inline cryptographic module is further configured to generate an entry for the at least one PRP in the first data structure, the entry for the at least one PRP in the first data structure including an address of the at least one PRP and a security context for the at least one PRP from a second data structure, to generate the shadow of the at least one PRP of the command entry data in the first data structure.
36. The computing device of claim 35, wherein:
- the command entry data includes a reference to an entry for the at least one PRP in the second data structure; and
- the NVMe inline cryptographic module is further configured to read the entry for the at least one PRP in the second data structure, the entry for the at least one PRP in the second data structure including the address of the at least one PRP and the security context for the at least one PRP from the command entry data.
37. The computing device of claim 32, wherein the NVMe inline cryptographic module is further configured to remove a reference to an entry for the at least one PRP in a second data structure to modify the command entry data to enable reading of the shadow of the at least one PRP.
38. The computing device of claim 32, wherein the NVMe inline cryptographic module is further configured to:
- send the modified command entry data to the NVMe device;
- identify a second transaction from the NVMe device for executing an operation for the shadow of the at least one PRP; and
- implement a cryptographic operation for data associated with the shadow of the at least one PRP based on a security context associated with the shadow of the at least one PRP.
39. The computing device of claim 32, wherein the NVMe inline cryptographic module is further configured to:
- generate a shadow of a PRP list (PRPL) of the command entry data in the first data structure; and
- modify the command entry data to enable reading of the shadow of the PRPL, thereby generating the modified command entry data.
40. The computing device of claim 39, wherein the NVMe inline cryptographic module is further configured to generate an entry for the PRPL in the first data structure, the entry for the PRPL in the first data structure including an address of the PRPL and a security context for the PRPL from the command entry data, to generate the shadow of the PRPL of the command entry data in the first data structure.
41. The computing device of claim 39, wherein the NVMe inline cryptographic module is further configured to:
- send the modified command entry data to the NVMe device;
- identify a second transaction from the NVMe device for reading the shadow of the PRPL;
- generate a shadow of each PRP of the PRPL in the first data structure; and
- modify the each PRP of the PRPL to point to the shadow of the each PRP, generating a modified PRPL.
42. The computing device of claim 41, wherein the NVMe inline cryptographic module is further configured to generate an entry for the each PRP of the PRPL in the first data structure, the entries for the each PRP of the PRPL in the first data structure including an address of the each PRP of the PRPL from the PRPL and a security context for the each PRP of the PRPL from an entry of the PRPL in the first data structure, to generate the shadow of the each PRP of the PRPL in the first data structure.
43. The computing device of claim 41, wherein the NVMe inline cryptographic module is further configured to:
- send the modified PRPL to the NVMe device;
- identify a third transaction from the NVMe device for executing an operation for at least one of the shadows of the each PRP; and
- implement a cryptographic operation for data associated with the at least one of the shadows of the each PRP based on the security context associated with the at least one of the shadows of the each PRP.
44. The computing device of claim 39, wherein the NVMe inline cryptographic module is further configured to modify an address of a PRPL pointer for the PRPL of the command entry data to point to the shadow of the PRPL to modifying the command entry data to enable reading of the shadow of the PRPL.
45. The computing device of claim 39, wherein the NVMe inline cryptographic module is further configured to generate an entry for a shadow of each PRP of the PRPL in the first data structure, the entries for the shadows the each PRP in the first data structure including an address of the each PRP of the PRPL from the PRPL and a security context for the each PRP from a second data structure, to generate the shadow of the PRPL of the command entry data in the first data structure.
46. The computing device of claim 45, wherein the NVMe inline cryptographic module is further configured to:
- send the modified command entry data to the NVMe device;
- identify a second transaction from the NVMe device for reading the PRPL, and in response to identifying the second transaction from the NVMe device, generate the shadow of the PRPL of the command entry data in the first data structure occurs; and
- modify the each PRP of the PRPL to point to the shadow of the each PRP, thereby generating a modified PRPL.
47. The computing device of claim 46, wherein the NVMe inline cryptographic module is further configured to:
- send the modified PRPL to the NVMe device;
- identify a third transaction from the NVMe device for executing an operation for at least one of the shadows of the each PRP; and
- implement a cryptographic operation for data associated with the at least one of the shadows of the each PRP based on the security context associated with the at least one of the shadows of the each PRP.
48. The computing device of claim 39, wherein the NVMe inline cryptographic module is further configured to remove a reference to an entry for the PRPL in a second data structure to modify the command entry data to enable reading of the shadow of the PRPL.
49. The computing device of claim 39, wherein:
- the command entry data includes a reference to an entry in a second data structure, the entry in the second data structure having a security context for the PRPL; and
- the NVMe inline cryptographic module is further configured to write the PRPL pointer to the second data structure at a location associated with the reference to the entry in the second data structure.
50. The computing device of claim 32, wherein:
- the modified command entry data includes a virtual address; and
- the NVMe inline cryptographic module is further configured to fetch a virtual address to physical address mapping for the virtual address in parallel with generating the shadow of the at least one PRP of the command entry data in the first data structure.
51. The computing device of claim 32, wherein the NVMe inline cryptographic module is further configured to identifying an address of the transaction that is within at least one range of addresses for a least one submission queue, the at least one range of addresses stored to a configuration register of the inline encryption module, to identify the first transaction from the NVMe device for reading the command entry of the command submission queue.
52. A computing device, comprising:
- a nonvolatile memory express (NVMe) inline cryptographic module; and
- a processing system coupled to the NVMe inline cryptographic module, the processing system configured to: acquire a cryptographic key slot for a command from a secure process, the cryptographic key slot including a cryptographic key slot reference; write a cryptographic enable to a command entry of the command for a submission queue; write the cryptographic key slot reference to the command entry of the command for the submission queue; and submit the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue.
53. The computing device of claim 52, wherein the processing system is further configured to:
- acquire a page-level read/write pointer lookup table (PRPLT) slot for the command from an inline cryptographic module, the PRPLT slot including a PRPLT slot reference;
- write the PRPLT slot reference to the command entry of the command for the submission queue; and
- submit the command entry of the command including the cryptographic enable, the cryptographic key slot reference, and the PRPLT slot reference to the submission queue to submit the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue.
54. The computing device of claim 52, wherein:
- the command has more than one page-level read/write pointer (PRP); and
- the processing system is further configured to: write a logical block address offset to part of at least one PRP of the command entry of the command for the submission queue; and submit the command entry of the command including the cryptographic enable, the cryptographic key slot reference, and the at least one PRP having the logical block offset to submit the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue.
55. The computing device of claim 52, wherein:
- data of the command is larger than two system memory pages; and
- the processing system is further configured to write a logical block address offset to part of at least one PRP of a PRP list (PRPL).
56. The computing device of claim 52, wherein:
- data of the command is larger than two system memory pages; and
- the processing system is further configured to: write a PRPL pointer to the command entry of the command for the submission queue at a location for a PRP; and submit the command entry of the command having the cryptographic enable, the cryptographic key slot reference, and the PRPL pointer to submit the command entry of the command having the cryptographic enable and the cryptographic key slot reference to the submission queue.
57. The computing device of claim 52, wherein:
- data of the command is larger than a number system memory pages that may be referenced by a PRP and a PRPL; and
- the processing system is further configured to write a PRPL pointer to a PRP of a PRPL.
58. The computing device of claim 52, wherein the processing system is further configured to:
- configure a first set of one or more registers of an inline cryptographic module corresponding with a number of command submission queues; and
- set each of the first set of one or more registers with an address range of a different one of the command submission queues.
59. The computing device of claim 58, wherein the processing system is further configured to set each of the first set of one or more registers with a start address and a size of a different one of the command submission queues to set each of the first set of one or more registers with the address range of a different one of the command submission queues.
60. The computing device of claim 58, wherein the processing system is further configured to set each of the first set of one or more registers with a start address and an end address of a different one of the command submission queues to set each of the first set of one or more registers with the address range of a different one of the command submission queues.
61. The computing device of claim 58, wherein the processing system is further configured to:
- configure a second set of one or more registers of the inline cryptographic module corresponding with a number of command completion queues; and
- set each of the second set of one or more registers with a start address and a size of a different one of the command submission queues.
62. The computing device of claim 58, wherein the processing system is further configured to:
- configure a second set of one or more registers of the inline cryptographic module corresponding with a number of exclusive address ranges; and
- set each of the second set of one or more registers with a start address and a size of a different one of the exclusive address ranges.
Type: Application
Filed: Jan 5, 2024
Publication Date: Nov 26, 2026
Inventors: Kishalay HALDAR (Bangalore), Tanya MAHAJAN (Bangalore), Amit GIL (Zichron Yaakov)
Application Number: 19/155,852