JP2009064462A - Microprocessor - Google Patents

Microprocessor Download PDF

Info

Publication number
JP2009064462A
JP2009064462A JP2008276073A JP2008276073A JP2009064462A JP 2009064462 A JP2009064462 A JP 2009064462A JP 2008276073 A JP2008276073 A JP 2008276073A JP 2008276073 A JP2008276073 A JP 2008276073A JP 2009064462 A JP2009064462 A JP 2009064462A
Authority
JP
Japan
Prior art keywords
task
key
address
program
data
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.)
Granted
Application number
JP2008276073A
Other languages
Japanese (ja)
Other versions
JP4643702B2 (en
Inventor
Mikio Hashimoto
幹生 橋本
Kensaku Fujimoto
謙作 藤本
Kenji Shirakawa
健治 白川
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2008276073A priority Critical patent/JP4643702B2/en
Publication of JP2009064462A publication Critical patent/JP2009064462A/en
Application granted granted Critical
Publication of JP4643702B2 publication Critical patent/JP4643702B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a tamper-resistant microprocessor which efficiently protects contents of an encoding program even from an OS on the basis of few secrets. <P>SOLUTION: The microprocessor is provided with: a processor core which designates an address of an external memory which stores programs encoded with unique program keys and issues a readout request; an I/F which reads out the data of the designated address of the external memory in response to the readout request; a task key table which holds program keys corresponding to task identifiers for each task; an offset table which holds the head addresses of the programs as the offset values; a key generation part which generates keys for block which are obtained by encoding, with the program keys, relative address values which are computed from the addresses designated in the readout request and the offset values designated by the task identifiers of the offset table; an encryption-processing part which decodes the data with the keys for block; and a cache memory which reads the data for each cache line. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、マルチタスクのプログラム実行環境下で、実行コードや処理対象であるデータの不正な改変を防止することのできる耐タンパマイクロプロセッサに関する。   The present invention relates to a tamper resistant microprocessor capable of preventing unauthorized modification of execution code and data to be processed under a multitask program execution environment.

PCなどの一般ユーザ向けコンピュータのハードウェア情報や、オペレーションシステム(以下、「OS」とする)のシステムプログラム情報が、特に秘密にされることなく開示されているオープンシステムが広く普及している。   An open system in which hardware information of a computer for general users such as a PC and system program information of an operation system (hereinafter referred to as “OS”) is disclosed without being kept secret is widespread.

オープンシステムでは、エンドユーザがシステムプログラムを変更して、所望の改良を加えることができる。 In an open system, an end user can change a system program to make a desired improvement.

このような環境下で、アプリケーションプログラムが扱う情報の著作権や、プログラム自体の著作権を保護するには、あらかじめシステムのOSがアプリケーションに対して敵対的動作をとり得ることを想定した秘密保護能力のあるハードウェアが必要である。   In such an environment, in order to protect the copyright of the information handled by the application program and the copyright of the program itself, a secret protection capability that assumes that the OS of the system can take hostile actions on the application in advance. Requires some hardware.

実際、このような秘密保護機能を有するハードウェア、特にマイクロプロセッサが提案されている(特許出願第2000−35398号,Lie et al., “Architectural Support for Copy and TamperResistant Software”;Computer Architecture News 28(5):p168- 等)。 In fact, hardware having such a secret protection function, in particular, a microprocessor has been proposed (Patent Application No. 2000-35398, Lie et al., “Architectural Support for Copy and Tamper Resistant Software”; Computer Architecture News 28 ( 5): p168- etc.).

秘密保護能力を有するマイクロプロセッサは、マルチタスク環境下で、プログラム自体やプログラムが扱う情報が不正に覗き見され、改変されないように、これらの情報を暗号化する機能を備えている。   A microprocessor having a secret protection capability has a function of encrypting information such that the program itself and information handled by the program are illegally looked at and not modified under a multitasking environment.

このようなマイクロプロセッサを、耐タンパプロセッサと呼ぶ。 Such a microprocessor is called a tamper resistant processor.

耐タンパプロセッサの主目的は、エンドユーザのシステムで動作するアプリケーションを保護することにより、プログラムやコンテンツ、ネットワークサービスの権利者の権利を保護することである。具体的には、(1)プログラムに実装されたアルゴリズムの保護、(2)プログラムに埋め込まれたトレードシークレットや、コンテンツの保護、(3)プログラム動作の改変からの保護、の3つが挙げられる。   The main purpose of the tamper resistant processor is to protect the rights of the right holders of programs, contents and network services by protecting the applications running on the end user system. Specifically, there are three methods: (1) protection of an algorithm implemented in a program, (2) protection of a trade secret embedded in the program and content, and (3) protection from modification of the program operation.

プログラムに実装されたアルゴリズムの保護は、プログラムの権利者を保護するために必要である。プログラムに埋め込まれたトレードシークレットの保護は、プログラムが扱うコンテンツの不正コピーを防止するために必要である。不正な改変からの保護は、たとえばサービスプロバイダの権利を保護するために必要である。   Protection of the algorithm implemented in the program is necessary to protect the right holder of the program. Protection of the trade secret embedded in the program is necessary to prevent unauthorized copying of the content handled by the program. Protection from unauthorized modification is necessary, for example, to protect the rights of service providers.

ネットワークサービスを利用するプログラムが、課金情報をサーバとやりとりするようなアプリケーションでは、特に、課金情報の送信動作を正しく実行し、不正な改変を防止することが重要である。実際の例として、PCでDVDを再生するプログラムが解析され、そこからDVDの暗号を解読するためのトレードシークレットが読みとられて不正にDVDをコピーするプログラム(DeCSS)が作られたことはよく知られている。   In an application in which a program that uses a network service exchanges accounting information with a server, it is particularly important to correctly execute the accounting information transmission operation to prevent unauthorized modification. As a practical example, it is often the case that a program that reproduces a DVD on a PC was analyzed, a trade secret for decrypting the DVD encryption was read from it, and a program (DeCSS) for illegally copying the DVD was created. Are known.

オープンシステムにおいて、単純にアプリケーションプログラムの秘密を保護する機構は従来から提案されているが、本件の出願人は、ひとつのシステム上で複数のプログラム(複数の異なるプログラムベンダからのプログラムあるいは単一のベンダからの複数の異なるプログラム)が擬似並列的に動かされる場合に、その各々について、システムの資源を管理するOSからも独立に秘密を保護する保護環境を提案してきた(特許出願第2000−35398号、第2000−135010号、第2000−333635号、第2001−024480号など)。このような保護環境を、「マルチパーティアプリケーション保護環境」と呼ぶ。   In an open system, a mechanism for simply protecting the secret of an application program has been proposed in the past. However, the applicant of the present application can use multiple programs (programs from different program vendors or a single program on one system). When a plurality of different programs from a vendor are run in a pseudo-parallel manner, a protection environment has been proposed for each of which is protected independently from the OS that manages system resources (Patent Application No. 2000-35398). No. 2000-135010, 2000-333635, 2001-024480, etc.). Such a protection environment is referred to as a “multi-party application protection environment”.

図18は、一般的なマルチパーティのアプリケーション保護環境を示す。   FIG. 18 illustrates a typical multi-party application protection environment.

図18において、ユーザ12が、複数のソフトウェアベンダ21−1〜21−nのうち、ベンダ1(21−1)からプログラムをする購入すると場合を例にとる。 In FIG. 18, a case where the user 12 purchases a program from a vendor 1 (21-1) among a plurality of software vendors 21-1 to 21-n is taken as an example.

ユーザ12が使用するシステム2は、マイクロプロセッサAを内蔵し、マイクロプロセッサAは、このプロセッサに固有の秘密鍵Aを有する。秘密鍵Aに対応する公開鍵Aは、公開されている。 The system 2 used by the user 12 includes a microprocessor A, and the microprocessor A has a secret key A unique to this processor. The public key A corresponding to the secret key A is made public.

ソフトウェアベンダ1はプログラム22−1を開発し、暗号鍵としてプログラム鍵1を選択し、平文プログラム22−1を暗号化して暗号プログラム23−1を作成する。   The software vendor 1 develops the program 22-1, selects the program key 1 as the encryption key, and encrypts the plaintext program 22-1 to create the encryption program 23-1.

次に、プログラム鍵1を、配布先システム2のプロセッサAに固有の公開鍵Aで暗号化して、配布鍵25−1を作成する。 Next, the program key 1 is encrypted with the public key A unique to the processor A of the distribution destination system 2 to create the distribution key 25-1.

図示はしないが、ソフトウェアベンダ1はプログラム22−1の他にも、複数の異なるプログラムを開発しており、それぞれプログラムに応じたプログラム鍵を選択して、暗号化プログラムと配布鍵を作成する。ここでは、説明の便宜上、ひとつのプログラムについて説明する。   Although not shown, the software vendor 1 has developed a plurality of different programs in addition to the program 22-1 and selects a program key corresponding to each program to create an encryption program and a distribution key. Here, for convenience of explanation, one program will be described.

ソフトウェアベンダ1は、暗号化したプログラム23−1と、暗号化した配布鍵25−1とを、ネットワークを介して、ターゲットシステム2に配信する。配信されたプログラム23−1と配布鍵25−1は、システムの二次記憶(たとえば、ハードディスク)7に格納される。プログラム23−1は、実行コードとデータ(初期化データ等)を含み、実行時に、マイクロプロセッサ3の外にある外部メモリ8上に、暗号化されたままの状態で読み込まれる。外部メモリ8上の暗号化されたプログラムを保護プログラムと称する。   The software vendor 1 distributes the encrypted program 23-1 and the encrypted distribution key 25-1 to the target system 2 via the network. The distributed program 23-1 and distribution key 25-1 are stored in the secondary storage (for example, hard disk) 7 of the system. The program 23-1 includes execution code and data (initialization data and the like), and is read in an encrypted state on the external memory 8 outside the microprocessor 3 at the time of execution. The encrypted program on the external memory 8 is called a protection program.

マイクロプロセッサAは、配布鍵25−1を読み込み、公開鍵Aに対応する秘密鍵Aによってこれを復号してプログラム鍵1を得る。鍵の復号処理はマイクロプロセッサ内の保護ロジック(コア)6で行なわれる。   The microprocessor A reads the distribution key 25-1 and decrypts it with the private key A corresponding to the public key A to obtain the program key 1. The key decryption process is performed by the protection logic (core) 6 in the microprocessor.

次にマイクロプロセッサAは、プログラム鍵1によってプログラム1を復号してキャッシュメモリ4に読み込む。復号とキャッシュメモリ3への読み込みは、所定のキャッシュアルゴリズムにより、プログラムの実行に従って、部分ごとに行われ、プログラム全体が一度にキャッシュメモリ4に読み込まれるわけではない。キャッシュメモリ4に読み込まれたプログラムは平文状態なので、暗号化されていない通常のプログラムと同様にコア6で実行される。プログラム鍵1や平文プログラムを扱う部分は、プロセッサAのコア6によって行なわれ、OSが介在する余地はない。マイクロプロセッサ内にあるキャッシュメモリ4、秘密鍵5の内容は、プロセッサの仕様に定められた操作を除いては、外部から直接読み出すことはできない。   Next, the microprocessor A decrypts the program 1 with the program key 1 and reads it into the cache memory 4. Decoding and reading into the cache memory 3 are performed for each part according to the execution of the program by a predetermined cache algorithm, and the entire program is not read into the cache memory 4 at a time. Since the program read into the cache memory 4 is in a plain text state, it is executed by the core 6 in the same manner as a normal program that is not encrypted. The part that handles the program key 1 and the plaintext program is performed by the core 6 of the processor A, and there is no room for the OS to intervene. The contents of the cache memory 4 and the secret key 5 in the microprocessor cannot be directly read from the outside except for the operations defined in the processor specifications.

なお図示はしないが、キャッシュメモリ4に格納された平文の情報について、ユーザが複数のプログラムベンダ21−1〜21−nから、複数の異なるプログラムを購入しても、それらのプログラムの間で、独立に秘密が守られることを保証するために、キャッシュメモリ4のライン毎に、その平文情報がどの暗号鍵によって復号化された情報であるかを特定する識別子がつけられる。異なるプログラムベンダの、異なるプログラムごとにプログラム鍵はそれぞれ異なるので、キャッシュラインにあるタスクと、それを復号した鍵とを対応付けることにより、プログラムの独立性は一応保証される。   Although not shown, even if the user purchases a plurality of different programs from the plurality of program vendors 21-1 to 21-n for the plaintext information stored in the cache memory 4, between the programs, In order to guarantee that the secret is protected independently, an identifier is attached to each line of the cache memory 4 to specify which encryption key is the decrypted plaintext information. Since the program key is different for each different program from different program vendors, the independence of the program is temporarily ensured by associating the task in the cache line with the key decrypted.

(1)タスクの識別機能を実現するには、各プログラムのプログラム鍵をタスクIDに対応して保持するテーブルをマイクロプロセッサ内部に持つことが必要である。このようなテーブルの設定を指示するのは、システムを管理するOSであり、OSプログラムからテーブルを操作する手段が必要となる。このテーブル操作手段は、当然、秘密保護の要求を満たすものでなければならない。   (1) In order to realize the task identification function, it is necessary to have a table in the microprocessor that holds the program key of each program corresponding to the task ID. The OS that manages the system instructs the setting of such a table, and a means for operating the table from the OS program is required. This table operation means must naturally satisfy the secret protection requirement.

また、タスク対応の鍵テーブルは秘密保護の要となるが、資源の有限性やコストの関係上、テーブルの量を無限に増やすことはできない。このため、あるテーブルのエントリをどのプログラムに割り当てるか、エントリをどのように再利用するかは、システムユーザの意向に従って、OSが管理する必要がある。   In addition, although the task-corresponding key table is important for secret protection, the amount of the table cannot be increased indefinitely due to the finite nature of resources and cost. Therefore, it is necessary for the OS to manage to which program an entry in a certain table is assigned and how the entry is reused according to the intention of the system user.

このようなOSの操作は、秘密保護に欠陥をもたらす可能性がある。例えば、あるプログラム鍵XにタスクID#1を割り当てた状態の時、OSが別のプログラム鍵Yに同一のタスクID#1を再割当したとする。このとき、キャッシュメモリにタスクID#1のタグが付与されたキャッシュラインが残っていると、そのデータは、プログラム鍵Yに対応するプログラムから読みとることができる。これは秘密保護の原則に違反する。   Such an OS operation can lead to flaws in secret protection. For example, when task ID # 1 is assigned to a program key X, the OS reassigns the same task ID # 1 to another program key Y. At this time, if the cache line with the task ID # 1 tag remains in the cache memory, the data can be read from the program corresponding to the program key Y. This violates the principle of confidentiality protection.

そこで、第1の課題として、このような違反を防止するためのタスク状態管理とテーブル管理の機構を提供する。   Therefore, as a first problem, a mechanism for task state management and table management for preventing such violation is provided.

(2)プログラムの暗号化には、キャッシュライン単位で復号処理が完結するような方法と、あるひとつのキャッシュラインの復号に複数のキャッシュラインのデータが必要な方法の2種類がある。前者はメモリ容量やライン単位の入れ替えにさほど影響しないが、後者には、以下の問題がある。   (2) There are two types of program encryption: a method in which decryption processing is completed in units of cache lines, and a method in which data of a plurality of cache lines is required for decryption of one cache line. The former does not significantly affect memory capacity and line unit replacement, but the latter has the following problems.

キャッシュラインの復号に複数のキャッシュラインのデータを必要とする方法では、メモリへのランダムアクセスが発生する場合、必要なメモリ領域の前後のメモリ領域も読み込まなければならない。このため、大きなオーバヘッドが発生する。   In a method that requires data of a plurality of cache lines for decoding a cache line, if random access to the memory occurs, the memory areas before and after the necessary memory area must also be read. For this reason, a large overhead occurs.

また、復号結果は隣接するラインのデータに依存するため、いわゆるブロック交換攻撃の可能性がある。ブロック交換攻撃とは、同一の秘密に基づいて暗号化されたブロック情報を、攻撃者が適切に入れ換えることにより、システムの状態を攻撃者の意図するように変更する攻撃を意味する。たとえば、攻撃者が、あるアドレスXに配置されていたラインPが課金動作に対応する部分であることを、通信のタイミングなどから知ったとする。   Further, since the decoding result depends on the data of the adjacent line, there is a possibility of so-called block exchange attack. The block exchange attack means an attack that changes the state of the system as intended by the attacker by appropriately replacing the block information encrypted based on the same secret. For example, it is assumed that the attacker knows from the communication timing that the line P placed at a certain address X is a part corresponding to the charging operation.

