JP2014119953A - Computer and interrupt service routine execution method - Google Patents

Computer and interrupt service routine execution method Download PDF

Info

Publication number
JP2014119953A
JP2014119953A JP2012274492A JP2012274492A JP2014119953A JP 2014119953 A JP2014119953 A JP 2014119953A JP 2012274492 A JP2012274492 A JP 2012274492A JP 2012274492 A JP2012274492 A JP 2012274492A JP 2014119953 A JP2014119953 A JP 2014119953A
Authority
JP
Japan
Prior art keywords
interrupt
instruction
decryption key
decryption
service routine
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.)
Pending
Application number
JP2012274492A
Other languages
Japanese (ja)
Inventor
Hideki Matsuyama
英樹 松山
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.)
Renesas Electronics Corp
Original Assignee
Renesas Electronics 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 Renesas Electronics Corp filed Critical Renesas Electronics Corp
Priority to JP2012274492A priority Critical patent/JP2014119953A/en
Publication of JP2014119953A publication Critical patent/JP2014119953A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To enable execution of coded interrupt service routines on a computer.SOLUTION: In one embodiment, a computer (1) is configured to respond to occurrence of a first interrupt by having a control unit (14) send an interrupt pseudo instruction (IPI) for branching to a first interrupt service routine to an instruction processing unit (11). The interrupt pseudo instruction (IPI) is associated with a first decoding key identifier corresponding to the first interrupt. The computer (1) is also configured to set a decoding key corresponding to the first decoding key identifier in a decoding circuit (50) in association with execution of the interrupt pseudo instruction (IPI) by the instruction processing unit (11), and have the decoding circuit (50) decode the first coded interrupt service routine.

Description

本発明は、コンピュータに関し、例えば、暗号化されたプログラムコードを復号化して実行するコンピュータに好適に利用できるものである。   The present invention relates to a computer and can be suitably used for, for example, a computer that decrypts and executes an encrypted program code.

特許文献1〜3は、暗号化されたプログラムコード(命令ルーチン)を復号化して実行するコンピュータを開示している。例えば、特許文献1に開示されたコンピュータは、暗号化されたプログラムコードを外部メモリからリードし、プロセッサにより指定された鍵識別子に対応する復号鍵を用いて暗号化されたプログラムコードを復号化し、復号化されたプログラムコードをキャッシュメモリに格納する。そして、プロセッサは、復号化されたプログラムコードをキャッシュメモリからリードして実行する。   Patent Documents 1 to 3 disclose a computer that decrypts and executes an encrypted program code (instruction routine). For example, the computer disclosed in Patent Document 1 reads the encrypted program code from the external memory, decrypts the encrypted program code using the decryption key corresponding to the key identifier specified by the processor, The decrypted program code is stored in the cache memory. Then, the processor reads the decrypted program code from the cache memory and executes it.

また、特許文献1では、プログラムコードは、非耐タンパ状態から耐タンパ状態に移行するための明示的な命令を含む。コンピュータは、当該命令を実行することで、非耐タンパ状態から耐タンパ状態に移行する。当該命令は、暗号化されたプログラムコードを格納したメモリブロックの先頭アドレスと、復号鍵のアドレスを指定する。   Further, in Patent Document 1, the program code includes an explicit instruction for shifting from the non-tamper resistant state to the tamper resistant state. The computer shifts from the non-tamper resistant state to the tamper resistant state by executing the instruction. This instruction designates the start address of the memory block storing the encrypted program code and the address of the decryption key.

さらに、特許文献1に開示されたコンピュータは、ハードウェ割り込みの発生時に耐タンパ状態から非耐タンパ状態に移行することを記載している。つまり、特許文献1に開示されたコンピュータは、割り込みサービスルーチン(割り込みハンドラ)を非耐タンパ状態で実行する。   Furthermore, it is described that the computer disclosed in Patent Document 1 shifts from a tamper resistant state to a non-tamper resistant state when a hardware interrupt occurs. That is, the computer disclosed in Patent Document 1 executes an interrupt service routine (interrupt handler) in a non-tamper resistant state.

特開2003−51819号公報JP 2003-51819 A 特開2009−301565号公報JP 2009-301565 A 特開2009−278491号公報JP 2009-278491 A

特許文献1のコンピュータは、ハードウェア割り込みの発生時に、割り込みサービスルーチン(割り込みハンドラ)を非耐タンパ状態で実行する。従って、コンピュータに供給するために不揮発性メモリ(例えば、マスクROM(Read Only Memory)、プログラマブルROM、フラッシュメモリ、又はハードディスクドライブ)に格納された割り込みサービスルーチンは暗号化されていない。しかしながら、コンピュータの様々な利用シナリオを想定した場合、暗号化された割り込みサービスルーチンを利用できることが好ましい。特許文献1〜3に開示されたコンピュータは、暗号化された割り込みサービスルーチンをコンピュータにおいて実行することができないという課題を有する。その他の課題と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。   The computer of Patent Literature 1 executes an interrupt service routine (interrupt handler) in a non-tamper resistant state when a hardware interrupt occurs. Therefore, interrupt service routines stored in non-volatile memory (eg, mask ROM (Read Only Memory), programmable ROM, flash memory, or hard disk drive) for supply to a computer are not encrypted. However, assuming various computer usage scenarios, it is preferable to be able to use an encrypted interrupt service routine. The computers disclosed in Patent Documents 1 to 3 have a problem that the encrypted interrupt service routine cannot be executed on the computer. Other problems and novel features will become apparent from the description of the specification and the accompanying drawings.

一実施形態において、コンピュータは、第1の割り込みの発生に応答して、第1の割り込みサービスルーチンに分岐するための割り込み擬似命令を制御ユニットから命令処理ユニットに投入するよう構成されている。前記割り込み擬似命令は、前記第1の割り込みに対応する第1の復号鍵識別子に関連付けられる。さらに、前記コンピュータは、前記命令処理ユニットにおける前記割り込み擬似命令の実行に基づいて前記第1の復号鍵識別子に対応する復号鍵を復号回路に設定するとともに、暗号化された第1の割り込みサービスルーチンを前記復号回路において復号化するよう構成されている。   In one embodiment, the computer is configured to inject an interrupt pseudo-instruction for branching to the first interrupt service routine from the control unit to the instruction processing unit in response to the occurrence of the first interrupt. The interrupt pseudo instruction is associated with a first decryption key identifier corresponding to the first interrupt. Further, the computer sets a decryption key corresponding to the first decryption key identifier in the decryption circuit based on execution of the interrupt pseudo-instruction in the instruction processing unit, and an encrypted first interrupt service routine Is decoded by the decoding circuit.

上述した実施形態は、暗号化された割り込みサービスルーチンをコンピュータにおいて実行することができる。   The above-described embodiments can execute an encrypted interrupt service routine in a computer.

第1の実施形態に係るコンピュータの第1の構成例を示すブロック図である。It is a block diagram which shows the 1st structural example of the computer which concerns on 1st Embodiment. 図1に示された割り込みベクタテーブルの構成例を示すブロック図である。FIG. 2 is a block diagram illustrating a configuration example of an interrupt vector table illustrated in FIG. 1. 第1の実施形態に係る割り込みサービスルーチンの実行方法の一例を示すフローチャートである。It is a flowchart which shows an example of the execution method of the interruption service routine which concerns on 1st Embodiment. 第1の実施形態に係るコンピュータの第2の構成例を示すブロック図である。It is a block diagram which shows the 2nd structural example of the computer which concerns on 1st Embodiment. 図4に示された割り込みコントローラの構成例を示すブロック図である。FIG. 5 is a block diagram illustrating a configuration example of an interrupt controller illustrated in FIG. 4. 第2の実施形態に係るコンピュータの構成例を示すブロック図である。It is a block diagram which shows the structural example of the computer which concerns on 2nd Embodiment. 第2の実施形態に係るトレースデータの出力制御方法の一例を示すフローチャートである。It is a flowchart which shows an example of the output control method of the trace data which concerns on 2nd Embodiment.

