JP2008250387A - Information processor - Google Patents

Information processor Download PDF

Info

Publication number
JP2008250387A
JP2008250387A JP2007087388A JP2007087388A JP2008250387A JP 2008250387 A JP2008250387 A JP 2008250387A JP 2007087388 A JP2007087388 A JP 2007087388A JP 2007087388 A JP2007087388 A JP 2007087388A JP 2008250387 A JP2008250387 A JP 2008250387A
Authority
JP
Japan
Prior art keywords
processor
instruction
fetch
instructions
access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007087388A
Other languages
Japanese (ja)
Inventor
Hiroshi Yao
浩 矢尾
Tatsunori Kanai
達徳 金井
Kenichiro Yoshii
謙一郎 吉井
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 JP2007087388A priority Critical patent/JP2008250387A/en
Priority to US11/898,880 priority patent/US20080244229A1/en
Publication of JP2008250387A publication Critical patent/JP2008250387A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/30181Instruction operation extension or modification
    • G06F9/30189Instruction operation extension or modification according to execution mode, e.g. mode flag
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3836Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/30Arrangements for executing machine instructions, e.g. instruction decode
    • G06F9/38Concurrent instruction execution, e.g. pipeline or look ahead
    • G06F9/3854Instruction completion, e.g. retiring, committing or graduating
    • G06F9/3858Result writeback, i.e. updating the architectural state or memory
    • G06F9/38585Result writeback, i.e. updating the architectural state or memory with result invalidation, e.g. nullification

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To improve safety regardless of whether a processor has virtualization support function or not. <P>SOLUTION: The information processor comprises a processor; a guarded memory which stores a hypervisor accessible to an HV protection area; a first communication path which connects the guarded memory with the processor; a fetch detection part which detects fetch to the address of the first instruction of a plurality of instructions contained in an entry part to be executed when activating the hypervisor through the first communication path; an instruction detection part which detects execution of the final instruction in the entry part through the first communication path; a time determination part which determines whether the execution of the final instruction is detected after the lapse of a predetermined time or not; an execution determination part which determines whether interruption of the processor is prohibited or not from the execution result of the final instruction when it is determined that the predetermined time does not pass; and first and second HV area protection circuits which permit the processor to access the HV protective area when the prohibition is determined. <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

この発明は、複数のソフトウェアが搭載されている情報処理装置に関するものである。   The present invention relates to an information processing apparatus equipped with a plurality of software.

従来から、データベースシステムやミッションクリティカルな処理を実行するサーバマシンにおいては、その処理の重要性や内部で保持するデータの機密度などの要因から、信頼性やセキュリティが重要視されていた。しかし近年では、これら汎用計算機等に限らず、組込み機器等の様々な装置において信頼性やセキュリティを確保することが重要となっている。   Conventionally, in a server machine that executes a database system or mission-critical processing, reliability and security have been regarded as important due to factors such as the importance of the processing and the sensitivity of data held inside. However, in recent years, it has become important to ensure reliability and security in various devices such as embedded devices as well as these general-purpose computers.

組込み機器では、一つの機器内で複数の機能を同時に実行したり、新しい機能をダウンロードして機能を追加するなど、機能の複雑化が進んでいる。このような複数の機能を実行可能な機器の開発または運用では、単機能の機器と比較すると、新たな問題が発生している。   In embedded devices, functions are becoming more complex, such as executing multiple functions at the same time within a single device, or downloading new functions and adding functions. In the development or operation of such a device capable of executing a plurality of functions, a new problem has occurred as compared with a single-function device.

例えば、ある機能に不具合が含まれていた場合、それがごく一部の機能であったとしても機器全体が停止するという障害が発生するケースがある。また、ダウンロードして、機器に対して追加した機能が悪意のある不正なプログラムである場合、秘密を保持すべき情報、またはプログラムが外部に漏洩したり、破壊や改竄されるケースがある。このように、組み込み機器等においても信頼性及びセキュリティが問題となっている。   For example, when a malfunction is included in a certain function, there is a case where a failure occurs in which the entire device stops even if it is a very small part of the function. In addition, when a function downloaded and added to a device is a malicious and malicious program, there is a case where information or a program that should be kept secret or the program leaks to the outside, or is destroyed or falsified. Thus, reliability and security are also a problem in embedded devices and the like.

上記の問題を解決するには、各機能を実現するプログラムに割り当てられたリソースへのアクセスを制御する必要がある。例えば、あるプログラムに割り当てたリソースへの他のプログラムや機能からのアクセスを禁止したり、複数の機能やプログラムから共有されるリソースへのアクセスを排他制御して管理する方法等が挙げられる。さらに、アクセス制御機構や制御情報自体も自由に操作できないように保護する必要がある。   In order to solve the above problems, it is necessary to control access to resources allocated to programs that implement each function. For example, a method of prohibiting access from other programs or functions to a resource allocated to a program, or managing by exclusive control of access to a resource shared by a plurality of functions or programs can be cited. Furthermore, it is necessary to protect the access control mechanism and the control information itself so that they cannot be freely operated.

これらの保護を実現し、複数の機能を隔離して信頼性やセキュリティを高める手段として、計算機の仮想化技術が提案されている。この仮想化技術の実装には様々な形態が存在する。仮想化技術の例としては、ハードウェアとOS(Operating System)の間に仮想化層を設けて、当該仮想化層上に複数のOS(ゲストOS)を動作させる形態がある。この仮想化層は、一般にハイパーバイザ層と呼ばれている。このハイパーバイザ層は、メモリやデバイス及び割込み等のリソースを管理し、個々のゲストOSに対して割り当てたリソースで構成される仮想計算機を提供する。これにより複数のゲストOSが互いに干渉せず隔離された状態での実行が実現できる。このハイパーバイザ層の機能をソフトウェアで実現する場合、当該ソフトウェアはハイパーバイザと呼ばれている。   Computer virtualization technology has been proposed as a means of realizing these protections and isolating multiple functions to increase reliability and security. There are various forms of implementation of this virtualization technology. As an example of the virtualization technology, there is a form in which a virtualization layer is provided between hardware and an OS (Operating System), and a plurality of OSs (guest OSs) are operated on the virtualization layer. This virtualization layer is generally called a hypervisor layer. This hypervisor layer manages resources such as memory, devices, and interrupts, and provides a virtual machine composed of resources allocated to each guest OS. As a result, execution in a state where a plurality of guest OSs are isolated without interfering with each other can be realized. When the functions of the hypervisor layer are realized by software, the software is called a hypervisor.

汎用計算機に使用されるプロセッサでは、プロセッサ自体に仮想化をサポートするハードウェア機構が用意されている。例としては、非特許文献1に示したIntel(登録商標)社が提唱する技術が存在する。この技術を実装したプロセッサでは、実行中のプログラムの権限を示す特権モードを多数用意し、特定の命令の実行時に、より上位の特権モードへ移行するように設定することが可能となる。これにより、ゲストOSから共有リソースへのアクセスをハードウェアで監視し、アクセス時により上位の特権モードを付与したソフトウェアでそのアクセス内容をチェックすることが可能になる。   In a processor used for a general-purpose computer, a hardware mechanism that supports virtualization is prepared in the processor itself. As an example, there is a technology proposed by Intel (registered trademark) shown in Non-Patent Document 1. A processor in which this technology is implemented can prepare a number of privilege modes indicating the authority of the program being executed, and can be set to shift to a higher privilege mode when a specific instruction is executed. As a result, access to the shared resource from the guest OS can be monitored by hardware, and the access content can be checked by software to which a higher privilege mode is given at the time of access.

他の例としては、Advanced Micro Devices社が提唱する技術(Pacifica)がある。当該技術(Pacifica)を実装したプロセッサでは、割込みをインターセプトする機構と、ソフトウェアから仮想割込みを発生させる機能とが用意されている。これにより、ハイパーバイザで割込みを一旦インターセプトした上で、その割込みを必要とするゲストOSへの割込み配送を管理することができる。また、ゲストOSによるアドレス変換テーブルへのアクセスを監視する機構が用意される。これにより、ゲストOSが自由にアドレス変換テーブルを書き換えて、他のゲストOSに割り当てられたメモリ領域をアクセスすることを防ぐことができる。   As another example, there is a technology (Pacifica) proposed by Advanced Micro Devices. A processor equipped with the technology (Pacifica) has a mechanism for intercepting an interrupt and a function for generating a virtual interrupt from software. As a result, once the interrupt is intercepted by the hypervisor, the interrupt delivery to the guest OS that needs the interrupt can be managed. A mechanism for monitoring access to the address conversion table by the guest OS is also prepared. As a result, it is possible to prevent the guest OS from freely rewriting the address conversion table and accessing a memory area allocated to another guest OS.

“Intel(R) Virtualization Technology Specification for the IA-32 Intel(R) Architecture"、[online]、[平成17年5月31日検索]、インターネット<URL: ftp://download.intel.com/technology/computing/vptech/C97063-002.pdf>"Intel (R) Virtualization Technology Specification for the IA-32 Intel (R) Architecture", [online], [searched May 31, 2005], Internet <URL: ftp://download.intel.com/technology /computing/vptech/C97063-002.pdf>

しかしながら、汎用計算機に使用されるような高機能なプロセッサと異なり、組込用に用いられる一般的なプロセッサには仮想化をサポートする機構が実装されていない。通常これらプロセッサでは、特権モードが少ないため、当該プロセッサで複数のゲストOSを実行した場合、各ゲストOSが最上位の特権モードで動作する。したがって、任意のゲストOSが、他のゲストOSに割り当てられたメモリ領域やデバイスを不正に参照・変更可能という問題がある。また、当該プロセッサでは、割込みの管理する割込みベクタテーブルを保護する機構がないため、ハイパーバイザが確実に割込みのインターセプトおよび配送を行えるという保証がないという問題がある。   However, unlike a high-performance processor used in a general-purpose computer, a general processor used for embedding does not have a mechanism for supporting virtualization. Usually, these processors have few privileged modes, so when a plurality of guest OSs are executed by the processor, each guest OS operates in the highest privileged mode. Therefore, there is a problem that an arbitrary guest OS can illegally refer to or change a memory area or a device assigned to another guest OS. Further, since the processor does not have a mechanism for protecting the interrupt vector table managed by the interrupt, there is a problem that there is no guarantee that the hypervisor can reliably intercept and deliver the interrupt.

本発明は、上記に鑑みてなされたものであって、プロセッサが仮想化サポート機能を有するか否かにかかわらず、安全性を向上させる情報処理装置を提供することを目的とする。   The present invention has been made in view of the above, and an object thereof is to provide an information processing apparatus that improves safety regardless of whether or not a processor has a virtualization support function.

上述した課題を解決し、目的を達成するために、本発明にかかる情報処理装置は、プロセッサと、第1のアクセス範囲へ前記プロセッサをアクセスさせる特権ソフトウェアを記憶する第1の記憶部と、前記第1のアクセス範囲よりも狭い第2のアクセス範囲へ前記プロセッサをアクセスさせるソフトウェアを記憶する第2の記憶部と、前記第1の記憶部と前記プロセッサとを接続し、前記特権ソフトウェアを前記プロセッサで実行するために必要なデータの通信を行う通信路と、前記プロセッサが前記通信路を介して、前記特権ソフトウェアに含まれる命令であって当該特権ソフトウェアを起動させる際に実行される複数の命令のうち、最初の命令が格納された格納アドレスへのフェッチを検出するフェッチ検出手段と、前記プロセッサが前記通信路を介して、前記プロセッサにより前記複数の命令のうちの特定の命令が実行されたことを検出する検出手段と、前記プロセッサが前記ソフトウェアを実行しているときに前記フェッチ検出手段により前記格納アドレスへのフェッチを検出してから、前記検出手段が前記特定の命令が実行されたことを検出するまでに、所定の時間が経過したか否かを判断する時間判断手段と、前記所定の時間が経過していないと判断した場合に、前記プロセッサが前記特定の命令を実行した結果から、前記プロセッサへの割り込みを禁止しているか否かを判断する判断手段と、前記実行判断手段が前記プロセッサへの割り込みを禁止していると判断した場合に、前記プロセッサに対して前記第1のアクセス範囲のアクセスを開放する制御手段と、を備えることを特徴とする。   In order to solve the above-described problems and achieve the object, an information processing apparatus according to the present invention includes a processor, a first storage unit that stores privileged software that causes the processor to access a first access range, A second storage unit that stores software that causes the processor to access a second access range narrower than the first access range; and the first storage unit and the processor are connected, and the privileged software is transmitted to the processor. And a plurality of instructions executed when the processor activates the privileged software via the communication path and a communication path for performing communication of data necessary for execution by the processor. Fetch detecting means for detecting a fetch to a storage address where the first instruction is stored, and the processor Detecting means for detecting that a specific instruction of the plurality of instructions has been executed by the processor via the communication path; and storing by the fetch detecting means when the processor is executing the software. Time determination means for determining whether or not a predetermined time has elapsed from detection of a fetch to an address until the detection means detects that the specific instruction has been executed; and the predetermined time A determination means for determining whether or not an interrupt to the processor is prohibited based on a result of the processor executing the specific instruction, and the execution determination means includes the processor Control means for releasing access in the first access range to the processor when it is determined that interrupting to the processor is prohibited. And wherein the Rukoto.

また、本発明にかかる情報処理装置は、プロセッサと、第1のアクセス範囲へ前記プロセッサをアクセスさせる特権ソフトウェアを記憶する第1の記憶部と、前記第1のアクセス範囲よりも狭い第2のアクセス範囲へ前記プロセッサをアクセスさせるソフトウェアを記憶する第2の記憶部と、前記第1の記憶部と前記プロセッサとを接続し、前記特権ソフトウェアを前記プロセッサで実行するために必要なデータの通信を行う通信路と、前記プロセッサが前記通信路を介して、前記特権ソフトウェアに含まれる命令であって当該特権ソフトウェアを起動させる際に実行される複数の命令のうち、最初の命令が格納された第1格納アドレスへのフェッチを検出する第1フェッチ検出手段と、前記プロセッサが前記通信路を介して、前記第1の記憶部に記憶される前記特権ソフトウェアに含まれる前記複数の命令のうち特定の命令が格納された第2格納アドレスへのフェッチを検出する第2フェッチ検出手段と、前記プロセッサが前記ソフトウェアを実行しているときに前記第1フェッチ検出手段により前記第1格納アドレスへのフェッチを検出してから、前記第2フェッチ検出手段により前記第2格納アドレスへのフェッチを検出するまでに、所定の時間が経過したか否かを判断する時間判断手段と、前記所定の時間が経過していないと判断した場合に、前記プロセッサに対して前記第1のアクセス範囲のアクセスを開放する制御手段と、を備えることを特徴とする。   The information processing apparatus according to the present invention includes a processor, a first storage unit that stores privileged software that causes the processor to access the first access range, and a second access that is narrower than the first access range. A second storage unit that stores software that allows the processor to access the range, and the first storage unit and the processor are connected to communicate data necessary for executing the privileged software on the processor. A communication path, and a first instruction storing a first instruction among a plurality of instructions that are included in the privileged software and executed when the processor starts the privileged software via the communication path First fetch detection means for detecting a fetch to a storage address; and the processor sends the first description via the communication path. Second fetch detection means for detecting a fetch to a second storage address storing a specific instruction among the plurality of instructions included in the privileged software stored in a section, and the processor executing the software A predetermined time elapses from when the first fetch detection means detects a fetch to the first storage address until the second fetch detection means detects a fetch to the second storage address. Time determining means for determining whether or not the predetermined time has elapsed, and control means for releasing access of the first access range to the processor when it is determined that the predetermined time has not elapsed. It is characterized by.

また、本発明にかかる情報処理装置は、プロセッサと、第1のアクセス範囲へ前記プロセッサをアクセスさせる特権ソフトウェアを記憶する第1の記憶部と、前記第1のアクセス範囲よりも狭い第2のアクセス範囲へ前記プロセッサをアクセスさせるソフトウェアを記憶する第2の記憶部と、前記第1の記憶部と前記プロセッサとを接続し、前記特権ソフトウェアを前記プロセッサで実行するために必要なデータの通信を行う通信路と、前記プロセッサが前記通信路を介して、前記特権ソフトウェアに含まれる命令であって当該特権ソフトウェアを起動させる際に実行される複数の命令へのフェッチを検出するフェッチ検出手段と、前記プロセッサが前記ソフトウェアを実行しているときに、検出したフェッチ先のアドレスから、前記複数の命令を構成する各命令が格納された格納アドレスへのフェッチが、命令順に行われているか否かを判断するフェッチ判断手段と、前記複数の命令のフェッチが命令順に行われたと判断した場合に、前記プロセッサにより前記複数の命令うちの特定の命令が実行されたことを検出する検出手段と、検出した前記複数の命令の実行結果から、前記プロセッサへの割り込み禁止されているか否かを判断する判断手段と、割り込み禁止されていると判断した場合に、前記プロセッサに対して前記第1のアクセス範囲のアクセスを開放する制御手段と、を備えることを特徴とする。   The information processing apparatus according to the present invention includes a processor, a first storage unit that stores privileged software that causes the processor to access the first access range, and a second access that is narrower than the first access range. A second storage unit that stores software that allows the processor to access the range, and the first storage unit and the processor are connected to communicate data necessary for executing the privileged software on the processor. A fetch detection means for detecting fetches to a plurality of instructions that are executed when the processor starts up the privileged software that is included in the privileged software via the communication path; When the processor is executing the software, from the detected fetch destination address, the plurality of Fetch determination means for determining whether or not the fetch to the storage address storing each instruction constituting the instruction is performed in the order of instructions, and when determining that the fetch of the plurality of instructions is performed in the order of instructions, Detection means for detecting that a specific instruction of the plurality of instructions has been executed by the processor, and determination for determining whether or not an interrupt to the processor is prohibited from the detected execution result of the plurality of instructions And a control means for releasing the access in the first access range to the processor when it is determined that the interrupt is prohibited.

また、本発明にかかる情報処理装置は、プロセッサと、第1のアクセス範囲へ前記プロセッサをアクセスさせる特権ソフトウェアを記憶する第1の記憶部と、前記第1のアクセス範囲よりも狭い第2のアクセス範囲へ前記プロセッサをアクセスさせるソフトウェアを記憶する第2の記憶部と、前記第1の記憶部と前記プロセッサとを接続し、前記特権ソフトウェアを前記プロセッサで実行するために必要なデータの通信を行う通信路と、前記プロセッサが前記通信路を介して、前記特権ソフトウェアに含まれる命令であって当該特権ソフトウェアを起動させる際に実行される複数の命令へのフェッチを検出するフェッチ検出手段と、前記プロセッサが前記ソフトウェアを実行しているときに、検出したフェッチ先のアドレスから、前記複数の命令を構成する各命令が格納された格納アドレスへのフェッチが行われているか否かを判断するフェッチ判断手段と、前記複数の命令のフェッチが命令順に行われたと判断した場合に、前記プロセッサに対して前記第1のアクセス範囲のアクセスを開放する制御手段と、を備えることを特徴とする。   The information processing apparatus according to the present invention includes a processor, a first storage unit that stores privileged software that causes the processor to access the first access range, and a second access that is narrower than the first access range. A second storage unit that stores software that allows the processor to access the range, and the first storage unit and the processor are connected to communicate data necessary for executing the privileged software on the processor. A fetch detection means for detecting fetches to a plurality of instructions that are executed when the processor starts up the privileged software that is included in the privileged software via the communication path; When the processor is executing the software, from the detected fetch destination address, the plurality of A fetch determination means for determining whether or not a fetch to a storage address storing each instruction constituting the instruction is performed; and when determining that the plurality of instructions are fetched in order of instructions, And control means for releasing access in the first access range.

本発明によれば、エントリコードが複数命令で構成される特権ソフトウェアを実行する際に、他のソフトウェアによる不正な割り込みを防止して、安全性を向上させるという効果を奏する。   According to the present invention, when privileged software whose entry code is composed of a plurality of instructions is executed, an illegal interruption by other software is prevented and safety is improved.

以下に添付図面を参照して、この発明にかかる情報処理装置の最良な実施の形態を詳細に説明する。また、後述する実施の形態においては、情報処理装置をシステムLSIに適用した例について説明する。なお、情報処理装置は、システムLSIに限らず、どのような装置に適用しても良い。   Exemplary embodiments of an information processing apparatus according to the present invention will be explained below in detail with reference to the accompanying drawings. In the embodiments described later, an example in which the information processing apparatus is applied to a system LSI will be described. The information processing apparatus is not limited to the system LSI and may be applied to any apparatus.

(第1の実施の形態)
図1に示すように、システムLSI100は、メモリ150と、デバイス160とを接続している。また、システムLSI100は、プロセッサ101と、動作モード管理回路102と、メモリアクセス制御部103と、第1HV(Hyper Viser)領域保護回路104と、デバイスアクセス制御部105と、第2HV領域保護回路106と、保護メモリ107とを備える。
(First embodiment)
As shown in FIG. 1, the system LSI 100 connects a memory 150 and a device 160. The system LSI 100 includes a processor 101, an operation mode management circuit 102, a memory access control unit 103, a first HV (Hyper Viser) area protection circuit 104, a device access control unit 105, and a second HV area protection circuit 106. , And a protective memory 107.

メモリ150は、第1メモリ領域154と、第2メモリ領域155と、第3メモリ領域156と、第2のゲストOS格納領域152と、第3のゲストOS格納領域153とを備えている。そして、第1メモリ領域154は、第1のゲストOS格納領域151を保持している。   The memory 150 includes a first memory area 154, a second memory area 155, a third memory area 156, a second guest OS storage area 152, and a third guest OS storage area 153. The first memory area 154 holds the first guest OS storage area 151.

また、第1のゲストOS格納領域151には第1のゲストOSのバイナリコードが、第2のゲストOS格納領域152には第2のゲストOSのバイナリコードが、第3のゲストOS格納領域153には第3のゲストOSのバイナリコードが格納されている。また、第1メモリ領域154、第2メモリ領域155及び第3メモリ領域156は、メモリアクセス制御部103により読み込み及び書き込みが制限される記憶領域とする。また、ゲストOSを格納する領域は、第1のゲストOS格納領域151のように、読み込み及び書き込みが制限される記憶領域内に確保されていても良い。   The first guest OS storage area 151 contains the binary code of the first guest OS, the second guest OS storage area 152 contains the binary code of the second guest OS, and the third guest OS storage area 153. Stores the binary code of the third guest OS. The first memory area 154, the second memory area 155, and the third memory area 156 are storage areas that are restricted in reading and writing by the memory access control unit 103. Further, an area for storing the guest OS may be secured in a storage area where reading and writing are restricted, like the first guest OS storage area 151.

デバイス160は、システムLSI100に接続され、システムLSI100に含まれるプロセッサ101により制御が行われるデバイスとする。また、デバイス160は、後述するデバイスアクセス制御部105によりアクセスが制限される。また、デバイス160は、システムLSI100の内部に備えるものでも、システムLSI100の外部に備えるものでもよい。なお、システムLSI100に接続されるデバイスの数について特に制限を設けるものではない。   The device 160 is a device connected to the system LSI 100 and controlled by the processor 101 included in the system LSI 100. Access to the device 160 is restricted by the device access control unit 105 described later. The device 160 may be provided inside the system LSI 100 or may be provided outside the system LSI 100. Note that there is no particular limitation on the number of devices connected to the system LSI 100.

また、デバイス160の例としては、メモリモジュール、ハードディスクドライブ等の大容量外部記憶装置、ネットワークインターフェース等の外部通信装置、キーボードやマウスなど利用者が入力に用いる入力装置、さらにはディスプレイ等の外部出力装置が考えられるが、これらに限るものではない。   Examples of the device 160 include a large capacity external storage device such as a memory module and a hard disk drive, an external communication device such as a network interface, an input device used by a user such as a keyboard and a mouse, and an external output such as a display. Devices are conceivable, but not limited to these.

そして、本実施の形態にかかるシステムLSI100の内部では、第1〜第6通信路が配接されている。これら通信路は、プロセッサ101とメモリ/デバイス等の間でデータを伝える媒体である。少なくとも、アクセス先のアドレスと読み書きされるデータが通信路を介して伝送される。また、通信路はどのような形態でも良く、本実施の形態ではバスを用いることとする。このバスの例としては、アドレスのビット幅分のアドレスバス、データのビット幅分のデータバス、読み出し/書き込みを示す信号線から構成されることが考えられる。また、別の実施例としては、シリアルバスのように、アドレスやデータ等の区別なく少数の信号線で構成して、その信号線上に所定のプロトコルでプロセッサからのアクセス要求とメモリからの応答とを伝送してもよい。   The first to sixth communication paths are arranged inside the system LSI 100 according to the present embodiment. These communication paths are media for transmitting data between the processor 101 and the memory / device. At least the access destination address and the data to be read and written are transmitted via the communication path. Further, the communication path may have any form, and in this embodiment, a bus is used. As an example of this bus, an address bus corresponding to the bit width of the address, a data bus corresponding to the data bit width, and a signal line indicating read / write can be considered. Further, as another embodiment, it is configured with a small number of signal lines such as a serial bus without distinction of addresses, data, etc., and an access request from a processor and a response from a memory using a predetermined protocol on the signal line. May be transmitted.

本実施の形態にかかるシステムLSI100では、プロセッサ101上で特権ソフトウェアが動作している場合に、当該システムLSI100が管理している最上位の動作モードで動作するように設定を行っている。そして、当該最上位の動作モードに限りHV保護領域に対する所定のアクセスを開放している。   In the system LSI 100 according to the present embodiment, when privileged software is operating on the processor 101, settings are made so as to operate in the highest operating mode managed by the system LSI 100. Only in the highest operating mode, predetermined access to the HV protection area is released.

