WO2007130074A1 - Method and system for controlling timing in a processor - Google Patents

Method and system for controlling timing in a processor Download PDF

Info

Publication number
WO2007130074A1
WO2007130074A1 PCT/US2006/020569 US2006020569W WO2007130074A1 WO 2007130074 A1 WO2007130074 A1 WO 2007130074A1 US 2006020569 W US2006020569 W US 2006020569W WO 2007130074 A1 WO2007130074 A1 WO 2007130074A1
Authority
WO
WIPO (PCT)
Prior art keywords
instruction
execution time
condition
instructions
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/US2006/020569
Other languages
French (fr)
Inventor
Majid Kaabouch
Eric Le Cocquen
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Atmel Corp
Original Assignee
Atmel Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Atmel Corp filed Critical Atmel Corp
Priority to CN2006800544413A priority Critical patent/CN101432691B/en
Publication of WO2007130074A1 publication Critical patent/WO2007130074A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3005Arrangements for executing specific machine instructions to perform operations for flow control
    • G06F9/30058Conditional branch instructions
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30003Arrangements for executing specific machine instructions
    • G06F9/3005Arrangements for executing specific machine instructions to perform operations for flow control
    • G06F9/30069Instruction skipping instructions, e.g. SKIP
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30181Instruction operation extension or modification
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30181Instruction operation extension or modification
    • G06F9/30189Instruction operation extension or modification according to execution mode, e.g. mode flag
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/32Address formation of the next instruction, e.g. by incrementing the instruction counter
    • G06F9/322Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address
    • G06F9/325Address formation of the next instruction, e.g. by incrementing the instruction counter for non-sequential address for loops, e.g. loop detection or loop counter
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3867Concurrent instruction execution, e.g. pipeline or look ahead using instruction pipelines
    • G06F9/3869Implementation aspects, e.g. pipeline latches; pipeline synchronisation and clocking