以下では、具体的な実施形態について、図面を参照しながら詳細に説明する。各図面において、同一又は対応する要素には同一の符号が付されており、説明の明確化のため、必要に応じて重複説明は省略される。   Hereinafter, specific embodiments will be described in detail with reference to the drawings. In each drawing, the same or corresponding elements are denoted by the same reference numerals, and redundant description is omitted as necessary for clarification of the description.

<第1の実施形態>
本実施形態に係るコンピュータ1は、第1の割り込みの発生に応答して、第1の割り込みサービスルーチン(ISR:Interrupt Service Routine)に分岐するための割り込み擬似命令(IPI:Interrupt Pseudo Instruction)を制御ロジック14から命令処理ユニット11に投入するよう構成されている。一例において、IPIは、第1の割り込みに対応する第1の復号鍵識別子(例えば、鍵番号KN)に関連付けられる。言い換えると、IPIは、第1の復号鍵識別子に対応する復号鍵の復号回路50への設定を引き起こす命令を含む。復号回路50は、命令処理ユニット11におけるIPIの実行に基づいて第1の復号鍵識別子に対応する復号鍵を設定する。これにより、第1のISRに分岐した命令処理ユニット11は、ISRを実行することができる。つまり、コンピュータ1は、暗号化されているISRを復号化した後に実行することができる。
<First Embodiment>
The computer 1 according to the present embodiment controls an interrupt pseudo instruction (IPI) for branching to a first interrupt service routine (ISR) in response to the occurrence of the first interrupt. The logic 14 is configured to be input to the instruction processing unit 11. In one example, the IPI is associated with a first decryption key identifier (eg, key number KN) corresponding to the first interrupt. In other words, the IPI includes an instruction that causes the decryption circuit 50 to set the decryption key corresponding to the first decryption key identifier. The decryption circuit 50 sets a decryption key corresponding to the first decryption key identifier based on the execution of IPI in the instruction processing unit 11. Thereby, the instruction processing unit 11 branched to the first ISR can execute the ISR. That is, the computer 1 can be executed after decrypting the encrypted ISR.

なお、CPU(Central Processing Unit)10は、複数の割り込み要因(例えば複数の周辺デバイスからの複数の割り込み)を扱うために複数のISRを実行する。一例において、複数のISRは、互いに異なる暗号鍵によって暗号化され、互いに異なる復号鍵による復号化を必要とする。したがって、制御ロジック14は、割り込み要因(又は割り込みベクタ)に対応する復号鍵(復号鍵識別子)を特定してもよい。具体的には、コンピュータ1は、複数の割り込み要因(又は割り込みベクタ)に対応する複数の復号鍵識別子を規定したレジストリを有してもよい。なお、当該レジストリは、CPU10に配置されてもよいし、割り込みベクタテーブル21に配置されてもよいし、割り込みコントローラ20に配置されてもよい。制御ロジック14は、発生した割り込みに対応する復号鍵(復号鍵識別子)を当該レジストリに基づいて特定すればよい。このようなアーキテクチャによれば、異なる復号鍵を必要とする複数のISRをコンピュータ1において実行することができる。   A CPU (Central Processing Unit) 10 executes a plurality of ISRs in order to handle a plurality of interrupt factors (for example, a plurality of interrupts from a plurality of peripheral devices). In one example, the plurality of ISRs are encrypted with different encryption keys and require decryption with different decryption keys. Therefore, the control logic 14 may specify a decryption key (decryption key identifier) corresponding to the interrupt factor (or interrupt vector). Specifically, the computer 1 may have a registry that defines a plurality of decryption key identifiers corresponding to a plurality of interrupt factors (or interrupt vectors). The registry may be arranged in the CPU 10, the interrupt vector table 21, or the interrupt controller 20. The control logic 14 may specify a decryption key (decryption key identifier) corresponding to the generated interrupt based on the registry. According to such an architecture, a plurality of ISRs that require different decryption keys can be executed in the computer 1.

本実施形態に係るコンピュータ1は、例えば、マイクロプロセッサ、マイクロコンピュータ、マイクロコントローラ、又はSoC(System on Chip)である。コンピュータ1は、1つのICチップのみで構成されてもよいし、複数のICチップにより構成されてもよい。以下では、本実施形態に係るコンピュータ1の構成及び動作の具体例について説明する。   The computer 1 according to the present embodiment is, for example, a microprocessor, a microcomputer, a microcontroller, or an SoC (System on Chip). The computer 1 may be composed of only one IC chip or may be composed of a plurality of IC chips. Below, the specific example of a structure and operation | movement of the computer 1 which concerns on this embodiment is demonstrated.

図1は、コンピュータ1の第1の構成例を示すブロック図である。CPU10は、命令処理ユニット11を含む。命令処理ユニット11は、命令をフェッチし、命令をデコードし、そして命令を実行する。命令処理ユニット11は、典型的には、命令パイプラインである。図1の構成例は、命令処理ユニット11は、命令フェッチユニット110、命令デコードユニット111、命令実行ユニット112、及びライトバックユニット113を含む。   FIG. 1 is a block diagram illustrating a first configuration example of the computer 1. The CPU 10 includes an instruction processing unit 11. The instruction processing unit 11 fetches instructions, decodes instructions, and executes the instructions. The instruction processing unit 11 is typically an instruction pipeline. In the configuration example of FIG. 1, the instruction processing unit 11 includes an instruction fetch unit 110, an instruction decode unit 111, an instruction execution unit 112, and a write back unit 113.

命令フェッチユニット110は、メモリ40に格納されているプログラムコードを、キャッシュメモリ30及びバスコントローラ13を介してフェッチする。命令デコードユニット111は、フェッチされた命令をデコードし、実行するべき演算種類(例えば、加減算、乗算、除算、又は論理演算)を決定し、必要な制御信号を生成する。命令実行ユニット112は、デコードされた命令に従って、CPU10の内部状態を変更する。すなわち、命令実行ユニット112は、複数の実行ユニット(例えば、ALU(Arithmetic Logic Unit)、乗算器、バレルシフタ、及びロード/ストアユニット)を有し、デコードされた命令に従った演算を実行する。ライトバックユニット113は、命令実行ユニット112の出力データをレジスタファイル12の汎用レジスタ(GPR:General Purpose Register)に書き込む。   The instruction fetch unit 110 fetches the program code stored in the memory 40 via the cache memory 30 and the bus controller 13. The instruction decode unit 111 decodes the fetched instruction, determines an operation type (for example, addition / subtraction, multiplication, division, or logical operation) to be executed, and generates a necessary control signal. The instruction execution unit 112 changes the internal state of the CPU 10 according to the decoded instruction. That is, the instruction execution unit 112 has a plurality of execution units (for example, an ALU (Arithmetic Logic Unit), a multiplier, a barrel shifter, and a load / store unit), and executes an operation according to the decoded instruction. The write back unit 113 writes the output data of the instruction execution unit 112 to a general purpose register (GPR: General Purpose Register) of the register file 12.

さらに、CPU10は、制御ロジック14、退避レジスタ15を含む。制御ロジック14は、ハードウェア割り込みを検出し、命令処理ユニット11による割り込みサービスルーチン(割り込みハンドラ)の実行を制御する。退避レジスタ15は、割り込みサービスルーチンに分岐する際に退避されるプログラムカウンタ(PC)160、プログラムステータスワード(PSW)レジスタ161、及び鍵番号(KN)レジスタ162を含む制御レジスタの値を保持する。なお、鍵番号(KN)レジスタ162は、CPU10において実行されているプログラムコードに適用される復号鍵番号を示す。   Further, the CPU 10 includes a control logic 14 and a save register 15. The control logic 14 detects a hardware interrupt and controls execution of an interrupt service routine (interrupt handler) by the instruction processing unit 11. The save register 15 holds values of control registers including a program counter (PC) 160, a program status word (PSW) register 161, and a key number (KN) register 162 that are saved when branching to an interrupt service routine. The key number (KN) register 162 indicates a decryption key number applied to the program code executed in the CPU 10.