また、特権ソフトウェアとは、システムLSI100で動作するソフトウェアのうち真に信頼できるソフトウェアをいう。特権ソフトウェアの信頼性を保証する機構は、どのような手法で実現しても良い。本実施の形態では、読み込み及び書き込みが制限されている保護メモリ107に格納することで信頼性を保証している。また、本実施の形態は、特権ソフトとしてハイパーバイザを用いた例とする。当該ハイパーバイザでは、後述するHV保護領域に含まれるアクセス先全てがアクセスさせる範囲となる。そして、当該ハイパーバイザのバイナリコードを「HVコード」と呼ぶ。また、上記の最上位の動作モードを、「HVモード」と呼ぶ。   Further, privileged software refers to software that can be truly trusted among software that operates on the system LSI 100. The mechanism for assuring the reliability of privileged software may be realized by any method. In this embodiment, the reliability is ensured by storing the data in the protection memory 107 that is restricted in reading and writing. In the present embodiment, a hypervisor is used as privilege software. In the hypervisor, all the access destinations included in the HV protection area described later are in a range to be accessed. The hypervisor binary code is referred to as “HV code”. In addition, the uppermost operation mode is referred to as “HV mode”.

HVコード格納領域112は、HVコードを格納している。また、当該HVコード格納領域112に格納されたHVコードは、ゲストOS等のソフトウェアから修正されてはならない。なお、HVコード格納領域112の詳細については後述する。   The HV code storage area 112 stores HV codes. Further, the HV code stored in the HV code storage area 112 must not be modified by software such as a guest OS. Details of the HV code storage area 112 will be described later.

図2に示すようにHVコードは、エントリ部に命令1“move SR to R0”201と、命令2“store R0 to CheckAdr”202とをエントリコードとして保持し、脱出コードに“return”203を保持する。このエントリ部では、HVコードの実行時に他プログラムにより割り込みが行われないように、プロセッサ101が割り込み禁止であるか確認を行う処理を実行する。また、エントリ部は、プロセッサ101がハイパーバイザを起動する際に実行する、HVコード内に格納されている複数の命令とする。そして、割り込み禁止であることが確認された場合には、プロセッサ101のHVコード実行時には、安全であることが保証される。   As shown in FIG. 2, the HV code holds the instruction 1 “move SR to R0” 201 and the instruction 2 “store R0 to CheckAdr” 202 as entry codes in the entry part, and “return” 203 as the exit code. To do. In this entry part, the processor 101 executes a process for confirming whether or not the interrupt is prohibited so that an interrupt is not performed by another program when the HV code is executed. The entry unit is a plurality of instructions stored in the HV code that are executed when the processor 101 activates the hypervisor. If it is confirmed that the interrupt is prohibited, it is ensured that the processor 101 is safe when the HV code is executed.

図2に示すように、HVコードのエントリ部は、ムーブ命令とストア命令とで構成されている。そして、これら各命令はプロセッサ101が提供する機械語の1命令に相当する。命令1に含まれている‘SR’は、プロセッサ101の状態を表す値が格納されているレジスタ(ステータスレジスタ)を示す。この‘SR’の値には、プロセッサ101が現在割込み禁止状態かどうかを示す情報が含まれている。そして、‘RO’は、汎用レジスタとする。   As shown in FIG. 2, the entry portion of the HV code is composed of a move instruction and a store instruction. Each of these instructions corresponds to one machine language instruction provided by the processor 101. 'SR' included in the instruction 1 indicates a register (status register) in which a value indicating the state of the processor 101 is stored. The value of 'SR' includes information indicating whether or not the processor 101 is currently in an interrupt disabled state. “RO” is a general-purpose register.

また、このように本実施の形態でエントリ部が複数命令したのは、本実施の形態にかかる後述するプロセッサ101では、命令セットにSRの内容をメモリに書込む命令が存在せず、SRの内容は汎用レジスタ(R0)との間に限り転送が可能なためである。   Also, in this embodiment, the plurality of entry units instructed in this way because the processor 101 (to be described later) according to this embodiment does not have an instruction to write the contents of the SR to the memory in the instruction set. This is because the contents can be transferred only to the general-purpose register (R0).

そこで、本実施の形態にかかるエントリ部は、命令1において、プロセッサ101の状態を示す値が格納されたレジスタ‘SR’の内容を、汎用レジスタ‘R0’に転送している。さらに命令2において、汎用レジスタ‘R0’の内容をCheckAdrに書込んでいる。この2個の命令で、プロセッサ101が割り込み禁止であることがチェックできる。   Therefore, in the instruction 1, the entry unit according to the present embodiment transfers the contents of the register 'SR' in which the value indicating the state of the processor 101 is stored to the general-purpose register 'R0'. Further, in instruction 2, the contents of the general-purpose register 'R0' are written into CheckAdr. With these two instructions, it can be checked that the processor 101 is disabled for interrupts.

この命令に含まれる‘CheckAdr’は‘SR’の値を書き込むアドレスとする。‘CheckAdr’は、プロセッサ101が制御するメモリやデバイスのアドレスとは異なる、実際には存在しないアドレスを選択することが望ましい。この場合、後述するプロセッサ101が通信路に対して、存在しないアドレス‘CheckAdr’へのアクセス要求を伝送するが、当該通信路を介して接続されるメモリやデバイスは、伝送されたアクセス要求に応答して実際に読み書きを行うことがない。   'CheckAdr' included in this instruction is an address for writing the value of 'SR'. It is preferable to select an address that does not actually exist as “CheckAdr”, which is different from the address of the memory or device controlled by the processor 101. In this case, the processor 101, which will be described later, transmits an access request to the nonexistent address “CheckAdr” to the communication path, but the memory or device connected via the communication path responds to the transmitted access request. And there is no actual reading and writing.

また、‘CheckAdr’に実際に存在するアドレスを選択する場合であっても、ハイパーバイザ及びゲストOSを含む全てのプログラムが使用しないアドレスを選択する必要がある。仮に‘CheckAdr’で示されたアドレスにデバイスが存在する場合、当該命令によってデータ書き込み処理が行われることになる。この結果、デバイスの誤動作を引き起こす可能性がある。このため、実際に使用されているアドレスを選択しないように留意する必要がある。   Further, even when an address that actually exists in 'CheckAdr' is selected, it is necessary to select an address that is not used by all programs including the hypervisor and the guest OS. If a device exists at the address indicated by 'CheckAdr', data write processing is performed according to the instruction. As a result, the device may malfunction. Therefore, care must be taken not to select an address that is actually used.

また、本実施の形態とは異なるが、HVコードのエントリ部が2個以上の命令で構成されていても良い。図3に示すように、HVコードのエントリ部がn個で構成されている場合等も考えられる。図3で示した例では、汎用レジスタの値をメモリに書き込む際に、別のベースレジスタを使用してアドレスを指定する必要がある場合である。この例では、命令1で、状態レジスタSRの内容を汎用レジスタR0に転送し、命令2以降で、R1の値をCheckAdrに設定し、最後の命令nでR1をベースレジスタに使用して、汎用レジスタR0の内容をCheckAdrに書込みを行っている。そして、これらの命令の後にプロセッサが割込み禁止状態であることをチェックするものとする。このようなn個で構成されている場合も途中で他のコードに割り込まれる可能性がある。   Further, although different from the present embodiment, the entry portion of the HV code may be composed of two or more instructions. As shown in FIG. 3, the case where the entry part of HV code | symbol is comprised by n piece etc. is also considered. In the example shown in FIG. 3, when writing the value of the general-purpose register into the memory, it is necessary to specify an address using another base register. In this example, the instruction 1 transfers the contents of the status register SR to the general-purpose register R0, the instruction 2 and later set the value of R1 to CheckAdr, and the last instruction n uses R1 as the base register. The contents of the register R0 are written to CheckAdr. Then, after these instructions, it is checked that the processor is in an interrupt disabled state. Even in the case of such n pieces, there is a possibility that another code will be interrupted.

つまり、HVコードのエントリ部が複数命令で構成されている場合にセキュリティをどのように保持するのか課題となる。   That is, it is a problem how to maintain security when the entry part of the HV code is composed of a plurality of instructions.

次に、従来から存在する組み込み機器において、単にハイパーバイザが動作している時に最上位の動作モードとなるように設計をしたために、ハイパーバイザ以外に不正ユーザコードが最上位の動作モードで実行されてしまう例について説明する。   Next, in the existing embedded device, since it was designed to be in the highest operating mode when the hypervisor is operating, unauthorized user code is executed in the highest operating mode in addition to the hypervisor. An example will be described.

図4に示すように、左側の不正ユーザコードが不正な処理を行うソフトウェアコードであり、右側のバイナリコードがハイパーバイザのバイナリコード(以下、HVコードという)である。まず、不正な処理を行うソフトウェアでは、“enable interrupt”により割込み許可に設定する。その後、不正ユーザコードは、エントリ部の命令1にジャンプする。命令1の実行後に何らかの割込みを発生させ、不正ユーザコードの割込みハンドラで‘R0’に偽のSRの値を読み込ませる。その後、エントリ部の命令2に復帰する。これと同時に、動作モードが最上位の動作モードに変更される。   As shown in FIG. 4, the unauthorized user code on the left side is software code for performing unauthorized processing, and the binary code on the right side is a hypervisor binary code (hereinafter referred to as HV code). First, in software that performs illegal processing, “enable interrupt” is set to enable interrupts. Thereafter, the unauthorized user code jumps to the instruction 1 in the entry part. An interrupt is generated after execution of the instruction 1, and a false SR value is read into 'R0' by an interrupt handler of an illegal user code. Thereafter, the process returns to the instruction 2 in the entry part. At the same time, the operation mode is changed to the highest operation mode.

また、1回の命令フェッチで同時に読み出される命令の範囲(以下、命令フェッチ単位と呼ぶ)は、プロセッサに依存して様々である。この命令フェッチ単位は、1回の命令フェッチによって同時に読み出される命令数と、命令フェッチ単位の先頭のアドレス境界で規定される。例えば、組込み用のPowerPC(登録商標)405プロセッサでは、命令長は32ビットであるが、オンチップバスに接続されたメモリから命令をフェッチする場合には、1回の命令フェッチで64ビット境界(=2命令境界)に配置された2命令が同時に読み出される。   Also, the range of instructions that are simultaneously read by one instruction fetch (hereinafter referred to as an instruction fetch unit) varies depending on the processor. This instruction fetch unit is defined by the number of instructions that are simultaneously read by one instruction fetch and the head address boundary of the instruction fetch unit. For example, in an embedded PowerPC (registered trademark) 405 processor, the instruction length is 32 bits. However, when fetching an instruction from a memory connected to an on-chip bus, a 64-bit boundary ( = 2 instructions arranged at the boundary of 2 instructions) are read out simultaneously.

この組込み用のPowerPC(登録商標)405プロセッサの例では、命令フェッチ単位に含まれる命令のうち1番目の命令(すなわち64ビット境界に配置された命令)から順に実行する場合、命令フェッチ要求で指定されるアドレスは命令フェッチ単位の先頭アドレスとなり、その命令フェッチ単位に含まれる2命令が同時に読み出される。1番目の命令の実行時には2番目の命令はバッファに記憶され、2番目の命令の実行時にはその命令に対する命令フェッチは発生しない。   In the example of the built-in PowerPC (registered trademark) 405 processor, when executing sequentially from the first instruction (that is, an instruction arranged on a 64-bit boundary) among the instructions included in the instruction fetch unit, it is designated by an instruction fetch request. The address to be used is the head address of the instruction fetch unit, and two instructions included in the instruction fetch unit are read simultaneously. When the first instruction is executed, the second instruction is stored in the buffer, and when the second instruction is executed, an instruction fetch for the instruction does not occur.

また、本実施の形態では、命令フェッチ単位を、1命令毎の例とする。しかしながら、以下の説明の「命令」を「命令フェッチ単位」と置き換えることにより、命令フェッチ単位が複数命令の場合にも適用可能である。   In this embodiment, the instruction fetch unit is an example for each instruction. However, by replacing “instruction” in the following description with “instruction fetch unit”, the present invention can be applied to a case where the instruction fetch unit is a plurality of instructions.

そして、プロセッサ101では、ハイパーバイザのエントリ部の命令が終了した後、ハイパーバイザの他の命令を実行する。そして、ハイパーバイザ実行時に、実際には割り込みが禁止されていないため、不正ユーザコードはハイパーバイザに対して割り込むことができる。   The processor 101 executes another instruction of the hypervisor after the instruction of the entry part of the hypervisor is completed. When executing the hypervisor, since an interrupt is not actually prohibited, an unauthorized user code can interrupt the hypervisor.

なお、図4に示した例では、エントリ部の命令については命令順に行われている場合を示している。つまり、フェッチ検出部121が、仮にハイパーバイザのエントリ部の最初から最後までの命令を命令順にフェッチしたことを確認しても、本実施の形態に示したシステムLSI100では第1通信経路を介した命令フェッチを確認できない。このため、例えば第6通信経路を介して他のユーザコードの命令フェッチが行われたとしても動作モード管理回路102は、当該他のユーザコードの命令フェッチを検出できない。そこで、本実施の形態では、エントリ部の処理に要する時間を計測して割り込みが行われたか否か判断することとしている。   In the example shown in FIG. 4, the instructions in the entry part are executed in the order of instructions. That is, even if the fetch detection unit 121 confirms that the instructions from the beginning to the end of the entry part of the hypervisor are fetched in the order of instructions, the system LSI 100 shown in the present embodiment passes through the first communication path. The instruction fetch cannot be confirmed. For this reason, for example, even if an instruction fetch of another user code is performed via the sixth communication path, the operation mode management circuit 102 cannot detect an instruction fetch of the other user code. Therefore, in this embodiment, it is determined whether or not an interrupt has been made by measuring the time required for processing of the entry unit.

仮に、汎用計算機に使用されるプロセッサのように割込みベクタテーブルや割込み処理ルーチンを完全に保護できる場合には、このような割込み処理ルーチンへのジャンプが行われても、再びHVコードに戻るように記述しておけば問題ない。しかしながら、組込み向け機器に用いられるプロセッサでは、割込みベクタテーブルや割込み処理ルーチンを完全にハイパーバイザの保護下に置くことができない。このため、割込み発生時に不正ユーザコードを、動作モードが最上位の動作モードで実行されてしまう可能性がある。   If the interrupt vector table and the interrupt processing routine can be completely protected as in a processor used in a general-purpose computer, even if a jump to such an interrupt processing routine is performed, the program returns to the HV code again. There is no problem if it is described. However, in a processor used for an embedded device, the interrupt vector table and the interrupt processing routine cannot be completely under the protection of the hypervisor. For this reason, there is a possibility that an illegal user code is executed in the highest operation mode when an interrupt occurs.

そこで、本実施の形態では、後述する動作モード管理回路102と、第1HV領域保護回路104と、第2HV領域保護回路106とが、不正ユーザコードによる最上位動作モードで動作することを禁止するように制御を行う。   Therefore, in the present embodiment, the operation mode management circuit 102, the first HV area protection circuit 104, and the second HV area protection circuit 106, which will be described later, are prohibited from operating in the highest-level operation mode based on an unauthorized user code. To control.

図1に戻り、プロセッサ101は、第1のゲストOS等のOS及びハイパーバイザなどのソフトウェアに従って処理又は演算等を行う。また、本実施の形態にかかるプロセッサ101は、仮想化を支援する機能を内蔵していないプロセッサとするが、実用上は仮想化を支援する機能を内蔵しているプロセッサであってもよいことはいうまでもない。   Returning to FIG. 1, the processor 101 performs processing or calculation according to an OS such as a first guest OS and software such as a hypervisor. In addition, the processor 101 according to the present embodiment is a processor that does not include a function that supports virtualization. However, in practice, it may be a processor that includes a function that supports virtualization. Needless to say.

また、プロセッサ101は、メモリ(メモリ150及び保護メモリ107)から命令を順次読み出し、読み出した命令を実行する。また、プロセッサ101は、読み出した命令に応じて、各通信路に接続されたメモリやデバイスに対してデータの読み出し/書き込みを行う。   The processor 101 sequentially reads instructions from the memory (the memory 150 and the protection memory 107), and executes the read instructions. Further, the processor 101 reads / writes data from / to a memory or device connected to each communication path in accordance with the read command.

ところで、一般的なプロセッサでは、より上位の特権モードに移行するときは、システムコール命令に代表される特定の命令の実行によって行われる。このシステムコール命令の実行後、特権モードへの移行とともに、例外が発生してOSのカーネルコードへジャンプし、割込み禁止状態として、安全性を確保している。本実施形態にかかるプロセッサは、動作モードが少なく、アプリケーションに割り当てるユーザモードとOSに割り当てる特権モードの2個程度しか動作モードがないものとする。この場合、ハイパーバイザの動作に割り当てる動作モードがなく、OSとハイパーバイザの動作を区別できない。   By the way, in a general processor, the transition to the higher privilege mode is performed by executing a specific instruction represented by a system call instruction. After execution of this system call instruction, with the transition to the privileged mode, an exception occurs and jumps to the kernel code of the OS to ensure safety by setting an interrupt disabled state. The processor according to the present embodiment has a small number of operation modes, and has only two operation modes: a user mode assigned to an application and a privilege mode assigned to an OS. In this case, there is no operation mode assigned to the operation of the hypervisor, and the operation of the OS and the hypervisor cannot be distinguished.

そこで、本実施の形態では、プロセッサ101自体が持つ動作モードよりも上位のアクセス権限を有する動作モードであるHVモードを導入している。このため、プロセッサ101の外部に配置されたハードウェアでHVモードに切り替えることになる。この場合、プロセッサ101上で動作するソフトウェアの指示によるHVコードへのジャンプや割込み禁止状態への移行等は、プロセッサ内部の動作のため、外部に配置されたハードウェアからは制御できない。   Therefore, in the present embodiment, an HV mode, which is an operation mode having an access authority higher than the operation mode of the processor 101 itself, is introduced. For this reason, the hardware mode arranged outside the processor 101 is switched to the HV mode. In this case, a jump to the HV code or a transition to an interrupt disabled state according to an instruction of software operating on the processor 101 cannot be controlled from outside hardware because of the internal operation of the processor.

そこで、本実施の形態にかかるシステムLSI100では、HVコードへのジャンプや割込み禁止状態への移行はプロセッサ101上で動作するソフトウェア(例えば第1のゲストOS等)に任せ、プロセッサ101の外部のハードウェアで、適切にHVコードへジャンプしているか及び適切に割込み禁止状態になっているかチェックする。次に、このようなチェックを行う動作モード管理回路102について説明する。   Therefore, in the system LSI 100 according to the present embodiment, the jump to the HV code and the transition to the interrupt disabled state are left to the software (for example, the first guest OS) operating on the processor 101, and the hardware external to the processor 101 is determined. The hardware checks whether the jump is properly made to the HV code and whether the interrupt is properly disabled. Next, the operation mode management circuit 102 that performs such a check will be described.

動作モード管理回路102は、フェッチ検出部121と、フェッチ判断部122と、時間計測部123と、命令検出部124と、時間判断部125と、実行判断部126と、モード切替部127とを備え、プロセッサ101と第2HV領域保護回路106とを接続する第1通信路に流れるデータを監視して、必要に応じて動作モードの切替を行う。   The operation mode management circuit 102 includes a fetch detection unit 121, a fetch determination unit 122, a time measurement unit 123, an instruction detection unit 124, a time determination unit 125, an execution determination unit 126, and a mode switching unit 127. The data flowing in the first communication path connecting the processor 101 and the second HV area protection circuit 106 is monitored, and the operation mode is switched as necessary.

また、動作モード管理回路102は、動作モードとして少なくともHVモードと通常モードの2個の状態を保持する状態遷移回路とする。動作モード管理回路102は、第1通信路に流れる信号を監視して、所定の条件が満たされた場合にHVモード/通常モードの状態遷移を起こす。また、動作モード管理回路102は、HVモード/通常モードの状態に応じて、モード情報信号を第1HV領域保護回路104及び第2HV領域保護回路106に出力する。これにより、第1HV領域保護回路104及び第2HV領域保護回路106は、動作モードに応じたアクセス制御を行うことができる。なお、動作モード管理回路102の動作に関する詳細については後述する。   The operation mode management circuit 102 is a state transition circuit that holds at least two states of the HV mode and the normal mode as operation modes. The operation mode management circuit 102 monitors the signal flowing through the first communication path, and causes a state transition between the HV mode and the normal mode when a predetermined condition is satisfied. Further, the operation mode management circuit 102 outputs a mode information signal to the first HV area protection circuit 104 and the second HV area protection circuit 106 according to the state of the HV mode / normal mode. Accordingly, the first HV area protection circuit 104 and the second HV area protection circuit 106 can perform access control according to the operation mode. Details regarding the operation of the operation mode management circuit 102 will be described later.

また、HVモードに遷移できる条件について説明する。上述から動作モード管理回路102が動作モードをHVモードに切り替えるために必要な処理は、HVコードのエントリ部に適切に実行を移す処理(つまりエントリ部の命令が適切に実行されたことを保証する必要がある)、及び割込み禁止にする処理(つまり割込み禁止状態であることを保証する必要がある)とする。そして動作モード管理回路102は、これら2つの処理の実行を保証した上で、動作モードをHVモードに設定する処理を行うことができる。つまり、これら3つの処理が不可分に行われることが必要となる。なお、処理が不可分に行われるとは、これらの処理の間に別の処理が行われることがないことを意味する。また、当然ながら、HVコードは、ゲストOS等の他のソフトウェアから修正できないように保護される必要がある。   In addition, the conditions that allow transition to the HV mode will be described. From the above, the processing necessary for the operation mode management circuit 102 to switch the operation mode to the HV mode is processing that appropriately transfers execution to the entry portion of the HV code (that is, guarantees that the instruction of the entry portion has been properly executed). And processing to disable interrupts (that is, it is necessary to guarantee that interrupts are disabled). The operation mode management circuit 102 can perform the process of setting the operation mode to the HV mode while guaranteeing the execution of these two processes. In other words, these three processes must be performed inseparably. Note that the processing is performed indivisiblely means that no other processing is performed between these processings. Of course, the HV code needs to be protected so that it cannot be modified by other software such as the guest OS.

また、本実施の形態にかかるHVコードのエントリ部が適切に実行された場合、プロセッサ101の状態が割り込み禁止であるか否かが確認できる。このため、エントリ部が上述したように不正ユーザコードに割り込まれず、適切に実行されたか否かがポイントとなる。そこで、本実施の形態にかかる動作モード管理回路102では、エントリ部の実行時間を測定することにより、2命令以上のエントリ部を不可分に実行したことを保証することとする。   Further, when the entry portion of the HV code according to the present embodiment is appropriately executed, it can be confirmed whether or not the state of the processor 101 is interrupt-prohibited. For this reason, as described above, the point is whether or not the entry unit is appropriately executed without being interrupted by the unauthorized user code. Therefore, in the operation mode management circuit 102 according to the present embodiment, it is assumed that the entry portion having two or more instructions is indivisiblely executed by measuring the execution time of the entry portion.

動作モード管理回路102が、2命令以上のエントリ部が不可分に実行されたか否かに基づいて、動作モードをHVモードにするか否かが決定される。これにより、動作モード管理回路102がHVモードに切り替えたときには、割り込み不可能な状態でHVコードのみ実行されていることが保証される。   The operation mode management circuit 102 determines whether or not to set the operation mode to the HV mode based on whether or not the entry part having two or more instructions is inextricably executed. As a result, when the operation mode management circuit 102 switches to the HV mode, it is guaranteed that only the HV code is executed in a state where no interruption is possible.

そして、本実施の形態にかかる動作モード管理回路102は、上述した割り込みの偽装を防ぐために、エントリ部の実行時間を測定することで、2命令以上のエントリ部を不可分に実行したことを保証する。なお、詳細な処理手順については後述する。   Then, the operation mode management circuit 102 according to the present embodiment guarantees that the entry portion of two or more instructions has been executed indefinitely by measuring the execution time of the entry portion in order to prevent the above-mentioned disguise of the interrupt. . The detailed processing procedure will be described later.

ところで、HVコードに実行を移す処理、及び割込み禁止にする処理は、プロセッサ101上で動作するソフトウェアで行われる。そして、動作モード管理回路102がこれらの処理の実行要求又は実行結果の検出を行う。この検出チェック方法として、本実施の形態にかかる動作モード管理回路102は、プロセッサ101と保護メモリ107とを接続する第1通信路で送受信されるアクセス要求の種類や、アドレス、データを監視する。次に、動作モード管理回路102の各構成について説明する。   By the way, the process of transferring execution to the HV code and the process of disabling interrupts are performed by software operating on the processor 101. Then, the operation mode management circuit 102 detects an execution request or execution result of these processes. As this detection check method, the operation mode management circuit 102 according to the present embodiment monitors the type, address, and data of an access request transmitted / received through the first communication path connecting the processor 101 and the protection memory 107. Next, each configuration of the operation mode management circuit 102 will be described.

フェッチ検出部121は、プロセッサ101と第2HV領域保護回路106とを接続する第1通信路を介して、命令フェッチの検出を行う。そして、フェッチ検出部121は、システムLSI起動時の初期化終了した後、又はゲストOS等のソフトウェアがプロセッサ101上で実行されている時に、HVコード格納領域112に格納されたHVコードのエントリ部の命令フェッチを検出することになる。   The fetch detection unit 121 detects an instruction fetch via a first communication path that connects the processor 101 and the second HV area protection circuit 106. The fetch detection unit 121 is an entry unit for the HV code stored in the HV code storage area 112 after completion of initialization at the time of starting the system LSI or when software such as the guest OS is executed on the processor 101. The instruction fetch is detected.

フェッチ判断部122は、フェッチ検出部121が検出した命令フェッチが、後述する保護メモリ107のHVコード格納領域112に格納されたHVコードのエントリ部の最初の命令(例えば図2に示した命令1)のアドレスであるか否かを判断する。なお、詳細な判断手法については後述する。   The fetch determination unit 122 detects that the instruction fetch detected by the fetch detection unit 121 is the first instruction (for example, the instruction 1 shown in FIG. 2) in the entry part of the HV code stored in the HV code storage area 112 of the protection memory 107 described later. ) Address. A detailed determination method will be described later.

また、フェッチ判断部122は、フェッチ検出部121が検出した命令フェッチが、後述する保護メモリ107のHVコード格納領域112に格納されたHVコードの脱出部に含まれている脱出命令のアドレス(例えば図2に示した“return”203のアドレス)であるか否かを判断する。   In addition, the fetch determination unit 122 uses the instruction fetch detected by the fetch detection unit 121 as the address of the escape instruction (for example, included in the escape part of the HV code stored in the HV code storage area 112 of the protection memory 107 described later). It is determined whether or not the address is “return” 203 shown in FIG.

