Reliable Flash Storage
The use of multiple pages in flash memory with a primary page determination and a flash reliability manager addresses write endurance and power-related issues, enhancing data reliability and integrity in flash storage.
Patent Information
- Application Number
- JP2024521151
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-10-15
- Filing Date
- 2022-10-11
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2042-10-11
AI Technical Summary
Flash memory devices face limitations such as write endurance and data corruption during power fluctuations, leading to potential memory failures and rendering electronic devices unusable.
Implementing reliable flash storage techniques using two or more pages in flash memory, where data is stored in an append-only manner, with a primary page determined for operations, ensuring previous entries remain available until overwritten, and utilizing a flash reliability manager to manage these operations.
This approach enhances data reliability by reducing the risk of corruption and wear, allowing recovery from write and erase failures, and ensuring data integrity through efficient page management.
Smart Images

Figure 2024538028000001_ABST
Abstract
Description
[Background technology]
[0001] background Electronic devices are continually used to perform tasks of increasing complexity and importance. As a result, electronic devices require the implementation of robust, high-performance memory devices. Currently, many electronic devices utilize flash memory as a non-volatile storage medium. However, many flash memory devices have limitations, such as write endurance, that dictate the number of program and erase operations that can be performed before damaging the flash memory device. Furthermore, in some circumstances, data stored within a flash memory device may be corrupted during a power fluctuation event, such as a power loss during a storage operation. Such an event may permanently compromise data that is essential to the operation of the electronic device. Thus, memory failures may damage an electronic device and, in some cases, may render the electronic device unusable. Summary of the Invention
[0002] overview This document describes techniques and apparatus for reliable flash storage that may enable reliable read, write (e.g., program), and erase operations in flash storage. In aspects, data may be stored in a flash memory device through the use of two or more pages. A primary page may be determined for two or more pages to determine a suitable page for performing a storage operation. An empty entry may be determined in the primary page, and data may be stored in the empty entry. After data is written to an entry, the previous entry may be invalidated, such as to prevent access or use of invalid or deprecated data. In doing so, the previous entry may only be changed at the time a new entry is stored in the flash device. Thus, the described techniques and apparatus may enable aspects of reliable flash storage.
[0003] A method is described that includes storing data in one of two or more pages of a flash memory. Storing the data includes determining a primary page of the two or more pages of the flash memory. A first free entry in the primary page may be determined, and data (e.g., boot code, boot data, data structures, etc.) may be stored in the first free entry of the primary page. In some cases, this ensures that previous data in the primary page is available in the event of a write failure when new or updated data is written to the free entry in the primary page.
[0004] In an aspect, a flash reliability manager implemented in a computer-readable storage medium that may be executed by a processor to perform methods or other operations for a trusted flash memory is also described. In another aspect, a system including a flash memory and a flash reliability manager configured to implement aspects of the trusted flash memory is further described in this document.
[0005] This summary is provided to introduce simplified concepts of techniques and apparatus for reliable flash storage that are further described below in the detailed description and drawings. This summary is not intended to identify essential features of the claimed subject matter, nor is it intended for use in determining the scope of the claimed subject matter.
[0006] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS One or more aspects of the reliable flash storage are described in detail below. The use of the same reference numbers in different instances in the description and figures indicates similar elements. [Brief description of the drawings]
[0007] [Figure 1] FIG. 1 illustrates an example of an operating environment in which reliable flash storage may be implemented in accordance with one or more aspects. [Diagram 2]FIG. 1 illustrates an example of a system including a flash reliability manager. [Diagram 3] FIG. 2 illustrates an example of a flash bank in a flash memory. [Figure 4] FIG. 2 illustrates an example of a flash memory including multiple pages in accordance with one or more aspects of reliable flash storage. [Diagram 5] FIG. 1 illustrates an example of a counter implementation for main page determination in accordance with one or more aspects. [Figure 6] FIG. 2 illustrates an example of a state scheme for main page determination in accordance with one or more aspects of reliable flash storage. [Figure 7] FIG. 1 illustrates an example of an implementation of a write operation in accordance with one or more aspects. [Figure 8] FIG. 2 illustrates an example of an implementation of a read operation in accordance with one or more aspects of reliable flash storage. [Figure 9] FIG. 2 illustrates an example of a method for a write operation in accordance with one or more aspects of reliable flash storage. [Figure 10] FIG. 1 illustrates an example of a method for a read operation in accordance with one or more aspects of reliable flash storage. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0008] Detailed Description overview This document describes techniques and apparatus for reliable flash storage. Many electronic devices may utilize flash memory to store data that is useful for the operation of the device. When provisioned, flash memory contains pages, with each page containing a set number of bits initialized to a value of 1. Through a write operation, a bit can be programmed from 1 to 0. However, to program a bit with a value of 0 back to its original value of 1, an erase operation is utilized. An erase operation cannot be performed on individual bits; instead, an erase operation programs all bits in a page (or bank) of flash memory to a value of 1, which may damage the flash device over time. Additionally, flash devices may experience power loss during a write or erase operation, which may corrupt the data being written or erased. Reliable flash storage is needed to limit damage to flash devices and provide a robust solution for storing data in flash memory.
[0009] Described herein is a reliable flash storage that utilizes at least two pages in an append-only fashion to store data in the flash memory. In general, the flash memory can be accessed through three operations: read, write, and erase. A read operation can retrieve data stored in the flash memory and output the content to be utilized in another device. A write operation can determine the appropriate entry to store the data in by programming the appropriate bits of the entry to zero. An erase command can reprogram all bits in a page (or bank or block) to a value of one. To provide reliable flash storage, two or more pages are used to ensure that previous entries are preserved until a new entry is written. Thus, even if data is corrupted, previous entries may remain available for reading. Additionally, a primary page on which read and write operations should be performed can be determined between the two pages. Data structures (boot code, boot data, etc.) are written to entries in each page and set to a valid or invalid state. In an aspect, the primary page can be determined through a counter scheme or a state scheme. A counter scheme can utilize a counter field in each data structure to determine the page that contains the valid entry with the highest data structure counter field. The state scheme can utilize storage space within each page where the state of the page is stored. Based on the state of each page, a primary page can be determined. Thus, write and read operations can be performed on the primary page, minimizing the computation required to determine the appropriate interaction with the flash memory.
[0010] For reliable flash storage, the write operation may be performed on the first empty entry in the primary page. The write operation may further set the previous entry to be invalid by modifying a field of a data structure stored in the previous entry, e.g., by setting all or some bits of a field of the data structure known to have at least one non-zero bit to zero. Doing so may allow the primary page to be determined with less computation since valid entries may be found more easily. Furthermore, when the primary page is changed from a first page to a second page, e.g., because the primary page is full, the second page may be erased to make space for the new entry without modifying the previous entry in the first page. In an aspect, the reliable flash storage, as described, is performed by a flash reliability manager operatively coupled with the flash memory.
[0011] The described aspects may provide one or more advantages over the prior art of flash memory writing. For example, reliable flash storage may provide an opportunity to recover from a write failure, since a previous entry is invalidated only after a successful write, or an erase failure without falling back to a default value. Additionally, these aspects may perform one erase every N writes, instead of one erase every write, reducing the likelihood of data corruption due to power outages. Alternatively or additionally, erase cycles are distributed across at least two pages of information, resulting in reduced flash wear. These are just a few examples of aspects and advantages provided by reliable flash storage, others are described throughout this disclosure.
[0012] 1 illustrates an example of an operating environment 100 for trusted flash storage according to one or more aspects. For example, the trusted flash storage may be executed within an electronic device 102, such as a mobile device 102-1, a tablet 102-2, a personal computer 102-3, a wearable computing device 102-4, or a vehicle 102-5 (e.g., a vehicle navigation, control, or entertainment system). Although not shown, other configurations of electronic device 102 are possible, such as desktops, servers, printers, digital cameras, gaming consoles, home automation terminals, mobile hotspots, security chips, etc.
[0013] In an aspect, an electronic device 102 capable of implementing trusted flash storage includes a processor 104 and a computer-readable storage medium 106. The computer-readable storage medium 106 may be implemented within or in association with the processor 104, for example, as a system-on-chip (SoC) or another form of internal or embedded system that provides processing or functionality of the electronic device 102. Alternatively, the computer-readable storage medium 106 may be external but associated with the processor 104. The computer-readable storage medium 106 includes a volatile memory 108 and a non-volatile memory 110, which may include any suitable type, combination, or number of internal or external memory devices. Each memory of the computer-readable storage medium 106 may be implemented as an on-chip memory of a hardware circuit, or an off-chip memory device that communicates data with the processor 104 via a data interface or bus. In one example, the volatile memory 108 includes a random access memory (RAM). Alternatively or additionally, the volatile memory 108 may include other types of memory, such as static random access memory (SRAM), synchronous dynamic random access memory (DRAM), asynchronous DRAM, double data rate RAM (DDR), etc.
[0014] In addition, the non-volatile memory 110 includes a flash memory 114 and may further include a read-only memory 112 (ROM 112), either of which may be used to store separate code partitions with various security requirements. Other non-volatile memories not shown may include non-volatile random access memory (NVRAM), electrically erasable programmable read-only memory (EEPROM), embedded multimedia card (eMMC) devices, single-level cell (SLC) flash memory, multi-level cell (MLC) flash memory, and the like. In one example, the ROM 112 is implemented as an on-chip memory area. Boot code may be stored in one or more non-volatile memory components, such as the flash memory 114 and the ROM 112. In a particular example, the lowest level of boot code is written or masked in the ROM 112. By doing so, the boot code in the ROM 112 or in the metal mask ROM / boot ROM cannot be modified after the chip is manufactured. The unmodifiable nature of the ROM 112 ensures the reliability of the lowest level of boot code. Higher level boot code may be implemented in an extension of ROM 112 , such as flash memory 114 .
[0015] The flash memory 114 may be implemented through a flash bank that includes multiple partitions, each accessible to a different system of the electronic device 102. In some implementations, the flash memory 114 may include a data partition that holds general purpose data and an information partition that holds metadata about the data partition and design specific confidential data. The flash memory 114 may be durable and therefore capable of supporting modification through multiple write and erase commands. Additionally, the flash memory 114 may support a read command that outputs data stored within the flash memory 114.
[0016] The electronic device 102 further includes a flash reliability manager 116 that enables reliable flash storage. The flash reliability manager 116 may be implemented through machine-readable instructions executable by the processor 104. In this implementation, the flash reliability manager 116 may provide high-level protocol commands, such as read, write, and erase, to the flash controller in accordance with techniques for reliable flash storage. As a result, the flash controller can arbitrate the high-level protocol commands to perform read, write, and erase operations on the flash memory 114. In other implementations, the flash reliability manager 116 may be implemented as hardware in the flash controller and function to arbitrate the high-level protocol commands to perform reliable flash storage. Thus, the flash reliability manager 116 may be implemented through any number of fixed logic circuits, including, but not limited to, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), SoCs, complex programmable logic devices (CPLDs), and the like.
[0017] The electronic device 102 may execute an operating system or applications from any suitable type of computer-readable storage medium 106, including volatile memory 108 and non-volatile memory 110. Alternatively or additionally, the operating system or applications may be embodied as firmware or any other computer-readable instructions, binaries, or code. The electronic device 102 may include a user interface provided by the operating system or applications to enable certain functions or services of the electronic device 102.
[0018] The electronic device 102 may also include I / O ports 118. The I / O ports 118 allow the embedded device 102 to interact with other devices or users, such as programming codes or values as described herein into respective memories, registers, and the like. The I / O ports 118 may include any combination of internal or external ports, such as USB ports, Joint Test Action Group (JTAG) ports, Test Access and Programming (TAP) ports, audio ports, Serial ATA (SATA) ports, PCI-express based ports or card slots, Secure Digital Input / Output (SDIO) slots, and / or other legacy ports. Various peripherals, such as human input devices (HIDs), external computer-readable storage media, or other peripherals, may be operatively coupled to the I / O ports 118.
[0019] FIG. 2 illustrates an example of a system 200 including a flash reliability manager 116. The flash reliability manager 116 may be disposed between the software interface of the host 202, other hardware components, and the flash physical controller 204. In some implementations, the flash reliability manager 116 translates read, write, and erase requests from the host 202 to a high-level protocol for the flash physical controller 204. The flash physical controller 204 is shown implemented within the flash memory 114, but may be external and connected to the flash memory 114. The flash physical controller 204 is connected to a flash bank 206 that includes one or more partitions accessible to various systems within the electronic device. Thus, the flash physical controller 204 may execute a high-level protocol provided by the flash reliability manager 116 to arbitrate read, write, and erase commands to one or more partitions of the flash bank 206. Additionally, the flash physical controller 204 or the flash reliability manager 116 may be utilized to perform various security functions on the flash memory 114, such as scrambling or buffering.
[0020] FIG. 3 illustrates an example of a flash bank 206 at 300. Flash memory may not be organized as a contiguous block of general purpose storage, but instead may be organized into a data partition and an information partition. For example, as illustrated, the flash bank 206 includes an information partition 302, an information partition 304, and a data partition 306. The data partition 306 may store general purpose data, such as general purpose memory. The information partition 302 and the information partition 304 may store metadata and design specific confidential data regarding the data partition. For example, the information partitions (e.g., the information partition 302 and the information partition 304) may include, but are not limited to, redundant information, manufacturer specific information, manufacturer flash timing information, a design specific unique seed, and redundant pages. Each partition may include or be divided into pages, e.g., the information partition 302, the information partition 304, and the data partition 306 each include a maximum integer number N of pages having a set number of entries capable of storing a set number of words. Each word may be configured with a set number of bits that determine the word size. In a default state, each bit may be set to one. In an embodiment, the flash bank 206 may include multiple information partitions, none of which need be the same size as the data partition 306 .
[0021] For each type of partition, the page size and word size may need to be the same, but each type of partition may contain a different number of pages. Thus, one or more partitions may be of different size than the other partitions. However, all types of partitions may follow the same program and erase rules, e.g., a bit cannot be programmed back to 1 after being programmed to 0 unless an erase command is used. In some aspects, a write command may be a bit-wide operation to program a 1 to 0, while an erase command must operate on an entire page or bank to erase all bits programmed with a value of 0 to 1. Alternatively or additionally, write operations may be performed at any suitable granularity, such as write operations implemented as one or more of a bit-wide operation, a nibble-wide operation, a byte-wide operation, a word-wide operation, etc. In some cases, the data partition may be directly read by software and other hardware hosts, while the information partition may only be read by the flash controller (e.g., flash physical controller 204).
[0022] In one implementation, the information partition 302 and the information partition 304 hold a secret seed for implementing a secure boot process. A page embedded within the information partition may be read upon initialization of the flash controller. A value read from the page may then be provided for use as part of the secure boot process of the electronic system. In some implementations, the secure boot process may involve a creator secret (from the manufacturer or designer of the silicon device) and an owner secret (from a purchaser or entity authorized by the creator (or previous owner) to execute code on the device). Thus, the information partition 302 or the information partition 304 may include a creator page and an owner page.
[0023] In an aspect, an entry may be implemented as shown in Example Data Structure 1 with one or more fields for a digest, an identifier, a counter, a security version value, etc. The entries may be a fixed size (e.g., a multiple of the word size) or may be integrity protected.
[0024] Data structure example 1 typedef struct boot_data { hmac_digest_t digest; uint32_t identifier; uint32_t counter; uint32_t min_security_version_rom_ext; / / other data (or padding) / / ... } FIG. 4 illustrates an example of a flash memory 400 that includes multiple pages according to one or more aspects of reliable flash storage. For example, pages 402 and 404 are used as append-only logs to allow recovery from interrupted write and erase operations. Data can be packed into a single data structure, and each page can store an integer number N of entries determined by the size of the data structure and the page size. At any given time, one of pages 402 and 404 is the primary (or active) page, and the other is the secondary (or inactive) page. The primary page is available for reading and writing until it is full. When the primary page is full and a new entry needs to be stored, the secondary page can be erased and the new entry written to the newly erased page. Once the new entry is verified, the primary and secondary pages can be switched. In other words, when the primary page is full (e.g., all entries are filled), the secondary page is erased and the new entry is written to the newly erased page. Verifying the new entry switches the respective roles or states of the primary and secondary pages (e.g., a previously erased page becomes the primary page). It should be noted that verifying the new entry can be performed in a variety of ways, for example, by reading back the newly written entry and comparing its contents with expected values, or by monitoring the flash controller for error conditions.
[0025] To allow the integrity of an entry to be verified, the stored data structure may have a digest (or checksum) field. In some implementations, the digest may be used to determine the validity of an entry. For example, the digest may be verified to determine that the entry is valid. However, if the digest does not verify, the entry may be considered invalid. In aspects, an identifier field with a non-trivial value may be used to allow invalid or empty entries to be quickly determined prior to full integrity and emptiness checking as an optimization. In aspects, the identifier field may be a predefined constant value across each entry. Alternatively, the identifier field may be unique per entry or may vary based on the type of entry.
[0026] FIG. 5 illustrates at 500 an exemplary counter scheme for determining a primary page according to one or more aspects of reliable flash storage. As previously described, the counter scheme may utilize at least two pages (e.g., pages shown as page 402 and page 404) in an append-only manner. Each of page 402 and page 404 may be writable and may contain a set number of entries that may be set to valid or invalid. Each entry may have a counter field that is incremented with each write. With each write, the entry may be filled and set to valid. Additionally, each other entry, or previous entries, may be set to invalid. To determine the primary page, a valid entry for each page may be found and then compared based on the value of its counter field, and the page with the higher counter value may be determined as the primary page. Alternatively, the last valid entry in each page may be found and then compared based on the value of the counter.
[0027] For example, page 402 does not contain an empty entry, and similarly does not contain a valid entry. Page 404, however, contains a valid entry with a counter value of 56. As a result, page 404 may be determined as the primary page. In an implementation where the previous entry is set as invalid as part of a write command, the flash memory may be corrupted while setting the validity field of the previous entry. As a result, the previous entry may not be marked as invalid. In this case, each valid entry may be compared based on the counter value, and the primary page is determined. In another implementation, the previous entry is not set as invalid. In this implementation, both page 402 and page 404 may contain valid entries. The valid entries are compared, and the valid entry with the highest counter value determines the primary page. Specifically, the primary page becomes the page that contains the entry with the highest counter value. If there are no valid entries, it may be determined that the page needs to be initialized, e.g., erased. If a read request is received before initialization, a default value may be returned. This behavior may be further controlled, allowed, or prohibited based on the device's life cycle state, one-time programmable (OTP) memory configuration, or other configuration. The initialization may include a default main page, such as page 402 or page 404. The counter approach may be advantageous for reliable flash storage due to its simplicity, since it only uses a simple counter field in each entry. Alternatively, reliable flash storage may be performed via a state approach.
[0028] FIG. 6 illustrates at 600 an example of a state scheme for determining a primary page in accordance with one or more aspects of reliable flash storage. The state scheme can utilize two append-only pages, similar to the counter scheme. As shown, the state scheme includes page 402 and page 404. Each page can have a reserved area for storing the state of the page. As shown in FIG. 6, a redundancy encoding can be used that utilizes two constants X and Y. Each of the constants X and Y can be used to represent the state of the page in which it is stored.
[0029] The first four rows shown in FIG. 6 list the states of the pages in the order they may transition. In addition, the state that will be updated in the next row is highlighted. For example, assume that the page's status field has values X and Y (first row) and page 402 (the primary page) is full, then page 404 is erased, its status field is set to X, and it becomes the primary page (second row). If this operation is interrupted, the state of the pages can still be reliably determined because the current primary page is not changed during this operation. If both pages are in the X state (second row), then page 404 can be written as the primary page. When page 404 becomes full, page 402 can be erased, its status can be changed to Y, and page 402 becomes the primary page (third row). Similarly, page 402 can be written as the primary page until it becomes full. When page 402 becomes full, page 404 can be erased, its status can be changed to Y, and page 404 becomes the primary page (fourth row). Page 404 can be written to as the primary page until it is full, at which point page 402 can be erased and its state can be set to X. This can determine page 402 as the primary page and the cycle starts over.
[0030] Once the primary page is determined, the primary page can be written to without modifying the existing entries. If the primary page is full, the secondary page can be erased and the secondary page can be written as the primary page. Thus, reliable flash storage is provided since previous entries cannot be cleared or invalidated until the new entry is written. It should be noted that the determination of the primary page and the erasure of the page may be performed in any order. For example, the primary page may be determined to be full. The secondary page may be determined as the primary page and deleted. Alternatively, the secondary page may be deleted and then determined as the primary page. It should be noted that the state scheme may not require any further fields in the entries and there is no need to scan a second page to determine the primary page. For ease of explanation, the various operations (read, write, and erase) are described in the context of a counter scheme. However, it should be understood that each of the read, write, and erase operations can be performed according to the state scheme by implementing a state for each respective page instead of or in addition to the counter field.
[0031] FIG. 7 illustrates at 700 an example of an implementation of a write operation according to one or more aspects of reliable flash storage. A page 402 is shown before (e.g., page 402-1) and after (e.g., page 402-2) a write operation is performed. The write operation may write a new data structure to the first empty entry of the primary page (e.g., the first entry with all 1's bits). In some aspects, this may be implemented as a simple linear search since the number of non-empty entries is expected to be small. Alternatively, a binary search or any other suitable search algorithm may be used to determine the first empty entry in the primary page. Note that the entries do not need to be unique, and the same entry may be written multiple times for redundancy. If no empty entries remain in the primary page, the secondary page may be erased before the new data structure can be written. Once the new entry is verified, the primary and secondary pages may be switched. Once the new entry is written, the previous entry may be invalidated (e.g., by writing all 0's to the structure's fields) to avoid reverting to old information. In some implementations, the identifier field may be written to 0. If a write operation is interrupted, the previous entry may still be valid as it becomes invalid only after the new entry is successfully written. In an example write operation, a search may determine the first empty entry in page 402-1, and a write command may write a new data structure including an incremented counter to the empty entry, resulting in page 402-2. In a state scheme, the write operation may include updating the state of each page as necessary.
[0032] FIG. 8 illustrates at 800 an example of an implementation of a read operation according to one or more aspects of the reliable flash storage. In FIG. 8, the page 402 is a primary page and includes at least one valid entry. The read operation can return the last valid entry in the primary page. Similar to a write operation, the read operation must first search for the first empty entry in the page and can perform a backward search to find the last valid entry. If there are no empty entries in the page, the backward search can start from the last entry in the page. As a result, the read operation can find the last valid entry even if the previous entry has not been updated to be invalid. A page may not contain a valid entry, for example, before the page is written to. In the absence of valid data, a default value can be used based on the life cycle state of the electronic device or another configuration, for example, OTP fuses. For example, in a manufacturing state, the life cycle state can determine a corresponding default value to enable the manufacturing use case. In another implementation, a single default configuration can be used.
[0033] In general, any of the components, modules, methods, and operations described herein may be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Some operations of the example methods may be described in the general context of executable instructions stored in a computer-readable storage memory that is local and / or remote to a computer processing system, and implementations may include software applications, programs, functions, and the like. Alternatively or in addition, any of the functions described herein may be performed at least in part by one or more hardware logic components, including, but not limited to, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SoCs), complex programmable logic devices (CPLDs), and the like.
[0034] FIG. 9 illustrates an example method 900 for a write operation according to one or more aspects of reliable flash storage. At 902, a primary page of two or more pages of a flash memory is determined. In aspects, the primary page is determined using a counter scheme or a state scheme detailed above. In some implementations, storing data in one of the two or more pages of a flash memory includes determining whether the primary page is full after determining the primary page. In response to determining that the primary page is full, another page of the two or more pages may be erased. The other page may then be used to store data in its first empty entry and determined as the primary page. In some cases, this prevents data from being erased until new or updated data for the entry is written to a different page of the flash memory, ensuring that the data is available even if an erase or write fails when storing the data in a new primary page of the flash memory.
[0035] In some implementations, a counter scheme may be used to direct and enable the determination of a primary page from multiple pages of a flash memory. For example, data may be written or formatted as a data structure including a counter field, and storing a data structure (e.g., a valid data structure or a valid structure) may include setting a counter field of the valid data structure by incrementing a counter field of the data structure stored in a previous entry (e.g., a monotonically increasing counter for indicating a valid entry). In some implementations, there may be no previous entry. Thus, a default value may be written to the counter field. In the counter scheme, a primary page may be identified by determining a first valid entry in a first page of the two or more pages and at least one second valid entry in at least one second page of the two or more pages. To determine the primary page, the first valid entry and the at least one second valid entry may be compared based on a counter field of a data structure stored in each of the first valid entry and the at least one second valid entry. In some implementations, multiple valid entries may exist on a page. Thus, the last valid entry of each page may be used to determine the primary page.
[0036] In some implementations, a status scheme is utilized to determine a primary page of the flash memory. For example, each page of the two or more pages of the flash memory may include a status field used to store a status of each page. The primary page may be determined based on the respective status fields of the two or more pages. In one aspect, an initial primary page is determined based on the respective status fields of the two or more pages, and the primary page is searched to determine whether the page includes an empty entry. If it is determined that the primary page does not include an empty entry (e.g., is full), another page of the two or more pages, different from the initial primary page, is determined as the primary page. In some implementations, in response to determining that the initial primary page is full, the other page is erased. In one aspect, in response to erasing the other page, a status field of the other page is changed. In some implementations, valid data is stored in a first empty entry of the other page using the other page as the primary page.
[0037] At 904, a first empty entry in the main page is determined. At 906, a valid data structure is stored in the first empty entry. In some implementations, the valid data structure may include a digest, an identifier field, or a counter field. At 908, in response to a valid data structure being stored in the first empty entry, the previous entry may be set to invalid. The previous entry may be set to invalid by modifying a field in the data structure stored in the previous entry. In a particular example, the field or a portion thereof may be changed to zero. In one aspect, the identifier field may be known to be non-zero, and therefore the identifier field may be adjusted to set the previous entry to invalid.
[0038] 10 illustrates an example method 1000 for a read operation in accordance with one or more aspects of reliable flash storage. At 1002, a master page of two or more pages of a flash memory is determined. In general, this determination may be similar to the master page determination made at 902 of FIG.
[0039] At 1004, a last valid entry in a main page of the two or more pages may be determined. The last valid entry may be determined based on any of the data stored in the flash memory. For example, a counter, a digest, or an identifier field may be used to determine the last valid entry. At 1006, the data structure stored in the last valid entry may be output. Generally, the output may include the entire data structure or a portion of the data structure. However, generally, the data may be obtained from the flash storage by a read operation.
[0040] In general, the methods described above may be implemented in whole or in part by a flash reliability manager. In doing so, the methods and / or aspects described herein may provide trusted flash storage that may be used to improve data reliability for secure boot operations or other types of flash memory access.
[0041] Examples of reliable flash storage are provided below. Example 1: A method including storing data in one page of two or more pages in a flash memory, the storing including determining a primary page of the two or more pages of the flash memory, determining a first empty entry in the primary page, and storing a data structure in the first empty entry of the primary page.
[0042] Example 2: A method according to any one of the previous examples, wherein storing data in one page of two or more pages in the flash memory includes determining whether the main page is full after determining a primary page of the two or more pages of the flash memory, erasing another page of the two or more pages in response to determining that the primary page is full, storing the data structure in a first empty entry in the other page, and selecting the other page as the primary page.
[0043] The method may include, after determining a main page of the two or more pages of the flash memory, determining whether the main page is full, and, in response to determining that the main page is not full, storing the data structure in a first empty entry of the main page.
[0044] Example 3: A method according to any one of the previous examples, wherein storing the data structure in an initial empty entry in the main page includes setting one or more fields of the data structure containing a digest or identifier of the data structure to indicate the validity of the data structure, and setting the previous data entry to an invalid state by modifying a field of the data structure stored in the previous entry.
[0045] Example 4: The method of any one of the previous examples, wherein setting the previous entry to an invalid state includes changing an identifier field of a data structure stored in the previous entry to a zero value or other non-zero predetermined value configured to indicate the invalid state.
[0046] Example 5: The method of any one of the previous examples, wherein the data structure includes a counter field, and storing the data structure includes setting the counter field of the data structure as an incremental value from a value of the counter field of the other data structure stored in a previous entry, or, in response to a determination that no previous entry exists, setting the counter field of the data structure as a default value.
[0047] Example 6: The method of any one of the previous examples, wherein determining the primary page includes determining a first valid entry in a first page of the two or more pages of the flash memory; determining at least one second valid entry in at least one second page of the two or more pages of the flash memory; and determining the primary page of the flash memory based on a comparison of respective counter fields of the data structure stored in the first valid entry and the at least one data structure stored in the at least one second valid entry.
[0048] Example 7: A method according to any one of the previous examples, wherein each page of the two or more pages of the flash memory includes a respective status field used to store a status of each page, and determining a primary page within the two or more pages includes determining a first primary page as the primary page based on the respective status field of each of the two or more pages, determining whether the first primary page includes an empty entry, and in response to a determination that the first primary page does not include an empty entry, determining another page of the two or more pages, different from the first primary page, as the primary page.
[0049] Example 8: The method of any one of the previous examples, wherein the state field stores either a first value or a second value different from the first value.
[0050] Example 9: The method of any one of the previous examples, further comprising, in response to determining the other page as a primary page, modifying a status field of the other page to indicate the other page as a primary page of two or more pages of the flash memory.
[0051] Example 10: The method of any one of the previous examples, further comprising erasing the other page in response to determining the other page as the primary page and storing the data structure in a first empty entry in the primary page.
[0052] Example 11: The method of any one of the previous examples, further including reading data from a main page of the two or more pages of the flash memory, the reading including determining a last valid entry in the main page of the two or more pages, and outputting a representation of a data structure stored in the last valid entry in the main page.
[0053] Example 12: The method of any one of the previous examples, wherein storing the data in one of the two or more pages of the flash memory is performed as part of a secure boot process.
[0054] Example 13: The method of any one of the previous examples, wherein storing data in one of the two or more pages of the flash memory utilizes the page as an append-only page.
[0055] Example 14: A system comprising a flash memory including two or more pages and a flash reliability manager configured to perform the method of any one of the previous examples.
[0056] Example 15: An apparatus comprising at least one computer-readable storage medium storing processor-executable instructions that, when executed by at least one processor, direct the at least one processor to perform a method according to any one of the previous examples. The apparatus may further comprise a flash memory and the at least one processor.
[0057] Although aspects of the trusted flash storage have been described in feature and / or method specific language, the subject matter of the appended claims is not necessarily limited to the specific features or methods described. Rather, the specific features and methods are disclosed as example implementations of the claimed trusted flash storage, and other equivalent features and methods are intended to be within the scope of the appended claims. Moreover, various aspects have been described, and it should be understood that each described aspect can be implemented independently or in conjunction with one or more of the other described aspects.
[0058] Unless the context indicates otherwise, use of the word "or" herein may be construed as "inclusive or," or as use of a term permitting the inclusion or application of one or more items associated by the word "or" (e.g., the phrase "A or B" may be interpreted as permitting only "A," permitting only "B," or permitting both "A" and "B"). Also, as used herein, a phrase referring to "at least one" of a list of items refers to any combination of those items, including single members. For example, "at least one of a, b, or c" may cover not only a, b, c, ab, ac, bc, and abc, but also any combination with multiples of the same element (e.g., aa, aaa, aab, aac, abb, acc, bb, bbb, bbc, cc, and ccc, or any other order of a, b, and c). Additionally, items depicted in the accompanying figures and terms discussed herein may denote one or more items or terms, and thus, the written specification may refer to the items and terms in their singular or plural forms interchangeably. Although implementations of trusted flash storage have been described in language specific to particular features and / or methods, the subject matter of the appended claims is not necessarily limited to the particular features or methods described. Rather, the specific features and methods are disclosed as example implementations of trusted flash storage.
Claims
1. Storing data in one of two or more pages in a flash memory, said storing comprising: determining a primary page of the two or more pages of the flash memory; determining a first empty entry on the main page; storing a data structure in the first empty entry of the main page; The method includes:
2. Storing the data in the one page of the two or more pages in a flash memory includes: determining whether the main page is full after determining a main page of the two or more pages of the flash memory; responsive to determining that the main page is full, erasing other pages of the two or more pages; storing said data structure in a first empty entry in said other page; selecting said other page as said primary page; The method of claim 1 , comprising:
3. Storing the data structure in the first empty entry in the main page comprises: setting one or more fields of the data structure including a digest or an identifier of the data structure to indicate validity of the data structure; setting a previous data entry to an invalid state by modifying a field of a data structure stored in said previous entry; 2. The method of any one of the preceding claims, comprising:
4. Setting the previous entry to the invalid state comprises: changing an identifier field of the data structure stored in the previous entry to a zero value or other non-zero predetermined value configured to indicate the invalid state; The method of claim 3 , comprising:
5. the data structure includes a counter field; Storing the data structure includes: setting the counter field of the data structure as an incremental value from the value of the counter field of the other data structure stored in a previous entry; or responsive to determining that the previous entry does not exist, setting the counter field of the data structure to a default value; 2. The method of any one of the preceding claims, comprising:
6. Determining the primary page comprises: determining a first valid entry in a first page of the two or more pages of a flash memory; determining at least one second valid entry in at least one second page of the two or more pages of a flash memory; determining the main page of the flash memory based on a comparison of respective counter fields of a data structure stored in the first valid entry and at least one data structure stored in the at least one second valid entry; The method of claim 5 , comprising:
7. each of said two or more pages of the flash memory including a respective status field used to store a status of each page; Determining the primary page within the two or more pages includes: determining an initial primary page as the primary page based on the respective status fields of each of the two or more pages; determining whether the first main page contains an empty entry; determining, in response to determining that the first primary page does not include an empty entry, another page of the two or more pages different from the first primary page as the primary page; 2. The method of any one of the preceding claims, comprising:
8. The method of claim 7 , wherein the state field stores either a first value or a second value that is different from the first value.
9. 9. The method of claim 7 or claim 8, further comprising, in response to determining the other page as the primary page, modifying the status field of the other page to indicate the other page as the primary page of the two or more pages of the flash memory.
10. 10. The method of claim 9, further comprising erasing the other page in response to determining the other page as the primary page, and storing the data structure in the first empty entry in the primary page.
11. The method further includes reading data from the main page of the two or more pages of the flash memory, the reading comprising: determining a last valid entry in the primary page of the two or more pages; outputting a representation of the data structure stored in the last valid entry in the main page; 2. The method of any one of the preceding claims, comprising:
12. 2. The method of any one of the preceding claims, wherein storing the data in the one of the two or more pages of the flash memory is performed as part of a secure boot process.
13. 2. A method according to any one of the preceding claims, wherein storing the data in the one of the two or more pages of the flash memory utilizes the page as an append-only page.
14. a flash memory including two or more pages; a flash reliability manager operatively coupled to said flash memory and configured to perform the method of any one of claims 1 to 13; A system comprising:
15. A flash memory; At least one processor; at least one computer readable storage medium storing processor executable instructions that, when executed by said at least one processor, direct said at least one processor to perform a method according to any one of claims 1 to 13; An apparatus comprising:
Citation Information
Patent Citations
Non-volatile memory with block-erasable memory locations
JP2009521045A
Monotonic counters in memories
US20200202944A1