そして、同一のプログラム鍵で暗号化された別のラインQを実行しても、プログラムの提供するサービスに悪影響がないことを、知っていたとする。このとき、ラインPをラインQで置き換えれば、攻撃者はプログラムのサービスに影響なく、課金だけを逃れることができる。同様の攻撃は、プログラムが扱うデータにも適用可能である。 Then, it is assumed that even if another line Q encrypted with the same program key is executed, the service provided by the program is not adversely affected. At this time, if the line P is replaced with the line Q, the attacker can escape only the charge without affecting the service of the program. A similar attack can be applied to data handled by a program.

すべてのブロック毎に個別の鍵を与えれば上記の問題は解決できるが、配布鍵にブロックごとの個別暗号鍵を格納すると、配布鍵を公開鍵で暗号化するアルゴリズムが膨大になり、復号化処理のオーバヘッドを引き起こす。また、そのような鍵を管理する膨大な容量のテーブルをマイクロプロセッサ内部に必要とし、鍵の配布、管理コストの面で現実的ではない。   The above problem can be solved if an individual key is given to every block, but if the individual encryption key for each block is stored in the distribution key, the algorithm for encrypting the distribution key with the public key becomes enormous, and decryption processing is performed. Cause overhead. In addition, an enormous capacity table for managing such keys is required inside the microprocessor, which is not realistic in terms of key distribution and management costs.

さらに、一般にプログラムは、あらかじめ配置されるアドレスが常に一定であるわけではなく、ターゲットシステムの構成(他のプログラムと共有するライブラリや共有メモリの構成)によって、配置されるアドレスが変更されることがある。これをリロケーションと呼ぶ。ブロックごとの暗号化を行う場合、リロケーションの問題を考慮しなければならない。   Furthermore, in general, addresses that are allocated in advance in a program are not always constant, and the addresses that are allocated may be changed depending on the configuration of the target system (the configuration of a library or shared memory shared with other programs). is there. This is called relocation. When performing block-by-block encryption, relocation issues must be considered.

そこで、第2の課題として、処理オーバヘッドが小さく、データ交換攻撃を困難にし、リロケーションをも考慮した秘密情報管理能力を有するマイクロプロセッサを提供する。   Therefore, as a second problem, there is provided a microprocessor that has a small processing overhead, makes a data exchange attack difficult, and has secret information management capability considering relocation.

(3)プログラム(実行コード)、データ、コンテキスト情報は、アプリケーションの3要素であるが、これらはプロセッサ内部での取り扱い違いがある。実行コードとデータでプログラム本体を成し、コンテキストは、タスクの実行が中断されたときにタスクを再開するためにメモリ上に保存される状態情報である。   (3) The program (execution code), data, and context information are the three elements of the application, but these are handled differently within the processor. The program body is composed of execution code and data, and the context is state information stored in the memory to resume the task when the execution of the task is interrupted.

一般にマイクロプロセッサ内部のプログラムは書き換えられることはないが、キャッシュ上のデータに変更があればデータは外部メモリへと書き戻される。   Generally, the program in the microprocessor is not rewritten, but if the data on the cache is changed, the data is written back to the external memory.

また、プログラムやデータはキャッシュライン単位でアクセスされるが、コンテキスト情報は、単一のキャッシュラインでは格納できないほどのサイズになることが多い。コンテキスト切り替えのときは、複数のキャッシュラインにまたがる情報がまとめて読み書きされる。   In addition, programs and data are accessed in units of cache lines, but context information often has a size that cannot be stored in a single cache line. When switching contexts, information across multiple cache lines is read and written together.

性質の異なるこれらの情報を外部メモリとやりとりする際には、それぞれ暗号処理が必要になるが、その一方でハードウェアコストの削減が望まれる。   When these pieces of information having different properties are exchanged with the external memory, encryption processing is required for each, but on the other hand, reduction of hardware costs is desired.

そこで、第3の課題として、これらの情報に対する暗号処理ハードウェアを共通化できるマイクロプロセッサを提供する。   Therefore, as a third problem, a microprocessor is provided that can share cryptographic processing hardware for these pieces of information.

第1の課題を解決するために、実際にキャッシュラインにあるタスクの識別子と、OSにより割り当てられたタスクの識別子とを比較して、一致するときにのみそのキャッシュラインへのアクセスを許可し、一致しないときは、キャッシュラインの内容を廃棄する。   In order to solve the first problem, the identifier of the task actually in the cache line is compared with the identifier of the task assigned by the OS, and access to the cache line is permitted only when they match, If they do not match, the contents of the cache line are discarded.

これを実現するために、マイクロプロセッサは、複数の状態を取り得るタスクに識別子を付与し、タスク識別子と対応してタスクの状態を保持するタスク状態テーブルと、現在実行中のタスク識別子を保持するタスクレジスタと、タスクの要求があったときに、外部メモリに所定のプログラム鍵で暗号化された状態で格納されているプログラムをキャッシュライン単位に読み込むインターフェイスと、プログラム鍵に基づきキャッシュラインごとに復号鍵を生成し、読み込まれた内容を復号する暗号処理部と、各々がタグを有する複数のキャッシュラインから構成され、キャッシュラインごとに、そのキャッシュラインの復号に用いられた復号鍵に対応するタスク識別子をタグに保持する第1のキャッシュメモリと、キャッシュラインのタグに保持されたタスク識別子と、前記タスクレジスタの値を比較し、値が一致しない場合にキャッシュラインの内容を廃棄するアクセス検証部とを備える。   In order to realize this, the microprocessor assigns an identifier to a task that can take a plurality of states, and retains a task state table that retains the task state corresponding to the task identifier, and a currently executing task identifier. Task register, interface that reads the program stored in the external memory encrypted with a predetermined program key when a task is requested, and decrypts each cache line based on the program key A task corresponding to a decryption key used to decrypt a cache line, which is composed of a cryptographic processing unit that generates a key and decrypts the read content and a plurality of cache lines each having a tag. A first cache memory for holding an identifier in a tag, and a cache line tag A task identifier which is held, by comparing the value of the task register, and an access verification unit for discarding the contents of the cache line if the values do not match.

第2の課題を解決するために、少ない秘密に基づいてブロックごとに異なる鍵で復号することを可能にする。これを実現するために、マイクロプロセッサは、以下を備える。   In order to solve the second problem, it is possible to decrypt with a different key for each block based on a small number of secrets. To achieve this, the microprocessor comprises:

(a)それぞれ固有のプログラム鍵に基づいて暗号化された複数のプログラムが格納されている外部メモリのアドレスを指定して、読み出し要求を発行するプロセッサコア;
(b)プロセッサコアの読み出し要求に応じて、外部メモリの指定されたアドレスのデータブロックを読み出すインターフェイス;
(c)プログラムの実行制御単位であるタスクごとに与えられるタスク識別子に対応して、プログラム鍵を保持するタスク鍵テーブル;
(d)タスク識別子ごとに、プログラムが配置された先頭アドレスをオフセット値として保持するオフセットテーブル;
(e)読み出し要求により指定されたアドレスと、オフセットテーブルのタスク識別子で指定されるオフセット値とから相対アドレス値を計算し、この相対アドレス値を、プログラム鍵で暗号化したブロック対応鍵を生成する鍵生成部;
(f)読み出されたデータブロックを、ブロック対応鍵により復号化する暗号処理部;および
(g)復号化されたデータブロックをキャッシュライン単位に読み込むキャッシュメモリ。
(A) a processor core that issues a read request by designating an address of an external memory in which a plurality of programs encrypted based on respective unique program keys are stored;
(B) an interface for reading a data block at a specified address in the external memory in response to a read request from the processor core;
(C) a task key table holding a program key corresponding to a task identifier given to each task which is a program execution control unit;
(D) an offset table that holds, as an offset value, the start address where the program is arranged for each task identifier;
(E) A relative address value is calculated from the address specified by the read request and the offset value specified by the task identifier of the offset table, and a block correspondence key is generated by encrypting the relative address value with the program key. Key generation unit;
(F) an encryption processing unit for decrypting the read data block with a block corresponding key; and (g) a cache memory for reading the decrypted data block in units of cache lines.

また、タスクの実行中断の際に、プログラムやデータが配置される物理アドレスは、しばしばシステムの資源管理によって変更される(リロケーション)が、ブロックごとに暗号化されたプログラムを復号して正常に実行するためには、情報は一定のアドレス空間に配置される必要がある。そこで、ターゲットアドレスとプログラムの開始アドレス(オフセットアドレス)との差で表わされる相対アドレスを計算するときは、仮想アドレスを用いる。   In addition, when a task is interrupted, the physical address where the program or data is allocated is often changed by system resource management (relocation), but the encrypted program for each block is decrypted and executed normally. In order to do this, the information needs to be placed in a certain address space. Therefore, when calculating the relative address represented by the difference between the target address and the program start address (offset address), a virtual address is used.

これによって、ブロック入れ替えを効果的に防止するとともいに、制限ある物理メモリを効率よく利用することができる。   As a result, block replacement can be effectively prevented, and limited physical memory can be used efficiently.

第3の課題を解決するために、マイクロプロセッサは、
(a)外部メモリに暗号化された状態で格納されているプログラムの実行コードおよびデータをキャッシュラインごとに取り込むインターフェイスと、
(b)プログラムの開始アドレスであるオフセット値を保持するオフセットテーブルを有し、実行コードを平文状態でキャッシュラインごとに保持する第1のキャッシュと、
(c)データのアドレス範囲を保持するアドレス範囲レジスタを有し、データを平文状態でキャッシュラインごとに保持する第2のキャッシュと、
(d)第1および第2のキャッシュに共通バスを介して接続され、プログラムの暗号化に用いた暗号鍵を保持する鍵値テーブルと、
(e)第1および第2のキャッシュバスおよび鍵値テーブルに共通バスを介して接続され、鍵値テーブルと第1のキャッシュから暗号鍵とオフセット値をそれぞれ受け取り、この暗号鍵とオフセット値に基づいて実行コードを復号化して第1のキャッシュに供給し、鍵値テーブルと第2のキャッシュから暗号鍵とアドレス範囲をそれぞれ受け取って、暗号鍵とアドレス範囲に基づきデータを復号化して第2のキャッシュに供給する暗号処理部と
を備える。
In order to solve the third problem, the microprocessor
(A) an interface for fetching an execution code and data of a program stored in an encrypted state in an external memory for each cache line;
(B) a first cache having an offset table that holds an offset value that is a start address of a program, and that holds an execution code for each cache line in a plain text state;
(C) a second cache having an address range register for holding an address range of data and holding the data for each cache line in a plaintext state;
(D) a key value table connected to the first and second caches via a common bus and holding an encryption key used for encrypting the program;
(E) Connected to the first and second cache buses and the key value table via a common bus, receives an encryption key and an offset value from the key value table and the first cache, respectively, and based on the encryption key and the offset value The execution code is decrypted and supplied to the first cache, the encryption key and the address range are received from the key value table and the second cache, respectively, and the data is decrypted based on the encryption key and the address range, and the second cache And an encryption processing unit to be supplied to.

この構成により、キャッシュ間で共有される効率的な暗号処理構造を有するマイクロプロセッサが実現される。   With this configuration, a microprocessor having an efficient cryptographic processing structure shared between caches is realized.

少ない数の秘密に基づき、簡便な方法でプログラムをブロックごとに暗号化、復号化するので、ブロック入れ替え攻撃を防止できるとともに、ソフトウェアベンダ側とマイクロプロセッサ側の双方の資源管理、処理負担が軽減する。   Based on a small number of secrets, the program is encrypted and decrypted for each block by a simple method, preventing block replacement attacks and reducing the resource management and processing burden on both the software vendor side and the microprocessor side. .

ブロック対応暗号化に、仮想メモリ空間に基づく相対アドレスを用いるので、リロケーションの問題に効率的に対処できる。   Since the relative address based on the virtual memory space is used for the block correspondence encryption, the problem of relocation can be efficiently dealt with.

鍵値テーブルと高速暗号鍵処理モジュールをキャッシュ間で共有することにより、ハードウェアコストが削減される。   By sharing the key value table and the high-speed encryption key processing module between the caches, the hardware cost is reduced.

以下、図面を参照しながら本発明の実施の形態を説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

図1は、本発明が適用されるマルチパーティのアプリケーション保護環境を説明するための図である。   FIG. 1 is a diagram for explaining a multi-party application protection environment to which the present invention is applied.

ソフトウェアベンダ121は、プログラム122を作製し、これをユーザ112のシステム102に内蔵されるマイクロプロセッサAに配布する。配布するプログラムを保護するため、平文プログラム122を暗号化する。   The software vendor 121 creates the program 122 and distributes it to the microprocessor A built in the system 102 of the user 112. In order to protect the program to be distributed, the plaintext program 122 is encrypted.

具体的には、実行コードと、初期化済データ等のデータで構成されるプログラムを、ソフトウェアベンダ121が選択したプログラム鍵で暗号化し、暗号化に用いたプログラム鍵を、ターゲットシステム102のプロセッサAの公開鍵Aで暗号化して配布鍵を生成する。   Specifically, a program composed of an execution code and data such as initialized data is encrypted with a program key selected by the software vendor 121, and the program key used for the encryption is converted into the processor A of the target system 102. The distribution key is generated by encrypting with the public key A.

このとき、ソフトウェアベンダ121は、プログラムや初期化データを複数のブロックに分割し、ブロックごとに異なる鍵で暗号化する。ただし、ベンダ121は、ブロック数に応じた数の鍵を選択するのではなく、複数の鍵を生成するための基本となる定数Cxと、Cxに基づいて生成された複数の鍵を暗号化する鍵Kxの2つだけを選択すればよい。詳細は後述するが、この2つの定数を基にして、ブロックごとに異なる鍵で暗号化し、暗号化プログラム123を生成する。そして、CxとKxをプロセッサAの公開鍵Aで暗号化して、配布鍵Kx[A]、Cx[A]を作製する。   At this time, the software vendor 121 divides the program and initialization data into a plurality of blocks, and encrypts them with different keys for each block. However, the vendor 121 does not select the number of keys according to the number of blocks, but encrypts a constant Cx that is a basis for generating a plurality of keys and a plurality of keys generated based on the Cx. Only two of the keys Kx need be selected. Although details will be described later, based on these two constants, encryption is performed with a different key for each block, and the encryption program 123 is generated. Then, Cx and Kx are encrypted with the public key A of the processor A to create distribution keys Kx [A] and Cx [A].

なお、図1では、説明の便宜上、単一のソフトウェアベンダしか描いていないが、マルチパーティの環境を想定しているので、ユーザ112は、複数のベンダから、それぞれブロック暗号化プログラムを購入し、システム102に格納するものとする。   In FIG. 1, for convenience of explanation, only a single software vendor is depicted, but since a multi-party environment is assumed, the user 112 purchases block encryption programs from a plurality of vendors, respectively. Assume that it is stored in the system 102.

配布されたブロック暗号化プログラムは、配布鍵とともに、いったんハードドライブディスクなどの二次記憶107に格納され、実行時にメモリ108に確保された領域109−1に読み込まれる。このメモリへの読み込みは、システム102の資源を管理するOS110によって行われる。プログラム本体と配布鍵は同一のファイルに格納しても良いし、別々のファイルに格納してもよい。メモリ108は、同じベンダ121による別のプログラムや、その他のベンダからのプログラムのための領域109−nも有するが,説明の便宜上、これらについては省略する。   The distributed block encryption program is temporarily stored in the secondary storage 107 such as a hard drive disk together with the distribution key, and is read into the area 109-1 secured in the memory 108 at the time of execution. Reading into the memory is performed by the OS 110 that manages the resources of the system 102. The program body and the distribution key may be stored in the same file or in separate files. The memory 108 also has an area 109-n for another program by the same vendor 121 and programs from other vendors, but these are omitted for convenience of explanation.

プロセッサAは、配布鍵125を読み込み、秘密鍵Aを用いて、保護ロジック106で配布鍵を復号する。復号した鍵で、メモリ108に配置された暗号化プログラムを、ブロック単位でキャッシュメモリ104に読み込み、ブロックごとに復号化する。このとき、プロセッサAの特徴として、限られた数の秘密、たとえば2つの定数Kx、Cxから、複数の暗号ブロックの各々に対応したブロック対応鍵を生成して、ブロック単位で復号する能力を有する。   The processor A reads the distribution key 125 and uses the secret key A to decrypt the distribution key with the protection logic 106. With the decrypted key, the encryption program arranged in the memory 108 is read into the cache memory 104 in units of blocks and decrypted for each block. At this time, the processor A has a capability to generate a block-corresponding key corresponding to each of a plurality of cipher blocks from a limited number of secrets, for example, two constants Kx and Cx, and decrypt them in units of blocks. .