時間計測部123は、フェッチ判断部122がHVコードのエントリ部の最初の命令(例えば図2に示した命令1)に対するフェッチが行われたと判断した場合、時間の計測を開始する。また、時間計測部123が計測する時間は、システムLSI100内で使用される何らかのクロック信号をカウントすることで得られる時間とする。また、プロセッサ101における命令実行時間を計測することが目的であるので、時間計測として用いるクロック信号はプロセッサ101の動作進行の基準となるクロック信号であることが望ましい。   When the fetch determination unit 122 determines that the fetch for the first instruction (for example, the instruction 1 shown in FIG. 2) in the entry part of the HV code has been performed, the time measurement unit 123 starts measuring time. The time measured by the time measuring unit 123 is a time obtained by counting some clock signal used in the system LSI 100. Since the purpose is to measure the instruction execution time in the processor 101, it is desirable that the clock signal used as the time measurement is a clock signal that serves as a reference for the progress of the operation of the processor 101.

命令検出部124は、プロセッサ101がHVコードのエントリ部の最後の命令(例えば図2に示した命令2)の実行を検出する。本実施の形態にかかる命令検出部124では、プロセッサ101からのデータ書き込み要求の検出を行う。なお、命令検出部124は、図2に示したようにエントリ部の命令が2個の場合には命令2の検出を行うが、エントリ部がn個の命令で構成されている場合にはn番目の命令の検出を行うことになる。なお、本実施の形態とは異なるが、命令検出部124が、実行を検出する命令は、最後の命令に制限するものではなく、割り込みが禁止されていることが確認できる特定の命令であればよいものとする。   The instruction detection unit 124 detects the execution of the last instruction (for example, instruction 2 shown in FIG. 2) in the entry part of the HV code by the processor 101. The instruction detection unit 124 according to the present embodiment detects a data write request from the processor 101. The instruction detection unit 124 detects the instruction 2 when there are two entries in the entry section as shown in FIG. 2, but n when the entry section is composed of n instructions. The second instruction will be detected. Although different from the present embodiment, the instruction that is detected by the instruction detection unit 124 is not limited to the last instruction, as long as it is a specific instruction that can confirm that interrupts are prohibited. Be good.

時間判断部125は、時間計測部123が時間の計測を開始してから所定の時間が経過したか否かを判断する。この所定の時間は、エントリ部の全ての命令を行うために要する時間に基づいて定められる。これにより、時間判断部125が所定の時間が経過したと判断したときに、命令検出部124が命令を検出できないのであれば、他のソフトウェアにより割り込みが行われたと判断できる。   The time determination unit 125 determines whether or not a predetermined time has elapsed since the time measurement unit 123 started measuring time. This predetermined time is determined based on the time required to execute all instructions in the entry section. Thus, when the time determination unit 125 determines that the predetermined time has elapsed, if the instruction detection unit 124 cannot detect the instruction, it can be determined that an interrupt has been performed by other software.

実行判断部126は、命令検出部124が検出した命令の実行結果から、割り込み禁止となっているか否か判断する。本実施の形態にかかる実行判断部126は、プロセッサ101からのアドレスCheckAdrに対する書き込み要求で指定された値が、割り込み禁止を表す値であるか否か判断する。これにより、プロセッサ101が割り込み禁止状態であるか否か判断できる。   The execution determination unit 126 determines whether or not interrupts are prohibited from the execution result of the instruction detected by the instruction detection unit 124. The execution determining unit 126 according to the present embodiment determines whether or not the value specified in the write request for the address CheckAdr from the processor 101 is a value indicating interrupt inhibition. Thereby, it can be determined whether or not the processor 101 is in an interrupt disabled state.

モード切替部127は、実行判断部126の判断結果に従って、動作モードの切替を行う。例えば、モード切替部127は、実行判断部126が割り込み禁止であると判断した場合、モード切替部127は、割り込み禁止状態でハイパーバイザがプロセッサ101上で動作するとみなして、動作モードをHVモードに切り替える。   The mode switching unit 127 switches the operation mode according to the determination result of the execution determination unit 126. For example, if the mode switching unit 127 determines that the execution determining unit 126 is disabled for interrupts, the mode switching unit 127 regards the hypervisor as operating on the processor 101 in the interrupt disabled state, and sets the operation mode to the HV mode. Switch.

そして、後述するHV保護領域においては、後述する第1HV領域保護回路104及び第2HV領域保護回路106が、当該動作モードに基づいて、メモリ150、保護メモリ107上のアドレス、又はデバイス160においてアクセス範囲を変更する処理を行う。なお、アクセス範囲とは、プロセッサ101にアクセスが開放されたアクセス先の範囲を示すものとする。   Then, in the HV protection area described later, the first HV area protection circuit 104 and the second HV area protection circuit 106 described later have access addresses in the memory 150, the address on the protection memory 107, or the access range in the device 160 based on the operation mode. Process to change. The access range indicates an access destination range in which access to the processor 101 is released.

これにより、割り込み不可能な状態でHVコードが実行された時に限り、HV保護領域に含まれる全てのアクセス先にアクセスが開放される。そして、通常モードの場合には、第1のゲストOS等はHV保護領域に含まれる全てのアクセス先(範囲)よりも狭い範囲のアクセス範囲に対してアクセスが開放される。   Thus, access is released to all access destinations included in the HV protection area only when the HV code is executed in a state in which interruption is impossible. In the normal mode, the first guest OS or the like is opened to an access range narrower than all access destinations (ranges) included in the HV protection area.

また、フェッチ判断部122が脱出命令のアドレスだと判断した場合、モード切替部127は、第1のゲストOS等のソフトウェアがプロセッサ101上で動作するとみなして、動作モードを通常モードに切り替える。なお、詳細な切り替え条件等については後述する。   When the fetch determination unit 122 determines that the address is an escape instruction address, the mode switching unit 127 assumes that software such as the first guest OS operates on the processor 101 and switches the operation mode to the normal mode. Detailed switching conditions and the like will be described later.

本実施の形態では、システムLSI100内部において、プロセッサ101上で動作するソフトウェアに応じてアクセスさせる範囲の変更等が行われる領域を、HV(ハイパーバイザ)保護領域とする。図1に示すようにHV保護領域には、メモリアクセス制御部103と、デバイスアクセス制御部105と、保護メモリ107と、第1HV(ハイパーバイザ)領域保護回路104と、第2HV領域保護回路106とを含むものとする。   In the present embodiment, an area in the system LSI 100 where a range to be accessed according to software running on the processor 101 is changed is an HV (hypervisor) protection area. As shown in FIG. 1, the HV protection area includes a memory access control unit 103, a device access control unit 105, a protection memory 107, a first HV (hypervisor) area protection circuit 104, a second HV area protection circuit 106, Shall be included.

このHV保護領域に格納された構成(メモリ又は回路)は、プロセッサ101からのアクセス(読出し/書込み)に対して所定の制限が設けられている。これにより、HV保護領域に格納されたメモリやデバイスの制御情報、ゲストOSの管理情報等が、HVコードのみがアクセス又は書き込み可能となり、ゲストOS等による不正な処理から保護することができる。   The configuration (memory or circuit) stored in the HV protection area has predetermined restrictions on access (read / write) from the processor 101. As a result, the memory and device control information stored in the HV protection area, the guest OS management information, and the like can be accessed or written only by the HV code, and can be protected from unauthorized processing by the guest OS or the like.

なお、本実施の形態では、HV保護領域に上述した構成を含むものとするが、このような構成に制限するものではない。変形例として、システムLSIのHV保護領域に、HV領域保護回路とメモリアクセス制御部のみ含むものでも良いし、HV領域保護回路とデバイスアクセス制御部のみ含むものでも良いし、HV領域保護回路と保護メモリのみ含むものでも良いし、これらの2つ以上の組み合わせでも良い。なお、他の組み合わせの詳細な例については後述する。   In the present embodiment, the above-described configuration is included in the HV protection region, but is not limited to such a configuration. As a modification, the HV protection area of the system LSI may include only the HV area protection circuit and the memory access control unit, or may include only the HV area protection circuit and the device access control unit, or the HV area protection circuit and the protection. Only the memory may be included, or a combination of two or more of these may be used. Detailed examples of other combinations will be described later.

保護メモリ107は、HVコード格納領域112を格納する。また、保護メモリ107は、通常モードの場合は書き込み禁止とする。   The protection memory 107 stores the HV code storage area 112. The protection memory 107 is write-protected in the normal mode.

本実施の形態では、HVコード格納領域112が、HV保護領域内に備えた保護メモリ107内に設けられている。そして、HVコード格納領域112は、後述する第2HV領域保護回路106により、動作モードがHVモード以外の時には書込みが禁止されている。これにより、ゲストOSからHVコードに対する修正を抑止することができる。なお、本実施の形態では、HVコード格納領域112をHV保護領域内部に設けたが、HV保護領域内部に制限するものではなく、ゲストOSからの修正を抑止できるのであればどこに設けても良く、例えばメモリ150内に設けても良い(ただし、メモリ150内に設けた場合、動作モード管理回路102は通信路6に接続する必要がある)。   In the present embodiment, the HV code storage area 112 is provided in the protection memory 107 provided in the HV protection area. The HV code storage area 112 is prohibited from being written by the second HV area protection circuit 106 described later when the operation mode is other than the HV mode. Thereby, the modification to the HV code from the guest OS can be suppressed. In this embodiment, the HV code storage area 112 is provided inside the HV protection area. However, the HV code storage area 112 is not limited to the inside of the HV protection area, and may be provided anywhere as long as the modification from the guest OS can be suppressed. For example, it may be provided in the memory 150 (however, when provided in the memory 150, the operation mode management circuit 102 needs to be connected to the communication path 6).

本実施の形態では、後述する第2HV領域保護回路106により保護されることとするが、他の実施例としてはプロセッサ101から書換え不可能なROM(read only memory)上にHVコード格納領域112を設けても良い。   In this embodiment, protection is performed by a second HV area protection circuit 106 to be described later. In another embodiment, the HV code storage area 112 is set on a ROM (read only memory) that cannot be rewritten by the processor 101. It may be provided.

さらに、第2HV領域保護回路106は、HVコード格納領域112に対する書込みを禁止するだけではなく、HVコードのエントリ部を除いたHVコード本体のアドレスへの操作を全て禁止するように制御を行ってもよい。第2HV領域保護回路106がこのように制御を行うことで、通常モードにおいてHVコード本体の読み出しを抑止することも可能となる。これにより、HVコードの処理内容をゲストOSから隠蔽することができ、安全性をいっそう向上させることもできる。   Further, the second HV area protection circuit 106 not only prohibits writing to the HV code storage area 112 but also controls to prohibit all operations on the address of the HV code main body excluding the entry part of the HV code. Also good. When the second HV area protection circuit 106 performs the control in this way, it is possible to suppress reading of the HV code main body in the normal mode. Thereby, the processing content of the HV code can be concealed from the guest OS, and the safety can be further improved.

次に、HVコード格納領域112に格納されたハイパーバイザと、第1のゲストOS格納領域151に格納された第1のゲストOSと、第2のゲストOS格納領域152に格納された第2のゲストOSと、第3のゲストOS格納領域153に格納された第3のゲストOSと、について説明する。   Next, the hypervisor stored in the HV code storage area 112, the first guest OS stored in the first guest OS storage area 151, and the second guest OS stored in the second guest OS storage area 152 The guest OS and the third guest OS stored in the third guest OS storage area 153 will be described.

図5に示すように、本実施の形態にかかるシステムLSI100では、ハードウェア上にソフトウェアの最下層としてハイパーバイザ504が配置されている。さらに、そのハイパーバイザ504の上に第1のゲストOS501と、第2のゲストOS502と、第3のゲストOS503とが配置された構成となっている。なお、図5では説明を容易にするために、ハードウェアの構成としてメモリ150内部の第1メモリ領域154と、第2メモリ領域155と、第3メモリ領域156と、HV保護領域111のメモリアクセス制御部103及びデバイスアクセス制御部105内に格納された制御情報とを示したが、これら以外の構成に対しても、同様の制御が行われるものとする。   As shown in FIG. 5, in the system LSI 100 according to the present embodiment, a hypervisor 504 is arranged on the hardware as the lowest layer of software. Further, the first guest OS 501, the second guest OS 502, and the third guest OS 503 are arranged on the hypervisor 504. In FIG. 5, for ease of explanation, the memory access of the first memory area 154, the second memory area 155, the third memory area 156, and the HV protection area 111 inside the memory 150 as a hardware configuration. Although the control information stored in the control unit 103 and the device access control unit 105 is shown, it is assumed that the same control is performed for other configurations.

そして、ハイパーバイザは、これらゲストOSの切り替え機能を提供する。システムLSI100では、ゲストOSの切替え時に、任意のゲストOSからハイパーバイザに処理を戻してから、現在のゲストOSの状態の保存、及び次のゲストOSの状態の復帰を行う。   The hypervisor provides a guest OS switching function. In the system LSI 100, when switching the guest OS, the process is returned from any guest OS to the hypervisor, and then the current guest OS state is saved and the next guest OS state is restored.

また、ゲストOSからハイパーバイザに処理が移ったときに、動作モードがHVモードとなる。この時、ハイパーバイザは、メモリアクセス制御部103及びデバイスアクセス制御部105が制御を行うときに参照する制御情報を更新することができる。そこで、ハイパーバイザは、次のゲストOSに対して割り当てられたメモリ及びデバイスのみアクセスできるように制御情報を更新する。このように、HVモードで動作しているハイパーバイザは、HV保護領域に含まれる全てのハードウェア(アクセス先)にアクセスすることができる。   Further, when the processing is transferred from the guest OS to the hypervisor, the operation mode becomes the HV mode. At this time, the hypervisor can update the control information referred to when the memory access control unit 103 and the device access control unit 105 perform control. Therefore, the hypervisor updates the control information so that only the memory and device assigned to the next guest OS can be accessed. In this way, the hypervisor operating in the HV mode can access all hardware (access destination) included in the HV protection area.

そして、ハイパーバイザから次のゲストOSに処理が移った段階で、動作モードが通常モードになる。この通常モードでは、制御情報に対して更新を行うことができない。これにより、後述するメモリアクセス制御部103は、更新された制御情報に従って、第1のゲストOS501に対して第1メモリ領域154のみアクセスを開放し、第2メモリ領域155及び第3メモリ領域156に対してアクセスを禁止することができる。これにより、本実施の形態にかかるシステムLSI100では、不正なゲストOSが、他のゲストOSに割り当てられたメモリやデバイスにアクセスすることを抑止することができる。本実施の形態にかかるシステムLSI100のソフトウェア構成では、このように複数のゲストOSを互いに隔離して動作させることとする。   Then, the operation mode becomes the normal mode when the processing is transferred from the hypervisor to the next guest OS. In this normal mode, the control information cannot be updated. Accordingly, the memory access control unit 103 described later releases only the first memory area 154 to the first guest OS 501 in accordance with the updated control information, and the second memory area 155 and the third memory area 156 are opened. On the other hand, access can be prohibited. Thereby, in the system LSI 100 according to the present embodiment, an unauthorized guest OS can be prevented from accessing a memory or a device assigned to another guest OS. In the software configuration of the system LSI 100 according to the present embodiment, a plurality of guest OSs are operated separately from each other as described above.

図1に戻り、第2HV領域保護回路106は、保護メモリ107とプロセッサ101との間に配置され、保護メモリ107を保護するための処理を行う。本実施の形態では、プロセッサ101と第2HV領域保護回路106とを第1通信路で接続し、第2HV領域保護回路106と保護メモリ107とを第3通信路で接続する。そして、第2HV領域保護回路106は、動作モード管理回路102から動作モードを示すモード情報信号が入力される。   Returning to FIG. 1, the second HV area protection circuit 106 is disposed between the protection memory 107 and the processor 101, and performs a process for protecting the protection memory 107. In the present embodiment, the processor 101 and the second HV area protection circuit 106 are connected by a first communication path, and the second HV area protection circuit 106 and the protection memory 107 are connected by a third communication path. The second HV area protection circuit 106 receives a mode information signal indicating the operation mode from the operation mode management circuit 102.

第2HV領域保護回路106は、第2制御部132を備え、第1通信路を介してプロセッサ101からのアクセス要求を受け付ける。そして、第2HV領域保護回路106は、動作モード管理回路102から入力されたモード情報信号がHVモードを示す値の場合、受け付けたアクセス要求を保護メモリ107に、第3通信路を介して出力する。   The second HV area protection circuit 106 includes a second control unit 132 and accepts an access request from the processor 101 via the first communication path. Then, when the mode information signal input from the operation mode management circuit 102 is a value indicating the HV mode, the second HV area protection circuit 106 outputs the received access request to the protection memory 107 via the third communication path. .

そして、第2制御部132は、動作モードがHVモードである旨の入力された場合に、保護メモリ107に対してアクセス要求を許可する制御を行う。また動作モードが通常モードである旨の入力がされた場合に、保護メモリ107に対してアクセス要求を禁止する制御を行う。   Then, the second control unit 132 performs control to permit an access request to the protection memory 107 when an input indicating that the operation mode is the HV mode is input. In addition, when an input indicating that the operation mode is the normal mode is input, control for prohibiting the access request to the protection memory 107 is performed.

これにより、第2HV領域保護回路106は、入力されたモード情報信号がHVモード以外を示す値の場合、受け付けたアクセス要求を保護メモリ107に出力することを抑止される。この保護メモリ107に対するアクセスに対する制限の例としては、保護メモリ107のアドレスの一部に対してアクセスを禁止する例や、書き込みのみ禁止する例等がある。また、これらの制限を組み合わせてもよい。このような制限は、保護メモリ107の一部のみ通常モード時のアクセスを制限する場合や、一部の操作を禁止する(書込みのみ禁止等)場合に有効である。   Thus, the second HV area protection circuit 106 is inhibited from outputting the accepted access request to the protection memory 107 when the input mode information signal is a value indicating a mode other than the HV mode. Examples of restrictions on access to the protection memory 107 include an example of prohibiting access to a part of the address of the protection memory 107 and an example of prohibiting only writing. Moreover, you may combine these restrictions. Such a restriction is effective when only a part of the protection memory 107 is restricted to access in the normal mode or when a part of the operation is prohibited (for example, only writing is prohibited).

また、第2HV領域保護回路106は、HVコードの隠蔽を行う場合には、HVコード格納領域112のうちHVコードのエントリ部に対応するアドレスのみ常に読み出し可能にしておく。そして、HVコードの本体に対応するアドレスは、HVモードの時のみ読み出し可能にする。また、HVコード実行時に動作モードをHVモードに変更する手順については後述する。このような処理を行うことで、安全性をさらに向上させることができる。   Further, the second HV area protection circuit 106 always allows only the address corresponding to the entry part of the HV code in the HV code storage area 112 to be concealed when the HV code is concealed. The address corresponding to the main body of the HV code is made readable only in the HV mode. A procedure for changing the operation mode to the HV mode when the HV code is executed will be described later. By performing such processing, safety can be further improved.

また、本実施の形態では、保護メモリ107と第2HV領域保護回路106とが別構成となる例について説明したが、これらの機能を1つの構成としてシステムLSI100に配置しても良い。   In the present embodiment, the example in which the protection memory 107 and the second HV area protection circuit 106 have different configurations has been described. However, these functions may be arranged in the system LSI 100 as one configuration.

第1HV領域保護回路104は、第1制御部131を備え、第1通信路を介してプロセッサ101からのアクセス要求を受け付ける。そして、第1HV領域保護回路104は、メモリアクセス制御部103及びデバイスアクセス制御部105とを第2通信路で接続する。また、第1HV領域保護回路104は、動作モード管理回路102からモード情報信号が入力される。   The first HV area protection circuit 104 includes a first control unit 131 and accepts an access request from the processor 101 via the first communication path. Then, the first HV area protection circuit 104 connects the memory access control unit 103 and the device access control unit 105 via the second communication path. The first HV area protection circuit 104 receives a mode information signal from the operation mode management circuit 102.

そして、メモリアクセス制御部103とメモリ150とを第4通信路で接続し、デバイス160とデバイスアクセス制御部105とを第5通信路で接続する。   Then, the memory access control unit 103 and the memory 150 are connected via a fourth communication path, and the device 160 and the device access control unit 105 are connected via a fifth communication path.

メモリアクセス制御部103は、メモリ150に対するアクセスを制御する。また、本実施の形態にかかるシステムLSI100では、プロセッサ101とメモリアクセス制御部103を接続する通信路として第6通信路を備え、プロセッサ101からメモリアクセス制御部103の制御情報にアクセスするための通信路として第1通信路及び第2通信路を用意した。これにより、メモリ150へのアクセス要求は、第6通信路を介して出力される。また、デバイスアクセス制御部105についても同様の通信路を備えることにした。   The memory access control unit 103 controls access to the memory 150. Further, the system LSI 100 according to the present embodiment includes a sixth communication path as a communication path connecting the processor 101 and the memory access control unit 103, and communication for accessing the control information of the memory access control unit 103 from the processor 101. A first communication path and a second communication path were prepared as paths. Thereby, the access request to the memory 150 is output via the sixth communication path. The device access control unit 105 is also provided with a similar communication path.

また、メモリアクセス制御部103は、プロセッサ101から第1通信路及び第1HV領域保護回路104を介して、制御情報の所定のアドレスに対するアクセス(少なくとも書込み、あるいは書込み/読出しの両方)を受け付ける。本実施の形態にかかるメモリアクセス制御部103では、保護対象となるのはこの制御情報とする。   In addition, the memory access control unit 103 receives access (at least for writing or both writing / reading) to a predetermined address of the control information from the processor 101 via the first communication path and the first HV area protection circuit 104. In the memory access control unit 103 according to the present embodiment, it is this control information that is to be protected.

メモリアクセス制御部103は、プロセッサ101から第6通信路を介して伝送されたメモリ150へのアクセス要求を、第4通信路を介してメモリ150に伝送する。このとき、メモリアクセス制御部103は、予め設定された制御情報に従い、メモリ150に伝送するアクセス要求に制限を加える。   The memory access control unit 103 transmits the access request to the memory 150 transmitted from the processor 101 via the sixth communication path to the memory 150 via the fourth communication path. At this time, the memory access control unit 103 limits the access request transmitted to the memory 150 in accordance with preset control information.

また、メモリアクセス制御部103に設定される制御情報には様々な形態で実現できる。例えば、<開始アドレス,終了アドレス>の組を複数設定する。メモリへのアクセス要求のアドレスが、それらの組が表すアドレスの範囲内であれば、第4通信路へアクセス要求を伝える。そして、このようなアドレスの組をHVモードの場合に限り、編集することを可能とする。   The control information set in the memory access control unit 103 can be realized in various forms. For example, a plurality of sets of <start address, end address> are set. If the address of the access request to the memory is within the range of addresses represented by those groups, the access request is transmitted to the fourth communication path. It is possible to edit such a set of addresses only in the HV mode.

メモリアクセス制御部103は、第1HV領域保護回路104にHVモードを示すモード情報信号が入力されている場合に、制御情報の書込み/読出しに割り当てられたアドレスに対するアクセスを受け付ける。そして、メモリアクセス制御部103は、第1HV領域保護回路104にHVモード以外のモードを示すモード情報信号が入力されている場合に、制御情報の書込み/読出しに割り当てられたアドレスに対するアクセスを受け付けない。   When the mode information signal indicating the HV mode is input to the first HV area protection circuit 104, the memory access control unit 103 accepts access to an address assigned for writing / reading control information. The memory access control unit 103 does not accept an access to an address assigned for writing / reading control information when a mode information signal indicating a mode other than the HV mode is input to the first HV area protection circuit 104. .

また、本実施の形態では、プロセッサ101とメモリアクセス制御部103を接続する経路として、第6通信路と、プロセッサ101から第1通信路、第1HV領域保護回路104及び第2通信路を経由する通信路との2つの経路を備えている。しかしながら、本実施の形態は、このような複数の経路を備えているものに制限するものではなく、例えばプロセッサ101から第1通信路、第1HV領域保護回路104及び第2通信路を経由する通信路のみとしてもよい。   Further, in the present embodiment, as a path for connecting the processor 101 and the memory access control unit 103, the sixth communication path, and the processor 101 passes through the first communication path, the first HV area protection circuit 104, and the second communication path. It has two routes, a communication channel. However, the present embodiment is not limited to the one having such a plurality of paths. For example, communication from the processor 101 via the first communication path, the first HV area protection circuit 104, and the second communication path. Only the road may be used.

メモリアクセス制御部103は、このようにHVモードに限り制御情報の書き込み/読み出しが行われることで、ゲストOSを動作を切り替える際に、ハイパーバイザが当該にメモリアクセス制御部103の制御情報を切り替え先のゲストOSに適した設定を行うことで、次に動作するゲストOSのデータのみアクセス可能にすることができる。   The memory access control unit 103 thus writes / reads control information only in the HV mode, so that when the guest OS is switched in operation, the hypervisor switches the control information of the memory access control unit 103 accordingly. By performing settings suitable for the previous guest OS, only the data of the guest OS that operates next can be accessed.

そして、第1制御部131は、動作モードがHVモードである旨の入力された場合に、メモリアクセス制御部103及びデバイスアクセス制御部105が有する制御情報に対するアクセスを開放する制御を行う。また動作モードが通常モードである旨の入力がされた場合に、メモリアクセス制御部103及びデバイスアクセス制御部105が有する制御情報に対するアクセスを禁止する制御を行う。   Then, the first control unit 131 performs control to release access to the control information included in the memory access control unit 103 and the device access control unit 105 when an input indicating that the operation mode is the HV mode is input. Further, when an input indicating that the operation mode is the normal mode is input, control for prohibiting access to the control information of the memory access control unit 103 and the device access control unit 105 is performed.

そして、通信路をこのような構成としたことで、第1HV領域保護回路104は、メモリアクセス制御部103及びデバイスアクセス制御部105の制御情報の書込み/読出し以外のアクセス要求に対する処理を行わなくてよい。   Since the communication path has such a configuration, the first HV area protection circuit 104 does not perform any processing for access requests other than writing / reading control information of the memory access control unit 103 and the device access control unit 105. Good.

