JP5905904B2 - Controlling debug exception generation - Google Patents

Controlling debug exception generation Download PDF

Info

Publication number
JP5905904B2
JP5905904B2 JP2013550946A JP2013550946A JP5905904B2 JP 5905904 B2 JP5905904 B2 JP 5905904B2 JP 2013550946 A JP2013550946 A JP 2013550946A JP 2013550946 A JP2013550946 A JP 2013550946A JP 5905904 B2 JP5905904 B2 JP 5905904B2
Authority
JP
Japan
Prior art keywords
debug
data processing
value
software
level
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.)
Active
Application number
JP2013550946A
Other languages
Japanese (ja)
Other versions
JP2014507720A (en
Inventor
ジョン ウィリアムズ、マイケル
ジョン ウィリアムズ、マイケル
ロイ グリセンスウェイト、リチャード
ロイ グリセンスウェイト、リチャード
Original Assignee
エイアールエム リミテッド
エイアールエム リミテッド
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 エイアールエム リミテッド, エイアールエム リミテッド filed Critical エイアールエム リミテッド
Publication of JP2014507720A publication Critical patent/JP2014507720A/en
Application granted granted Critical
Publication of JP5905904B2 publication Critical patent/JP5905904B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3648Software debugging using additional hardware
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3648Software debugging using additional hardware
    • G06F11/3656Software debugging using additional hardware using a specific debug interface
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • 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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4812Task transfer initiation or dispatching by interrupt, e.g. masked

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Description

本発明は、データ処理装置、特にデータ処理装置での診断オペレーションに関する。   The present invention relates to data processing devices, and more particularly to diagnostic operations in data processing devices.

ハードウェア、オペレーティング・システム、アプリケーション・プログラム、全体的なシステム設計などの開発を支援するために、データ処理システムで診断オペレーション(例、ソフトウェアとハードウェアの障害の特定と分析(デバッグ))に使用できるようにデータ処理システムに診断メカニズムを提供することが知られている。   Used in data processing systems for diagnostic operations (eg, identifying and analyzing software and hardware faults (debugging)) to support development of hardware, operating systems, application programs, overall system design, etc. It is known to provide diagnostic mechanisms for data processing systems so that they can.

データ処理システムを分析する場合、外部デバッガを使用できる。外部デバッガは、システム上で実行する診断オペレーションを指定する制御信号が、ホストからシステムに渡されるように分析対象システムに接続されているホスト・システムで実行するデバッグ・プログラムを含む。   An external debugger can be used to analyze the data processing system. The external debugger includes a debug program that executes on a host system connected to the system under analysis so that control signals that specify diagnostic operations to be executed on the system are passed from the host to the system.

外部デバッガでは、デバッガが外部ポートを介してターゲットに接続され、デバッグ・ハードウェアをプログラムするために使用される。プロセッサは、デバッグ・イベントにより、データ処理装置が外部デバッガによって問い合わされ、制御される特殊なデバッグ状態に入るようにする。デバッグ・イベントのデバッグ状態エントリへの変換は、ハードウェア認証インタフェースによって制御されるが、デバッグ・ハードウェアをプログラムするデバッガの機能をゲートでコントロールしない。   In an external debugger, the debugger is connected to the target via an external port and is used to program debug hardware. The processor causes a debug event to cause the data processing device to be queried by an external debugger and enter a special debug state that is controlled. The conversion of debug events into debug state entries is controlled by the hardware authentication interface, but does not gate the debugger's ability to program debug hardware.

または、デバッグ・モニタ・ソフトウェアがデバッグ対象のターゲットで実行される自己ホスト型デバッグ・システムであってもよい。プロセッサ上のこうしたデバッグ・ハードウェアは、デバッグ・イベントを生成するようにプログラムされ、プロセッサはデバッグ・イベントがソフトウェアによって処理されるデバッグ例外に変換されるように構成される。多くの場合、デバッグ・ソフトウェアは、特権のない、または階層が低いタスク(通常、他の特権のないアプリケーションをデバッグする場合)として実行され、特権のある、またはより高い階層のソフトウェアのエグゼクティブまたはカーネルのサービスを使用して、デバッグ・ハードウェアをプログラムし、デバッグ・イベントの通知を受け続ける。他のシナリオでは、カーネル自体がデバッグされる。   Alternatively, it may be a self-hosted debugging system in which the debug monitor software is executed on the target to be debugged. Such debug hardware on the processor is programmed to generate debug events, and the processor is configured to translate debug events into debug exceptions that are handled by software. Often, debug software runs as an unprivileged or low-level task (usually when debugging other non-privileged applications) and is a privileged or higher-level software executive or kernel Program your debug hardware and continue to receive debug event notifications using these services. In other scenarios, the kernel itself is debugged.

一般に上記の2つのスキームは、ブレークポイントとウォッチポイントのレジスタなどのデバッグ・ハードウェアのほとんどを共有する。 In general, the above two schemes share most of the debug hardware such as breakpoint and watchpoint registers.

デバッグ・ハードウェアをプログラムするには、少なくとも以下の3つのルートがある。
1)カーネル・モードでのデバッグのためのカーネルのデバッグ・モニタによるもの
2)アプリケーションのデバッグのための特権のないデバッガ・タスクのためのカーネルによるもの
3)専用デバッグ・ポートを介した外部デバッガによるもの
There are at least the following three routes for programming debug hardware:
1) By kernel debug monitor for debugging in kernel mode 2) By kernel for non-privileged debugger tasks for application debugging 3) By external debugger via dedicated debug port thing

デバッグの1つの問題として、おそらく外部エージェントであるデバッグ・エージェントによるブレークポイント・レジスタのプログラミングがあり、これはオペレーティング・システムのコードを含みうるコードで例外を生成することがある。これには、リスクがあり、ソフトウェアの障害を招きうる。   One debugging issue is the programming of breakpoint registers, possibly by an external agent, the debug agent, which can generate exceptions in code that may include operating system code. This is risky and can lead to software failure.

システムの障害を招きうるコード内での例外生成のリスクを減らしながら、オペレーティング・システムを含むシステムのデバッグをできるようにするのが望ましい。   It would be desirable to be able to debug a system, including the operating system, while reducing the risk of exception generation in code that could cause a system failure.

本発明の第1の態様では、以下を含むデータ処理装置を提供する。すなわち、
プログラムの命令実行に応答してデータ処理オペレーションを行うためのデータ処理回路、および
データ処理回路上で実行するデバッグ・ソフトウェアによって制御されるデバッグ・オペレーションを行うためのデバッグ回路を含む。
このデータ処理装置は、現在のデバッグの例外マスク値を保存するためのデータ記憶を含み、
データ処理回路は、クリティカルなコードの実行に応答して、現在のデバッグ例外マスク値をデータ記憶に第1の値として設定し、クリティカルなコード実行の終了に応答して、現在のデバッグ例外マスク値をその第1の値を保存しないようにリセットするように構成される
データ処理回路は、複数の異なるソフトウェア階層レベルに対応するプログラム命令を実行するように構成される。この場合、より高いソフトウェア階層レベルは、より低いソフトウェア階層レベルに比べて大きな特権を持ち、より高い階層レベルからアクセスできるが、より低い階層レベルからはアクセスできない少なくともいくつかのデータ記憶域の場所があるようにする。
この場合、データ処理回路は、現在、ソフトウェアが実行しているレベルと同じ階層レベルで前記デバッグ・ソフトウェアを実行する場合に、現在のデバッグ例外マスク値が第1の値に設定されていなければデバッグ例外取得を許可し、現在のデバッグ例外マスク値が第1の値に設定されていればデバッグ例外取得を許可しないように構成され、事前定義されたより高いソフトウェア階層レベルで前記デバッグ・ソフトウェアを実行する場合は、デバッグ例外取得を許可する。
In a first aspect of the present invention, a data processing apparatus including the following is provided. That is,
A data processing circuit for performing data processing operations in response to execution of program instructions, and
A debug circuit is included for performing debug operations controlled by debug software executing on the data processing circuit .
The data processing apparatus includes a data store for storing a current debug exception mask value;
In response to critical code execution, the data processing circuit sets the current debug exception mask value as the first value in the data store and in response to the end of critical code execution, the current debug exception mask value. Is reset so as not to save its first value .
The data processing circuit is configured to execute program instructions corresponding to a plurality of different software hierarchy levels. In this case, the higher software hierarchy level has greater privileges than the lower software hierarchy level and is accessible from the higher hierarchy level, but there are at least some data storage locations that are not accessible from the lower hierarchy level. To be.
In this case, the data processing circuit debugs if the current debug exception mask value is not set to the first value when the debug software is executed at the same hierarchical level as the level currently being executed by the software. Exception acquisition is allowed and configured to not allow debug exception acquisition if the current debug exception mask value is set to the first value, and the debug software is executed at a predefined higher software hierarchy level In case, debug exception acquisition is allowed.

本発明では、いくつかのコードの実行はパフォーマンスとシステムが正しく挙動するうえでクリティカルであり、こうしたコードに割り込みすると、システムの障害をほぼ招きうることを認識している。処理中にどの時点であっても非同期の割り込みが起こりうるが、これは一般的に現在実行中の命令ストリームの命令とは独立して発生し、しばらくペンディングになることが許容され、処理中に適切なポイントに到達した場合にシステムはこうした例外を取得するように構成されていることも認識している。命令ストリーム内の命令に応答して同期例外が発生するが、これは従来、ただちに取得される。   The present invention recognizes that the execution of some code is critical to performance and system behavior, and interrupting such code can cause system failure. Asynchronous interrupts can occur at any point during processing, but this generally occurs independently of the instructions in the currently executing instruction stream and is allowed to remain pending for a while. We also recognize that the system is configured to catch these exceptions when the appropriate point is reached. A synchronization exception occurs in response to an instruction in the instruction stream, which is conventionally obtained immediately.

同期例外がクリティカルなコードの実行中に発生すると問題となりうる。一般的に、データ処理システムは、クリティカルなコードの間は、データのアボートなどの同期例外を生成しうるメモリ領域へのアクセスは行われないようにし、こうした不測の事態に対して防護する。しかし、本発明では、デバッグ回路によって生成されうる他の同期例外があり、これらは通常の処理オペレーションの制御の範囲外であり、不測の例外として発生することを認識している。こうした例外が取得されないことが重要であり、従って本発明のシステムでは、クリティカルなコードの実行に応答して、プロセッサがマスク値を設定し、このマスク値はクリティカルなコードの実行中に受け取ったデバッグ例外の取得を禁止するために使用される。クリティカルなコードの実行の終了時に、マスク値はリセットされ、例外取得を禁止した値を保持しないようにする。従って、こうした単純ではあるが、簡潔な方法によりクリティカルなコードは、デバッグ中に同期的に生成される例外から保護される。   It can be a problem if synchronous exceptions occur during the execution of critical code. In general, data processing systems protect against such unforeseen situations by preventing access to memory areas that can generate synchronization exceptions such as data aborts during critical code. However, the present invention recognizes that there are other synchronization exceptions that can be generated by the debug circuit, and these are outside the control of normal processing operations and occur as unexpected exceptions. It is important that these exceptions are not taken, so in the system of the present invention, in response to critical code execution, the processor sets a mask value that is received during critical code execution. Used to prohibit getting exceptions. At the end of the execution of critical code, the mask value is reset so that it does not retain the value that prohibits exception acquisition. Thus, such a simple but concise method protects critical code from exceptions that are generated synchronously during debugging.

さらに、多くの処理装置は異なるソフトウェア階層レベルでデータを処理し、特定のメモリ領域とシステム・レジスタへのアクセスは低階層レベルからは禁止され、高階層レベルからは許可される。デバッグ例外マスク値は、現在ソフトウェアが実行しているレベルと同じ階層ではデバッグ例外取得を禁止するために使用可能であり、こうした例外はリエントラント可能な例外と呼ばれることが多い。従って、デバッグ・ソフトウェアが同じ階層で実行することを制御信号が示している場合に、特定の階層レベルで命令を処理する場合、デバッグ例外マスク値を使用してその例外が取得されることを防ぐことができる。これはそのレベルでクリティカルなコードを現在実行中に例外取得を禁止するために使用できる。クリティカルなコードを実行している場合、プロセッサが正しく挙動するために不可欠な値を保存しているレジスタが上書きされる可能性があるため、例外がそのレベルで取得されないことが重要である。しかし、制御信号が、現在コードを実行している階層とは異なる階層レベルで例外が取得されることを示している場合(多くの実施形態では、例外取得はより高い階層レベルでのみ許可される)、この他の階層レベルは独自の割り込みレジスタを持っているため、より低い階層レベルでのクリティカルなコードの割り込みは許容できる。これは、重要な情報を保存しているレジスタが上書きされないためである。こうして、本発明の実施形態では、システムを細分化し、例外取得によってソフトウェアの障害を起こしうる階層レベルでのみ例外取得を禁止する。   In addition, many processing devices process data at different software hierarchy levels, and access to specific memory areas and system registers is prohibited from lower hierarchy levels and allowed from higher hierarchy levels. The debug exception mask value can be used to prohibit the acquisition of debug exceptions at the same level as the level currently being executed by software, and such exceptions are often referred to as reentrant exceptions. Therefore, if the control signal indicates that the debug software is executing in the same hierarchy, use the debug exception mask value to prevent that exception from being taken when processing instructions at a particular hierarchy level. be able to. This can be used to prohibit exceptions while currently executing critical code at that level. When executing critical code, it is important that no exceptions are taken at that level, as registers that store values that are essential for the processor to behave correctly can be overwritten. However, if the control signal indicates that exceptions are taken at a different hierarchy level than the hierarchy that is currently executing the code (in many embodiments, exception acquisition is allowed only at higher hierarchy levels) ) Since other hierarchy levels have their own interrupt registers, critical code interruptions at lower hierarchy levels are acceptable. This is because a register storing important information is not overwritten. Thus, in the embodiment of the present invention, the system is subdivided, and exception acquisition is prohibited only at a hierarchical level that can cause a software failure by exception acquisition.