図2は、図1に示すマイクロプロセッサAのハードウェア構成図である。プロセッサAは、プロセッサパッケージ200の中に、コア902、命令キャッシュ903、データキャッシュ904、これらのキャッシュで共有される高速暗号鍵処理モジュール(FCM:Fast Ciphering Module)911、鍵値テーブル(KVT:key value table)912、配布鍵管理モジュール913、バスインターフェイス(BIU)906を有する。これらは、内部バス905で互いに接続されている。   FIG. 2 is a hardware configuration diagram of the microprocessor A shown in FIG. The processor A includes, in the processor package 200, a core 902, an instruction cache 903, a data cache 904, a fast ciphering module (FCM) 911 shared by these caches, and a key value table (KVT: key). value table) 912, a distribution key management module 913, and a bus interface (BIU) 906. These are connected to each other by an internal bus 905.

コア902、高速暗号鍵処理モジュール911、鍵値テーブル912、配布鍵管理モジュール913で、図1の保護ロジックを構成する。   The core 902, the high-speed encryption key processing module 911, the key value table 912, and the distribution key management module 913 constitute the protection logic of FIG.

コア902は、レジスタアレイ915とタスクスイッチャー914を有する。タスクスイッチャー914は、タスクの切り替え、すなわち割り込み発生時のコンテキストの保存、復帰を実行する。コンテキストは、タスクの実行に対応して生成され、タスクと対応して管理される。これを実現するために、タスクスイッチャー914は、内部にタスク状態テーブル921と、ハッシュ計算部922を有する。タスク状態テーブル921は、後述するように、タスクIDと対応付けてタスク状態を保持する。また、図示はしないが、コア902は、レジスタアレイにあるコンテキストの変更通知や、配布鍵設定命令などを発する。   The core 902 includes a register array 915 and a task switcher 914. The task switcher 914 executes task switching, that is, saving and restoring context when an interrupt occurs. The context is generated corresponding to the execution of the task, and is managed corresponding to the task. In order to realize this, the task switcher 914 includes a task state table 921 and a hash calculation unit 922 inside. As will be described later, the task state table 921 holds task states in association with task IDs. Although not shown, the core 902 issues a context change notification in the register array, a distribution key setting command, and the like.

命令キャッシュ903は、プログラムの実行コードをキャッシュする。通常のアドレスを識別するキャッシュタグに加え、保護タスクを識別するタグも付けられ、マイクロプロセッサの内部データでアプリケーションの独立性を保証する。なお、図2には図示しないが、後述するように,命令キャッシュは、プログラム(実行コード)やデータの開始アドレス(オフセット)を記述するオフセットテーブル1207(図9参照)を内部に有する。   The instruction cache 903 caches the execution code of the program. In addition to the cache tag identifying the normal address, a tag identifying the protection task is also attached to ensure application independence with microprocessor internal data. Although not shown in FIG. 2, as will be described later, the instruction cache has an offset table 1207 (see FIG. 9) that describes a start address (offset) of a program (execution code) and data.

データキャッシュ904は、プログラムの初期化データ、スタックデータ、ダイナミックデータなど、プログラムに関連する種々の情報をキャッシュする。   The data cache 904 caches various information related to the program, such as program initialization data, stack data, and dynamic data.

高速(対称)鍵暗号処理モジュール911は、鍵生成モジュール1312と暗号処理モジュール1313を有する。鍵生成モジュール1312は、内部バス905を通じてブロックの鍵と、処理対象ブロックの相対アドレス値を取得し、後述する方法でブロックごとに対応する暗号鍵を生成する。暗号処理モジュール1313は、生成されたブロックごとの暗号鍵により、対応するブロックの暗号/復号処理を実行する。ブロックの暗号処理には複数クロックを要するので、複数のモジュールを並列処理するためのディスパッチャも含む。   The high speed (symmetric) key encryption processing module 911 includes a key generation module 1312 and an encryption processing module 1313. The key generation module 1312 acquires the block key and the relative address value of the processing target block through the internal bus 905, and generates a corresponding encryption key for each block by a method described later. The encryption processing module 1313 executes encryption / decryption processing of the corresponding block using the generated encryption key for each block. Since the block encryption process requires a plurality of clocks, a dispatcher for processing a plurality of modules in parallel is also included.

鍵値テーブル(KVT)912は、キャッシュから送られてくるテーブルID情報に基づいてテーブルを検索し、鍵の値を高速暗号鍵処理モジュール911に供給する。   The key value table (KVT) 912 searches the table based on the table ID information sent from the cache, and supplies the key value to the high-speed cryptographic key processing module 911.

配布鍵管理モジュール913は、配布鍵の公開鍵復号化および復号化結果のテーブルをセットアップする。   The distribution key management module 913 sets up a public key decryption and decryption result table for the distribution key.

マイクロプロセッサはまた、点線の矢印で示すように、タスクチャンネル916を有し、コア902から他のモジュールへ、現在実行中のタスク、およびコンテキスト保存されるタスクの情報を伝達する。マイクロプロセッサのパッケージの外に外部メモリとしてのRAM907,周辺回路を接続するいわゆるサウスブリッジ908があり、バスインターフェイス905で、内部バス905と外部メモリ907やサウスブリッジ908との間のデータ転送、バッファリングを行なう。   The microprocessor also has a task channel 916, as shown by the dotted arrows, to convey information about the currently executing task and the context saved task from the core 902 to other modules. In addition to the microprocessor package, there is a so-called south bridge 908 for connecting a RAM 907 as an external memory and peripheral circuits, and a bus interface 905 transfers and buffers data between the internal bus 905 and the external memory 907 or south bridge 908. To do.

図3は、プログラムをブロックごとに暗号化する手順を説明する図である。この処理は、図1のソフトウェアベンダ121のブロック対応暗号処理部126によって行われる。   FIG. 3 is a diagram illustrating a procedure for encrypting a program for each block. This processing is performed by the block corresponding encryption processing unit 126 of the software vendor 121 in FIG.

ソフトウェアベンダが開発した平文のアプリケーションプログラムのプログラム領域1001は、128ビット(16バイト)を単位とする複数のブロック0〜ブロックnで構成されている。この領域全体に対して、あらかじめ2つの定数KxとCxが選択されている。   A program area 1001 of a plain text application program developed by a software vendor is composed of a plurality of blocks 0 to n in units of 128 bits (16 bytes). Two constants Kx and Cx are selected in advance for the entire area.

まず、定数Cxと、プログラムの先頭から見た相対的は各ブロックの先頭アドレスとの和を求める。たとえば最初のブロック0の先頭バイトは0であるから、Cx+0が計算される(S1002−0)。Cx+0の値は、秘密鍵Kxで暗号化され、ブロック対応鍵Kv0が生成される(S1003−0)。平文ブロック1001−0は、このブロック対応鍵Kv0で暗号化され(S1004−0)、暗号ブロック1005−0が生成される。   First, the sum of the constant Cx and the relative head address of each block is obtained. For example, since the first byte of the first block 0 is 0, Cx + 0 is calculated (S1002-0). The value of Cx + 0 is encrypted with the secret key Kx, and a block corresponding key Kv0 is generated (S1003-0). The plaintext block 1001-0 is encrypted with this block corresponding key Kv0 (S1004-0), and an encrypted block 1005-0 is generated.

同様に、2番目のブロック1の先頭バイトは16バイトであるから、プログラムの先頭からみた相対アドレスは16となり、Cx+16を計算する(S1002−1)。   Similarly, since the first byte of the second block 1 is 16 bytes, the relative address viewed from the top of the program is 16, and Cx + 16 is calculated (S1002-1).

n+1番目のブロックnの相対アドレスは16nであり、Cx+16nを求める(S1002−n)。これらの値をKxで暗号化して、対応するブロックの暗号鍵Kv1〜Kvnを生成する(S1004−1〜S1004−n)。各暗号鍵で平文ブロック1〜nを暗号化し、暗号ブロック1005−1〜1005−nを生成する。 The relative address of the (n + 1) th block n is 16n, and Cx + 16n is obtained (S1002-n). These values are encrypted with Kx to generate corresponding block encryption keys Kv1 to Kvn (S1004-1 to S1004-n). The plaintext blocks 1 to n are encrypted with each encryption key to generate encryption blocks 1005-1 to 1005-n.

図3では、暗号化処理S1003−0〜S1003−nや、S1004−0〜S1004−nを独立に示してあるが、ひとつの暗号化処理に与えるパラメータを変えて繰り返し使ってもよいし、ソフトウェアで実現してもよい。   In FIG. 3, encryption processing S1003-0 to S1003-n and S1004-0 to S1004-n are shown independently, but the parameters given to one encryption processing may be changed and used repeatedly. It may be realized with.

図3に示す暗号化方法によれば、プログラムベンダ121は、ターゲットシステム102でプログラムが配置される絶対アドレスを意識せずに、暗号処理することができる。プログラムベンダは絶対アドレス値を予想することはできないので、絶対アドレス値に基づいてブロック対応鍵を生成しようとすると、ターゲットシステム102からあらかじめプログラムが配置される絶対アドレスの通知を受けてから、配置アドレス対応の暗号化プログラム本体を作成するか、配置アドレス対応の暗号化プログラム本体を無数に配布しなければならない。いずれの場合もプログラム本体の配布コストが著しく大きくなる。   According to the encryption method shown in FIG. 3, the program vendor 121 can perform encryption processing without being aware of the absolute address where the program is placed in the target system 102. Since the program vendor cannot predict the absolute address value, when trying to generate a block-corresponding key based on the absolute address value, after receiving the notification of the absolute address where the program is arranged in advance from the target system 102, the arrangement address Either a corresponding encryption program body must be created, or an infinite number of encryption program bodies corresponding to arrangement addresses must be distributed. In either case, the distribution cost of the program body is significantly increased.

図3の方法では、配布しなければならない秘密は鍵Kxと定数Cxのみであり、かつ、各ブロックの相対アドレスを使用して複数ブロック対応の暗号鍵を生成するので、ソフトウェアベンダ側の処理負担が軽減され、経済性も満たされる。   In the method of FIG. 3, the only secret that must be distributed is the key Kx and the constant Cx, and an encryption key corresponding to a plurality of blocks is generated using the relative address of each block. Is reduced, and economic efficiency is satisfied.

こうして暗号化された各ブロック1005−0〜1005−nは、配布鍵Kx[A],Cx[A]とともに、ターゲットシステム102に送られる。ターゲットシステムでは、秘密情報Kx、Cxと、ブロックの相対アドレス値さえ与えられれば、マイクロプロセッサ内で、他のブロックのデータや配置されたメモリの絶対番地に依存せず、各ブロック独立に復号することができる。   The blocks 1005-0 to 1005-n thus encrypted are sent to the target system 102 together with the distribution keys Kx [A] and Cx [A]. In the target system, as long as the secret information Kx and Cx and the relative address value of the block are given, each block is independently decoded without depending on the data of other blocks and the absolute address of the arranged memory in the microprocessor. be able to.

これは、メモリへのランダムアクセスを特徴とする現在のコンピュータアーキテクチャおよびアプリケーションプログラムのリロケーションを前提とした現在のOSに効率よく適合する。   This efficiently adapts to current computer architectures characterized by random access to memory and current OSs that presuppose relocation of application programs.

また、たとえ攻撃者が、ブロックの不正な入れ換えを行っても、ブロックごとの相対アドレス値が異なるので、ブロック暗号鍵Kvも異なり、攻撃者の意図する動作は行われない。   Even if the attacker performs illegal block replacement, since the relative address value for each block is different, the block encryption key Kv is also different and the operation intended by the attacker is not performed.

次に、ターゲットシステム102側での動作の詳細を説明する。   Next, details of the operation on the target system 102 side will be described.

プログラムの実行に先立って、OS110は、ソフトウェアベンダ121から受け取ったアプリケーションプログラムの実行コード、初期化データ(静的データ)、作業領域(スタック)に、それぞれメモリ108の領域を割り当てる。この段階では、プログラムは暗号化されたままの状態である。割り当てられるメモリ領域の開始アドレスは、システムの状態、すなわち連係して動作する他のプログラムモジュールや共有メモリの配置によって変わってくるので、システムを管理するOSは、状況に応じて領域のアドレスを自由に決定する(リロケーション)。OS110はまた、配置鍵を配置するメモリ領域を決定し、配布鍵情報を読み込む。   Prior to execution of the program, the OS 110 allocates an area of the memory 108 to the execution code, initialization data (static data), and work area (stack) of the application program received from the software vendor 121. At this stage, the program remains encrypted. Since the start address of the allocated memory area varies depending on the system status, that is, the arrangement of other program modules that operate in conjunction with each other and the shared memory, the OS that manages the system can freely set the address of the area according to the situation. (Relocation) The OS 110 also determines a memory area in which the arrangement key is arranged, and reads the distribution key information.

OS110は、これらの領域のアドレス情報を、メモリ上の情報配置記述子(IAD:information arrangement descriptor)とよばれる構造体に記述する。   The OS 110 describes the address information of these areas in a structure called an information arrangement descriptor (IAD) on the memory.

図4は、あるタスクの仮想アドレス空間のメモリマップと、情報配置記述子1111および配布鍵情報1121の構造を示す。メモリマップ上には、プログラム1102、初期化(static)データ1103、作業領域(スタック)1104に加え、情報配布記述子用の領域1105、配布鍵用の領域1106が配置される。   FIG. 4 shows the memory map of the virtual address space of a certain task, and the structure of the information allocation descriptor 1111 and distribution key information 1121. On the memory map, an information distribution descriptor area 1105 and a distribution key area 1106 are arranged in addition to the program 1102, the initialization data 1103, and the work area (stack) 1104.

情報配置記述子1111は、プログラム領域の開始アドレス(オフセット)1112、データ領域開始アドレス(オフセット)1113、データ領域終了アドレス1114、作業領域開始アドレス(オフセット)1115、作業領域終了アドレス1116、配布鍵アドレス開始アドレス(オフセット)1117を含む。   The information allocation descriptor 1111 includes a program area start address (offset) 1112, a data area start address (offset) 1113, a data area end address 1114, a work area start address (offset) 1115, a work area end address 1116, and a distribution key address. A start address (offset) 1117 is included.

配布鍵1121は、プログラム鍵(Kx)1122、プログラム秘密定数(Cx)1123、初期化データ鍵1124、初期化データ秘密定数1125、初期化データ長1126、作業領域(スタック)鍵1127、作業領域秘密定数1128、作業領域長1129を含む。   The distribution key 1121 includes a program key (Kx) 1122, a program secret constant (Cx) 1123, an initialization data key 1124, an initialization data secret constant 1125, an initialization data length 1126, a work area (stack) key 1127, and a work area secret. A constant 1128 and a work area length 1129 are included.

メモリ上に配置されたプログラムが、マイクロプロセッサ103に読み込まれて、復号、実行されるときは、OS110は、情報配置記述子に基づいて、タスク状態を制御する種々の特権命令(タスク制御命令)を発行して、タスクの状態管理を行う。   When a program arranged on the memory is read into the microprocessor 103 and decoded and executed, the OS 110 performs various privileged instructions (task control instructions) for controlling the task state based on the information arrangement descriptor. To manage the task status.

図5は、タスク制御命令の例を示し、図6は、タスクの状態遷移を示す。タスク制御命令は、内部テーブルへのタスクの登録(register)、タスクの開始(start)、中断されたタスク状態の保存(suspend)、中断されたタスクの再開(continue)、タスクの終了、すなわち内部テーブルからのタスク秘密情報の削除(delete)などを含む。そして、これらの制御命令に応じて、図6に示すようにNULL状態201からINIT状態202になり、RUN状態203、STOPPED状態204、SUSPEND状態205等を遷移する。   FIG. 5 shows an example of a task control instruction, and FIG. 6 shows a task state transition. Task control instructions are: register task to internal table (register), start task (start), save suspended task state (suspend), resume suspended task (continue), end task, ie internal This includes deleting task secret information from the table. Then, in response to these control instructions, as shown in FIG. 6, the state changes from the NULL state 201 to the INIT state 202, and transits to the RUN state 203, the STOPPED state 204, the SUSPEND state 205, and the like.