また、第1HV領域保護回路104は、プロセッサ101からメモリアクセス制御部103の制御情報の書込み/読出しに割り当てられたアドレスへのアクセス要求を受け付けた時、動作モード管理回路102から入力されるモード情報信号がHVモードを表す値の場合、当該アクセス要求を、第2通信路を介してメモリアクセス制御部103に出力する。また、第1HV領域保護回路104は、動作モード管理回路102から入力されるモード情報信号がHVモード以外を表す値の場合、当該アクセス要求を、メモリアクセス制御部103に出力するのを抑止する。   The first HV area protection circuit 104 receives the mode information input from the operation mode management circuit 102 when receiving an access request from the processor 101 to the address assigned to write / read the control information of the memory access control unit 103. When the signal is a value representing the HV mode, the access request is output to the memory access control unit 103 via the second communication path. Further, the first HV area protection circuit 104 inhibits the access request from being output to the memory access control unit 103 when the mode information signal input from the operation mode management circuit 102 is a value indicating a mode other than the HV mode.

なお、本実施の形態では、メモリアクセス制御部103の制御情報に対するアクセス要求を第1通信路及び第2通信路を介してデータの送受信を行い、制御情報以外のメモリアクセス制御部103に対するアクセス要求を第6通信路を介してデータの送受信を行うこととした。しかしながら、本実施の形態とは異なるが、これら別々となっている通信路を、第1HV領域保護回路104を介した1つの通信路で構成しても良い。この場合、メモリ150に対するアクセス要求も第1HV領域保護回路104を介してアクセス要求が行われることになる。また、第1HV領域保護回路104は、メモリアクセス制御部103の制御情報に対する書き込み/読み込みは上述したような制御を行うが、これら以外のアクセス要求(例えば、メモリ150に対するアクセス要求)については全てメモリアクセス制御部103に出力する。   In this embodiment, the access request for the control information of the memory access control unit 103 is transmitted / received via the first communication path and the second communication path, and the access request for the memory access control unit 103 other than the control information is transmitted. Is to transmit and receive data via the sixth communication path. However, although different from the present embodiment, these separate communication paths may be configured as one communication path via the first HV area protection circuit 104. In this case, an access request for the memory 150 is also made via the first HV area protection circuit 104. In addition, the first HV area protection circuit 104 performs the above-described control for writing / reading the control information of the memory access control unit 103, but all other access requests (for example, access requests for the memory 150) are stored in the memory. Output to the access control unit 103.

デバイスアクセス制御部105は、デバイス160に対するアクセスを制御する。また、デバイスアクセス制御部105は、上記のメモリアクセス制御部103と同様に第1HV領域保護回路104を介して、デバイスアクセス制御部105が有する制御情報に対するアクセス要求を受け付ける。なお、デバイスアクセス制御部105で行われる処理は、メモリアクセス制御部103と同様なので説明を省略する。   The device access control unit 105 controls access to the device 160. Further, the device access control unit 105 receives an access request for control information included in the device access control unit 105 via the first HV area protection circuit 104 in the same manner as the memory access control unit 103 described above. Note that the processing performed by the device access control unit 105 is the same as that of the memory access control unit 103, and thus description thereof is omitted.

また、デバイスアクセス制御部105に設定される制御情報には様々な形態で実現できる。例えば、<開始アドレス,終了アドレス>の組を複数設定する。デバイスへのアクセス要求のアドレスが、それらの組が表すアドレスの範囲内であれば、第5通信路へアクセス要求を伝える。そして、このようなアドレスの組をHVモードの場合に限り、編集することを可能とする。   The control information set in the device access control unit 105 can be realized in various forms. For example, a plurality of sets of <start address, end address> are set. If the address of the access request to the device is within the range of addresses represented by the set, the access request is transmitted to the fifth communication path. It is possible to edit such a set of addresses only in the HV mode.

また制御情報の別の形態としては、複数のデバイスを接続されている場合、各デバイスに対応する<開始アドレス,終了アドレス>の組をあらかじめ設定しておき、さらに、当該アドレスに対してアクセスを開放するか否かを1ビットのビットマスクとして設定してもよい。この形態では、デバイスへのアクセス要求のアドレスが、ビットマスクが‘1’に対応するデバイスに割り当てられたアドレスの範囲内であれば、アクセス要求を出力する。   As another form of control information, when a plurality of devices are connected, a set of <start address, end address> corresponding to each device is set in advance, and access to the address is further performed. Whether or not to open may be set as a 1-bit bit mask. In this mode, if the address of the access request to the device is within the range of the address assigned to the device corresponding to the bit mask “1”, the access request is output.

本実施の形態では、例えばゲストOSを切り替える際に、ハイパーバイザがデバイスアクセス制御部105の制御情報の書き換えを行うことで、動作するゲストOSに割り当てられたデバイスにのみアクセスを開放することが可能となる。   In the present embodiment, for example, when the guest OS is switched, the hypervisor rewrites the control information of the device access control unit 105 so that access can be released only to the device assigned to the operating guest OS. It becomes.

次に動作モード管理回路102の処理について説明する。動作モード管理回路102が行う動作は、大きく分けると以下の2つの動作になる。   Next, processing of the operation mode management circuit 102 will be described. The operation performed by the operation mode management circuit 102 is roughly divided into the following two operations.

まず第1の動作として、動作モード管理回路102は、動作モードが通常モードの時、HVモードエントリのチェックを行い、所定の条件が満たされた時点で動作モードをHVモードに遷移させる。第2の動作として、動作モード管理回路102は、動作モードがHVモードの時、HVモード脱出のチェックを行い、所定の条件が満たされた時点で動作モードを通常モードへ遷移させる。   First, as a first operation, the operation mode management circuit 102 checks the HV mode entry when the operation mode is the normal mode, and transitions the operation mode to the HV mode when a predetermined condition is satisfied. As a second operation, when the operation mode is the HV mode, the operation mode management circuit 102 checks for escape from the HV mode, and transitions the operation mode to the normal mode when a predetermined condition is satisfied.

図6に示すように、まず、動作モード管理回路102は、システムLSI100全体の起動時に初期化を行う(ステップS611)。ここでは動作モードを通常モードにする。   As shown in FIG. 6, first, the operation mode management circuit 102 performs initialization when the entire system LSI 100 is activated (step S611). Here, the operation mode is set to the normal mode.

その後、動作モード管理回路102のフェッチ検出部121等が、第1通信路を監視して、HVコードのエントリ部が適切に行われたことを確認する(ステップS612)。また、ステップS612の処理は、所定時間毎にエントリ部が適切に行われたと判断されるまで繰り返し行われる。なお、詳細な処理手順については後述する。   Thereafter, the fetch detection unit 121 or the like of the operation mode management circuit 102 monitors the first communication path and confirms that the entry part of the HV code has been appropriately performed (step S612). Further, the process of step S612 is repeatedly performed until it is determined that the entry unit is appropriately performed every predetermined time. The detailed processing procedure will be described later.

次に、モード切替部127が、動作モードをHVモードに切り替える処理を行う(ステップS613)。そして、動作モード管理回路102は、動作モードがHVモードであることを示すモード情報信号を、第1HV領域保護回路104及び第2HV領域保護回路106に対して出力する(ステップS614)。なお、本フローチャートでは説明を容易にするため、このタイミングでモード情報信号を出力しているが、実際には、動作モード管理回路102は所定間隔毎に常にモード情報信号を出力している。なお、動作モード管理回路102が、モード情報信号を常に信号線に出力していてもよい。いずれにしても、動作モード管理回路102が、モード変更のタイミングを第1HV領域保護回路104及び第2HV領域保護回路106に伝えることが可能である。以上までが、上記第1の動作となる。   Next, the mode switching unit 127 performs processing for switching the operation mode to the HV mode (step S613). Then, the operation mode management circuit 102 outputs a mode information signal indicating that the operation mode is the HV mode to the first HV region protection circuit 104 and the second HV region protection circuit 106 (step S614). In this flowchart, for ease of explanation, the mode information signal is output at this timing, but actually, the operation mode management circuit 102 always outputs the mode information signal at predetermined intervals. Note that the operation mode management circuit 102 may always output the mode information signal to the signal line. In any case, the operation mode management circuit 102 can transmit the mode change timing to the first HV region protection circuit 104 and the second HV region protection circuit 106. The above is the first operation.

そして、第1HV領域保護回路104は、動作モード管理回路102からモード情報信号の入力を受け付け、動作モードがHVモードに変更されたことを認識する(ステップS601)。これにより、第1制御部131は、メモリアクセス制御部103及びデバイスアクセス制御部105が有する制御情報に対するアクセスを開放する制御を行う(ステップS602)。   Then, the first HV area protection circuit 104 receives an input of the mode information signal from the operation mode management circuit 102 and recognizes that the operation mode has been changed to the HV mode (step S601). Thereby, the first control unit 131 performs control to release access to the control information included in the memory access control unit 103 and the device access control unit 105 (step S602).

同様に、第2HV領域保護回路106は、動作モード管理回路102からモード情報信号の入力を受け付けた場合、動作モードがHVモードに変更されたことを認識する(ステップS621)。これにより、第2制御部132は、保護メモリ107に対するアクセスを開放する制御を行う(ステップS622)。   Similarly, when receiving the input of the mode information signal from the operation mode management circuit 102, the second HV area protection circuit 106 recognizes that the operation mode has been changed to the HV mode (step S621). Thereby, the second control unit 132 performs control to release access to the protection memory 107 (step S622).

その後、動作モード管理回路102のフェッチ検出部121が、第1通信路を監視して、HVコードの脱出部が適切に行われたことを確認する(ステップS615)。なお、ステップS615の処理は、所定時間毎に脱出部が適切に行われたと判断されるまで繰り返し行われる。なお、詳細な処理手順については後述する。   Thereafter, the fetch detection unit 121 of the operation mode management circuit 102 monitors the first communication path and confirms that the HV code escape unit has been appropriately performed (step S615). Note that the process of step S615 is repeatedly performed until it is determined that the escape unit has been appropriately performed every predetermined time. The detailed processing procedure will be described later.

次に、モード切替部127が、動作モードを通常モードに切り替える処理を行う(ステップS616)。つまり、プロセッサ101上では、ステップS616の処理において他のソフトウェアのために通常モードに切り替えられ、ゲストOS等の他のソフトウェアが実行されることになる。   Next, the mode switching unit 127 performs a process of switching the operation mode to the normal mode (step S616). That is, on the processor 101, the normal mode is switched for other software in the process of step S616, and other software such as the guest OS is executed.

このため、動作モード管理回路102は、動作モードが通常モードであることを示すモード情報信号を、第1HV領域保護回路104及び第2HV領域保護回路106に対して出力する(ステップS617)。以上までが、上記第2の動作となる。その後、他のソフトウェアが実行されているときに、再び動作モード管理回路102のフェッチ検出部121等が、第1通信路を監視して、HVコードのエントリ部が適切に行われたか否かを確認することになる(ステップS612)。   Therefore, the operation mode management circuit 102 outputs a mode information signal indicating that the operation mode is the normal mode to the first HV region protection circuit 104 and the second HV region protection circuit 106 (step S617). The above is the second operation. Thereafter, when other software is being executed, the fetch detection unit 121 or the like of the operation mode management circuit 102 again monitors the first communication path to determine whether or not the HV code entry unit has been appropriately performed. It will be confirmed (step S612).

また、第1HV領域保護回路104は、動作モード管理回路102からモード情報信号の入力を受け付けた場合、動作モードが通常モードに変更されたことを認識する(ステップS603)。これにより、第1制御部131は、直ちにメモリアクセス制御部103及びデバイスアクセス制御部105が有する制御情報に対するアクセスを禁止する制御を行う(ステップS604)。   Further, when receiving the input of the mode information signal from the operation mode management circuit 102, the first HV area protection circuit 104 recognizes that the operation mode has been changed to the normal mode (step S603). Thereby, the first control unit 131 immediately performs control to prohibit access to the control information included in the memory access control unit 103 and the device access control unit 105 (step S604).

同様に、第2HV領域保護回路106は、動作モード管理回路102からモード情報信号の入力を受け付けた場合、動作モードが通常モードに変更されたことを認識する(ステップS623)。これにより、第2制御部132は、直ちに保護メモリ107に対するアクセスを禁止する制御を行う(ステップS624)。   Similarly, when receiving the input of the mode information signal from the operation mode management circuit 102, the second HV area protection circuit 106 recognizes that the operation mode has been changed to the normal mode (step S623). As a result, the second control unit 132 immediately controls to prohibit access to the protection memory 107 (step S624).

本実施の形態では、上述した処理を行うことで、動作モードに従って、HV保護領域に格納された構成を適切に保護することができる。   In the present embodiment, by performing the above-described processing, it is possible to appropriately protect the configuration stored in the HV protection area according to the operation mode.

次に、図6のステップS612で示したHVコードのエントリ部が適切に実行されたことの確認手順について説明する。HVコードのエントリ部のチェック手法は、HVコードのエントリ部の内容とシステムLSIの構成との組合せに応じて複数の形態が存在する。本実施の形態では複数存在する形態のうち一形態について説明する。なお、他の形態については、後述する実施形態で説明する。   Next, a procedure for confirming that the entry portion of the HV code shown in step S612 in FIG. 6 has been executed properly will be described. There are a plurality of methods for checking the entry portion of the HV code depending on the combination of the contents of the entry portion of the HV code and the configuration of the system LSI. In the present embodiment, one of a plurality of forms will be described. In addition, about another form, it demonstrates in embodiment mentioned later.

本実施の形態にかかるHVコードのエントリ部が適切に実行されたことを確認する手法としては、所定時間内にエントリ部が実行されたか否かを判断する手法とする。また、HVコードのエントリ部が実行された際に、プロセッサ101が割込み禁止であることを確認している。そこで、本実施の形態では、所定時間内にエントリ部が実行され、且つエントリ部の実行で割り込み禁止であることが確認できた場合に、HVモードに切り替えることとする。   As a method for confirming that the entry portion of the HV code according to the present embodiment has been properly executed, a method for determining whether or not the entry portion has been executed within a predetermined time is used. In addition, when the entry portion of the HV code is executed, it is confirmed that the processor 101 is prohibited from interrupting. Therefore, in this embodiment, when the entry part is executed within a predetermined time and it is confirmed that the interruption is prohibited by the execution of the entry part, the mode is switched to the HV mode.

そして、HVコードのエントリ部が実行される時、プロセッサ101から第1通信路に以下の順序で信号が伝送される。   When the entry portion of the HV code is executed, signals are transmitted from the processor 101 to the first communication path in the following order.

まず、プロセッサ101から、HVコード格納領域112内のアドレス‘HVEntry’の命令1のアドレスに対して、命令フェッチの要求を伝送する。そして、HVコード格納領域112から命令1が伝送される。その後、プロセッサ101から命令2のアドレスに対して命令フェッチの要求が伝送される。そして、HVコード格納領域112から命令2が伝送される。なお、エントリ部にn個命令がある場合、この命令フェッチ要求及び命令の伝送がn回繰り返されることになる。   First, an instruction fetch request is transmitted from the processor 101 to the address of the instruction 1 at the address “HVEntry” in the HV code storage area 112. Then, the instruction 1 is transmitted from the HV code storage area 112. Thereafter, an instruction fetch request is transmitted from the processor 101 to the address of the instruction 2. Then, the instruction 2 is transmitted from the HV code storage area 112. When there are n instructions in the entry part, this instruction fetch request and instruction transmission are repeated n times.

本実施の形態にかかる動作モード管理回路102は、命令1のアドレスに対する命令フェッチの要求を検出してから、命令2が実行されるまでの実行時間を計測し、当該実行時間が不正ユーザコードに割り込まれることなく連続して実行された場合の時間と等しい(または小さい)か否かを確認する。そして、動作モード管理回路102は、実行時間が等しい(または小さい)場合に、HVコードのエントリ部が不可分に実行されたことを保証する。さらに、命令2の実行内容を確認することで、割込み禁止状態であることを保証する。これらが保証されたことで、動作モード管理回路102が動作モードをHVモードに遷移させる条件が満たされたことになる。   The operation mode management circuit 102 according to the present embodiment measures the execution time from the detection of the instruction fetch request for the address of the instruction 1 to the execution of the instruction 2, and the execution time is converted into an illegal user code. Check if it is equal to (or smaller than) the time when executed continuously without interruption. Then, the operation mode management circuit 102 guarantees that the entry portion of the HV code is inseparably executed when the execution times are equal (or small). Further, by confirming the execution contents of the instruction 2, it is guaranteed that the interrupt is prohibited. Since these are guaranteed, the condition for the operation mode management circuit 102 to transition the operation mode to the HV mode is satisfied.

図7に示すように、まず、フェッチ検出部121は、第1通信路を監視して、プロセッサ101から伝送されてくる命令フェッチの要求を検出したか否か判断する(ステップS701)。なお、当該処理は検出するまで繰り返される。   As shown in FIG. 7, first, the fetch detection unit 121 monitors the first communication path to determine whether or not an instruction fetch request transmitted from the processor 101 has been detected (step S701). This process is repeated until it is detected.

次に、フェッチ判断部122は、フェッチ検出部121が命令フェッチの要求を検出した場合(ステップS701:Yes)、当該命令フェッチの要求で指定されたアドレスがエントリ部の命令1のアドレスであるか否か判断する(ステップS702)。そして、フェッチ判断部122が、異なると判断した場合(ステップS702:No)、再びフェッチ検出部121による命令フェッチの検出を行う(ステップS701)。   Next, when the fetch detection unit 121 detects an instruction fetch request (step S701: Yes), the fetch determination unit 122 determines whether the address specified in the instruction fetch request is the address of the instruction 1 in the entry unit. It is determined whether or not (step S702). If the fetch determination unit 122 determines that they are different (step S702: No), the fetch detection unit 121 detects the instruction fetch again (step S701).

そして、フェッチ検出部121は、アドレスが命令1と一致すると判断した場合(ステップS702:Yes)、時間計測部123が時間の計測を開始する(ステップS703)。   When the fetch detection unit 121 determines that the address matches the instruction 1 (step S702: Yes), the time measurement unit 123 starts measuring time (step S703).

次に、時間判断部125が、時間の計測を開始してから所定時間Tを経過したか否か判断する(ステップS704)。なお、所定時間Tは、命令1のフェッチを検出してから命令2が実行されるまでに要するものとして予め設定された時間とする。   Next, the time determination unit 125 determines whether or not a predetermined time T has elapsed since the start of time measurement (step S704). The predetermined time T is a time set in advance as a time required from the detection of the fetch of the instruction 1 to the execution of the instruction 2.

また、時間判断部125により所定時間Tを経過したと判断された場合(ステップS704:No)、時間計測部123は時間計測を終了し(ステップS709)、再びフェッチ検出部121による命令フェッチの検出を行う(ステップS701)。   If the time determination unit 125 determines that the predetermined time T has elapsed (step S704: No), the time measurement unit 123 ends the time measurement (step S709), and the fetch detection unit 121 detects the instruction fetch again. (Step S701).

そして、時間判断部125により所定時間Tを経過していないと判断された場合(ステップS704:Yes)、命令検出部124は、第1通信路を監視して、プロセッサ101からのデータ書き込み要求を検出したか否かを判断する(ステップS705)。検出していないと判断した場合(ステップS705:No)、時間判断部125が所定時間Tを経過したか否かの判断から処理を開始する(ステップS704)。   If the time determination unit 125 determines that the predetermined time T has not elapsed (step S704: Yes), the instruction detection unit 124 monitors the first communication path and issues a data write request from the processor 101. It is determined whether or not it has been detected (step S705). If it is determined that no time has been detected (step S705: No), the time determination unit 125 starts processing from determining whether the predetermined time T has elapsed (step S704).

なお、所定時間Tは、エントリコードが先頭から連続して実行された際の実行時間であることが望ましい。このエントリコード実行時間は、プロセッサ101内部の動作をシミュレートして計算する、又は実際にプロセッサ上でエントリコードを実行させてプロセッサ101の出力信号を計測する等により、あらかじめ調べておく必要がある。ただし、エントリコードの実行時間にある程度の揺れが存在する場合、実行時間の最大値を所定時間Tとして用いる。   The predetermined time T is desirably an execution time when the entry code is continuously executed from the top. This entry code execution time needs to be checked in advance, for example, by simulating the internal operation of the processor 101 or by actually executing the entry code on the processor and measuring the output signal of the processor 101. . However, when there is some fluctuation in the execution time of the entry code, the maximum value of the execution time is used as the predetermined time T.

次に、命令検出部124がデータ書込みの要求を検出した場合(ステップS705:Yes)、時間計測部123が時間計測を終了する(ステップS706)。そして、命令検出部124が当該データ書き込み要求で指定されたアドレスが‘CheckAdr’と一致するか否か判断する(ステップS707)。そして、命令検出部124が、異なると判断した場合(ステップS707:No)、再びフェッチ検出部121による命令フェッチの検出を行う(ステップS701)。   Next, when the instruction detection unit 124 detects a data write request (step S705: Yes), the time measurement unit 123 ends the time measurement (step S706). Then, the instruction detection unit 124 determines whether or not the address specified in the data write request matches “CheckAdr” (step S707). If the instruction detection unit 124 determines that they are different (step S707: No), the fetch detection unit 121 detects the instruction fetch again (step S701).

そして、命令検出部124は、アドレスが‘CheckAdr’と一致すると判断した場合(ステップS707:Yes)、実行判断部126が書込み要求で指定されたデータと割込み禁止を表す‘SR’の値が一致するか否か判断する(ステップS708)。そして、実行判断部126が、異なると判断した場合(ステップS708:No)、再びフェッチ検出部121による命令フェッチの検出を行う(ステップS701)。   If the instruction detection unit 124 determines that the address matches “CheckAdr” (step S707: Yes), the execution determination unit 126 matches the data specified in the write request with the value of “SR” indicating that the interrupt is prohibited. It is determined whether or not to perform (step S708). If the execution determining unit 126 determines that they are different (step S708: No), the fetch detecting unit 121 detects the instruction fetch again (step S701).

次に、実行判断部126は、書込みデータと割込み禁止を表す‘SR’の値が一致すると判断した場合(ステップS707:Yes)、HVコードのエントリ部が適切に実行されたことを確認できたものとする。そして、図6に示したステップS613以降の処理が行われることになる。   Next, when the execution determination unit 126 determines that the write data and the value of 'SR' indicating interrupt inhibition match (step S707: Yes), the execution determination unit 126 was able to confirm that the HV code entry unit was appropriately executed. Shall. And the process after step S613 shown in FIG. 6 will be performed.

なお、‘SR’が割込み禁止/許可のみを表す場合には、単純に書込みデータ全体を比較すれば良い。しかし、一般にはプロセッサ状態を表すレジスタは、割込み状態、アドレス変換モード、特権モードなどの異なる種類の状態をビット単位で表す場合が多い。このような場合、割込み状態に対応するビットのみを比較すれば良い。   When 'SR' indicates only interrupt prohibition / permission, the entire write data may be simply compared. However, in general, a register representing a processor state often represents different types of states such as an interrupt state, an address translation mode, and a privileged mode in units of bits. In such a case, only the bit corresponding to the interrupt state needs to be compared.

次に、図6のステップS615で示したHVモード脱出の検出手順について説明する。ハイパーバイザによる処理が終了したことを検出することで、動作モードをHVモードから切り替えられる。後述する例は、HVモード脱出のチェックの第一の形態として、HVモードで動作すべき処理が終了したことが保証される命令(以降、HVモード脱出命令と呼ぶ)が実行されたことが保証されたときに動作モードを通常モードに切り替えさせる例である。   Next, the detection procedure of HV mode escape shown by step S615 of FIG. 6 is demonstrated. By detecting the completion of processing by the hypervisor, the operation mode can be switched from the HV mode. In the example described later, as a first form of checking for HV mode exit, it is guaranteed that an instruction (hereinafter referred to as an HV mode exit instruction) that guarantees that processing to be operated in the HV mode has ended is executed. This is an example of switching the operation mode to the normal mode when the operation is performed.

HVモードで動作すべき処理が終了したことが保証される命令はHVコードに依存する。このため、当該命令は、HVコードに応じて様々な形態が存在する。例えば、図2で示したHVコードでは、符号203で示されるHVコードの最後の命令‘return’が呼び出された場合、HVコードによる処理が終了する。つまり、プロセッサ101が最後の命令203を呼び出して、実行されるソフトウェアをゲストOSに切り替える場合、これ以降の処理はHVモードで動作させる必要がない。そこで、図2に示すHVコードでは、当該最後の命令203を、HVモード脱出命令として用いる。なお、本実施の形態は、HVモード脱出命令をHVコードの最後の命令に制限するものではない。つまり、HVモードで動作すべき処理が終了したことが保証される命令であれば、HVコードの最後の命令より前の命令でも良い。   The instruction that guarantees that the process to be operated in the HV mode is completed depends on the HV code. Therefore, the instruction has various forms depending on the HV code. For example, in the HV code shown in FIG. 2, when the last instruction “return” of the HV code indicated by reference numeral 203 is called, the processing by the HV code ends. That is, when the processor 101 calls the last instruction 203 to switch the software to be executed to the guest OS, the subsequent processing does not need to be operated in the HV mode. Therefore, in the HV code shown in FIG. 2, the last instruction 203 is used as an HV mode exit instruction. In the present embodiment, the HV mode exit instruction is not limited to the last instruction of the HV code. That is, an instruction prior to the last instruction of the HV code may be used as long as it is guaranteed that the process to be operated in the HV mode is completed.

そして、図2に示すHVモード脱出命令(最後の命令203)が実行される時、まず第1にプロセッサ101は、保護メモリ107のHVモード脱出命令が格納されているアドレス(以下、“HVExit”とする)に対して、命令フェッチの要求を伝送する。次に、保護メモリ107からHVコード格納領域112に格納されたデータ(“HVExit”に格納されている命令)をプロセッサ101に対して伝送する。   When the HV mode exit instruction (last instruction 203) shown in FIG. 2 is executed, first, the processor 101 first stores the address (hereinafter referred to as “HVExit”) of the protected memory 107 in which the HV mode exit instruction is stored. The instruction fetch request is transmitted. Next, the data (instruction stored in “HVExit”) stored in the HV code storage area 112 is transmitted from the protection memory 107 to the processor 101.