ある実施形態では、デバッグ回路はデバッグ例外を取得することを示す信号をデータ処理回路に送り、処理回路は現在のデバッグ・マスク値に応じて例外の取得を禁止または許可する。他の実施形態では、デバッグ・マスク値が設定されている場合、処理回路に制御信号を送ることをアサートしないことにより、現在のマスク値に応答するのはデバッグ回路自体である。   In some embodiments, the debug circuit sends a signal to the data processing circuit indicating that a debug exception is to be acquired, and the processing circuit prohibits or permits exception acquisition depending on the current debug mask value. In other embodiments, if the debug mask value is set, it is the debug circuit itself that responds to the current mask value by not asserting sending a control signal to the processing circuit.

実行されるデバッグ・オペレーションは、外部ホストで実行するデバッグ・ソフトウェアによって制御される場合があるが、ある実施形態では、デバッグ回路は、データ処理回路上で実行するソフトウェアによって制御されるデバッグ・オペレーションを行う。   Although debug operations performed may be controlled by debug software executing on an external host, in one embodiment, the debug circuit performs debug operations controlled by software executing on the data processing circuit. Do.

クリティカルなコードは、多数ありうるが、ある実施形態では、その割り込みがソフトウェアの障害を起こしうる複数の命令を含む。   There can be many critical codes, but in one embodiment, the interrupt includes multiple instructions that can cause a software failure.

異なる種類のコードを実行する場合、デバッグ回路から例外取得を禁止するようにデータ処理装置を構成しうるが、例外取得によってソフトウェアの障害を起こしうる場合にコード実行中の取得を禁止すると有用である。こうしたコードを実行する場合に、例外の取得を禁止することが重要であることは明らかである。   When executing different types of code, the data processing device can be configured to prohibit exception acquisition from the debug circuit, but it is useful to prohibit acquisition during code execution when exceptions can cause software failure . Obviously, it is important to prevent exceptions when executing such code.

こうしたコードは、様々なものを含む。例えば、システムを構成するレジスタ値を保存または復元するコード、システム・レジスタの割り込みを確認、無効化、または再有効化するコード、プロセッサの状態をデータ記憶に保存するためのコード、またはそのデータ記憶から状態を復元するコードを含む場合がある。明らかに、プロセッサの状態を正しく保存し、正しく復元することは重要である。従って、こうしたコードの割り込みを回避するのが最良である。   These codes include various things. For example, code that saves or restores the register values that make up the system, code that checks, disables, or re-enables system register interrupts, code that saves the processor state in the data store, or the data store May contain code to restore state from. Obviously, it is important to save and restore the processor state correctly. Therefore, it is best to avoid such code interruptions.

ある実施形態では、データ処理装置は、データ記憶を含む。データ記憶は、複数の異なるソフトウェア階層レベルに対応した複数のデバッグ例外マスク値を保存するように構成される。データ処理回路は、複数のソフトウェア階層レベルの1つに切り替える場合に、現在のデバッグ例外マスク値を、その複数のソフトウェア階層レベルの1つに対して保存されているデバッグ例外マスク値の値に設定するように構成される。   In some embodiments, the data processing device includes data storage. The data store is configured to store a plurality of debug exception mask values corresponding to a plurality of different software hierarchy levels. When the data processing circuit switches to one of a plurality of software hierarchy levels, the current debug exception mask value is set to the value of the debug exception mask value stored for one of the plurality of software hierarchy levels. Configured to do.

ある実施形態では、処理装置は異なるソフトウェア階層レベルに対するデバッグ例外マスク値を保存するための記憶装置を含む。こうした値は、当該レベルでプログラムの命令の実行に切り替える際に、そのデバッグ例外マスク値の現在の値を設定するために使用される。異なる階層レベルに対して異なるマスク値を保存することで、高度な細分性と制御を実現する。   In some embodiments, the processing device includes a storage device for storing debug exception mask values for different software hierarchy levels. These values are used to set the current value of the debug exception mask value when switching to execution of program instructions at that level. High granularity and control is achieved by storing different mask values for different hierarchical levels.

ある実施形態では、データ処理装置は、現在のデバッグ例外マスク値を保存するためのステータス記憶領域を含む。データ処理回路は、ソフトウェアのある階層レベルから異なる階層レベルへの切り替えに応答し、その階層レベルに対してデバッグ例外マスク値をステータス記憶領域に保存し、ある階層レベルに切り替わって戻るときに、そのデバッグ例外マスク値を復元する。   In some embodiments, the data processing apparatus includes a status storage area for storing a current debug exception mask value. The data processing circuit responds to switching from one hierarchical level of the software to a different hierarchical level, stores a debug exception mask value for the hierarchical level in the status storage area, and switches to a hierarchical level to return to the hierarchical level. Restore the debug exception mask value.

または、異なる階層レベルに対して異なるマスク値を保存するのではなく、デバッグ例外マスク値は、階層レベルを離れるときにステータス記憶領域に保存してもよく、デバッグ例外があるレベルでマスクされ、そのレベルに戻るときに再度マスクされるように、この値は、そのレベルに戻る際に、デバッグ例外マスク記憶位置に復元されてもよい。   Or, rather than storing different mask values for different hierarchy levels, debug exception mask values may be stored in the status storage area when leaving a hierarchy level, masked at the level where the debug exception is, and This value may be restored to the debug exception mask location when returning to that level, so that it is masked again when returning to that level.

ある実施形態では、データ処理装置は、ステータス・インジケータを保存するためのステータス記憶領域を含む。このステータス・インジケータの少なくとも1つは、ソフトウェア階層レベルの1つに対応したデバッグ許可ステータス・インジケータを含む。データ処理回路は、事前定義されたソフトウェア階層レベルで命令を実行し、デバッグ・ソフトウェアが処理回路でその階層レベルで実行する場合に以下を行うように構成される。すなわち、その事前定義されたソフトウェア階層レベルに対するデバッグ許可ステータス・インジケータが事前定義された許可値に設定されていて、現在のデバッグ例外マスク値が第1の値に設定されていない場合に例外の取得を許可する。ステータス・インジケータが事前定義された許可値に設定されていないか、または現在のデバッグ例外マスク値がその第1の値に設定されている場合に、その例外の取得を許可しない。   In some embodiments, the data processing device includes a status storage area for storing status indicators. At least one of the status indicators includes a debug permission status indicator corresponding to one of the software hierarchy levels. The data processing circuit is configured to execute instructions at a predefined software hierarchy level and to do the following when debug software executes at that hierarchy level in the processing circuit. That is, get an exception if the debug permission status indicator for that predefined software hierarchy level is set to a predefined permission value and the current debug exception mask value is not set to the first value Allow. If the status indicator is not set to a predefined permission value or the current debug exception mask value is set to its first value, it does not allow the exception to be taken.

本技術では、異なる階層レベルでのシステムのデバッグは、おそらくオペレーティング・システムのコードなどの重要なコードが実行されているより高い階層レベル内での例外のトリガーにつながる可能性があり、こうしたコードの割り込みは望ましくない、ことを認識している。例えば、プロセッサで実行しているオペレーティング・システムがデバッグできるようにシステムがセットアップされている場合、通常のオペレーション中には、オペレーティング・システムで例外の生成が認められないように、ある時点ではデバッグを禁止できることが望ましい場合がある。こうした例外生成は、オペレーティング・システムの障害を招き、セキュリティ上の問題を発生しうる。従って、本発明の実施形態では、特定の階層レベルでデバッグを許可または禁止するように設定できるステータス・インジケータを提供する。このようにして、ステータス・インジケータを設定すると、例えば、システムがテスト中である場合、全階層レベルのデバッグを許可するが、システムが出荷されると、より高い階層レベルでのデバッグを禁止することができる。つまり、システムで実行されるアプリケーションは何でもデバッグできるが、出荷前に完全にテストされたオペレーティング・システムでのデバッグ例外生成は認められない。   With this technology, debugging a system at different hierarchy levels can lead to exceptions triggering in higher hierarchy levels, perhaps where important code such as operating system code is running. Recognize that interrupts are undesirable. For example, if your system is set up so that the operating system running on the processor can be debugged, you can debug at some point during normal operation to prevent the operating system from generating exceptions. It may be desirable to be able to ban. Such exception generation can cause operating system failures and create security problems. Accordingly, embodiments of the present invention provide a status indicator that can be configured to allow or prohibit debugging at a particular hierarchy level. In this way, setting a status indicator, for example, allows debugging at all hierarchy levels if the system is under test, but prohibits debugging at higher hierarchy levels when the system is shipped. Can do. This means that any application running on the system can be debugged, but debug exception generation is not allowed on operating systems that have been fully tested prior to shipping.

これは、例えば、ブレークポイントのレジスタを設定する外部手段がある場合、有用である。こうした場合、外部エージェントは、オペレーティング・システム内で例外を発生しうる。こうした例外は、当該処理システムの制御下にはなく、深刻なエラーを発生する可能性があり、従って回避するのが最良である。   This is useful, for example, when there is an external means of setting a breakpoint register. In such cases, the foreign agent can raise an exception in the operating system. Such exceptions are not under the control of the processing system and can cause serious errors and are therefore best avoided.

ある実施形態では、事前定義されたソフトウェア階層レベルで命令を実行し、デバッグ・ソフトウェアを事前定義されたより高いソフトウェア階層レベルで実行する場合、例外を取得することを示すデバッグ回路からの制御信号の受信に応答して、データ処理回路は例外取得を許可するように構成される。   In an embodiment, receiving a control signal from a debug circuit that indicates that an exception is taken when executing instructions at a predefined software hierarchy level and executing debug software at a predefined higher software hierarchy level. In response, the data processing circuit is configured to allow exception acquisition.

現在、命令を実行しているレベルよりも高い事前定義されたソフトウェア階層レベルでデバッグ・ソフトウェアを実行することを示すデバッグ例外を取得する場合、こうした例外の取得は常に許可される。こうしたより高いレベルは、割り込み値を保存するための独自のレジスタを持っているためである。従って、より低いレベルでクリティカルなコードを割り込みすることになっても、プロセッサの状態が破損されることはないであろう。   If you get a debug exception that indicates that you are running debug software at a predefined software hierarchy level that is higher than the level at which you are currently executing instructions, you are always allowed to get such exceptions. These higher levels have their own registers for storing interrupt values. Thus, interrupting critical code at a lower level will not corrupt the processor state.

ある実施形態では、データ処理回路は、例外に応答してより低いソフトウェア階層レベルからより高いソフトウェア階層レベルに切り替える場合、現在のデバッグ例外マスク値を第1の値に設定するように構成される。   In some embodiments, the data processing circuit is configured to set the current debug exception mask value to a first value when switching from a lower software hierarchy level to a higher software hierarchy level in response to an exception.

例外を取得する際にクリティカルなコードが実行されており、従って、このレベルでさらにデバッグ例外を取得することによってクリティカルなコードが割り込みされないように処理装置がマスク値を設定するのが望ましい。   Critical code is being executed when obtaining an exception, and therefore it is desirable for the processing unit to set a mask value so that critical code is not interrupted by obtaining further debug exceptions at this level.

デバッグ例外は、多くの形式をとりうるが、レジスタに保存されるアドレスであるウォッチポイントの場合がある。この場合、このアドレスへのアクセス、またはアクセスの試みは、デバッグ制御信号のアサートをトリガーする。または、これもデバッグ・レジスタに保存されるアドレスであるブレークポイントである場合がある。この場合、このアドレスを有する命令を実行または実行の試みは、デバッグ制御信号のアサートをトリガーする。   Debug exceptions can take many forms, but can be watchpoints, which are addresses stored in registers. In this case, accessing or attempting to access this address triggers the assertion of the debug control signal. Or it may be a breakpoint, which is also an address stored in a debug register. In this case, an attempt to execute or execute an instruction having this address triggers the assertion of a debug control signal.

ある実施形態では、データ処理回路は、デバッグ例外を取得することデバッグ例外のマスク値が第1の値に設定されていることを示すデバッグ回路からの制御信号の受信に応答して、ペンディングしているデバッグ例外をアサートし、第1の値を保存しないようにマスクがクリアされることに応答して、ペンディングしているデバッグ例外を取得するように構成される。   In some embodiments, the data processing circuit is pending in response to receiving a control signal from the debug circuit to obtain a debug exception and to indicate that the debug exception mask value is set to a first value. Is configured to obtain a pending debug exception in response to the mask being cleared so as not to save the first value.

前述のように、デバッグ例外は同期的例外であり、命令の実行に応答して発生する。マスク値が、例外がトリガーできないことを示す第1の値に設定されている場合、実施形態によっては、ペンディングのデバッグ例外信号が生成され、マスクがクリアされ、第1の値が保存されなくなった場合、デバッグ許可ステータス・インジケータが許可を示していることを前提にペンディングのデバッグ例外を取得可能になる。デバッグ例外は、プログラムをデバッグしている者が、プロセッサの状態を知りたいことを示しているため、これは望ましい。従って、ソフトウェア障害の原因になりうるため、ただちに応答することは禁止されているが、後で応答することは許可され、有用な情報を生成しうる。   As described above, debug exceptions are synchronous exceptions and occur in response to instruction execution. If the mask value is set to a first value indicating that an exception cannot be triggered, in some embodiments, a pending debug exception signal is generated, the mask is cleared, and the first value is no longer saved If the debug permission status indicator indicates permission, a pending debug exception can be obtained. This is desirable because the debug exception indicates that the person debugging the program wants to know the state of the processor. Therefore, it is forbidden to respond immediately because it can cause a software failure, but it is allowed to respond later and can produce useful information.