以下、タスクを実行するための動作について、特に、タスクの登録、タスクの実行、タスクの中断、タスクの終了を中心に、詳細に説明する。   Hereinafter, the operation for executing a task will be described in detail with a focus on task registration, task execution, task interruption, and task termination.

<タスクの登録>
1.登録処理フロー
まず、タスクを登録するために、OS110は、登録したいタスクのIDと、そのプログラムの情報配置記述子の先頭アドレスをパラメータとして、特権命令であるregister命令を発行する。register命令の発行により、このプログラムのための配布鍵1121が復号され、各メモリブロックの復号に使われる鍵と相対アドレス情報が、タスクIDと関連付けて、マイクロプロセッサ内の各種テーブル(後述)に登録される。
<Register task>
1. Registration Process Flow First, in order to register a task, the OS 110 issues a register instruction, which is a privileged instruction, using the ID of the task to be registered and the start address of the information allocation descriptor of the program as parameters. By issuing a register instruction, the distribution key 1121 for this program is decrypted, and keys and relative address information used for decryption of each memory block are registered in various tables (described later) in the microprocessor in association with the task ID. Is done.

図7は、マイクロプロセッサ(ハードウェア)103上でのタスク登録の概略動作を示し、図8は、登録(register)命令の処理フローを示す。   FIG. 7 shows a schematic operation of task registration on the microprocessor (hardware) 103, and FIG. 8 shows a processing flow of a register (register) instruction.

情報配置記述子(IAD)1111のアドレスとタスクID#1をパラメータとしてregister命令が発行されると、コア902内のタスクスイッチャー914はタスクの状態をチェックする(S301)。タスク状態がNULLでなければ(S301でNO)、タスク状態をINVALIDとしてエラーにする(S308)。タスク状態がNULLならば(S301でYES)、図7の点線(1)で示すように、コア902は情報配置記述子のアドレスとタスクIDを含む登録要求を、配布鍵管理モジュール913のシーケンサ913−1に書き込む。   When a register instruction is issued with the address of the information allocation descriptor (IAD) 1111 and the task ID # 1 as parameters, the task switcher 914 in the core 902 checks the task status (S301). If the task state is not NULL (NO in S301), the task state is set to INVALID and an error is generated (S308). If the task state is NULL (YES in S301), the core 902 sends a registration request including the address of the information placement descriptor and the task ID to the sequencer 913 of the distribution key management module 913 as shown by the dotted line (1) in FIG. Write to -1.

シーケンサは、図7の点線(2)で示すように、情報配置記述子の領域に対するメモリ読み出し要求をBIU906に送り、BIUは、点線(3)で示すように情報記述子1111をシーケンサに供給する。シーケンサはこの情報記述子を解析して、プログラム、初期化データ、作業領域に対応するオフセットアドレスや範囲、配布鍵オフセットアドレス1117を取得する(S302)。   The sequencer sends a memory read request for the area of the information placement descriptor to the BIU 906 as shown by the dotted line (2) in FIG. 7, and the BIU supplies the information descriptor 1111 to the sequencer as shown by the dotted line (3). . The sequencer analyzes this information descriptor, and acquires a program, initialization data, an offset address and range corresponding to the work area, and a distribution key offset address 1117 (S302).

次にシーケンサは、配布鍵アドレスに対する読み出し要求をBIUに送る。   Next, the sequencer sends a read request for the distribution key address to the BIU.

BIUは、点線(4)で示すように、配布鍵の内容を公開鍵復号モジュール913−2に供給する。公開鍵復号モジュール913−2は、配布鍵1121(図4)を復号化し、プログラムの秘密定数(Cx)、初期化データの秘密定数、作業領域秘密定数を取得する(S303)。 The BIU supplies the contents of the distribution key to the public key decryption module 913-2 as indicated by the dotted line (4). The public key decryption module 913-2 decrypts the distribution key 1121 (FIG. 4), and acquires the program secret constant (Cx), the initialization data secret constant, and the work area secret constant (S303).

次に、図7の点線(5)で示すように、S302で取得したプログラム、初期化データ、作業領域のオフセットアドレスを、命令キャッシュ903のオフセットテーブル(図9参照)に書き込む(S304)。   Next, as indicated by the dotted line (5) in FIG. 7, the program, initialization data, and work area offset address acquired in S302 are written into the offset table (see FIG. 9) of the instruction cache 903 (S304).

同様に、S303で取得したプログラム、初期化データ、作業領域の暗号鍵(秘密定数)を、鍵値テーブル912に書き込む(S305)。   Similarly, the program, initialization data, and work area encryption key (secret constant) acquired in S303 are written in the key value table 912 (S305).

こうして、テーブルが設定され、タスクの登録が完了する。 Thus, the table is set and task registration is completed.

タスクの登録が完了すると、タスク状態はNULLからINITに移行し(S306)、この状態の遷移は、割り込みによりコア902に通知され(S307)、OSは、タスクを実行するための準備が整ったことを知る。   When task registration is completed, the task state shifts from NULL to INIT (S306). This state transition is notified to the core 902 by an interrupt (S307), and the OS is ready to execute the task. Know that.

2.テーブルの設定
マイクロプロセッサ内の各種テーブルの設定を説明する前に、図9〜11を参照して、マイクロプロセッサを構成する命令キャッシュ903、高速暗号鍵処理モジュール(FCM)911、鍵値テーブル(KVT)912、データキャッシュ904の構成を説明する。
2. Table Settings Before describing the settings of various tables in the microprocessor, referring to FIGS. 9 to 11, an instruction cache 903, a high-speed cryptographic key processing module (FCM) 911, and a key value table (KVT) constituting the microprocessor are described. 912, the configuration of the data cache 904 will be described.

図9は命令キャッシュ903の詳細を示す。命令キャッシュ903は、命令TLB(translation lookaside buffer)1202を有する命令管理ユニット(MMU)1201と、命令キャッシュメモリ1203と、カレントタスクIDレジスタ1204と、キャッシュアクセス検証部1205と、タスクID書き込み部1206と、オフセットテーブル1207を含む。   FIG. 9 shows details of the instruction cache 903. The instruction cache 903 includes an instruction management unit (MMU) 1201 having an instruction TLB (translation lookaside buffer) 1202, an instruction cache memory 1203, a current task ID register 1204, a cache access verification unit 1205, a task ID writing unit 1206, The offset table 1207 is included.

キャッシュメモリ1203は、複数の所定サイズのキャッシュラインで構成され、各キャッシュラインは、そのキャッシュライン(ブロック)で実行されるタスクのタスクIDを保持するタグを有する。キャッシュアクセス検証部1205は、タグに保持されたタスクIDと、カレントタスクIDレジスタの値とを比較し、一致するときのみアクセスを許可する。一致しないときは、そのキャッシュラインの内容を廃棄する。   The cache memory 1203 includes a plurality of cache lines having a predetermined size, and each cache line has a tag that holds a task ID of a task executed in the cache line (block). The cache access verification unit 1205 compares the task ID held in the tag with the value of the current task ID register, and permits access only when they match. If they do not match, the contents of the cache line are discarded.

図10は、鍵値テーブル(KVT)912と、高速暗号鍵処理モジュール(FCM)911の詳細を示す。KVT912は、テーブルアクセス制御部1301と、カレントタスクIDレジスタ1302と、タスク鍵(あるいはプログラム鍵)テーブル1303と、コンテキスト鍵テーブル1304と、データ鍵テーブル1305を含む。ここでは図示はしないが、データ鍵テーブル1305は、4つのテーブル(0〜3)を含む。KVT912は、パス1315を介してバス905と接続される。   FIG. 10 shows details of the key value table (KVT) 912 and the high-speed cryptographic key processing module (FCM) 911. The KVT 912 includes a table access control unit 1301, a current task ID register 1302, a task key (or program key) table 1303, a context key table 1304, and a data key table 1305. Although not shown here, the data key table 1305 includes four tables (0 to 3). The KVT 912 is connected to the bus 905 via the path 1315.

高速暗号鍵処理モジュール(FCM)911は、ディスパッチャ1311と、鍵生成モジュール1312と、暗号処理モジュール1313を含む。鍵生成モジュール1312は、鍵生成単位として並列に1312−1〜1312−3を有し、暗号処理モジュール1313は暗号処理単位として1313−1〜1313−3を有する。ディスパッチャ1311は、後述するように、鍵生成単位や暗号処理単位の空きのある部分に処理を割り振り、並列処理を可能にする。FCM911は、パス1314を介してバス905に接続される。   The high-speed cryptographic key processing module (FCM) 911 includes a dispatcher 1311, a key generation module 1312, and a cryptographic processing module 1313. The key generation module 1312 has 1312-1 to 1312-3 in parallel as key generation units, and the cryptographic processing module 1313 has 1313-1 to 1313-3 as cryptographic processing units. As will be described later, the dispatcher 1311 allocates a process to an empty part of a key generation unit or an encryption processing unit, and enables parallel processing. The FCM 911 is connected to the bus 905 via the path 1314.

KVT912からFCM911へ、パス1316を介して暗号鍵が転送され、パス1317を介して相対アドレス値が転送される。   The encryption key is transferred from the KVT 912 to the FCM 911 via the path 1316, and the relative address value is transferred via the path 1317.

図11は、データキャッシュ904の詳細を示す。データキャッシュ904は、カレントタスクIDレジスタ1401と、アドレス範囲を保持するMTRR(memory type range register)テーブル1403と、このテーブルを管理しMTRRテーブルのアドレス範囲とターゲットアドレスを比較するMTRRテーブル管理比較部1402と、暗号属性送出部1411と、データキャッシュメモリ1431と、データTLB1433を有するMMU1442と、保存予定コンテキスト識別子レジスタ1434を含む。暗号属性送出部1411は、データやコンテキストを外部メモリへ書き戻すときに、その暗号属性を確認するために、読み込み要求データ暗号識別子レジスタ1412と、読み込み要求コンテキスト暗号鍵識別子レジスタ1413と、書き出し要求データ暗号鍵識別子レジスタ1414と、書き出し要求コンテキスト暗号鍵識別子レジスタ1415と、アクセス検証部1421を有する。MMU1442は、所定の変換情報に基づいて、コア902から出力される仮想アドレスから物理アドレスへと変換してメモリアクセスを行う。   FIG. 11 shows details of the data cache 904. The data cache 904 includes a current task ID register 1401, an MTRR (memory type range register) table 1403 that holds an address range, and an MTRR table management comparison unit 1402 that manages this table and compares the address range of the MTRR table with a target address. An encryption attribute sending unit 1411, a data cache memory 1431, an MMU 1442 having data TLB 1433, and a storage-scheduled context identifier register 1434. The encryption attribute sending unit 1411 reads the read request data encryption identifier register 1412, the read request context encryption key identifier register 1413, and the write request data in order to confirm the encryption attribute when data or context is written back to the external memory. It has an encryption key identifier register 1414, a write request context encryption key identifier register 1415, and an access verification unit 1421. Based on predetermined conversion information, the MMU 1442 converts a virtual address output from the core 902 into a physical address and performs memory access.

KVT912の6種類のテーブル、すなわちプログラム鍵テーブル1303、コンテキスト鍵テーブル1304、データ鍵テーブル1305(0−3)は、それぞれタスクIDでインデックスされ、鍵生成に使う2種類の秘密情報を保持できる。ブロックの復号鍵生成に使われる2つの秘密情報、例えば図4に示すプログラムのためのKx1122とCx1123は、KVT912のプログラム鍵テーブル1303のタスクID#1の欄に書き込まれる。   Six types of KVT 912 tables, that is, a program key table 1303, a context key table 1304, and a data key table 1305 (0-3) are each indexed by a task ID and can hold two types of secret information used for key generation. Two pieces of secret information used for block decryption key generation, for example, Kx1122 and Cx1123 for the program shown in FIG. 4, are written in the task ID # 1 column of the program key table 1303 of KVT912.

一方、このプログラム領域のオフセット値1112は、命令キャッシュ903内のオフセットテーブル1207のタスクID#1の欄に書き込まれる。   On the other hand, the offset value 1112 of this program area is written in the task ID # 1 column of the offset table 1207 in the instruction cache 903.

データキャッシュ904のMTRRテーブル1403は、タスクIDと0〜3の値をとるMTRR識別子で識別される。すなわち、MTRRテ−ブル1403は、1タスク当たり4個のMTRR(アドレス範囲レジスタ)を持ち、それぞれにデータ領域のアドレス範囲と鍵の値を登録することができる。タスク登録時においては、MTRR識別子0、1に対応する初期化データと、作業領域(スタック)に対応するMTRRが設定される。また、MTRR2,3の内容は0で初期化される。   The MTRR table 1403 of the data cache 904 is identified by a task ID and an MTRR identifier that takes a value from 0 to 3. That is, the MTRR table 1403 has four MTRRs (address range registers) per task, and can register the address range of the data area and the key value in each. At the time of task registration, initialization data corresponding to the MTRR identifiers 0 and 1 and MTRR corresponding to the work area (stack) are set. The contents of MTRR 2 and 3 are initialized with 0.

あるタスクがメモリを参照する時、ターゲットアドレスとMTRRのアドレス範囲とが比較され、一致したMTRRに対応する暗号化属性(すなわち鍵)が使用される。   When a task references memory, the target address and the MTRR address range are compared and the encryption attribute (ie, key) corresponding to the matched MTRR is used.

データについても、MTRRの先頭番地をオフセットとして、相対アドレス値を使用して、上述した手順の暗号鍵生成が適用される。 The encryption key generation of the above-described procedure is also applied to the data using the relative address value with the start address of the MTRR as an offset.

テーブルの内容に矛盾が発生するのを防ぐため、これらのテーブルを書き換えている期間は、コア902ではこのタスクに対するあらゆるオペレーションが禁止される。   In order to prevent inconsistencies in the contents of the tables, the core 902 prohibits all operations for this task during the period during which these tables are rewritten.

テーブルの書換えが完了すると、タスクスイッチャー(STS)914のタスク状態テーブル921で、このタスクIDに対応するエントリが状態NULLからINITに書き換えられ、登録の完了が、割り込みによってコア902に通知される。   When the rewriting of the table is completed, the entry corresponding to this task ID is rewritten from the state NULL to INIT in the task state table 921 of the task switcher (STS) 914, and the completion of registration is notified to the core 902 by an interrupt.

なお、本実施例ではこれらの登録オペレーションをハードウェアで実装した例を示したが、ファームウェアとしてプロセッサ内部に組み込まれたソフトウェアとして実装してもよい。ただし、ファームウェアは悪意を持つシステムユーザによって改変されることがないような注意が必要である。   In the present embodiment, an example in which these registration operations are implemented by hardware has been described. However, the registration operation may be implemented as software incorporated in the processor as firmware. However, care must be taken that the firmware cannot be altered by a malicious system user.

<タスクの実行>
1.タスクの実行開始
タスクを実行するには、INIT状態にあるタスクに対して、OSがタスクIDをパラメータとしてstart命令を実行する。すると制御がプログラム領域の先頭に移される。
<Execute task>
1. Task Execution Start To execute a task, the OS executes a start instruction for the task in the INIT state with the task ID as a parameter. Control is then transferred to the beginning of the program area.

INIT状態にあるタスク以外を指定してstart命令を実行した場合、エラーとなり、なにも実行されない。 If a start instruction is executed by specifying a task other than the task in the INIT state, an error occurs and nothing is executed.

図12は、タスク実行開始命令の処理フローを示す。あるタスクについてそのタスクIDを指定してstart命令が発行されると、まず、そのタスク状態がINITにあるかどうか、すなわち、タスク実行の準備が整った状態にあるか否かを判断する(S401)。INIT以外の状態にあるタスク識別子を指定してstart命令が出された場合は(S401でNO)、タスク状態テーブル921がINVALIDにされ(S407)、エラーとなる。   FIG. 12 shows a processing flow of a task execution start instruction. When a start instruction is issued with a task ID specified for a task, it is first determined whether the task state is INIT, that is, whether the task is ready for execution (S401). ). If a start instruction is issued by specifying a task identifier in a state other than INIT (NO in S401), the task state table 921 is set to INVALID (S407), resulting in an error.