そして、本実施の形態では、動作モード管理回路102は、HVモード脱出命令が格納されているアドレスに対するフェッチを検出した場合に、HVモードで動作すべき処理が終了したことを保証されたと判断し、動作モードを通常モードに切り替える。   In this embodiment, when the operation mode management circuit 102 detects fetch for the address where the HV mode exit instruction is stored, the operation mode management circuit 102 determines that the processing to be operated in the HV mode has been guaranteed. The operation mode is switched to the normal mode.

図8に示すように、まず、フェッチ検出部121は、第1通信路を監視して、プロセッサ101から伝送されてくる命令フェッチの要求を検出する(ステップS801)。   As shown in FIG. 8, first, the fetch detection unit 121 monitors the first communication path and detects an instruction fetch request transmitted from the processor 101 (step S801).

次に、フェッチ検出部121は、命令フェッチの要求を検出した場合、フェッチ判断部122は、当該命令フェッチの要求で指定されたアドレスが脱出命令のアドレス(図2の符号203)と一致するか否か判断する(ステップS802)。そして、フェッチ判断部122が、異なると判断した場合(ステップS802:No)、再び命令フェッチの検出を行う(ステップS801)。   Next, when the fetch detection unit 121 detects an instruction fetch request, the fetch determination unit 122 determines whether the address specified in the instruction fetch request matches the address of the escape instruction (reference numeral 203 in FIG. 2). It is determined whether or not (step S802). If the fetch determination unit 122 determines that they are different (step S802: No), the instruction fetch is detected again (step S801).

次に、フェッチ検出部121は、当該命令フェッチの要求で指定されたアドレスが脱出命令のアドレス(図2符号203)と一致すると判断した場合(ステップS802:Yes)、HVモード脱出チェックが完了したものとする。そして、図6に示したステップS616以降の処理が行われることになる。   Next, when the fetch detection unit 121 determines that the address specified in the instruction fetch request matches the address of the escape instruction (reference numeral 203 in FIG. 2) (step S802: Yes), the HV mode escape check is completed. Shall. And the process after step S616 shown in FIG. 6 will be performed.

上述した実施の形態では、システムLSI100のHVコード格納領域911を保護メモリ107内に設け、各ゲストOSの格納領域をメモリ150内に設けた。しかしながら、同一メモリ内にHVコード格納領域と各ゲストOSの格納領域とを設けても良い。この場合、HVコード格納領域は、メモリアクセス制御部等によりアクセスが制限されることになる。   In the embodiment described above, the HV code storage area 911 of the system LSI 100 is provided in the protection memory 107 and the storage area of each guest OS is provided in the memory 150. However, an HV code storage area and a storage area for each guest OS may be provided in the same memory. In this case, access to the HV code storage area is restricted by a memory access control unit or the like.

なお、HV保護領域の制限手法として、本実施の形態以外の制限手法を用いても良い。例えば、HVモード以外の動作モードの場合は、HV保護領域に格納された全てのメモリ及びデバイスの全てのアドレスに対して、全ての操作(読出し/書込み)を禁止してもよい。他の例としては、HV保護領域に格納されたうちアドレスの一部に対してのみアクセスや書き込みを禁止しても良い。また、これらの制限を組み合わせても良い。   Note that a limiting method other than the present embodiment may be used as a method for limiting the HV protection area. For example, in an operation mode other than the HV mode, all operations (read / write) may be prohibited for all addresses of all memories and devices stored in the HV protection area. As another example, access or writing to only a part of the address stored in the HV protection area may be prohibited. Moreover, you may combine these restrictions.

なお、通信路を流れるデータにおいて、命令フェッチとデータ読出しを区別する信号が存在しない場合、通信路と別経路でプロセッサ101が出力する命令フェッチを示す信号を動作モード管理回路に入力する必要がある。これにより、命令フェッチとデータ読み出しを区別することができる。   If there is no signal for distinguishing between instruction fetch and data read in the data flowing through the communication path, it is necessary to input a signal indicating the instruction fetch output by the processor 101 on the path different from the communication path to the operation mode management circuit. . This makes it possible to distinguish between instruction fetch and data read.

本実施の形態にかかるシステムLSI100を用いることで、プロセッサの仮想化サポート機能に依存することなく、HVコードの実行時にのみアクセス可能となる保護領域を確保することができる。この保護領域にメモリやデバイスのアクセス制御情報、ゲストOSの管理情報、HVコード本体といった情報を格納することにより、ゲストOSから不正にこれらの情報を読出し/書込みすることを抑止することができる。このように、確実にゲストOS間の隔離を実現することで、安全性を向上させることができる。   By using the system LSI 100 according to the present embodiment, it is possible to secure a protected area that can be accessed only when executing the HV code without depending on the virtualization support function of the processor. By storing information such as memory and device access control information, guest OS management information, and HV code main body in this protection area, it is possible to prevent unauthorized reading / writing of these information from the guest OS. As described above, it is possible to improve safety by reliably realizing isolation between guest OSes.

また、本実施の形態にかかるシステムLSI100では、HVコードのエントリ部が複数命令で構成されているが、当該エントリ部の実行時に時間を計測することで、エントリ部の複数命令が不可分に行われていることを保証するので、当該エントリ部の実行時に他のコードによる割り込みを防止することができる。これにより、安全性を向上させることができる。   In the system LSI 100 according to the present embodiment, the entry portion of the HV code is composed of a plurality of instructions. However, by measuring the time when the entry portion is executed, the plurality of instructions in the entry portion are inseparably performed. Therefore, it is possible to prevent interruption by another code when executing the entry section. Thereby, safety can be improved.

(第2の実施の形態)
第1の実施の形態にかかるシステムLSI100では、HVコード格納領域112に格納されたHVコードのエントリ部が、割り込み禁止であることを確認するための複数命令で構成された例について説明した。しかしながら、HVコードのエントリ部をこのような命令に制限するものではない。そこで、第2の実施の形態では、システムLSIのHVコード格納領域に、割り込み禁止するための複数命令で構成された例について説明する。
(Second Embodiment)
In the system LSI 100 according to the first embodiment, the example in which the entry portion of the HV code stored in the HV code storage area 112 is configured with a plurality of instructions for confirming that the interrupt is prohibited has been described. However, the entry part of the HV code is not limited to such an instruction. Therefore, in the second embodiment, an example will be described in which the HV code storage area of the system LSI is configured with a plurality of instructions for prohibiting interrupts.

図9は、第2の実施の形態に係るシステムLSI900の構成を示すブロック図である。上述した第1の実施の形態に係るシステムLSI100とは、動作モード管理回路102と処理が異なる動作モード管理回路901を備え、HVコード格納領域112とは格納しているバイナリコードが異なるHVコード格納領域911を保護メモリ107が備えている点のみ異なる。なお、本実施の形態のシステムLSI900の構成で、第1の実施の形態のシステムLSI100と共通な構成については説明を省略する。   FIG. 9 is a block diagram showing a configuration of a system LSI 900 according to the second embodiment. The system LSI 100 according to the first embodiment described above includes an operation mode management circuit 901 that is different in processing from the operation mode management circuit 102, and stores HV code that is different from the stored HV code storage area 112. The only difference is that the protection memory 107 includes the area 911. Note that the description of the configuration of the system LSI 900 of the present embodiment that is common to the system LSI 100 of the first embodiment will be omitted.

まず、HVコード格納領域911は、HVコードを格納している。図10に示すようにHVコードは、エントリ部に命令1“load R0,=割り込み禁止”1001と、命令2“move R0 to SR”1002とを保持し、脱出コードは図2と同様に“return”1003を保持する。このエントリ部では、プロセッサ101の状態を保持する“SR”に割り込み禁止であることを示す値を設定する。つまり、第1の実施の形態にかかるシステムLSI100のようにアドレス“CheckAdr”に対して書き込まれたデータをチェックする必要がない。つまり、本実施の形態にかかるシステムLSI900は命令フェッチの確認を行うだけで、割り込み禁止を保証できる実施の形態である。   First, the HV code storage area 911 stores HV codes. As shown in FIG. 10, the HV code holds the instruction 1 “load R0, = interrupt disabled” 1001 and the instruction 2 “move R0 to SR” 1002 in the entry portion, and the exit code is “return” as in FIG. “1003 is held. In this entry section, a value indicating that interrupts are prohibited is set in “SR” that holds the state of the processor 101. That is, unlike the system LSI 100 according to the first embodiment, there is no need to check the data written to the address “CheckAdr”. In other words, the system LSI 900 according to the present embodiment is an embodiment that can guarantee prohibition of interrupts only by confirming instruction fetch.

また、本実施の形態とは異なるが、HVコードのエントリ部が2個以上の命令で構成されていても良い。図11に示すように、HVコードのエントリ部がn個で構成されている場合等も考えられる。図11で示した例では、状態レジスタ‘SR’の3ビット目が‘1’の場合が書き込み禁止である例とする。このためにn個の命令を行うことで、SRの3ビット目を‘1’を設定している。このようなn個で構成されている場合も途中で他のコードに割り込まれる可能性がある。   Further, although different from the present embodiment, the entry portion of the HV code may be composed of two or more instructions. As shown in FIG. 11, the case where the entry part of HV code is comprised by n piece etc. is also considered. In the example shown in FIG. 11, it is assumed that writing is prohibited when the third bit of the status register “SR” is “1”. Therefore, by executing n instructions, “1” is set for the third bit of the SR. Even in the case of such n pieces, there is a possibility that another code will be interrupted.

また、このように本実施の形態でエントリ部が複数命令したのは、第1の実施の形態と同様に、プロセッサ101が有する命令セットの制限のためである。   In addition, the reason why the plurality of entry units instructed in this embodiment is because of the limitation of the instruction set of the processor 101 as in the first embodiment.

動作モード管理回路901は、第1の実施の形態にかかる動作モード管理回路102とは、フェッチ判断部122と処理が異なるフェッチ判断部921を備え、時間判断部125と処理が異なる時間判断部922を備え、命令検出部124と実行判断部126とを削除された点で異なる。   The operation mode management circuit 901 includes a fetch determination unit 921 having a process different from that of the fetch determination unit 122 and the time determination unit 922 having a process different from that of the time determination unit 125, unlike the operation mode management circuit 102 according to the first embodiment. In that the instruction detection unit 124 and the execution determination unit 126 are deleted.

フェッチ判断部921は、フェッチ検出部121が備える機能の他に、後述する保護メモリ107のHVコード格納領域911に格納されたHVコードのエントリ部の最後の命令のアドレス(図10に示す命令2)であるか否かを判断する。なお、詳細な判断手法については後述する。   In addition to the function of the fetch detection unit 121, the fetch determination unit 921 has the address of the last instruction in the entry part of the HV code stored in the HV code storage area 911 of the protection memory 107 described later (instruction 2 shown in FIG. 10). ) Or not. A detailed determination method will be described later.

時間判断部922は、時間計測部123が時間の計測を開始してから所定の時間が経過したか否かを判断する。この所定の時間は、エントリ部の全ての命令をフェッチするまでに要する時間に基づいて定められる。これにより、時間判断部922が所定の時間が経過したと判断したときに、フェッチ判断部921がエントリ部の最後の命令を検出したと判断できなかった場合、他のソフトウェアにより割り込みが行われたと判断できる。   The time determination unit 922 determines whether or not a predetermined time has elapsed since the time measurement unit 123 started measuring time. This predetermined time is determined based on the time required to fetch all the instructions in the entry section. As a result, when the time determination unit 922 determines that the predetermined time has elapsed, if the fetch determination unit 921 cannot determine that the last instruction in the entry unit has been detected, an interrupt has been performed by other software. I can judge.

また、システムLSI900の処理は、システムLSI100の処理と異なる点として、動作モード管理回路911のフェッチ検出部121等が、第1通信路を監視して、HVコードのエントリ部が適切に行われたことを確認する処理手順が異なる。そこで、エントリ部が適切に行われたことを確認する処理手順について説明する。   The processing of the system LSI 900 is different from the processing of the system LSI 100. The fetch detection unit 121 of the operation mode management circuit 911 monitors the first communication path, and the HV code entry unit is appropriately performed. The processing procedure for confirming this is different. Therefore, a processing procedure for confirming that the entry part has been appropriately performed will be described.

図12に示すように、まず、フェッチ検出部121は、第1通信路を監視して、プロセッサ101から伝送されてくる命令フェッチの要求を検出したか否か判断する(ステップS1201)。なお、当該処理は検出するまで繰り返される。   As shown in FIG. 12, first, the fetch detection unit 121 monitors the first communication path to determine whether or not an instruction fetch request transmitted from the processor 101 has been detected (step S1201). This process is repeated until it is detected.

次に、フェッチ判断部122は、フェッチ検出部121が命令フェッチの要求を検出した場合(ステップS1201:Yes)、当該命令フェッチの要求で指定されたアドレスがエントリ部の命令1のアドレスであるか否か判断する(ステップS1202)。そして、フェッチ判断部122が、異なると判断した場合(ステップS1202:No)、再びフェッチ検出部121による命令フェッチの検出を行う(ステップS1201)。   Next, when the fetch detection unit 121 detects an instruction fetch request (step S1201: Yes), the fetch determination unit 122 determines whether the address specified in the instruction fetch request is the address of the instruction 1 in the entry unit. It is determined whether or not (step S1202). If the fetch determination unit 122 determines that they are different (step S1202: No), the fetch detection unit 121 detects the instruction fetch again (step S1201).

そして、フェッチ判断部122は、アドレスが命令1と一致すると判断した場合(ステップS1202:Yes)、時間計測部123が時間の計測を開始する(ステップS1203)。   When the fetch determination unit 122 determines that the address matches the instruction 1 (step S1202: Yes), the time measurement unit 123 starts measuring time (step S1203).

次に、時間判断部922が、時間の計測を開始してから所定時間Tを経過したか否か判断する(ステップS1204)。なお、所定時間Tは、命令1のフェッチを検出してから命令2をフェッチするまでに要するものとして予め設定された時間とする。   Next, the time determination unit 922 determines whether or not a predetermined time T has elapsed since the start of time measurement (step S1204). The predetermined time T is a time set in advance as a time required from the detection of the fetch of the instruction 1 to the fetch of the instruction 2.

また、時間判断部922により所定時間Tを経過したと判断された場合(ステップS1204:No)、時間計測部123は時間計測を終了し(ステップS1208)、再びフェッチ検出部121による命令フェッチの検出を行う(ステップS1201)。   If the time determination unit 922 determines that the predetermined time T has elapsed (step S1204: No), the time measurement unit 123 ends the time measurement (step S1208), and the fetch detection unit 121 detects the instruction fetch again. Is performed (step S1201).

そして、時間判断部922により所定時間Tを経過していないと判断された場合(ステップS1204:Yes)、フェッチ検出部121は、第1通信路を監視して、プロセッサ101から伝送されてくる命令フェッチの要求を検出したか否か判断する(ステップS1205)。   If the time determination unit 922 determines that the predetermined time T has not elapsed (step S1204: Yes), the fetch detection unit 121 monitors the first communication path and receives a command transmitted from the processor 101. It is determined whether a fetch request has been detected (step S1205).

そして、フェッチ検出部121が命令フェッチを検出しなかった場合(ステップS1205:No)、時間判断部922が所定時間Tを経過したか否かの判断から処理を開始する(ステップS1204)。   If the fetch detection unit 121 does not detect an instruction fetch (step S1205: No), the time determination unit 922 starts processing from determining whether the predetermined time T has elapsed (step S1204).

そして、フェッチ検出部121が命令フェッチを検出した場合(ステップS1205:Yes)、フェッチ判断部921はフェッチアドレスが命令2のアドレスであるか否か判断する(ステップS1206)。そして、フェッチアドレスが命令2のアドレスではないと判断した場合(ステップS1206:No)、時間判断部922が所定時間Tを経過したか否かの判断から処理を開始する(ステップS1204)。   When the fetch detection unit 121 detects instruction fetch (step S1205: Yes), the fetch determination unit 921 determines whether the fetch address is the address of the instruction 2 (step S1206). If it is determined that the fetch address is not the address of the instruction 2 (step S1206: No), the time determination unit 922 starts processing from determining whether the predetermined time T has elapsed (step S1204).

次に、フェッチ判断部921はフェッチアドレスが命令2のアドレスであると判断した場合(ステップS1206:Yes)、時間計測部123が時間計測を終了する(ステップS1207)。そして、図6に示したステップS613以降の処理が行われることになる。   Next, when the fetch determination unit 921 determines that the fetch address is the address of the instruction 2 (step S1206: Yes), the time measurement unit 123 ends the time measurement (step S1207). And the process after step S613 shown in FIG. 6 will be performed.

つまり、本実施の形態では、命令2のアドレスがフェッチされた以上、命令2により書き込み禁止状態にされる。これにより、プロセッサ101が書き込み禁止状態になることが保証される。つまり、第1の実施の形態のように実行結果を確認することなく、エントリ部の複数命令が不可分に行われていることを保証するので、安全性を確保することができる。   That is, in the present embodiment, as long as the address of the instruction 2 is fetched, the write prohibited state is set by the instruction 2. This ensures that the processor 101 is in a write-protected state. In other words, as in the first embodiment, it is ensured that a plurality of instructions in the entry portion are inseparably executed without confirming the execution result, so that safety can be ensured.

(第3の実施の形態)
第1及び第2の実施の形態にかかるシステムLSIでは、時間を計測することで他のプログラムによる割り込みを防止する例について説明した。しかしながら、割り込み防止手法を時間計測に制限するものではない。そこで、第3の実施の形態では、HVコードのエントリ部の命令フェッチが命令順に行われていることを検出することで、割り込み禁止を防止する形態とする。
(Third embodiment)
In the system LSIs according to the first and second embodiments, the example in which interruption by another program is prevented by measuring time has been described. However, the interrupt prevention method is not limited to time measurement. Therefore, in the third embodiment, the prohibition of interrupt is prevented by detecting that the instruction fetch of the entry part of the HV code is performed in the order of instructions.

図13は、第3の実施の形態に係るシステムLSI1300の構成を示すブロック図である。上述した第1の実施の形態に係るシステムLSI100とは、動作モード管理回路102と処理が異なる動作モード管理回路1301と、第1HV領域保護回路104と処理が異なる第1HV領域保護回路1302とを備え、第2HV領域保護回路106が削除され、第1、2及び6通信路の接続先が変更されている点のみ異なる。なお、本実施の形態のシステムLSI1300の構成で、第1の実施の形態のシステムLSI100と共通な構成については説明を省略する。   FIG. 13 is a block diagram showing a configuration of a system LSI 1300 according to the third embodiment. The system LSI 100 according to the first embodiment described above includes an operation mode management circuit 1301 that is different in processing from the operation mode management circuit 102, and a first HV region protection circuit 1302 that is different in processing from the first HV region protection circuit 104. The second HV area protection circuit 106 is deleted and the connection destination of the first, second, and sixth communication paths is changed. Note that the description of the configuration of the system LSI 1300 of the present embodiment that is common to the system LSI 100 of the first embodiment will be omitted.

また、本実施の形態で利用されるHVコードは、第1の実施の形態で示したHVコードと同様として説明を省略する。そして、このようなHVコードに対してエントリコードを2命令以上で実装する場合、その処理中に任意のユーザコードを実行されて、割込み禁止状態を偽装されるおそれがある。   The HV code used in the present embodiment is the same as the HV code shown in the first embodiment, and the description thereof is omitted. When an entry code is implemented with two or more instructions for such an HV code, an arbitrary user code may be executed during the process and the interrupt disabled state may be disguised.

図14は、図2に示したエントリコードにおいて、割込み禁止状態が偽装される処理を示した説明図である。図14に示す例では、エントリコードのエントリ部の途中から不正ユーザコードが進入して、プロセッサ101の状態を割込み禁止状態と偽装している。詳細には、不正ユーザコードは“enable interrupt”命令を実行することで、プロセッサ101の割込みを許可する。その後、不正ユーザコードは、“load R0, 偽SR値”命令を実行することで、汎用レジスタ“R0”に偽のSRの値を読み込ませる。その後、エントリコードの命令2にジャンプする。そして、プロセッサ101は、命令2を実行する際、実際には割込み許可状態であるにもかかわらず、割込み禁止を表す偽SR値をCheckAdrに書き込むことになる。これにより、動作モード管理部がCheckAdrの値を参照すると割り込み禁止状態と判断できるので、割込み許可状態でハイパーバイザが実行され、動作モードがHVモードに切り替えられることになる。ここで不正ユーザコードにより割込みが行われると、HVモードのまま不正ユーザコードの割込みハンドラにジャンプしてしまう。   FIG. 14 is an explanatory diagram showing a process for impersonating an interrupt disabled state in the entry code shown in FIG. In the example shown in FIG. 14, an unauthorized user code enters from the middle of the entry part of the entry code, and the state of the processor 101 is disguised as an interrupt prohibited state. Specifically, the unauthorized user code executes the “enable interrupt” instruction to permit the processor 101 to interrupt. Thereafter, the illegal user code executes a “load R0, fake SR value” instruction to cause the general-purpose register “R0” to read a fake SR value. Thereafter, the process jumps to instruction 2 of the entry code. Then, when executing the instruction 2, the processor 101 writes a false SR value indicating that the interrupt is prohibited to the CheckAdr even though it is actually in the interrupt enabled state. As a result, when the operation mode management unit refers to the value of CheckAdr, it can be determined that the interrupt is prohibited. Therefore, the hypervisor is executed in the interrupt enabled state, and the operation mode is switched to the HV mode. If an interrupt is performed by an unauthorized user code, the jump to the interrupt handler for the unauthorized user code remains in the HV mode.

また、図14で示した例では、HVコードのエントリ部を全て行わなくてよいので、不正ユーザコードで割り込まれたとしても、エントリ部の実行時間が短くなる場合が存在する。このため、第1の実施の形態で示した手法は用いることは難しい。   Further, in the example shown in FIG. 14, it is not necessary to perform the entire entry portion of the HV code. Therefore, even when interrupted by an unauthorized user code, the execution time of the entry portion may be shortened. For this reason, it is difficult to use the method shown in the first embodiment.

そこで、本実施の形態にかかる動作モード管理回路1301では、エントリ部の命令が命令順にフェッチされていることを確認して、割り込み禁止状態になっていることを保証することとしている。つまり、本実施の形態にかかる動作モード管理回路1301は、第1通信路を監視しているので、プロセッサ101から保護メモリ107へのフェッチ要求のみならず、メモリ150へのフェッチ要求も監視することができる。つまり、フェッチ要求が、エントリ部に対して命令順に行われていれば、ハイパーバイザコード以外のコードに対してフェッチ要求が行われていないことになる。したがって、動作モード管理回路1301は、他のコードによる割り込みが行われていないことを保証できる。   Therefore, in the operation mode management circuit 1301 according to the present embodiment, it is confirmed that the instructions in the entry section are fetched in the order of instructions, and the interrupt disabled state is guaranteed. That is, since the operation mode management circuit 1301 according to the present embodiment monitors the first communication path, not only the fetch request from the processor 101 to the protection memory 107 but also the fetch request to the memory 150 should be monitored. Can do. In other words, if the fetch request is made in the order of instructions to the entry part, the fetch request is not made to the code other than the hypervisor code. Therefore, the operation mode management circuit 1301 can guarantee that no interruption by another code is performed.

図13に戻り、動作モード管理回路1301は、第1の実施の形態にかかる動作モード管理回路102とは、フェッチ検出部121と処理が異なるフェッチ検出部1311を備え、フェッチ判断部122と処理が異なるフェッチ判断部1312を備え、時間計測部123と時間判断部125とを削除された点で異なる。   Returning to FIG. 13, the operation mode management circuit 1301 includes a fetch detection unit 1311 that is different in processing from the fetch detection unit 121 and the operation mode management circuit 102 according to the first embodiment. The difference is that a different fetch determination unit 1312 is provided, and the time measurement unit 123 and the time determination unit 125 are deleted.

フェッチ検出部1311は、プロセッサ101とメモリアクセス制御部103と、デバイスアクセス制御部105と、保護メモリ107とを接続する第6通信路を介して、命令フェッチの検出を行う。   The fetch detection unit 1311 detects an instruction fetch via a sixth communication path that connects the processor 101, the memory access control unit 103, the device access control unit 105, and the protection memory 107.

フェッチ判断部1312は、フェッチ検出部121が検出した命令フェッチが、保護メモリ107のHVコード格納領域112に格納されたHVコードのエントリ部を構成する各命令のアドレスであるか否かを判断する。また、フェッチ判断部1312は、命令フェッチがエントリ部の命令順にフェッチを行っているか否かも判断する。   The fetch determination unit 1312 determines whether the instruction fetch detected by the fetch detection unit 121 is the address of each instruction constituting the entry part of the HV code stored in the HV code storage area 112 of the protected memory 107. . In addition, the fetch determination unit 1312 also determines whether or not the instruction fetch is fetching in the order of instructions in the entry part.

第1HV領域保護回路1302は、第1制御部1321を備え、第1通信路を介してプロセッサ101からのアクセス要求を受け付ける。そして、第1HV領域保護回路1302は、メモリアクセス制御部103、デバイスアクセス制御部105及び保護メモリ107を第2通信路で接続する。また、第1HV領域保護回路1302は、動作モード管理回路1301からモード情報信号が入力される。   The first HV area protection circuit 1302 includes a first control unit 1321 and receives an access request from the processor 101 via the first communication path. The first HV area protection circuit 1302 connects the memory access control unit 103, the device access control unit 105, and the protection memory 107 via the second communication path. The first HV area protection circuit 1302 receives a mode information signal from the operation mode management circuit 1301.

第1制御部1321は、動作モードがHVモードである旨の入力された場合に、メモリアクセス制御部103及びデバイスアクセス制御部105が有する制御情報、並びに保護メモリ107に対するアクセスを開放する制御を行う。また動作モードが通常モードである旨の入力がされた場合に、メモリアクセス制御部103及びデバイスアクセス制御部105が有する制御情報、並びに保護メモリ107に対するアクセスを禁止する制御を行う。   The first control unit 1321 performs control to release access to the control information included in the memory access control unit 103 and the device access control unit 105 and the protection memory 107 when an input indicating that the operation mode is the HV mode is input. . Further, when an input indicating that the operation mode is the normal mode is input, control for prohibiting access to the control information included in the memory access control unit 103 and the device access control unit 105 and the protection memory 107 is performed.