割り込みコントローラ20は、1又は複数の周辺デバイスからの複数の割り込み(INT1、INT2、・・・)を受信し、複数の割り込みが同時に発生している場合はこれらの優先順位を判定し、割り込み要求信号(INTR)及び割り込み要因番号(INTNO)を出力する。INTRは割り込みの発生を示す。割り込み要因番号(INTNO)は、優先順位に基づいて選択された割り込み要因を示す番号である。図1の例では、割り込み要求信号(INTR)はCPU10の制御ロジック14に送られ、割り込み要因番号(INTNO)は割り込みベクタテーブル(IVT:Interrupt Vector Table)21に送られる。   The interrupt controller 20 receives a plurality of interrupts (INT1, INT2,...) From one or a plurality of peripheral devices. When a plurality of interrupts are simultaneously generated, the interrupt controller 20 determines the priority order of the interrupts and requests an interrupt. A signal (INTR) and an interrupt factor number (INTNO) are output. INTR indicates the occurrence of an interrupt. The interrupt factor number (INTNO) is a number indicating the interrupt factor selected based on the priority order. In the example of FIG. 1, an interrupt request signal (INTR) is sent to the control logic 14 of the CPU 10, and an interrupt factor number (INTNO) is sent to an interrupt vector table (IVT: Interrupt Vector Table) 21.

図1に示された割り込みベクタテーブル21は、複数の割り込みベクタに対応する複数の復号鍵識別子を規定している。割り込みベクタテーブル21は、割り込み番号信号(INTNO)を割り込みコントローラ20から受信し、割り込み番号信号(INTNO)に示された割り込み番号に関連付けられている割り込みベクタ(INTV)及び復号鍵番号(KN)を制御ロジック14に送る。ここで、割り込みベクタ(INTV)は、例えば、ベクタアドレスを示してもよい。ベクタアドレスは、ISRの開始アドレス、又はISRへの分岐命令が置かれたアドレスである。また、割り込みベクタ(INTV)は、ベクタアドレスを求めるためのオフセット、又はベクタアドレスを求めるためのベクタ番号を示してもよい。また、鍵番号(KN)は、復号鍵を特定するための鍵識別子の一例に過ぎない。つまり、割り込みベクタテーブル21は、鍵番号(KN)とは異なる他のコードを鍵識別子として格納してもよい。   The interrupt vector table 21 shown in FIG. 1 defines a plurality of decryption key identifiers corresponding to a plurality of interrupt vectors. The interrupt vector table 21 receives the interrupt number signal (INTNO) from the interrupt controller 20, and receives the interrupt vector (INTV) and the decryption key number (KN) associated with the interrupt number indicated by the interrupt number signal (INTNO). Send to control logic 14. Here, the interrupt vector (INTV) may indicate a vector address, for example. The vector address is an ISR start address or an address where a branch instruction to the ISR is placed. The interrupt vector (INTV) may indicate an offset for obtaining a vector address or a vector number for obtaining a vector address. The key number (KN) is only an example of a key identifier for specifying a decryption key. That is, the interrupt vector table 21 may store another code different from the key number (KN) as the key identifier.

CPU10の制御ロジック14は、割り込み要求信号(INTR)を受信すると、割り込みアクノリッジ信号(INTA)を割り込みコントローラ20に送る。制御ロジック14は、割り込みベクタテーブル21から割り込みベクタ(INTV)及び復号鍵番号(KN)を受信し、割り込み擬似命令(IPI)を生成する。そして、制御ロジック14は、IPIを命令処理ユニット11(具体的には命令実行ユニット112)に投入する。IPIは、割り込みベクタ及び復号鍵番号に関連付けられている。IPIは、割り込みベクタ及び復号鍵番号示す即値を含んでもよいし、割り込みベクタ及び復号鍵番号が格納されたレジスタを示してもよい。また、IPIは、複数の命令を含んでもよい。例えば、IPIは、以下の命令を含んでもよい。
・退避レジスタ15の書き換え命令;
・第1の復号鍵識別子に対応する復号鍵の復号回路50への設定を引き起こす命令;及び
・割り込みベクタに基づくアドレス(つまり、ISRの開始アドレス又はISRへの分岐命令のアドレス)へのジャンプを引き起こす命令。
When receiving the interrupt request signal (INTR), the control logic 14 of the CPU 10 sends an interrupt acknowledge signal (INTA) to the interrupt controller 20. The control logic 14 receives the interrupt vector (INTV) and the decryption key number (KN) from the interrupt vector table 21, and generates an interrupt pseudo instruction (IPI). Then, the control logic 14 inputs the IPI to the instruction processing unit 11 (specifically, the instruction execution unit 112). The IPI is associated with an interrupt vector and a decryption key number. The IPI may include an immediate value indicating an interrupt vector and a decryption key number, or may indicate a register in which the interrupt vector and the decryption key number are stored. The IPI may include a plurality of instructions. For example, the IPI may include the following instructions:
-Rewrite instruction of save register 15;
An instruction that causes the decryption key 50 to be set in the decryption circuit 50 corresponding to the first decryption key identifier; and Instruction to cause.

命令実行ユニット112は、IPIを受信した場合に、実行中の命令を中断し、プログラムカウンタ(PC)160、プログラムステータスワード(PSW)レジスタ161、及び鍵番号(KN)レジスタ162を含む制御レジスタの値を退避レジスタ15に退避する。そして、命令実行ユニット112は、鍵設定要求信号(KNREQ)、及びIPIによって示された鍵番号(KN)を復号回路50に送る。さらに、命令実行ユニット112は、IPIによって示された割り込みベクタからフェッチターゲットのアドレス(FADS)を生成する。このアドレス(FADS)は、ISRの開始アドレス又はISRへの分岐命令が置かれたアドレスを示す。命令実行ユニット112は、生成したアドレス(FADS)をPC160にセットし、アドレス(FADS)及びフェッチ要求(FREQ)を命令フェッチユニット110に送る。命令フェッチユニット110は、フェッチ要求をキャッシュメモリ30に送る。これにより、命令処理ユニット11は、ISRに分岐し、ISRを実行する。   When the instruction execution unit 112 receives the IPI, the instruction execution unit 112 suspends the instruction being executed, and controls the control registers including the program counter (PC) 160, the program status word (PSW) register 161, and the key number (KN) register 162. The value is saved in the save register 15. Then, the instruction execution unit 112 sends the key setting request signal (KNREQ) and the key number (KN) indicated by the IPI to the decryption circuit 50. Further, the instruction execution unit 112 generates a fetch target address (FADS) from the interrupt vector indicated by the IPI. This address (FADS) indicates the start address of the ISR or the address where the branch instruction to the ISR is placed. The instruction execution unit 112 sets the generated address (FADS) in the PC 160 and sends the address (FADS) and the fetch request (FREQ) to the instruction fetch unit 110. The instruction fetch unit 110 sends a fetch request to the cache memory 30. As a result, the instruction processing unit 11 branches to the ISR and executes the ISR.

キャッシュメモリ30は、ライン単位(例えば、16バイト又は32バイト)でメモリ40から命令をリードし、リードした命令を一時的に格納する。キャッシュメモリ30は、メモリ40からリードしたデータをキャッシュしてもよい。キャッシュメモリ30は、例えば、SRAM(Static Random Access Memory)である。メモリ40は、例えば、SRAM(つまり、セカンダリキャッシュ)、DRAM(Dynamic Random Access Memory)、マスクROM、プログラマブルROM、又はフラッシュメモリである。   The cache memory 30 reads an instruction from the memory 40 in line units (for example, 16 bytes or 32 bytes), and temporarily stores the read instruction. The cache memory 30 may cache data read from the memory 40. The cache memory 30 is, for example, an SRAM (Static Random Access Memory). The memory 40 is, for example, an SRAM (that is, a secondary cache), a DRAM (Dynamic Random Access Memory), a mask ROM, a programmable ROM, or a flash memory.