タスクがINIT状態にある場合は(S401でYES)、コア902が保持するカレントタスクIDが、新しいタスクに設定され(S402)、レジスタアレイ915が初期化される(S403)。また、プログラムカウンタ(不図示)の値が、プログラム領域の先頭に設定される(S404)。   If the task is in the INIT state (YES in S401), the current task ID held by the core 902 is set to a new task (S402), and the register array 915 is initialized (S403). Also, the value of the program counter (not shown) is set at the beginning of the program area (S404).

続いて、新しいタスクIDが、タスクチャンネル916を通じて、命令キャッシュ903、データキャッシュ904、鍵値テーブル912に通知され、それぞれのカレントタスクIDレジスタ1204、1401、1302に保持される(S405)。   Subsequently, the new task ID is notified to the instruction cache 903, the data cache 904, and the key value table 912 through the task channel 916, and held in the respective current task ID registers 1204, 1401, and 1302 (S405).

その後、コア902のタスク状態テーブル921で、タスク状態がINITからRUNに書き換えられ(S406)、実行が開始される。 Thereafter, the task state is rewritten from INIT to RUN in the task state table 921 of the core 902 (S406), and execution is started.

本実施形態では、ブロックごとに暗号化され保護されたプログラムを実行するので、外部メモリのプログラムがキャッシュに読み込まれる際に、タスクIDに対応して登録されたプログラム鍵に基づいて、ブロックごとにプログラムの復号化が行われ、復号結果である平文がキャッシュに読み込まれ、実行される。このとき、タスク登録時に配置されたメモリアドレスに合わせて、オフセットを命令キャッシュ903内部のオフセットテーブル1297に登録し、メモリアクセスとオフセットの差を相対アドレス値として使用するので、プログラマが暗号化したプログラムがOSによりどのアドレスに配置されていても、正しく復号化できる。   In this embodiment, since the program encrypted and protected for each block is executed, when the program in the external memory is read into the cache, the program is registered for each block based on the program key registered corresponding to the task ID. The program is decrypted, and the plaintext that is the decryption result is read into the cache and executed. At this time, the offset is registered in the offset table 1297 in the instruction cache 903 according to the memory address arranged at the time of task registration, and the difference between the memory access and the offset is used as a relative address value. Can be correctly decoded no matter what address is placed by the OS.

なお、実施形態ではNULL状態から中間のINIT状態を経てRUN状態へ移行する例が書かれているが、これは配布鍵の公開鍵アルゴリズム処理を非同期的に実行することにより、公開鍵アルゴリズム処理中の比較的長い応答不能時間を短縮することが目的である。応答不能時間を許容すれば中間のINIT状態を省略してもさしつかえない。(非同期的公開アルゴリズム処理については、同一出願人による特許出願第2001−024480号を参照されたい。)
2.命令キャッシュの読み込み
次に、命令キャッシュ903の読み込み処理について、図13の処理フローを参照して説明する。
In the embodiment, an example is described in which the transition from the NULL state to the RUN state via the intermediate INIT state is performed. This is because the public key algorithm processing of the distribution key is executed asynchronously, thereby executing the public key algorithm processing. The purpose is to shorten the relatively long non-response time. If the non-response time is allowed, the intermediate INIT state can be omitted. (For the asynchronous publication algorithm processing, refer to Patent Application No. 2001-024480 by the same applicant.)
2. Reading Instruction Cache Next, the reading process of the instruction cache 903 will be described with reference to the processing flow of FIG.

タスクの実行が開始されてキャッシュに読み込まれたラインには、通常のメモリアドレスの一致を判定するタグに加えて、このタスクのタスクIDタグが付けられる。   The task ID tag of this task is attached to the line read into the cache after the execution of the task is started, in addition to the tag for determining the match of the normal memory address.

そして、読み込まれたキャッシュラインにアクセスがあると、命令キャッシュ903のアクセス検証部1205で、ラインに付されたタスクIDのタグと、アクセスのあったカレントタスクIDの一致、不一致が判断される。不一致の場合は、たとえメモリアドレスのタグが一致していてもキャッシュのミスヒットとして扱われ、このキャッシュラインの情報が再度外部メモリから読み込まれることになる。別のタスクによりこのラインに対応する外部メモリの内容が再読み込みされても、新たにアクセスしたタスクのタスクIDに対応する鍵で復号化されて読み込まれることになる。つまり、本来の鍵と異なる鍵で復号化された結果を実行することになり、正常な処理は行われない。 When the read cache line is accessed, the access verification unit 1205 of the instruction cache 903 determines whether the task ID tag attached to the line matches the current task ID accessed. In the case of mismatch, even if the memory address tags match, it is treated as a cache miss hit, and the information of this cache line is read from the external memory again. Even if the content of the external memory corresponding to this line is re-read by another task, it is decrypted and read with the key corresponding to the task ID of the newly accessed task. That is, the result decrypted with a key different from the original key is executed, and normal processing is not performed.

なお、以下の説明で、相対アドレスの計算は仮想アドレスに基づいて行なわれるが、キャッシュのヒット、ミスヒットの判定は、物理アドレスに対して行われる。キャッシュのヒット、ミスヒットの判定に仮想アドレスを使用すると、同一のメモリブロックがキャッシュ上に複数存在するエイリアスと呼ばれる現象が発生するからである。この現象は特に同一の物理アドレス領域を複数のタスクが共有する場合に問題となるので、本実施形態では、通常のキャッシュヒット、ミスヒットは物理アドレスによって判定している。   In the following description, the calculation of the relative address is performed based on the virtual address, but the determination of the cache hit or the miss hit is performed on the physical address. This is because, when a virtual address is used for determination of cache hit or miss hit, a phenomenon called alias in which a plurality of identical memory blocks exist on the cache occurs. This phenomenon becomes a problem particularly when a plurality of tasks share the same physical address area. In this embodiment, normal cache hits and miss hits are determined by physical addresses.

図13は、命令キャッシュ903の読み込み処理フローを示す。このフローでは、説明の簡略化のため、命令キャッシュ903と、FCM911、BIU906の動作を一体として示している。   FIG. 13 shows a read processing flow of the instruction cache 903. In this flow, for simplification of description, the operations of the instruction cache 903, the FCM 911, and the BIU 906 are shown as a unit.

まず、コア902から読み出し要求があると、命令キャッシュ903はBIU906に対して、ターゲットアドレスブロックの読み出し要求を送る。読み出し要求には、リクエストID、保護の有無、ターゲットアドレス範囲、要求元IDの情報が含まれている。   First, when there is a read request from the core 902, the instruction cache 903 sends a read request for the target address block to the BIU 906. The read request includes information on the request ID, the presence / absence of protection, the target address range, and the request source ID.

ここで、ターゲットアドレスと、読み込まれたキャッシュラインに付されているアドレスタグとの一致、不一致が判断される(S501)。物理アドレスが一致しない場合は(S501でNO)、ミスヒットとして、読み出し要求された新たなタスクIDに対応するオフセットアドレスの取得を開始する。オフセットアドレスは、オフセットテーブル1207の中の、カレントタスクIDに対応するエントリから取得する(S502)。   Here, it is determined whether the target address matches the address tag attached to the read cache line (S501). If the physical addresses do not match (NO in S501), acquisition of an offset address corresponding to the new task ID requested to be read is started as a miss. The offset address is acquired from the entry corresponding to the current task ID in the offset table 1207 (S502).

次に、取得したオフセット値から相対アドレスを計算する。相対アドレスは、メモリアドレスからオフセット値を引き算することによって求められる(S503)。なお、保護タスク実行中にキャッシュメモリへのアクセスがあると、命令キャッシュ903は、キャッシュメモリのアクセスと並行して、相対アドレスの計算を行なう。   Next, a relative address is calculated from the acquired offset value. The relative address is obtained by subtracting the offset value from the memory address (S503). If there is an access to the cache memory during execution of the protection task, the instruction cache 903 calculates a relative address in parallel with the access to the cache memory.

命令キャッシュ903は、求めた相対アドレス値とタスクIDとを、内部バス905を通じて鍵値テーブル(KVT)912へ送る。このとき、リクエストIDがつけられる。KVT912は、はタスク鍵テーブル1303からタスクIDに対応する鍵の値を取得し、鍵の値とオフセット値を、チャネル1316を通じて、高速暗号鍵処理モジュール(FCM)911の鍵生成モジュール1312へと送る。同時にKVT912は、オフセット値とリクエストID、要求元IDを、チャネル1317を通じて、FCM911の暗号処理モジュール1313へ送る。   The instruction cache 903 sends the obtained relative address value and task ID to the key value table (KVT) 912 through the internal bus 905. At this time, a request ID is attached. The KVT 912 acquires the key value corresponding to the task ID from the task key table 1303, and sends the key value and the offset value to the key generation module 1312 of the high-speed cryptographic key processing module (FCM) 911 through the channel 1316. . At the same time, the KVT 912 sends the offset value, the request ID, and the request source ID to the cryptographic processing module 1313 of the FCM 911 through the channel 1317.

FCM911の鍵生成モジュール1312は、KVT912から鍵の値とオフセット値を受け取ると、すぐにそのブロックに対応する鍵の計算を開始する。すなわち、プログラムの秘密定数Cxに相対アドレス値を加算した中間値を求め(S504)、求めた中間値をプログラムの秘密鍵Kxで暗号化して、プログラムのブロックに対応するブロック対応鍵を生成する(S505)。   When the key generation module 1312 of the FCM 911 receives the key value and the offset value from the KVT 912, the key generation module 1312 immediately starts calculating the key corresponding to the block. That is, an intermediate value obtained by adding the relative address value to the secret constant Cx of the program is obtained (S504), and the obtained intermediate value is encrypted with the secret key Kx of the program to generate a block corresponding key corresponding to the block of the program ( S505).

この鍵の計算は暗号化処理なので、複数サイクルの時間を要する。効率よく計算をするため、鍵生成モジュール1312には複数の鍵生成単位1312−1〜1312−3が設けられ、ディスパッチャ1311が、空きの鍵生成単位に処理要求を割り振る。1つのリクエストが複数の暗号ブロックで構成される場合は、すべての暗号ブロック対応の鍵を生成するまで相対アドレス値を増分してS502〜505を繰り返す。   Since this key calculation is an encryption process, it takes a plurality of cycles. In order to perform calculation efficiently, the key generation module 1312 is provided with a plurality of key generation units 1312-1 to 1312-3, and the dispatcher 1311 allocates processing requests to empty key generation units. When one request is composed of a plurality of cipher blocks, the relative address value is incremented and keys S502 to S505 are repeated until keys corresponding to all cipher blocks are generated.

一方、BIU906は外部メモリから読み出した結果を、暗号ブロックの大きさのデータになるまでバッファリングする。もともと保護されていない非暗号化データが要求されている場合は、データは直接要求元の命令キャッシュへ送られるが、本実施形態では、暗号化データに対する要求なので、読み出し結果はFCM911へ送られる。FCM911の暗号処理モジュール1313は、鍵生成モジュールによって生成されたブロック暗号鍵で、BIU906から供給されたデータを復号する(S506)。   On the other hand, the BIU 906 buffers the result read from the external memory until the data becomes the size of the encryption block. When unencrypted data that is not originally protected is requested, the data is directly sent to the instruction cache of the request source. However, in this embodiment, since the request is for encrypted data, the read result is sent to the FCM 911. The encryption processing module 1313 of the FCM 911 decrypts the data supplied from the BIU 906 with the block encryption key generated by the key generation module (S506).

復号には複数サイクルの時間がかかるので、前の復号処理が完了する前にキャッシュラインを構成する次の暗号ブロックが到着した場合は、別の暗号処理単位が割り当てられ、並列的に処理が行なわれる。図10には、暗号処理単位として1313−1〜1313−3だけが示されているが、十分な数の暗号処理単位を準備すれば、暗号処理単位の処理サイクルよりも短い間隔でデータが到着しても遅延を発生させることなく復号化処理が可能となる。   Since the decryption takes a plurality of cycles, if the next cipher block that constitutes the cache line arrives before the previous decryption process is completed, another cipher processing unit is allocated and the processes are performed in parallel. It is. FIG. 10 shows only 133-1 to 1313-3 as encryption processing units. However, if a sufficient number of encryption processing units are prepared, data arrives at an interval shorter than the processing cycle of the encryption processing unit. Even in this case, the decoding process can be performed without causing a delay.

復号を完了したブロックは、直ちに内部バス経由で要求元の命令キャッシュ903に送られる。命令キャッシュ903は、このキャッシュラインにデータを格納し、ラインを構成するすべてのデータがそろうと、キャッシュタグにライン有効の表示、暗号化ありの表示、実行中のタスクIDを書き込む(S507)。   The block that has been decoded is immediately sent to the instruction cache 903 as the request source via the internal bus. The instruction cache 903 stores data in this cache line, and when all the data constituting the line is ready, the instruction indicating that the line is valid, the display with encryption, and the task ID being executed are written in the cache tag (S507).

キャッシュラインが有効になると、コア902はこのラインからデータを読み出し、プログラムの実行を再開する(S508)。   When the cache line becomes valid, the core 902 reads data from this line and resumes execution of the program (S508).

次に、S501でターゲットアドレスとキャッシュラインのアドレスタグ(物理アドレス部分)が一致した場合、つまり、それまで実行されていたタスクAと異なるタスクIDを有するタスクBが、たまたま同一のメモリ領域をアクセスしてキャッシュラインがヒットした場合を考える。キャッシュの物理アドレスがヒットしたということは、タスクBは、従来の資源管理的な意味でこのアドレスのメモリのアクセス権があることになる。   Next, in S501, when the target address matches the address tag (physical address part) of the cache line, that is, the task B having a task ID different from the task A executed so far accidentally accesses the same memory area. Then, consider a case where a cache line hits. When the physical address of the cache is hit, task B has the right to access the memory at this address in a conventional resource management sense.

この場合は、命令キャッシュ903のアクセス検証部1205が、現在のタスクIDレジスタ1204の値と、このキャッシュラインにつけられているタスクIDタグとを、さらに比較する(S509)。比較結果が一致しない場合、たとえばカレントタスクIDレジスタ1204には“B”と書かれているが、キャッシュラインタグのタスクID欄には“A”と書かれ、その暗号特性は暗号化ラインであることを示している場合には(S509でNO)、キャッシュがフラッシュされ、タスクBにタスクIDに対してS502〜S507を繰り返す。すなわち、タスクBのオフセットアドレスから相対アドレスが計算され、キャッシュラインアドレスに対応する外部メモリのデータをタスクBのプログラム鍵で復号した結果が、このキャッシュラインに読み込まれる。   In this case, the access verification unit 1205 of the instruction cache 903 further compares the current value of the task ID register 1204 with the task ID tag attached to this cache line (S509). If the comparison results do not match, for example, “B” is written in the current task ID register 1204, but “A” is written in the task ID column of the cache line tag, and the encryption characteristic is an encryption line. If this is the case (NO in S509), the cache is flushed, and S502 to S507 are repeated for task ID in task B. That is, the relative address is calculated from the offset address of task B, and the result of decrypting the external memory data corresponding to the cache line address with the program key of task B is read into this cache line.

タスクAとタスクBのプログラム鍵が一致していれば、別々に読み込まれたとしても2つのタスクは同一のプログラムを実行するだけであるが、外部メモリのデータを暗号化した本来の鍵がタスクAのプログラム鍵であり、タスクBの鍵がそれとは違うものである場合、タスクBは本来のプログラムとは異なるでたらめなプログラムを実行することになり、意図する攻撃ができない。   If the program keys of Task A and Task B match, the two tasks will only execute the same program even if they are read separately, but the original key that encrypted the data in the external memory is the task. If it is the program key of A and the key of task B is different from that, task B will execute a random program different from the original program, and the intended attack cannot be performed.

一方、カレントタスクレジスタの値とキャッシュラインのタスクIDタグが一致すれば(S509でYES)、要求されたアドレスの内容が、コア902に送られる(S508)。   On the other hand, if the value of the current task register matches the task ID tag of the cache line (YES in S509), the contents of the requested address are sent to the core 902 (S508).

このように、あるタスクの実行中に、別のタスクによって同じキャッシュラインが再度読み込まれた場合、外部メモリの内容は、本来の鍵とは異なる鍵で復号化されてキャッシュラインに読み込まれる。本来の鍵と異なる鍵で復号化した結果を実行したプログラムはもちろん正常な動作をしない。   Thus, when the same cache line is read again by another task during execution of a certain task, the contents of the external memory are decrypted with a key different from the original key and read into the cache line. Of course, the program that executed the decryption result with a key different from the original key does not operate normally.