ある実施形態では、データ処理回路は、ステップ・モードの制御信号に応答して、ステップ・モードで実行するように構成される。この場合、プログラム内の命令は順次ステップとして実行され、このステップ・モードでは、データ処理回路は、各順次命令の実行後にデバッグ例外をアサートするように構成される。   In some embodiments, the data processing circuit is configured to execute in step mode in response to a step mode control signal. In this case, the instructions in the program are executed as sequential steps, and in this step mode, the data processing circuit is configured to assert a debug exception after execution of each sequential instruction.

本発明の実施形態がサポートするデバッグ・モードとして考えられるものは、ステップ・モードがある。この場合、各命令が実行され、その後にデバッグ例外が取得される。こうすることで、プログラムはステップをたどり、各命令の実行後に、レジスタ内の値またはプロセッサの他の状態を照会できるように、デバッグ・ソフトウェアに対して制御が与えられる。   One possible debugging mode supported by embodiments of the present invention is a step mode. In this case, each instruction is executed, and then a debug exception is acquired. This gives control to the debug software so that the program can step through and query the value in the register or other state of the processor after each instruction is executed.

ある実施形態では、データ処理回路が順次命令の1つを実行中に例外を受け取ることに応答して、データ処理装置は、現在のデバッグ例外マスク値を第1の値に設定し、ペンディングのデバッグ例外をアサートするように構成される。また、現在のデバッグ例外マスク値が第1の値に設定されていないことに応答して、データ処理回路はペンディングのデバッグ例外を取得するように構成される。   In some embodiments, in response to the data processing circuit receiving an exception while executing one of the sequential instructions, the data processing device sets the current debug exception mask value to the first value and the pending debug. Configured to assert exceptions. Also, in response to the current debug exception mask value not being set to the first value, the data processing circuit is configured to obtain a pending debug exception.

ステップ・モードで、順次命令の実行中に例外が発生すると、ペンディングのデバッグ例外とデバッグ例外マスクの使用によって、例外でクリティカルなコードの実行中にデバッグ例外が確実に取得されないようにできるが、クリティカルなコードの実行が完了したときに、マスクがクリアされるとデバッグ例外が取得される。   In step mode, if an exception occurs during the execution of a sequential instruction, the use of pending debug exceptions and debug exception masks can help ensure that debug exceptions are not captured during the execution of critical code with exceptions, but critical A debug exception is taken when the mask is cleared when the execution of the correct code is complete.

ある実施形態では、データ処理回路は、例外に応答し、より低い階層からより高いソフトウェアの階層レベルに切り替える場合に、異なるタイプの例外をマスクするために複数のマスクを設定し、単独の命令の実行に応答してマスクのすべてをリセットするように構成される。   In one embodiment, the data processing circuit sets multiple masks to mask different types of exceptions when responding to an exception and switching from a lower hierarchy to a higher software hierarchy level, Configured to reset all of the masks in response to execution.

デバッグ例外は、マスクのリセットに加えてクリティカルなコードの実行中に他の非同期の例外の取得をマスクするように他のマスクが設定される場合がある。この場合、クリティカルなコードの実行の完了が、単独の命令によって示されると、こうした命令の実行により、すべてのマスクのクリアがトリガーされうる。このようにして、他のマスクと合わせてクリアされるため、デバッグのマスクをクリアするために追加のコードを必要としない。   Debug exceptions may have other masks set to mask the acquisition of other asynchronous exceptions during critical code execution in addition to resetting the mask. In this case, if the completion of critical code execution is indicated by a single instruction, execution of such an instruction may trigger the clearing of all masks. In this way, no additional code is required to clear the debug mask because it is cleared along with the other masks.

ある実施形態では、単独の命令は、クリティカルなコードの実行終了を示す命令を含む。   In some embodiments, the single instruction includes an instruction that indicates the end of execution of critical code.

マスクのサブセットは、クリアされるか、または実際は1つの命令に設定されるかであることに注意されたい。処理装置の異なる階層レベルは、多くのものを含みうるが、ある実施形態では、アプリケーション・ソフトウェアが実行される第1の低いレベル、オペレーティング・システムのソフトウェアが実行される第2のより高いレベル、およびハイパーバイザ・ソフトウェアが実行される第3の最も高いレベルがある。   Note that the subset of masks is either cleared or actually set to one instruction. Different hierarchical levels of processing devices may include many, but in certain embodiments, a first lower level at which application software is executed, a second higher level at which operating system software is executed, And the third highest level where hypervisor software is run.

ある実施形態では、データ処理装置は、ステータス・インジケータとさらにトラップ・インジケータを含むインジケータを保存するためのステータス記憶領域を含む。このトラップ・インジケータは、デバッグ・ソフトウェアがハイパーバイザ・レベルで実行されることを示すトラップ値を持つ。データ処理回路は、トラップ値を持つトラップ・インジケータに応答して、処理回路が現在ハイパーバイザ・レベルで実行し、ステータス・インジケータが事前定義された許可値に設定されていないか、現在のデバッグ例外マスク値が第1の値に設定されている場合、デバッグ例外の取得を許可せず、ステータス・インジケータが事前定義された許可値に設定されていて、しかも現在のデバッグ例外マスク値が第1の値に設定されていないか、またはデータ処理回路がハイパーバイザ・レベルよりも低い階層レベルで現在実行している場合、ハイパーバイザ・レベルでデバッグ例外取得を許可するように構成される。   In some embodiments, the data processing device includes a status storage area for storing indicators including status indicators and further trap indicators. This trap indicator has a trap value indicating that the debug software is run at the hypervisor level. In response to a trap indicator with a trap value, the data processing circuit is currently executing at the hypervisor level and the status indicator is not set to a predefined permission value or the current debug exception If the mask value is set to the first value, the debug exception is not allowed to be acquired, the status indicator is set to a predefined permission value, and the current debug exception mask value is set to the first value. If not set to a value or the data processing circuit is currently executing at a hierarchical level lower than the hypervisor level, it is configured to allow debug exception acquisition at the hypervisor level.

細分性を実現する1つの方法として、現在の階層レベルで、リエントラントのデバッグ例外を許可または許可しない単独のステータス・インジケータを持つこと、および現在のレベルが階層的にハイパーバイザ・レベルよりも低いことを前提として例外をハイパーバイザ・レベルにトラップするさらなるトラップ・インジケータを持つことがある。図1の実施形態など、多くの場合、ハイパーバイザ・レベルよりも高いレベルはないが、そうしたレベルがあったとして、処理回路がそのレベルで稼働している場合、トラップ値は例外をハイパーバイザ・レベルにトラップしないが、これは、例外は、より低い階層レベルでは取得できないためである。前述のように、例外は常により高いレベルで取得できる。そのため、例外がハイパーバイザ・レベルよりも下のレベルで発生した場合、取得可能となる。処理回路がハイパーバイザ・レベルで稼働していれば、ステータス・インジケータが例外取得を許可していること、例外がマスクされていないことを前提に、例外は取得される。   One way to achieve granularity is to have a single status indicator that does or does not allow reentrant debug exceptions at the current hierarchy level, and the current level is hierarchically lower than the hypervisor level May have additional trap indicators that trap exceptions to the hypervisor level. In many cases, such as the embodiment of FIG. 1, there is no level higher than the hypervisor level, but if there is such a level, the trap value will cause an exception for the hypervisor if the processing circuitry is operating at that level. Do not trap to level, because exceptions cannot be obtained at lower hierarchy levels. As mentioned above, exceptions can always be taken at a higher level. Therefore, if an exception occurs at a level below the hypervisor level, it can be acquired. If the processing circuit is operating at the hypervisor level, the exception is acquired on the assumption that the status indicator permits exception acquisition and that the exception is not masked.

本発明の第2の態様では、データ処理装置内のデバッグ・オペレーションの開始を制御する方法を提供する。データ処理装置は、複数の異なるソフトウェア階層レベルに対応するプログラム命令を実行するように構成され、より高い階層レベルからアクセスできるが、より低い階層レベルからはアクセスできない少なくともいくつかのデータ記憶場所があるように、前記より高いソフトウェアの階層レベルは、前記より低いソフトウェア階層レベルに比べて大きな特権を持つ。この方法は、以下のステップを含む。
データ処理装置がクリティカルなコードを実行することに応答して、現在のデバッグ例外マスク値をデータ処理装置内のデータ記憶の第1の値に設定し、クリティカルなコードの実行が終了すると、現在のデバッグ例外マスク値を第1の値を保存しないようにリセットする。
現在、ソフトウェアが実行しているレベルと同じ階層レベルで前記デバッグ・ソフトウェアを実行する場合は、現在のデバッグ例外マスク値が、第1の値に設定されていなければ、デバッグ例外の取得を許可し、現在のデバッグ例外マスク値が第1の値に設定されていれば、デバッグ例外の取得を許可しない。
事前定義されたより高いソフトウェア階層レベルで前記デバッグ・ソフトウェアを実行する場合は、デバッグ例外取得を許可する。
In a second aspect of the invention, a method for controlling the start of a debug operation in a data processing device is provided. The data processing apparatus is configured to execute program instructions corresponding to a plurality of different software hierarchy levels, and there are at least some data storage locations that are accessible from higher hierarchy levels but not accessible from lower hierarchy levels. Thus, the higher software hierarchy level has greater privileges than the lower software hierarchy level. The method includes the following steps.
In response to the data processor executing the critical code, the current debug exception mask value is set to the first value of the data store in the data processor, and when execution of the critical code is completed, Reset the debug exception mask value so as not to save the first value.
When the debug software is executed at the same hierarchical level as the level at which the software is currently being executed , the acquisition of the debug exception is permitted unless the current debug exception mask value is set to the first value. If the current debug exception mask value is set to the first value, acquisition of a debug exception is not permitted.
Debug exception acquisition is allowed when the debug software is executed at a pre-defined higher software hierarchy level.

本発明の第3の態様では、コンピュータ・プログラムを保存しているコンピュータ・プログラム製品を提供する。このコンピュータ・プログラムは、データ・プロセッサで実行されると、データ・プロセッサが本発明の第2の態様に従った方法のステップを実行するように制御するように動作可能である。   In a third aspect of the invention, a computer program product storing a computer program is provided. This computer program, when executed on a data processor, is operable to control the data processor to perform the steps of the method according to the second aspect of the invention.

本発明の第4の態様は、データ処理装置で実行するコンピュータ・プログラムによって提供される仮想マシンがある。この仮想マシンは、本発明の第1の態様のデータ処理装置の命令実行環境を実現する。   A fourth aspect of the present invention is a virtual machine provided by a computer program executed by a data processing device. This virtual machine implements the instruction execution environment of the data processing apparatus according to the first aspect of the present invention.

上記および本発明のその他の目的、機能、特徴は、添付の図面と関連付けて読まれる例示的実施形態の以下の詳細な説明から明らかになるであろう。   These and other objects, features, and features of the present invention will become apparent from the following detailed description of exemplary embodiments, read in conjunction with the accompanying drawings.

本発明の一実施形態のデータ処理装置のソフトウェア階層レベルを示す図である。It is a figure which shows the software hierarchy level of the data processor of one Embodiment of this invention. ホストのデバッガに接続されたデータ処理装置を示す図である。It is a figure which shows the data processor connected to the debugger of the host. KDEが0に設定された状態で、EL0レベルからEL1レベルでの例外取得を示す図である。It is a figure which shows the exception acquisition from EL0 level to EL1 level in the state in which KDE was set to 0. KDEが1に設定された状態で、EL0レベルからEL1レベルでの例外取得、およびデバッグ・イベントに応答したリエントラントの例外取得を示す図である。FIG. 10 is a diagram illustrating exception acquisition from EL0 level to EL1 level and reentrant exception acquisition in response to a debug event in a state where KDE is set to 1. KDEが1に設定された状態で、EL0レベルからEL1レベルでの例外取得、およびデバッグ・マスクが設定されている間に発生するデバッグ・イベントに応答したリエントラントの例外取得を示す図である。FIG. 10 is a diagram showing exception acquisition from the EL0 level to the EL1 level in a state where KDE is set to 1, and reentrant exception acquisition in response to a debug event that occurs while the debug mask is set. ソフトウェアのステップのデバッグ・オペレーション中に生じる状態を示す状態図である。FIG. 6 is a state diagram illustrating states that occur during a software step debug operation. 割り込みを取得したクリティカルなコードを実行する場合に起こるステップを示す流れ図である。FIG. 6 is a flow diagram illustrating the steps that occur when executing critical code that has acquired an interrupt. 図6に類似した流れ図であるが、この場合、複数の例外が起こりうる。FIG. 7 is a flow diagram similar to FIG. 6, but in this case multiple exceptions may occur. 本発明の一実施形態の仮想マシンの実装を示す図である。It is a figure which shows mounting of the virtual machine of one Embodiment of this invention.

図1は、本発明の実施形態のデータ処理装置の様々なソフトウェア階層レベルを表している。この実施形態では、ハイパーバイザを含む最高の階層レベル、EL2がある。この中には、デバッグ・サービスを含む場合がある。この場合、デバッガはハイパーバイザ・アプリケーションとして実行し、このハイパーバイザは、デバッグ・ハードウェアのプログラミングを行う。   FIG. 1 represents various software hierarchy levels of a data processing apparatus according to an embodiment of the present invention. In this embodiment, there is the highest hierarchical level, EL2, including the hypervisor. This may include debug services. In this case, the debugger runs as a hypervisor application, which performs debugging hardware programming.