本実施形態では、命令処理ユニット11において実行される複数のプログラムコード(命令ルーチン)の少なくとも一部(1又は複数のISRを含む)は、暗号化された状態でメモリ40に格納されている。したがって、図1の構成例は、復号回路50を有する。復号回路50は、メモリ40から読み出される暗号化されたプログラムコードを復号化し、キャッシュメモリ30に格納する。復号回路50においてプログラムコードの復号化に使用される復号鍵は、CPU10によって指定される。具体的には、復号回路50は、デコーダ51及び鍵格納ユニット52を有する。鍵格納ユニット52は、それぞれ異なる復号鍵番号(例えば、KN1、KN2、・・・)に関連付けられた複数の復号鍵(例えば、KEY1、KEY2、・・・)を格納している。鍵格納ユニット52は、鍵設定要求信号(KNREQ)、及び復号鍵番号(KN)をCPU10(命令処理ユニット11)から受信し、CPU10より指定された復号鍵番号に対応する復号鍵をデコーダ51に設定する。   In the present embodiment, at least a part (including one or a plurality of ISRs) of a plurality of program codes (instruction routines) executed in the instruction processing unit 11 is stored in the memory 40 in an encrypted state. Therefore, the configuration example of FIG. The decryption circuit 50 decrypts the encrypted program code read from the memory 40 and stores it in the cache memory 30. The decryption key used for decrypting the program code in the decryption circuit 50 is designated by the CPU 10. Specifically, the decryption circuit 50 includes a decoder 51 and a key storage unit 52. The key storage unit 52 stores a plurality of decryption keys (for example, KEY1, KEY2,...) Associated with different decryption key numbers (for example, KN1, KN2,...). The key storage unit 52 receives the key setting request signal (KNREQ) and the decryption key number (KN) from the CPU 10 (command processing unit 11), and sends the decryption key corresponding to the decryption key number designated by the CPU 10 to the decoder 51. Set.

図2は、割り込みベクタテーブル21の構成例を示している。図2の例では、割り込み要因番号(INTNO)、割り込みベクタ(INTV)、及び復号鍵番号(KN)が関連付けて格納されている。図2の割り込みベクタ(INTV)は、ベクタ番号を示している。例えば、INTNO=0の割り込み要因に、INTV=64、KN=1が関連付けられている。INTNO=1の割り込み要因にINTV=65、KN=3が関連付けられている。また、INTNO=2の割り込み要因にINTV=66、KN=10が関連付けられている。   FIG. 2 shows a configuration example of the interrupt vector table 21. In the example of FIG. 2, an interrupt factor number (INTNO), an interrupt vector (INTV), and a decryption key number (KN) are stored in association with each other. The interrupt vector (INTV) in FIG. 2 indicates a vector number. For example, INTTV = 64 and KN = 1 are associated with the interrupt factor of INTNO = 0. INTTV = 65 and KN = 3 are associated with the interrupt factor of INTNO = 1. Further, INTTV = 66 and KN = 10 are associated with the interrupt factor of INTNO = 2.

図3は、CPU10における割り込みサービスルーチンの実行方法の一例を示すフローチャートである。ステップS11では、制御ロジック14は、割り込み要求信号(INTQ)を割り込みコントローラ20から受信する。ステップS12では、制御ロジック14は、割り込み要求信号(INTQ)の受信に反応して、割り込みベクタ(INTV)及び復号鍵番号(KN)を割り込みベクタテーブル21から取得する。既に述べたように、この復号鍵番号(KN)は、割り込みベクタ(INTV)によって特定されるISRの復号化に使用されるべき復号鍵を特定する。ステップS13では、制御ロジック14は、割り込み擬似命令(IPI)を生成する。IPIは、割り込みベクタ(INTV)及び復号鍵番号(KN)に関連付けられている。ステップS14では、制御ロジック14は、生成したIPIを命令処理ユニット11(命令実行ユニット112)に投入する。   FIG. 3 is a flowchart showing an example of an execution method of the interrupt service routine in the CPU 10. In step S <b> 11, the control logic 14 receives an interrupt request signal (INTQ) from the interrupt controller 20. In step S12, the control logic 14 acquires the interrupt vector (INTV) and the decryption key number (KN) from the interrupt vector table 21 in response to the reception of the interrupt request signal (INTQ). As already described, this decryption key number (KN) specifies the decryption key to be used for decryption of the ISR specified by the interrupt vector (INTV). In step S13, the control logic 14 generates an interrupt pseudo instruction (IPI). The IPI is associated with an interrupt vector (INTV) and a decryption key number (KN). In step S14, the control logic 14 inputs the generated IPI into the instruction processing unit 11 (instruction execution unit 112).

IPIを受信した命令実行ユニット112は、ステップS15において、実行中の命令を中断し、中断した命令に関するコンテクスト(PC160、PSW161、KN162)を退避レジスタ15に退避する。ステップS16では、命令実行ユニット112は、ISRの復号化に適用される復号鍵を復号回路50に設定する。具体的には、既に述べたように、命令実行ユニット112は、IPIによって指示された鍵番号(KN)と鍵設定要求信号(KNREQ)を復号回路50に送る。   In step S15, the instruction execution unit 112 that has received the IPI interrupts the instruction being executed, and saves the context (PC160, PSW161, KN162) relating to the interrupted instruction in the save register 15. In step S <b> 16, the instruction execution unit 112 sets a decryption key applied to the decryption of the ISR in the decryption circuit 50. Specifically, as already described, the instruction execution unit 112 sends the key number (KN) and key setting request signal (KNREQ) indicated by the IPI to the decryption circuit 50.

ステップS17では、命令処理ユニット11は、ISRに分岐し、ISRを実行する。命令フェッチユニット110によってキャッシュメモリ30からフェッチされるISRの命令は、復号回路50によってデコードされている。したがって、CPU10は、暗号化された状態でメモリ40に格納されているISRを実行することができる。   In step S17, the instruction processing unit 11 branches to the ISR and executes the ISR. The ISR instruction fetched from the cache memory 30 by the instruction fetch unit 110 is decoded by the decoding circuit 50. Therefore, the CPU 10 can execute the ISR stored in the memory 40 in an encrypted state.

なお、ISRの処理が完了すると、CPU10は、中断した命令に復帰する。図1の構成例では、中断した命令のPC及びPSWに加えて、中断した命令(中断したプログラムコード)に適用される復号鍵の番号を退避レジスタ15に退避している。したがって、CPU10は、復号鍵番号を含むコンテクストをPC160、PSWレジスタ161、KNレジスタ162に戻し、中断した命令に復帰する。これにより、コンピュータ1は、中断したプログラムコードの復号化を復号回路50において再開することができ、中断したプログラムコードのCPU10における実行を継続することができる。   When the ISR process is completed, the CPU 10 returns to the interrupted instruction. In the configuration example of FIG. 1, the decryption key number applied to the interrupted instruction (interrupted program code) is saved in the save register 15 in addition to the PC and PSW of the interrupted instruction. Therefore, the CPU 10 returns the context including the decryption key number to the PC 160, the PSW register 161, and the KN register 162, and returns to the interrupted instruction. Thereby, the computer 1 can restart decoding of the interrupted program code in the decoding circuit 50, and can continue execution of the interrupted program code in the CPU 10.