この制御はOSの特権をもっても覆すことはできない。OSが自由にタスク鍵テーブル1303を操作できとしたならば、他のプログラムの秘密を取得することができるが、本発明では、OSがプログラム鍵の登録に代表されるタスクの状態管理と秘密情報の操作を実行できるのは、図5に示すような一連のタスク制御命令の発行に制限されている。したがって、本発明のマイクロプロセッサでは、たとえOSの資源特権をもっても、アプリケーションのプログラムまたはデータの各ブロックに対応する鍵を知らない限り、それを正しく実行したり読み出したりすることはできない。   This control cannot be reversed even with OS privileges. If the OS can freely operate the task key table 1303, secrets of other programs can be acquired. However, in the present invention, task status management and secret information represented by registration of program keys by the OS is possible. The operations described above can be executed only by issuing a series of task control instructions as shown in FIG. Therefore, even if the microprocessor of the present invention has the resource privilege of the OS, it cannot execute or read it correctly unless the key corresponding to each block of the application program or data is known.

この機構により、アプリケーションプログラムの独立性を保証するマルチパーティのプログラム保護環境が提供できるのである。   This mechanism provides a multi-party program protection environment that guarantees the independence of application programs.

なお、S506と関連して複数の暗号処理単位1313により迅速な復号処理が可能であると述べたが、1個の暗号処理単位に十分なスループットがあれば、複数の暗号処理単位を備えることは不要である。例えば、DESのように同一種類の演算の繰り返しにより構成される暗号処理では、処理をパイプライン化することにより高いスループットが得られることが知られている。   Although it has been described that rapid decryption processing can be performed by a plurality of cryptographic processing units 1313 in relation to S506, if one cryptographic processing unit has sufficient throughput, it is possible to provide a plurality of cryptographic processing units. It is unnecessary. For example, it is known that a high throughput can be obtained by pipelining a process in an encryption process configured by repeating the same type of operation as in DES.

しかし、このようなパイプライン実装は、ハードウェア規模においても、設計の困難さにおいても大きなコストが必要である。また、一般に利用可能なIPの形で提供される暗号処理単位は、設計に高度のノウハウと時間を必要とするので、必要な処理能力に見あった番号処理単位をその都度設計することを大きな負担となる。多様な条件への対応を考えた時、本実施形態のように既存の暗号処理単位を複数並列動作させることが、設計の柔軟性の点で有利である。また、ハードウェア設計コストを含めた全体のコスト削減の効果がある。   However, such pipeline implementation requires a large cost in terms of hardware scale and design difficulty. In addition, cryptographic processing units provided in the form of generally available IP require a high level of know-how and time for design, so it is important to design a number processing unit that meets the required processing capacity each time. It becomes a burden. When considering the correspondence to various conditions, it is advantageous in terms of design flexibility to operate a plurality of existing cryptographic processing units in parallel as in this embodiment. In addition, there is an effect of overall cost reduction including hardware design cost.

3.データキャッシュでの実行処理
次に、データキャッシュの動作について説明する。初期化データ、作業領域(スタック)などのデータの保護については、タスクが動的に確保したデータ領域を、任意の暗号鍵によって暗号化保護することができる。初期化データ、作業領域、動的領域など、複数の保護領域を定義し、各々異なる鍵を設定することが可能である。たとえば初期化データの場合、外部メモリにはすでに暗号化済みのデータがおかれており、これを読み出し、復号する際の手順は基本的にはプログラムの場合と同じである。
3. Data Cache Execution Processing Next, the data cache operation will be described. Regarding protection of data such as initialization data and work area (stack), a data area dynamically secured by a task can be encrypted and protected with an arbitrary encryption key. It is possible to define a plurality of protection areas such as initialization data, work area, and dynamic area, and set different keys for each. For example, in the case of initialization data, already encrypted data is stored in the external memory, and the procedure for reading and decrypting the data is basically the same as that for the program.

前述したプログラム(実行コード)の場合は、暗号属性は、命令キャッシュ903でカレントタスクIDとキャッシュタグのタスクIDを比較することによって判断されていたが、データの場合は、属性の判断がカレントタスクIDとMTRR(アドレス範囲レジスタ)との比較で行なわれるところが異なる。   In the case of the program (execution code) described above, the encryption attribute is determined by comparing the current task ID and the task ID of the cache tag in the instruction cache 903. However, in the case of data, the attribute determination is the current task. The difference is made in comparison between ID and MTRR (address range register).

データアクセスがあった場合、図11に示すデータキャッシュ904のMTRRテーブル管理比較部1402でアクセス属性が判定される。具体的には、MTRRテーブル管理比較部1402にカレントタスクIDとターゲットアドレスが入力されると、タスクIDに対応するMTRRテーブル1403のエントリ(0〜3)のアドレス範囲とターゲットアドレスがそれぞれ比較される。   When there is data access, the access attribute is determined by the MTRR table management comparison unit 1402 of the data cache 904 shown in FIG. Specifically, when the current task ID and the target address are input to the MTRR table management comparison unit 1402, the address range of the entry (0-3) of the MTRR table 1403 corresponding to the task ID is compared with the target address. .

MTRRエントリに合致するものがひとつだけであれば、その属性が無条件に採用され、タスクIDとMTRRエントリIDの組が当該メモリアクセスの暗号属性となる。   If there is only one that matches the MTRR entry, that attribute is adopted unconditionally, and the set of task ID and MTRR entry ID becomes the encryption attribute of the memory access.

MTRRエントリが重複したアドレス範囲を持ち、ターゲットアドレスが複数のエントリのアドレス範囲に合致した場合、あらかじめMTRRごとに定められた優先順位にしたがってただひとつのMTRRが選ばれ、このメモリアクセスの暗号属性となる。   When MTRR entries have overlapping address ranges and the target address matches the address ranges of a plurality of entries, only one MTRR is selected according to the priority order determined in advance for each MTRR. Become.

こうしてMTRRテーブル管理比較部1402で決定されたメモリアクセス属性は、データ読み込みの場合、暗号属性送出部1411の読み込みデータキーIDレジスタ1412に一時的に保持される。また、MTRRテーブル管理比較部1402では、ヒットしたMTRRエントリの先頭アドレスとメモリアクセスのターゲットアドレスから相対アドレス値が計算される。   Thus, the memory access attribute determined by the MTRR table management comparison unit 1402 is temporarily held in the read data key ID register 1412 of the encryption attribute transmission unit 1411 in the case of data reading. Also, the MTRR table management comparison unit 1402 calculates a relative address value from the head address of the hit MTRR entry and the target address of the memory access.

これらのメモリアクセス属性と相対アドレス値は、プログラムメモリのアクセスの場合と同様に、内部バス905を通じて鍵値テーブル(KVT)912に送られる。   These memory access attributes and relative address values are sent to the key value table (KVT) 912 through the internal bus 905, as in the case of program memory access.

データキャッシュがBIU906にデータ読み出しを要求し、メモリアクセス属性がKVT912に送られ、データがFCM911に送られて復号化され、データキャッシュに返されるシーケンスは、命令キャッシュの場合と同一である。   The sequence in which the data cache requests the BIU 906 to read data, the memory access attribute is sent to the KVT 912, the data is sent to the FCM 911, decoded, and returned to the data cache is the same as in the case of the instruction cache.

最後にキャッシュタグにメモリアクセス属性と相対アドレス値が書き込まれてキャッシュの読み込みは完了する。   Finally, the memory access attribute and the relative address value are written in the cache tag, and the cache reading is completed.

次に、アドレス変換機構を持つ場合のデータキャッシュの非同期書き込みに関する問題と、本実施形態で提供する機構について説明する。   Next, a problem related to asynchronous writing of the data cache when the address translation mechanism is provided and a mechanism provided in the present embodiment will be described.

図14に、本実施形態のデータキャッシュのデータ構造を示す。データキャッシュメモリ1431は、256本のライン1501―0〜1501−255で構成されている。   FIG. 14 shows the data structure of the data cache of this embodiment. The data cache memory 1431 is composed of 256 lines 1501-0 to 1501-255.

各ライン(たとえばライン0)は、外部メモリの内容を格納するラインバッファ1501−0−0と、物理アドレスタグ1501−0−1と、相対アドレス値1501−0−2と、タスク識別子1501−0−3と、MTRR識別子1501−0−4と、フラッグ領域1501−0−5を有する。 Each line (for example, line 0) includes a line buffer 1501-0-0 for storing the contents of the external memory, a physical address tag 1501-0-1, a relative address value 1501-0-2, and a task identifier 1501-0. -3, an MTRR identifier 1501-0-4, and a flag region 1501-0-5.

データキャッシュ904が命令キャッシュ903と異なる点は、データの書き戻し、すなわち割り込み時などに、外部メモリに一時的に退避される場合があることである。   The data cache 904 is different from the instruction cache 903 in that the data cache 904 may be temporarily saved in the external memory when data is written back, that is, at the time of interruption.

あるタスクAに読み込まれたキャッシュラインは、必ずしもタスクAの実行中にフラッシュされて外部メモリに書き戻されるとは限らない。別のタスクBの実行中にフラッシュされる可能性もある。アドレス変換機構を持つプロセッサの場合、タスク毎に異なるメモリマップを持つことできるため、キャッシュラインの保存先物理アドレスは、仮想アドレスから一意に決定することはできない。   A cache line read into a certain task A is not necessarily flushed and written back to the external memory during the execution of task A. It may be flushed during the execution of another task B. Since a processor having an address translation mechanism can have a different memory map for each task, a cache line storage destination physical address cannot be uniquely determined from a virtual address.

従来、この問題は、キャッシュタグに物理アドレスタグ1501−0−1をもうけて、保存先の物理アドレス情報を付与すれば、現在実行中のタスクが何であるかに関わらずキャッシュラインの保存先を決定できる。   Conventionally, the problem is that if the physical address tag 1501-0-1 is provided in the cache tag and the physical address information of the storage destination is given, the storage destination of the cache line is determined regardless of what task is currently being executed. Can be determined.

ところが、これに本発明のブロック対応鍵を利用した暗号化を適用しようとすると、問題が生じる。ブロック対応鍵は、上述したように、キャッシュラインの仮想アドレスと、オフセット値の差である相対アドレス値から生成されている。一般にはこの相対アドレス値は物理アドレスから生成することはできないので、キャッシュの書き戻しにあたってのデータ暗号化ができない。   However, if the encryption using the block corresponding key of the present invention is applied to this, a problem arises. As described above, the block correspondence key is generated from the virtual address of the cache line and the relative address value that is the difference between the offset values. In general, since this relative address value cannot be generated from a physical address, data encryption at the time of cache write-back cannot be performed.

本実施形態では、データキャッシュメモリ1431のキャッシュタグに、相対アドレス値を格納するタグ1501−0−2をもうけて、このキャッシュラインの確保時に付与された相対アドレス値を保存することで、書き戻し時の暗号化の問題を解決している。   In the present embodiment, the cache tag of the data cache memory 1431 is provided with a tag 1501-0-2 for storing the relative address value, and the relative address value given at the time of securing the cache line is saved, thereby rewriting the data. The problem of encryption at the time is solved.

タグの書き込みは、このキャッシュラインの暗号属性決定時に行う。 The tag is written when the cache line encryption attribute is determined.

別の方法として、キャッシュタグに仮想アドレスを保持しても同様の機能が実現される。キャッシュの非同期書き戻しを実行するときに、メモリ領域情報はMTRRテーブル1403に保持されているので、仮想アドレスとタスク識別子からMTRRのオフセット情報を取得して相対アドレス値を計算すればよい。   As another method, the same function can be realized even if a virtual address is held in the cache tag. When executing the asynchronous write-back of the cache, the memory area information is held in the MTRR table 1403. Therefore, the relative address value may be calculated by obtaining the offset information of the MTRR from the virtual address and the task identifier.

データキャッシュ904では、配布鍵で決められた初期化データと作業領域の他に、2箇所のデータ領域を追加することができる。これらの領域は、MTRR(アドレス範囲レジスタ)のID2、3で指定される。   In the data cache 904, two data areas can be added in addition to the initialization data determined by the distribution key and the work area. These areas are designated by IDs 2 and 3 of MTRR (address range register).

データ領域の追加は、setkeyと呼ぶ特別な命令をタスクが発行することで行なわれる。プロセッサの所定のレジスタにデータの暗号鍵、補助定数とメモリ領域およびMTRR IDを格納してsetkey命令を発行する。Setkey命令は自タスクIDのデータ暗号化属性のみに有効なので、命令で明示的にタスクIDを指定する必要はない。   The data area is added by the task issuing a special command called setkey. The data encryption key, auxiliary constant, memory area, and MTRR ID are stored in a predetermined register of the processor, and a setkey instruction is issued. Since the Setkey command is valid only for the data encryption attribute of the own task ID, it is not necessary to explicitly specify the task ID with the command.

Setkey命令は、プロセッサコア902の内部で、データキャッシュ904のMTRRテーブル1403へのアクセスと、鍵値テーブル912のデータ鍵テーブル1305へのアクセスという、2つのステップに分解されて実行される。   The Setkey instruction is executed in the processor core 902 after being decomposed into two steps: access to the MTRR table 1403 of the data cache 904 and access to the data key table 1305 of the key value table 912.

タスクの初期状態において、MTRR(アドレス範囲レジスタ)の2、3は無効化された状態、すなわちアドレス範囲の大きさが0である状態にある。この状態ではいかなるメモリアクセスもアドレス範囲に該当しない。   In the initial state of the task, MTRR (address range register) 2 and 3 are invalidated, that is, the size of the address range is zero. In this state, any memory access does not fall within the address range.

Setkey命令が発行されると、最初にタスクIDとMTRRのIDに一致するデータキャッシュラインがフラッシュされる。   When the Setkey instruction is issued, the data cache line that matches the task ID and the MTRR ID is first flushed.

次に、鍵値テーブル912のデータ鍵テーブル1305のタスクIDとMTRRのIDでインデックスされた欄に、暗号鍵が書き込まれる。   Next, the encryption key is written in the column indexed by the task ID and MTRR ID of the data key table 1305 of the key value table 912.

次に、データキャッシュ904のMTRRテーブル1403の指定タスクIDとMTRR IDでインデックスされた欄に、アドレス範囲が書き込まれる。 Next, the address range is written in the column indexed by the designated task ID and MTRR ID of the MTRR table 1403 of the data cache 904.

MTRRのアドレス範囲の長さが0を越えるとその暗号化指定が有効になる。以下、追加データの読み書きについては初期化データの場合と同様である。   When the length of the MTRR address range exceeds 0, the encryption designation becomes valid. Hereinafter, the reading / writing of the additional data is the same as that of the initialization data.

設定したMTRRを変更、すなわちデータ領域の属性を変更するには、再度setkey命令を発行する。上述のように、setkey命令を発行するとMTRRのIDに対応するキャッシュ上のラインはすべてフラッシュされ、外部メモリへと書き出される。その後、データ鍵テーブル1305,MTRRテーブル1403に新しい設定が書き込まれ、新しい設定での読み書きが始まる。   In order to change the set MTRR, that is, to change the attribute of the data area, the setkey command is issued again. As described above, when the setkey instruction is issued, all the lines on the cache corresponding to the ID of the MTRR are flushed and written to the external memory. Thereafter, a new setting is written in the data key table 1305 and the MTRR table 1403, and reading / writing with the new setting is started.

いったん外部メモリに書き戻されて保存された暗号データは、先に使用した暗号鍵Kx、補助定数Cx、オフセットアドレスが一致して初めて正しく読み出せる。たとえ暗号鍵、補助定数が一致していてもオフセットアドレスが一致しなければ正しい値を復号化することはできない。このことはタスク間で共有される共有メモリやディスクデータの読み書きにおいて重要である。この理由でsetkey命令が実行されると、対応するキャッシュラインは無条件にフラッシュされる。   The encrypted data once written back to the external memory and stored can be read correctly only after the previously used encryption key Kx, auxiliary constant Cx, and offset address match. Even if the encryption key and auxiliary constant match, the correct value cannot be decrypted unless the offset address matches. This is important in reading and writing shared memory and disk data shared between tasks. For this reason, when a setkey instruction is executed, the corresponding cache line is unconditionally flushed.

逆に、あるデータ領域が外部メモリ上で別の絶対メモリアドレスに領域にコピーされたとしても、MTRRの領域指定先頭アドレスが移動先アドレスに対応して設定されれば、暗号鍵、補助定数が一致する条件の下で、元のデータを正しく読み出すことができる。   On the contrary, even if a certain data area is copied to another absolute memory address on the external memory, if the MTRR area designation head address is set corresponding to the destination address, the encryption key and auxiliary constant are The original data can be read correctly under matching conditions.

