Data processing device and method of operating a data processing device
By introducing a speculative execution tracking circuit in the data processing device to monitor and expel incorrect speculative execution entries, the vulnerability problem of the data processing device in speculative execution is solved, cache detection attacks are prevented, and the security of secret data is ensured.
Patent Information
- Application Number
- CN201980025052.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2018-04-17
- Filing Date
- 2019-03-21
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2039-03-21
AI Technical Summary
Data processing equipment is vulnerable during speculative execution. Malware can discover the address assigned by the cache through cache detection technology, thereby leaking secret data. Existing technologies are difficult to effectively prevent cache detection attacks.
A speculative execution tracking circuit is introduced to monitor the correctness of speculative execution and evict relevant entries in the cache structure when incorrect speculative execution occurs to ensure that the addresses allocated by the cache are not exploited by malware.
Effectively prevents cache detection attacks and ensures that secret data is not leaked. By quickly evicting incorrectly speculated entries, it reduces the possibility of cache detection technology obtaining secret data.
Smart Images

Figure CN111954870B_ABST
Abstract
Description
Technical Field
[0001] The present technology relates to the field of data processing. In particular, the present technology relates to speculative execution in a data processing device. Background Art
[0002] A data processing device that performs data processing operations in response to a sequence of instructions may speculatively execute at least some of those instructions. Speculative execution refers to the process of executing instructions outside a branch before the outcome of the branch is known with certainty. In the case where the data processing device is able to predict the outcome of a branch based on previous outcomes with sufficient accuracy, it is more efficient for the device to speculatively continue to execute instructions under the assumption that the predicted outcome of the branch will occur, thereby risking the risk that the occasional speculation will be incorrect and the speculatively executed instructions must be "undone". This presents a more efficient approach overall than waiting until the outcome of a branch is known before proceeding. Such a data processing device may also be provided with at least one cache to store temporary copies of data items that are the subject of its data processing operations. Summary of the invention
[0003] At least some examples provide a device comprising: a data processing circuit for performing a data processing operation in response to an instruction sequence, wherein the data processing circuit is capable of performing speculative execution of at least some instructions in the instruction sequence; a cache structure comprising entries, the cache structure being used to store temporary copies of data items subjected to the data processing operation; and a speculative execution tracking circuit for monitoring the correctness of the speculative execution and, in response to an indication of incorrect speculative execution, causing entries in the cache structure allocated by the incorrect speculative execution to be evicted from the cache structure.
[0004] At least some examples provide a method of operating a data processing device, the method comprising: performing a data processing operation in response to an instruction sequence, wherein performing the data processing operation comprises performing speculative execution of at least some instructions in the instruction sequence; storing a temporary copy of a data item subjected to the data processing operation in an entry of a cache structure; monitoring the correctness of the speculative execution; and in response to an indication of incorrect speculative execution, causing entries in the cache structure allocated by the incorrect speculative execution to be evicted from the cache structure.
[0005] At least some examples provide a device comprising: a device for performing a data processing operation in response to an instruction sequence, wherein performing the data processing operation includes performing speculative execution of at least some instructions in the instruction sequence; a device for storing a temporary copy of a data item subjected to the data processing operation in an entry of a cache structure; a device for monitoring the correctness of the speculative execution; and a device for causing entries in the cache structure allocated by the incorrect speculative execution to be evicted from the cache structure in response to an indication of incorrect speculative execution. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] The present technology will be further described, by way of example only, with reference to embodiments as illustrated in the accompanying drawings, in which:
[0007] Figure 1 schematically illustrates a data processing apparatus in an example embodiment;
[0008] Figure 2A schematically illustrates a data processing apparatus in an example embodiment;
[0009] Figure 2B schematically illustrates a data processing apparatus in an example embodiment;
[0010] Figure 3A shows information maintained by speculative execution tracking circuitry in one example embodiment;
[0011] Figure 3B shows information maintained in association with a cache line in a data cache in one example embodiment;
[0012] Figure 4A shows information maintained by speculative execution tracking circuitry in one example embodiment;
[0013] Figure 4B shows information maintained in association with a cache line in a data cache in one example embodiment;
[0014] Figure 5A and Figure 5B schematically illustrates a cache lookup procedure in a data cache in an example embodiment;
[0015] Figure 6 is a flow chart illustrating a process of allocating cache lines in a data cache in one example embodiment; and
[0016] Figure 7 is a flow chart illustrating how certain data cache entries are evicted in one example embodiment. Specific embodiments
[0017] At least some embodiments provide a device comprising: a data processing circuit for performing a data processing operation in response to an instruction sequence, wherein the data processing circuit is capable of performing speculative execution of at least some of the instructions in the instruction sequence; a cache structure comprising entries, the cache structure comprising entries being used to store temporary copies of data items undergoing the data processing operation; and a speculative execution tracking circuit for monitoring the correctness of the speculative execution and, in response to an indication of incorrect speculative execution, causing entries in the cache structure that were allocated by the incorrect speculative execution to be evicted from the cache structure.
[0018] Both caching and speculative instruction execution, which provide for storing temporary copies of data items, are established techniques for improving performance in the field of data processing. However, the present technology recognizes that, in combination, these two features of a data processing device can actually present a vulnerability, for example where malware seeks to direct speculative execution so as to cause a data cache allocation with an address that depends on some secret data (data that the malware should not be able to access). Cache probing techniques (side-channel attacks) may then be able to discover some of the address bits of the cache allocation, thereby rendering the secret data vulnerable. In view of this recognition, the present technology proposes that speculative execution tracking circuitry of the device monitors the speculative execution of instructions being executed, and when incorrect speculative execution is established, causes any entries in the data cache that were allocated as a result of (now known to be) incorrect speculative execution to be evicted from the cache. As a result, the cache probing techniques mentioned above are unable to determine information related to the secret data, because by the time such cache probing techniques are attempted, the speculative execution that caused the relevant entries in the cache to be allocated will have been determined to be incorrect, and therefore those entries have already been evicted from the cache.
[0019] The speculative execution tracking circuitry may take various forms, but in some embodiments the speculative execution tracking circuitry comprises an entry for each instruction speculatively executed by the data processing circuitry and for which the correctness of the speculative execution of the instruction has not yet been resolved, wherein each of said entries comprises an indication of whether the speculative execution of the instruction resulted in at least one entry being allocated in a cache structure. In other words therefore, where the device already includes a mechanism for monitoring speculative execution, this may be suitable for indicating whether the speculative execution of each instruction has resulted in an allocation in the cache. This may, for example, be in the form of a data structure that provides a sequence of entries corresponding to a sequence of instructions on the speculative path, and each of these instructions may be further annotated to indicate whether the instruction has resulted in an allocation in the cache. When incorrect speculative execution is established, this structure may then be referenced in order to cause those allocations in the cache to be evicted.
[0020] Generally the present technology proposes that in such a speculative execution tracking circuit, an entry corresponding to a speculatively executed instruction may indicate that the instruction has caused at least one entry to be allocated in the cache, but in some embodiments more details about the cache allocation may be indicated. Thus in some embodiments each of the entries includes an indication of at least one entry allocated in the cache structure as a result of speculative execution of the instruction. Thus one or more specific entries in the cache structure may be identified from the speculative execution tracking circuit entries, and accordingly, if the instruction is subsequently determined to have been incorrectly speculatively executed, then those specific entries may be caused to be evicted.
[0021] The eviction of certain entries in the cache structure may be performed in a variety of ways. In some embodiments, speculative execution tracking circuitry, in response to an indication of incorrect speculative execution, marks entries in the cache structure that were allocated by incorrect speculative execution as evicted from the cache structure. In other words, a first response of the device to an indication of incorrect speculative execution may be to mark certain entries in the cache structure for eviction and then actually perform the eviction. This approach recognizes that performing an eviction from the cache structure may take some time and may reliably provide a faster response to incorrect speculative execution by immediately marking those entries to indicate that they are to be evicted and therefore may have been handled differently beforehand.
[0022] While entries in the speculative execution tracking circuitry may correspond to individually speculatively executed instructions, in some embodiments, the speculative execution tracking circuitry includes entries that each correspond to at least one entry in the cache structure allocated as a result of speculative execution. Such correspondence between entries in the speculative execution tracking circuitry and entries in the cache structure allocated as a result of speculative execution facilitates identification of those entries in the cache so that their eviction can be managed if such speculative execution is established.
[0023] For example, in some embodiments the speculative execution tracking circuitry, in response to an indication of incorrect speculative execution, marks entries in the speculative execution tracking circuitry corresponding to at least one entry allocated in the cache structure as a result of the incorrect speculative execution as invalid. Thus, by marking those entries as invalid, reference to the speculative execution tracking circuitry information can quickly establish whether a given entry in the cache structure is about to be evicted (even if such an eviction has not yet been performed).
[0024] In some embodiments, each entry in the cache structure includes an indication of whether the entry was allocated as a result of speculative execution.
[0025] As mentioned above, there may be a gap between an indication of incorrect speculative execution (and the device's response of initiating the eviction of certain entries from the cache) and those evictions occurring. In this context, in some embodiments, the cache structure responds to a lookup in the cache structure received after an indication of incorrect speculative execution and before entries in the cache structure allocated through incorrect speculative execution have been evicted from the cache structure by generating a cache miss response to the lookup when the lookup corresponds to an entry in the cache structure allocated through incorrect speculative execution. In other words, the cache behaves as if the relevant entry is not there and responds with a cache miss. This can be achieved by marking entries in the speculative execution tracking circuitry to indicate that those cache structure entries are to be evicted, or by marking entries in the cache structure itself as pending eviction. As a result, even a cache lookup that very closely follows an indication of incorrect speculative execution may not be able to derive information about allocations made in the cache as a result of incorrect speculative execution.
[0026] In some embodiments, eviction of entries allocated in a cache as part of a speculative execution sequence is facilitated by ensuring that the allocated entries are "clean" with respect to the cache coherence protocol. This means that if an entry is to be evicted, this can happen more directly without first performing any cache coherence updates.
[0027] The speculative execution tracking circuitry may be provided in various configurations, and the speculative execution tracking circuitry may be associated with, or form part of, various components of the device. In some embodiments, the device further includes a load-store circuit to perform memory access operations and maintain an outstanding memory access instruction data structure, wherein the outstanding memory access instruction data structure includes an entry for each outstanding memory access instruction, and wherein the load-store circuitry includes the speculative execution tracking circuitry. Accordingly, where a load-store unit may be provided as part of the device to manage memory access and is arranged to track the memory access instructions it is processing, it is proposed that tracking of speculatively executed instructions may be performed as part of the load-store unit. For example, the data structure maintained by the load-store unit to track memory access instructions may be modified in accordance with the present technology to further track those instructions that have been speculatively executed and have caused cache line allocations.
[0028] In some example embodiments there is a method of operating a data processing device, the method comprising: performing a data processing operation in response to an instruction sequence, wherein performing the data processing operation includes performing speculative execution of at least some of the instructions in the instruction sequence; storing a temporary copy of a data item subject to the data processing operation in an entry of a cache structure; monitoring correctness of the speculative execution; and in response to an indication of incorrect speculative execution, causing the entry in the cache structure allocated by the incorrect speculative execution to be evicted from the cache structure.
[0029] In some example embodiments, there is an apparatus comprising: means for performing a data processing operation in response to an instruction sequence, wherein performing the data processing operation comprises performing speculative execution of at least some of the instructions in the instruction sequence; means for storing a temporary copy of a data item subject to the data processing operation in an entry of a cache structure; means for monitoring correctness of the speculative execution; and means for causing entries in the cache structure allocated by the incorrect speculative execution to be evicted from the cache structure in response to an indication of incorrect speculative execution.
[0030] Some specific embodiments are now described with reference to the figures.
[0031] Figure 1The apparatus 10 in one example embodiment is schematically illustrated. The apparatus comprises an execution circuit 12 which performs data processing operations defined by a sequence of instructions which the apparatus 10 is configured to fetch from a memory 14. Instructions are fetched from the memory 14 by a fetch circuit 16 which forms part of a series of pipeline stages, namely the fetch stage 16, the decode stage 18, the rename stage 20 and the emit stage 22. In order to avoid latency associated with fetching instructions from the memory 14, a cache hierarchy is provided comprising a level 1 (L1) instruction cache 24, a level 1 (L1) data cache 26 and a level 2 (L2) cache 28. Within the execution circuit 12 there are functional capabilities as shown, namely a branch resolution unit 30, an arithmetic logic unit 32, a floating point unit 34 and a load / store unit 36. Depending on the nature of the instruction received from the emit stage 22, it will be processed by an appropriate execution unit among those shown. It will be appreciated, of course, that for purposes of clarity only, the configuration of the execution circuit 12 is schematically illustrated at a high level of abstraction, and further details thereof that are not important to the present technology are not given here. However, a striking feature of the device 10 is that it is capable of performing speculative execution on instructions. Although in some cases, the extraction unit 16 will simply cause sequential instructions (sequential PC values) to be retrieved, the device 10 also includes a branch predictor 38, which provides the extraction unit 16 with a prediction of whether the branch defined by the encountered branch instruction will be taken. This prediction is performed based on previous behavior and is a technique familiar to those skilled in the art, and further details are therefore not described here for the sake of brevity. However, based on the predicted branch result, under the assumption that this branch prediction is correct, the extraction unit 16 is arranged to extract the corresponding instruction sequence from the memory. These instructions then pass through the pipeline stage and are executed by the relevant execution unit within the execution circuit 12. Thus, in the manner in which any instruction is executed, the data processing operations performed are performed on the values held in the register file 40 and may involve the retrieval of data from the memory 14 (possibly stored in the L2 cache 28 and / or the L1 data cache 26) by means of the load / store unit 36. In order to track the execution and results of such speculatively executed instructions, the execution circuitry 12 further includes a speculation tracking circuit 42 within which an indication of each speculatively executed instruction is stored. This enables the device to "roll back" the effects of the execution of the speculatively executed instruction when the branch resolution unit determines that the result of the branch is different from the predicted result (i.e., an incorrect speculative execution has been performed). Thus, the speculation tracking circuitry 42 receives a signal from the branch resolution unit 30. This signal is also received by the branch predictor 38, thereby informing it of the result of each resolved branch, enabling the branch predictor 38 to continuously update the branch history it maintains. In response to the indication of incorrect speculative execution, the speculation tracking unit 42 sends a flush signal to various parts of the device including the register file 40 and the rename unit 20.For the purpose of enabling the unwinding of speculatively executed instructions, register file 40 maintains a checkpoint snapshot of any registers that may have to be modified. Thus, in response to a flush signal, the rename unit modifies the rename map it maintains to point to the set of registers in register file 40 that represent the checkpoint snapshot. Additionally, and in accordance with the present technique, speculation tracking circuitry 42 also interacts with control circuitry 44 of data cache 26. In particular, in response to receiving a signal from branch resolution unit 30 indicating that a certain set of instructions has been incorrectly speculatively executed, such communication enables speculation tracking unit 42 to cause entries in data cache 26 that were allocated as a result of incorrectly speculative instruction execution to be evicted from the cache. Further details and variations of how this is addressed are described below with reference to the following figures.
[0032] Figure 2A Some components of a device in an example embodiment are schematically illustrated. In general, Figure 2A The embodiment of the present invention comprises an execution pipeline 50, a speculation tracking circuit 52 and a data cache 54. The execution pipeline 50 performs data processing operations on data values, some of which are cached in the data cache 54. In the case where the execution pipeline is arranged to perform speculative instruction execution, the speculation tracking circuit 52 interacts with the execution pipeline 50 to monitor speculative execution, and in particular the speculation tracking circuit 52 maintains in the form of a table the number of execution values of the execution pipeline 50 and the number of execution values of the execution pipeline 50. Figure 2A 5 , which indicates a current set of instructions that are known to have been speculatively executed but it is not yet clear whether the speculative execution was correct. Once the speculation tracking circuitry 52 receives an indication from the execution pipeline 50 that one or more speculatively executed instructions were correctly executed, the corresponding entry in the data structure 56 is removed. Further, the data structure 56 includes an indication associated with each speculatively executed instruction to indicate whether the instruction caused an entry to be allocated in the data cache 54. For this purpose, the speculation tracking circuitry 52 receives an allocation indication from the data cache 54, and when the cache line allocation indication corresponds to a speculatively executed instruction (i.e., was caused by speculative execution of that instruction), the corresponding entry in the data structure 56 is marked to indicate this. When the speculation tracking circuitry 52 receives an indication of incorrect speculative execution from the execution pipeline, this is received by the data cache eviction control circuitry 58, which references the data structure 56 and signals to the data cache 54 that cache lines allocated for those instructions that are now known to have been incorrectly speculatively executed and for which the cache line allocation flag is set should be evicted from the data cache.
[0033] Figure 2B Some components of a device in an example embodiment are schematically illustrated. In general, Figure 2BThe loader / store unit 60 includes an execution unit 60, a load / store circuit 62, and a data cache 64. The execution unit 60 performs data processing operations in response to instructions other than memory access instructions, whereas the load / store unit 62 performs memory access operations in response to memory access instructions. Performing these memory access operations includes accessing the data cache 64. In addition, accessing the data cache 64 when a cache miss occurs causes a cache line to be allocated for the requested data. The load / store unit includes a data structure 66 that it uses to keep track of the memory access instruction it is currently processing. Figure 2B As shown in , this data structure also allows an indication to be stored in association with each entry of each memory access instruction to indicate whether this access caused a cache allocation (note that these indications are only maintained for speculatively executed instructions). When a speculatively executed instruction has caused a cache line allocation, the load / store unit 62 receives an allocation indication from the data cache 64. The corresponding entry in the data structure 66 is then marked to indicate this. If the load / store unit 62 receives an indication from the execution unit 60 that one or more speculatively executed instructions have been incorrectly executed, then the corresponding entry received by the data cache control circuit 68 should be evicted from the data cache, which references the data structure 66 and signals to the data cache 64 certain cache lines that were allocated for those instructions that are now known to have been incorrectly speculatively executed and for which the cache line allocation tag is set.
[0034] Figure 3A An example of a data structure maintained by a speculative tracking circuit is shown. As shown in the figure, each entry includes validity information, speculation information, and an indication of index and mode information. The validity information here serves the purpose of indicating a cache allocation indication, i.e., the indicated index and mode information identifies the cache line that was actually allocated as a result of speculative instruction execution. The speculation information may include further information related to one or more instructions that were speculatively executed. Therefore, reference to this data structure can identify whether a cache line is allocated for a given speculatively executed instruction or set of speculatively executed instructions.
[0035] Figure 3B An example data cache is shown in which cache entries, i.e. cache lines, are stored in association with further information indicating the cache coherence (MESI) state of the cache line and an indication of whether this cache line is to be evicted. Figure 3BIn the example of providing a cache coherence state in association with a cache line recognizing that this data cache may form part of a system of caches, each cache may potentially store a copy of the same data item retrieved from memory and therefore this data cache is arranged to participate in a cache coherence protocol defined for this system to ensure coherence between those potentially multiple copies of the data item in the system. As part of this, in this example, the data cache is arranged to store in association with each cache line an indication showing its state relative to the protocol, where here this is one of the state set "MESI", namely modified, exclusive, shared and invalid. In one example according to the present technology, a data cache is arranged to ensure that any cache line allocated as a result of speculative instruction execution is stored in a "clean" state, i.e., wherein the necessary mechanisms of the cache coherence protocol are immediately invoked upon allocation of this cache line to ensure that the cache line is then maintained in this "clean" state, so that if a subsequent indication of incorrect speculative execution is received and this cache line should be evicted, there is no delay associated with the need to write the modified contents of this cache line back to memory, or further interact with other data caches via the cache coherence protocol, and eviction of the cache line can be effectively accomplished simply by marking it as invalid, so that this cache line can be selected in place for new allocation at the next opportunity. The eviction indication ("Evict?") stored in association with the cache line enables the data cache to quickly mark each relevant cache line as "to be evicted" upon receipt of a corresponding eviction signal from the speculative tracking circuitry.
[0036] The specific distribution of information between the speculative tracking circuitry and the data cache need not be exactly as Figure 3A and Figure 3B As shown in the example, and Figure 4A and Figure 4B Other example embodiments are contemplated. Figure 4A The data structure maintained by the speculation tracking circuit in includes entries with validity information, speculation information, cache entry indication information, and eviction indication. Accordingly, (for comparison with reference Figure 3A )It should be noted that this data structure is Figure 3A In the example of has "cache entry" information in place of the index and mode information, and further includes an eviction indication. The details of the cache entry information stored are not important, as long as it enables identification of the specific cache line allocated as a result of speculative instruction execution. Maintaining the eviction indication in the data structure further means that this entry can be referenced when access to the cache is required, and the indication of eviction intent marked in association with the entry in this data structure can be used to modify the response of the data cache to the cache lookup, as described below with reference to Figure 5B as described.
[0037] Figure 4BAn example configuration of a data cache is shown in which, in addition to the usual cache line information (i.e., the data itself) and its associated MESI state information, an indication that a cache line was allocated as a result of speculative instruction execution may be stored. This facilitates identification of data cache contents allocated as a result of speculative instruction execution and the response of the data cache to eviction signals. For example, the response of the data cache to an eviction signal received from the speculation tracking circuitry may be to evict all entries in the cache that were allocated as a result of speculative instruction execution, regardless of whether it is explicitly known whether those cache lines marked as speculative were allocated as a result of an instruction set that is now known to have been incorrectly speculatively executed. This represents a performance choice, as doing so may result in more entries in the cache being evicted than are strictly necessary in response to incorrect speculative instruction execution, but the simplicity of doing so and the ensured safety of evicting all such entries may be preferable in some implementations.
[0038] Figure 5A and Figure 5B Involves cache lookups in the data cache. Figure 5A Such a configuration is schematically illustrated in which entries in a data cache are marked as "pending eviction" such that when a cache lookup is performed, although the corresponding entry is identified, this results in a cache miss due to the eviction tag. Figure 5B A variation is schematically illustrated in which the cache lookup references not only the data cache itself, but also the speculative tracking data structure. Thus, when the cache lookup process finds a corresponding entry in the speculative tracking data structure that is marked as "to be evicted", then although the cache lookup process finds a valid entry that would otherwise generate a cache hit in the data cache, the match of the entry in the speculative tracking data structure causes (by providing logic 70) a cache miss signal.
[0039] Figure 6 and Figure 7 is a flow chart illustrating the steps of an example method. In particular, Figure 6 involves a process by which a data cache line may be allocated in a data cache as a result of speculative instruction execution, and Figure 7 The diagram illustrates the process by which data cache entries allocated through speculative execution may be evicted. It is therefore important to note that the two processes described are by no means mutually exclusive and in fact both processes may be considered to be ongoing simultaneously with new allocations being made and other already existing entries being evicted. Figure 6Beginning at step 70, execution of the next issued instruction in the execution unit of the device begins at step 70. Then at step 72, it is determined whether the execution of the instruction has triggered a data cache line allocation. If not, the process returns to step 70 for execution of the next issued instruction. However, if it is determined at step 72 that such a data cache line allocation has occurred, then at step 74 it is determined whether the instruction execution is speculative. If not, the process returns to step 70. However, if it is, then at step 76, the allocated data cache line is recorded as speculative. It should be appreciated with reference to the examples of the previous figures that such "recording" can be performed in some examples by marking the data cache line itself as speculative, while in other examples, the speculative nature is recorded by means of an entry in a data structure maintained by a speculation tracking unit. The process then returns to step 70.
[0040] It can be considered Figure 7 Beginning at step 80, it is determined whether an incorrect speculative execution has been signaled. If not, the process loops back on itself at this step. When such an incorrect speculative execution has been signaled, the process proceeds to step 82, where it is determined whether there are data entries allocated by speculative execution. If not, the process returns to step 80. If so, the process proceeds to step 84, where the eviction of the speculatively allocated data cache entries is initiated. It should be appreciated with reference to the examples of the previous figures that this may include evicting all data cache entries allocated as a result of speculative instruction execution, or may include identifying those specific data cache entries that were allocated as a result of a specific instruction (or instructions) that are now known to have been incorrectly speculatively executed.
[0041] In general, an apparatus and method of operating a data processing apparatus are disclosed. The apparatus includes data processing circuitry for performing data processing operations in response to a sequence of instructions, wherein the data processing circuitry is capable of performing speculative execution of at least some of the instructions in the sequence of instructions. A cache structure including entries stores temporary copies of data items subject to the data processing operations, and speculative execution tracking circuitry monitors the correctness of the speculative execution and causes entries in the cache structure allocated by the incorrect speculative execution to be evicted from the cache structure in response to an indication of incorrect speculative execution.
[0042] In this application, the words "configured to..." are used to mean that elements of a device have a configuration that enables the performance of a defined operation. In this context, "configuration" refers to the arrangement or manner of interconnection of hardware or software. For example, a device may have dedicated hardware that provides the defined operation, or a processor or other processing device may be programmed to perform the function. "Configured to" does not imply that the device elements need to be changed in any way to provide the defined operation.
[0043] Although illustrative embodiments have been described in detail herein with reference to the accompanying drawings, it will be appreciated that the invention is not limited to those precise embodiments and that various changes, additions and modifications may be effected therein by those skilled in the art without departing from the scope of the invention as defined by the appended claims. For example, various combinations of features of the dependent claims may be made with features of the independent claim without departing from the scope of the invention.
Claims
1. A data processing device, comprising: data processing circuitry for performing data processing operations in response to a sequence of instructions, wherein the data processing circuitry is capable of performing speculative execution of at least some instructions in the sequence of instructions; a cache structure comprising entries for storing temporary copies of data items subject to the data processing operation; and speculative execution tracking circuitry to monitor correctness of the speculative execution and, in response to an indication of incorrect speculative execution, cause entries in the cache structure allocated by the incorrect speculative execution to be evicted from the cache structure, wherein the speculative execution tracking circuitry comprises an entry for each instruction speculatively executed by the data processing circuitry, and wherein the correctness of the speculative execution of the instruction has not yet been resolved for the entry, Each of the entries includes an indication of whether speculative execution of the instruction resulted in allocation of at least one entry in the cache structure.
2. The device according to claim 1, wherein Each of the entries includes an indication of the at least one entry in the cache structure that was allocated as a result of speculative execution of the instruction.
3. The device according to claim 1, wherein The speculative execution tracking circuitry is responsive to the indication of the incorrect speculative execution to mark an entry in the cache structure allocated by the incorrect speculative execution as evicted from the cache structure.
4. The device according to claim 1, wherein The speculative execution tracking circuitry includes entries each corresponding to at least one entry in the cache structure allocated as a result of speculative execution.
5. The device according to any one of claims 1 to 4, wherein The speculative execution tracking circuitry is responsive to the indication of incorrect speculative execution to mark an entry in the speculative execution tracking circuitry corresponding to at least one entry in the cache structure allocated by the incorrect speculative execution as invalid.
6. The device according to any one of claims 1 to 4, wherein: Each entry in the cache structure includes an indication of whether the entry was allocated as a result of speculative execution.
7. The device according to any one of claims 1 to 4, wherein: The cache structure, in response to a lookup in the cache structure received after the indication of the incorrect speculative execution and before the entry in the cache structure allocated by the incorrect speculative execution has been evicted from the cache structure, generates a cache miss response for the lookup when the lookup corresponds to an entry in the cache structure allocated by the incorrect speculative execution.
8. The apparatus according to any one of claims 1 to 4, wherein: The cache structure is arranged such that entries in the cache structure allocated by speculative execution are stored in a clean state with respect to a cache coherence protocol.
9. The apparatus of any one of claims 1 to 4, further comprising a load-store circuit configured to perform memory access operations and maintain an outstanding memory access instruction data structure, wherein The outstanding memory access instruction data structure includes an entry for each outstanding memory access instruction, And wherein the load-store circuitry includes the speculative execution tracing circuitry.
10. A method of operating a data processing device, the method comprising: performing a data processing operation in response to a sequence of instructions, wherein performing the data processing operation comprises performing speculative execution of at least some instructions in the sequence of instructions; storing a temporary copy of the data item subject to the data processing operation in an entry of a cache structure; monitoring the correctness of the speculative execution via speculative execution tracing circuitry; and In response to an indication of incorrect speculative execution, the speculative execution tracking circuitry causes entries in the cache structure allocated by the incorrect speculative execution to be evicted from the cache structure, storing, by the speculative execution tracking circuitry, an entry for each instruction that was speculatively executed and for which the correctness of the speculative execution of the instruction has not yet been resolved, Wherein each of the entries for each speculatively executed instruction includes an indication of whether speculative execution of the instruction resulted in allocation of at least one entry in the cache structure.
11. A data processing device, comprising: means for performing a data processing operation in response to a sequence of instructions, wherein performing the data processing operation comprises performing speculative execution of at least some instructions in the sequence of instructions; means for storing a temporary copy of the data item subject to said data processing operation in an entry of a cache structure; means for monitoring the correctness of said speculative execution; and means for causing entries in the cache structure allocated by the incorrect speculative execution to be evicted from the cache structure in response to an indication of incorrect speculative execution, wherein the means for monitoring includes an entry for each instruction speculatively executed by the means for executing, and wherein the correctness of the speculative execution of the instruction has not yet been resolved for the entry, wherein each said entry for each speculatively executed instruction comprises an indication of whether speculative execution of said instruction resulted in allocation of at least one entry in said means for storing.
Citation Information
Patent Citations
System for ordering load and store instructions that performs out-of-order multithread execution
CN1285064A
Out-of-pipeline trace buffer for instruction replay following misspeculation
CN1286771A
Apparatus, method, and system for instantaneous cache state recovery from speculative abort / commit
US20120144126A1
Redundant Transactional Memory
US20130019083A1
Allocating processor resources during speculative execution using a temporal ordering policy
US7774531B1