Definitions

  • the present invention relates to computer systems, and more particularly to a method and system for controlling timing in a processor.
  • a central processing unit is the part of a computer that interprets and carries out instructions contained in software, which can have various functions such as controlling hardware, performing computations, communication with other software.
  • the timing execution of instructions may vary, depending on a number of various conditions (e.g., status register contents, the value of a bit, the size of the following instructions, accessed peripherals, etc.).
  • Timing execution can be a serious problem when the timing must be constant or predictable. For example, during software communication routines, a coprocessor must be synchronized with the CPU. Timing variations can also cause problems such as the leakage of sensitive information, etc.
  • the method comprises fetching a plurality of instructions, wherein each instruction has a first default execution time during a first condition, and wherein each instruction has a second default execution time during a second condition; during a first mode, executing the plurality of instructions within a same execution time regardless of whether a condition is the first condition or the second condition; and during a second mode, executing the plurality of instructions within random execution times regardless of whether a condition is the first condition or the second condition.
  • the method effectively modifies the timing of a processor by controlling and/or minimizing variations in the execution times of instructions.
  • Figure 1 is a block diagram of a conventional computer system.
  • Figure 2 is a block diagram of a processor, which may be used to implement the processor of Figure 1, in accordance with the present invention.
  • FIG 3 is a diagram illustrating a control register, which may be used to implement the one or more control registers of Figure 2, in accordance with the present invention.
  • Figure 4 is a flow chart showing a method for controlling timing in a processor, in accordance with the present invention.
  • Figure 5 is a timing diagram illustrating a skip instruction having a false condition (i.e., no skip), and where timing compensation is enabled in accordance with the present invention.
  • Figure 6 is a timing diagram illustrating a skip instruction having a true condition (i.e., skip), and where timing compensation is enabled in accordance with the present invention.
  • Figure 7 is a timing diagram illustrating an instruction having controlled compensation in accordance with another embodiment of the present invention.
  • Figure 8 is a timing diagram illustrating a CPU loop on a skip instruction in accordance with another embodiment of the present invention.
  • the present invention relates to computer systems, and more particularly to a method and system for controlling timing in a processor.
  • the following description is presented to enable one of ordinary skill in the art to make and use the invention, and is provided in the context of a patent application and its requirements.
  • Various modifications to the preferred embodiment and the generic principles and features described herein will be readily apparent to those skilled in the art.
  • the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features described herein.
  • a method and system in accordance with the present invention for controlling timing in a processor are disclosed.
  • the method includes controlling the execution times in which a processor executes particular types of instructions in order to improve the overall security of the processor.
  • the method effectively modifies the timing of a processor by controlling and/or minimizing variations in the execution times of instructions.
  • a timing compensation mode instructions are executed within a same execution time regardless of whether a condition is true or false.
  • a controlled compensation mode instructions are executed within random execution times regardless of whether a condition true or false.
  • FIG 1 is a block diagram of a conventional computer system.
  • the computer system 100 includes a processor 102, a bus 104, system memory 106 (e.g., hard drive, random access memory (RAM)), I/O devices 108 (e.g., keyboard, display, mouse, etc.), and a network interface 110 for connecting to a network such as a local area network (LAN) or the Internet.
  • Figure 2 is a block diagram of a processor 200, which may be used to implement the processor 102 of Figure 1 , in accordance with the present invention.
  • the processor 200 includes a control mechanism 201, which has one or more control registers 202.
  • Figure 3 is a diagram illustrating a control register 300, which may be used to implement the one or more control registers 202 of Figure 2, in accordance with the present invention.
  • the control register 300 includes two bits 302 and 304. The operation of the control register 300 is described in further detail below.
  • Timing compensation refers to a process that provides constant execution timing of instructions.
  • timing compensation is applied to the branch and skip instructions, but may apply to other types of instructions.
  • Table 1 shows a list of various types of branch instructions 320 and skip instructions 322.
  • the timing execution of branch and skip instructions typically varies, because the number of cycles required to execute a given instruction varies.
  • a conditional branch or conditional skip instruction executes in a different number of cycles depending on the condition being true or false. For example, as shown in column 330 of Table 1, the default timing execution for a branch instruction may range from one to two cycles, and the default timing execution for a skip instruction may range from one to three cycles.
  • a control mechanism 201 varies the number of cycles it takes to execute particular instructions. During timing compensation, the execution time is the same regardless of the condition. During controlled compensation, the execution time random regardless of the condition, which prevents leakage of information.
  • the control mechanism 201 is a digital block that compensates or controls (randomizes) the number of cycles taken by a conditional instruction to execute.
  • the equalization or randomization may be performed automatically by software, which is advantageous over manual operations, since manual operations are prone to error, time consuming, have high-maintenance costs, and are not compatible with high- level languages such as C.
  • the control mechanism 201 improves execution timing, especially in time-sensitive applications, by minimizing the variations in execution times of different types of instructions as well as variations in power signatures. For example, as shown in column 332 of Table 1, the balanced timing execution (i.e., with timing compensated) for a branch instruction is set to three cycles, and the balanced timing execution for a skip instruction is set to four cycles. The specific number of cycles for branch and skip instructions will depend on the specific implementation.
  • the timing compensation feature when the bit 302 (also labeled "Bit 0-TCE” (timing compensation enable)) is set by software, the timing compensation feature is enabled and all branch and skip instruction timing executions will take three cycles for branch instructions and four cycles for skip instructions. Of course the specific number cycles will depend on the specific implementation. When the bit 302 is cleared, all branches and skip instructions will follow the default timing execution.
  • the bit 304 when the bit 304 (also labeled "Bit 1-CCE” (controlled compensation enable)) is set by software and the TCE bit is also set, the controlled compensation mechanism is enabled. When this bit is cleared, the controlled compensation mechanism is disabled. In a preferred embodiment, any attempt to set this bit when TCE is cleared has no effect.
  • bit 302 is the "master switch” whereas the bit 304 is an "option selector.”
  • the bit 302 is used to switch the compensation ON, and the bit 304 selects whether balancing or randomization is selected.
  • one of the two options may be offered.
  • a single bit may switch ON/OFF one type of compensation (e.g., timing compensation).
  • Figure 4 is a flow chart showing a method for controlling timing in a processor, in accordance with the present invention. Referring to both Figures 2 and 4, the process begins a step 402 when the processor 200 fetches a plurality of instructions.
  • Each instruction has a first default execution time during a first condition (e.g., true), and each instruction has a second default execution time during a second condition (e.g., false).
  • the instructions may include different types of instructions (e.g., branch instructions and skip instructions).
  • a step 404 during a first mode (i.e., timing compensation), the processor 200 executes the plurality of instructions within a same execution time regardless of whether a condition is the first condition or the second condition.
  • a step 406 i.e., controlled compensation
  • the processor 200 executes the plurality of instructions within random execution times regardless of whether a condition is the first condition or the second condition.
  • the processor 200 executes at least one instruction of the plurality of instructions of a first type within a first predetermined execution time, wherein the first predetermined execution time is greater than a first default execution time.
  • the processor 200 executes at least one instruction of the plurality of instructions of a second type within a second predetermined execution time, wherein the second predetermined execution time is greater than a second default execution time.
  • the first and second predetermined execution times are different.
  • the first and second predetermined execution times are the same. The first and second execution times are based on a number of cycles required to execute a given type of instruction.
  • the first predetermined execution time is greater than the first default execution time
  • the second predetermined execution time is greater than the second default execution time.
  • first and second types of instruction can be conditional branch and skip instructions, respectively.
  • first and second types of instruction can be skip and conditional branch instructions, respectively.
  • Figure 5 is a timing diagram illustrating a skip instruction having a false condition (i.e., no skip), and where timing compensation is enabled in accordance with the present invention.
  • the default number of cycles required to execute this particular type of skip instruction is one cycle.
  • the control mechanism 201 adds three cycles in order to increase the number of cycles required to execute the skip instruction from one cycle to four cycles. The specific number of cycles added will depend on the specific implementation,
  • Figure 6 is a timing diagram illustrating a skip instruction having a true condition
  • the default number of cycles required to execute this particular type of skip instruction is two cycles.
  • the control mechanism 201 adds two cycles to increase the number of cycles required to execute the skip instruction from two cycles to four cycles.
  • Figures 5 and 6 may also be applied to branch instructions or any other type of instructions. The key point is that the control mechanism 201 adds cycles if necessary so that the number of cycles required to execute a given type of instruction is controlled or the variations in execution timing are eliminated.
  • Controlled compensation in accordance with the present invention, refers to a process that provides random execution timing of instructions.
  • Figure 7 is a timing diagram illustrating an instruction having controlled compensation in accordance with another embodiment of the present invention.
  • a 3 -bit variable value controls the number of cycles taken by the process to execute a given type of instruction such as a skip instruction. Accordingly, 0 to 7 cycles or more, may be added to the instruction length to control execution timing.
  • the processor determines the number of cycles, the number of which is random. For example, branch instructions may be executed in: 3 cycles + "3 bits number" which varies randomly from 3 cycles to 10 cycles, and skip instructions may be executed in: 4 cycles + "3 bits number” which varies from 4 cycles to 11 cycles.
  • Figure 8 is a timing diagram illustrating a CPU loop on a skip instruction in accordance with another embodiment of the present invention.
  • the CPU loops such that the number of cycles taken to execute a skip instruction are random.
  • the present invention provides numerous benefits. For example, it automatically balances and controls timing variations (e.g., caused by conditional branches), making processor functions high-level- language friendly.
  • Embodiments of the present invention also control execution timing to avoid information leakage to simplify the implementation of security features.
  • Embodiments of the present invention also enable the slowing down of processor instruction execution to improve power consumption, access slow peripherals, spread the electromagnetic spectrum, etc.
  • Embodiments of the present invention also balance access time to different memories (e.g., random access memory (RAM), non-volatile memories).
  • RAM random access memory
  • a method and system in accordance with the present invention for controlling timing in a processor has been disclosed.
  • the method includes controlling the execution times in which a CPU executes particular types of instructions in order to improve the overall security of the CPU.
  • the method effectively modifies the timing of a processor by controlling and/or minimizing variations in the execution times of instructions.
  • the present invention has been described in accordance with the embodiments shown.
  • One of ordinary skill in the art will readily recognize that there could be variations to the embodiments, and that any variations would be within the spirit and scope of the present invention.
  • the present invention can be implemented using hardware, software, a computer readable medium containing program instructions, or a combination thereof.
  • Software written according to the present invention is to be either stored in some form of computer-readable medium such as memory or CD-ROM, or is to be transmitted over a network, and is to be executed by a processor. Consequently, a computer-readable medium is intended to include a computer readable signal, which may be, for example, transmitted over a network. Accordingly, many modifications may be made by one of ordinary skill in the art without departing from the spirit and scope of the appended claims.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Executing Machine-Instructions (AREA)

Abstract

A method and system for controlling timing in a processor. In one aspect of the present invention, the method comprises fetching a plurality of instructions, wherein each instruction has a first default execution time during a first condition, and wherein each instruction has a second default execution time during a second condition; during a first mode, executing the plurality of instructions within a same execution time regardless of whether a condition is the first condition or the second condition; and during a second mode, executing the plurality of instructions within random execution time regardless of whether a condition is the first condition or the second condition. According to the system and method disclosed herein, the method effectively modifies the timing of a processor by controlling and/or minimizing variations in the execution times of instructions.

Description

METHOD AND SYSTEM FOR CONTROLLING TIMING IN A PROCESSOR
FIELD OF THE INVENTION
The present invention relates to computer systems, and more particularly to a method and system for controlling timing in a processor.
BACKGROUND OF THE INVENTION
A central processing unit (CPU) is the part of a computer that interprets and carries out instructions contained in software, which can have various functions such as controlling hardware, performing computations, communication with other software. The timing execution of instructions may vary, depending on a number of various conditions (e.g., status register contents, the value of a bit, the size of the following instructions, accessed peripherals, etc.).
Variations in timing execution can be a serious problem when the timing must be constant or predictable. For example, during software communication routines, a coprocessor must be synchronized with the CPU. Timing variations can also cause problems such as the leakage of sensitive information, etc.
Generally, known solutions are unreliable and time consuming to implement. For example, software routines are developed and manually balanced in Assembly Language to ensure that all possible paths execute in an equal number of clock cycles. This is an error prone and time-consuming process that also induces high maintenance costs and risks.
Accordingly, what is needed is an improved method and system for controlling timing in a CPU. The present invention addresses such a need.
SUMMARY OF THE INVENTION A method and system for controlling timing in a processor is disclosed. In one aspect of the present invention, the method comprises fetching a plurality of instructions, wherein each instruction has a first default execution time during a first condition, and wherein each instruction has a second default execution time during a second condition; during a first mode, executing the plurality of instructions within a same execution time regardless of whether a condition is the first condition or the second condition; and during a second mode, executing the plurality of instructions within random execution times regardless of whether a condition is the first condition or the second condition. According to the system and method disclosed herein, the method effectively modifies the timing of a processor by controlling and/or minimizing variations in the execution times of instructions.
BRIEF DESCRIPTION OF THE DRAWINGS
Figure 1 is a block diagram of a conventional computer system. Figure 2 is a block diagram of a processor, which may be used to implement the processor of Figure 1, in accordance with the present invention.
Figure 3 is a diagram illustrating a control register, which may be used to implement the one or more control registers of Figure 2, in accordance with the present invention.
Figure 4 is a flow chart showing a method for controlling timing in a processor, in accordance with the present invention.
Figure 5 is a timing diagram illustrating a skip instruction having a false condition (i.e., no skip), and where timing compensation is enabled in accordance with the present invention.
Figure 6 is a timing diagram illustrating a skip instruction having a true condition (i.e., skip), and where timing compensation is enabled in accordance with the present invention. Figure 7 is a timing diagram illustrating an instruction having controlled compensation in accordance with another embodiment of the present invention.
Figure 8 is a timing diagram illustrating a CPU loop on a skip instruction in accordance with another embodiment of the present invention.
DETAILED DESCRIPTION OF THE INVENTION
The present invention relates to computer systems, and more particularly to a method and system for controlling timing in a processor. The following description is presented to enable one of ordinary skill in the art to make and use the invention, and is provided in the context of a patent application and its requirements. Various modifications to the preferred embodiment and the generic principles and features described herein will be readily apparent to those skilled in the art. Thus, the present invention is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features described herein.
A method and system in accordance with the present invention for controlling timing in a processor are disclosed. The method includes controlling the execution times in which a processor executes particular types of instructions in order to improve the overall security of the processor. According to the system and method disclosed herein, the method effectively modifies the timing of a processor by controlling and/or minimizing variations in the execution times of instructions. During a timing compensation mode, instructions are executed within a same execution time regardless of whether a condition is true or false. During a controlled compensation mode, instructions are executed within random execution times regardless of whether a condition true or false. To more particularly describe the features of the present invention, refer now to the following description in conjunction with the accompanying figures.
Although the present invention disclosed herein is described in the context of CPUs, branch instructions, and skip instructions, the present invention may apply to other types of processors and other types of instructions, and still remain within the spirit and scope of the present invention. Figure 1 is a block diagram of a conventional computer system. The computer system 100 includes a processor 102, a bus 104, system memory 106 (e.g., hard drive, random access memory (RAM)), I/O devices 108 (e.g., keyboard, display, mouse, etc.), and a network interface 110 for connecting to a network such as a local area network (LAN) or the Internet. Figure 2 is a block diagram of a processor 200, which may be used to implement the processor 102 of Figure 1 , in accordance with the present invention. The processor 200 includes a control mechanism 201, which has one or more control registers 202. Figure 3 is a diagram illustrating a control register 300, which may be used to implement the one or more control registers 202 of Figure 2, in accordance with the present invention. The control register 300 includes two bits 302 and 304. The operation of the control register 300 is described in further detail below.
Timing compensation, in accordance with the present invention, refers to a process that provides constant execution timing of instructions. In one implementation, timing compensation is applied to the branch and skip instructions, but may apply to other types of instructions. Table 1 shows a list of various types of branch instructions 320 and skip instructions 322. The timing execution of branch and skip instructions typically varies, because the number of cycles required to execute a given instruction varies. A conditional branch or conditional skip instruction executes in a different number of cycles depending on the condition being true or false. For example, as shown in column 330 of Table 1, the default timing execution for a branch instruction may range from one to two cycles, and the default timing execution for a skip instruction may range from one to three cycles. In accordance with the present invention, a control mechanism 201 varies the number of cycles it takes to execute particular instructions. During timing compensation, the execution time is the same regardless of the condition. During controlled compensation, the execution time random regardless of the condition, which prevents leakage of information. The control mechanism 201 is a digital block that compensates or controls (randomizes) the number of cycles taken by a conditional instruction to execute.
The equalization or randomization may be performed automatically by software, which is advantageous over manual operations, since manual operations are prone to error, time consuming, have high-maintenance costs, and are not compatible with high- level languages such as C. The control mechanism 201 improves execution timing, especially in time-sensitive applications, by minimizing the variations in execution times of different types of instructions as well as variations in power signatures. For example, as shown in column 332 of Table 1, the balanced timing execution (i.e., with timing compensated) for a branch instruction is set to three cycles, and the balanced timing execution for a skip instruction is set to four cycles. The specific number of cycles for branch and skip instructions will depend on the specific implementation.
Referring again to Figure 3, in one embodiment, when the bit 302 (also labeled "Bit 0-TCE" (timing compensation enable)) is set by software, the timing compensation feature is enabled and all branch and skip instruction timing executions will take three cycles for branch instructions and four cycles for skip instructions. Of course the specific number cycles will depend on the specific implementation. When the bit 302 is cleared, all branches and skip instructions will follow the default timing execution. In one embodiment, when the bit 304 (also labeled "Bit 1-CCE" (controlled compensation enable)) is set by software and the TCE bit is also set, the controlled compensation mechanism is enabled. When this bit is cleared, the controlled compensation mechanism is disabled. In a preferred embodiment, any attempt to set this bit when TCE is cleared has no effect. In one embodiment, the bit 302 is the "master switch" whereas the bit 304 is an "option selector." The bit 302 is used to switch the compensation ON, and the bit 304 selects whether balancing or randomization is selected. In an alternative embodiment, one of the two options may be offered. For example, a single bit may switch ON/OFF one type of compensation (e.g., timing compensation). Figure 4 is a flow chart showing a method for controlling timing in a processor, in accordance with the present invention. Referring to both Figures 2 and 4, the process begins a step 402 when the processor 200 fetches a plurality of instructions. Each instruction has a first default execution time during a first condition (e.g., true), and each instruction has a second default execution time during a second condition (e.g., false). In one embodiment, the instructions may include different types of instructions (e.g., branch instructions and skip instructions). Next, in a step 404, during a first mode (i.e., timing compensation), the processor 200 executes the plurality of instructions within a same execution time regardless of whether a condition is the first condition or the second condition. Alternatively, in a step 406, during a second mode (i.e., controlled compensation), the processor 200 executes the plurality of instructions within random execution times regardless of whether a condition is the first condition or the second condition.
During timing compensation, the processor 200 executes at least one instruction of the plurality of instructions of a first type within a first predetermined execution time, wherein the first predetermined execution time is greater than a first default execution time. The processor 200 executes at least one instruction of the plurality of instructions of a second type within a second predetermined execution time, wherein the second predetermined execution time is greater than a second default execution time. In one embodiment, the first and second predetermined execution times are different. In another embodiment, the first and second predetermined execution times are the same. The first and second execution times are based on a number of cycles required to execute a given type of instruction. In this specific embodiment, the first predetermined execution time is greater than the first default execution time, and the second predetermined execution time is greater than the second default execution time. This enables the execution times of instructions of a given type of instruction to be the same. The specific type of instruction will depend on the specific implementation. For example, the first and second types of instruction can be conditional branch and skip instructions, respectively. Or, the first and second types of instruction can be skip and conditional branch instructions, respectively.
Figure 5 is a timing diagram illustrating a skip instruction having a false condition (i.e., no skip), and where timing compensation is enabled in accordance with the present invention. As shown in Figure 5, the default number of cycles required to execute this particular type of skip instruction is one cycle. After the processor 200 (Figure 2) fetches the skip instruction, the control mechanism 201 adds three cycles in order to increase the number of cycles required to execute the skip instruction from one cycle to four cycles. The specific number of cycles added will depend on the specific implementation, Figure 6 is a timing diagram illustrating a skip instruction having a true condition
(i.e., skip), and where timing compensation is enabled in accordance with the present invention. As shown in Figure 5, the default number of cycles required to execute this particular type of skip instruction is two cycles. After the processor fetches the skip instruction, the control mechanism 201 adds two cycles to increase the number of cycles required to execute the skip instruction from two cycles to four cycles. Figures 5 and 6 may also be applied to branch instructions or any other type of instructions. The key point is that the control mechanism 201 adds cycles if necessary so that the number of cycles required to execute a given type of instruction is controlled or the variations in execution timing are eliminated. Controlled compensation, in accordance with the present invention, refers to a process that provides random execution timing of instructions. Figure 7 is a timing diagram illustrating an instruction having controlled compensation in accordance with another embodiment of the present invention. In a preferred embodiment, a 3 -bit variable value controls the number of cycles taken by the process to execute a given type of instruction such as a skip instruction. Accordingly, 0 to 7 cycles or more, may be added to the instruction length to control execution timing. The processor determines the number of cycles, the number of which is random. For example, branch instructions may be executed in: 3 cycles + "3 bits number" which varies randomly from 3 cycles to 10 cycles, and skip instructions may be executed in: 4 cycles + "3 bits number" which varies from 4 cycles to 11 cycles.
Figure 8 is a timing diagram illustrating a CPU loop on a skip instruction in accordance with another embodiment of the present invention. In one implementation, the CPU loops such that the number of cycles taken to execute a skip instruction are random. According to the system and method disclosed herein, the present invention provides numerous benefits. For example, it automatically balances and controls timing variations (e.g., caused by conditional branches), making processor functions high-level- language friendly. Embodiments of the present invention also control execution timing to avoid information leakage to simplify the implementation of security features. Embodiments of the present invention also enable the slowing down of processor instruction execution to improve power consumption, access slow peripherals, spread the electromagnetic spectrum, etc. Embodiments of the present invention also balance access time to different memories (e.g., random access memory (RAM), non-volatile memories).
A method and system in accordance with the present invention for controlling timing in a processor has been disclosed. The method includes controlling the execution times in which a CPU executes particular types of instructions in order to improve the overall security of the CPU. According to the system and method disclosed herein, the method effectively modifies the timing of a processor by controlling and/or minimizing variations in the execution times of instructions.
The present invention has been described in accordance with the embodiments shown. One of ordinary skill in the art will readily recognize that there could be variations to the embodiments, and that any variations would be within the spirit and scope of the present invention. For example, the present invention can be implemented using hardware, software, a computer readable medium containing program instructions, or a combination thereof. Software written according to the present invention is to be either stored in some form of computer-readable medium such as memory or CD-ROM, or is to be transmitted over a network, and is to be executed by a processor. Consequently, a computer-readable medium is intended to include a computer readable signal, which may be, for example, transmitted over a network. Accordingly, many modifications may be made by one of ordinary skill in the art without departing from the spirit and scope of the appended claims.

Claims

CLAIMS What is claimed is:
1. A method for controlling timing in a processor, the method comprising: fetching a plurality of instructions, wherein each instruction has a first default execution time during a first condition, and wherein each instruction has a second default execution time during a second condition; during a first mode, executing the plurality of instructions within a same execution time regardless of whether a condition is the first condition or the second condition; and during a second mode, executing the plurality of instructions within random execution times regardless of whether a condition is the first condition or the second condition.
2. The method of claim 1 wherein the first condition is true and the second condition is false.
3. The method of claim 1 wherein the first condition is false and the second condition is true.
4. The method of claim 1 further comprising: executing at least one instruction of the plurality of instructions of a first type within a first predetermined execution time, wherein the first predetermined execution time is greater than a first default execution time; and executing at least one instruction of the plurality of instructions of a second type within a second predetermined execution time, wherein the second predetermined execution time is greater than a second default execution time.
5. The method of claim 4 wherein the first and second predetermined execution times are the same.
6. The method of claim 4 wherein the first and second predetermined execution times are different.
7. The method of claim 4 wherein the first type of instruction is a branch instruction and the second type of instruction is a skip instruction.
8. The method of claim 4 wherein the first type of instruction is a skip instruction and the second type of instruction is a conditional branch instruction.
9. The method of claim 4 wherein the first predetermined execution time is based on a number of cycles required to execute the at least one instruction.
10. The method of claim 9 wherein the executing comprises adjusting a first execution time for executing instructions of the first type of instruction to the first predetermined execution time by increasing the number of cycles required to execute the at least one instruction.
11. The method of claim 4 wherein the first predetermined execution time is based on a number of cycles required to execute the at least one instruction.
12. The method of claim 11 wherein the executing comprises adjusting a first execution time for executing instructions of the first type of instruction to the first predetermined execution time by increasing the number of cycles required to execute the at least one instruction.
13. The method of claim 4 wherein the first predetermined time is based on a variable value.
14. The method of claim 13 wherein the variable value is random.
15. The method of claim 13 wherein the variable value controls the number of cycles taken by the processor to execute a given type of instruction.
16. The method of claim 15 wherein the variable value increases the number of cycles taken by the processor to execute a given type of instruction by at least one cycle.
17. A computer-readable medium containing program instructions for controlling timing in a processor, the program instructions which when executed by a computer system cause the computer system to execute a method comprising: fetching a plurality of instructions, wherein each instruction has a first default execution time during a first condition, and wherein each instruction has a second default execution time during a second condition; during a first mode, executing the plurality of instructions within a same execution time regardless of whether a condition is the first condition or the second condition; and during a second mode, executing the plurality of instructions within random execution times regardless of whether a condition is the first condition or the second condition.
18. The computer-readable medium of claim 17 wherein the first condition is true and the second condition is false.
19. The computer-readable medium of claim 17 wherein the first condition is false and the second condition is true.
20. The computer-readable medium of claim 17 further comprising program instructions for: executing at least one instruction of the plurality of instructions of a first type within a first predetermined execution time, wherein the first predetermined execution time is greater than a first default execution time; and executing at least one instruction of the plurality of instructions of a second type within a second predetermined execution time, wherein the second predetermined execution time is greater than a second default execution time.
21. The computer-readable medium of claim 20 wherein the first and second predetermined execution times are the same.
22. The computer-readable medium of claim 20 wherein the first and second predetermined execution times are different.
23. The computer-readable medium of claim 20 wherein the first type of instruction is a branch instruction and the second type of instruction is a skip instruction.
24. The computer-readable medium of claim 20 wherein the first type of instruction is a skip instruction and the second type of instruction is a conditional branch instruction.
25. The computer-readable medium of claim 20 wherein the first predetermined execution time is based on a number of cycles required to execute the at least one instruction.
26. The computer-readable medium of claim 25 wherein the executing comprises program instructions for adjusting a first execution time for executing instructions of the first type of instruction to the first predetermined execution time by increasing the number of cycles required to execute the at least one instruction.
27. The computer-readable medium of claim 20 wherein the first predetermined execution time is based on a number of cycles required to execute the at least one instruction.
28. The computer-readable medium of claim 27 wherein the executing comprises program instructions for adjusting a first execution time for executing instructions of the first type of instruction to the first predetermined execution time by increasing the number of cycles required to execute the at least one instruction.
29. The computer-readable medium of claim 20 wherein the first predetermined time is based on a variable value.
30. The computer-readable medium of claim 29 wherein the variable value is random.
31. The computer-readable medium of claim 29 wherein the variable value controls the number of cycles taken by the processor to execute a given type of instruction.
32. The computer-readable medium of claim 31 wherein the valuable value increases the number of cycles taken by the processor to execute a given type of instruction by at least one cycle.
33. A system for controlling timing in a processor, the system comprising: a processor for fetching a plurality of instructions, wherein each instruction has a first default execution time during a first condition, and wherein each instruction has a second default execution time during a second condition; and at least one register for enabling timing compensation, wherein during a first mode, the processor executes the plurality of instructions within a same execution time regardless of whether a condition is the first condition or the second condition, and wherein during a second mode, the processor executes the plurality of instructions within random execution times regardless of whether a condition is the first condition or the second condition.
34. The system of claim 33 wherein, during the first mode, the processor executes at least one instruction of the plurality of instructions of a first type within a first predetermined execution time, wherein the first predetermined execution time is greater than a first default execution time, and wherein the processor executes at least one instruction of the plurality of instructions of a second type within a second predetermined execution time, wherein the second predetermined execution time is greater than a second default execution time.
35. The system of claim 34 wherein the first and second predetermined execution times are the same.
36. The system of claim 34 wherein the first and second predetermined execution times are different.
37. The system of claim 34 wherein the first type of instruction is a branch instruction and the second type of instruction is a skip instruction.
38. The system of claim 34 wherein the first type of instruction is a skip instruction and the second type of instruction is a conditional branch instruction.
39. The system of claim 34 wherein the first predetermined execution time is based on a number of cycles required to execute the at least one instruction.
40. The system of claim 39 wherein the processor adjusts a first execution time for executing instructions of the first type of instruction to the first predetermined execution time by increasing the number of cycles required to execute the at least one instruction.
41. The system of claim 34 wherein the first predetermined execution time is based on a number of cycles required to execute the at least one instruction.
42. The system of claim 41 wherein the processor adjusts a first execution time for executing instructions of the first type of instruction to the first predetermined execution time by increasing the number of cycles required to execute the at least one instruction.
43. The system of claim 34 wherein the first predetermined time is based on a variable value.
44. The system of claim 43 wherein the variable value is random.
45. The system of claim 34 wherein the variable value controls the number of cycles taken by the processor to execute a given type of instruction.
46. The system of claim 45 wherein the variable value increases the number of cycles taken by the processor to execute a given type of instruction by at least one cycle.
PCT/US2006/020569 2006-05-02 2006-05-26 Method and system for controlling timing in a processor Ceased WO2007130074A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2006800544413A CN101432691B (en) 2006-05-02 2006-05-26 Method and system for controlling timing in a processor

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US11/416,651 2006-05-02
US11/416,651 US7647486B2 (en) 2006-05-02 2006-05-02 Method and system having instructions with different execution times in different modes, including a selected execution time different from default execution times in a first mode and a random execution time in a second mode

Publications (1)

Publication Number Publication Date
WO2007130074A1 true WO2007130074A1 (en) 2007-11-15

Family

ID=38662483

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2006/020569 Ceased WO2007130074A1 (en) 2006-05-02 2006-05-26 Method and system for controlling timing in a processor

Country Status (4)

Country Link
US (1) US7647486B2 (en)
CN (1) CN101432691B (en)
TW (1) TWI347552B (en)
WO (1) WO2007130074A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090089555A1 (en) * 2007-09-28 2009-04-02 James Adam Cataldo Methods and apparatus for executing or converting real-time instructions
DE102009047024A1 (en) * 2009-11-23 2011-05-26 Beckhoff Automation Gmbh Parallelized program control
US9530398B2 (en) 2012-12-06 2016-12-27 White Eagle Sonic Technologies, Inc. Method for adaptively scheduling ultrasound system actions
US9529080B2 (en) 2012-12-06 2016-12-27 White Eagle Sonic Technologies, Inc. System and apparatus having an application programming interface for flexible control of execution ultrasound actions
US10499884B2 (en) 2012-12-06 2019-12-10 White Eagle Sonic Technologies, Inc. System and method for scanning for a second object within a first object using an adaptive scheduler
US10076313B2 (en) 2012-12-06 2018-09-18 White Eagle Sonic Technologies, Inc. System and method for automatically adjusting beams to scan an object in a body
US9983905B2 (en) 2012-12-06 2018-05-29 White Eagle Sonic Technologies, Inc. Apparatus and system for real-time execution of ultrasound system actions
CN113095446B (en) * 2021-06-09 2021-09-03 中南大学 Abnormal behavior sample generation method and system
CN115640046B (en) * 2021-07-20 2025-10-03 荣耀终端股份有限公司 Command sending method, storage medium and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5944833A (en) * 1996-03-07 1999-08-31 Cp8 Transac Integrated circuit and method for decorrelating an instruction sequence of a program

Family Cites Families (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4558176A (en) * 1982-09-20 1985-12-10 Arnold Mark G Computer systems to inhibit unauthorized copying, unauthorized usage, and automated cracking of protected software
US5165033A (en) 1983-07-25 1992-11-17 Hitachi, Ltd. Microprocessor and data processor using the former
US5034880A (en) 1988-12-22 1991-07-23 Wang Laboratories, Inc. Apparatus and method for executing a conditional branch instruction
JP2680899B2 (en) 1989-08-28 1997-11-19 日本電気株式会社 Information processing apparatus and control method therefor
EP0471888B1 (en) 1989-08-28 1999-01-13 Nec Corporation Microprocessor for enhancing initiation of instruction execution after the execution of conditional branch instruction
JP2834862B2 (en) 1990-07-13 1998-12-14 松下電器産業株式会社 Processor
US5539911A (en) 1991-07-08 1996-07-23 Seiko Epson Corporation High-performance, superscalar-based computer system with out-of-order instruction execution
KR100299691B1 (en) 1991-07-08 2001-11-22 구사마 사부로 Scalable RSC microprocessor architecture
TW380238B (en) 1996-12-09 2000-01-21 Matsushita Electric Industrial Co Ltd Information processing apparatus which accurately predicts whether a branch is taken for a conditional branch instruction, using small-scale hardware
US20010054137A1 (en) 1998-06-10 2001-12-20 Richard James Eickemeyer Circuit arrangement and method with improved branch prefetching for short branch instructions
US6230261B1 (en) 1998-12-02 2001-05-08 I. P. First, L.L.C. Method and apparatus for predicting conditional branch instruction outcome based on branch condition test type
JP4050857B2 (en) 1999-04-27 2008-02-20 矢崎総業株式会社 Fluid discrimination device and flow rate measuring device
JP2001094550A (en) * 1999-09-17 2001-04-06 Toshiba Corp Signal processing device
US6598152B1 (en) 1999-11-08 2003-07-22 International Business Machines Corporation Increasing the overall prediction accuracy for multi-cycle branch prediction and apparatus by enabling quick recovery
FR2807591B1 (en) * 2000-04-06 2003-08-08 Gemplus Card Int COUNTER-MEASUREMENT PROCESS FOR A MICRO-CONTROLLER BASED ON AN "PIPELINE" ARCHITECTURE
JP3672874B2 (en) * 2002-01-25 2005-07-20 Necマイクロシステム株式会社 Data processing device
US7076640B2 (en) 2002-02-05 2006-07-11 Sun Microsystems, Inc. Processor that eliminates mis-steering instruction fetch resulting from incorrect resolution of mis-speculated branch instructions
US7949883B2 (en) * 2004-06-08 2011-05-24 Hrl Laboratories, Llc Cryptographic CPU architecture with random instruction masking to thwart differential power analysis
JP4342464B2 (en) * 2005-03-29 2009-10-14 富士通マイクロエレクトロニクス株式会社 Microcontroller

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5944833A (en) * 1996-03-07 1999-08-31 Cp8 Transac Integrated circuit and method for decorrelating an instruction sequence of a program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
PUSCHNER ET AL.: "Avoiding timing problems in real-time software", PROC. IEEE COMPUTER SOCIETY'S WORKSHOP ON SOFTWARE TECHNOLOGIES FOR FUTURE EMBEDDED SYSTEMS, May 2003 (2003-05-01), pages 75 - 78, XP010640293 *

Also Published As

Publication number Publication date
CN101432691A (en) 2009-05-13
US7647486B2 (en) 2010-01-12
US20070260861A1 (en) 2007-11-08
CN101432691B (en) 2011-11-16
TWI347552B (en) 2011-08-21
TW200818004A (en) 2008-04-16

Similar Documents

Publication Publication Date Title
KR101745446B1 (en) Mechanism to provide high performance and fairness in a multi-threading computer system
TWI807877B (en) Processors, methods, systems, and instructions to protect shadow stacks
US6134653A (en) RISC processor architecture with high performance context switching in which one context can be loaded by a co-processor while another context is being accessed by an arithmetic logic unit
EP3757829B1 (en) Processor instruction support for mitigating controlled-channel and cache-based side-channel attacks
CN111611096A (en) Restricted speculative execution
CN113051626A (en) Method and device for multi-key full memory encryption based on dynamic key derivation
KR20170097018A (en) Apparatus and method for vector broadcast and xorand logical instruction
KR20210110598A (en) Security predictor for speculative execution
US20220206819A1 (en) Dynamic detection of speculation vulnerabilities
EP3798854A1 (en) Apparatuses, methods, and systems for processor non-write-back capabilities
US7647486B2 (en) Method and system having instructions with different execution times in different modes, including a selected execution time different from default execution times in a first mode and a random execution time in a second mode
US20190212935A1 (en) Lazy memory deduplication
EP3329361B1 (en) Vector operand bitsize control
CN110659066A (en) Processor instruction support for defeating side-channel attacks
EP2972820A1 (en) Minimizing switchover time during operating system kernel update in a hot swappable program memory
GB2024475A (en) Memory access controller
EP3314428B1 (en) Method and apparatus for execution mode selection
CN114692139A (en) Reinforcing loading hardware for speculative vulnerabilities
US10545735B2 (en) Apparatus and method for efficient call/return emulation using a dual return stack buffer
US20110231637A1 (en) Central processing unit and method for workload dependent optimization thereof
KR20070004705A (en) Electronic circuits and how they work
JPH06236272A (en) Method and system for enhancement of efficiency of synchronization of superscalar processor system
EP4020279A1 (en) Hardening store hardware against speculation vulnerabilities
US20220207149A1 (en) Data tainting to mitigate speculation vulnerabilities
CN114692142A (en) Strengthening branch hardware for speculative vulnerabilities

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 06771377

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 200680054441.3

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 06771377

Country of ref document: EP

Kind code of ref document: A1