このように、本実施形態ではデータの暗号化においても、ブロック交換攻撃防止のためのブロックごとの個別暗号鍵方式と、メモリの再配置(リロケーション)とを、矛盾なく両立させることができる。   As described above, according to the present embodiment, even in data encryption, the individual encryption key method for each block for preventing block exchange attacks and the memory relocation can be reconciled without contradiction.

<タスクの一時中断>
マルチタスクOSでは、タスクの実行はしばしば割り込みにより中断される。
<Suspend task>
In a multitasking OS, task execution is often interrupted by an interrupt.

割り込み後はOSの割り込みハンドラが実行され、必要に応じて、別のタスクに実行が切替えられる場合と、タスクの切り替えなしに元のタスクに復帰する場合がある。 After the interrupt, the OS interrupt handler is executed, and if necessary, execution may be switched to another task, or the task may be returned to the original task without switching the task.

本実施形態のプロセッサでは、割り込みコントローラから割り込み要求があると、保護タスクの実行は中断され、割り込みベクタで指定されるアドレスの割り込みハンドラの実行が開始される。すなわち、それまでの保護タスクのレジスタ値(コンテキスト情報)が、割り込みハンドラによりコア902のレジスタバッファ(アレイ)915に退避され、OSを含む他のタスクからの読み出しから保護される。この割り込みにより、図6の状態遷移に示されるように、タスク状態テーブル921の値がRUNからSTOPPEDに移行する。   In the processor of this embodiment, when an interrupt request is issued from the interrupt controller, the execution of the protection task is interrupted and the execution of the interrupt handler at the address specified by the interrupt vector is started. In other words, the register value (context information) of the protection task so far is saved in the register buffer (array) 915 of the core 902 by the interrupt handler, and is protected from reading from other tasks including the OS. By this interruption, as shown in the state transition of FIG. 6, the value of the task state table 921 shifts from RUN to STOPPED.

STOPPED状態では、中断されたタスクのコンテキストは、コア902のレジスタバッファ915を占有しているが、この状態でSUSPEND命令(タスク実行状態保存命令)が発せられると、レジスタバッファの内容は、SUSPEND命令で指定されたメモリ領域に保存され、タスク状態はSUSPENDへ移行する。   In the STOPPED state, the interrupted task context occupies the register buffer 915 of the core 902. When a SUSPEND instruction (task execution state storage instruction) is issued in this state, the contents of the register buffer are changed to the SUSPEND instruction. The task state is transferred to SUSPEND.

割り込みハンドラは、レジスタバッファの内容を読み出すことはできないが、それを一括してメモリに保存することはできるのである。 The interrupt handler cannot read the contents of the register buffer, but can save it in memory in a batch.

割り込み処理時間が長い場合や、タスク切り替えがある場合は、レジスタバッファの内容は、キャッシュメモリに保存される。また、保存されたコンテキスト情報が、さらに外部メモリへ書き出される場合もある。この場合、コンテキスト情報が所定のコンテキスト鍵で暗号化されてから、外部メモリに書き出される。   When the interrupt processing time is long or when there is task switching, the contents of the register buffer are saved in the cache memory. In addition, the stored context information may be further written to the external memory. In this case, the context information is encrypted with a predetermined context key and then written to the external memory.

SUSPEND(保存)状態のタスクを再開するには、図5および6に示すように、タスクIDとコンテキスト情報の保存先アドレスを指定して、resume命令を発行する。   To resume a task in the SUSPEND (save) state, as shown in FIGS. 5 and 6, a task ID and a save destination address of context information are designated and a resume instruction is issued.

STOPPED状態(レジスタ値が保存されず、単に退避されている状態)からタスクを再開するには、continue命令を発行する。たとえば、割り込み処理が簡単に終りタスクの切り替えが起きない場合や、ソフトウェアタイマーのカウンタインクリメント処理では、それまで実行されていたレジスタ値を保存せずに、レジスタバッファアレイ915に退避させるにとどまる。この場合は、レジスタバッファからレジスタ値が復帰され、割り込み前のタスク実行が再開される。タスクの状態は、STOPPEDからRUNに戻される。   To resume the task from the STOPPED state (the state in which the register value is not saved and is simply saved), the continue instruction is issued. For example, when interrupt processing is simply completed and task switching does not occur, or in software timer counter increment processing, the register values that have been executed are not saved, but are simply saved in the register buffer array 915. In this case, the register value is restored from the register buffer, and the task execution before the interruption is resumed. The task state is returned from STOPPED to RUN.

図15は、suspend(タスク状態保存)命令が出されたときの処理フローである。   FIG. 15 is a processing flow when a suspend (save task state) command is issued.

まず、suspend命令の発行を受けて、タスク状態テーブル921を参照して、指定されたタスク状態がSTOPPEDであるか判断される(S601)。STOPPEDでない場合は(S601でNO)、それまのレジスタ値がコア902のレジスタバッファ(アレイ)915に退避されていないことになるので、この状態でsuspend命令が出されても無効にされ、タスク状態はINVALIDにされる(S605)。   First, in response to the issuance of the suspend instruction, it is determined whether or not the designated task state is STOPPED with reference to the task state table 921 (S601). If it is not STOPPED (NO in S601), the previous register value is not saved in the register buffer (array) 915 of the core 902. Therefore, even if the suspend instruction is issued in this state, it is invalidated, and the task The state is set to INVALID (S605).

指定されたタスク状態がSTOPPEDの場合は(S601でYES)、レジスタバッファアレイ915にある内容が、suspend命令で指定されたアドレスのメモリ領域に書き込まれ、保存が開始される(S692)。   If the designated task state is STOPPED (YES in S601), the contents in the register buffer array 915 are written into the memory area at the address designated by the suspend instruction, and saving is started (S692).

保存はキャッシュへの保存が基本であり、保存開始前にタスクチャネル916を通じてそれまで実行していたタスクのIDが、データキャッシュの保存予定コンテキスト識別子レジスタ1434に保持される。そして、データキャッシュメモリ1431上でコンテキスト情報を書き込むためのキャッシュラインが確保され、データの転送が開始される。ラインの書き込み完了ごとに、キャッシュラインのタグにコンテキストを表す識別子とタスクIDが書き込まれる。   The saving is basically saving to the cache, and the ID of the task executed so far through the task channel 916 before the saving is started is held in the saving-scheduled context identifier register 1434 of the data cache. Then, a cache line for writing context information is secured on the data cache memory 1431, and data transfer is started. Each time line writing is completed, an identifier representing a context and a task ID are written to the tag of the cache line.

コンテキスト情報の保存は元のメモリの内容を完全に上書きするものである。コンテキスト情報はキャッシュラインサイズの整数倍で、その先頭アドレスがかならずキャッシュラインサイズでアラインされており、通常必要とされる書き込み前に保存先内容を読み出す動作(ライトアロケート)は不要となる。   Saving the context information completely overwrites the contents of the original memory. The context information is an integral multiple of the cache line size, and the head address is always aligned with the cache line size, and the operation (write allocation) for reading the contents of the storage destination before writing, which is normally required, becomes unnecessary.

そして、コア902のハッシュ計算部922で、レジスタバッファの内容全体のハッシュが計算され、タスクIDとともに、メモリ上のレジスタ情報の最後にハッシュ値が付加される(S603)。多数ラインにわたる場合は、コア902のタスクスイッチャ(STS)914は、レジスタバッファアレイ915の情報を順次キャッシュラインに書き込みながらハッシュを計算する。   The hash calculation unit 922 of the core 902 calculates the hash of the entire contents of the register buffer, and adds the hash value to the end of the register information on the memory together with the task ID (S603). When a large number of lines are used, the task switcher (STS) 914 of the core 902 calculates a hash while sequentially writing the information of the register buffer array 915 to the cache line.

コンテキスト領域の最後にタスクIDとハッシュ値を書き込み、タグの付加が終わるとsuspend命令の実行は完了となり、タスクの状態はSUSPENDに移行する(S604)。   When the task ID and hash value are written at the end of the context area and tag addition is completed, execution of the suspend instruction is completed, and the task state shifts to SUSPEND (S604).

保存されたコンテキスト情報は、データと同様に、タスクの実行とは非同期的に外部メモリ108へと書き出される。外部メモリへの書き出し時のコンテキスト情報の取り扱いで、他の情報と異なる点が2点ある。ひとつは相対アドレス値の扱いであり、もうひとつは読み込み処理の違いである。   The stored context information is written out to the external memory 108 asynchronously with the execution of the task, like the data. There are two differences from other information in handling context information when writing to external memory. One is the handling of relative address values, and the other is the difference in reading processing.

コンテキスト情報は複数のブロックで構成されるが、相対アドレス値として同一の値が使われる。相対アドレス値には、あらかじめ定められた定数が用いられる。コンテキスト情報にはハッシュが付加されているため、ブロックの交換に元々耐性があるためである。コンテキスト情報が保存されたキャッシュラインがフラッシュされる時、取り出された暗号属性は書き出しコンテキストキーID1415に一時的に保持される。その後の処理は、データキャッシュの書き出しと同様である。   The context information is composed of a plurality of blocks, but the same value is used as the relative address value. A predetermined constant is used as the relative address value. This is because the hash is added to the context information, so that the exchange of blocks is inherently resistant. When the cache line in which the context information is stored is flushed, the extracted encryption attribute is temporarily held in the write context key ID 1415. The subsequent processing is the same as the data cache writing.

図16は、保存されたコンテキスト情報からタスクを再開する処理フローである。   FIG. 16 is a processing flow for resuming a task from saved context information.

まず、保存されたコンテキスト情報を読み込んでタスクの実行を再開するために、タスクIDと保存先メモリアドレスをパラメータとしたresume命令が発行されると、指定されたタスク状態がSUSPENDであるかどうか判断される(S701)。SUSPEND状態にない場合は(S701でNO)、コンテキスト情報が保存されていないので、タスク状態はINVALIDにされる(S707)。換言すれば、resume命令はタスク状態がSUSPENDED以外の場合は、無効である。   First, in order to read the saved context information and resume execution of the task, when a resume instruction is issued with the task ID and the destination memory address as parameters, it is determined whether or not the specified task state is SUSPEND. (S701). When not in the SUSPEND state (NO in S701), since the context information is not saved, the task state is set to INVALID (S707). In other words, the resume instruction is invalid when the task state is other than SUSPENDED.

SUSPEND状態にある場合は(S701でYES)、アドレスとタスクIDが、それぞれアドレスラインとタスクチャンネルを通して、データキャッシュ904に送られる。キャッシュのアドレスがヒットして、かつタグがコンテキストを示しており、タスクIDが一致する場合、キャッシュメモリ1431上のデータが、レジスタバッファに転送され、タスクの再開処理が開始される(S702)。   When in the SUSPEND state (YES in S701), the address and task ID are sent to the data cache 904 through the address line and task channel, respectively. When the cache address hits and the tag indicates the context and the task IDs match, the data on the cache memory 1431 is transferred to the register buffer, and task resumption processing is started (S702).

レジスタバッファへのデータ転送と並行してハッシュ計算が行なわれる(S703)。計算したハッシュが期待値と一致するかどうか判断され(S704)、不一致の場合、再開処理は中止され、タスクはINVALID状態となる(S707)。   A hash calculation is performed in parallel with the data transfer to the register buffer (S703). It is determined whether or not the calculated hash matches the expected value (S704). If they do not match, the restart process is stopped and the task enters the INVALID state (S707).

ハッシュが一致した場合は(S704でYES)、カレントタスクレジスタに指定されたタスクのIDを設定し(S705)、タスクの状態をRUNに変更して実行が再開される(S706)。   If the hashes match (YES in S704), the task ID specified in the current task register is set (S705), the task state is changed to RUN, and execution is resumed (S706).

図16のフローには記載されていないが、resume命令で指定されたコンテキスト情報の領域がキャッシュにヒットしない場合は、保存されたデータが外部メモリに書き出されている場合である。この場合は、外部メモリからのデータ読み込みが開始される。すなわち、タスクIDレジスタ1401に保持されたタスクIDと、resume命令で指定されたアドレスに対応するメモリの読み出し要求がデータキャッシュ904からBIU906に送られる。そして、タスクIDとコンテキストを意味する暗号属性が鍵値テーブル912へ送られ、FCM911で復号のための鍵が生成される。ある時点で保存されたタスクのコンテキスト情報は、すべて同じ鍵で暗号化されているので、ブロック単位の鍵生成は行なわない。   Although not described in the flow of FIG. 16, the case where the context information area specified by the resume instruction does not hit the cache is the case where the stored data is written to the external memory. In this case, data reading from the external memory is started. That is, the task ID held in the task ID register 1401 and a memory read request corresponding to the address specified by the resume instruction are sent from the data cache 904 to the BIU 906. Then, the task ID and the encryption attribute indicating the context are sent to the key value table 912, and the key for decryption is generated by the FCM 911. Since all the context information of the task saved at a certain point is encrypted with the same key, key generation in units of blocks is not performed.

復号が完了したブロックは、順次データキャッシュ904へと送られ、タスクスイッチャ(STS)914はレジスタバッファアレイ915にその内容を読み込む。以後の処理はキャッシュがヒットした場合と同じである。   The blocks for which decoding has been completed are sequentially sent to the data cache 904, and the task switcher (STS) 914 reads the contents into the register buffer array 915. The subsequent processing is the same as when the cache hits.

<タスクの終了>
タスクを終了して、割り当てたタスクIDとプロセッサ内の各種テーブルを別の新しいタスクのために再利用するには、タスクIDを指定してdelete命令を発行する。本実施形態では、それまでのタスクの内容が不正に覗き見されないように、システム動作中は、一度登録したタスクのタスクIDは、その登録を削除しない限り、新しいタスクのために使用することはできない。
<End task>
To terminate the task and reuse the assigned task ID and various tables in the processor for another new task, issue a delete instruction with the task ID specified. In the present embodiment, the task ID of a task that has been registered once is not used for a new task unless the registration is deleted while the system is operating so that the contents of the previous task are not illegally peeped. Can not.

図17は、タスク削除の処理フローを示す。   FIG. 17 shows a task deletion processing flow.

まず、タスクに対してdelete命令が発行されると、指定されたタスクがINIT、STOPPED、SUSPENDのいずれかの状態にあるかが判断される(S801)。上記のいずれの状態にもない場合(すなわちRUN,NULLである場合)には、タスクはINVALIDにされ(S805)、エラーとなる。   First, when a delete instruction is issued for a task, it is determined whether the designated task is in an INIT, STOPPED, or SUSPEND state (S801). If it is not in any of the above states (that is, if it is RUN, NULL), the task is set to INVALID (S805) and an error occurs.

上記のいずれかの状態にある場合は(S801でYES)、指定されたタスクIDに対応するタグが付与されたキャッシュラインがフラッシュされ(S802)。   When in any of the above states (YES in S801), the cache line to which the tag corresponding to the designated task ID is assigned is flushed (S802).

これにより、対応する鍵テーブル1303〜1305、命令キャッシュのオフセットテーブル1207、データキャッシュのMTRRテーブル1403もクリアされる(S803)。   Accordingly, the corresponding key tables 1303 to 1305, the instruction cache offset table 1207, and the data cache MTRR table 1403 are also cleared (S803).

これらの動作が完了すると、タスク状態がNULLにされる(S804)。   When these operations are completed, the task state is set to NULL (S804).

Delete命令を発行するのはタスク自身ではなくOSであり、delete命令を発行できるのはRUNとNULL以外の状態にあるタスクに対してである。   The Delete instruction is issued not by the task itself but by the OS, and the delete instruction can be issued only for a task in a state other than RUN and NULL.

タスクが削除されてタスクIDがNULL状態となれば、再びregister命令により配布鍵を登録して、新しいタスクを実行することができる。   If the task is deleted and the task ID becomes NULL, a new key can be executed by registering the distribution key again with the register instruction.

