HK40058957B - Secure predictors for speculative execution - Google Patents
Secure predictors for speculative executionInfo
- Publication number
- HK40058957B HK40058957B HK62022047552.4A HK62022047552A HK40058957B HK 40058957 B HK40058957 B HK 40058957B HK 62022047552 A HK62022047552 A HK 62022047552A HK 40058957 B HK40058957 B HK 40058957B
- Authority
- HK
- Hong Kong
- Prior art keywords
- predictor
- mode
- circuit
- reset
- subset
- Prior art date
Links
Description
技术领域Technical Field
本公开涉及用于推测执行的安全预测器。This disclosure relates to a secure predictor for speculative execution.
背景技术Background Technology
已经公开了依赖处理器分支预测和推测执行的边信道攻击。对于Intel x86处理器,这些攻击中的第一个最初被标记为Spectre,这些攻击的其他变体或类别也存在。简而言之,这些攻击依赖于训练分支预测器来执行攻击者选择的代码,以便在进程/上下文和/或权限级别改变后将目标的秘密数据加载到缓存存储器中。攻击者使用的目标代码可能是来自目标进程或共享库中的代码,因此目标进程执行该代码是合法的。在攻击者进程重新获得对处理器的控制后,攻击者可以测量从缓存中的同一位置读取数据所需的时间,从而确定缓存中存在哪些目标数据,并且因此确定目标进程中数据的价值。减少这些攻击对于安全且可靠的计算非常重要。Side-channel attacks relying on processor branch prediction and speculative execution have been publicly disclosed. For Intel x86 processors, the first of these attacks was initially labeled Spectre, but other variations or categories of these attacks also exist. In short, these attacks rely on training a branch predictor to execute attacker-selected code to load secret data of the target into cache memory after a change in process/context and/or privilege level. The target code used by the attacker may originate from the target process or a shared library, making its execution legitimate for the target process. After the attacker process regains control of the processor, the attacker can measure the time required to read data from the same location in the cache, thus determining what target data is present in the cache and, consequently, the value of the data in the target process. Mitigating these attacks is crucial for secure and reliable computing.
附图说明Attached Figure Description
当结合附图阅读时,从以下详细描述可以最好地理解本公开。需要强调的是,按照惯例,附图的各种特征并非按比例。相反,为了清楚,各种特征的尺寸被任意扩大或缩小。This disclosure can be best understood from the following detailed description when read in conjunction with the accompanying drawings. It should be emphasized that, by convention, the various features in the drawings are not to scale. Rather, for clarity, the dimensions of the various features have been arbitrarily enlarged or reduced.
图1是用于执行具有安全预测的指令的集成电路的示例的框图。Figure 1 is a block diagram of an example of an integrated circuit for executing instructions with security prediction.
图2是用于安全预测的预测器电路的示例的框图。Figure 2 is a block diagram of an example predictor circuit for secure prediction.
图3是用于执行具有安全预测的指令的系统的示例的框图。Figure 3 is a block diagram of an example of a system for executing instructions with safety prediction.
图4是用于执行具有安全预测的指令的技术的示例的流程图。Figure 4 is a flowchart of an example of a technique for executing instructions with security prediction.
图5是用于在预测器的重置操作期间,基于预测器条目集合的子集来执行具有预测的指令的技术的示例的流程图。Figure 5 is a flowchart illustrating an example of a technique for executing instructions with predictions based on a subset of the predictor entry set during a predictor reset operation.
具体实施方式Detailed Implementation
概述Overview
本文公开了用于推测执行的安全预测器的实施方式。一些实施方式可以被用来比先前已知的解决方案更有效地消除或减少对处理器(例如,诸如x86、ARM和/或RISC-V CPU的CPU)的边信道攻击(例如,Spectre-类攻击)的可能性。This document discloses implementations of a security predictor for speculative execution. Some implementations can be used to eliminate or reduce the likelihood of side-channel attacks (e.g., Spectre-class attacks) on processors (e.g., CPUs such as x86, ARM, and/or RISC-V CPUs) more effectively than previously known solutions.
公开了用于安全预测的系统和方法。集成电路(例如,处理器或微控制器)可以被配置为解码和执行指令集架构(ISA)(例如,RISC V指令集)中的指令。集成电路可以实现流水线架构。集成电路可以包括预测器电路(例如,分支预测器),其用于通过减少流水线架构中执行指令的延迟来提高性能。预测器电路访问被放置在条目中的预测数据,这些预测数据可以被用来确定用于相应指令的预测。Systems and methods for secure prediction are disclosed. Integrated circuits (e.g., processors or microcontrollers) can be configured to decode and execute instructions in an instruction set architecture (ISA) (e.g., RISC V instruction set). The integrated circuits can implement pipelined architectures. The integrated circuits may include predictor circuitry (e.g., branch predictors) for improving performance by reducing latency in instruction execution within the pipelined architecture. The predictor circuitry accesses prediction data placed in entries, which can be used to determine the prediction for the corresponding instruction.
集成电路可以被配置为检测针对正在由集成电路执行的软件,何时发生安全域转换。例如,可以基于隐含或明确地解码与安全域转换相关联的指令来检测安全域转换。例如,可以使用用于指示在软件中的安全域边界的特殊指令,或者可以将现有指令解释为使安全域转换。在一些实施方式中,可以基于接收中断信号来检测安全域转换。Integrated circuits can be configured to detect when a security domain transition occurs for software being executed by the integrated circuit. For example, a security domain transition can be detected based on implicitly or explicitly decoding instructions associated with it. For instance, special instructions used to indicate security domain boundaries in the software can be used, or existing instructions can be interpreted to cause a security domain transition. In some implementations, a security domain transition can be detected based on receiving an interrupt signal.
当检测到安全域转换时,可以重置预测器的状态,包括预测器条目集合,以防止处于该状态的数据在安全域之间传递信息。由于预测器的状态可能很大并且重置整个状态可能需要多个时钟周期来完成,因此预测器可以被配置为在一种或多种受限模式下操作,以防止预测器在对重置操作指定的时间间隔期间,使用被标记为重置的预测器条目来生成预测。例如,在受限模式中,在重置的时间间隔期间,可以禁止预测器电路生成预测以促进推测执行。例如,在受限模式中,预测器电路可以被配置为在重置的时间间隔期间生成不依赖于预测器条目的静态预测。在一些实施方式中,预测器电路可以包括混合预测器,该混合预测器可以基于其预测器状态的子集来生成预测。例如,在受限模式中,预测器电路可以被配置为基于预测器条目的子集生成预测,而预测器条目中的不相交子集在被重置时不可使用。在一些实施方式中,重置操作的时间间隔的持续时间是固定的,这可以提供诸如防止经由时序变化泄漏信息和/或防止抖动(例如,对于实时应用)的益处。When a security domain transition is detected, the predictor's state, including the set of predictor entries, can be reset to prevent data in that state from passing information between security domains. Since the predictor's state can be large and resetting the entire state may take multiple clock cycles, the predictor can be configured to operate in one or more constrained modes to prevent the predictor from generating predictions using predictor entries marked for reset during a time interval specified for the reset operation. For example, in constrained mode, predictor circuitry can be prohibited from generating predictions to facilitate speculative execution during the reset time interval. For example, in constrained mode, predictor circuitry can be configured to generate static predictions independent of predictor entries during the reset time interval. In some implementations, predictor circuitry can include a hybrid predictor that can generate predictions based on a subset of its predictor states. For example, in constrained mode, predictor circuitry can be configured to generate predictions based on a subset of predictor entries, where disjoint subsets of predictor entries are unavailable when reset. In some implementations, the duration of the reset operation time interval is fixed, which can provide benefits such as preventing information leakage via timing variations and/or preventing jitter (e.g., for real-time applications).
如本文所用,术语“电路”指被构造为实现一个或多个功能的电子组件(例如,晶体管、电阻器、电容器和/或电感器)的布置。例如,电路可以包括互连以形成共同实现逻辑功能的逻辑门的一个或多个晶体管。As used herein, the term "circuit" refers to an arrangement of electronic components (e.g., transistors, resistors, capacitors, and/or inductors) configured to perform one or more functions. For example, a circuit may include one or more transistors interconnected to form logic gates that collectively perform a logic function.
如本文所用,术语“微体系结构状态”指集成电路(例如,处理器或微控制器)的状态(例如,数据位)的一部分,其不能由集成电路执行的软件直接访问。例如,微体系结构状态可以包括存储在缓存中的数据和/或由控制流预测器存储的用于对控制流执行进行预测的数据。As used herein, the term "microarchitectural state" refers to a portion of the state (e.g., data bits) of an integrated circuit (e.g., a processor or microcontroller) that cannot be directly accessed by the software executing the integrated circuit. For example, microarchitectural state may include data stored in a cache and/or data stored by a control flow predictor for predicting control flow execution.
详情Details
图1是用于执行具有安全预测的指令的集成电路110的示例的框图。例如,集成电路110可以是处理器、微处理器、微控制器或IP核。集成电路110包括预测器电路120和安全域转换检测电路130。例如,预测器电路120可以包括值预测器、存储器依赖预测器、预取预测器、控制流预测器、分支预测器、分支历史表、分支目标缓冲器和/或返回地址堆栈预测器。例如,预测器电路120可以被配置为当在第一模式(例如,标准或正常模式)下操作时,使用存储在从预测器条目集合中的任何中选择的一个或多个条目中的数据来生成用于指令的推测执行的预测。例如,安全域转换检测电路130可以检测集成电路110(例如,处理器)何时进行到不同进程的上下文切换,或从用户进程切换到操作系统(内核模式),或从操作系统切换到虚拟机管理程序(管理程序模式)。在一些实施方式中,安全域转换检测电路130可以基于指令的解码来检测转换,该指令明确或隐含地与安全域的转换相关联。在一些实施方式中,安全域转换检测电路130可以基于接收中断信号来检测转换。预测器电路120包括预测器重置电路140,其被配置为当安全域转换检测电路130检测到安全域转换事件时,重置预测器电路120的状态。例如,预测器条目集合可能全部或部分存储在SRAM中,并且可能需要多个时钟周期来完全重置。当正在执行重置操作时,预测器电路120可以被配置为避免使用被调度以重置的预测器状态中一些或全部(例如,预测器条目的子集)。例如,在用于执行重置的时间间隔期间,预测器电路120可以完全禁止预测、生成不依赖于任何预测器条目的静态预测,或者基于预测器条目集合中的已经被重置的子集(例如,存储在触发器中并且可以在检测到安全域转换时立即重置的条目的子集)来生成预测。例如,预测器电路120可以包括可以使用其预测器条目的子集生成预测的混合预测器。在一些实施方式中,可以在固定持续时间的时间间隔期间执行重置操作,这可以防止以重置延迟的形式泄露信息并防止抖动源(例如,以提高实时应用的性能)。例如,预测器电路120可以被实现为图2的预测器电路210。例如,集成电路110可以被用来实现图4的技术400。Figure 1 is a block diagram of an example of an integrated circuit 110 for executing instructions with security prediction. For example, the integrated circuit 110 may be a processor, microprocessor, microcontroller, or IP core. The integrated circuit 110 includes predictor circuitry 120 and security domain transition detection circuitry 130. For example, predictor circuitry 120 may include a value predictor, memory dependency predictor, prefetch predictor, control flow predictor, branch predictor, branch history table, branch destination buffer, and/or return address stack predictor. For example, predictor circuitry 120 may be configured to generate a prediction for speculative execution of instructions using data stored in one or more entries selected from any of the predictor entry sets when operating in a first mode (e.g., standard or normal mode). For example, security domain transition detection circuitry 130 may detect when the integrated circuit 110 (e.g., the processor) performs a context switch to a different process, or a switch from a user process to the operating system (kernel mode), or a switch from the operating system to the hypervisor (hypervisor mode). In some embodiments, security domain transition detection circuitry 130 may detect transitions based on the decoding of instructions that are explicitly or implicitly associated with a security domain transition. In some implementations, the security domain transition detection circuit 130 may detect a transition based on a received interrupt signal. The predictor circuit 120 includes a predictor reset circuit 140 configured to reset the state of the predictor circuit 120 when the security domain transition detection circuit 130 detects a security domain transition event. For example, the set of predictor entries may be stored entirely or partially in SRAM and may require multiple clock cycles to fully reset. While performing a reset operation, the predictor circuit 120 may be configured to avoid using some or all of the predictor states scheduled for reset (e.g., a subset of predictor entries). For example, during the time interval used to perform the reset, the predictor circuit 120 may completely disable prediction, generate static predictions independent of any predictor entries, or generate predictions based on a subset of the predictor entry set that has already been reset (e.g., a subset of entries stored in triggers and that can be immediately reset upon detection of a security domain transition). For example, the predictor circuit 120 may include a hybrid predictor that can generate predictions using a subset of its predictor entries. In some implementations, a reset operation can be performed during a fixed-duration time interval, which can prevent information leakage in the form of a reset delay and prevent jitter sources (e.g., to improve the performance of real-time applications). For example, predictor circuit 120 can be implemented as predictor circuit 210 of FIG2. For example, integrated circuit 110 can be used to implement technique 400 of FIG4.
例如,集成电路110可以被配置为使用安全域转换检测电路130,针对由集成电路110正在执行的软件,检测安全域转换,并且响应于安全域转换,将预测器电路的模式120从第一模式改变为第二模式,并且通过向预测器重置电路140输入重置信号来调用该预测器条目集合的重置。第二模式可以防止预测器电路120使用预测器条目集合中的预测器条目的至少第一子集以生成预测。集成电路110可以被配置为在完成预测器状态重置之后,将预测器电路的模式改变为第一模式以恢复正常预测。在一些实施方式中,集成电路110可以被配置为响应于重置的部分完成,将预测器电路120的模式改变为第三模式,该第三模式使得预测器电路120能够使用预测器条目集合中的已经被重置的第二子集,同时防止使用预测器条目集合中的尚未被重置的第三子集。第二子集和第三子集可以是非空并且是第一子集的不相交的子集。集成电路110可以被配置为在重置完成之前,基于第二子集中的预测器条目来生成预测。在一些实施方式中,在第二模式下操作防止预测器电路120生成预测。在一些实施方式中,在第二模式下操作防止预测器电路120使用预测器条目集合中的所有并且使预测器电路120生成静态预测。在一些实施方式中,在第二模式下操作使预测器电路120基于预测器条目集合中的与预测器条目的第一子集不相交的第二子集中的预测器条目来生成预测。例如,预测器电路120当在第一模式下操作时,可以基于根据预测器条目集合的第二子集确定的预测与根据预测器条目集合中的与第二集合不相交的一个或多个相应的附加子集确定的一个或多个预测的组合来生成预测。在一些实施方式中,安全域转换检测电路130被配置为基于对与安全域转换相关联的指令进行解码来检测安全域转换。在一些实施方式中,安全域转换检测电路130被配置为基于接收中断信号来检测安全域转换。在一些实施方式中,在调用重置和将预测器电路的模式改变为第一模式之间的时间间隔具有固定的持续时间,这可以防止经由重置操作的定时泄露信息和/或减少或消除抖动。For example, integrated circuit 110 can be configured to use security domain transition detection circuit 130 to detect security domain transitions for the software being executed by integrated circuit 110, and in response to the security domain transition, change the mode 120 of the predictor circuit from a first mode to a second mode, and invoke a reset of the predictor entry set by inputting a reset signal to predictor reset circuit 140. The second mode can prevent predictor circuit 120 from using at least a first subset of predictor entries in the predictor entry set to generate predictions. Integrated circuit 110 can be configured to change the mode of the predictor circuit back to the first mode to resume normal prediction after the predictor state reset is completed. In some embodiments, integrated circuit 110 can be configured to change the mode of predictor circuit 120 to a third mode in response to partial completion of the reset, which allows predictor circuit 120 to use the second subset of the predictor entry set that has been reset, while preventing the use of a third subset of the predictor entry set that has not yet been reset. The second and third subsets can be non-empty and disjoint subsets of the first subset. Integrated circuit 110 can be configured to generate a prediction based on predictor entries in a second subset before a reset is complete. In some embodiments, operation in the second mode prevents predictor circuit 120 from generating a prediction. In some embodiments, operation in the second mode prevents predictor circuit 120 from using all predictor entries in the predictor entry set and causes predictor circuit 120 to generate a static prediction. In some embodiments, operation in the second mode causes predictor circuit 120 to generate a prediction based on predictor entries in a second subset of the predictor entry set that do not intersect with the first subset of predictor entries. For example, when operating in the first mode, predictor circuit 120 may generate a prediction based on a prediction determined according to the second subset of the predictor entry set and a combination of one or more predictions determined according to one or more corresponding additional subsets of the predictor entry set that do not intersect with the second set. In some embodiments, security domain transition detection circuit 130 is configured to detect a security domain transition based on decoding instructions associated with the security domain transition. In some embodiments, security domain transition detection circuit 130 is configured to detect a security domain transition based on receiving an interrupt signal. In some implementations, the time interval between invoking a reset and changing the predictor circuitry to the first mode has a fixed duration, which can prevent timing information leakage via the reset operation and/or reduce or eliminate jitter.
图2是用于安全预测的预测器电路210的示例的框图。预测电路210包括预测确定电路230;具有预测器条目的预测数据表240;预测更新电路250和预测器重置电路252。例如,预测确定电路230可以被配置为基于对应于指令的预测数据表240的条目中的数据来确定用于指令的预测260(例如,分支预测或值预测)。然而,当已经检测到安全域转换时,可以将预测器重置信号输入到预测器电路210以使得预测器重置电路252执行存储在预测数据表240中的预测器条目的重置,以及预测模式选择信号可以被输入到预测器电路210以修改预测确定电路生成预测260的方式。例如,改变预测器电路210的模式可以使预测260生成为不依赖于预测数据表240中的预测器条目的静态预测或阻止生成预测260。例如,改变预测器电路210的模式可以使得通过仅访问在重置操作的早期阶段已经被重置的预测数据表240中的预测器条目(例如,存储在触发器中的条目)的子集来生成预测260。例如,预测器电路210可以用在实现图4的技术400中。Figure 2 is a block diagram of an example predictor circuit 210 for security prediction. Prediction circuit 210 includes prediction determination circuit 230; prediction data table 240 with predictor entries; prediction update circuit 250; and predictor reset circuit 252. For example, prediction determination circuit 230 can be configured to determine a prediction 260 (e.g., branch prediction or value prediction) for an instruction based on data in entries of prediction data table 240 corresponding to the instruction. However, when a security domain transition has been detected, a predictor reset signal can be input to predictor circuit 210 to cause predictor reset circuit 252 to perform a reset of the predictor entries stored in prediction data table 240, and a prediction mode selection signal can be input to predictor circuit 210 to modify how prediction determination circuit generates prediction 260. For example, changing the mode of predictor circuit 210 can cause prediction 260 to be generated as a static prediction independent of predictor entries in prediction data table 240 or prevent the generation of prediction 260. For example, changing the mode of predictor circuit 210 can enable prediction 260 to be generated by accessing only a subset of predictor entries (e.g., entries stored in triggers) in prediction data table 240 that have been reset in an early stage of the reset operation. For example, predictor circuit 210 can be used in technique 400 of FIG4.
例如,预测器电路210可以包括分支预测器并且预测260可以包括对是否将采用本分支指令的预测。例如,预测数据表240的条目可以包括反映最近已经采用对应分支指令的频率的相应计数器(例如,两位饱和计数器)。在一些实施方式中,预测器电路210包括分支历史表。例如,预测数据表240的条目可以包括反映最近对应分支指令的分支历史的相应移位寄存器。例如,预测数据表240的条目可以由程序计数器索引。在第一模式(例如,标准或正常模式)中,预测确定电路230可以被配置为基于对应于指令的预测数据表240的条目中的数据来确定用于该指令的预测260。例如,如果预测数据表240的对应条目中的饱和计数器高于阈值,则可以“采用”用于分支指令的预测260。例如,在第二模式(例如,受限重置模式)中,预测确定电路230可以被配置为将用于指令的预测260确定为静态预测。例如,在第二模式(例如,受限重置模式)中,预测确定电路230可以被配置为基于来自预测器条目集合中的在重置操作的早期阶段中已经被重置并且可用于安全使用的子集的数据来确定用于该指令的预测260。For example, predictor circuit 210 may include a branch predictor and prediction 260 may include a prediction of whether the branch instruction will be adopted. For example, entries in prediction data table 240 may include a corresponding counter (e.g., a two-bit saturation counter) reflecting the frequency at which the corresponding branch instruction has been adopted recently. In some embodiments, predictor circuit 210 includes a branch history table. For example, entries in prediction data table 240 may include a corresponding shift register reflecting the branch history of the most recent corresponding branch instruction. For example, entries in prediction data table 240 may be indexed by a program counter. In a first mode (e.g., standard or normal mode), prediction determination circuit 230 may be configured to determine prediction 260 for the instruction based on data in the entries of prediction data table 240 corresponding to the instruction. For example, if the saturation counter in the corresponding entry of prediction data table 240 is above a threshold, prediction 260 for the branch instruction may be "adopted". For example, in a second mode (e.g., restricted reset mode), prediction determination circuit 230 may be configured to determine prediction 260 for the instruction as a static prediction. For example, in a second mode (e.g., a restricted reset mode), the prediction determination circuit 230 can be configured to determine the prediction 260 for the instruction based on data from a subset of the predictor entries that have been reset in the early stages of the reset operation and are available for safe use.
预测更新电路250被配置为在执行指令后更新预测数据表240。例如,当采用分支指令时,预测更新电路250可以使对应于分支指令的预测数据表240的条目中的饱和计数器递增。例如,当不采用分支指令时,预测更新电路250可以使对应于分支指令的预测数据表240的条目中的饱和计数器递减。The prediction update circuit 250 is configured to update the prediction data table 240 after an instruction is executed. For example, when a branch instruction is used, the prediction update circuit 250 may increment the saturation counter in the entry of the prediction data table 240 corresponding to the branch instruction. For example, when no branch instruction is used, the prediction update circuit 250 may decrement the saturation counter in the entry of the prediction data table 240 corresponding to the branch instruction.
预测器重置电路252可以被配置为对存储在预测数据表240中的预测器条目集合执行重置操作。例如,当检测到安全域转换时,预测器电路可以从检测器电路接收预测器重置信号,这可以使预测器重置电路252启动预测数据表240中的预测器条目的重置。例如,预测数据表240的一些或全部预测器条目可以被存储在SRAM中。重置(例如,将条目值设置为零或一些其他默认值或初始值)所有预测器条目可能需要多个时钟周期。例如,可以在跨越多个时钟周期的时间间隔期间,由预测器重置电路252执行完全重置操作。在一些实施方式中,预测数据表240的一些预测器条目可以被存储在触发器或寄存器中,当接收到预测器重置信号时,其可以在单个时钟周期内被清零或重置。例如,可以在接收到预测器重置信号后的第一个时钟周期内,清零存储在触发器中的预测器条目的子集,而可以在更长时间间隔的过程中,重置被存储在SRAM中的预测器条目的另一个不相交子集(例如,利用对SRAM的不同部分进行一系列写入)。Predictor reset circuit 252 can be configured to perform a reset operation on the set of predictor entries stored in prediction data table 240. For example, when a security domain transition is detected, the predictor circuitry can receive a predictor reset signal from the detector circuitry, which can cause predictor reset circuit 252 to initiate a reset of the predictor entries in prediction data table 240. For example, some or all of the predictor entries in prediction data table 240 may be stored in SRAM. Resetting all predictor entries (e.g., setting the entry value to zero or some other default or initial value) may require multiple clock cycles. For example, a complete reset operation can be performed by predictor reset circuit 252 over a time interval spanning multiple clock cycles. In some implementations, some predictor entries in prediction data table 240 may be stored in flip-flops or registers, which can be cleared or reset within a single clock cycle when a predictor reset signal is received. For example, a subset of predictor entries stored in flip-flops can be cleared within the first clock cycle after receiving the predictor reset signal, while another disjoint subset of predictor entries stored in SRAM can be reset over a longer time interval (e.g., by utilizing a series of writes to different portions of the SRAM).
图3是用于执行具有安全预测的指令的系统300的示例的框图。系统300包括存储指令的存储器302和被配置为执行指令的集成电路310。例如,集成电路310可以是处理器、微处理器、微控制器或IP核。集成电路310包括互连接口电路312;高速缓存314;指令解码缓冲器320,其被配置为存储从存储器302中取出的指令;指令解码器电路330,其被配置为对来自指令解码缓冲器320的指令进行解码并且将对应微指令传递给一个或多个执行资源电路(340、342、344和346)以供执行;预测器电路350;以及安全域转换检测电路360。例如,预测器电路350可以被实现为图2的预测器电路210。例如,集成电路310可以被配置为实现图4的技术400。Figure 3 is a block diagram of an example of a system 300 for executing instructions with security prediction. System 300 includes a memory 302 storing instructions and an integrated circuit 310 configured to execute the instructions. For example, integrated circuit 310 may be a processor, microprocessor, microcontroller, or IP core. Integrated circuit 310 includes interconnect interface circuitry 312; a cache 314; an instruction decoder buffer 320 configured to store instructions fetched from memory 302; an instruction decoder circuitry 330 configured to decode instructions from the instruction decoder buffer 320 and pass the corresponding microinstructions to one or more execution resource circuits (340, 342, 344, and 346) for execution; a predictor circuitry 350; and a security domain transition detection circuitry 360. For example, predictor circuitry 350 may be implemented as predictor circuitry 210 of Figure 2. For example, integrated circuit 310 may be configured to implement technique 400 of Figure 4.
互连接口电路312(例如,总线接口电路)被配置为向包括存储器302的外部设备传输数据以及从其接收数据。例如,互连接口电路312可以被配置为从存储器302提取指令并将它们存储在指令解码缓冲器320,同时指令由集成电路310的流水线架构处理。例如,互连接口电路312可以被配置为在流水线的回写阶段期间,将由执行指令产生的数据写入存储器302。例如,互连接口电路312可以提取数据块(例如,指令)。互连接口电路312可以被配置为使用高速缓存314来优化数据传输。Interconnect interface circuitry 312 (e.g., bus interface circuitry) is configured to transmit data to and receive data from an external device including memory 302. For example, interconnect interface circuitry 312 may be configured to fetch instructions from memory 302 and store them in instruction decoding buffer 320 while the instructions are processed by the pipelined architecture of integrated circuit 310. For example, interconnect interface circuitry 312 may be configured to write data generated by executing instructions to memory 302 during the write-back phase of the pipeline. For example, interconnect interface circuitry 312 may fetch data blocks (e.g., instructions). Interconnect interface circuitry 312 may be configured to use cache 314 to optimize data transfer.
集成电路310包括指令解码缓冲器320,其被配置为存储从存储器302提取的指令,同时它们被解码用于执行。例如,指令解码缓冲器320可以具有有助于集成电路310的流水线和/或超标量架构的深度(例如,4、8、12、16或24条指令)。指令可以是集成电路310支持的指令集合(例如,RISC V指令集合、x86指令集合、ARM指令集合或MIPS指令集合)的成员。Integrated circuit 310 includes an instruction decoder buffer 320 configured to store instructions fetched from memory 302, which are then decoded for execution. For example, the instruction decoder buffer 320 may have a depth that facilitates the pipeline and/or superscalar architecture of integrated circuit 310 (e.g., 4, 8, 12, 16, or 24 instructions). Instructions may be members of an instruction set supported by integrated circuit 310 (e.g., RISC V instruction set, x86 instruction set, ARM instruction set, or MIPS instruction set).
集成电路310包括一个或多个执行资源电路(340、342、344和346),其被配置为执行指令或微指令以支持指令集合。例如,指令集合可以是RISC V指令集合。例如,一个或多个执行资源电路(340、342、344和346)可以包括加法器、移位器(例如桶形移位器)、乘法器和/或浮点单元。一个或多个执行资源电路(340、342、344和346)可以基于执行指令的结果,更新集成电路310的状态,包括内部寄存器和/或标志或状态位(图3中未明确示出)和微架构状态。指令的执行结果也可以被写入存储器302(例如,在流水线执行的后续阶段期间)。Integrated circuit 310 includes one or more execution resource circuits (340, 342, 344, and 346) configured to execute instructions or microinstructions to support an instruction set. For example, the instruction set could be a RISC V instruction set. For example, one or more execution resource circuits (340, 342, 344, and 346) could include adders, shifters (e.g., barrel shifters), multipliers, and/or floating-point units. One or more execution resource circuits (340, 342, 344, and 346) can update the state of integrated circuit 310, including internal registers and/or flags or status bits (not explicitly shown in Figure 3) and microarchitectural state, based on the result of instruction execution. The result of instruction execution can also be written to memory 302 (e.g., during subsequent stages of pipelined execution).
集成电路310包括指令解码器电路330,其被配置为对指令解码缓冲器320中的指令进行解码。指令解码缓冲器320可以使用一个或多个执行资源电路(340、342、344和346),将指令转换成集成电路310内部执行的对应微指令。指令解码器电路330被配置为使用来自预测器电路350的预测来调度用于执行的指令并且实现推测执行。Integrated circuit 310 includes instruction decoder circuitry 330, which is configured to decode instructions in instruction decoder buffer 320. Instruction decoder buffer 320 may use one or more execution resource circuits (340, 342, 344, and 346) to translate instructions into corresponding microinstructions that are executed internally by integrated circuit 310. Instruction decoder circuitry 330 is configured to schedule instructions for execution using predictions from predictor circuitry 350 and to implement speculative execution.
集成电路310包括预测器电路350,其被配置为生成预测以使得能够推测执行。预测器电路350的预测器条目可以存储用于确定用于指令(例如,分支指令)的预测的数据(例如,计数器)。例如,预测器电路350可以包括值预测器、存储器依赖预测器、预取预测器、控制流预测器、分支预测器、分支历史表、分支目标缓冲器和/或返回地址堆栈预测器。例如,预测器电路350可以被配置为当在第一模式(例如,标准或正常模式)下操作时,使用存储在从预测器条目集合的任何中选择的一个或多个条目中的数据以生成用于指令的推测执行的预测。预测器电路350可以支持预测器条目集合的重置,当在由集成电路310正在执行的软件中发生安全域转换时可以调用该重置,以防止预测器条目的数据被用作边信道信息泄漏。由于重置操作可能需要一个以上的时钟周期来完成,因此预测器电路350还可以支持限制性模式,该模式防止在为执行重置操作分配的时间间隔期间使用为重置而调度的预测器条目。例如,预测器电路350可以支持禁用预测器电路350并且在为重置预测器状态而分配的时间间隔期间防止生成预测的限制性模式。例如,预测器电路350可以支持限制性模式,该模式使预测器电路350在为重置预测器状态分配的时间间隔期间生成静态预测。例如,预测器电路350可以支持限制性模式,该模式使得预测器电路350仅使用在重置操作的早期阶段期间已经被重置的预测器条目的子集来生成预测。在一些实施方式中,预测器电路350是混合预测器,其被配置为基于预测器条目集合的一个或多个子集生成预测。例如,预测器电路350可以使用多数投票方案、子集的固定层级或优先级、从可用子集选择其中的预测的元预测、或基于用于对使用相应子集生成的预测的预测置信度得分,来组合来自预测器条目的多个相应子集的预测。例如,这些混合方案可以被用来在重置操作期间预测器条目集合的部分不可用时确定合理的预测。Integrated circuit 310 includes predictor circuitry 350 configured to generate predictions to enable speculative execution. Predictor entries of predictor circuitry 350 may store data (e.g., counters) used to determine predictions for instructions (e.g., branch instructions). For example, predictor circuitry 350 may include a value predictor, a memory-dependent predictor, a prefetch predictor, a control flow predictor, a branch predictor, a branch history table, a branch target buffer, and/or a return address stack predictor. For example, predictor circuitry 350 may be configured to, when operating in a first mode (e.g., standard or normal mode), use data stored in one or more entries from any selected set of predictor entries to generate predictions for speculative execution of instructions. Predictor circuitry 350 may support resetting of the predictor entry set, which can be invoked when a security domain transition occurs in the software being executed by integrated circuitry 310, to prevent the data of the predictor entries from being used for side-channel information leakage. Since a reset operation may require more than one clock cycle to complete, predictor circuit 350 may also support a restrictive mode that prevents the use of predictor entries scheduled for the reset during the time interval allocated for performing the reset operation. For example, predictor circuit 350 may support a restrictive mode that disables predictor circuit 350 and prevents prediction generation during the time interval allocated for resetting the predictor state. For example, predictor circuit 350 may support a restrictive mode that causes predictor circuit 350 to generate static predictions during the time interval allocated for resetting the predictor state. For example, predictor circuit 350 may support a restrictive mode that causes predictor circuit 350 to generate predictions using only a subset of predictor entries that have already been reset during the early stages of the reset operation. In some implementations, predictor circuit 350 is a hybrid predictor configured to generate predictions based on one or more subsets of the predictor entry set. For example, predictor circuit 350 can combine predictions from multiple corresponding subsets of predictor entries using a majority voting scheme, a fixed hierarchy or priority of subsets, a meta-prediction selecting predictions from an available subset, or a prediction confidence score used to evaluate predictions generated using the corresponding subsets. For example, these hybrid schemes can be used to determine reasonable predictions when a portion of the predictor entry set is unavailable during a reset operation.
集成电路310包括安全域转换电路360,其被配置为检测由集成电路310正在执行的软件何时从一个安全域改变到另一安全域。例如,当集成电路310执行到不同进程的上下文切换、或接收中断、或从用户进程切换到操作系统、或从操作系统切换到虚拟机管理程序时,安全域转换检测电路360可以检测到转换。在一些实施方式中,安全域转换检测电路360可以基于解码(例如,使用指令解码器电路330)与安全域转换相关联的指令来检测安全域转换。解码的指令可以明确或隐含地与安全域的转换相关联。例如,解码的指令可以是专门的指令,其明确目的是发信号告知软件编写者的意图以强制执行就在指令之前或之后的安全域边界。例如,该指令可以是与安全域转换隐含关联的过程调用或返回指令。在一些实施方式中,安全域转换检测电路360可以基于接收中断信号来检测安全域转换。当检测到安全域转换时,安全域转换检测电路360可以向预测器电路350发出模式选择信号和/或重置信号。Integrated circuit 310 includes security domain transition circuitry 360, configured to detect when software being executed by integrated circuit 310 changes from one security domain to another. For example, security domain transition detection circuitry 360 can detect a transition when integrated circuit 310 performs a context switch between different processes, receives an interrupt, switches from a user process to the operating system, or switches from the operating system to a hypervisor. In some embodiments, security domain transition detection circuitry 360 can detect a security domain transition based on decoding (e.g., using instruction decoder circuitry 330) instructions associated with the security domain transition. The decoded instructions can be explicitly or implicitly associated with the security domain transition. For example, the decoded instructions can be specific instructions whose explicit purpose is to signal the software author's intention to enforce a security domain boundary immediately before or after the instruction. For example, the instruction could be a procedure call or return instruction implicitly associated with the security domain transition. In some embodiments, security domain transition detection circuitry 360 can detect a security domain transition based on receiving an interrupt signal. When a security domain transition is detected, the security domain transition detection circuit 360 can send a mode selection signal and/or a reset signal to the predictor circuit 350.
例如,集成电路310可以被配置为使用安全域转换检测电路360,对由集成电路310正在执行的软件检测安全域转换,并且响应于安全域转换,将预测器电路的模式350从第一模式改变到第二模式并调用预测器条目集合的重置。第二模式可以防止预测器电路350使用预测器条目集合中的预测器条目的至少第一子集来生成预测。集成电路310可以被配置为在完成重置之后,将预测器电路的模式改变为第一模式以恢复正常预测。在一些实施方式中,集成电路310可以被配置为响应于重置的部分完成,将预测器电路350的模式改变为第三模式,该第三模式使得预测器电路350能够使用预测器条目集合中的已经被重置的第二子集,同时防止使用预测器条目集合中的尚未被重置的第三子集。第二子集和第三子集可以是非空并且是第一子集的不相交的子集。集成电路310可以被配置为在重置完成之前,基于第二子集中的预测器条目来生成预测。在一些实施方式中,在第二模式下操作防止预测器电路350生成预测。在一些实施方式中,在第二模式下操作防止预测器电路350使用预测器条目集合中的所有并且使预测器电路350生成静态预测。在一些实施方式中,在第二模式下操作使预测器电路350基于预测器条目集合中的与预测器条目的第一子集不相交的第二子集中的预测器条目来生成预测。例如,预测器电路350当在第一模式下操作时,可以基于根据预测器条目集合的第二子集确定的预测与根据预测器条目集合中的与第二集合不相交的一个或多个相应的附加子集确定的一个或多个预测的组合来生成预测。在一些实施方式中,安全域转换检测电路360被配置为基于对与安全域转换相关联的指令进行解码来检测安全域转换。在一些实施方式中,安全域转换检测电路360被配置为基于接收中断信号来检测安全域转换。在一些实施方式中,在调用重置和将预测器电路的模式改变为第一模式之间的时间间隔具有固定的持续时间,这可以防止经由重置操作的定时泄露信息和/或减少或消除抖动。For example, integrated circuit 310 can be configured to use security domain transition detection circuit 360 to detect security domain transitions in the software being executed by integrated circuit 310, and in response to a security domain transition, change the mode 350 of the predictor circuit from a first mode to a second mode and invoke a reset of the predictor entry set. The second mode prevents the predictor circuit 350 from using at least a first subset of predictor entries in the predictor entry set to generate predictions. Integrated circuit 310 can be configured to change the mode of the predictor circuit back to the first mode after the reset is complete to restore normal prediction. In some embodiments, integrated circuit 310 can be configured to change the mode of the predictor circuit 350 to a third mode in response to partial completion of the reset, which allows the predictor circuit 350 to use a second subset of the predictor entry set that has been reset, while preventing the use of a third subset of the predictor entry set that has not yet been reset. The second and third subsets can be non-empty and disjoint subsets of the first subset. Integrated circuit 310 can be configured to generate predictions based on predictor entries in the second subset before the reset is complete. In some embodiments, operation in the second mode prevents the predictor circuit 350 from generating predictions. In some embodiments, operation in the second mode prevents the predictor circuit 350 from using all entries in the predictor entry set and causes the predictor circuit 350 to generate static predictions. In some embodiments, operation in the second mode causes the predictor circuit 350 to generate predictions based on predictor entries in a second subset of the predictor entry set that do not intersect with the first subset of predictor entries. For example, when operating in the first mode, the predictor circuit 350 may generate predictions based on a combination of predictions determined according to the second subset of the predictor entry set and one or more predictions determined according to one or more corresponding additional subsets of the predictor entry set that do not intersect with the second set. In some embodiments, the security domain transition detection circuit 360 is configured to detect security domain transitions based on decoding instructions associated with the security domain transition. In some embodiments, the security domain transition detection circuit 360 is configured to detect security domain transitions based on receiving an interrupt signal. In some implementations, the time interval between invoking a reset and changing the predictor circuitry to the first mode has a fixed duration, which can prevent timing information leakage via the reset operation and/or reduce or eliminate jitter.
图4是用于执行具有安全预测的指令的技术400的示例的流程图。技术400包括检测用于由集成电路正执行的软件的安全域转换(410);响应于安全域转换,调用预测器条目集合的重置(420)并且将预测器电路的模式从第一模式改变到第二模式(430);在重置时间间隔期间,继续执行将一种或多种限制模式用于限制对预测器条目的访问的预测器电路(440);以及在完成重置之后,将预测器电路的模式改变到第一模式(450),并且继续使用具有对预测器条目的完全访问的第一模式执行(460)。例如,预测器电路可以包括控制流预测器、值预测器、分支预测器、分支历史表、分支目标缓冲器和/或返回地址堆栈预测器。例如,可以使用图1的集成电路110来实现技术400。例如,可以使用图2的预测器电路210来实现技术400。例如,可以使用图3的系统300来实现技术400。Figure 4 is a flowchart of an example of technique 400 for executing instructions with security prediction. Technique 400 includes detecting a security domain transition for software being executed by an integrated circuit (410); in response to the security domain transition, invoking a reset of the predictor entry set (420) and changing the mode of the predictor circuit from a first mode to a second mode (430); during the reset interval, continuing execution of the predictor circuit using one or more restriction modes to restrict access to predictor entries (440); and after the reset is complete, changing the mode of the predictor circuit back to the first mode (450) and continuing execution using the first mode with full access to predictor entries (460). For example, the predictor circuit may include a control flow predictor, a value predictor, a branch predictor, a branch history table, a branch destination buffer, and/or a return address stack predictor. For example, technique 400 may be implemented using the integrated circuit 110 of Figure 1. For example, technique 400 may be implemented using the predictor circuit 210 of Figure 2. For example, technique 400 may be implemented using the system 300 of Figure 3.
技术400包括对由集成电路(例如,集成电路310)正执行的软件检测安全域转换(410),该集成电路包括预测器电路,该预测器电路被配置为当在第一模式(例如,标准或正常标准)中操作时,使用存储在从预测器条目集合中的任何选择的一个或多个条目中的数据来生成用于指令的推测执行的预测。在一些实施方式中,可以基于解码与安全域转换相关联的指令来检测安全域转换(410)。例如,可以解码可以被用来明确地指示软件中的安全域边界的特殊指令。例如,服务于另一目的的指令(例如,过程调用或返回指令)可以与安全域转换隐含地相关联,并且可以基于对这些隐含关联指令之一的解码来检测安全域转换(410)。在一些实施方式中,基于接收中断信号来检测安全域转换(410)。例如,某些中断可能与安全域转换相关联,或者所有中断都可能与安全域转换相关联。在一些实施方式中,基于对指令进行解码并且还基于与安全域转换相关联的集成电路(例如,处理器)的内部状态来检测安全域转换(410)。例如,可以基于解码或执行异常返回指令并且基于具有与安全域转换相关联的值的目的地的特权模式来检测安全域转换(410),其中,处理器状态记录将返回哪一特权模式。Technique 400 includes detecting security domain transitions (410) in software being executed by an integrated circuit (e.g., integrated circuit 310), the integrated circuit including predictor circuitry configured to generate predictions for speculative execution of instructions when operating in a first mode (e.g., standard or normal standard) using data stored in one or more entries from any selection of a set of predictor entries. In some embodiments, security domain transitions (410) can be detected based on decoding instructions associated with the security domain transition. For example, specific instructions that can be used to explicitly indicate security domain boundaries in the software can be decoded. For example, instructions serving another purpose (e.g., procedure call or return instructions) may be implicitly associated with security domain transitions, and security domain transitions (410) can be detected based on decoding one of these implicitly associated instructions. In some embodiments, security domain transitions (410) are detected based on receiving interrupt signals. For example, some interrupts may be associated with security domain transitions, or all interrupts may be associated with security domain transitions. In some implementations, a security domain transition (410) is detected based on the decoding of an instruction and also on the internal state of an integrated circuit (e.g., a processor) associated with the security domain transition. For example, a security domain transition (410) may be detected based on decoding or executing an exception return instruction and on the privileged mode of the destination with a value associated with the security domain transition, wherein the processor state record will return which privileged mode.
当(在操作415)已经检测到安全域转换时,技术400包括响应于安全域转换,将预测器电路的模式从第一模式改变到第二模式(430)并调用预测器条目集合的重置(420)。第二模式可以防止预测器电路使用预测器条目集合中的预测器条目的至少第一子集来生成预测。例如,在第二模式下操作可以防止预测器电路生成预测。例如,在第二模式下操作可以防止预测器电路使用预测器条目集合中的所有并且可以使预测器电路生成静态预测。在一些实施方式中,在第二模式下操作使预测器电路基于预测器条目集合中的与预测器条目的第一子集不相交的第二子集中的预测器条目来生成预测。例如,预测器电路可以包括混合预测器,该混合预测器能够基于包括在其预测器状态中的预测器条目的一个或多个子集来生成预测。例如,预测器电路可以使用多数投票方案、子集的固定层级或优先级、从可用子集选择其中的预测的元预测、或基于对使用相应子集生成的预测的预测置信度得分,来组合来自预测器条目的多个相应子集的预测。在正常模式下,预测器电路可以通过组合基于预测器条目集合的多个子集的预测来生成预测。例如,预测器电路当在第一模式下操作时,可以基于根据预测器条目集合的第二子集确定的预测与根据预测器条目集合中的与第二集合不相交的一个或多个相应的附加子集的一个或多个预测的组合来生成预测。例如,在第二模式(例如,限制模式)中,预测器电路可以被配置为仅基于预测器条目的一个或多个子集来确定预测,因为它们在重置操作期间变得可用。When a security domain transition has been detected (in operation 415), technique 400 includes, in response to the security domain transition, changing the mode of the predictor circuitry from a first mode to a second mode (430) and invoking a reset (420) of the predictor entry set. The second mode can prevent the predictor circuitry from generating predictions using at least a first subset of the predictor entries in the predictor entry set. For example, operating in the second mode can prevent the predictor circuitry from generating predictions. For example, operating in the second mode can prevent the predictor circuitry from using all of the predictor entry sets and can cause the predictor circuitry to generate static predictions. In some embodiments, operating in the second mode causes the predictor circuitry to generate predictions based on predictor entries in a second subset of the predictor entry set that do not intersect with the first subset of predictor entries. For example, the predictor circuitry may include a hybrid predictor capable of generating predictions based on one or more subsets of predictor entries included in its predictor state. For example, the predictor circuitry can combine predictions from multiple corresponding subsets of predictor entries using a majority voting scheme, a fixed hierarchy or priority of subsets, a meta-prediction selecting predictions from available subsets, or a prediction confidence score based on predictions generated using the corresponding subsets. In normal mode, the predictor circuitry can generate predictions by combining predictions from multiple subsets of the predictor entry set. For example, when operating in a first mode, the predictor circuitry can generate predictions based on a combination of predictions determined according to a second subset of the predictor entry set and one or more predictions based on one or more corresponding additional subsets of the predictor entry set that do not intersect with the second set. For example, in a second mode (e.g., a restricted mode), the predictor circuitry can be configured to determine predictions based solely on one or more subsets of predictor entries, as these become available during a reset operation.
技术400包括继续执行对预测器电路使用在重置时间间隔期间限制对预测器条目的访问的一种或多种限制模式(440)。例如,继续执行指令(440)可以包括使用由在第二模式下操作的预测器电路确定的预测来促进推测执行。在一些实施方式中,当在第二模式下操作时,预测器电路不生成预测,并且在没有推测执行的益处的情况下执行继续(440),直到重置操作完成。例如,图5的技术500可以被实现以利用预测器条目集合的附加部分,因为它们在重置操作期间变得可用以提高预测器的性能以继续推测执行(440)。Technique 400 includes continuing execution of one or more restricted modes (440) for the predictor circuitry to use, which restrict access to predictor entries during the reset time interval. For example, the continue execution instruction (440) may include using a prediction determined by the predictor circuitry operating in a second mode to facilitate speculative execution. In some implementations, when operating in the second mode, the predictor circuitry does not generate a prediction and continues (440) without any benefit of speculative execution until the reset operation is complete. For example, technique 500 of FIG. 5 may be implemented to utilize additional portions of the predictor entry set, as they become available during the reset operation, to improve the predictor's performance for continuing speculative execution (440).
当(在操作445)重置完成时,技术400包括在完成重置之后将预测器电路的模式改变为第一模式(例如,标准或正常模式)(450)。在一些实施方式中,在调用重置(420)和将预测器电路的模式改变为第一模式(450)之间的时间间隔具有固定持续时间。将该时间间隔限制为具有固定的持续时间可以提供益处,诸如防止以定时信息的形式跨越安全域边界泄漏信息和/或防止抖动源(例如,对于实时应用)。When the reset (in operation 445) is complete, technique 400 includes changing the mode of the predictor circuitry to a first mode (e.g., standard or normal mode) after the reset is complete (450). In some implementations, the time interval between invoking the reset (420) and changing the mode of the predictor circuitry to the first mode (450) has a fixed duration. Limiting this time interval to a fixed duration can provide benefits such as preventing information leakage across security domain boundaries in the form of timing information and/or preventing jitter sources (e.g., for real-time applications).
在预测器电路的模式已经改变回到第一模式(例如,标准或正常模式)(450)之后,技术400包括使用具有对预测器条目的完全访问权的第一模式继续执行(460)。在用预测更新(例如,使用预测更新电路250)的继续执行(460)一段时间之后,包括预测器条目集合的预测器状态可以稳定并收敛到调整到新安全域内的条件的有用值。图5是用于在预测器的重置操作期间,基于预测器条目集合的子集,执行具有预测的指令的技术500的示例的流程图。After the predictor circuit mode has changed back to a first mode (e.g., standard or normal mode) (450), technique 400 includes continuing execution (460) using the first mode with full access to the predictor entries. After a period of time following continued execution with prediction updates (e.g., using prediction update circuit 250) (460), the predictor state, including the set of predictor entries, can stabilize and converge to a useful value of the conditions adjusted to the new security domain. Figure 5 is a flowchart of an example of technique 500 for executing instructions with predictions based on a subset of the predictor entry set during a predictor reset operation.
图5是用于在预测器的重置操作期间,基于预测器条目集合的子集执行具有预测的指令的技术500的示例的流程图。技术500包括响应于重置的部分完成,将预测器电路的模式改变到第三模式(例如,附加的限制较少的模式)(510),这使得预测器电路能够使用预测器条目集合中、已经被重置的第二子集同时阻止使用预测器条目集合中的尚未被重置的第三子集。第二子集和第三子集可以是非空且第一子集的不相交的子集。技术500包括在完成重置之前,基于第二子集中的预测器条目生成预测(520)。例如,当这些子集在重置操作期间变得可用时,技术500可以被用来利用混合预测器中的预测器条目的附加子集。Figure 5 is a flowchart illustrating an example of technique 500 for executing instructions with predictions based on a subset of the predictor entry set during a predictor reset operation. Technique 500 includes changing the mode of the predictor circuitry to a third mode (e.g., an additional, less restrictive mode) in response to partial completion of the reset (510). This allows the predictor circuitry to utilize a second subset of the predictor entry set that has been reset while preventing the use of a third subset of the predictor entry set that has not yet been reset. The second and third subsets can be non-empty and disjoint subsets of the first subset. Technique 500 includes generating predictions based on the predictor entries in the second subset before the reset is complete (520). For example, technique 500 can be used to utilize additional subsets of predictor entries in a hybrid predictor when these subsets become available during the reset operation.
在第一方面,本说明书中描述的主题可以被体现在用于执行指令的集成电路中,该集成电路包括预测器电路,该预测器电路被配置为当在第一模式下操作时,使用存储在从预测器条目集合中的任何选择的一个或多个条目中的数据来生成用于指令的推测执行的预测,其中,该集成电路被配置为:检测由集成电路正执行的软件的安全域转换;响应于安全域转换,将预测器电路的模式从第一模式改变为第二模式并且调用预测器条目集合的重置,其中,第二模式防止预测器电路使用预测器条目集合中的预测器条目的至少第一子集以生成预测;以及在重置完成后,将预测器电路的模式改变为第一模式。In a first aspect, the subject matter described herein can be embodied in an integrated circuit for executing instructions, the integrated circuit including predictor circuitry configured to, when operating in a first mode, generate a prediction for speculative execution of instructions using data stored in one or more entries selected from a set of predictor entries, wherein the integrated circuit is configured to: detect a security domain transition of software being executed by the integrated circuit; in response to the security domain transition, change the mode of the predictor circuitry from the first mode to a second mode and invoke a reset of the set of predictor entries, wherein the second mode prevents the predictor circuitry from using at least a first subset of predictor entries in the set of predictor entries to generate a prediction; and after the reset is completed, change the mode of the predictor circuitry back to the first mode.
在第二方面,本说明书中描述的主题可以被体现在包括检测正由集成电路执行的软件的安全域转换的方法中,该集成电路包括预测器电路,该预测器电路被配置为当在第一模式下操作时,使用存储在从预测器条目集合中的任何选择的一个或多个条目中的数据来生成用于指令的推测执行的预测;响应于安全域转换,将预测器电路的模式从第一模式改变为第二模式并且调用预测器条目集合的重置,其中,第二模式防止预测器电路使用预测器条目集中的预测器条目的至少第一子集以生成预测;以及在重置完成后,将预测器电路的模式改变为第一模式。In a second aspect, the subject matter described herein can be embodied in a method comprising detecting a security domain transition of software being executed by an integrated circuit, the integrated circuit including a predictor circuit configured to, when operating in a first mode, generate a prediction for speculative execution of instructions using data stored in one or more entries from any selected set of predictor entries; in response to a security domain transition, change the mode of the predictor circuit from the first mode to a second mode and invoke a reset of the predictor entry set, wherein the second mode prevents the predictor circuit from using at least a first subset of the predictor entries in the predictor entry set to generate a prediction; and after the reset is completed, change the mode of the predictor circuit back to the first mode.
虽然已经结合某些实施例描述了本公开,但是应当理解到,本公开不限于所公开的实施例,相反,旨在涵盖包括在所附权利要求的范围内的各种修改和等效布置,其范围被赋予最广泛的解释,以涵盖法律允许的所有这类修改和等效结构。While this disclosure has been described in conjunction with certain embodiments, it should be understood that this disclosure is not limited to the disclosed embodiments, but rather is intended to cover various modifications and equivalent arrangements included within the scope of the appended claims, the scope of which is to be interpreted in the broadest possible sense to cover all such modifications and equivalent structures permitted by law.
Claims (28)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US62/787,248 | 2018-12-31 | ||
| US16/362,121 | 2019-03-22 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| HK40058957A HK40058957A (en) | 2022-04-29 |
| HK40058957B true HK40058957B (en) | 2025-09-05 |
Family
ID=
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN113228024B (en) | Secure predictor for speculative execution | |
| US11347507B2 (en) | Secure control flow prediction | |
| US11681533B2 (en) | Restricted speculative execution mode to prevent observable side effects | |
| JP5172942B2 (en) | Method for reducing power consumption by processor, processor, and information processing system | |
| KR100973951B1 (en) | Misaligned memory access prediction | |
| US10001998B2 (en) | Dynamically enabled branch prediction | |
| CN104978284B (en) | Processor subroutine cache | |
| JP2006522375A (en) | Processing action masking in data processing system | |
| CN110235103B (en) | Speculative transitions between modes with different privilege levels in a block-based microarchitecture | |
| US6760835B1 (en) | Instruction branch mispredict streaming | |
| JP7569307B2 (en) | Apparatus and method for handling exception cause events - Patents.com | |
| US7373489B1 (en) | Apparatus and method for floating-point exception prediction and recovery | |
| CN110096129A (en) | Calculate equipment | |
| US20220292183A1 (en) | Secure control flow prediction | |
| US10324727B2 (en) | Memory dependence prediction | |
| CN111989657B (en) | Apparatus and method for controlling the allocation of instructions to instruction cache storage areas | |
| JP2004503865A (en) | Processor with selective branch prediction | |
| US6721878B1 (en) | Low-latency interrupt handling during memory access delay periods in microprocessors | |
| HK40058957B (en) | Secure predictors for speculative execution | |
| JPH1049373A (en) | Method and device for operating multiplex and highly accurate event for pipeline digital processor | |
| HK40058957A (en) | Secure predictors for speculative execution | |
| JP2011070290A (en) | Data processor | |
| TW202213088A (en) | System, apparatus and methods for register hardening via a micro-operation | |
| US11157277B2 (en) | Data processing apparatus with respective banked registers for exception levels | |
| Nazarenus | Mitigation of actual cpu attacks–a hare and hedgehog race not to win |