続いて以下では、コンピュータ1の他の構成例について説明する。図4は、コンピュータ1の第2の構成例を示すブロック図である。図4の構成例では、割り込みコントローラ200が、複数の割り込み要因(又は複数のISR)に対応する複数の復号鍵番号を管理する。そして、割り込みコントローラ200は、割り込みの発生時に、割り込み要求(INTR)及び復号鍵番号(KN)を制御ロジック14に供給する。例えば、割り込みコントローラ200は、複数の割り込み要因に対応する複数の復号鍵番号を定めた1又は複数のレジスタを有してもよい。図4に示された割り込みベクタテーブル210は、割り込み番号(INTNO)と割り込みベクタ(INTV)を関連付けて保持すればよい。   Subsequently, another configuration example of the computer 1 will be described below. FIG. 4 is a block diagram illustrating a second configuration example of the computer 1. In the configuration example of FIG. 4, the interrupt controller 200 manages a plurality of decryption key numbers corresponding to a plurality of interrupt factors (or a plurality of ISRs). Then, the interrupt controller 200 supplies an interrupt request (INTR) and a decryption key number (KN) to the control logic 14 when an interrupt occurs. For example, the interrupt controller 200 may include one or a plurality of registers that define a plurality of decryption key numbers corresponding to a plurality of interrupt factors. The interrupt vector table 210 shown in FIG. 4 may hold the interrupt number (INTNO) and the interrupt vector (INTV) in association with each other.

図5は、割り込みコントローラ200の構成例を示している。割り込みコントローラ200は、複数の割り込み要因レジスタ201を有する。各割り込み要因レジスタ201は、対応する割り込み(INT0、INT1など)の有無をフラグ、割り込みの優先度(PRI)、及び鍵番号(KN)を格納する。つまり、図5の構成例では、各割り込み要因レジスタ201は、各割り込み要因に対応する鍵番号の設定値を保持している。要因選択回路202は、フラグを参照して発生している割り込みを検知し、優先度(PRI)に基づいてCPU10に通知する割り込み要因を選択する。そして、要因選択回路202は、割り込み要求信号(INTR)、並びに選択した割り込み要因に対応する割り込み番号(INTNO)及び鍵番号(KN)を出力する。   FIG. 5 shows a configuration example of the interrupt controller 200. The interrupt controller 200 has a plurality of interrupt factor registers 201. Each interrupt factor register 201 stores the presence / absence of a corresponding interrupt (INT0, INT1, etc.), an interrupt priority (PRI), and a key number (KN). That is, in the configuration example of FIG. 5, each interrupt factor register 201 holds a set value of a key number corresponding to each interrupt factor. The factor selection circuit 202 detects an interrupt that has occurred with reference to the flag, and selects an interrupt factor to be notified to the CPU 10 based on the priority (PRI). Then, the factor selection circuit 202 outputs an interrupt request signal (INTR), an interrupt number (INTNO) and a key number (KN) corresponding to the selected interrupt factor.

<第2の実施形態>
本実施形態では、第1の実施形態に係るコンピュータ1の変形例について説明する。図6は、本実施形態に係るコンピュータ2の構成例を示すブロック図である。本実施の形態に係るコンピュータ2は、比較回路61及びトレース出力回路62を有する。比較回路61は、暗号化されたプログラムコードの復号化のために復号回路50(デコーダ51)に適用されている復号鍵番号を、トレース対象プログラムコードに関連付けられた復号鍵番号と比較するよう構成されている。トレース出力回路62は、2つの鍵番号が比較回路61において一致することを条件として、命令処理ユニット11の命令実行状況を示すトレースデータを出力するよう構成されている。トレース対象プログラムコードに関連付けられた復号鍵番号は、トレース用鍵番号レジスタ60にセットされる。
<Second Embodiment>
In the present embodiment, a modification of the computer 1 according to the first embodiment will be described. FIG. 6 is a block diagram illustrating a configuration example of the computer 2 according to the present embodiment. The computer 2 according to the present embodiment has a comparison circuit 61 and a trace output circuit 62. The comparison circuit 61 is configured to compare the decryption key number applied to the decryption circuit 50 (decoder 51) for decryption of the encrypted program code with the decryption key number associated with the trace target program code. Has been. The trace output circuit 62 is configured to output trace data indicating the instruction execution status of the instruction processing unit 11 on condition that the two key numbers match in the comparison circuit 61. The decryption key number associated with the trace target program code is set in the trace key number register 60.

レジスタ60への鍵番号の書き込みは、例えば、デバッグツール(不図示)から行えばよい。デバッグツールは、利用者を認証し、利用者の認証に成功したことを条件として当該利用者に対応付けられた復号鍵番号をトレース用鍵番号レジスタ60にセットしてもよい。   The key number can be written to the register 60 from, for example, a debug tool (not shown). The debug tool may authenticate the user and set the decryption key number associated with the user in the trace key number register 60 on condition that the user has been successfully authenticated.