本発明の実施形態に係るマルチパーティのアプリケーション保護環境を示す図である。1 is a diagram illustrating a multi-party application protection environment according to an embodiment of the present invention. FIG. 図1のターゲットシステムに内蔵されたマイクロプロセッサの概略構成図である。It is a schematic block diagram of the microprocessor incorporated in the target system of FIG. 図1のマルチパーティ保護環境を実現するためのブロック対応暗号鍵生成手順を示す図である。It is a figure which shows the block corresponding | compatible encryption key production | generation procedure for implement | achieving the multi party protection environment of FIG. 本発明の実施形態で用いられる情報配置記述子と配布鍵の構成と、これらの情報が配置される仮想アドレス空間のメモリマップを示す図である。It is a figure which shows the memory map of the structure of the information arrangement | positioning descriptor used by embodiment of this invention, a distribution key, and the virtual address space where these information are arrange | positioned. タスク制御命令の例を示す図である。It is a figure which shows the example of a task control command. タスク状態遷移の例を示す図である。It is a figure which shows the example of a task state transition. マイクロプロセッサ上でのタスク登録の動作を示す図である。It is a figure which shows the operation | movement of the task registration on a microprocessor. タスク登録の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of task registration. 図2に示すマイクロプロセッサ内の命令キャッシュの概略構成図である。It is a schematic block diagram of the instruction cache in the microprocessor shown in FIG. 図2に示すマイクロプロセッサ内の鍵値テーブルと高速暗号鍵処理モジュールの概略構成図である。It is a schematic block diagram of the key value table and high-speed encryption key processing module in the microprocessor shown in FIG. 図2に示すマイクロプロセッサ内のデータキャッシュの概略構成図である。It is a schematic block diagram of the data cache in the microprocessor shown in FIG. タスク実行開始の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of a task execution start. 命令キャッシュの読み込み(フェッチ)手順を示すフローチャートである。It is a flowchart which shows the read (fetch) procedure of an instruction cache. データキャッシュ内部のデータ構造を示す図である。It is a figure which shows the data structure inside a data cache. タスク状態保存(SUSPEND)の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of task state preservation | save (SUSPEND). 中断されたタスク再開の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of the suspended task restart. タスクの終了(削除)の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of completion | finish (deletion) of a task. 従来のマルチパーティアプリケーション保護環境の図である。1 is a diagram of a conventional multi-party application protection environment. FIG.

符号の説明Explanation of symbols

102 ターゲットシステム(ユーザーシステム)
103 マイクロプロセッサ
105 秘密鍵
108 外部メモリ
113 公開鍵
121 ソフトウェアベンダ
125 配布鍵
126 ブロック対応暗号処理部
200 プロセッサパッケージ
902 コア
903 命令キャッシュ
904 データキャッシュ
905 内部バス
906 バスインターフェイスユニット(BIU)
911 高速暗号鍵処理モジュール(FCM)
912 鍵値テーブル
913 配布鍵管理モジュール
913−1 シーケンサ
913−2 公開鍵復号モジュール
914 タスクスイッチャ
915 レジスタバッファアレイ
921 タスク状態テーブル
922 ハッシュ計算部
1111 情報配置記述子
1203 命令キャッシュメモリ
1204、1302、1401 カレントタスクIDレジスタ
1205 アクセス検証部
1207 オフセットテーブル
1303〜1305 キーテーブル
1311 ディスパッチャ
1312 鍵生成モジュール
1313 暗号処理モジュール
1402 MTRRテーブル管理比較部
1403 MTRR(アドレス範囲レジスタ)テーブル
1411 暗号属性送出部
102 Target system (user system)
103 Microprocessor 105 Private Key 108 External Memory 113 Public Key 121 Software Vendor 125 Distribution Key 126 Block Corresponding Cryptographic Processing Unit 200 Processor Package 902 Core 903 Instruction Cache 904 Data Cache 905 Internal Bus 906 Bus Interface Unit (BIU)
911 High-speed cryptographic key processing module (FCM)
912 Key value table 913 Distribution key management module 913-1 Sequencer 913-2 Public key decryption module 914 Task switcher 915 Register buffer array 921 Task state table 922 Hash calculator 1111 Information allocation descriptor 1203 Instruction cache memory 1204, 1302, 1401 Current Task ID register 1205 Access verification unit 1207 Offset table 1303-1305 Key table 1311 Dispatcher 1312 Key generation module 1313 Cryptographic processing module 1402 MTRR table management comparison unit 1403 MTRR (address range register) table 1411 Cryptographic attribute sending unit

Claims (4)

それぞれ固有のプログラム鍵に基づいて暗号化された複数のプログラムが格納されている外部メモリのアドレスを指定して、読み出し要求を発行するプロセッサコアと、
前記プロセッサコアの読み出し要求に応じて、前記外部メモリの指定されたアドレスのデータブロックを読み出すインターフェイスと、
前記プログラムの実行制御単位であるタスクごとに与えられるタスク識別子に対応して、 前記プログラム鍵を保持するタスク鍵テーブルと、
前記タスク識別子ごとに、前記プログラムが配置された先頭アドレスをオフセット値として保持するオフセットテーブルと、
前記読み出し要求により指定されたアドレスと、前記オフセットテーブルのタスク識別子で指定されるオフセット値とから相対アドレス値を計算し、この相対アドレス値を、前記プログラム鍵で暗号化したブロック対応鍵を生成する鍵生成部と、
前記読み出されたデータブロックを、前記ブロック対応鍵により復号化する暗号処理部と、
前記復号化されたデータブロックをキャッシュライン単位に読み込むキャッシュメモリと、
を備えるマイクロプロセッサ。
A processor core for issuing a read request by designating an address of an external memory in which a plurality of programs encrypted based on respective unique program keys are stored;
An interface for reading a data block at a specified address in the external memory in response to a read request from the processor core;
In response to a task identifier given to each task that is an execution control unit of the program, a task key table that holds the program key;
For each task identifier, an offset table that holds, as an offset value, the start address where the program is arranged;
A relative address value is calculated from the address specified by the read request and the offset value specified by the task identifier of the offset table, and a block correspondence key is generated by encrypting the relative address value with the program key. A key generation unit;
An encryption processing unit for decrypting the read data block with the block corresponding key;
A cache memory for reading the decrypted data block in units of cache lines;
A microprocessor comprising:
前記プロセッサコアが指定する外部メモリのアドレスは、仮想アドレスであり、
前記マイクロプロセッサは、所定の変換情報に基づいて仮想アドレスから物理アドレスへ変換して外部メモリにアクセスするアドレス変換機能をさらに有し、
前記鍵生成部は、前記仮想アドレスから相対アドレス値を計算することを特徴とする請求項1に記載のマイクロプロセッサ。
The address of the external memory specified by the processor core is a virtual address,
The microprocessor further has an address conversion function of converting from a virtual address to a physical address based on predetermined conversion information and accessing an external memory,
The microprocessor according to claim 1, wherein the key generation unit calculates a relative address value from the virtual address.
現在実行中のタスクの識別子を保持するタスクレジスタをさらに有し、
前記鍵生成部は、前記相対アドレス値に所定の秘密定数を加算し、前記加算結果を、前記タスクレジスタに保持されたタスク識別子で指定されるプログラム鍵によって暗号化して、前記ブロック対応鍵を生成することを特徴とする請求項1に記載のマイクロプロセッサ。
A task register that holds an identifier of the currently executing task;
The key generation unit adds a predetermined secret constant to the relative address value, encrypts the addition result with a program key specified by a task identifier held in the task register, and generates the block corresponding key The microprocessor according to claim 1.
現在実行されているタスクの識別子を保持するタスクレジスタと、
複数のキャッシュラインから構成され、タスクの要求があったときに、外部メモリに暗号化された状態で格納されているデータを、前記キャッシュライン単位に前記タスクの識別子と対応付けて、平文状態で読み込み可能なキャッシュメモリと、
前記暗号状態のデータを、キャッシュラインごとに異なるブロック対応暗号鍵で前記平文に復号する暗号処理部と、
前記暗号状態のデータのアドレス範囲を、前記タスクの識別子と対応付けて保持するアドレス範囲レジスタと、
前記アドレス範囲レジスタに保持されたアドレス範囲と、前記タスクの要求先のアドレスとから相対アドレスを計算し、この相対アドレスを所定の鍵で暗号化することにより前記ブロック対応暗号鍵を生成する暗号鍵生成部とを備え、前記タスクの実行中に、第2のタスクの要求があった場合に、前記暗号処理部は、前記タスクレジスタに保持されているタスクの識別子に対応するキャッシュラインの内容を、前記ブロック対応暗号鍵で暗号化し、
前記キャッシュメモリは、前記暗号化されたデータを外部メモリに書き戻し可能であることを特徴とするマイクロプロセッサ。
A task register that holds the identifier of the currently executing task;
It is composed of multiple cache lines, and when a task is requested, the data stored in an encrypted state in the external memory is associated with the task identifier in the cache line unit in the plain text state. Readable cache memory,
An encryption processor that decrypts the data in the encrypted state into the plaintext with a different block-compatible encryption key for each cache line;
An address range register that holds the address range of the data in the encryption state in association with the identifier of the task;
An encryption key that generates a block-corresponding encryption key by calculating a relative address from the address range held in the address range register and the request destination address of the task and encrypting the relative address with a predetermined key A generation unit, and when the second task is requested during execution of the task, the cryptographic processing unit displays the contents of the cache line corresponding to the identifier of the task held in the task register. , Encrypted with the block-compatible encryption key,
The microprocessor according to claim 1, wherein the cache memory is capable of writing back the encrypted data to an external memory.
JP2008276073A 2008-10-27 2008-10-27 Microprocessor Expired - Fee Related JP4643702B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008276073A JP4643702B2 (en) 2008-10-27 2008-10-27 Microprocessor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008276073A JP4643702B2 (en) 2008-10-27 2008-10-27 Microprocessor

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2001304488A Division JP4226816B2 (en) 2001-09-28 2001-09-28 Microprocessor

Publications (2)

Publication Number Publication Date
JP2009064462A true JP2009064462A (en) 2009-03-26
JP4643702B2 JP4643702B2 (en) 2011-03-02

Family

ID=40558936

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008276073A Expired - Fee Related JP4643702B2 (en) 2008-10-27 2008-10-27 Microprocessor

Country Status (1)

Country Link
JP (1) JP4643702B2 (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5377748B2 (en) * 2010-02-18 2013-12-25 株式会社東芝 program
JP2016523421A (en) * 2013-06-27 2016-08-08 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method, data processing program, computer program product, and data processing system for handling guest events in a system controlled by a hypervisor
CN107690621A (en) * 2015-06-16 2018-02-13 Arm 有限公司 Shielded abnormal disposal
CN111752200A (en) * 2020-07-08 2020-10-09 深圳市有方科技股份有限公司 Program operating method, computer device, and readable storage medium
US10802729B2 (en) 2015-06-16 2020-10-13 Arm Limited Apparatus and method for sharing pages including enforcing ownership rights independently of privilege level
US10936504B2 (en) 2015-06-16 2021-03-02 Arm Limited Apparatus and method for address translation and control of whether an access request is rejected based on an ownership table indicating an owner process for a block of physical addresses
US11314658B2 (en) 2015-06-16 2022-04-26 Arm Limited Apparatus and method including an ownership table for indicating owner processes for blocks of physical addresses of a memory

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6079446A (en) * 1983-10-06 1985-05-07 Hitachi Ltd Processor for multiple virtual storage data
JPH03204744A (en) * 1990-01-08 1991-09-06 Nec Corp Address converting mechanism
JPH03235143A (en) * 1990-02-13 1991-10-21 Sanyo Electric Co Ltd Cache memory controller
JPH03235144A (en) * 1990-02-13 1991-10-21 Sanyo Electric Co Ltd Cache memory controller
JPH06266620A (en) * 1993-03-16 1994-09-22 Nippon Telegr & Teleph Corp <Ntt> Exclusive control system using cache memory
JPH06266610A (en) * 1993-03-16 1994-09-22 Nippon Telegr & Teleph Corp <Ntt> Exclusive control system capable of interrupting processing
JPH06266621A (en) * 1993-03-17 1994-09-22 Nippon Telegr & Teleph Corp <Ntt> Data access method
JPH06282488A (en) * 1993-03-25 1994-10-07 Mitsubishi Electric Corp Cache storage device
JPH0728703A (en) * 1993-07-09 1995-01-31 Nippon Telegr & Teleph Corp <Ntt> Multiprocessor system capable of exclusive control
JPH07311712A (en) * 1994-05-19 1995-11-28 Toshiba Corp Fault recovering method
JPH09259044A (en) * 1996-03-21 1997-10-03 Fuji Xerox Co Ltd Information processor with secrecy protection function and secrecy protection method

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6079446A (en) * 1983-10-06 1985-05-07 Hitachi Ltd Processor for multiple virtual storage data
JPH03204744A (en) * 1990-01-08 1991-09-06 Nec Corp Address converting mechanism
JPH03235143A (en) * 1990-02-13 1991-10-21 Sanyo Electric Co Ltd Cache memory controller
JPH03235144A (en) * 1990-02-13 1991-10-21 Sanyo Electric Co Ltd Cache memory controller
JPH06266620A (en) * 1993-03-16 1994-09-22 Nippon Telegr & Teleph Corp <Ntt> Exclusive control system using cache memory
JPH06266610A (en) * 1993-03-16 1994-09-22 Nippon Telegr & Teleph Corp <Ntt> Exclusive control system capable of interrupting processing
JPH06266621A (en) * 1993-03-17 1994-09-22 Nippon Telegr & Teleph Corp <Ntt> Data access method
JPH06282488A (en) * 1993-03-25 1994-10-07 Mitsubishi Electric Corp Cache storage device
JPH0728703A (en) * 1993-07-09 1995-01-31 Nippon Telegr & Teleph Corp <Ntt> Multiprocessor system capable of exclusive control
JPH07311712A (en) * 1994-05-19 1995-11-28 Toshiba Corp Fault recovering method
JPH09259044A (en) * 1996-03-21 1997-10-03 Fuji Xerox Co Ltd Information processor with secrecy protection function and secrecy protection method

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5377748B2 (en) * 2010-02-18 2013-12-25 株式会社東芝 program
JP2016523421A (en) * 2013-06-27 2016-08-08 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method, data processing program, computer program product, and data processing system for handling guest events in a system controlled by a hypervisor
CN107690621A (en) * 2015-06-16 2018-02-13 Arm 有限公司 Shielded abnormal disposal
KR20180017095A (en) * 2015-06-16 2018-02-20 에이알엠 리미티드 Handling Protected Exceptions
JP2018523211A (en) * 2015-06-16 2018-08-16 エイアールエム リミテッド Protected exception handling
US10802729B2 (en) 2015-06-16 2020-10-13 Arm Limited Apparatus and method for sharing pages including enforcing ownership rights independently of privilege level
US10838877B2 (en) 2015-06-16 2020-11-17 Arm Limited Protected exception handling
US10936504B2 (en) 2015-06-16 2021-03-02 Arm Limited Apparatus and method for address translation and control of whether an access request is rejected based on an ownership table indicating an owner process for a block of physical addresses
US11314658B2 (en) 2015-06-16 2022-04-26 Arm Limited Apparatus and method including an ownership table for indicating owner processes for blocks of physical addresses of a memory
KR102592377B1 (en) * 2015-06-16 2023-10-23 에이알엠 리미티드 Protected exception handling
CN111752200A (en) * 2020-07-08 2020-10-09 深圳市有方科技股份有限公司 Program operating method, computer device, and readable storage medium

Also Published As

Publication number Publication date
JP4643702B2 (en) 2011-03-02

Similar Documents

Publication Publication Date Title
JP4226816B2 (en) Microprocessor
JP3866597B2 (en) Internal memory tamper resistant processor and secret protection method
JP4098478B2 (en) Microprocessor
US6983374B2 (en) Tamper resistant microprocessor
US9954681B2 (en) Systems and methods for data encryption
JP4226760B2 (en) Microprocessor, multitask execution method using the same, and multired execution method
US7590869B2 (en) On-chip multi-core type tamper resistant microprocessor
KR100924043B1 (en) Methods and apparatus for secure data processing and transmission
US7673152B2 (en) Microprocessor with program and data protection function under multi-task environment
US7694151B1 (en) Architecture, system, and method for operating on encrypted and/or hidden information
JP3880933B2 (en) Data access control method using tamper resistant microprocessor and cache memory processor
JP4643702B2 (en) Microprocessor
JP2005521942A (en) System and method for providing domain granular, hardware controlled memory encryption
JP2003051819A (en) Microprocessor
US11748493B2 (en) Secure asset management system
Whelihan et al. A key-centric processor architecture for secure computing
JP4021810B2 (en) Processor, processor system, and cache coherency control method

Legal Events

Date Code Title Description
TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20101109

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20101202

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131210

Year of fee payment: 3

LAPS Cancellation because of no payment of annual fees