この次のレベルは、EL1レベルであり、ゲストのオペレーティング・システムが実行される。これらのレベルの中にも、デバッグ・サービスを含む場合がある。繰り返しになるが、こうしたデバッグ・サービスはデバッグ・ハードウェアのプログラミングを行う。   This next level is the EL1 level, where the guest operating system is executed. Some of these levels may also include debug services. Again, these debugging services program debugging hardware.

3つ目のレベルは、アプリケーションが実行される最下層のEL0レベルである。こうしたアプリケーションの1つがデバッグ・アプリケーションの場合がある。   The third level is the lowermost EL0 level where the application is executed. One such application may be a debug application.

図2は、本発明の実施形態のデータ処理装置である。本実施形態のデータ処理装置10は、ホスト・デバッガ20に接続される。ホスト・デバッガは、入力12を介してデータ処理装置10と通信し、デバッグ命令をデータ処理装置10に送信し、データ処理装置10から診断データを受信する。データ処理装置10は、命令のストリームを実行するためのプロセッサ30を含む。また、データ処理装置10は、デバッグ・ハードウェア40、47、48も含む。こうしたデバッグ・ハードウェア40、47、48には、データ記憶40とレジスタ・バンク42内のレジスタ47と48を含む。データ記憶40は、デバッグ例外を、取得可能か否かを示すステータス・インジケータとマスク値を保存するためのものである。レジスタ47と48は、デバッグ例外を取得すべき場所を示すブレークポイントとウォッチポイントの値を保存するためのものである。   FIG. 2 shows a data processing apparatus according to the embodiment of the present invention. The data processing apparatus 10 of this embodiment is connected to a host debugger 20. The host debugger communicates with the data processing device 10 via the input 12, transmits debug instructions to the data processing device 10, and receives diagnostic data from the data processing device 10. The data processing apparatus 10 includes a processor 30 for executing a stream of instructions. The data processing apparatus 10 also includes debug hardware 40, 47, and 48. Such debug hardware 40, 47, 48 includes data store 40 and registers 47 and 48 in register bank 42. The data storage 40 is for storing a status indicator and a mask value indicating whether or not a debug exception can be acquired. Registers 47 and 48 are used to store breakpoint and watchpoint values indicating where to obtain debug exceptions.

マスク値に関して、それぞれ特定の階層レベルに関するいくつかのマスク値が保存され、そのレベルで取得されるデバッグ例外のマスクとして機能する。こうした値の1つは、現在のデバッグ・マスク値またはマスク・フラグであり、設定されると現在のソフトウェア階層レベルで取得されるリエントラントの例外であるデバッグ例外を禁止する。このマスク・フラグは、プロセッサの状態の一部であり、割り込みに応答してこの状態を保存する場合、この値も保存される。このマスク値のオペレーションについては後述する。   For mask values, several mask values for each particular hierarchy level are stored and serve as masks for debug exceptions taken at that level. One such value is the current debug mask value or mask flag, which when set inhibits debug exceptions, which are reentrant exceptions taken at the current software hierarchy level. This mask flag is part of the state of the processor, and if this state is saved in response to an interrupt, this value is also saved. The operation of this mask value will be described later.

割り込みまたはその他の例外が取得される場合、プロセッサの状態を保存するために少なくとも1つのデータ記憶46がある。前述のように、データ記憶46に保存されるプロセッサの状態には、プロセッサがソフトウェアの階層レベルを変更する場合、現在のデバッグ・マスク値またはマスクのフラグが含まれうる。   If an interrupt or other exception is taken, there is at least one data store 46 for saving the state of the processor. As described above, the processor state stored in the data store 46 may include the current debug mask value or mask flag if the processor changes the hierarchical level of the software.

各ソフトウェア階層レベルに対して1つずつ、いくつかのデータ記憶46が存在する場合がある。例えば、EL1で割り込みを取得する場合、プロセッサの現在の状態は、EL1レベルに対してデータ記憶46に保存され、EL1で割り込みされた処理に切り替わって戻る場合、その状態はEL1に対するデータ記憶46から復元される。デバッグ・マスクが、EL1に対して設定されている場合、この値はデータ記憶に保存され、その状態が復元されるときに再度設定されるであろう。   There may be several data stores 46, one for each software hierarchy level. For example, when acquiring an interrupt at EL1, the current state of the processor is stored in the data store 46 for the EL1 level, and when switching back to the interrupted process at EL1, the state is taken from the data store 46 for EL1. Restored. If the debug mask is set for EL1, this value will be saved in the data store and will be set again when the state is restored.

データ記憶46は、例外を取得する場合、プロセッサの状態を保存する目的専用であってもよいし、またはデータ・メモリなどのより汎用的なデータ記憶の一部であってもよい。   The data store 46 may be dedicated for the purpose of saving the state of the processor when obtaining exceptions, or may be part of a more general purpose data store such as a data memory.

ホスト・デバッガ20は、デバッグ・ハードウェア40、47、48自体をプログラムしてもよいし、ホスト・デバッガ20内の個別のプロセッサ上でソフトウェアのデバッグを実行してもよい。または、プロセッサ30は、ソフトウェアの階層レベルの1つの中にデバッグ・サービスを持ってもよく、ホスト・デバッガからの信号に応答して、これらを使用してデバッグ・ハードウェアをプログラムしてもよい。さらに、ホスト・デバッガ20自体は、プロセッサ30で実行するプログラムであってもよい。   The host debugger 20 may program the debug hardware 40, 47, 48 itself, or may perform software debugging on a separate processor within the host debugger 20. Alternatively, the processor 30 may have a debug service in one of the hierarchical levels of software and use these to program debug hardware in response to signals from the host debugger. . Further, the host debugger 20 itself may be a program executed by the processor 30.

ブレークポイント値とウォッチポイント値は、レジスタ47と48で設定される。実行されている命令のアドレスとして現れるブレークポイント・レジスタのアドレスに応答して、またはアクセスされているデータの場所のアドレスとして現れるウォッチポイントのレジスタのアドレスに応答して、デバッグ例外が生成される。こうした例外は、デバッグ・ソフトウェアがプロセッサを制御し、この時点でのプロセッサの状態についてのデバッガ情報を伝えるためにユーザと通信するようにする。   Breakpoint values and watchpoint values are set in registers 47 and 48. A debug exception is generated in response to the address of the breakpoint register appearing as the address of the instruction being executed, or in response to the address of the watchpoint register appearing as the address of the location of the data being accessed. These exceptions cause debug software to control the processor and communicate with the user to convey debugger information about the state of the processor at this point.

前述のように、コード実行中の例外取得が望ましくない状況があり、従って本発明の実施形態では、こうしたデバッグ例外取得を禁止することが適切な場合に、禁止するためのメカニズムを提供する。こうした制御の細分性は、様々な方法で実現できる。例えば、オペレーティング・システム実行中の例外取得は望ましくないかもしれないが、出荷前にそうしたオペレーティング・システムをデバッグできることは望ましいであろう。従って、EL1レベルでオペレーティング・システム内のカーネル・デバッガを提供するが、禁止フラグ、KDEビットの使用でこのデバッガが生成する例外取得を禁止できるようにするのは有用であろう。   As mentioned above, there are situations where exception acquisition during code execution is undesirable, and therefore embodiments of the present invention provide a mechanism for prohibiting such debug exception acquisition when appropriate. Such control granularity can be realized in various ways. For example, exception acquisition during operating system execution may not be desirable, but it would be desirable to be able to debug such an operating system prior to shipping. Therefore, it would be useful to provide a kernel debugger in the operating system at the EL1 level, but allow the exception acquisition generated by this debugger to be prohibited by using the prohibit flag, KDE bit.

従って、データ記憶40に保存されているKDEビットがクリアされると、TDEビットが設定されない限り、こうしたアドレスがEL1レベルからアクセスされる場合、例外が生成されないようにブレークポイントやウォッチポイントは無効になる。これについては後述する。このように、適宜、カーネルに例外を生成できないように、こうしたデバッグを無効にする機能と共にオペレーティング・システムをデバッグする機能が提供されている。従って、出荷前にシステムを完全にデバッグできるが、出荷後は、例えば、KDEビットを永久にクリアし、カーネルのデバッグを許可しないようにすることが可能である。   Thus, when the KDE bit stored in the data store 40 is cleared, breakpoints and watchpoints are disabled so that no exception is generated when such an address is accessed from the EL1 level, unless the TDE bit is set. Become. This will be described later. As described above, a function for debugging the operating system is provided together with a function for disabling such debugging so that an exception cannot be generated in the kernel. Thus, the system can be fully debugged before shipment, but after shipment, for example, the KDE bit can be permanently cleared to not allow kernel debugging.

データ記憶40に保存されているTDEビットもあり、このビットはEL2レベルでハイパーバイザにマッチするブレークポイントまたはウォッチポイントで生成された例外をトラップし、生成された例外がハイパーバイザ内で取得され、サービスされるようにする。この例では、データ記憶40は、レジスタ42とは異なる記憶として示されているが、こうしたフラグは、レジスタ・バンク42内のレジスタ内に保存されうる。   There is also a TDE bit stored in the data store 40 that traps exceptions generated at breakpoints or watchpoints that match the hypervisor at the EL2 level, and the generated exception is captured in the hypervisor, To be serviced. In this example, the data store 40 is shown as a store different from the register 42, but such flags may be stored in a register in the register bank 42.

KDEビットは、EL1に関連して上記で説明されているが、EL2レベルでデバッグ例外取得を禁止するEL2レベルに対する別個のKDEビットが存在しうることに注意されたい。   Note that although the KDE bit is described above in connection with EL1, there may be a separate KDE bit for the EL2 level that prohibits debug exception acquisition at the EL2 level.

または、実施形態によっては、TDEビットが設定されていない場合に、EL1レベルに関連する単独のKDEビットがある。TDEビットが設定されると、デバッグ例外はハイパーバイザ・レベルにトラップされ、ある実施形態では、KDEビットがEL2レベルに関連することを示すように設定される場合、TDEビットを使用する。TDEビットは、デバッグ例外をハイパーバイザ・レベルでトラップするように設定されているため、EL1レベルで例外が発生すると、より高い階層レベルで取得されるため、その例外は常に取得できる。従って、EL1レベル(TDEが設定されていない場合)とEL2レベル(TDEが設定されている場合)の両方で単独のKDEビットを使用すると便利である。   Or, in some embodiments, there is a single KDE bit associated with the EL1 level when the TDE bit is not set. When the TDE bit is set, debug exceptions are trapped at the hypervisor level, and in one embodiment, the TDE bit is used if the KDE bit is set to indicate that it is related to the EL2 level. Since the TDE bit is set to trap debug exceptions at the hypervisor level, when an exception occurs at the EL1 level, it is acquired at a higher hierarchy level, so that exception can always be acquired. Therefore, it is convenient to use a single KDE bit at both the EL1 level (when TDE is not set) and the EL2 level (when TDE is set).

こうして、TDEビットとKDEビットと合わせて、EL1レベルとEL2レベルでリエントラント例外の取得を禁止または許可することができる。   In this way, the acquisition of the reentrant exception can be prohibited or permitted at the EL1 level and the EL2 level together with the TDE bit and the KDE bit.

カーネルのデバッグを許可するか否かの細分性を実現することに加えて、特定のコード実行時にデバッグ例外の取得を禁止する機能も備えうる。これは、現在のデバッグ・マスク値またはマスク・フラグ43によって実現する。このマスク・フラグは、特定のコードを実行するときに、プロセッサ30によって設定される。従って、プロセッサがEL1レベルでコードを実行していて、それがクリティカルなコードの場合、コードの割り込みはソフトウェアの障害を招くことがあり、プロセッサ30がデバッグのマスク・フラグを設定する。その後、このマスク・フラグが取得を禁止しているため、デバッグ例外が生成されても、このレベルでは取得できない。   In addition to realizing the granularity of whether or not to allow debugging of the kernel, a function of prohibiting the acquisition of a debug exception when executing a specific code may be provided. This is accomplished by the current debug mask value or mask flag 43. This mask flag is set by the processor 30 when executing a particular code. Thus, if the processor is executing code at the EL1 level and it is critical code, the code interrupt may cause a software failure and the processor 30 sets the debug mask flag. After that, since this mask flag prohibits acquisition, even if a debug exception is generated, it cannot be acquired at this level.

ある実施形態では、これは例外が決して取得されないことを意味しうるが、他の実施形態では、ペンディングのフラグ44が設定される場合がある。この場合、プロセッサがクリティカルなコードの実行を終了後に、おそらくソフトウェアの命令によってマスク・フラグが再設定されると、ペンディングしている例外を取得できる。   In some embodiments, this may mean that exceptions are never taken, but in other embodiments, a pending flag 44 may be set. In this case, the pending exception can be obtained after the processor finishes executing the critical code, and possibly when the mask flag is reset by a software instruction.