また、システムLSI1300の処理は、システムLSI100の処理と異なる点として、動作モード管理回路1301のフェッチ検出部1311等が、第6通信路を監視して、HVコードのエントリ部が適切に行われたことを確認する処理手順が異なる。そこで、エントリ部が適切に行われたことを確認する処理手順について説明する。   Further, the processing of the system LSI 1300 is different from the processing of the system LSI 100, and the fetch detection unit 1311 of the operation mode management circuit 1301 monitors the sixth communication path, and the entry part of the HV code is appropriately performed. The processing procedure for confirming this is different. Therefore, a processing procedure for confirming that the entry part has been appropriately performed will be described.

図15に示すように、まず、動作モード管理回路1301は、エントリチェックをするため、変数iに初期値として‘1’を設定する(ステップS1501)。次に、フェッチ検出部1311は、第6通信路を監視して、プロセッサ101から伝送されてくる命令フェッチの要求を検出したか否か判断する(ステップS1502)。なお、当該処理は検出するまで繰り返される。   As shown in FIG. 15, first, the operation mode management circuit 1301 sets ‘1’ as an initial value to a variable i in order to perform an entry check (step S <b> 1501). Next, the fetch detection unit 1311 monitors the sixth communication path and determines whether or not an instruction fetch request transmitted from the processor 101 has been detected (step S1502). This process is repeated until it is detected.

次に、フェッチ判断部1312は、フェッチ検出部1311が命令フェッチの要求を検出した場合(ステップS1502:Yes)、当該命令フェッチの要求で指定されたアドレスがエントリ部のi番目の命令(最初はi=‘1’)のアドレスであるか否か判断する(ステップS1503)。そして、フェッチ判断部1312が、異なると判断した場合(ステップS1503:No)、再び動作モード管理回路1301は、変数iに初期値として‘1’を設定する処理から開始する(ステップS1501)。   Next, when the fetch detection unit 1311 detects an instruction fetch request (step S1502: Yes), the fetch determination unit 1312 determines that the address specified in the instruction fetch request is the i-th instruction (initially) of the entry unit. It is determined whether the address is i = '1') (step S1503). If the fetch determination unit 1312 determines that the values are different (step S1503: No), the operation mode management circuit 1301 starts again from the process of setting ‘1’ as the initial value for the variable i (step S1501).

そして、フェッチ判断部1312は、アドレスが命令iのアドレスと一致すると判断した場合(ステップS1503:Yes)、動作モード管理回路1301は、変数iに‘1’を追加する(ステップS1504)。そして、動作モード管理回路1301は、変数iが‘2’より大きいか否か判断する(ステップS1505)。つまり、HVコードのエントリ部に含まれている命令の数だけ、上述した処理を繰り返す。   If the fetch determination unit 1312 determines that the address matches the address of the instruction i (step S1503: Yes), the operation mode management circuit 1301 adds “1” to the variable i (step S1504). Then, the operation mode management circuit 1301 determines whether or not the variable i is larger than “2” (step S1505). That is, the above-described processing is repeated for the number of instructions included in the entry part of the HV code.

なお、ステップS1505では、本実施の形態にかかるHVコードのエントリ部が2命令で構成されているため、変数iが‘2’より大きいか否か判断している。つまり、エントリ部がn命令で構成されている場合、変数iがnより大きいか否か判断すればよい。   In step S1505, since the entry portion of the HV code according to the present embodiment is composed of two instructions, it is determined whether or not the variable i is larger than “2”. In other words, if the entry part is composed of n instructions, it may be determined whether or not the variable i is larger than n.

動作モード管理回路1301は変数iが‘2’以下と判断した場合(ステップS1505:No)、フェッチ検出部1311がプロセッサ101から伝送されてくる命令フェッチの要求を検出したか否か判断を再び行う(ステップS1502)。   When the operation mode management circuit 1301 determines that the variable i is '2' or less (step S1505: No), the operation mode management circuit 1301 determines again whether or not the fetch detection unit 1311 has detected an instruction fetch request transmitted from the processor 101. (Step S1502).

そして、動作モード管理回路1301は変数iが‘2’より大きいと判断した場合(ステップS1505:Yes)、命令検出部124は、第6通信路を監視して、プロセッサ101からのデータ書き込み要求を検出したか否かを判断する(ステップS1506)。検出していないと判断した場合(ステップS1506:No)、書き込み要求を検出するまで処理を繰り返す。   If the operation mode management circuit 1301 determines that the variable i is greater than “2” (step S1505: Yes), the instruction detection unit 124 monitors the sixth communication path and issues a data write request from the processor 101. It is determined whether or not it has been detected (step S1506). If it is determined that it has not been detected (step S1506: No), the processing is repeated until a write request is detected.

次に、命令検出部124がデータ書込みの要求を検出した場合(ステップS1506:Yes)、当該データ書き込み要求で指定されたアドレスが‘CheckAdr’と一致するか否か判断する(ステップS1507)。そして、命令検出部124が、異なると判断した場合(ステップS1507:No)、再び動作モード管理回路1301は、変数iに初期値として‘1’を設定する処理から開始する(ステップS1501)。   Next, when the instruction detection unit 124 detects a data write request (step S1506: Yes), it is determined whether or not the address specified in the data write request matches “CheckAdr” (step S1507). If the instruction detection unit 124 determines that the values are different (step S1507: NO), the operation mode management circuit 1301 starts again from the process of setting “1” as an initial value to the variable i (step S1501).

そして、命令検出部124は、アドレスが‘CheckAdr’と一致すると判断した場合(ステップS1507:Yes)、実行判断部126が書込み要求で指定されたデータと割込み禁止を表す‘SR’の値が一致するか否か判断する(ステップS1508)。そして、実行判断部126が、異なると判断した場合(ステップS1508:No)、再び動作モード管理回路1301は、変数iに初期値として‘1’を設定する処理から開始する(ステップS1501)。   If the instruction detection unit 124 determines that the address matches “CheckAdr” (step S1507: Yes), the execution determination unit 126 matches the data specified in the write request with the value of “SR” indicating that the interrupt is prohibited. It is determined whether or not to perform (step S1508). If the execution determining unit 126 determines that the values are different (step S1508: NO), the operation mode management circuit 1301 starts again from the process of setting ‘1’ as the initial value for the variable i (step S1501).

次に、実行判断部126は、書込みデータと割込み禁止を表す‘SR’の値が一致すると判断した場合(ステップS1508:Yes)、HVコードのエントリ部が適切に実行されたことを確認できたものとする。そして、図6に示したステップS613以降の処理が行われることになる。   Next, when the execution determination unit 126 determines that the write data and the value of 'SR' indicating interrupt prohibition match (step S1508: Yes), the execution determination unit 126 was able to confirm that the HV code entry unit was appropriately executed. Shall. And the process after step S613 shown in FIG. 6 will be performed.

本実施の形態にかかるシステムLSI1300では、HVコードのエントリ部の命令が順にフェッチされていることを確認することで、他のコードによる割り込みが行われていないことを確認できる。これにより、安全性を確保することができる。   In the system LSI 1300 according to the present embodiment, it is possible to confirm that an interrupt by another code is not performed by confirming that instructions in the entry part of the HV code are fetched in order. Thereby, safety can be ensured.

(第3の実施の形態の変形例)
第3の実施の形態では、命令フェッチの確認をループ処理(ステップS1502〜S1505)で行うこととしたが、命令数が少ない場合には上述した命令フェッチの確認のループ処理を展開しても良い。そこで、第3の実施の形態の変形例ではループ処理を展開した例について説明する。
(Modification of the third embodiment)
In the third embodiment, instruction fetch confirmation is performed by loop processing (steps S1502 to S1505). However, when the number of instructions is small, the above-described instruction fetch confirmation loop processing may be developed. . Therefore, in a modification of the third embodiment, an example in which loop processing is developed will be described.

実際にエントリコードをチェックするハードウェア回路を設計する際、エントリコードの命令数が少ない場合は、ループを展開した方が実装が簡潔になる。   When designing the hardware circuit that actually checks the entry code, if the number of instructions in the entry code is small, the implementation is simpler if the loop is expanded.

第3の実施の形態の図15に示した処理手順の命令フェッチの確認のループを、2回の命令フェッチの確認で展開した処理手順が図16である。図16のフローチャートでは、図15と比較して、変数iの演算を行うハードウェアの実装は不要であり、単純な状態遷移回路として設計可能となる。   FIG. 16 shows a processing procedure in which the instruction fetch confirmation loop of the processing procedure shown in FIG. 15 of the third embodiment is expanded by two instruction fetch confirmations. In the flowchart of FIG. 16, compared with FIG. 15, it is not necessary to implement hardware for performing the calculation of the variable i, and it can be designed as a simple state transition circuit.

図16に示すように、フェッチ検出部1311は、第6通信路を監視して、プロセッサ101から伝送されてくる命令フェッチの要求を検出したか否か判断する(ステップS1601)。なお、当該処理は検出するまで繰り返される。   As shown in FIG. 16, the fetch detection unit 1311 monitors the sixth communication path and determines whether or not an instruction fetch request transmitted from the processor 101 has been detected (step S1601). This process is repeated until it is detected.

次に、フェッチ判断部1312は、フェッチ検出部1311が命令フェッチの要求を検出した場合(ステップS1601:Yes)、当該命令フェッチの要求で指定されたアドレスがエントリ部の命令1のアドレスであるか否か判断する(ステップS1602)。そして、フェッチ判断部1312が、異なると判断した場合(ステップS1602:No)、再びフェッチ検出部1311による命令フェッチの要求を検出したか否か判断する処理を行う(ステップS1601)。   Next, when the fetch detection unit 1311 detects an instruction fetch request (step S1601: Yes), the fetch determination unit 1312 determines whether the address specified in the instruction fetch request is the address of the instruction 1 of the entry unit. It is determined whether or not (step S1602). If the fetch determination unit 1312 determines that they are different (step S1602: No), it again determines whether an instruction fetch request by the fetch detection unit 1311 has been detected (step S1601).

そして、フェッチ判断部1312は、アドレスが命令1のアドレスと一致すると判断した場合(ステップS1602:Yes)、フェッチ検出部1311が、第6通信路を監視して、プロセッサ101から伝送されてくる命令フェッチの要求を検出したか否か判断する(ステップS1603)。なお、当該処理は検出するまで繰り返される。   When the fetch determination unit 1312 determines that the address matches the address of the instruction 1 (step S1602: Yes), the fetch detection unit 1311 monitors the sixth communication path and transmits the instruction transmitted from the processor 101. It is determined whether a fetch request has been detected (step S1603). This process is repeated until it is detected.

次に、フェッチ判断部1312は、フェッチ検出部1311が命令フェッチの要求を検出した場合(ステップS1603:Yes)、当該命令フェッチの要求で指定されたアドレスがエントリ部の命令2のアドレスであるか否か判断する(ステップS1604)。そして、フェッチ判断部1312が、異なると判断した場合(ステップS1604:No)、再びフェッチ検出部1311による命令フェッチの要求を検出したか否か判断する処理を行う(ステップS1601)。   Next, when the fetch detection unit 1311 detects an instruction fetch request (step S1603: Yes), the fetch determination unit 1312 determines whether the address specified in the instruction fetch request is the address of the instruction 2 in the entry unit. It is determined whether or not (step S1604). If the fetch determination unit 1312 determines that they are different (step S1604: No), it performs processing to determine again whether an instruction fetch request by the fetch detection unit 1311 has been detected (step S1601).

そして、フェッチ判断部1312は、アドレスが命令2のアドレスと一致すると判断した場合(ステップS1604:Yes)、命令検出部124は、第6通信路を監視して、プロセッサ101からのデータ書き込み要求を検出したか否かを判断する(ステップS1605)。検出していないと判断した場合(ステップS1605:No)、書き込み要求を検出するまで処理を繰り返す。   When the fetch determination unit 1312 determines that the address matches the address of the instruction 2 (step S1604: Yes), the instruction detection unit 124 monitors the sixth communication path and issues a data write request from the processor 101. It is determined whether or not it has been detected (step S1605). If it is determined that it has not been detected (step S1605: NO), the processing is repeated until a write request is detected.

次に、命令検出部124がデータ書込みの要求を検出した場合(ステップS1605:Yes)、当該データ書き込み要求で指定されたアドレスが‘CheckAdr’と一致するか否か判断する(ステップS1606)。そして、命令検出部124が、異なると判断した場合(ステップS1606:No)、再びフェッチ検出部1311による命令フェッチの要求を検出したか否か判断する処理を行う(ステップS1601)。   Next, when the instruction detection unit 124 detects a data write request (step S1605: Yes), it is determined whether or not the address specified in the data write request matches ‘CheckAdr’ (step S1606). If the instruction detection unit 124 determines that they are different (step S1606: No), it again determines whether an instruction fetch request by the fetch detection unit 1311 has been detected (step S1601).

そして、命令検出部124は、アドレスが‘CheckAdr’と一致すると判断した場合(ステップS1606:Yes)、実行判断部126が書込み要求で指定されたデータと割込み禁止を表す‘SR’の値が一致するか否か判断する(ステップS1607)。そして、実行判断部126が、異なると判断した場合(ステップS1607:No)、再びフェッチ検出部1311による命令フェッチの要求を検出したか否か判断する処理を行う(ステップS1601)。   If the instruction detection unit 124 determines that the address matches “CheckAdr” (step S1606: Yes), the execution determination unit 126 matches the data specified in the write request with the value of “SR” indicating that the interrupt is prohibited. It is determined whether or not to perform (step S1607). If the execution determining unit 126 determines that they are different (step S1607: NO), it again determines whether an instruction fetch request by the fetch detecting unit 1311 has been detected (step S1601).

次に、実行判断部126は、書込みデータと割込み禁止を表す‘SR’の値が一致すると判断した場合(ステップS1607:Yes)、HVコードのエントリ部が適切に実行されたことを確認できたものとして終了する。そして、図6に示したステップS613以降の処理が行われることになる。   Next, when the execution determination unit 126 determines that the write data and the value of 'SR' indicating interrupt prohibition match (step S1607: Yes), the execution determination unit 126 was able to confirm that the HV code entry unit was appropriately executed. End as a thing. And the process after step S613 shown in FIG. 6 will be performed.

上述した処理手順で行うことでハードウェア回路を簡潔することができる。なお、後述する実施の形態において、命令フェッチの確認をループ処理している場合も、上述したようにループ処理を展開しても良い。   The hardware circuit can be simplified by performing the processing procedure described above. In the embodiment described later, even when instruction fetch confirmation is loop-processed, the loop process may be developed as described above.

(第4の実施の形態)
第4の実施の形態では、第3の実施の形態と同様にHVコードのエントリ部の命令フェッチが命令順に行われていることを確認する。そして、第4の実施の形態は、第3の実施の形態と異なる点としてはHVコードのエントリ部の処理が割り込み禁止するための複数命令で構成された例とする。
(Fourth embodiment)
In the fourth embodiment, as in the third embodiment, it is confirmed that the instruction fetch of the entry part of the HV code is performed in the order of instructions. The fourth embodiment is different from the third embodiment in that the processing of the entry part of the HV code is composed of a plurality of instructions for prohibiting interrupts.

図17は、第4の実施の形態に係るシステムLSI1700の構成を示すブロック図である上述した第3の実施の形態に係るシステムLSI1300とは、動作モード管理回路1301と処理が異なる動作モード管理回路1701を備える点のみ異なる。なお、本実施の形態のシステムLSI1700の構成で、第3の実施の形態のシステムLSI1300と共通な構成については説明を省略する。   FIG. 17 is a block diagram showing the configuration of a system LSI 1700 according to the fourth embodiment. The system LSI 1300 according to the third embodiment described above differs from the operation mode management circuit 1301 in operation mode management circuit. The only difference is that 1701 is provided. Note that the description of the configuration of the system LSI 1700 of this embodiment that is common to the system LSI 1300 of the third embodiment will be omitted.

また、本実施の形態で利用されるHVコードは、第2の実施の形態で示したHVコードと同様として説明を省略する。そして、このようなHVコードに対してエントリコードを2命令以上で実装する場合、その処理中に任意のユーザコードを実行されて、割込み禁止状態を偽装されるおそれがある。   The HV code used in the present embodiment is the same as the HV code shown in the second embodiment, and the description thereof is omitted. When an entry code is implemented with two or more instructions for such an HV code, an arbitrary user code may be executed during the process and the interrupt disabled state may be disguised.

動作モード管理回路1701は、第3の実施の形態にかかる動作モード管理回路1301とは、命令検出部124と実行判断部126とを削除された点で異なる。   The operation mode management circuit 1701 is different from the operation mode management circuit 1301 according to the third embodiment in that the instruction detection unit 124 and the execution determination unit 126 are deleted.

システムLSI1700の処理は、システムLSI1300の処理と異なる点として、動作モード管理回路1701のフェッチ検出部1311等が、第6通信路を監視して、HVコードのエントリ部が適切に行われたことを確認する処理手順が異なる。そこで、エントリ部が適切に行われたことを確認する処理手順について説明する。   The processing of the system LSI 1700 differs from the processing of the system LSI 1300 in that the fetch detection unit 1311 of the operation mode management circuit 1701 monitors the sixth communication path and confirms that the HV code entry unit has been appropriately performed. The processing procedure to check is different. Therefore, a processing procedure for confirming that the entry part has been appropriately performed will be described.

図18のステップS1801〜S1805までの処理は、図15のステップS1501〜S1805までの処理と同様として説明を省略する。そして、ステップS1805まで処理が行われた場合に終了する。つまり、図18で示した処理手順は、図15のステップS1805以降に行われるデータの書き込み検出及び割り込み禁止状態であるか否かの確認する処理が不要となる。   The processes from Steps S1801 to S1805 in FIG. 18 are the same as the processes from Steps S1501 to S1805 in FIG. Then, the process ends when the processing is performed up to step S1805. In other words, the processing procedure shown in FIG. 18 does not require processing for detecting data writing and checking whether or not an interrupt is disabled after step S1805 in FIG.

つまり、本実施の形態では、命令1、2の順にアドレスがフェッチされた以上、プロセッサ101がこれら命令を実行することで、プロセッサ101は書き込み禁止状態となる。これにより、プロセッサ101が書き込み禁止状態になることが保証される。また、エントリ部の複数命令が不可分に行われていることを保証できる。これにより、安全性を確保することができる。   In other words, in the present embodiment, as long as the addresses are fetched in the order of the instructions 1 and 2, the processor 101 executes these instructions, so that the processor 101 is in a write-protected state. This ensures that the processor 101 is in a write-protected state. Further, it can be assured that a plurality of instructions in the entry part are inseparably performed. Thereby, safety can be ensured.

(第5の実施の形態)
第5の実施の形態では、第1の実施の形態で示した時間計測による割り込み防止と、第3の実施の形態で示したHVコードのエントリ部の命令フェッチが順に行われていることを検出する例とする。また、本実施の形態にかかるHVコードは、割り込み禁止状態であることを確認するエントリ部を有する図3で示したコードとする。
(Fifth embodiment)
In the fifth embodiment, it is detected that the interrupt prevention by the time measurement shown in the first embodiment and the instruction fetch of the entry part of the HV code shown in the third embodiment are sequentially performed. Let's take an example. The HV code according to the present embodiment is the code shown in FIG. 3 having an entry part for confirming that the interrupt is prohibited.

図19は、第5の実施の形態に係るシステムLSI1900の構成を示すブロック図である。上述した第1の実施の形態に係るシステムLSI100とは、動作モード管理回路102と処理が異なる動作モード管理回路1901を備え、HVコード格納領域112と格納しているHVコードが異なるHVコード格納領域1902を備えている点のみ異なる。また、なお、本実施の形態のシステムLSI1900の構成で、第1の実施の形態のシステムLSI100と共通な構成については説明を省略する。   FIG. 19 is a block diagram showing a configuration of a system LSI 1900 according to the fifth embodiment. The system LSI 100 according to the first embodiment described above includes an operation mode management circuit 1901 whose processing is different from that of the operation mode management circuit 102, and an HV code storage region in which the HV code stored in the HV code storage region 112 is different. The only difference is that 1902 is provided. In addition, the description of the configuration of the system LSI 1900 of the present embodiment that is common to the system LSI 100 of the first embodiment will be omitted.

HVコード格納領域1902は、図3に示したHVコードを格納している。図3に示すように、HVコードのエントリ部は、n個の命令で構成され、プロセッサ101が割り込み禁止状態であるか否かを確認している。   The HV code storage area 1902 stores the HV code shown in FIG. As shown in FIG. 3, the entry portion of the HV code is composed of n instructions and confirms whether or not the processor 101 is in an interrupt disabled state.

本実施の形態にかかるシステムLSI1900において、複数の割り込み防止を組み合わせたのは、エントリコードの命令数が大きい場合、例えば第1の実施の形態で示したようなエントリ部の実行時間を測定するだけでは、割込み禁止の状態を偽装される可能性がある。   In the system LSI 1900 according to the present embodiment, the combination of a plurality of interrupt preventions is only to measure the execution time of the entry unit as shown in the first embodiment, for example, when the number of instructions in the entry code is large. Then, there is a possibility that the interrupt disabled state is disguised.

図20に示すHVコードのエントリ部では、n個の命令を実行することで、SRが保持する値を、アドレス“CheckAdr”に書き込んでいる。   In the entry part of the HV code shown in FIG. 20, the value held by the SR is written to the address “CheckAdr” by executing n instructions.

これに対して、不正ユーザコードは、まず、汎用レジスタR2に偽のSRの値を書き込み、R3にCheckAdrの即値を読み込み、割込みを許可した後、エントリコードの命令1にジャンプする。そして、この命令1の実行後に何らかの割込みを発生させ、不正ユーザコードの割込みハンドラにジャンプし、R2の値をR3をベースレジスタとして“CheckAdr”に書き込んでいる。   On the other hand, the unauthorized user code first writes a false SR value into the general register R2, reads the immediate value of CheckAdr into R3, permits an interrupt, and then jumps to the instruction 1 of the entry code. Then, after execution of this instruction 1, some interrupt is generated, jumps to the interrupt handler of the illegal user code, and the value of R2 is written in “CheckAdr” using R3 as a base register.

つまり、この不正ユーザコードは、HVコードのエントリ部の呼出し前に汎用レジスタに予め不正な値を設定した上で、1)命令1の実行、2)割込み発生、3)偽SRの値をCheckAdrへ書込みという3個の処理によって、割り込み禁止状態の偽装を実現している。これら3個の処理の実行時間は、HVコードのエントリ部のn個の命令の実行時間より小さいため、時間の計測のみでは不正な割り込みを検出することができない。   In other words, the illegal user code sets an illegal value in the general-purpose register in advance before calling the entry part of the HV code, and 1) executes the instruction 1, 2) generates an interrupt, and 3) sets the value of the false SR to CheckAdr. Impersonation of the interrupt disabled state is realized by three processes of writing to. Since the execution time of these three processes is shorter than the execution time of n instructions in the entry part of the HV code, an illegal interrupt cannot be detected only by measuring the time.

さらに第5の実施形態にかかるシステムLSI1900は、第3の実施形態にかかるシステムLSI1300とは通信路の構成が異なるので、全ての命令フェッチを検出することができない。つまり、システムLSI1900では、HVコードのエントリ部が命令順にフェッチされるときに、不正ユーザコードの命令もフェッチしている可能性がある。   Furthermore, since the system LSI 1900 according to the fifth embodiment has a different communication path configuration from the system LSI 1300 according to the third embodiment, it is not possible to detect all instruction fetches. That is, in the system LSI 1900, when the entry portion of the HV code is fetched in the order of instructions, there is a possibility that the instruction of the illegal user code is also fetched.

そこで、第5の実施の形態にかかるシステムLSI1900の動作モード管理回路1901では、第1の実施の形態で示した時間計測と、第3の実施の形態で示したHVコードのエントリ部の命令フェッチが順に行われていることの検出とを行うこととした。   Therefore, in the operation mode management circuit 1901 of the system LSI 1900 according to the fifth embodiment, the time measurement shown in the first embodiment and the instruction fetch of the entry portion of the HV code shown in the third embodiment. It was decided to detect that the processes were sequentially performed.

図19に戻り、動作モード管理回路1901は、第1の実施の形態にかかる動作モード管理回路102とは、フェッチ検出部121と処理が異なるフェッチ検出部1311を備え、フェッチ判断部122と処理が異なるフェッチ判断部1312を備えた点で異なる。フェッチ検出部1311及びフェッチ判断部1312は、第3の実施の形態で示したので説明を省略する。   Returning to FIG. 19, the operation mode management circuit 1901 includes a fetch detection unit 1311 that is different in processing from the fetch detection unit 121 and the operation mode management circuit 102 according to the first embodiment. The difference is that a different fetch determination unit 1312 is provided. Since the fetch detection unit 1311 and the fetch determination unit 1312 are shown in the third embodiment, description thereof is omitted.

また、システムLSI1900の処理は、システムLSI100の処理と異なる点として、動作モード管理回路1901のフェッチ検出部1311等が、第1通信路を監視して、HVコードのエントリ部が適切に行われたことを確認する処理手順が異なる。そこで、エントリ部が適切に行われたことを確認する処理手順について説明する。   Further, the processing of the system LSI 1900 differs from the processing of the system LSI 100 in that the fetch detection unit 1311 of the operation mode management circuit 1901 monitors the first communication path, and the HV code entry unit is appropriately performed. The processing procedure for confirming this is different. Therefore, a processing procedure for confirming that the entry part has been appropriately performed will be described.

図21に示すように、まず、フェッチ検出部1311は、第1通信路を監視して、プロセッサ101から伝送されてくる命令フェッチの要求を検出したか否か判断する(ステップS2101)。なお、当該処理は検出するまで繰り返される。   As shown in FIG. 21, first, the fetch detection unit 1311 monitors the first communication path and determines whether or not an instruction fetch request transmitted from the processor 101 has been detected (step S2101). This process is repeated until it is detected.