図7は、本実施形態に係るトレースデータの出力制御方法の一例を示すフローチャートである。ステップS21では、コンピュータ1は、認証された復号鍵番号をトレース用鍵番号レジスタ60に設定する。ステップS22及び23では、比較回路61は、実行中のプログラムコードの復号化のために用いられる復号鍵の鍵番号(つまり、KNレジスタ162の値)を、認証された鍵番号(つまり、トレース用鍵番号レジスタ60の値)と比較し、これら2つの鍵番号が一致するかを判定する。2つの鍵番号が一致する場合(ステップS23でYES)、CPU10はトレース出力回路62からのトレースデータの出力を許可する(ステップS24)。一方、2つの鍵番号が一致しない場合(ステップS23でNO)、CPU10はトレースデータの出力を禁止する(ステップS25)。   FIG. 7 is a flowchart showing an example of a trace data output control method according to the present embodiment. In step S <b> 21, the computer 1 sets the authenticated decryption key number in the trace key number register 60. In steps S22 and S23, the comparison circuit 61 uses the key number (that is, the value of the KN register 162) of the decryption key used for decrypting the program code being executed as the authenticated key number (that is, for tracing It is determined whether or not these two key numbers match each other. If the two key numbers match (YES in step S23), the CPU 10 permits output of trace data from the trace output circuit 62 (step S24). On the other hand, if the two key numbers do not match (NO in step S23), the CPU 10 prohibits the output of trace data (step S25).

一般的なCPUはデバッグ機能を有しており、命令の実行状況およびアクセスデータを示すトレースデータを出力できるよう構成されている。仮に、暗号化した状態でメモリ40に格納されているプログラムコード(例えば、ユーザープログラム、割り込みサービスルーチン)の実行状況を誰でもトレースすることができるとすれば、これらのプログラムコードの耐タンパ性が低下する。本実施形態のコンピュータ2は、実行中のプログラムコードに適用されている復号鍵の識別子(鍵番号)がトレース対象プログラムコードに関連付けられた復号鍵識別子(鍵番号)と一致することを条件として、トレースデータの出力を許可する。したがって、暗号化した状態でメモリ40に格納されているプログラムコードの耐タンパ性の低下を防止できる。   A general CPU has a debugging function, and is configured to output trace data indicating instruction execution status and access data. If anyone can trace the execution status of the program code (for example, user program, interrupt service routine) stored in the memory 40 in an encrypted state, the tamper resistance of these program codes can be reduced. descend. The computer 2 of the present embodiment, on condition that the decryption key identifier (key number) applied to the program code being executed matches the decryption key identifier (key number) associated with the trace target program code, Allows output of trace data. Therefore, it is possible to prevent the tamper resistance of the program code stored in the memory 40 from being encrypted.

なお、本実施形態において、比較回路61は、復号鍵識別子(例えば、鍵番号)の比較ではなく、復号鍵自体を比較するように構成されてもよい。すなわち、比較回路61は、復号回路50(デコーダ51)に適用されている復号鍵を、トレース対象のプログラムコードの復号化のために用いられる復号鍵と比較してもよい。トレース出力回路62は、2つの復号鍵が比較回路61において一致することを条件として、命令処理ユニット11の命令実行状況を示すトレースデータを出力すればよい。   In the present embodiment, the comparison circuit 61 may be configured not to compare the decryption key identifier (for example, key number) but to compare the decryption keys themselves. That is, the comparison circuit 61 may compare the decryption key applied to the decryption circuit 50 (decoder 51) with the decryption key used for decrypting the program code to be traced. The trace output circuit 62 may output trace data indicating the instruction execution status of the instruction processing unit 11 on condition that the two decryption keys match in the comparison circuit 61.

<その他の実施形態>
図1、図4、及び図6に示したコンピュータ1及び2の構成例は一例に過ぎない。例えば、あるアーキテクチャでは、割り込み擬似命令を生成する制御ロジック14は割り込みコントローラ20に配置されてもよい。
<Other embodiments>
The configuration examples of the computers 1 and 2 shown in FIGS. 1, 4, and 6 are merely examples. For example, in some architectures, control logic 14 that generates interrupt pseudo-instructions may be located in interrupt controller 20.

また、他のアーキテクチャでは、制御ロジック14又は割り込みコントローラ20(200)は、割り込み信号に基づいて割り込みベクタを生成するロジック回路を有してもよい。つまり、割り込みベクタテーブル21(210)は明示的に存在しなくてもよい。この場合、CPU10又は割り込みコントローラ20(200)は、複数の割り込み要因に対応する複数の復号鍵識別子を規定したレジストリ(例えば、レジスタ、ROM上のテーブル)を有していればよい。   In other architectures, the control logic 14 or the interrupt controller 20 (200) may include a logic circuit that generates an interrupt vector based on an interrupt signal. That is, the interrupt vector table 21 (210) may not explicitly exist. In this case, the CPU 10 or the interrupt controller 20 (200) only needs to have a registry (for example, a register or a table on the ROM) that defines a plurality of decryption key identifiers corresponding to a plurality of interrupt factors.

さらに、上述した実施形態は本件発明者により得られた技術思想の適用に関する例に過ぎない。すなわち、当該技術思想は、上述した実施形態のみに限定されるものではなく、種々の変更が可能であることは勿論である。   Furthermore, the above-described embodiment is merely an example relating to application of the technical idea obtained by the present inventors. That is, the technical idea is not limited to the above-described embodiment, and various changes can be made.

例えば、本件発明者等により得られた技術思想は、以下に示す実施形態A1〜A7、並びにB1〜B7を含む。   For example, the technical idea obtained by the present inventors includes Embodiments A1 to A7 and B1 to B7 described below.

(実施形態A1)
命令をデコードして実行するCPU(Central Processing Unit)、
第1の割り込みの発生に応答して、第1の復号鍵識別子を前記CPUに供給する割り込みコントローラ、及び
前記CPUから前記第1の復号鍵識別子を受信し、暗号化された第1の割り込みサービスルーチンを前記第1の復号鍵識別子に対応する復号鍵を用いて復号化する復号回路、
を備えるコンピュータ。
(実施形態A2)
前記割り込みコントローラは、複数の割り込み要因に対応する複数の復号鍵識別子を定めた1又は複数のレジスタを備える、実施形態A1に記載のコンピュータ。
(実施形態A3)
前記CPUは、
命令をデコードして実行する命令処理ユニットと、
前記第1の割り込みに基づく前記割り込みコントローラからの割り込み要求に応答して、前記第1の割り込みサービスルーチンに分岐するよう前記命令処理ユニットを制御する制御ユニットと、
を備える、実施形態A1又はA2に記載のコンピュータ。
(実施形態A4)
前記制御ユニットによる前記命令処理ユニットの制御は、前記第1の割り込みサービスルーチンに分岐するための割り込み擬似命令を前記命令処理ユニットに投球することを含む、実施形態A3に記載のコンピュータ。
(実施形態A5)
前記割り込み擬似命令は、前記割り込み擬似命令は前記第1の復号鍵識別子に関連付けられている、実施形態A4に記載のコンピュータ。
(実施形態A6)
前記命令処理ユニットは、前記割り込み擬似命令を実行することによって、前記第1の復号鍵識別子を示す信号を前記復号回路に供給するとともに、前記第1の割り込みサービスルーチンに分岐する、実施形態A4に記載のコンピュータ。
(実施形態A7)
前記命令処理ユニットは、前記復号回路において復号化された前記第1の割り込みサービスルーチンを実行する、実施形態A1又はA2に記載のコンピュータ。
(Embodiment A1)
CPU (Central Processing Unit) that decodes and executes instructions,
An interrupt controller that supplies a first decryption key identifier to the CPU in response to the occurrence of a first interrupt; and an encrypted first interrupt service that receives the first decryption key identifier from the CPU and is encrypted A decryption circuit for decrypting a routine using a decryption key corresponding to the first decryption key identifier;
A computer comprising:
(Embodiment A2)
The computer according to embodiment A1, wherein the interrupt controller includes one or more registers that define a plurality of decryption key identifiers corresponding to a plurality of interrupt factors.
(Embodiment A3)
The CPU
An instruction processing unit for decoding and executing instructions;
A control unit for controlling the instruction processing unit to branch to the first interrupt service routine in response to an interrupt request from the interrupt controller based on the first interrupt;
A computer as described in embodiment A1 or A2.
(Embodiment A4)
The computer of embodiment A3, wherein the control of the instruction processing unit by the control unit includes throwing an interrupt pseudo-instruction to branch to the first interrupt service routine to the instruction processing unit.
(Embodiment A5)
The computer of embodiment A4, wherein the interrupt pseudo-instruction is associated with the first decryption key identifier.
(Embodiment A6)
In the embodiment A4, the instruction processing unit supplies the signal indicating the first decryption key identifier to the decryption circuit by executing the interrupt pseudo-instruction, and branches to the first interrupt service routine. The listed computer.
(Embodiment A7)
The computer according to embodiment A1 or A2, wherein the instruction processing unit executes the first interrupt service routine decoded by the decoding circuit.

(実施形態B1)
命令をデコードして実行するCPU(Central Processing Unit)、
複数の割り込み要因に対応する複数の復号鍵識別子を規定し、第1の割り込みの発生時に前記第1の割り込みに対応する第1の復号鍵識別子を前記CPUに供給するレジストリ、及び
前記CPUから前記第1の復号鍵識別子を受信し、暗号化された第1の割り込みサービスルーチンを前記第1の復号鍵識別子に対応する復号鍵を用いて復号化する復号回路、
を備えるコンピュータ。
(実施形態B2)
前記レジストリは、割り込みベクタテーブルである、実施形態B2に記載のコンピュータ。
(実施形態B3)
前記CPUは、
命令をデコードして実行する命令処理ユニットと、
前記第1の割り込みの発生時に前記第1の割り込みサービスルーチンに分岐するよう前記命令処理ユニットを制御する制御ユニットと、
を備える、実施形態B1又はB2に記載のコンピュータ。
(実施形態B4)
前記制御ユニットによる前記命令処理ユニットの制御は、前記第1の割り込みサービスルーチンに分岐するための割り込み擬似命令を前記命令処理ユニットに投球することを含む、実施形態B3に記載のコンピュータ。
(実施形態B5)
前記割り込み擬似命令は前記第1の復号鍵識別子に関連付けられている、実施形態B4に記載のコンピュータ。
(実施形態B6)
前記命令処理ユニットは、前記割り込み擬似命令を実行することによって、前記第1の復号鍵識別子を示す信号を前記復号回路に供給するとともに、前記第1の割り込みサービスルーチンに分岐する、実施形態B4に記載のコンピュータ。
(実施形態B7)
前記命令処理ユニットは、前記復号回路において復号化された前記第1の割り込みサービスルーチンを実行する、実施形態B1又はB2に記載のコンピュータ。
(Embodiment B1)
CPU (Central Processing Unit) that decodes and executes instructions,
Defining a plurality of decryption key identifiers corresponding to a plurality of interrupt factors, and supplying a first decryption key identifier corresponding to the first interrupt to the CPU when a first interrupt occurs; and A decryption circuit for receiving a first decryption key identifier and decrypting the encrypted first interrupt service routine using a decryption key corresponding to the first decryption key identifier;
A computer comprising:
(Embodiment B2)
The computer of embodiment B2 wherein the registry is an interrupt vector table.
(Embodiment B3)
The CPU
An instruction processing unit for decoding and executing instructions;
A control unit that controls the instruction processing unit to branch to the first interrupt service routine when the first interrupt occurs;
A computer as described in embodiment B1 or B2.
(Embodiment B4)
The computer of embodiment B3, wherein the control of the instruction processing unit by the control unit includes pitching an interrupt pseudo-instruction for branching to the first interrupt service routine to the instruction processing unit.
(Embodiment B5)
The computer of embodiment B4, wherein the interrupt pseudo-instruction is associated with the first decryption key identifier.
(Embodiment B6)
The instruction processing unit supplies the signal indicating the first decryption key identifier to the decryption circuit by executing the interrupt pseudo-instruction, and branches to the first interrupt service routine. Embodiment B4 The listed computer.
(Embodiment B7)
The computer according to embodiment B1 or B2, wherein the instruction processing unit executes the first interrupt service routine decoded by the decoding circuit.

1、2 コンピュータ
10 CPU(Central Processing Unit)
11 命令処理ユニット
20、200 割り込みコントローラ
21、210 割り込みベクタテーブル
30 キャッシュメモリ
40 メモリ
50 復号回路
60 トレース用鍵番号レジスタ
61 比較回路
62 トレース出力回路
201 割り込み要因レジスタ
ISR 割り込みサービスルーチン
IPI 割り込み擬似命令
KN 鍵番号
1, 2 Computer 10 CPU (Central Processing Unit)
11 Instruction processing unit 20, 200 Interrupt controller 21, 210 Interrupt vector table 30 Cache memory 40 Memory 50 Decoding circuit 60 Trace key number register 61 Comparison circuit 62 Trace output circuit 201 Interrupt factor register ISR Interrupt service routine IPI Interrupt pseudo instruction KN key number

Claims (20)

命令をデコードして実行する命令処理ユニット、
第1の割り込みの発生に応答して、第1の割り込みサービスルーチンに分岐するための割り込み擬似命令を前記命令処理ユニットに投入する制御ユニット、前記割り込み擬似命令は前記第1の割り込みに対応する第1の復号鍵識別子に関連付けられている、及び
前記命令処理ユニットにおける前記割り込み擬似命令の実行に基づいて前記第1の復号鍵識別子に対応する復号鍵を設定するとともに、暗号化された第1の割り込みサービスルーチンを前記復号鍵を用いて復号化する復号回路、
を備えるコンピュータ。
An instruction processing unit for decoding and executing instructions;
In response to the occurrence of the first interrupt, a control unit that inputs an interrupt pseudo-instruction for branching to the first interrupt service routine to the instruction processing unit, and the interrupt pseudo-instruction corresponds to the first interrupt corresponding to the first interrupt. A decryption key that is associated with the first decryption key identifier and that corresponds to the first decryption key identifier based on execution of the interrupt pseudo-instruction in the instruction processing unit; A decryption circuit for decrypting an interrupt service routine using the decryption key;
A computer comprising:
前記命令処理ユニットは、前記割り込み擬似命令を実行することによって、前記第1の復号鍵識別子を示す信号を前記復号回路に供給するとともに、前記第1の割り込みサービスルーチンに分岐する、請求項1に記載のコンピュータ。   The instruction processing unit supplies the signal indicating the first decryption key identifier to the decryption circuit by executing the interrupt pseudo-instruction, and branches to the first interrupt service routine. The listed computer. 複数の割り込み要因に対応する複数の復号鍵識別子を規定したレジストリをさらに備え、
前記制御ユニットは、前記第1の割り込みに対応する前記第1の復号鍵識別子を前記レジストリから取得する、
請求項1又は2に記載のコンピュータ。
A registry that defines a plurality of decryption key identifiers corresponding to a plurality of interrupt factors;
The control unit obtains the first decryption key identifier corresponding to the first interrupt from the registry;
The computer according to claim 1 or 2.
複数の割り込みベクタに対応する複数の復号鍵識別子を規定した割り込みベクタテーブルをさらに備え、
前記割り込みベクタテーブルは、前記第1の割り込みの発生時に、前記第1の割り込みに対応する第1の割り込みベクタ及び前記第1の復号鍵識別子を前記制御ユニットに供給する、
請求項1又は2に記載のコンピュータ。
An interrupt vector table that defines a plurality of decryption key identifiers corresponding to a plurality of interrupt vectors;
The interrupt vector table supplies a first interrupt vector corresponding to the first interrupt and the first decryption key identifier to the control unit when the first interrupt occurs.
The computer according to claim 1 or 2.
前記第1の割り込みベクタは、ベクタアドレス、前記ベクタアドレスを求めるためのオフセット、又は前記ベクタアドレスを求めるためのベクタ番号を示し、
前記ベクタアドレスは、前記第1の割り込みサービスルーチンの開始アドレス又は前記第1の割り込みサービスルーチンへの分岐命令のアドレスである、請求項4に記載のコンピュータ。
The first interrupt vector indicates a vector address, an offset for obtaining the vector address, or a vector number for obtaining the vector address,
The computer according to claim 4, wherein the vector address is a start address of the first interrupt service routine or an address of a branch instruction to the first interrupt service routine.
前記第1の割り込みの発生時に、割り込み要求及び前記第1の復号鍵識別子を前記制御ユニットに供給する割り込みコントローラをさらに備える、請求項1又は2に記載のコンピュータ。   The computer according to claim 1, further comprising an interrupt controller that supplies an interrupt request and the first decryption key identifier to the control unit when the first interrupt occurs. 前記割り込みコントローラは、複数の割り込み要因に対応する複数の復号鍵識別子を定めた1又は複数のレジスタを備える、請求項6に記載のコンピュータ。   The computer according to claim 6, wherein the interrupt controller includes one or more registers that define a plurality of decryption key identifiers corresponding to a plurality of interrupt factors. 前記割り込み擬似命令は、さらに、前記第1の割り込みに対応する第1の割り込みベクタに関連付けられる、請求項1又は2に記載のコンピュータ。   The computer according to claim 1, wherein the interrupt pseudo-instruction is further associated with a first interrupt vector corresponding to the first interrupt. 前記割り込み擬似命令は、前記第1の復号鍵識別子に対応する復号鍵の前記復号回路への設定を引き起こす命令を含む、請求項1又は2に記載のコンピュータ。   The computer according to claim 1, wherein the interrupt pseudo-instruction includes an instruction that causes a decryption key corresponding to the first decryption key identifier to be set in the decryption circuit. 前記割り込み擬似命令は、前記第1の割り込みサービスルーチンの開始アドレス又は前記第1の割り込みサービスルーチンへの分岐命令のアドレスへのジャンプを引き起こす命令を含む、請求項1又は2に記載のコンピュータ。   The computer according to claim 1, wherein the interrupt pseudo instruction includes an instruction that causes a jump to a start address of the first interrupt service routine or an address of a branch instruction to the first interrupt service routine. 前記命令処理ユニットは、前記第1の割り込みの発生に応じて、前記命令処理ユニットで実行されていたプログラムコードに関するコンテクストを退避するよう構成され、
前記コンテクストは、前記プログラムコードの復号化に適用される第2の復号鍵識別子を含む、請求項1又は2に記載のコンピュータ。
The instruction processing unit is configured to save a context relating to a program code executed by the instruction processing unit in response to the occurrence of the first interrupt,
The computer according to claim 1, wherein the context includes a second decryption key identifier applied to decrypt the program code.
暗号化されたプログラムコードの復号化のために前記復号回路に適用されている第3の復号鍵識別子又は前記第3の復号鍵識別子に対応する復号鍵を、トレース対象プログラムコードに関連付けられた第4の復号鍵識別子又は前記第4の復号鍵識別子に対応する復号鍵と比較する比較回路と、
前記第3の復号鍵識別子及び前記第4の復号鍵識別子が一致すること、又は前記第3及び第4の復号鍵識別子に対応付けられた復号鍵同士が一致することを条件として、前記命令処理ユニットの命令実行状況を示すトレースデータを出力する出力回路と、
をさらに備える、
請求項1又は2に記載のコンピュータ。
A third decryption key identifier applied to the decryption circuit for decrypting the encrypted program code or a decryption key corresponding to the third decryption key identifier is associated with the program code to be traced. A comparison circuit for comparing with a decryption key identifier of 4 or a decryption key corresponding to the fourth decryption key identifier;
The instruction process on condition that the third decryption key identifier and the fourth decryption key identifier match or the decryption keys associated with the third and fourth decryption key identifiers match. An output circuit that outputs trace data indicating the instruction execution status of the unit;
Further comprising
The computer according to claim 1 or 2.
前記復号回路は、それぞれ異なる復号鍵識別子に関連付けられた複数の復号鍵を格納した鍵格納部を備える、請求項1又は2に記載のコンピュータ。   The computer according to claim 1, wherein the decryption circuit includes a key storage unit that stores a plurality of decryption keys associated with different decryption key identifiers. 前記復号回路によって復号化された前記第1の割り込みサービスルーチンを一時的に格納し、前記第1の割り込みサービスルーチンを前記命令処理ユニットに供給するキャッシュメモリをさらに備える、請求項1又は2に記載のコンピュータ。   The cache memory according to claim 1, further comprising a cache memory that temporarily stores the first interrupt service routine decoded by the decoding circuit and supplies the first interrupt service routine to the instruction processing unit. Computer. コンピュータにおける割り込みサービスルーチンの実行方法であって、
第1の割り込みの発生に応答して、第1の割り込みサービスルーチンに分岐するための割り込み擬似命令を制御ユニットから命令処理ユニットに投入することを備え、
前記割り込み擬似命令は、第1の復号鍵識別子に対応する復号鍵の復号回路への設定を引き起こす命令を含む、
方法。
A method of executing an interrupt service routine in a computer,
In response to the occurrence of the first interrupt, an interrupt pseudo instruction for branching to the first interrupt service routine is input from the control unit to the instruction processing unit,
The interrupt pseudo-instruction includes an instruction that causes the decryption key corresponding to the first decryption key identifier to be set in the decryption circuit.
Method.
前記割り込み擬似命令は、前記第1の割り込みサービスルーチンの開始アドレス又は前記第1の割り込みサービスルーチンへの分岐命令のアドレスへのジャンプを引き起こす命令を含む、請求項1又は2に記載の方法。   The method according to claim 1 or 2, wherein the interrupt pseudo-instruction includes an instruction that causes a jump to a start address of the first interrupt service routine or an address of a branch instruction to the first interrupt service routine. 前記第1の割り込みの発生時に、前記第1の割り込みに対応する第1の割り込みベクタ及び前記第1の復号鍵識別子を割り込みベクタテーブルから前記制御ユニットに供給することをさらに備える、請求項15又は16に記載の方法。   16. The method according to claim 15, further comprising: supplying a first interrupt vector corresponding to the first interrupt and the first decryption key identifier from the interrupt vector table to the control unit when the first interrupt occurs. 16. The method according to 16. 前記第1の割り込みの発生時に、割り込み要求及び前記第1の復号鍵識別子を割り込みコントローラから前記制御ユニットに供給することをさらに備える、請求項15又は16に記載の方法。   The method according to claim 15 or 16, further comprising supplying an interrupt request and the first decryption key identifier from an interrupt controller to the control unit when the first interrupt occurs. 前記第1の割り込みの発生に応じて、前記命令処理ユニットで実行されていたプログラムコードに関するコンテクストを退避することをさらに備え、
前記コンテクストは、前記プログラムコードの復号化に適用される第2の復号鍵識別子を含む、
請求項15又は16に記載の方法。
Evacuating a context related to the program code executed by the instruction processing unit in response to the occurrence of the first interrupt;
The context includes a second decryption key identifier applied to decrypt the program code,
The method according to claim 15 or 16.
前記命令処理ユニットにおける前記割り込み擬似命令の実行に基づいて、前記第1の復号鍵識別子に対応する復号鍵を復号回路に設定すること、
前記命令処理ユニットにおける前記割り込み擬似命令の実行に基づいて、前記第1の割り込みサービスルーチンに分岐すること、
暗号化された第1の割り込みサービスルーチンを前記復号鍵を用いて前記復号回路において復号化すること、及び
前記第1の割り込みサービスルーチンを前記命令処理ユニットにおいて実行すること、
をさらに備える、請求項15又は16に記載の方法。
Setting a decryption key corresponding to the first decryption key identifier in a decryption circuit based on execution of the interrupt pseudo-instruction in the instruction processing unit;
Branching to the first interrupt service routine based on execution of the interrupt pseudo-instruction in the instruction processing unit;
Decrypting the encrypted first interrupt service routine in the decryption circuit using the decryption key; and executing the first interrupt service routine in the instruction processing unit;
The method according to claim 15 or 16, further comprising:
JP2012274492A 2012-12-17 2012-12-17 Computer and interrupt service routine execution method Pending JP2014119953A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2012274492A JP2014119953A (en) 2012-12-17 2012-12-17 Computer and interrupt service routine execution method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2012274492A JP2014119953A (en) 2012-12-17 2012-12-17 Computer and interrupt service routine execution method

Publications (1)

Publication Number Publication Date
JP2014119953A true JP2014119953A (en) 2014-06-30

Family

ID=51174738

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2012274492A Pending JP2014119953A (en) 2012-12-17 2012-12-17 Computer and interrupt service routine execution method

Country Status (1)

Country Link
JP (1) JP2014119953A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180011671A (en) * 2016-07-25 2018-02-02 삼성전자주식회사 Data storage device and data processing system having the same

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20180011671A (en) * 2016-07-25 2018-02-02 삼성전자주식회사 Data storage device and data processing system having the same
KR102538258B1 (en) * 2016-07-25 2023-05-31 삼성전자주식회사 Data storage device and data processing system having the same

Similar Documents

Publication Publication Date Title
US11354423B2 (en) Cryptographic isolation of memory compartments in a computing environment
TWI690822B (en) Platform migration of secure enclaves
CN107667499B (en) Keyed hash message authentication code processor, method, system, and instructions
US20210150040A1 (en) Data type based cryptographic computing
US11243893B2 (en) Preventing unauthorized access to encrypted memory
JP6006248B2 (en) Instruction emulation processor, method and system
CN112639778A (en) Pointer authentication and dynamic switching between pointer authentication schemes
US20150032996A1 (en) Execution-aware memory protection
US20160180095A1 (en) Measured boot capability
US11580035B2 (en) Fine-grained stack protection using cryptographic computing
TW202238423A (en) Apparatus, method and machine-readable medium for processor extensions to protect stacks during ring transitions
US9971702B1 (en) Nested exception handling
JP2013542498A (en) Debugging data processing equipment
US20160188874A1 (en) System and method for secure code entry point control
TWI457784B (en) Hardware protection of virtual machine monitor runtime integrity watcher
US20230018585A1 (en) Updating encrypted security context in stack pointers for exception handling and tight bounding of on-stack arguments
TW202138997A (en) Processor and system comprising mode-specific endbranch for control flow termination
US11468168B1 (en) Systems and methods for optimizing authentication branch instructions
US9785800B2 (en) Non-tracked control transfers within control transfer enforcement
JP2014119953A (en) Computer and interrupt service routine execution method
CN117546168A (en) Cryptographic computation using context information for transient side channel security
JP2007058588A (en) Processor having program protection function
CN113536293A (en) Apparatus and method for efficiently managing and processing shadow stacks
TW201734769A (en) Processing vector instructions
US20240069913A1 (en) Uniform Microcode Update Enumeration