これは、図3a、3b、および4に詳しく示されている。こうした図では、アプリケーションは、そのアプリケーションのEL0レベルで実行しており、例外が受け取られる(この例外は、デバッグ例外だけでなく、あらゆるタイプの例外でありうる)。次にプロセッサは、EL1レベルに移動し、その例外を処理する。最初に、このレベルで実行を開始する場合、クリティカルなコードが実行され、これにより、そのアプリケーションに戻るときにその状態が復元できるようにプロセッサの状態が保存される。このクリティカルなコードの実行中に、保存中の状態が上書きされないように、このレベルでさらに例外が取得されないようにすることが重要である。従って、この時点でデバッグ・マスク・フラグ、CPSR.Dが1に設定される。システムの例外ハンドラが次に実行され、これにより、例外を処理する。この処理のある時点で、システム例外ハンドラが、プロセッサの状態の保存を完了する。これは、ソフトウェアがこのクリティカルなコード領域を離れることが可能になり、CPSR.Dフラグが0に設定されることを意味する。システム例外ハンドラが例外の処理を完了すると、割り込みしたアプリケーションの処理に戻らなければならないと判断し、従って、さらにクリティカルなコード領域に入り、元の例外の時点でのプロセッサの状態を復元する一方で、デバッグ・マスク・フラグ、CPSR.Dが再度1に設定される。   This is illustrated in detail in FIGS. 3a, 3b and 4. In these figures, the application is running at the EL0 level of the application and an exception is received (this exception can be any type of exception, not just a debug exception). The processor then moves to the EL1 level and handles the exception. Initially, when executing at this level, critical code is executed, which saves the processor state so that it can be restored when returning to the application. It is important that no further exceptions are taken at this level so that the state being saved is not overwritten during execution of this critical code. Therefore, at this point, the debug mask flag, CPSR. D is set to 1. The system exception handler is then executed to handle the exception. At some point in this process, the system exception handler completes saving the processor state. This allows the software to leave this critical code area, and CPSR. This means that the D flag is set to 0. When the system exception handler completes processing the exception, it determines that it must return to the interrupted application's processing, and therefore enters a more critical code area, while restoring the processor state at the time of the original exception. , Debug mask flag, CPSR. D is set to 1 again.

図3aでは、KDEビットは0に設定される。従って、デバッグ例外取得はEL1レベルで許可されず、すべてのブレークポイントとウォッチポイントが無効になる。従って、EL1での処理中は、クリティカル領域、または残りのシステムの例外ハンドラでもデバッグ例外は受け取られない。   In FIG. 3a, the KDE bit is set to zero. Therefore, debug exception acquisition is not allowed at the EL1 level, and all breakpoints and watchpoints are disabled. Therefore, during processing in EL1, no debug exception is received even in the critical region or the exception handler of the remaining system.

図3bでは、KDEビットは1に設定される。従って、EL1レベルでのデバッグ例外取得は許可されるが、クリティカルなコード領域内では許可されない。こうしたリエントラントデバッグ例外は、ブレークポイントに応答して受け取られ、この時点ではデバッグ・マスク・フラグ、CPSR.Dは0、KDE=1であり、このデバッグ例外は取得され、カーネルがブレークポイント・ハンドラを使用して例外を処理する。これが完了すると、例外の戻りがあり、カーネルはシステム例外ハンドラの処理を継続する。システムの例外処理が完了すると、デバッグ・マスク・フラグが1に設定されるコードのクリティカル領域に入り、このポイントでデバッグ例外が受け取られても無視される。   In FIG. 3b, the KDE bit is set to one. Therefore, debug exception acquisition at the EL1 level is permitted, but not within the critical code region. Such reentrant debug exceptions are received in response to a breakpoint, at which point the debug mask flag, CPSR. D is 0, KDE = 1, this debug exception is taken and the kernel handles the exception using a breakpoint handler. When this is complete, there is an exception return and the kernel continues processing the system exception handler. When the system exception handling is complete, it enters the critical region of the code where the debug mask flag is set to 1, and any debug exception received at this point is ignored.

図4は、本発明の実施形態の例外処理のさらなる例を示している。再度、図3bのように、KDEビットが設定され、そのアプリケーション・レベルで例外が受け取られ、取得されると、処理はEL1レベルに切り替わる。プロセッサの状態を保存するために、クリティカルなコードが最初に実行され、デバッグ・マスク・フラグ、CPSR.Dが1に設定される。この間、ウォッチポイントのデバッグ・イベントが発生し、デバッグ・マスク・フラグが設定されているため、これは取得できない。しかし、このKDEが設定されているため、本実施形態では、このウォッチポイントを無視するのではなく、ペンディングのデバッグ例外フラグが1に設定される。従って、クリティカルなコードの実行が終了すると、ソフトウェアがデバッグ・マスク・フラグを0にリセットし、ペンディングのデバッグ例外フラグは、ペンディングのデバッグ例外があることをプロセッサに示し、従って、この時点で取得され、カーネルがウォッチポイントのハンドラを実行し、その例外を処理する。   FIG. 4 shows a further example of exception handling according to an embodiment of the present invention. Again, as shown in FIG. 3b, when the KDE bit is set and an exception is received and obtained at that application level, the process switches to the EL1 level. To save the state of the processor, the critical code is first executed and the debug mask flag, CPSR. D is set to 1. During this time, a watchpoint debug event has occurred and the debug mask flag is set, so this cannot be obtained. However, since this KDE is set, in this embodiment, this watchpoint is not ignored, but the pending debug exception flag is set to 1. Therefore, when critical code execution finishes, the software resets the debug mask flag to 0, and the pending debug exception flag indicates to the processor that there is a pending debug exception and is therefore obtained at this point. The kernel executes the watchpoint handler and handles the exception.

ペンディングのデバッグ例外が取得されるとただちに、プロセッサがペンディングのデバッグ・マスク・フラグの現在の値、0を保存し、次にそれ(CPSR.D)を1に設定する。デバッグ例外ハンドラ、この場合、ウォッチポイントのハンドラが続いて実行され、完了すると、デバッグ・マスク・フラグに対して保存されていた値が復元される。この場合、CPSR.Dが0にリセットされる。この時点で、システムのコール・ハンドラを実行し、完了すると、ソフトウェアは例外のリターン・コードに入る。これは、クリティカルなコードであり、従って、このコードの実行の継続中、デバッグ例外フラグCPSR.Dが再び1に設定される。   As soon as a pending debug exception is obtained, the processor saves the current value of the pending debug mask flag, 0, and then sets it (CPSR.D) to 1. The debug exception handler, in this case the watchpoint handler, is then executed and upon completion, the saved value for the debug mask flag is restored. In this case, CPSR. D is reset to zero. At this point, the system call handler is executed and upon completion, the software enters an exception return code. This is critical code, so the debug exception flag CPSR. D is set to 1 again.

前述の例では、KDEビットはEL1について説明したが、EL2レベルに関するKDEビットもありうる。KDEビットが特定レベルでクリアされると、そのレベルでソフトウェアのデバッグ・イベントが無効になる。実施形態によっては、KDEビットがそのレベルに対してクリアされても、有効であるデバッグ・イベントがあるであろう。例えば、ソフトウェアのブレークポイント命令は、デバッグ例外を生成する命令のタイプである。ハードウェアのブレークポイント・レジスタ42が利用できない場合、ある場所でブレークポイントを設定する手段として、デバッガが実際のプログラム命令を、ソフトウェアのブレークポイント命令と置き換える。オリジナルのプログラム命令は存在しなくなっているため、KDEビットがクリアされても、こうしたデバッグ命令を無視するのは安全ではない。   In the above example, the KDE bit has been described for EL1, but there can also be a KDE bit for the EL2 level. When the KDE bit is cleared at a particular level, software debug events are disabled at that level. In some embodiments, there will be debug events that are valid even if the KDE bit is cleared for that level. For example, a software breakpoint instruction is a type of instruction that generates a debug exception. If the hardware breakpoint register 42 is not available, the debugger replaces the actual program instructions with software breakpoint instructions as a means of setting breakpoints at certain locations. Since the original program instructions no longer exist, it is not safe to ignore these debug instructions even if the KDE bit is cleared.

TDEビットが設定されている場合、EL0レベルまたはEL1レベルのいずれかからのソフトウェアのデバッグ・イベントがEL2レベルにトラップされる。従って、TDEビットが設定される場合、EL0またはEL1で発生するデバッグ・イベントは、EL1レベルに対するKDEビットによる影響を受けず、EL2レベルで取得されるであろう。   If the TDE bit is set, software debug events from either the EL0 level or the EL1 level are trapped at the EL2 level. Thus, if the TDE bit is set, debug events occurring at EL0 or EL1 will not be affected by the KDE bit on the EL1 level and will be acquired at the EL2 level.

ある実施形態では、TDEビットがクリアである場合、EL1レベルでデバッグ例外に影響を与え、TDEビットが設定されている場合にEL2レベルでデバッグ例外に影響を及ぼす単独のKDEビットがある。   In one embodiment, there is a single KDE bit that affects debug exceptions at the EL1 level when the TDE bit is clear and affects debug exceptions at the EL2 level when the TDE bit is set.

ある実施形態では、単純なソフトウェアのステップの状態機械を実行するようにデバッガが構成される。この場合、各命令実行後に、プロセッサが停止し、状態が分析される。ソフトウェアのステップはソフトウェアの制御下にあるため、ソフトウェアのステップ・デバッガが現在の例外レベルで有効化または無効化するように、ステッピングはグローバルなデバッグが有効にしたコントロールによっても制御される。   In one embodiment, the debugger is configured to execute a simple software step state machine. In this case, after executing each instruction, the processor stops and the state is analyzed. Since software steps are under software control, stepping is also controlled by global debug enabled controls, just as the software step debugger is enabled or disabled at the current exception level.

図5は、ソフトウェアのステップのデバッグ・オペレーション例の間に発生する状態を示す状態図である。この図では、以下の3種類のコードがある。「デバッガ」は、デバッガ・コード自体を含み、例えば、EL1で実行するコードである。「デバッグ対象」はデバッグされているコードを含み、例えば、EL0で実行するコードであり、KDEが設定されている場合、クリティカルなコード以外で、EL1で実行するコードである。「クリティカルなコード」は、デバッグ例外によって割り込みされてはいけないコードを含み、これはデバッグ・マスク・フラグCPSR.Dが設定された状態でデバッガ(EL1)と同じレベルで実行されるコードである。   FIG. 5 is a state diagram illustrating the states that occur during an example software step debug operation. In this figure, there are the following three types of codes. “Debugger” includes debugger code itself, for example, code executed in EL1. “Debug target” includes code that is being debugged. For example, the code is executed by EL0. When KDE is set, the code is executed by EL1 other than the critical code. “Critical code” includes code that must not be interrupted by a debug exception, which includes the debug mask flag CPSR. This code is executed at the same level as the debugger (EL1) with D set.

ステップ・プロセスを開始する前に、ソフトウェアのステップ状態機械は、無効な状態であり、デバッガのコードが実行している。デバッガは、モニタ・デバッグ・ステータスでシングル・ステップの制御フラグを設定し、EL1レベルから制御レジスタ(MDSCR_EL1)を設定することにより、ステッピングのためにプロセスをセットアップする。次にデバッガは例外リターン命令を実行し、デバッグ対象コードにジャンプする。デバッグ対象コードで、シングル・ステップのデバッグ・イベントがアクティブであるが、例外はまだペンディングされていない。   Before starting the step process, the software step state machine is in an invalid state and the debugger code is executing. The debugger sets up the process for stepping by setting a single step control flag in the monitor debug status and setting the control register (MDSCR_EL1) from the EL1 level. Next, the debugger executes the exception return instruction and jumps to the debug target code. In the code being debugged, a single-step debug event is active, but no exceptions are pending.

次に、プロセッサが命令を実行し、これは通常、ソフトウェアのステップの状態機械をアクティブなペンディング状態に移動させる。この時点で、ペンディングのソフトウェアのステップのデバッグ例外が取得され、実行はデバッガに戻り、シングル・ステップが完了する。   The processor then executes the instruction, which typically moves the software step state machine to the active pending state. At this point, a pending software step debug exception is taken and execution returns to the debugger to complete the single step.

しかし、命令実行中に他の例外があると、これを取得し、クリティカルなコードが最初に実行されているため、プロセッサはデバッグ・マスク・フラグCPSR.Dを設定する。これは、ペンディングのシングル・ステップのデバッグ例外がマスクされていることを意味する。このデバッグ例外は、クリティカルなコードが完了し、CPSR.Dフラグがクリアされている場合に限り取得可能である。しかし、例外ハンドラが、CPSR.Dフラグをクリアしない場合、デバッグ対象コードに戻る。例外ハンドラがステップされていた命令の再実行に戻る場合、ペンディングのシングル・ステップのデバッグ例外は、クリアされる。   However, if there are other exceptions during instruction execution, they will get this and the critical code will be executed first, so the processor will use the debug mask flag CPSR. Set D. This means that pending single-step debug exceptions are masked. This debug exception occurs when critical code completes and CPSR. It can be acquired only when the D flag is cleared. However, if the exception handler is CPSR. If the D flag is not cleared, the process returns to the debug target code. If the exception handler returns to re-executing the instruction that was being stepped, the pending single-step debug exception is cleared.

デバッグ・マスク・フラグとTDEビット、KDEビットで達成できる細分性が以下の表にいくつかの事例として示されている。この表は、こうしたフラグのいくつかの構成によってデバッグ・イベントが取得されるか、または取得されないかを示す。本実施形態では、デバッグ例外は、EL1レベル、EL2レベルでのみ取得される。
レベル TDE KDE CPSR.D デバッグ・イベントに対するアクション
601 EL0 0 X X EL1で取得
602 1 X X EL2で取得
603 EL1 0 0 X 無視
604 0 1 1 無視
605 0 1 0 EL1へのリエントラント例外
606 1 X X EL2で取得
607 EL2 0 X X 無視
608 1 0 X 無視
609 1 1 1 無視
610 1 1 0 EL2へのリエントラント例外
The granularity achievable with the debug mask flag, the TDE bit, and the KDE bit is shown in the following table as a few examples. This table shows whether debug events are captured or not captured by some configurations of these flags. In the present embodiment, the debug exception is acquired only at the EL1 level and the EL2 level.
Actions for level TDE KDE CPSR.D debug events
Obtained with 601 EL0 0 XX EL1
Obtained with 602 1 XX EL2
603 EL1 0 0 X Ignore
604 0 1 1 Ignored
605 0 1 0 Reentrant exception to EL1
Obtained with 606 1 XX EL2
607 EL2 0 XX Ignored
608 1 0 X Ignore
609 1 1 1 Ignored
610 1 1 0 Reentrant exception to EL2