次に、フェッチ判断部1312は、フェッチ検出部1311が命令フェッチの要求を検出した場合(ステップS2101:Yes)、当該命令フェッチの要求で指定されたアドレスがエントリ部の命令1のアドレスであるか否か判断する(ステップS2102)。そして、フェッチ判断部1312が、異なると判断した場合(ステップS2102:No)、再びフェッチ検出部1311による命令フェッチの検出を行う(ステップS2101)。   Next, when the fetch detection unit 1311 detects an instruction fetch request (step S2101: Yes), the fetch determination unit 1312 determines whether the address specified in the instruction fetch request is the address of the instruction 1 in the entry unit. It is determined whether or not (step S2102). If the fetch determination unit 1312 determines that they are different (step S2102: No), the fetch detection unit 1311 detects instruction fetch again (step S2101).

そして、フェッチ検出部1311は、アドレスが命令1と一致すると判断した場合(ステップS2102:Yes)、時間計測部123が時間の計測を開始する(ステップS2103)。   When the fetch detection unit 1311 determines that the address matches the instruction 1 (step S2102: Yes), the time measurement unit 123 starts measuring time (step S2103).

次に、動作モード管理回路1901は、エントリチェックをするため、変数iに初期値として‘2’を設定する(ステップS2104)。   Next, the operation mode management circuit 1901 sets ‘2’ as an initial value to the variable i in order to perform an entry check (step S <b> 2104).

次に、時間判断部125が、時間の計測を開始してから所定時間Tを経過したか否か判断する(ステップS2105)。なお、所定時間Tは、命令1のフェッチを検出してから命令nが実行されるまでに要するものとして予め設定された時間とする。   Next, the time determination unit 125 determines whether or not a predetermined time T has elapsed since the start of time measurement (step S2105). The predetermined time T is a time set in advance as a time required from the detection of the fetch of the instruction 1 to the execution of the instruction n.

また、時間判断部125により所定時間Tを経過したと判断された場合(ステップS2105:No)、時間計測部123は時間計測を終了し(ステップS2110)、再びフェッチ検出部1311による命令フェッチの検出を行う(ステップS2101)。   If the time determination unit 125 determines that the predetermined time T has elapsed (step S2105: No), the time measurement unit 123 ends the time measurement (step S2110), and the fetch detection unit 1311 detects the instruction fetch again. Is performed (step S2101).

そして、時間判断部125により所定時間Tを経過していないと判断された場合(ステップS2105:Yes)、次に、フェッチ検出部1311は、第1通信路を監視して、プロセッサ101から伝送されてくる命令フェッチの要求を検出したか否か判断する(ステップS2106)。なお、当該処理は検出するまで繰り返される。   If it is determined by the time determination unit 125 that the predetermined time T has not elapsed (step S2105: Yes), the fetch detection unit 1311 monitors the first communication path and is transmitted from the processor 101. It is determined whether an incoming instruction fetch request is detected (step S2106). This process is repeated until it is detected.

次に、フェッチ判断部1312は、フェッチ検出部1311が命令フェッチの要求を検出した場合(ステップS2106:Yes)、当該命令フェッチの要求で指定されたアドレスがエントリ部のi番目の命令のアドレスであるか否か判断する(ステップS2107)。そして、フェッチ判断部1312が、異なると判断した場合(ステップS2107:No)、再びフェッチ検出部1311による命令フェッチの検出を行う(ステップS2101)。   Next, when the fetch detection unit 1311 detects an instruction fetch request (step S2106: Yes), the fetch determination unit 1312 determines that the address specified by the instruction fetch request is the address of the i-th instruction in the entry unit. It is determined whether or not there is (step S2107). If the fetch determination unit 1312 determines that they are different (step S2107: No), the fetch detection unit 1311 detects instruction fetch again (step S2101).

そして、フェッチ判断部1312は、アドレスが命令iのアドレスと一致すると判断した場合(ステップS2107:Yes)、動作モード管理回路1901は、変数iに‘1’を追加する(ステップS2108)。そして、動作モード管理回路1901は、変数iがnより大きいか否か判断する(ステップS2109)。つまり、HVコードのエントリ部に含まれている命令の数nだけ、上述した処理を繰り返す。   If the fetch determination unit 1312 determines that the address matches the address of the instruction i (step S2107: Yes), the operation mode management circuit 1901 adds ‘1’ to the variable i (step S2108). Then, the operation mode management circuit 1901 determines whether or not the variable i is larger than n (step S2109). That is, the above-described processing is repeated for the number n of instructions included in the entry portion of the HV code.

動作モード管理回路1901は変数iがn以下と判断した場合(ステップS2109:No)、時間判断部125が、時間の計測を開始してから所定時間Tを経過したか否か判断する処理から再び行う(ステップS2105)。   When the operation mode management circuit 1901 determines that the variable i is n or less (step S2109: No), the time determination unit 125 starts again from the process of determining whether or not the predetermined time T has elapsed since the start of time measurement. This is performed (step S2105).

次に、動作モード管理回路1901は変数iがnより大きいと判断した場合(ステップS2109:Yes)、時間判断部125が、時間の計測を開始してから所定時間Tを経過したか否か判断する(ステップS2111)。   Next, when the operation mode management circuit 1901 determines that the variable i is larger than n (step S2109: Yes), the time determination unit 125 determines whether or not a predetermined time T has elapsed since the time measurement started. (Step S2111).

そして、時間判断部125により所定時間Tを経過したと判断された場合(ステップS2111:No)、時間計測部123は時間計測を終了し(ステップS2110)、再びフェッチ検出部1311による命令フェッチの検出を行う(ステップS2101)。   When the time determination unit 125 determines that the predetermined time T has elapsed (step S2111: No), the time measurement unit 123 ends the time measurement (step S2110), and the fetch detection unit 1311 detects the instruction fetch again. Is performed (step S2101).

また、時間判断部125により所定時間Tを経過していないと判断された場合(ステップS2111:Yes)、命令検出部124は、第1通信路を監視して、プロセッサ101からのデータ書き込み要求を検出したか否かを判断する(ステップS2112)。検出していないと判断した場合(ステップS2112:No)、時間判断部125が所定時間Tを経過したか否かの判断から処理を開始する(ステップS2111)。   If the time determination unit 125 determines that the predetermined time T has not elapsed (step S2111: Yes), the instruction detection unit 124 monitors the first communication path and issues a data write request from the processor 101. It is determined whether or not it has been detected (step S2112). If it is determined that no detection has been made (step S2112: No), the time determination unit 125 starts processing from determining whether the predetermined time T has elapsed (step S2111).

次に、命令検出部124がデータ書込みの要求を検出した場合(ステップS2112:Yes)、時間計測部123が時間計測を終了する(ステップS2113)。そして、命令検出部124が当該データ書き込み要求で指定されたアドレスが‘CheckAdr’と一致するか否か判断する(ステップS2114)。そして、命令検出部124が、異なると判断した場合(ステップS2114:No)、再びフェッチ検出部121による命令フェッチの検出を行う(ステップS2101)。   Next, when the instruction detection unit 124 detects a data write request (step S2112: Yes), the time measurement unit 123 ends the time measurement (step S2113). Then, the instruction detection unit 124 determines whether or not the address specified by the data write request matches “CheckAdr” (step S2114). If the instruction detection unit 124 determines that they are different (step S2114: No), the fetch detection unit 121 detects the instruction fetch again (step S2101).

そして、命令検出部124は、アドレスが‘CheckAdr’と一致すると判断した場合(ステップS2114:Yes)、実行判断部126が書込み要求で指定されたデータと割込み禁止を表す‘SR’の値が一致するか否か判断する(ステップS2115)。そして、実行判断部126が、異なると判断した場合(ステップS2115:No)、再びフェッチ検出部121による命令フェッチの検出を行う(ステップS2101)。   If the instruction detection unit 124 determines that the address matches “CheckAdr” (step S2114: Yes), the execution determination unit 126 matches the data specified in the write request with the value of “SR” indicating that the interrupt is prohibited. It is determined whether or not to perform (step S2115). If the execution determining unit 126 determines that they are different (step S2115: No), the fetch detecting unit 121 detects the instruction fetch again (step S2101).

次に、実行判断部126は、書込みデータと割込み禁止を表す‘SR’の値が一致すると判断した場合(ステップS2115:Yes)、HVコードのエントリ部が適切に実行されたことを確認できたものとする。そして、図6に示したステップS613以降の処理が行われることになる。   Next, when the execution determination unit 126 determines that the write data and the value of 'SR' indicating interrupt prohibition match (step S2115: Yes), the execution determination unit 126 was able to confirm that the HV code entry unit was appropriately executed. Shall. And the process after step S613 shown in FIG. 6 will be performed.

上述した実施の形態のシステムLSI1900によれば、時間計測による割り込み防止と、第3の実施の形態で示したHVコードのエントリ部の命令フェッチが順に行われていることを検出する処理とを組み合わせることとした。これにより、HVコードのエントリ部の命令が多い場合に、短時間で処理が行われたために時間計測のみでは検出できないという不正な割り込みを検出することができる。これにより、安全性が向上する。   According to the system LSI 1900 of the above-described embodiment, the interrupt prevention by time measurement is combined with the process of detecting that the instruction fetch of the entry part of the HV code shown in the third embodiment is sequentially performed. It was decided. As a result, when there are many instructions in the entry portion of the HV code, it is possible to detect an illegal interrupt that cannot be detected only by time measurement because the processing is performed in a short time. Thereby, safety is improved.

(第6の実施の形態)
第6の実施の形態では、第1の実施の形態で示した時間計測による割り込み防止と、第3の実施の形態で示したHVコードのエントリ部の命令フェッチが順に行われていることを検出する例とする。また、本実施の形態にかかるHVコードは、割り込み禁止状態を設定するエントリ部を有する図11で示したコードとする。
(Sixth embodiment)
In the sixth embodiment, it is detected that the interruption prevention by the time measurement shown in the first embodiment and the instruction fetch of the entry part of the HV code shown in the third embodiment are sequentially performed. Let's take an example. Further, the HV code according to the present embodiment is the code shown in FIG. 11 having an entry part for setting the interrupt disabled state.

図22は、第6の実施の形態に係るシステムLSI2200の構成を示すブロック図である上述した第2の実施の形態に係るシステムLSI900とは、動作モード管理回路901と処理が異なる動作モード管理回路2201を備え、HVコード格納領域911と格納しているHVコードが異なるHVコード格納領域2202を備えている点が異なる。なお、本実施の形態のシステムLSI2200の構成で、第2の実施の形態のシステムLSI900と共通な構成については説明を省略する。   FIG. 22 is a block diagram showing a configuration of a system LSI 2200 according to the sixth embodiment. The operation mode management circuit is different from the operation mode management circuit 901 in processing in the system LSI 900 according to the second embodiment described above. 2201 is different from the HV code storage area 911 in that the HV code storage area 2202 is different from the HV code storage area 911 stored therein. Note that the description of the configuration of the system LSI 2200 of the present embodiment that is common to the system LSI 900 of the second embodiment will be omitted.

HVコード格納領域2202は、図11に示したHVコードを格納している。図11に示すように、HVコードのエントリ部は、n個の命令で構成され、プロセッサ101が割り込み禁止状態に設定している。   The HV code storage area 2202 stores the HV code shown in FIG. As shown in FIG. 11, the entry portion of the HV code is composed of n instructions, and the processor 101 is set to the interrupt disabled state.

動作モード管理回路2201は、第2の実施の形態にかかる動作モード管理回路901とは、フェッチ検出部121と処理が異なるフェッチ検出部1311を備え、フェッチ判断部921と処理が異なるフェッチ判断部1312を備えた点で異なる。なお、フェッチ検出部1311及びフェッチ判断部1312は、第3の実施の形態で示したので説明を省略する。   The operation mode management circuit 2201 includes a fetch detection unit 1311 having a process different from that of the fetch detection unit 121 and the fetch determination unit 1312 having a process different from that of the fetch determination unit 921 in the operation mode management circuit 901 according to the second embodiment. It differs in that it is equipped with. Note that the fetch detection unit 1311 and the fetch determination unit 1312 have been described in the third embodiment, and a description thereof will be omitted.

図23のステップS2301〜S2310までの処理は、図21のステップS2101〜S2110までの処理と同様として説明を省略する。そして、ステップS2309で変数iがエントリ部の命令数nより大きくなった場合に(ステップS2309:Yes)、すべての命令のフェッチを検出したとして、時間計測部123が時間計測を終了して(ステップS2311)、処理を終了する。つまり、図23で示した処理手順は、図21のステップS2111以降に行われるデータの書き込み検出及び割り込み禁止状態であるか否かの確認する処理が不要となる。   The processing from step S2301 to S2310 in FIG. 23 is the same as the processing from step S2101 to S2110 in FIG. Then, when the variable i becomes larger than the number of instructions n in the entry part in step S2309 (step S2309: Yes), the time measurement unit 123 finishes the time measurement, assuming that all instruction fetches have been detected (step S2309). S2311), the process is terminated. In other words, the processing procedure shown in FIG. 23 does not require the processing of detecting data writing and confirming whether or not the interrupt is disabled, which is performed after step S2111 in FIG.

つまり、本実施の形態では、n個の命令が命令順にアドレスがフェッチされた以上、プロセッサ101がこれら命令を実行することで、プロセッサ101は書き込み禁止状態となる。これにより、プロセッサ101が書き込み禁止状態になることが保証される。また、エントリ部の複数命令が不可分に行われていることを保証できる。これにより、安全性を確保することができる。   In other words, in the present embodiment, since the addresses of n instructions are fetched in the order of instructions, the processor 101 executes these instructions to put the processor 101 in a write-protected state. This ensures that the processor 101 is in a write-protected state. Further, it can be assured that a plurality of instructions in the entry part are inseparably performed. Thereby, safety can be ensured.

上述した実施の形態のシステムLSI2200によれば、時間計測による割り込み防止と、第3の実施の形態で示したHVコードのエントリ部の命令フェッチが順に行われていることを検出する処理とを組み合わせることとした。これにより、HVコードのエントリ部の命令が多い場合に、短時間で処理が行われたために時間計測のみでは検出できないという不正な割り込みを検出することができる。これにより、安全性が向上する。   According to the system LSI 2200 of the above-described embodiment, the interrupt prevention based on time measurement is combined with the process of detecting that the instruction fetch of the entry part of the HV code shown in the third embodiment is sequentially performed. It was decided. As a result, when there are many instructions in the entry portion of the HV code, it is possible to detect an illegal interrupt that cannot be detected only by time measurement because the processing is performed in a short time. Thereby, safety is improved.

(変形例)
また、上述した各実施の形態に限定されるものではなく、以下に例示するような種々の変形が可能である。
(Modification)
Moreover, it is not limited to each embodiment mentioned above, The various deformation | transformation which is illustrated below is possible.

(変形例1)
上述した第1〜6の実施の形態では、プロセッサ101の命令フェッチ単位が1命令毎の場合について説明した。しかしながら、上述した実施の形態は、命令フェッチ単位を1命令毎に制限するものではない。そこで、本変形例では2命令毎の例について説明する。
(Modification 1)
In the first to sixth embodiments described above, the case where the instruction fetch unit of the processor 101 is one instruction has been described. However, the above-described embodiment does not limit the instruction fetch unit for each instruction. Therefore, in this modification, an example for every two instructions will be described.

本変形例にかかるシステムLSIでは、プロセッサが2命令毎に命令フェッチを行う。そして、命令フェッチの際にプロセッサが割り込み禁止状態であるか否かの確認手法は、上述した実施の形態と同様とする。   In the system LSI according to this modification, the processor fetches an instruction every two instructions. A method for confirming whether or not the processor is in an interrupt disabled state at the time of instruction fetch is the same as that in the above-described embodiment.

そして、命令フェッチ単位が複数命令の場合、HVコードのエントリ部における命令の配置によっては割込み禁止状態を偽装される可能性がある。そこで、HVコードのエントリ部で割り込み禁止状態が偽装される命令の配置について説明する。   When the instruction fetch unit is a plurality of instructions, there is a possibility that the interrupt disabled state is disguised depending on the arrangement of instructions in the entry part of the HV code. Therefore, the arrangement of instructions in which the interrupt disabled state is impersonated in the entry part of the HV code will be described.

図24に示した例では、HVコードのエントリ部が2命令の場合とする。そして、プロセッサの命令フェッチ単位の2命令毎とする。そして、エントリ部の命令1が命令フェッチ単位のアドレス境界に配置された場合、一回の命令フェッチでエントリ部の2命令が同時に読み出される。   In the example shown in FIG. 24, it is assumed that the entry part of the HV code is 2 instructions. Then, every two instructions in the instruction fetch unit of the processor. When the instruction 1 in the entry part is arranged at the address boundary in the instruction fetch unit, two instructions in the entry part are simultaneously read out by one instruction fetch.

そのため、第3、第4の実施の形態で示したような命令フェッチの確認を行った場合、命令フェッチの確認を1度しか行わない。この場合、次に示すような割込み禁止状態の偽装が考えられる。   For this reason, when instruction fetch confirmation as shown in the third and fourth embodiments is performed, instruction fetch confirmation is performed only once. In this case, the following disguise of interrupt disabled state can be considered.

図24に示すように、不正ユーザコードは、まずR0に偽のSRの値を読み込んだあと、割込みを許可する。その後、エントリ部の命令2にジャンプする。この時、命令フェッチは2命令単位で発生するため、命令1のアドレスに対して命令フェッチが発生する。そのため、動作モード管理回路が、正しくHVコードのエントリ部が呼び出されたと判断することになる。にもかかわらず、エントリ部の命令2は、割込み許可状態であるにもかかわらず、割込み禁止を表す偽SR値を、アドレス“CheckAdr”に書き込むことになる。   As shown in FIG. 24, the unauthorized user code first reads a fake SR value into R0 and then permits an interrupt. Thereafter, the process jumps to instruction 2 in the entry part. At this time, since instruction fetch occurs in units of two instructions, instruction fetch occurs for the address of instruction 1. Therefore, the operation mode management circuit determines that the entry part of the HV code has been correctly called. Nevertheless, even though the instruction 2 in the entry section is in the interrupt enabled state, it writes a false SR value indicating interrupt prohibition to the address “CheckAdr”.

これによりHVコードが割込み許可のまま実行される。そして、不正ユーザコードにより割込みが発生すると、動作モードがHVモードの状態で、不正ユーザコードの割込みハンドラにジャンプしてしまう。   As a result, the HV code is executed with the interrupt permitted. When an interrupt occurs due to an unauthorized user code, the operation mode is in the HV mode, and the routine jumps to an unauthorized user code interrupt handler.

そこで本変形例におけるシステムLSIのHVコード格納領域に以下に示すHVコードを格納することとした。   Therefore, the following HV codes are stored in the HV code storage area of the system LSI in this modification.

つまり、HVコードをHVコード格納領域に格納する際、上述した偽装を防ぐために、本来のエントリ部の先頭命令を、最初の命令フェッチ単位の最後に配置することとした。   In other words, when the HV code is stored in the HV code storage area, the head instruction of the original entry part is arranged at the end of the first instruction fetch unit in order to prevent the above-mentioned impersonation.

図25に示したHVコードでは、エントリ部に命令1、命令3を2命令境界に配置した。これにより、プロセッサからのフェッチ要求では、命令1と命令2、命令3と命令4がそれぞれ同時にフェッチされる。   In the HV code shown in FIG. 25, instruction 1 and instruction 3 are arranged at the boundary of two instructions in the entry part. Thereby, in the fetch request from the processor, instruction 1 and instruction 2, and instruction 3 and instruction 4 are fetched simultaneously.

そして、上述した偽装を防ぐために、本来のエントリ部の最初の命令であるmove命令は、最初の命令フェッチ単位の最後、つまり2命令目に配置される。そして、エントリ部の2番目の命令であるstore命令は、2番目の命令フェッチ単位の最初、つまり3命令目に配置される。これにより、不正ユーザコードが、上述した偽装を行おうとした場合、命令フェッチ単位1のフェッチ要求がなされず、命令フェッチ単位2がフェッチ要求なされることになり、動作モード管理回路は異常なフェッチ要求が行われたと判断することができる。   In order to prevent the above-mentioned impersonation, the move instruction which is the first instruction of the original entry part is arranged at the end of the first instruction fetch unit, that is, at the second instruction. The store instruction, which is the second instruction in the entry section, is arranged at the beginning of the second instruction fetch unit, that is, at the third instruction. As a result, when an unauthorized user code tries to perform the above-mentioned disguise, the fetch request for instruction fetch unit 1 is not made, but the fetch request for instruction fetch unit 2 is made, and the operation mode management circuit makes an abnormal fetch request. Can be determined.

また、命令フェッチ単位の命令数が複数命令の場合にも、上述した実施の形態で説明した処理は、ほぼそのまま適用可能である。   Further, even when the number of instructions in the instruction fetch unit is a plurality of instructions, the processing described in the above embodiment can be applied almost as it is.

そして、上述した実施の形態において、命令(例えばn個の命令)を命令フェッチ単位(例えばn個の命令フェッチ単位)に置き換え、変数iがエントリ部における何番目の命令としていたのを何番目の命令フェッチ単位に置き換え、命令のアドレスを命令フェッチ単位の先頭アドレスと置き換えることで、命令フェッチ単位の命令数が複数命令に対応できる。   In the above-described embodiment, an instruction (for example, n instructions) is replaced with an instruction fetch unit (for example, n instruction fetch units), and what number instruction the variable i has been set to in the entry part. By replacing with the instruction fetch unit and replacing the instruction address with the head address of the instruction fetch unit, the number of instructions in the instruction fetch unit can correspond to a plurality of instructions.

(変形例2)
上述した第1〜6の実施の形態では、プロセッサ101がプリフェッチ機能を有しない場合について説明した。しかしながら、上述した実施の形態は、プロセッサにプリフェッチ機能を有していない場合に制限するものではない。そこで、本変形例ではプリフェッチ機能を有する場合について説明する。
(Modification 2)
In the first to sixth embodiments described above, the case where the processor 101 does not have a prefetch function has been described. However, the above-described embodiment is not limited to the case where the processor does not have a prefetch function. Therefore, in this modification, a case where a prefetch function is provided will be described.

システムLSIの備えられたプロセッサが命令のプリフェッチ機能を持つ場合、ある命令の実行中に、それ以降の命令の命令フェッチが行われる。そのため、ある命令に対する命令フェッチを検出したとしても、その命令が必ず実行されるとは限らない。   When the processor provided with the system LSI has an instruction prefetch function, instruction fetch of the subsequent instructions is performed during execution of a certain instruction. Therefore, even if an instruction fetch for an instruction is detected, the instruction is not always executed.

図2に示したHVコードのエントリ部では、命令2でSRの値をCheckAdrに書き込むことにより、割込み禁止状態であることを保証している。しかしながら、プロセッサが命令のプリフェッチ機能を持つ場合には、命令1の実行中に既に命令2がプリフェッチされてしまう。   In the entry portion of the HV code shown in FIG. 2, the SR value is written to CheckAdr by the instruction 2 to guarantee that the interrupt is prohibited. However, when the processor has an instruction prefetch function, the instruction 2 is already prefetched during the execution of the instruction 1.

このような場合に対応するために、エントリ部の割込み禁止を保証する最終の命令(以下、保証命令と呼ぶ)までが正しく実行された時に、プリフェッチにより命令フェッチ要求が行われる命令の範囲をあらかじめ調べておき、エントリ部の命令フェッチの確認を行う際には、それらのプリフェッチ範囲も含めて命令フェッチを確認すればよい。   In order to cope with such a case, when the instruction up to the last instruction (hereinafter referred to as a guaranteed instruction) that guarantees prohibition of interrupt in the entry portion is correctly executed, the range of instructions for which an instruction fetch request is made by prefetching is determined in advance. It is sufficient to check the instruction fetch including the prefetch range when checking the instruction fetch in the entry part.

図26に示すように、命令2以降は、フェッチが行われた後、少し時間が経過してから実行が行われる。そして、エントリ部が2命令を実行する必要がある場合、2番目の命令が実行されている時に行われる命令フェッチも確認すればよい。図26に示した例では、命令4の命令フェッチを確認することで、命令2の命令の実行が保証される。   As shown in FIG. 26, the instruction 2 and subsequent instructions are executed after a little time has elapsed after fetching. If the entry unit needs to execute two instructions, the instruction fetch performed when the second instruction is executed may be confirmed. In the example shown in FIG. 26, the execution of the instruction 2 is guaranteed by confirming the instruction fetch of the instruction 4.

そこで、上述した実施の形態で行った処理を、プリフェッチ機能付のプロセッサに対応させるには、HVコードのエントリ部に含まれている保証命令までの命令に加え、上記のプリフェッチ範囲の命令もエントリ部に含める必要がある。   Therefore, in order to make the processing performed in the above-described embodiment correspond to a processor with a prefetch function, in addition to the instructions up to the guarantee instruction included in the entry part of the HV code, the instructions in the prefetch range are also entered. It is necessary to include in the department.

まず、命令フェッチ単位の命令数=1の場合にプリフェッチ機能に対応する方法について説明する。図27に示すHVコードは、図3に示したHVコードと同様に、本来は2命令で割込み禁止状態をチェックするエントリ部を有する。   First, a method corresponding to the prefetch function when the number of instructions per instruction fetch unit = 1 is described. Like the HV code shown in FIG. 3, the HV code shown in FIG. 27 originally has an entry part for checking the interrupt disabled state with two instructions.