最初から2行の601と602は、EL0で実行時に何が起こるかを示している。TDEビットがクリアである場合(行601)、EL0でのデバッグ例外はEL1で処理される。TDEビットが設定されている場合(行602)、EL0でのデバッグ例外はEL2で処理される。CPSR.DフラグとKDEビットは、EL0では何の影響も及ぼさないことに注意されたい。この表では、「X」は、「無関係」を意味し、これはその行のアクションはその列に対する値に依存しないということである。   The first two rows 601 and 602 show what happens at runtime in EL0. If the TDE bit is clear (line 601), the debug exception at EL0 is handled at EL1. If the TDE bit is set (line 602), a debug exception at EL0 is handled at EL2. CPSR. Note that the D flag and KDE bit have no effect on EL0. In this table, “X” means “irrelevant”, which means that the action for that row does not depend on the value for that column.

その次の4行、603、604、605、606は、EL1レベルで実行する場合の挙動を示している。TDEビットとKDEビットの両方がクリアである場合(行603)、デバッグ例外は無視される。KDEビットが設定され、TDEビットがクリアである場合、デバッグ例外は、CPSR.Dフラグの値に応じてEL1で許可されうる。行604では、CPSR.Dフラグも設定される。この場合、クリティカルなコードはEL1レベルで実行されている。デバッグ・イベントは現在マスクされており、無視される。しかし、行605では、CPSR.Dフラグがクリアであり、EL1へのリエントラント例外としてデバッグ例外が許可される。行606では、KDEビットとCPSR.Dフラグが無視され、デバッグ例外がEL2で取得されるように、TDEビットが設定される。   The next four lines, 603, 604, 605, and 606, show the behavior when executed at the EL1 level. If both the TDE and KDE bits are clear (line 603), the debug exception is ignored. If the KDE bit is set and the TDE bit is clear, the debug exception is CPSR. Depending on the value of the D flag, it can be permitted in EL1. In line 604, CPSR. The D flag is also set. In this case, the critical code is executed at the EL1 level. Debug events are currently masked and will be ignored. However, in line 605, CPSR. The D flag is clear, and a debug exception is permitted as a reentrant exception to EL1. In line 606, the KDE bit and CPSR. The TDE bit is set so that the D flag is ignored and a debug exception is taken at EL2.

残りの4行、607、608、609、610は、EL2で実行する場合の挙動を示している。TDEビットまたはKDEビットのいずれかがクリアである場合(行607、608)、デバッグ例外は無視される。しかし、TDEビットとKDEビットの両方が設定されている場合、デバッグ例外はCPSR.Dフラグの値に応じてEL2で許可されうる。行609では、CPSR.Dフラグも設定されている。この場合、クリティカルなコードは、EL2レベルで実行されている。デバッグ・イベントは、現在マスクされており、無視される。しかし、行610では、CPSR.Dフラグがクリアであり、EL2へのリエントラント例外としてデバッグ例外が許可される。   The remaining four lines, 607, 608, 609, and 610 show the behavior when executed in EL2. If either the TDE bit or the KDE bit is clear (lines 607, 608), the debug exception is ignored. However, if both the TDE and KDE bits are set, the debug exception is CPSR. Depending on the value of the D flag, it can be allowed in EL2. In line 609, CPSR. The D flag is also set. In this case, the critical code is executed at the EL2 level. Debug events are currently masked and will be ignored. However, in line 610, CPSR. The D flag is clear, and a debug exception is permitted as a reentrant exception to EL2.

図6は、割り込みの受け取に応答して行われるステップを示している。EL0レベルで割り込みが受け取られると、割り込み例外がEL1レベルで取得され、デバッグ・マスク・フラグが設定され、プロセッサの現在の状態を保存することに関連する割り込み例外を処理するために必要なクリティカルなコードが実行される。クリティカルなコードの実行中に、デバッグ・イベントが発生した場合、TDEビットまたはKDEビットが設定されていない限り、無視するようにデバッグ・マスク・フラグが設定される。この実施形態では、TDEビットが設定されておらず、KDEビットが設定されている場合、ペンディングのデバッグ例外フラグが設定される。TDEビットが設定されていれば、例外はEL2レベルにトラップされ、処理され、戻ると、クリティカルなコードの実行が終了し、ペンディングのデバッグ例外フラグは設定されない。他の実施形態では、ペンディングのデバッグ例外フラグは、デバッグ例外の特定タイプについて設定されうるが、他は設定されない(無視される)、または全く設定されない。   FIG. 6 shows the steps performed in response to receiving an interrupt. When an interrupt is received at the EL0 level, an interrupt exception is taken at the EL1 level, the debug mask flag is set, and the critical necessary to handle the interrupt exception associated with saving the current state of the processor. The code is executed. If a debug event occurs during the execution of critical code, the debug mask flag is set to be ignored unless the TDE or KDE bits are set. In this embodiment, if the TDE bit is not set and the KDE bit is set, a pending debug exception flag is set. If the TDE bit is set, the exception is trapped at the EL2 level, handled, and upon return, critical code execution is terminated and the pending debug exception flag is not set. In other embodiments, pending debug exception flags may be set for a particular type of debug exception, but others are not set (ignored) or not set at all.

クリティカルなコードの実行が終了すると、デバッグ・マスク・フラグが再設定され、デバッグ例外のペンディングのフラグを設定されているか否かを判断する。設定されている場合、ペンディングのデバッグ例外は取得され、設定されていない場合、割り込み例外の実行が継続する。   When execution of the critical code is finished, the debug mask flag is reset to determine whether the debug exception pending flag is set. If set, a pending debug exception is taken, otherwise execution of the interrupt exception continues.

図7は、図6と同様の流れ図であるが、クリティカルなコードの実行中に複数のデバッグ・イベントが発生したらどうなるかをさらに示しているため、より複雑である。従って、EL1に対する割り込みが受け取られ、取得されると、クリティカルなコードが実行され、デバッグ・マスクが設定される。次に、デバッグ・イベントが発生するか、デバッグ・イベントがペンディングしていることを示すペンディングのフラグを設定するかを判断する。いずれかが真であり、TDEビットが設定されていると、例外はEL2で取得される。そうでなければ、EL1レベルでデバッグを許可しないようにKDEビットが設定されていない場合、イベントは無視される。   FIG. 7 is a flow diagram similar to FIG. 6, but is more complex because it further illustrates what happens if multiple debug events occur during the execution of critical code. Thus, when an interrupt for EL1 is received and acquired, critical code is executed and a debug mask is set. Next, it is determined whether a debug event occurs or whether a pending flag indicating that the debug event is pending is set. If either is true and the TDE bit is set, an exception is taken at EL2. Otherwise, the event is ignored if the KDE bit is not set to not allow debugging at the EL1 level.

デバッグを許可することを示すKDEビットが設定されていれば、デバッグ・マスクがまだ設定されているか(クリティカルなコードがまだ実行中であるか)を判断し、そうであれば、ペンディングのフラグが設定され、そうでなければ、リエントラント例外がEL1で取得される。ペンディングのフラグは、累積し、これは既に設定されていれば、設定され続けることを意味する。   If the KDE bit indicating that debugging is allowed is set, it is determined whether the debug mask is still set (critical code is still running), and if so, the pending flag is set Set, otherwise a reentrant exception is taken at EL1. The pending flag is cumulative, which means that if it has already been set, it will continue to be set.

例外が取得されないか、またはデバッグ・イベントが発生しなければ、デバッグ・マスクがまだ設定されているかを判断する。設定されていなければ、プロセッサがクリティカルなコードの処理を開始した時点であるかを判断し、そうであれば、デバッグ・マスク・フラグが設定され、そうでなければデバッグ・マスク・フラグは設定されない。デバッグ・マスクがまだ設定されていれば、プロセッサがクリティカルなコードの実行終了時点であるかを判断し、そうであればデバッグ・マスク・フラグはクリアされ、そうでなければ、クリアされない。次に、割り込みハンドラの終了に達したかを判断する。そうであれば、例外からEL0への戻りが実行される。そうでなければ、デバッグ・イベントが発生し、そのメソッドのステップが繰り返されるかを判断する。   If no exception is taken or no debug event occurs, determine if the debug mask is still set. If not set, determine if it is time for the processor to begin processing critical code; if so, the debug mask flag is set, otherwise the debug mask flag is not set . If the debug mask is still set, the processor determines if it is the end of critical code execution, and if so, the debug mask flag is cleared, otherwise it is not cleared. Next, it is determined whether the end of the interrupt handler has been reached. If so, a return from exception to EL0 is performed. Otherwise, a debug event occurs and determines whether the method step is repeated.

図8は、使用可能な仮想マシンの実装を示している。前述の実施例では、本発明に関連する技術をサポートする特定の処理ハードウェアを稼働するための装置と方法で本発明を実装したが、いわゆるハードウェア・デバイスの仮想マシンの実装も可能である。こうした仮想マシンの実装は、仮想マシン・プログラム510をサポートするホストのオペレーティング・システム520を実行するホストのプロセッサ530で実行する。通常、妥当な速度で実行する仮想マシンの実装には通常大きな強力なプロセッサが必要である。しかし、こうしたアプローチは、互換性または再利用の目的で他のプロセッサに対してネイティブなコードの実行を望むような特定の状況で正当化される場合がある。仮想マシン・プログラム510は、アプリケーション・プログラム500に対するアプリケーション・プログラム・インタフェースを提供する。アプリケーション・プログラム500は、仮想マシン・プログラム510によってモデル化されているデバイスである実際のハードウェアによって提供されるアプリケーション・プログラム・インタフェースと同じである。従って、上記のメモリへのアクセスの制御を含むプログラム命令は、仮想マシン・プログラム510を使用して、仮想マシン・ハードウェアとのインタラクションをモデル化することにより、このアプリケーション500内から実行されうる。   FIG. 8 shows a virtual machine implementation that can be used. In the above-described embodiments, the present invention has been implemented with an apparatus and method for operating specific processing hardware that supports technology related to the present invention, but a virtual machine with a so-called hardware device can also be implemented. . Such a virtual machine implementation is performed by a host processor 530 executing a host operating system 520 that supports a virtual machine program 510. Usually, implementing a virtual machine that runs at a reasonable speed usually requires a large and powerful processor. However, such an approach may be justified in certain situations where it is desirable to execute code native to other processors for compatibility or reuse purposes. The virtual machine program 510 provides an application program interface to the application program 500. Application program 500 is the same as the application program interface provided by the actual hardware, which is a device modeled by virtual machine program 510. Accordingly, program instructions including control of access to the memory described above can be executed from within this application 500 by modeling the interaction with the virtual machine hardware using the virtual machine program 510.

本発明の例示的実施例は、添付図面を参照して詳細に説明したが、本発明はこうした実施形態そのものに限定されるものではないこと、および添付の請求項によって定義される本発明の範囲と精神から逸脱することなく当業者によって様々な変更や改良を行うことができることを理解されたい。例えば、本発明の範囲から逸脱することなく、以下の従属請求項の機能と、独立請求項の機能を様々に組み合わせることができる。   While exemplary embodiments of the present invention have been described in detail with reference to the accompanying drawings, the present invention is not limited to these embodiments per se and the scope of the invention as defined by the appended claims. It should be understood that various changes and modifications can be made by those skilled in the art without departing from the spirit. For example, the functions of the following dependent claims and the functions of the independent claims can be variously combined without departing from the scope of the present invention.

Claims (19)

データ処理装置であって、
プログラム命令の実行に応答してデータ処理オペレーションを行うためのデータ処理回路と、
該データ処理回路上で実行するデバッグ・ソフトウェアによって制御されるデバッグ・オペレーションを行うためのデバッグ回路と、を含み、
前記データ処理装置は、現在のデバッグ例外マスク値を保存するためのデータ記憶を含み、
前記データ処理回路は、クリティカルなコードの実行に応答してデータ記憶に、前記現在のデバッグ例外マスク値を第1の値に設定し、前記クリティカルなコードの実行の終了時に前記現在のデバッグ例外マスク値を前記第1の値を保存しないようにリセットするように構成され、
前記データ処理回路は、複数の異なるソフトウェア階層レベルに対応するプログラム命令を実行するように構成され、より高い階層レベルからアクセスできるが、より低い階層レベルからはアクセスできない少なくともいくつかのデータ記憶場所があるように、前記より高いソフトウェアの階層レベルは、前記より低いソフトウェア階層レベルに比べて大きな特権を持ち、
前記データ処理回路は、
現在、ソフトウェアが実行しているレベルと同じ階層レベルで前記デバッグ・ソフトウェアを実行する場合であって、
前記現在のデバッグ例外マスク値が前記第1の値に設定されていない場合にはデバッグ例外取得を許可し、
前記現在のデバッグ例外マスク値が前記第1の値に設定されている場合には前記デバッグ例外取得を許可しないように構成され、
事前定義された、現在、ソフトウェアが実行しているレベルと同じ階層レベルより高いソフトウェア階層レベルで前記デバッグ・ソフトウェアを実行する場合は、デバッグ例外取得を許可するように構成される、前記データ処理装置。
A data processing device,
A data processing circuit for performing data processing operations in response to execution of program instructions;
A debug circuit for performing a debug operation controlled by debug software executed on the data processing circuit,
The data processing device includes a data store for storing a current debug exception mask value;
The data processing circuit sets the current debug exception mask value to a first value in data storage in response to critical code execution, and sets the current debug exception mask at the end of execution of the critical code. Configured to reset a value not to store the first value;
The data processing circuit is configured to execute program instructions corresponding to a plurality of different software hierarchy levels and is accessible from a higher hierarchy level, but at least some data storage locations that are not accessible from a lower hierarchy level As such, the higher software hierarchy level has greater privileges than the lower software hierarchy level,
The data processing circuit includes:
The debug software is executed at the same hierarchical level as the level at which the software is currently running,
Wherein if the current debug exception mask value is not set to the first value, and permits the debug exception acquisition,
Wherein if the current debug exception mask value is set to the first value, is configured to not allow the debug exception acquisition,
The data processing apparatus configured to allow debug exception acquisition when the debug software is executed at a software hierarchy level that is higher than the same hierarchy level that is currently being executed by the software. .
前記クリティカルなコードは、その割り込みがソフトウェアの障害を起こしうる複数の命令を含む請求項1に記載のデータ処理装置。   The data processing apparatus according to claim 1, wherein the critical code includes a plurality of instructions whose interruption may cause a software failure. 前記クリティカルなコードは、プロセッサの状態をデータ記憶に保存するためのコードおよびデータ記憶に保存した状態からプロセッサの状態を復元するためのコードを含む請求項2に記載のデータ処理装置。   The data processing apparatus according to claim 2, wherein the critical code includes a code for saving the processor state in the data storage and a code for restoring the processor state from the state saved in the data storage. 前記データ処理装置は、前記複数のソフトウェア階層レベルに対応した複数のデバッグ例外マスク値を保存するように構成されたデータ記憶を含み、
前記データ処理回路は、前記複数の異なるソフトウェアの階層レベルの1つに切り替えるときに、前記現在のデバッグ例外マスク値を、前記ソフトウェアの階層レベルの1つに対して保存された前記デバッグ例外マスク値に設定するように構成されている請求項1に記載のデータ処理装置。
The data processing apparatus includes a data store configured to store a plurality of debug exception mask values corresponding to the plurality of software hierarchy levels;
When the data processing circuit switches to one of the plurality of different software hierarchy levels, the current debug exception mask value is stored for the one of the software hierarchy levels. The data processing apparatus according to claim 1, wherein the data processing apparatus is configured to be set to the following.
前記データ処理装置は、前記現在のデバッグ例外マスク値を保存するためのステータス記憶領域を含み、前記データ処理回路は、あるソフトウェア階層レベルから他のソフトウェア階層レベルへの切り替えに応答し、前記ある階層レベルに対する前記デバッグ例外マスク値を前記ステータス記憶領域に保存し、前記ある階層レベルに切り替わり戻るときに、前記デバッグ例外マスク値を復元する請求項1に記載のデータ処理装置。   The data processing apparatus includes a status storage area for storing the current debug exception mask value, and the data processing circuit is responsive to switching from one software hierarchy level to another software hierarchy level, The data processing apparatus according to claim 1, wherein the debug exception mask value for a level is stored in the status storage area, and the debug exception mask value is restored when returning to the certain hierarchical level. 前記データ処理装置は、ステータス・インジケータを保存するためのステータス記憶領域を含み、前記ステータス・インジケータの少なくとも1つは、前記ソフトウェア階層レベルの少なくとも1つに対応するデバッグ許可のステータス・インジケータを含み、
前記データ処理回路は、前記デバッグ・ソフトウェアが、事前定義された階層レベルで、前記処理回路で実行される、前記事前定義されたソフトウェアの階層レベルで命令を実行する場合、前記事前定義されたソフトウェアの階層レベルに対する前記デバッグ許可ステータス・インジケータが事前定義された許可値に設定され、前記現在のデバッグ例外マスク値が前記第1の値に設定されていない場合、前記デバッグ例外取得を許可し、前記ステータス・インジケータが前記事前定義された許可値に設定されていないか、または前記現在のデバッグ例外マスク値が前記第1の値に設定されている場合に前記デバッグ例外取得を許可しないように構成される請求項1に記載のデータ処理装置。
The data processing device includes a status storage area for storing status indicators, at least one of the status indicators including a debug-enabled status indicator corresponding to at least one of the software hierarchy levels;
The data processing circuit is pre-defined when the debug software executes instructions at a hierarchical level of the predefined software, executed at the processing circuit at a predefined hierarchical level. If the debug permission status indicator for the hierarchical level of the software is set to a predefined permission value and the current debug exception mask value is not set to the first value, the debug exception acquisition is permitted. Do not allow the debug exception acquisition if the status indicator is not set to the predefined permission value or the current debug exception mask value is set to the first value The data processing apparatus according to claim 1, which is configured as follows.
前記データ処理回路は、例外に応答して、より低いソフトウェアの階層レベルから、より高い階層レベルに切り替わるとき、前記デバッグ例外マスク値を前記第1の値に設定するように構成された請求項1から6のいずれかに記載のデータ処理装置。   The data processing circuit is configured to set the debug exception mask value to the first value when switching from a lower software hierarchy level to a higher hierarchy level in response to an exception. The data processing device according to any one of 6 to 6. 前記データ処理回路は、例外に応答して、より低いソフトウェアの階層レベルから、より高い階層レベルに切り替わるとき、異なるタイプの例外をマスクするために複数のマスクを設定し、単独の命令の実行に応答して前記マスクのすべてをリセットするように構成された請求項1から7のいずれかに記載のデータ処理装置。   When the data processing circuit switches from a lower software hierarchy level to a higher hierarchy level in response to an exception, the data processing circuit sets a plurality of masks to mask different types of exceptions, and executes a single instruction. The data processing apparatus according to claim 1, wherein the data processing apparatus is configured to reset all of the masks in response. 前記単独の命令は、クリティカルなコードの実行が終了したことを示す命令を含む請求項8に記載のデータ処理装置。   The data processing apparatus according to claim 8, wherein the single instruction includes an instruction indicating that execution of a critical code is finished. 前記ソフトウェアの階層レベルは、アプリケーション・ソフトウェアを含む第1の低いレベル、オペレーティング・システム・ソフトウェアと、デバッグ・ソフトウェアを含む前記オペレーティング・システム・ソフトウェアの拡張を含む2番目のより高いレベル、ハイパーバイザのソフトウェアを含む3番目の1番高いレベルを含む、請求項1から9のいずれかに記載のデータ処理装置。   The hierarchical level of the software includes a first lower level including application software, an operating system software, and a second higher level including an extension of the operating system software including debug software. The data processing apparatus according to any one of claims 1 to 9, including a third highest level including software. 前記データ処理装置は、ステータス・インジケータとさらにトラップ・インジケータを含むインジケータを保存するためのステータス記憶領域を含み、前記トラップ・インジケータは、前記デバッグ・ソフトウェアを前記ハイパーバイザ・レベルで実行することを示すトラップ値を有し、
前記データ処理回路は、前記トラップ値を有する前記トラップ・インジケータに応答して前記処理回路が現在前記ハイパーバイザ・レベルで実行していて、前記ステータス・インジケータが前記事前定義された許可値に設定されていないか、または前記現在のデバッグ例外マスク値が前記第1の値に設定されている場合、デバッグ例外取得を許可せず、前記ステータス・インジケータが前記事前定義された許可値に設定され、しかも前記現在のデバッグ例外マスク値が前記第1の値に設定されていない場合、または前記データ処理回路が現在、前記ハイパーバイザ・レベルよりも階層的に低いレベルで実行している場合、前記ハイパーバイザ・レベルでデバッグ例外取得を許可するように構成される請求項10に記載のデータ処理装置。
The data processing device includes a status storage area for storing an indicator including a status indicator and further a trap indicator, wherein the trap indicator indicates that the debug software is to be executed at the hypervisor level. Has a trap value,
The data processing circuit is responsive to the trap indicator having the trap value, the processing circuit is currently executing at the hypervisor level, and the status indicator is set to the predefined permission value. If not, or if the current debug exception mask value is set to the first value, do not allow debug exception acquisition and the status indicator is set to the predefined permission value And if the current debug exception mask value is not set to the first value, or if the data processing circuit is currently executing at a hierarchically lower level than the hypervisor level, The data processing apparatus according to claim 10, wherein the data processing apparatus is configured to allow debug exception acquisition at a hypervisor level.
前記デバッグ例外は、ウォッチポイントまたはブレークポイントの少なくとも1つを含む、請求項1から11のいずれかに記載のデータ処理装置。   The data processing apparatus according to claim 1, wherein the debug exception includes at least one of a watchpoint and a breakpoint. 前記データ処理回路は、デバッグ例外の受け取と、前記現在のデバッグ例外マスク値が前記第1の値に設定されていることに応答して、ペンディングのデバッグ例外信号をアサートし、前記第1の値を保存しないように前記現在のデバッグ例外マスク値がクリアされていることに応答して、前記ペンディングのデバッグ例外を取得するように構成された、請求項1から12のいずれかに記載のデータ処理装置。 Wherein the data processing circuit, when will receive the debug exception, the current debug exception mask value in response to being set to the first value, and asserts a debug exception signal pending, the first 13. Data according to any one of the preceding claims, configured to obtain the pending debug exception in response to the current debug exception mask value being cleared so as not to save the value. Processing equipment. 前記データ処理回路は、ステップ・モードの制御信号に応答してステップ・モードで実行するように構成され、この場合、プログラム内の命令は、順次のステップとして実行され、前記ステップ・モードでは、前記データ処理回路は、各前記命令の実行後に、デバッグ例外をアサートするように構成された、請求項1から13のいずれかに記載のデータ処理装置。 The data processing circuit is configured to execute in step mode in response to a step mode control signal, wherein instructions in the program are executed as sequential steps, wherein in the step mode the The data processing device according to claim 1, wherein the data processing circuit is configured to assert a debug exception after execution of each of the instructions . 前記データ処理回路が前記順次命令の1つの実行中に例外を受け取ることに応答して、前記データ処理装置は、前記現在のデバッグ例外マスク値を前記第1の値に設定し、ペンディングのデバッグ例外をアサートし、前記現在のデバッグ例外マスク値が前記第1の値に設定されていないことに応答して、前記データ処理回路は、前記ペンディングのデバッグ例外を取得するように構成される、請求項14に記載のデータ処理装置。   In response to the data processing circuit receiving an exception during execution of one of the sequential instructions, the data processing device sets the current debug exception mask value to the first value and sets a pending debug exception. And the data processing circuit is configured to obtain the pending debug exception in response to the current debug exception mask value not being set to the first value. 14. A data processing apparatus according to 14. データ処理装置内でデバッグ・オペレーションの開始を制御する方法であって、前記データ処理装置は、複数の異なるソフトウェア階層レベルに対応するプログラム命令を実行するように構成され、より高い階層レベルからアクセスできるが、より低い階層レベルからはアクセスできない少なくともいくつかのデータ記憶場所があるように、前記より高いソフトウェアの階層レベルは、前記より低いソフトウェア階層レベルに比べて大きな特権を持ち、前記方法は、
前記データ処理装置がクリティカルなコードを実行することに応答し、前記データ処理装置内のデータ記憶に現在のデバッグ例外マスク値を第1の値に設定し、および前記クリティカルなコードの実行が終了すると、前記現在のデバッグ例外マスク値を前記第1の値を保存しないように再設定するステップと、
現在、ソフトウェアが実行しているレベルと同じ階層レベルで前記デバッグ・ソフトウェアを実行する場合であって、前記現在のデバッグ例外マスク値が前記第1の値に設定されていない場合にはデバッグ例外の取得を許可し、前記現在のデバッグ例外マスク値が前記第1の値に設定されている場合には前記デバッグ例外取得を許可しないようにするステップと、
事前定義された、現在、ソフトウェアが実行しているレベルと同じ階層レベルより高いソフトウェア階層レベルで前記デバッグ・ソフトウェアを実行する場合は、デバッグ例外取得を許可するステップとを含む、前記方法。
A method for controlling the start of a debug operation within a data processing device, wherein the data processing device is configured to execute program instructions corresponding to a plurality of different software hierarchy levels and is accessible from a higher hierarchy level However, the higher software hierarchy level has greater privileges than the lower software hierarchy level so that there are at least some data storage locations that are not accessible from the lower hierarchy level;
In response to the data processing device executing critical code, setting a current debug exception mask value to a first value in data storage in the data processing device, and terminating execution of the critical code Re-setting the current debug exception mask value to not save the first value;
If the debug software is executed at the same hierarchical level as the level at which the software is currently being executed and the current debug exception mask value is not set to the first value, the debug exception Allowing acquisition, and not allowing the debug exception acquisition if the current debug exception mask value is set to the first value;
Allowing debug exception acquisition if the debug software is executed at a software hierarchy level that is predefined and higher than the same hierarchy level at which the software is currently executing .
請求項16に記載の方法であって、
前記データ処理装置は、ステータス・インジケータを保存するためのステータス記憶領域を含み、前記ステータス・インジケータの少なくとも1つは、前記ソフトウェア階層レベルの少なくとも1つに対応したデバッグ許可ステータス・インジケータを含み、
前記事前定義されたソフトウェア階層レベルで命令を実行する場合、
前記事前定義されたソフトウェア階層レベルに対する前記デバッグ許可ステータス・インジケータが事前定義された許可値に設定されていて、前記現在のデバッグ例外マスク値が前記第1の値に設定されていない場合、前記デバッグ例外取得を許可し、
前記ステータス・インジケータが前記事前定義された許可値に設定されていないか、または前記現在のデバッグ例外マスク値が前記第1の値に設定されている場合に前記デバッグ例外取得を許可しない、請求項18に記載の方法。
The method according to claim 16, comprising:
The data processing device includes a status storage area for storing status indicators, at least one of the status indicators including a debug permission status indicator corresponding to at least one of the software hierarchy levels;
When executing instructions at the predefined software hierarchy level,
If the debug permission status indicator for the predefined software hierarchy level is set to a predefined permission value and the current debug exception mask value is not set to the first value; Allow debug exception acquisition,
The debug exception is not allowed to be taken if the status indicator is not set to the predefined permission value or the current debug exception mask value is set to the first value. Item 19. The method according to Item 18.
データ・プロセッサ上で実行されると、データ・プロセッサが請求項16又は17のいずれかに記載の方法のステップを行うように機能するコンピュータ・プログラム。 When executed on a data processor, a computer program that functions as a data processor performs the steps of the method according to any one of claims 16 or 17. データ処理装置で実行するコンピュータ・プログラムによって提供される仮想マシンであって、前記データ処理装置は、
プログラム命令の実行に応答してデータ処理オペレーションを行うためのデータ処理回路と、
該データ処理回路上で実行するデバッグ・ソフトウェアによって制御されるデバッグ・オペレーションを行うためのデバッグ回路と、を含み、
前記データ処理装置は、現在のデバッグ例外マスク値を保存するためのデータ記憶を含み、
前記データ処理回路は、クリティカルなコードの実行に応答してデータ記憶に、前記現在のデバッグ例外マスク値を第1の値に設定し、前記クリティカルなコードの実行の終了時に前記現在のデバッグ例外マスク値を前記第1の値を保存しないようにリセットするように構成され、
前記データ処理回路は、複数の異なるソフトウェア階層レベルに対応するプログラム命令を実行するように構成され、より高い階層レベルからアクセスできるが、より低い階層レベルからはアクセスできない少なくともいくつかのデータ記憶場所があるように、前記より高いソフトウェアの階層レベルは、前記より低いソフトウェア階層レベルに比べて大きな特権を持ち、
前記データ処理回路は、
現在、ソフトウェアが実行しているレベルと同じ階層レベルで前記デバッグ・ソフトウェアを実行する場合であって、
前記現在のデバッグ例外マスク値が前記第1の値に設定されていない場合には、デバッグ例外取得を許可し、
前記現在のデバッグ例外マスク値が前記第1の値に設定されている場合には、前記デバッグ例外取得を許可しないように構成され、
事前定義された、現在、ソフトウェアが実行しているレベルと同じ階層レベルより高いソフトウェア階層レベルで前記デバッグ・ソフトウェアを実行する場合は、デバッグ例外取得を許可するように構成され、
前記仮想マシンは、前記コンピュータ・プログラムの実行により、前記データ処理装置によって提供される命令実行環境およびアプリケーション・プログラム・インターフェースと同じ命令実行環境およびアプリケーション・プログラム・インターフェースを提供する、前記仮想マシン。
A virtual machine that is provided by a computer program executing on a data processing apparatus, the data processing device,
A data processing circuit for performing data processing operations in response to execution of program instructions;
A debug circuit for performing a debug operation controlled by debug software executed on the data processing circuit,
The data processing device includes a data store for storing a current debug exception mask value;
The data processing circuit sets the current debug exception mask value to a first value in data storage in response to critical code execution, and sets the current debug exception mask at the end of execution of the critical code. Configured to reset a value not to store the first value;
The data processing circuit is configured to execute program instructions corresponding to a plurality of different software hierarchy levels and is accessible from a higher hierarchy level, but at least some data storage locations that are not accessible from a lower hierarchy level As such, the higher software hierarchy level has greater privileges than the lower software hierarchy level,
The data processing circuit includes:
The debug software is executed at the same hierarchical level as the level at which the software is currently running,
If the current debug exception mask value is not set to the first value, allow debug exception acquisition;
If the current debug exception mask value is set to the first value, the debug exception acquisition is configured not to be permitted;
If the debug software is run at a predefined software hierarchy level that is higher than the same hierarchy level at which the software is currently running, it is configured to allow debug exception acquisition;
The virtual machine, the execution of the computer program, to provide the data processing device the same instruction execution environment and application program interface and instruction execution environment and application program interface provided by the virtual machine .
JP2013550946A 2011-01-28 2012-01-19 Controlling debug exception generation Active JP5905904B2 (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
GB1101490.9 2011-01-28
GB1101490.9A GB2487575B (en) 2011-01-28 2011-01-28 Controlling generation of debug exceptions
PCT/GB2012/050115 WO2012101425A1 (en) 2011-01-28 2012-01-19 Controlling generation of debug exceptions

Publications (2)

Publication Number Publication Date
JP2014507720A JP2014507720A (en) 2014-03-27
JP5905904B2 true JP5905904B2 (en) 2016-04-20

Family

ID=43824737

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013550946A Active JP5905904B2 (en) 2011-01-28 2012-01-19 Controlling debug exception generation

Country Status (9)

Country Link
US (1) US8713371B2 (en)
EP (1) EP2668578B1 (en)
JP (1) JP5905904B2 (en)
KR (1) KR102003663B1 (en)
GB (1) GB2487575B (en)
IL (1) IL227320A (en)
MY (1) MY159188A (en)
TW (1) TWI544330B (en)
WO (1) WO2012101425A1 (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9244814B1 (en) * 2013-06-25 2016-01-26 Cadence Design Systems, Inc Enriched log viewer
KR101479516B1 (en) * 2014-03-05 2015-01-07 소프트포럼 주식회사 Source code security weakness detection apparatus and method
GB2530050B (en) * 2014-09-10 2021-07-21 Advanced Risc Mach Ltd Debugging in a data processing apparatus
GB2532777B (en) * 2014-11-28 2021-07-07 Advanced Risc Mach Ltd System error handling in a data processing apparatus
GB2535212B (en) 2015-02-13 2021-08-04 Advanced Risc Mach Ltd An apparatus and method for controlling debugging of program instructions including a transaction
GB2535213B (en) 2015-02-13 2021-10-06 Advanced Risc Mach Ltd An apparatus and method for controlling debugging of program instructions including a transaction
US9996448B2 (en) 2016-02-25 2018-06-12 Red Hat Israel Ltd Breakpoint insertion into kernel pages
US10169106B2 (en) 2016-06-30 2019-01-01 International Business Machines Corporation Method for managing control-loss processing during critical processing sections while maintaining transaction scope integrity
US10394641B2 (en) * 2017-04-10 2019-08-27 Arm Limited Apparatus and method for handling memory access operations
US10452516B2 (en) * 2017-07-10 2019-10-22 Microsoft Technology Licensing, Llc Replaying time-travel traces relying on processor undefined behavior
WO2019231000A1 (en) * 2018-05-29 2019-12-05 라인플러스 주식회사 Java debugger blocking method and system for protecting program
KR102623022B1 (en) * 2018-06-08 2024-01-09 라인플러스 주식회사 Debugger blocking method and system for program protection
GB2581821B (en) * 2019-02-28 2021-06-30 Advanced Risc Mach Ltd Conditional yield to hypervisor instruction
US11734457B2 (en) * 2019-12-23 2023-08-22 Intel Corporation Technology for controlling access to processor debug features
GB2622801A (en) * 2022-09-28 2024-04-03 Advanced Risc Mach Ltd Exception control

Family Cites Families (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5390310A (en) 1991-09-30 1995-02-14 Apple Computer, Inc. Memory management unit having cross-domain control
JP3678759B2 (en) 1992-07-21 2005-08-03 アドバンスト・マイクロ・ディバイシズ・インコーポレイテッド Apparatus for generating an interrupt and method for generating an interrupt
US5491793A (en) * 1992-07-31 1996-02-13 Fujitsu Limited Debug support in a processor chip
US5809293A (en) * 1994-07-29 1998-09-15 International Business Machines Corporation System and method for program execution tracing within an integrated processor
US5574786A (en) 1995-02-06 1996-11-12 International Business Machines Corporation Securing trusted personal computer system against unauthorized movement
US6249881B1 (en) * 1997-07-01 2001-06-19 National Semiconductor Corporation Method for enabling and servicing critical interrupts while running an interrupt based debug monitor
US6282657B1 (en) * 1997-09-16 2001-08-28 Safenet, Inc. Kernel mode protection
FI108478B (en) 1998-01-21 2002-01-31 Nokia Corp Built-in system
JP2000076087A (en) 1998-08-28 2000-03-14 Hitachi Ltd Multioperating system control method
CA2309627A1 (en) 1998-09-25 2000-04-06 Hughes Electronics Corporation An apparatus for providing a secure processing environment
US6173386B1 (en) * 1998-12-14 2001-01-09 Cisco Technology, Inc. Parallel processor with debug capability
US6604123B1 (en) 1999-02-23 2003-08-05 Lucent Technologies Inc. Operating system transfer of control and parameter manipulation using portals
JP3659062B2 (en) 1999-05-21 2005-06-15 株式会社日立製作所 Computer system
JP4260984B2 (en) 1999-06-04 2009-04-30 株式会社東芝 Information processing apparatus and information processing method
JP3801833B2 (en) 2000-02-14 2006-07-26 株式会社東芝 Microprocessor
WO2001063416A1 (en) 2000-02-24 2001-08-30 Bops Incorporated Methods and apparatus for scalable array processor interrupt detection and response
EP1162536A1 (en) 2000-06-09 2001-12-12 Hitachi, Ltd. Multiple operating system control method
US6981153B1 (en) 2000-11-28 2005-12-27 Xilinx, Inc. Programmable logic device with method of preventing readback
JP2002318700A (en) 2001-04-19 2002-10-31 Hitachi Ltd Providing/control method for operation management information of virtual computer system and virtual computer system
US6883162B2 (en) 2001-06-06 2005-04-19 Sun Microsystems, Inc. Annotations for transaction tracing
DE10136335B4 (en) 2001-07-26 2007-03-22 Infineon Technologies Ag Processor with several arithmetic units
GB0124563D0 (en) * 2001-10-12 2001-12-05 Siroyan Ltd Debug exception registers
US7272832B2 (en) * 2001-10-25 2007-09-18 Hewlett-Packard Development Company, L.P. Method of protecting user process data in a secure platform inaccessible to the operating system and other tasks on top of the secure platform
US7350110B2 (en) 2002-01-14 2008-03-25 International Business Machines Corporation Method and system using hardware assistance for continuance of trap mode during or after interruption sequences
GB2411254B (en) 2002-11-18 2006-06-28 Advanced Risc Mach Ltd Monitoring control for multi-domain processors
JP2005128773A (en) * 2003-10-23 2005-05-19 Toshiba Corp Microprocessor and compiling method
JP4222370B2 (en) * 2006-01-11 2009-02-12 セイコーエプソン株式会社 Program for causing a computer to execute a debugging support apparatus and a debugging processing method
US20080034193A1 (en) 2006-08-04 2008-02-07 Day Michael N System and Method for Providing a Mediated External Exception Extension for a Microprocessor
JP2008090390A (en) * 2006-09-29 2008-04-17 Matsushita Electric Ind Co Ltd Microcomputer debugging system and microcomputer
US7996835B2 (en) 2006-10-10 2011-08-09 International Business Machines Corporation System, method and program for managing communication with multiple configurations for virtual machine

Also Published As

Publication number Publication date
US20120198278A1 (en) 2012-08-02
KR102003663B1 (en) 2019-07-25
US8713371B2 (en) 2014-04-29
IL227320A0 (en) 2013-09-30
GB2487575A (en) 2012-08-01
TWI544330B (en) 2016-08-01
KR20140005978A (en) 2014-01-15
EP2668578A1 (en) 2013-12-04
IL227320A (en) 2017-04-30
GB2487575B (en) 2017-04-12
TW201234175A (en) 2012-08-16
JP2014507720A (en) 2014-03-27
MY159188A (en) 2016-12-30
CN103339614A (en) 2013-10-02
EP2668578B1 (en) 2017-12-06
GB201101490D0 (en) 2011-03-16
WO2012101425A1 (en) 2012-08-02

Similar Documents

Publication Publication Date Title
JP5905904B2 (en) Controlling debug exception generation
Fattori et al. Dynamic and transparent analysis of commodity production systems
US9268666B2 (en) System and method for debugging of computer programs
US7536605B2 (en) Injection of software faults into an operational system
US6708326B1 (en) Method, system and program product comprising breakpoint handling mechanism for debugging and/or monitoring a computer instruction sequence
US7711914B2 (en) Debugging using virtual watchpoints
EP2787444A2 (en) Central processing unit, information processing apparatus, and intra-virtual-core register value acquisition method
US8037459B2 (en) Recovery from nested exceptions in an instrumentation routine
KR102025078B1 (en) Diagnosing code using single step execution
US7765526B2 (en) Management of watchpoints in debuggers
GB2552519A (en) Debugging Systems
US9652348B2 (en) Debugging in a data processing apparatus
JP5841199B2 (en) Safety protection method and processor
US10089474B2 (en) Virtual machine introspection
US7657792B2 (en) Identifying race conditions involving asynchronous memory updates
CN115878363A (en) Method, apparatus and computer readable storage medium for resolving processor exceptions
Gao et al. Debugging classification and anti-debugging strategies
Tröger et al. Software-implemented fault injection at firmware level
EP2600252B1 (en) System and method for debugging of computer programs
JP2000181748A (en) Debug system for multi-memory space program and its debug method
JP2020086872A (en) Debug system, bios, information processor, and debug method
Oikawa et al. Simultaneous virtual-machine logging and replay
Tröger Software-Implemented Fault Injection in the HPI FutureSOC Lab

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20150107

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20150630

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20150710

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20151013

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20160223

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20160317

R150 Certificate of patent or registration of utility model

Ref document number: 5905904

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250