図27に示した例では、本来のエントリ部である命令1、命令2のフェッチ要求が行われた後、命令2が実行されることでアドレス‘CheckAdr’に書き込みが行われるまでに、以降の命令nまでがプリフェッチされる。なお、命令nの数は、プロセッサの性能に依存する。そこで、図27に示した例では、命令nまでnop命令(何もしない命令9を配置することとした。   In the example shown in FIG. 27, after the fetch request for the instruction 1 and the instruction 2, which are the original entry parts, is performed, the instruction 2 is executed, and then writing to the address “CheckAdr” is performed. Up to instruction n is prefetched. Note that the number of instructions n depends on the performance of the processor. Therefore, in the example shown in FIG. 27, the nop instruction (the instruction 9 that does nothing) is arranged up to the instruction n.

なお、本変形例では、プリフェッチされる範囲に、説明のためにnop命令(何もしない命令)を配置してあるが、HVの処理コード本体を配置してもよい。   In this modification, a nop instruction (an instruction that does nothing) is arranged in the prefetched range for explanation, but an HV processing code body may be arranged.

つまり、本変形例において第1、第3又は第5の実施の形態で示した処理を適用する場合は、プリフェッチされる命令nは、命令1の実行時には未だプリフェッチされず、命令2の実行開始から‘CheckAdr’へのデータ書込みまでにプリフェッチされる命令であることが望ましい。   That is, when the processing shown in the first, third, or fifth embodiment is applied in this modification, the prefetched instruction n is not yet prefetched when the instruction 1 is executed, and the execution of the instruction 2 is started. It is desirable that the instruction be prefetched until data is written to 'CheckAdr'.

なお、本変形例のHVコードと異なるが、第2、第4又は第6の実施の形態で示した処理に適用する場合は、命令2の実行中にプリフェッチされる命令であることが望ましい。   Although different from the HV code of this modification, when applied to the processing shown in the second, fourth, or sixth embodiment, it is desirable that the instruction be prefetched during the execution of the instruction 2.

このように、プリフェッチ範囲までを含めてHVコードのエントリ部に命令を備えることで、上述した実施の形態で示した処理手順を、プリフェッチ機能を有するプロセッサを備えるシステムLSIに適用できる。   In this way, by providing instructions in the entry portion of the HV code including the prefetch range, the processing procedure described in the above-described embodiment can be applied to a system LSI including a processor having a prefetch function.

同様に、命令フェッチ単位の命令数が複数の場合についても、プリフェッチ機能を持つプロセッサに対応することができる。   Similarly, even when the number of instructions per instruction fetch is plural, it is possible to deal with a processor having a prefetch function.

図28に示すHVコードは、図25と同様に、命令フェッチ単位が2命令毎に対応するエントリ部を有している。図28に示す例では、本来のエントリコードである命令2、命令3のフェッチ要求が行われ、命令3が実行されることでアドレス‘CheckAdr’への書き込みが行われるまで、命令5および命令6がプリフェッチされる例である。   As in FIG. 25, the HV code shown in FIG. 28 has an entry portion in which the instruction fetch unit corresponds to every two instructions. In the example shown in FIG. 28, instructions 5 and 6 are fetched until a fetch request is made for instruction 2 and instruction 3, which are the original entry codes, and writing to address 'CheckAdr' is performed by executing instruction 3. Is an example of prefetching.

上述したように、プリフェッチされる範囲までを含めてエントリ部を構成することで、上述した実施の形態で示した処理手順を、プリフェチ機能を有するプロセッサを備えたシステムLSIに適用できる。   As described above, by configuring the entry part including the prefetch range, the processing procedure described in the above embodiment can be applied to a system LSI including a processor having a prefetch function.

第1の実施の形態にかかるシステムLSIの構成を示すブロック図である。1 is a block diagram showing a configuration of a system LSI according to a first embodiment. 第1の実施の形態にかかるシステムLSIが有するHVコードのバイナリコードの例を示した図である。It is the figure which showed the example of the binary code of the HV code which the system LSI concerning 1st Embodiment has. 他の実施の形態にかかるシステムLSIが有するHVコードのバイナリコードの例を示した図である。It is the figure which showed the example of the binary code of the HV code which the system LSI concerning other embodiment has. 従来のシステムLSI上で、ハイパーバイザの複数の命令で構成されるエントリ部の実行途中に、不正な処理を行うソフトウェアコードに実行が移る第1の例を示した図である。It is the figure which showed the 1st example in which execution transfers to the software code which performs an unauthorized process in the middle of execution of the entry part comprised by the several instruction | command of a hypervisor on the conventional system LSI. 第1の実施の形態にかかるシステムLSIのソフトウェア構成の例を示した図である。It is a figure showing an example of software composition of a system LSI concerning a 1st embodiment. 第1の実施の形態にかかるシステムLSIにおいて、HVコードの実行の有無に応じて動作モードを切り替えて、HV保護領域に対するアクセスを制御する処理手順を示したフローチャートである。6 is a flowchart showing a processing procedure for controlling access to an HV protection area by switching an operation mode according to whether or not an HV code is executed in the system LSI according to the first embodiment. 第1の実施の形態にかかるシステムLSIにおいて、動作モード管理回路においてHVコードのエントリ部が適切に実行されたことを確認する処理手順を示すフローチャートである。6 is a flowchart showing a processing procedure for confirming that an entry part of an HV code is properly executed in an operation mode management circuit in the system LSI according to the first embodiment. 第1の実施の形態にかかるシステムLSIにおいて、動作モード管理回路のHVモード脱出の検出手順を示すフローチャートである。5 is a flowchart showing a procedure for detecting an escape from the HV mode of the operation mode management circuit in the system LSI according to the first embodiment. 第2の実施の形態にかかるシステムLSIの構成を示すブロック図である。It is a block diagram which shows the structure of the system LSI concerning 2nd Embodiment. 第2の実施の形態にかかるシステムLSIが有するHVコードのバイナリコードの例を示した図である。It is the figure which showed the example of the binary code of the HV code which the system LSI concerning 2nd Embodiment has. 他の実施の形態にかかるシステムLSIが有するHVコードのバイナリコードの例を示した図である。It is the figure which showed the example of the binary code of the HV code which the system LSI concerning other embodiment has. 第2の実施の形態にかかるシステムLSIにおいて、動作モード管理回路においてHVコードのエントリ部が適切に実行されたことを確認する処理手順を示すフローチャートである。14 is a flowchart showing a processing procedure for confirming that an entry part of an HV code is properly executed in an operation mode management circuit in the system LSI according to the second embodiment. 第3の実施の形態にかかるシステムLSIの構成を示すブロック図である。It is a block diagram which shows the structure of the system LSI concerning 3rd Embodiment. 従来のシステムLSI上で、ハイパーバイザの複数の命令で構成されるエントリ部の実行途中に、不正な処理を行うソフトウェアコードに実行が移る第2の例を示した図である。It is the figure which showed the 2nd example by which execution transfers to the software code which performs an illegal process in the middle of execution of the entry part comprised by the several instruction | command of a hypervisor on the conventional system LSI. 第3の実施の形態にかかるシステムLSIにおいて、動作モード管理回路においてHVコードのエントリ部が適切に実行されたことを確認する処理手順を示すフローチャートである。14 is a flowchart illustrating a processing procedure for confirming that an entry part of an HV code is properly executed in an operation mode management circuit in a system LSI according to a third embodiment. 第3の実施の形態の変形例にかかるシステムLSIにおいて、動作モード管理回路においてHVコードのエントリ部が適切に実行されたことを確認する処理手順を示すフローチャートである。14 is a flowchart illustrating a processing procedure for confirming that an entry part of an HV code is appropriately executed in an operation mode management circuit in a system LSI according to a modification of the third embodiment. 第4の実施の形態にかかるシステムLSIの構成を示すブロック図である。It is a block diagram which shows the structure of the system LSI concerning 4th Embodiment. 第4の実施の形態にかかるシステムLSIにおいて、動作モード管理回路においてHVコードのエントリ部が適切に実行されたことを確認する処理手順を示すフローチャートである。14 is a flowchart illustrating a processing procedure for confirming that an entry part of an HV code is properly executed in an operation mode management circuit in a system LSI according to a fourth embodiment. 第5の実施の形態にかかるシステムLSIの構成を示すブロック図である。It is a block diagram which shows the structure of the system LSI concerning 5th Embodiment. 従来のシステムLSI上で、ハイパーバイザの複数の命令で構成されるエントリ部の実行途中に、不正な処理を行うソフトウェアコードに実行が移る第3の例を示した図である。It is the figure which showed the 3rd example in which execution transfers to the software code which performs an unauthorized process in the middle of execution of the entry part comprised by the several instruction | command of a hypervisor on the conventional system LSI. 第5の実施の形態にかかるシステムLSIにおいて、動作モード管理回路においてHVコードのエントリ部が適切に実行されたことを確認する処理手順を示すフローチャートである。In the system LSI according to the fifth embodiment, it is a flowchart showing a processing procedure for confirming that the entry portion of the HV code is properly executed in the operation mode management circuit. 第6の実施の形態にかかるシステムLSIの構成を示すブロック図である。It is a block diagram which shows the structure of the system LSI concerning 6th Embodiment. 第6の実施の形態にかかるシステムLSIにおいて、動作モード管理回路においてHVコードのエントリ部が適切に実行されたことを確認する処理手順を示すフローチャートである。In the system LSI according to the sixth embodiment, it is a flowchart showing a processing procedure for confirming that the entry part of the HV code is properly executed in the operation mode management circuit. 複数の命令を同時にフェッチするプロセッサを有する従来のシステムLSI上で、ハイパーバイザの複数の命令で構成されるエントリ部の実行途中に、不正な処理を行うソフトウェアコードに実行が移る例を示した図である。The figure which showed the example which execution moves to the software code which performs illegal processing in the middle of execution of the entry section which consists of plural instructions of the hypervisor on the conventional system LSI which has the processor which fetches plural instructions simultaneously It is. 命令フェッチ単位が2命令毎の場合に、図2に示したエントリ部の各命令を偽装防止できるように配置したHVコードの例を示した図である。FIG. 3 is a diagram showing an example of HV code arranged so that each instruction in the entry section shown in FIG. 2 can be prevented from being camouflaged when the instruction fetch unit is every two instructions. プロセッサがプリフェッチ機能を有する場合において、命令のフェッチと実行の時間関係を示した説明図である。When a processor has a prefetch function, it is explanatory drawing which showed the time relationship of instruction fetch and execution. プリフェッチ機能付きのプロセッサからのフェッチ要求が行われた場合でも割り込み禁止状態であることが保証できるHVコードの例を示した図である。It is the figure which showed the example of the HV code which can ensure that it is an interruption prohibition state, even when the fetch request from the processor with a prefetch function is performed. プリフェッチ機能付きのプロセッサからの2命令のフェッチ要求が行われた場合でも割り込み禁止状態であることが保証できるHVコードの例を示した図である。It is the figure which showed the example of the HV code which can be guaranteed that it is an interruption prohibition state, even when the fetch request of 2 instructions from the processor with a prefetch function is performed.

符号の説明Explanation of symbols

100、900、1300、1700、1900、2200 システムLSI
101 プロセッサ
102、901、1301、1701、1901、2201 動作モード管理回路
103 メモリアクセス制御部
104、1302 第1HV領域保護回路
105 デバイスアクセス制御部
106 第2HV領域保護回路
107 保護メモリ
112、911、1902、2202 HVコード格納領域
121、1311 フェッチ検出部
122、921、1312 フェッチ判断部
123 時間計測部
124 命令検出部
125、922 時間判断部
126 実行判断部
127 モード切替部
131、1321 第1制御部
132 第2制御部
150 メモリ
151 第1のゲストOS格納領域
152 第2のゲストOS格納領域
153 第3のゲストOS格納領域
154 第1メモリ領域
155 第2メモリ領域
156 第3メモリ領域
160 デバイス
100, 900, 1300, 1700, 1900, 2200 System LSI
101 processor 102, 901, 1301, 1701, 1901, 2012 operation mode management circuit 103 memory access control unit 104, 1302 first HV region protection circuit 105 device access control unit 106 second HV region protection circuit 107 protection memory 112, 911, 1902, 2202 HV code storage area 121, 1311 Fetch detection unit 122, 921, 1312 Fetch determination unit 123 Time measurement unit 124 Instruction detection unit 125, 922 Time determination unit 126 Execution determination unit 127 Mode switching unit 131, 1321 First control unit 132 First 2 control unit 150 memory 151 first guest OS storage area 152 second guest OS storage area 153 third guest OS storage area 154 first memory area 155 second memory area 156 third memory area 60 device

Claims (7)

プロセッサと、
第1のアクセス範囲へ前記プロセッサをアクセスさせる特権ソフトウェアを記憶する第1の記憶部と、
前記第1のアクセス範囲よりも狭い第2のアクセス範囲へ前記プロセッサをアクセスさせるソフトウェアを記憶する第2の記憶部と、
前記第1の記憶部と前記プロセッサとを接続し、前記特権ソフトウェアを前記プロセッサで実行するために必要なデータの通信を行う通信路と、
前記プロセッサが前記通信路を介して、前記特権ソフトウェアに含まれる命令であって当該特権ソフトウェアを起動させる際に実行される複数の命令のうち、最初の命令が格納された格納アドレスへのフェッチを検出するフェッチ検出手段と、
前記プロセッサが前記通信路を介して、前記プロセッサにより前記複数の命令のうちの特定の命令が実行されたことを検出する検出手段と、
前記プロセッサが前記ソフトウェアを実行しているときに前記フェッチ検出手段により前記格納アドレスへのフェッチを検出してから、前記検出手段が前記特定の命令が実行されたことを検出するまでに、所定の時間が経過したか否かを判断する時間判断手段と、
前記所定の時間が経過していないと判断した場合に、前記プロセッサが前記特定の命令を実行した結果から、前記プロセッサへの割り込みを禁止しているか否かを判断する判断手段と、
前記実行判断手段が前記プロセッサへの割り込みを禁止していると判断した場合に、前記プロセッサに対して前記第1のアクセス範囲のアクセスを開放する制御手段と、
を備えることを特徴とする情報処理装置。
A processor;
A first storage unit for storing privileged software that allows the processor to access a first access range;
A second storage unit that stores software that causes the processor to access a second access range that is narrower than the first access range;
A communication path for connecting the first storage unit and the processor and performing communication of data necessary for executing the privileged software on the processor;
Of the plurality of instructions executed when the processor starts up the privileged software that is included in the privileged software via the communication path, the processor fetches the first instruction to the storage address. Fetch detection means for detecting;
Detecting means for detecting that a specific instruction of the plurality of instructions is executed by the processor via the communication path;
When the processor is executing the software, the fetch detection unit detects a fetch to the storage address, and the detection unit detects that the specific instruction has been executed. Time determination means for determining whether time has elapsed,
A determination means for determining whether or not interrupting to the processor is prohibited from a result of the processor executing the specific instruction when it is determined that the predetermined time has not elapsed;
Control means for releasing the access in the first access range to the processor when the execution determining means determines that the interrupt to the processor is prohibited;
An information processing apparatus comprising:
前記プロセッサは、複数単位で命令のフェッチを行い、
前記フェッチ検出手段は、前記格納アドレスとして、前記最初の命令を含む複数単位で命令の先頭アドレスのフェッチを検出すること、
を特徴とする請求項1に記載の情報処理装置。
The processor fetches instructions in a plurality of units,
The fetch detecting means detects a fetch of a head address of an instruction in a plurality of units including the first instruction as the storage address;
The information processing apparatus according to claim 1.
前記第1の記憶部は、前記複数の命令のうち最初の命令を、前記プロセッサがフェッチする複数単位の命令の最後尾に配置すること、
を特徴とする請求項2に記載の情報処理装置。
The first storage unit arranges a first instruction among the plurality of instructions at a tail end of a plurality of instructions fetched by the processor;
The information processing apparatus according to claim 2.
前記プロセッサは、実行する前に予め命令のフェッチを行うプリフェッチ機能を有し、
前記記憶部は、前記プロセッサが書き込み禁止状態であることを確認する命令を実行しているタイミングで前記プロセッサのフェッチ対象が存在する数で、前記複数の命令を構成すること、
を特徴とする請求項1に記載の情報処理装置。
The processor has a prefetch function for fetching instructions in advance before execution,
The storage unit constitutes the plurality of instructions by the number of fetch targets of the processor at a timing at which an instruction for confirming that the processor is in a write-protected state is executed;
The information processing apparatus according to claim 1.
プロセッサと、
第1のアクセス範囲へ前記プロセッサをアクセスさせる特権ソフトウェアを記憶する第1の記憶部と、
前記第1のアクセス範囲よりも狭い第2のアクセス範囲へ前記プロセッサをアクセスさせるソフトウェアを記憶する第2の記憶部と、
前記第1の記憶部と前記プロセッサとを接続し、前記特権ソフトウェアを前記プロセッサで実行するために必要なデータの通信を行う通信路と、
前記プロセッサが前記通信路を介して、前記特権ソフトウェアに含まれる命令であって当該特権ソフトウェアを起動させる際に実行される複数の命令のうち、最初の命令が格納された第1格納アドレスへのフェッチを検出する第1フェッチ検出手段と、
前記プロセッサが前記通信路を介して、前記第1の記憶部に記憶される前記特権ソフトウェアに含まれる前記複数の命令のうち特定の命令が格納された第2格納アドレスへのフェッチを検出する第2フェッチ検出手段と、
前記プロセッサが前記ソフトウェアを実行しているときに前記第1フェッチ検出手段により前記第1格納アドレスへのフェッチを検出してから、前記第2フェッチ検出手段により前記第2格納アドレスへのフェッチを検出するまでに、所定の時間が経過したか否かを判断する時間判断手段と、
前記所定の時間が経過していないと判断した場合に、前記プロセッサに対して前記第1のアクセス範囲のアクセスを開放する制御手段と、
を備えることを特徴とする情報処理装置。
A processor;
A first storage unit for storing privileged software that allows the processor to access a first access range;
A second storage unit that stores software that causes the processor to access a second access range that is narrower than the first access range;
A communication path for connecting the first storage unit and the processor and performing communication of data necessary for executing the privileged software on the processor;
Of the plurality of instructions that are executed when the processor starts up the privileged software that is included in the privileged software via the communication path, the first storage address storing the first instruction is stored. First fetch detection means for detecting a fetch;
The processor detects a fetch to a second storage address storing a specific instruction among the plurality of instructions included in the privileged software stored in the first storage unit via the communication path. Two fetch detection means;
When the processor is executing the software, the first fetch detection means detects a fetch to the first storage address, and then the second fetch detection means detects a fetch to the second storage address. Time determination means for determining whether or not a predetermined time has elapsed before
Control means for releasing access of the first access range to the processor when it is determined that the predetermined time has not elapsed;
An information processing apparatus comprising:
プロセッサと、
第1のアクセス範囲へ前記プロセッサをアクセスさせる特権ソフトウェアを記憶する第1の記憶部と、
前記第1のアクセス範囲よりも狭い第2のアクセス範囲へ前記プロセッサをアクセスさせるソフトウェアを記憶する第2の記憶部と、
前記第1の記憶部と前記プロセッサとを接続し、前記特権ソフトウェアを前記プロセッサで実行するために必要なデータの通信を行う通信路と、
前記プロセッサが前記通信路を介して、前記特権ソフトウェアに含まれる命令であって当該特権ソフトウェアを起動させる際に実行される複数の命令へのフェッチを検出するフェッチ検出手段と、
前記プロセッサが前記ソフトウェアを実行しているときに、検出したフェッチ先のアドレスから、前記複数の命令を構成する各命令が格納された格納アドレスへのフェッチが、命令順に行われているか否かを判断するフェッチ判断手段と、
前記複数の命令のフェッチが命令順に行われたと判断した場合に、前記プロセッサにより前記複数の命令うちの特定の命令が実行されたことを検出する検出手段と、
検出した前記複数の命令の実行結果から、前記プロセッサへの割り込み禁止されているか否かを判断する判断手段と、
割り込み禁止されていると判断した場合に、前記プロセッサに対して前記第1のアクセス範囲のアクセスを開放する制御手段と、
を備えることを特徴とする情報処理装置。
A processor;
A first storage unit for storing privileged software that allows the processor to access a first access range;
A second storage unit that stores software that causes the processor to access a second access range that is narrower than the first access range;
A communication path for connecting the first storage unit and the processor and performing communication of data necessary for executing the privileged software on the processor;
Fetch detection means for detecting fetches to a plurality of instructions executed when the processor starts up the privileged software, which is an instruction included in the privileged software, via the communication path;
Whether or not the fetch from the detected fetch destination address to the storage address storing each instruction constituting the plurality of instructions is performed in the order of instructions when the processor is executing the software Fetch determination means for determining;
Detecting means for detecting that a specific instruction of the plurality of instructions is executed by the processor when it is determined that the plurality of instructions are fetched in the order of instructions;
Determination means for determining whether or not an interrupt to the processor is prohibited from the detected execution results of the plurality of instructions;
Control means for releasing access in the first access range to the processor when it is determined that interrupts are prohibited;
An information processing apparatus comprising:
プロセッサと、
第1のアクセス範囲へ前記プロセッサをアクセスさせる特権ソフトウェアを記憶する第1の記憶部と、
前記第1のアクセス範囲よりも狭い第2のアクセス範囲へ前記プロセッサをアクセスさせるソフトウェアを記憶する第2の記憶部と、
前記第1の記憶部と前記プロセッサとを接続し、前記特権ソフトウェアを前記プロセッサで実行するために必要なデータの通信を行う通信路と、
前記プロセッサが前記通信路を介して、前記特権ソフトウェアに含まれる命令であって当該特権ソフトウェアを起動させる際に実行される複数の命令へのフェッチを検出するフェッチ検出手段と、
前記プロセッサが前記ソフトウェアを実行しているときに、検出したフェッチ先のアドレスから、前記複数の命令を構成する各命令が格納された格納アドレスへのフェッチが行われているか否かを判断するフェッチ判断手段と、
前記複数の命令のフェッチが命令順に行われたと判断した場合に、前記プロセッサに対して前記第1のアクセス範囲のアクセスを開放する制御手段と、
を備えることを特徴とする情報処理装置。
A processor;
A first storage unit for storing privileged software that allows the processor to access a first access range;
A second storage unit that stores software that causes the processor to access a second access range that is narrower than the first access range;
A communication path for connecting the first storage unit and the processor and performing communication of data necessary for executing the privileged software on the processor;
Fetch detection means for detecting fetches to a plurality of instructions executed when the processor starts up the privileged software, which is an instruction included in the privileged software, via the communication path;
Fetch for determining whether or not fetching is performed from the detected fetch destination address to the storage address storing each of the instructions constituting the plurality of instructions when the processor is executing the software Judgment means,
Control means for releasing access of the first access range to the processor when it is determined that the plurality of instructions are fetched in the order of instructions;
An information processing apparatus comprising:
JP2007087388A 2007-03-29 2007-03-29 Information processor Pending JP2008250387A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2007087388A JP2008250387A (en) 2007-03-29 2007-03-29 Information processor
US11/898,880 US20080244229A1 (en) 2007-03-29 2007-09-17 Information processing apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007087388A JP2008250387A (en) 2007-03-29 2007-03-29 Information processor

Publications (1)

Publication Number Publication Date
JP2008250387A true JP2008250387A (en) 2008-10-16

Family

ID=39796324

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007087388A Pending JP2008250387A (en) 2007-03-29 2007-03-29 Information processor

Country Status (2)

Country Link
US (1) US20080244229A1 (en)
JP (1) JP2008250387A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014532201A (en) * 2011-10-13 2014-12-04 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method, system and computer program for memory protection of virtual guest

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5505781B2 (en) * 2008-02-04 2014-05-28 日本電気株式会社 Trace / failure observation system, trace / failure observation method, and trace / failure observation program
US8549516B2 (en) * 2008-12-23 2013-10-01 Citrix Systems, Inc. Systems and methods for controlling, by a hypervisor, access to physical resources
JP4572259B1 (en) * 2009-04-27 2010-11-04 株式会社フォティーンフォティ技術研究所 Information device, program, and illegal program code execution prevention method
US8433889B2 (en) * 2010-04-28 2013-04-30 Acer Cloud Technology, Inc. Operating system context switching
GB2482701C (en) * 2010-08-11 2018-12-26 Advanced Risc Mach Ltd Illegal mode change handling
US20130054135A1 (en) * 2011-08-31 2013-02-28 Ragnar H. Backsen, JR. Electronic cartage application
US10229043B2 (en) * 2013-07-23 2019-03-12 Intel Business Machines Corporation Requesting memory spaces and resources using a memory controller
JP6117068B2 (en) * 2013-09-20 2017-04-19 株式会社東芝 Information processing apparatus and program
JP2023023847A (en) * 2021-08-06 2023-02-16 東芝テック株式会社 Information processing apparatus and control program therefor

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6369855B1 (en) * 1996-11-01 2002-04-09 Texas Instruments Incorporated Audio and video decoder circuit and system
US7120717B2 (en) * 2004-02-13 2006-10-10 Hewlett-Packard Development Company, L.P. Method and apparatus for controlling interrupt storms
US7913055B2 (en) * 2006-11-04 2011-03-22 Virident Systems Inc. Seamless application access to hybrid main memory
US7831818B2 (en) * 2007-06-20 2010-11-09 Freescale Semiconductor, Inc. Exception-based timer control

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014532201A (en) * 2011-10-13 2014-12-04 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method, system and computer program for memory protection of virtual guest

Also Published As

Publication number Publication date
US20080244229A1 (en) 2008-10-02

Similar Documents

Publication Publication Date Title
JP2008250387A (en) Information processor
US11580264B2 (en) Systems and methods for controlling access to secure debugging and profiling features of a computer system
EP2805246B1 (en) Dynamic execution prevention to inhibit return-oriented programming
JP4872001B2 (en) Memory access safety management
JP5100133B2 (en) Information processing device
US7631196B2 (en) Method and apparatus for loading a trustable operating system
JP4249779B2 (en) Device controller
CN109840410A (en) The method and system of data isolation and protection in a kind of process
JP2008257734A (en) Security control in data processing system based on memory domain
JP3982687B2 (en) Controlling access to multiple isolated memories in an isolated execution environment
JP2008257735A (en) Protected function calling
JP7432586B2 (en) Validating the stack pointer
US10467410B2 (en) Apparatus and method for monitoring confidentiality and integrity of target system
US20220366037A1 (en) Domain transition disable configuration parameter
TWI312253B (en) Data processing apparatus and method for controlling access to a memory in the same
US9633213B2 (en) Secure emulation logic between page attribute table and test interface
Geater ARM® TrustZone®
EP4073635B1 (en) Intermodal calling branch instruction
JP2011150457A (en) Information processing apparatus and memory access control method
JP2009271597A (en) Processor
Lee et al. GENESIS: A Generalizable, Efficient, and Secure Intra-kernel Privilege Separation
CN115269456A (en) Processor and isolated memory protection method
JP2022509722A (en) Devices and methods for handling exception-causing events

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090326

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090804

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090818

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20100119