[go: up one dir, main page]

JP2020086872A - Debug system, bios, information processor, and debug method - Google Patents

Debug system, bios, information processor, and debug method Download PDF

Info

Publication number
JP2020086872A
JP2020086872A JP2018219672A JP2018219672A JP2020086872A JP 2020086872 A JP2020086872 A JP 2020086872A JP 2018219672 A JP2018219672 A JP 2018219672A JP 2018219672 A JP2018219672 A JP 2018219672A JP 2020086872 A JP2020086872 A JP 2020086872A
Authority
JP
Japan
Prior art keywords
exception
bios
debug
function
smm
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2018219672A
Other languages
Japanese (ja)
Other versions
JP6996748B2 (en
Inventor
大介 上石
Daisuke Kamiishi
大介 上石
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NEC Platforms Ltd
Original Assignee
NEC Platforms Ltd
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 NEC Platforms Ltd filed Critical NEC Platforms Ltd
Priority to JP2018219672A priority Critical patent/JP6996748B2/en
Publication of JP2020086872A publication Critical patent/JP2020086872A/en
Application granted granted Critical
Publication of JP6996748B2 publication Critical patent/JP6996748B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

To provide a method for debugging a BIOS.SOLUTION: A debug system includes: an exception detection unit configured to detect exceptions that occur in a BIOS (Basic Input/Output System); an SMI issuing unit configured to issue an SMI (System Management Interrupt) when the exception detection unit detects an exception; and a debug function unit configured to execute a debug function in an SMM (System Management Mode).SELECTED DRAWING: Figure 11

Description

本発明は、デバッグシステム、BIOS、情報処理装置及びデバッグ方法に関する。 The present invention relates to a debug system, a BIOS, an information processing device and a debug method.

Xeon(登録商標)プロセッサ等を搭載したサーバにおいては、システムマネジメントモード(SMM:System Management Mode)と非SMMのモード変更を繰り返しながら、初期化が行われる。システムマネジメント割り込み(SMI:System Management Interrupt)は、最高の優先度を持ったハードウェア割り込みである。SMMはSMIを契機として移入するモードであり、プロセッサは、SMIが発行されると動作モードをSMMへ遷移させる。SMMは、オペレーティングシステム(OS)を含むユーザからはアクセスできない独立した環境である。SMMでの動作中のみアクセスすることができるメモリ空間(SMM protected memory)が設定されており、SMMでの動作中にプロセッサがSMM protected memory以外のコードを参照すると、例外割り込みが発生するセキュリティが設けられている(特許文献1)。 In a server equipped with a Xeon (registered trademark) processor or the like, initialization is performed by repeatedly changing the system management mode (SMM: System Management Mode) and the non-SMM mode. A system management interrupt (SMI) is a hardware interrupt with the highest priority. The SMM is a mode in which the SMI is used as a trigger for the transfer, and the processor changes the operation mode to the SMM when the SMI is issued. The SMM is an independent environment that cannot be accessed by users including the operating system (OS). A memory space (SMM protected memory) that can be accessed only while operating in SMM is set, and when the processor references a code other than SMM protected memory while operating in SMM, security is provided to cause an exception interrupt. (Patent Document 1).

一般的なソフトウェアデバッグ手法は、非SMMを前提としており、SMM protected memoryへのアクセスができない。一般的なOSやアプケーションのデバッグを行う場合には、SMM protected memoryを使用しないプログラムを対象とするデバッグであるため、SMM protected memoryへのアクセスができなくても特に不都合はない。しかしながら、BIOS(Basic Input/Output System)のデバッグを行う場合、SMM protected memoryもデバッグ対象となる場合がある。例えば、BIOSの場合、非SMMで動作するプログラム(非SMMプログラム)とSMMで動作するプログラム(SMMプログラム)が連携して処理を行うことがある。この場合、非SMMプログラムが期待外の動作をした場合でも、その原因はSMMプログラムにある場合がある。従って、BIOSで期待外の動作が発生した場合、原因を明らかにするためにはSMMプログラムと非SMMプログラムの両方がデバッグできる必要がある。 The general software debugging method is based on the non-SMM and cannot access the SMM protected memory. When debugging a general OS or application, since the debugging is intended for a program that does not use the SMM protected memory, there is no particular inconvenience even if the SMM protected memory cannot be accessed. However, when the BIOS (Basic Input/Output System) is debugged, the SMM protected memory may be the debug target. For example, in the case of BIOS, a program that operates in non-SMM (non-SMM program) and a program that operates in SMM (SMM program) may cooperate to perform processing. In this case, even if the non-SMM program performs an unexpected operation, the cause may be the SMM program. Therefore, when an unexpected operation occurs in the BIOS, it is necessary to debug both the SMM program and the non-SMM program in order to clarify the cause.

一般にBIOSファームウェアの開発においては、JTAG(Joint Test Action Group)規格の外部装置(デバッガ)をJTAGポート接続し、デバッグを行う。JTAGポートは、開発評価用の目的に使用され、セキュリティ上の配慮により、出荷時の基盤では削除されることが多い。つまり、出荷後に問題が起きてもJTAG規格のデバッガによるデバッグを行うことができない。 Generally, in the development of BIOS firmware, an external device (debugger) of JTAG (Joint Test Action Group) standard is connected to the JTAG port for debugging. The JTAG port is used for the purpose of development evaluation, and is often deleted from the base at the time of shipment due to security considerations. In other words, even if a problem occurs after shipping, it cannot be debugged by the JTAG standard debugger.

特許文献1には、SMMおよび非SMMの両方において読み出し可能で、SMMにおいてのみ書き換えが可能とされる保護すべきシステムデータに対して、読み出し専用領域に記憶し、非SMMコードの実行中に前記読み出し専用領域へアクセスさせることを可能とする方法が開示されている。 In Patent Document 1, system data to be protected that is readable in both SMM and non-SMM and can be rewritten only in SMM is stored in a read-only area, and is stored during execution of non-SMM code. A method is disclosed that allows access to a read-only area.

特表2013−536505号公報Japanese Patent Publication No. 2013-536505

サーバ上で稼働するOSやアプリケーションが、BIOSによって提供されるサービスを呼び出して使用するような場合、BIOSのプログラムを原因とする障害が発生し得る。JTAG規格のデバッガが使用できない状況であってもSMM protected memoryを使用して動作するプログラムのデバッグを行うことができる方法が求められている。 When an OS or application running on the server calls and uses a service provided by the BIOS, a failure due to the BIOS program may occur. There is a demand for a method capable of debugging a program that operates by using the SMM protected memory even when the JTAG standard debugger cannot be used.

そこでこの発明は、上述の課題を解決するデバッグシステム、BIOS、情報処理装置及びデバッグ方法を提供することを目的としている。 Therefore, an object of the present invention is to provide a debug system, a BIOS, an information processing device, and a debug method that solve the above-mentioned problems.

本発明の一態様によれば、デバッグシステムは、BIOS(Basic Input/Output System)で発生する例外を検出する例外検出部と、前記例外検出部が例外を検出するとSMI(System Management Interrupt)を発行するSMI発行部と、SMM(System Management Mode)でデバッグ機能を実行するデバッグ機能部と、を備える。 According to one aspect of the present invention, a debug system issues an exception detection unit that detects an exception that occurs in a BIOS (Basic Input/Output System) and an SMI (System Management Interrupt) when the exception detection unit detects an exception. And a debug function unit that executes a debug function in SMM (System Management Mode).

また、本発明の一態様によれば、BIOSは、BIOSで発生する例外を検出する例外検出部と、前記例外検出部が例外を検出するとSMIを発行するSMI発行部と、SMMでデバッグ機能を実行するデバッグ機能部と、を非SMMレイヤに備える。 Further, according to one aspect of the present invention, the BIOS has an exception detection unit that detects an exception that occurs in the BIOS, an SMI issuing unit that issues an SMI when the exception detection unit detects an exception, and a debug function by the SMM. A debug function unit to be executed is provided in the non-SMM layer.

また、本発明の他の一態様によれば、情報処理装置は、SMMでの動作が可能なプロセッサと、上記のBIOSと、を備える。 According to another aspect of the present invention, an information processing device includes a processor capable of operating in SMM and the BIOS described above.

また、本発明の他の一態様によれば、デバッグ方法は、BIOSで発生する例外を検出するステップと、前記例外を検出するとSMIを発行させるステップと、前記SMI発行により遷移したSMMでデバッグ機能を実行するステップと、を有する。 Further, according to another aspect of the present invention, a debugging method includes a step of detecting an exception that occurs in a BIOS, a step of issuing an SMI when the exception is detected, and a debug function using an SMM transitioned by the SMI issue. And a step of performing.

本発明によれば、SMM protected memoryにアクセスして動作するプログラムのデバッグを行うことができる。 According to the present invention, a program that operates by accessing the SMM protected memory can be debugged.

本発明の一実施形態によるデバッグシステムの一例を示す第1の図である。It is a 1st figure which shows an example of the debugging system by one Embodiment of this invention. 本発明の第一実施形態によるBIOS例外割り込みのハンドリングについて説明する図である。It is a figure explaining the handling of the BIOS exception interruption by 1st embodiment of this invention. 本発明の第一実施形態によるOS起動時の初期化処理の一例を示すフローチャートである。6 is a flowchart showing an example of initialization processing at OS startup according to the first embodiment of the present invention. 本発明の第一実施形態によるBIOSのデバッガの呼び出し処理の一例を示すフローチャートである。It is a flow chart which shows an example of calling processing of a debugger of BIOS by a first embodiment of the present invention. 本発明の第二実施形態によるBIOS例外アサーションのハンドリングを説明する図である。It is a figure explaining the handling of the BIOS exception assertion by 2nd embodiment of this invention. 本発明の第二実施形態によるアサーションに用いるパラメータの一例を示す図である。It is a figure which shows an example of the parameter used for the assertion by 2nd embodiment of this invention. 本発明の第二実施形態によるBIOSのデバッガの呼び出し処理の一例を示す第1のフローチャートである。It is a 1st flowchart which shows an example of the calling process of the debugger of BIOS by 2nd embodiment of this invention. 本発明の第二実施形態によるBIOSのデバッガの呼び出し処理の一例を示す第2のフローチャートである。It is a 2nd flowchart which shows an example of the calling process of the debugger of BIOS by 2nd embodiment of this invention. 本発明の一実施形態によるデバッグシステムの一例を示す第2の図である。It is a 2nd figure which shows an example of the debugging system by one Embodiment of this invention. 本発明の一実施形態によるデバッグシステムの一例を示す第3の図である。It is a 3rd figure which shows an example of the debugging system by one Embodiment of this invention. 本発明の各実施形態によるデバッグシステムの最小構成を示す図である。It is a figure which shows the minimum structure of the debug system by each embodiment of this invention. 本発明の各実施形態におけるデバッグシステムを搭載した情報処理装置のハードウェア構成の一例を示す図である。It is a figure which shows an example of the hardware constitutions of the information processing apparatus which mounts the debug system in each embodiment of this invention.

以下、本発明の各実施形態におけるデバッグシステムについて、図面を参照して説明する。
(システム構成)
図1は、本発明の各実施形態によるデバッグシステムの一例を示す図である。
デバッグシステム1は、OS10とBIOS20とを含む。OS10とBIOS20はソフトウェアである。デバッグシステム1は、サーバ等のコンピュータに実装され、コンピュータが備えるCPU(Central Processing Unit)等のプロセッサによって実行される。
Hereinafter, a debug system according to each embodiment of the present invention will be described with reference to the drawings.
(System configuration)
FIG. 1 is a diagram showing an example of a debug system according to each embodiment of the present invention.
The debug system 1 includes an OS 10 and a BIOS 20. The OS 10 and the BIOS 20 are software. The debug system 1 is mounted on a computer such as a server and is executed by a processor such as a CPU (Central Processing Unit) included in the computer.

OS10は、IDT(Interrupt Descriptor Table)110と、OS例外割り込みハンドリング機能120と、OS初期完了通知機能130とを備える。
IDT110は、例外割り込みベクタと例外割り込みハンドラを設定するテーブルである。IDT110には、0除算割り込み、breakpoint割り込み、ページフォルトなどの各種例外に対して、それぞれの例外が発生したときに呼び出される例外割り込みハンドラのメモリアドレスが登録されている。
OS例外割り込みハンドリング機能120は、IDT110に定義された例外が発生した時に実行されるハンドラである。OS10は、例外が発生すると、IDT110を参照して、例外に応じたOS例外割り込みハンドリング機能120を呼び出す。IDT110とOS例外割り込みハンドリング機能120は、一般的なOSの機能である。
The OS 10 includes an IDT (Interrupt Descriptor Table) 110, an OS exception interrupt handling function 120, and an OS initial completion notification function 130.
The IDT 110 is a table that sets an exception interrupt vector and an exception interrupt handler. In the IDT 110, memory addresses of exception interrupt handlers that are called when respective exceptions occur are registered for various exceptions such as division by 0 interrupt, breakpoint interrupt, and page fault.
The OS exception interrupt handling function 120 is a handler that is executed when an exception defined in the IDT 110 occurs. When an exception occurs, the OS 10 refers to the IDT 110 and calls the OS exception interrupt handling function 120 corresponding to the exception. The IDT 110 and the OS exception interrupt handling function 120 are general OS functions.

OS初期完了通知機能130は、IDT110の初期化が完了したことをBIOS20に通知する。一般的なOSは、この機能を備えていない。サーバ等のブートフローでは、IDT110の初期化完了後にACPI(Advanced Configuration and Power Interface)の初期化が開始される。OS初期完了通知機能130は、例えば、ACPIの初期化開始の契機である「\_SB._INI」の実行を契機として動作するように実装することができる。または、OS初期完了通知機能130を、IDT110の初期化完了を検出してBIOS20にその旨を通知するデーモン・サービスアプリケーションとして実装し、自動実行させるようにしてもよい。 The OS initial completion notification function 130 notifies the BIOS 20 that the initialization of the IDT 110 is completed. A general OS does not have this function. In the boot flow of a server or the like, the initialization of ACPI (Advanced Configuration and Power Interface) is started after the initialization of the IDT 110 is completed. The OS initial completion notification function 130 can be implemented, for example, so as to be triggered by the execution of “\_SB._INI”, which is the trigger for starting the initialization of ACPI. Alternatively, the OS initial completion notification function 130 may be implemented as a daemon service application that detects the completion of initialization of the IDT 110 and notifies the BIOS 20 of that fact, and may be automatically executed.

BIOS20は、非SMMレイヤ30と、SMMレイヤ40とを備える。非SMMレイヤ30は、非SMMでの動作時に実行され、SMMレイヤ40は、SMM動作時に実行される。
非SMMレイヤ30は、SMI発行機能310と、Debug/Release切り替え機能320と、BIOS例外割り込みハンドリング機能330と、IDT書き換え機能340と、アサーションハンドリング機能350と、を備える。
The BIOS 20 includes a non-SMM layer 30 and an SMM layer 40. The non-SMM layer 30 is executed when operating in non-SMM, and the SMM layer 40 is executed when operating in SMM.
The non-SMM layer 30 includes an SMI issuing function 310, a Debug/Release switching function 320, a BIOS exception interrupt handling function 330, an IDT rewriting function 340, and an assertion handling function 350.

SMI発行機能310は、SMIを発行する。上記のようにSMIはSMMへ移入するための割り込みである。本実施形態では、SMIの発行を、後述するSMMレイヤ40のデバッグ機能410を呼び出すために用いる。
Debug/Release切り替え機能320は、現在の動作モードを、詳細解析モード(debug)と出荷モード(release)との何れかに切り替える機能である。この機能は、例えば、何れかの動作モードを設定した設定ファイルをOS上に格納し、その設定に従って動作モードを切り替えるようにしてもよい。あるいは、何れかの動作モードを、UEFI(Unified Extensible Firmware Interface)に関する環境変数であるUEFI変数として設定して不揮発な媒体に格納し、その設定を読み込んで動作モードを切り替えるようにしてもよい。また、Debug/Release切り替え機能320は、設定ファイル等に基づいて、現在の動作モードを判断することができる。
The SMI issuing function 310 issues an SMI. As mentioned above, the SMI is an interrupt for populating the SMM. In this embodiment, the issuance of the SMI is used to call the debug function 410 of the SMM layer 40, which will be described later.
The Debug/Release switching function 320 is a function for switching the current operation mode to either the detailed analysis mode (debug) or the shipping mode (release). For this function, for example, a setting file in which any operation mode is set may be stored in the OS, and the operation mode may be switched according to the setting. Alternatively, any operation mode may be set as a UEFI variable that is an environment variable related to UEFI (Unified Extensible Firmware Interface), stored in a nonvolatile medium, and the operation mode may be switched by reading the setting. In addition, the Debug/Release switching function 320 can determine the current operation mode based on the setting file and the like.

BIOS例外割り込みハンドリング機能330は、例外割り込みの発生時にBIOSの例外割り込みか、OSの例外割り込みかを判断し、OS例外割り込みハンドリング機能120、または、SMI発行機能310を呼び出す。次に図2、図3を用いて説明するように、BIOS例外割り込みハンドリング機能330は、例外割り込みハンドラのように振る舞う。
IDT書き換え機能340は、IDT110を書き換え、BIOS例外割り込みハンドリング機能330を動作可能にする。一つの実装形態では、IDT書き換え機能340は、初期化後のIDT110に登録された所定の例外(例えば、PageFaut例外など)について、それらの例外に対応する割り込み番号(割り込みベクタ)と、BIOS例外割り込みハンドリング機能330を呼び出すためのメモリアドレスとを対応付けて登録する。つまり、IDT書き換え機能340は、それらの書き換えられた例外が発生すると、BIOS例外割り込みハンドリング機能330が呼び出されるような設定にIDT110を書き換える。
アサーションハンドリング機能350は、アサーション発生時にSMI発行機能310を呼び出す機能である。この機能については、後に図5を用いて説明する。
The BIOS exception interrupt handling function 330 determines whether a BIOS exception interrupt or an OS exception interrupt occurs when an exception interrupt occurs, and calls the OS exception interrupt handling function 120 or the SMI issuing function 310. Next, as will be described with reference to FIGS. 2 and 3, the BIOS exception interrupt handling function 330 behaves like an exception interrupt handler.
The IDT rewriting function 340 rewrites the IDT 110 and enables the BIOS exception interrupt handling function 330. In one implementation, the IDT rewrite function 340, for a predetermined exception registered in the IDT 110 after the initialization (for example, PageFut exception), the interrupt number (interrupt vector) corresponding to the exception, and the BIOS exception interrupt. A memory address for calling the handling function 330 is associated and registered. In other words, the IDT rewriting function 340 rewrites the IDT 110 so that the BIOS exception interrupt handling function 330 is called when the rewritten exceptions occur.
The assertion handling function 350 is a function that calls the SMI issuing function 310 when an assertion occurs. This function will be described later with reference to FIG.

SMMレイヤ40は、デバッグ機能410を備える。
デバッグ機能410は、BIOSのデバッグを行うための機能である。デバッグ機能410は、一般的なBIOSが備える機能である。デバッグ機能410には、例えば、レジスタダンプ、メモリダンプ、対話型デバッグ機能などが存在する。
The SMM layer 40 has a debug function 410.
The debug function 410 is a function for debugging the BIOS. The debug function 410 is a function included in a general BIOS. The debug function 410 includes, for example, a register dump, a memory dump, and an interactive debug function.

<第一実施形態>
(BIOS例外割り込みハンドリング機能)
次に第一実施形態におけるデバッグ機能の呼び出し処理について説明する。まず、図2を用いてBIOS例外割り込みハンドリング機能330について説明する。
図2は、本発明の第一実施形態によるBIOS例外割り込みのハンドリングについて説明する図である。
BIOS例外割り込みハンドリング機能330は、何らかの例外が発生し呼び出しを受けると、発生した例外の割り込みベクタに基づいて、発生した割り込みがPageFault割り込みかどうかを判定する(ステップS200)。PageFault割り込みの場合(ステップS200;Yes)、BIOS例外割り込みハンドリング機能330は、OS例外割り込みハンドリング機能120を呼び出す(ステップS210)。具体的には、BIOS例外割り込みハンドリング機能330は、PageFault割り込み用の割り込みハンドラの呼び出しを行う。ここで、PageFault割り込みとは、プログラムが物理メモリマップされていない仮想アドレス空間上のページにアクセスしたときにハードウェアが発生する例外割り込みである。PageFault割り込みは、プログラムのエラーではないためBIOSのデバッグ機能を呼び出さない。また、BIOS例外割り込みハンドリング機能330は、IDT書き換え機能340による書き換え前のIDT110に登録されていた例外割り込みベクタと例外割り込みハンドラの呼び出しアドレスの対応テーブルを内部に保持しており、この対応テーブルに基づいて、例外に応じたOS例外割り込みハンドリング機能120の呼び出しを行う。
<First embodiment>
(BIOS exception interrupt handling function)
Next, the calling process of the debug function in the first embodiment will be described. First, the BIOS exception interrupt handling function 330 will be described with reference to FIG.
FIG. 2 is a diagram illustrating handling of a BIOS exception interrupt according to the first embodiment of the present invention.
When an exception occurs and the call is received, the BIOS exception interrupt handling function 330 determines whether the generated interrupt is a PageFault interrupt based on the interrupt vector of the generated exception (step S200). In the case of the Page Fault interrupt (step S200; Yes), the BIOS exception interrupt handling function 330 calls the OS exception interrupt handling function 120 (step S210). Specifically, the BIOS exception interrupt handling function 330 calls an interrupt handler for PageFault interrupt. Here, the PageFault interrupt is an exception interrupt generated by hardware when a program accesses a page in a virtual address space that is not physical memory mapped. The Page Fault interrupt does not call the debug function of the BIOS because it is not a program error. Further, the BIOS exception interrupt handling function 330 internally holds a correspondence table of the exception interrupt vector registered in the IDT 110 before rewriting by the IDT rewriting function 340 and the calling address of the exception interrupt handler, and based on this correspondence table. Then, the OS exception interrupt handling function 120 is called according to the exception.

PageFault割り込みではない場合(ステップS200;No)、BIOS例外割り込みハンドリング機能330は、例外が発生したメモリアドレスがBIOSのエリア外かどうかを判定する(ステップS220)。x86アーキテクチャ等の一般的なCPUにおいては、例外割り込み発生時に、例外割り込み発生時の命令アドレス、例外割り込み要因がCPUのレジスタに格納される。BIOS例外割り込みハンドリング機能330は、この例外割り込み発生時の命令アドレスがBIOSのエリア(コード領域)どうかを確認することで、BIOSのエリアで例外割り込みが発生したかを判定することができる。また、BIOSのコード領域については、BIOSが生成したUEFI Memory Mapを参照することにより判断することができる。 When it is not the Page Fault interrupt (step S200; No), the BIOS exception interrupt handling function 330 determines whether the memory address where the exception occurred is outside the BIOS area (step S220). In a general CPU such as x86 architecture, when an exception interrupt occurs, the instruction address and the exception interrupt factor at the time of the exception interrupt are stored in a register of the CPU. The BIOS exception interrupt handling function 330 can determine whether an exception interrupt has occurred in the BIOS area by checking whether the instruction address at the time of the exception interrupt occurrence is the BIOS area (code area). The BIOS code area can be determined by referring to the UEFI Memory Map generated by the BIOS.

BIOSのエリア外の場合(ステップS220;Yes)、BIOS例外割り込みハンドリング機能330は、例外に応じたOS例外割り込みハンドリング機能120を呼び出す(ステップS230)。
BIOSのエリア内の場合(ステップS220;No)、BIOS例外割り込みハンドリング機能330は、SMI発行機能310を呼び出す(ステップS240)。
このようにBIOS例外割り込みハンドリング機能330を呼び出し可能な状態とすることにより、BIOSのコード領域で例外が発生した場合に、SMI発行により、SMMへ移入することができる。次に図3を用いて、BIOS例外割り込みハンドリング機能330を呼び出し可能な状態にするための処理の一例について説明する。
If it is outside the BIOS area (step S220; Yes), the BIOS exception interrupt handling function 330 calls the OS exception interrupt handling function 120 corresponding to the exception (step S230).
If it is within the BIOS area (step S220; No), the BIOS exception interrupt handling function 330 calls the SMI issuing function 310 (step S240).
By making the BIOS exception interrupt handling function 330 callable in this way, when an exception occurs in the BIOS code area, it is possible to transfer to the SMM by issuing an SMI. Next, an example of processing for making the BIOS exception interrupt handling function 330 callable will be described with reference to FIG.

(BIOS例外割り込みハンドリング機能の初期化)
図3は、本発明の第一実施形態によるOS起動時の初期化処理の一例を示すフローチャートである。
図3を用いてOS10の起動時にBIOS例外割り込みハンドリング機能330を呼び出し可能とするようにIDT110に登録する処理(初期化)について説明する。
まず、OS10は、OS例外割り込みハンドリング機能120を初期化する(ステップS310)。例えば、OS10は、各種の例外が発生した時に割り込みハンドラを呼び出せるように、各種ハンドラを実行可能な状態にする。
次にOS10は、IDT110を初期化する(ステップS320)。例えば、OS10は、各種の例外割り込みベクタと対応する例外割り込みハンドラをIDT110に登録する。
次にOS10は、OS初期化完了通知機能130を実行する。OS初期化完了通知機能130は、IDT110の初期化完了をBIOS20へ通知する(ステップS330)。
IDT110の初期化完了通知を受信したBIOS20は、Debug/Release切り替え機能320により、現在の動作モードを確認する(ステップS340)。現在の動作モードがRelease(出荷モード)の場合、本初期化処理を終了する。
現在の動作モードがDebug(詳細解析モード)の場合、BIOS20は、IDT書き換え機能340を呼び出す(ステップS350)。IDT書き換え機能340は、BIOS例外割り込みハンドリング機能330を呼び出せるようにIDT110へ登録を行う。例えば、IDT書き換え機能340は、初期化後のIDT110に対して、所定の割り込みベクタとBIOS例外割り込みハンドリング機能330のアドレスとを対応付けて登録する。これにより、所定の割り込みベクタが示す例外が発生したときにBIOS例外割り込みハンドリング機能330が呼び出し可能となる。図2を用いて説明したようにBIOS例外割り込みハンドリング機能330は、例外割り込みベクタに基づいて、例外の発生エリアがBIOSのコード領域でなければ、例外に応じたOS例外割り込みハンドリング機能120を呼び出し、例外の発生エリアがBIOSのコード領域であれば、SMI発行機能310を呼び出す。
(Initialize the BIOS exception interrupt handling function)
FIG. 3 is a flowchart showing an example of initialization processing at OS startup according to the first embodiment of the present invention.
A process (initialization) for registering in the IDT 110 so that the BIOS exception interrupt handling function 330 can be called when the OS 10 is activated will be described with reference to FIG.
First, the OS 10 initializes the OS exception interrupt handling function 120 (step S310). For example, the OS 10 makes various handlers executable so that the interrupt handler can be called when various exceptions occur.
Next, the OS 10 initializes the IDT 110 (step S320). For example, the OS 10 registers exception interrupt handlers corresponding to various exception interrupt vectors in the IDT 110.
Next, the OS 10 executes the OS initialization completion notification function 130. The OS initialization completion notifying function 130 notifies the BIOS 20 of the completion of initialization of the IDT 110 (step S330).
Upon receiving the initialization completion notification of the IDT 110, the BIOS 20 confirms the current operation mode by the Debug/Release switching function 320 (step S340). If the current operation mode is Release (shipping mode), this initialization processing ends.
When the current operation mode is Debug (detailed analysis mode), the BIOS 20 calls the IDT rewriting function 340 (step S350). The IDT rewriting function 340 registers in the IDT 110 so that the BIOS exception interrupt handling function 330 can be called. For example, the IDT rewrite function 340 registers a predetermined interrupt vector and the address of the BIOS exception interrupt handling function 330 in association with each other in the initialized IDT 110. This enables the BIOS exception interrupt handling function 330 to be called when an exception indicated by a predetermined interrupt vector occurs. As described with reference to FIG. 2, the BIOS exception interrupt handling function 330 calls the OS exception interrupt handling function 120 corresponding to the exception if the exception generation area is not the BIOS code area based on the exception interrupt vector. If the exception generation area is the BIOS code area, the SMI issuing function 310 is called.

(デバッガ呼び出し処理)
次に図4を用いて、SMI発行機能310が呼び出されたときにBIOSのデバッガを呼び出す処理について説明する。
図4は、本発明の第一実施形態によるBIOSのデバッガの呼び出し処理の一例を示すフローチャートである。
図3で説明した処理によりIDT110にBIOS例外割り込みハンドリング機能330が登録され、例外が発生し、図2で説明した処理によりSMI発行機能310が呼び出されたとする。
まず、SMI発行機能310は、所定のデバッグ要求情報をBIOSが確保したメモリ領域に格納する(ステップS410)。次にSMI発行機能310は、SMIを発行する(ステップS420)。例えば、PCH(Platform Controller Hub)を備えたチップを搭載している場合、PCHのAdvanced Power Management Control PortのIOアドレスに所定の値を書くことでSMIを発行することができる。
(Debugger call processing)
Next, a process of calling the BIOS debugger when the SMI issuing function 310 is called will be described with reference to FIG.
FIG. 4 is a flowchart showing an example of calling processing of the BIOS debugger according to the first embodiment of the present invention.
It is assumed that the BIOS exception interrupt handling function 330 is registered in the IDT 110 by the processing described in FIG. 3, an exception occurs, and the SMI issuing function 310 is called by the processing described in FIG.
First, the SMI issuing function 310 stores predetermined debug request information in the memory area secured by the BIOS (step S410). Next, the SMI issuing function 310 issues an SMI (step S420). For example, when a chip equipped with a PCH (Platform Controller Hub) is mounted, an SMI can be issued by writing a predetermined value in the IO address of the Advanced Power Management Control Port of the PCH.

SMIが発行されると、プロセッサの動作はSMMに遷移する。SMMレイヤ40は、SMI割り込み発生時の情報(コンテキスト)をメモリ上(SMM protected memory)に保存する(ステップS430)。このとき、ステップS410で格納されたデバッグ要求情報もメモリへ保存される。次にSMMレイヤ40は、メモリを参照し、デバッグ要求情報が格納されているかどうかを判断する(ステップS440)。
デバッグ要求情報が格納されている場合(ステップS440;Yes)、SMMレイヤ40は、デバッグ機能410を実行する(ステップS450)。デバッグ機能410は、レジスタダンプ、メモリダンプを実施する。これにより、詳細解析モードで稼働するシステムでOSやアプリケーションが、BIOSによって提供されるサービスを利用しているときに障害が発生した場合、SMMへ移入しデバッガを起動することができる。これにより、BIOSのコード領域(SMMプログラム、非SMMプログラムを含む)で発生した障害情報を採取することができる。
When the SMI is issued, the operation of the processor transits to SMM. The SMM layer 40 saves the information (context) when the SMI interrupt occurs in the memory (SMM protected memory) (step S430). At this time, the debug request information stored in step S410 is also stored in the memory. Next, the SMM layer 40 refers to the memory and determines whether the debug request information is stored (step S440).
When the debug request information is stored (step S440; Yes), the SMM layer 40 executes the debug function 410 (step S450). The debug function 410 executes register dump and memory dump. As a result, when an OS or application in the system operating in the detailed analysis mode fails while using a service provided by the BIOS, it is possible to transfer to the SMM and activate the debugger. As a result, it is possible to collect the failure information generated in the BIOS code area (including the SMM program and the non-SMM program).

ステップS450の実行後、あるいはステップS440でデバッグ要求無し、と判断された場合、プロセッサは、ステップS430で格納した情報を参照し、SMI割り込み時の状態に復旧し(ステップS460)、SMM終了コマンドを発行する(ステップS470)。 After executing step S450 or when it is determined in step S440 that there is no debug request, the processor refers to the information stored in step S430, restores the state at the SMI interrupt time (step S460), and issues the SMM end command. Issue (step S470).

本実施形態によれば、外部装置を必要とせずにBIOSで生じた例外のデバッグを行うことができる。特にSMM protected memoryにアクセスして動作するSMMプログラムのデバッグを行うことができる。 According to this embodiment, it is possible to debug an exception that has occurred in the BIOS without requiring an external device. In particular, the SMM protected memory can be accessed to debug an operating SMM program.

<第二実施形態>
第一実施形態では、詳細解析モード時にBIOS例外割り込みを補足してSMI発行を行うことにより、BIOSのデバッグ機能を呼び出す方法を説明した。第二実施形態では、非SMMプログラムにアサーション(assertion)を記載して、アサーションの診断結果に基づいてSMI発行を行う。アサーションとは、プログラムの処理や条件の成立を表明するための手法や機能のことである。本実施形態では、非SMMプログラムのコードにおける診断を行う部分に以下の記載を挿入する。
ASSERT(expression)
アサーションハンドリング機能350は、診断の結果(評価式expressionの値)に応じてSMI発行機能310を呼び出す機能を備える。図5を用いて、アサーションハンドリング機能350について説明する。
図5は、本発明の第二実施形態によるアサーションハンドリング機能を説明する図である。
アサーションが記載された非SMMプログラムが実行され、ASSERT(expression)を実行しているとする。アサーションハンドリング機能350は、アサーションの評価式expressionの値を判断する(ステップS510)。expressionの値がTRUEではない場合、アサーションハンドリング機能350は、SMI発行機能310を呼び出す(ステップS520)。SMI発行機能310を呼び出した後の処理は、図4で説明したものと同様である。つまり、SMI発行により、SMMへ移入し、デバッグ機能410を実行することができる。
<Second embodiment>
In the first embodiment, the method of calling the debug function of the BIOS by supplementing the BIOS exception interrupt and issuing the SMI in the detailed analysis mode has been described. In the second embodiment, an assertion is described in the non-SMM program, and the SMI issuance is performed based on the diagnosis result of the assertion. Assertions are methods and functions for expressing the processing of programs and the establishment of conditions. In the present embodiment, the following description is inserted in the part of the code of the non-SMM program that performs the diagnosis.
ASSERT (expression)
The assertion handling function 350 has a function of calling the SMI issuing function 310 according to the result of the diagnosis (the value of the evaluation expression). The assertion handling function 350 will be described with reference to FIG.
FIG. 5 is a diagram illustrating an assertion handling function according to the second embodiment of the present invention.
It is assumed that the non-SMM program in which the assertion is described is executed and ASSERT (expression) is executed. The assertion handling function 350 determines the value of the evaluation expression expression of the assertion (step S510). If the expression value is not TRUE, the assertion handling function 350 calls the SMI issuing function 310 (step S520). The process after calling the SMI issuing function 310 is the same as that described with reference to FIG. That is, by issuing the SMI, it is possible to import into the SMM and execute the debug function 410.

非SMM30レイヤ30が、アサーションハンドリング機能350を備えることにより、例えば、非SMMプログラムからSMMプログラムを呼び出す箇所などにアサーションを記載することで、SMM protected memoryを含むBIOSのコード領域で発生した障害情報を採取することができる。また、第二実施形態のデバッガ呼び出し方法は、出荷モードにも適用することができる。 By providing the assertion handling function 350 in the non-SMM 30 layer 30, for example, by writing an assertion at a place where the SMM program is called from the non-SMM program, the failure information generated in the BIOS code area including the SMM protected memory can be displayed. Can be collected. The debugger calling method of the second embodiment can also be applied to the shipping mode.

さらに、アサーションチェックを拡張することにより、解析性と可用性を向上することが可能である。図6を用いて、拡張されたアサーションに用いるパラメータを説明する。
図6は、本発明の第二実施形態によるアサーションに用いるパラメータの一例を示す図である。
例えば、非SMMプログラムの診断を行う部分に以下の拡張されたアサーションの記載を行う。
ASSERT_EX(expression,debug_policy,debug_interactive,output_data,recovery)
上記引数のうちexpressionには評価式を設定する。また、debug_policyには、出荷モード時の動作を設定する。例えば、出荷モード時にデバッグを実施するか(release_mode_debug)、リカバリのみを実施するか(release_mode_recovery_only)、何もしないか(release_mode_none)を設定する。debug_interactiveには、対話型デバッグを行うか否かを設定する。output_dataには、解析に必要なデータを設定する。recoveryには、継続運用を行うか(recovery_mode_need)、OSダンプを行うか(recovery_mode_dump)、何もしないか(recovery_mode_none)を設定する。なお、継続運用を行う設定の場合には、リカバリ処理の内容(アサーション要因を解決するための式)を設定することができる(recovery_expression)。
Furthermore, by extending the assertion check, it is possible to improve the parseability and availability. The parameters used for the extended assertion will be described with reference to FIG.
FIG. 6 is a diagram showing an example of parameters used for an assertion according to the second embodiment of the present invention.
For example, the following expanded assertion is described in the part that diagnoses the non-SMM program.
ASSERT_EX(expression, debug_policy, debug_interactive, output_data, recovery)
An evaluation expression is set in expression among the above arguments. Further, the operation in the shipping mode is set in the debug_policy. For example, it is set whether to perform debugging in the shipping mode (release_mode_debug), only recovery (release_mode_recovery_only), or nothing (release_mode_none). In debug_interactive, whether to perform interactive debugging is set. Data required for analysis is set in output_data. For recovery, whether continuous operation is performed (recovery_mode_need), OS dump is performed (recovery_mode_dump), or nothing is performed (recovery_mode_none) is set. In addition, in the case of setting to perform continuous operation, the content of the recovery process (expression for solving the assertion factor) can be set (recovery_expression).

(デバッガ呼び出し処理)
次に図7、図8を用いて、拡張されたアサーション(ASSERT_EX)を用いたデバッガ呼び出し処理についてより具体的に説明する。
図7、図8は、それぞれ、本発明の第二実施形態によるBIOSのデバッガの呼び出し処理の一例を示す第1のフローチャート、第2のフローチャートである。
拡張されたアサーションが記載された非SMMプログラムが実行されているとする。アサーションハンドリング機能350は、アサーションの記載箇所ごとに以下の処理を実行する。
まず、アサーションハンドリング機能350は、ASSERT_EXの評価式expressionの値がTRUEか判断する(ステップS710)。expressionの値がTRUEの場合(ステップS710;Yes)、本フローチャートの処理を終了する。expressionの値がFALSEの場合(ステップS710;No)、デバッグ処理が開始される。例えば、expressionに(val==1)と記載した場合、valが1以外であれば、expressionの値がFALSEとなるので、アサーションハンドリング機能350が、以下の処理を開始する。
(Debugger call processing)
Next, the debugger calling process using the expanded assertion (ASSERT_EX) will be described more specifically with reference to FIGS. 7 and 8.
7 and 8 are a first flowchart and a second flowchart, respectively, showing an example of the calling process of the BIOS debugger according to the second embodiment of the present invention.
It is assumed that the non-SMM program in which the expanded assertion is described is being executed. The assertion handling function 350 executes the following processing for each place where the assertion is described.
First, the assertion handling function 350 determines whether the value of the evaluation expression expression of ASSERT_EX is TRUE (step S710). When the expression value is TRUE (step S710; Yes), the process of this flowchart ends. When the expression value is FALSE (step S710; No), the debug process is started. For example, when (val==1) is described in expression, if val is other than 1, the expression value becomes FALSE, so the assertion handling function 350 starts the following processing.

まず、アサーションハンドリング機能350は、Debug/Release切り替え機能320を用いて、現在の動作モードを取得する(ステップS720)。アサーションハンドリング機能350は、現在の動作モードがReleaseかつASSERT_EXのdebug_policyがrelease_mode_noneであるかどうかを判断する(ステップS730)。この条件を満たす場合(ステップS730;Yes)、本フローチャートの処理を終了する。条件を満たさない場合(ステップS730;No)、アサーションハンドリング機能350は、SMI発行機能310を呼び出す(ステップS740)。すると、図4を用いて説明したように、SMI発行機能310は、デバッグ要求情報をメモリに格納し、SMIを発行する。SMIが発行されると、プロセッサの動作はSMMに遷移する。 First, the assertion handling function 350 uses the Debug/Release switching function 320 to acquire the current operation mode (step S720). The assertion handling function 350 determines whether the current operation mode is Release and the debug_policy of ASSERT_EX is release_mode_none (step S730). If this condition is satisfied (step S730; Yes), the process of this flowchart is ended. If the condition is not satisfied (step S730; No), the assertion handling function 350 calls the SMI issuing function 310 (step S740). Then, as described using FIG. 4, the SMI issuing function 310 stores the debug request information in the memory and issues the SMI. When the SMI is issued, the operation of the processor transits to SMM.

SMMレイヤ40は、SMI割り込み発生時の情報(コンテキスト)をメモリ上(SMM protected memory)に保存する(ステップS750)。このとき、SMI発行機能310が格納したデバッグ要求情報もメモリへ保存される。次にSMMレイヤ40は、メモリを参照し、デバッグ要求情報が格納されているかどうかを判断する(ステップS760)。デバッグ要求情報が格納されていない場合(ステップS760;No)、ステップS860以降の処理を行う(後述)。 The SMM layer 40 saves the information (context) when the SMI interrupt occurs in the memory (SMM protected memory) (step S750). At this time, the debug request information stored by the SMI issuing function 310 is also stored in the memory. Next, the SMM layer 40 refers to the memory and determines whether the debug request information is stored (step S760). When the debug request information is not stored (step S760; No), the processes after step S860 are performed (described later).

デバッグ要求情報が格納されている場合(ステップS760;Yes)、SMMレイヤ40は、デバッグ機能410を実行する。デバッグ機能410は、ステップS720でDebug/Release切り替え機能320により取得した現在の動作モードの情報を取得する(ステップS770)。デバッグ機能410は、現在の動作モードがDebugかつASSERT_EXのdebug_interactiveにtrueが設定されているかどうかを判断する(ステップS780)。この条件を満たす場合(ステップS780;Yes)、デバッグ機能410は、対話型デバッグ機能を実行する(ステップS790)。これにより、ユーザは、対話型でデバッグを行うことができる。 When the debug request information is stored (step S760; Yes), the SMM layer 40 executes the debug function 410. The debug function 410 acquires information on the current operation mode acquired by the Debug/Release switching function 320 in step S720 (step S770). The debug function 410 determines whether the current operation mode is Debug and the debug_interactive of ASSERT_EX is set to true (step S780). When this condition is satisfied (step S780; Yes), the debug function 410 executes the interactive debug function (step S790). This allows the user to interactively debug.

条件を満たさない場合(ステップS780;No)、デバッグ機能410は、現在の動作モードがReleaseかつASSERT_EXのrelease_mode_recovery_onlyにfalseが設定されているかどうかを判断する(ステップS800)。この条件を満たす場合(ステップS800;Yes)、デバッグ機能410は、ASSERT_EXのoutput_dataで指定された情報を表示する(ステップS810)。例えば、デバッグに必要な値として変数val_a、val_b、val_cがoutput_dataに(val_a;val_b;val_c)のように設定されている場合、プログラム実行時のval_a、val_b、val_cの値が表示される。
ステップS810の実行後、又はステップS800の判断がNoの場合、次にデバッグ機能410は、ASSERT_EXのrecoveryにrecovery_mode_needが設定されているかどうかを判断する(ステップS820)。この条件を満たす場合、デバッグ機能410は、recovery_expressionで指定されたリカバリ処理を実施する(ステップS830)。例えば、recovery_expressionに(val_a=2;)と設定されている場合、ステップS830では、val_a=2が実行される。
When the condition is not satisfied (step S780; No), the debug function 410 determines whether the current operation mode is Release and the release_mode_recovery_only of ASSERT_EX is set to false (step S800). When this condition is satisfied (step S800; Yes), the debug function 410 displays the information specified by output_data of ASSERT_EX (step S810). For example, when variables val_a, val_b, and val_c are set to output_data as (val_a; val_b; val_c) as values required for debugging, the values of val_a, val_b, and val_c at the time of program execution are displayed.
After execution of step S810 or when the determination in step S800 is No, the debug function 410 next determines whether recovery_mode_need is set in the recovery of ASSERT_EX (step S820). If this condition is satisfied, the debug function 410 executes the recovery process specified by recovery_expression (step S830). For example, when recovery_expression is set to (val_a=2;), val_a=2 is executed in step S830.

条件を満たさない場合(ステップS820;No)、デバッグ機能410は、ASSERT_EXのrecoveryにrecovery_mode_dumpが設定されているかどうかを判断する(ステップS840)。この条件を満たす場合、デバッグ機能410は、OSダンプ割り込みを実行する(ステップS850)。一般に、OSダンプ割り込みには、NMI(Non-Maskable Interrupt)が使用される。なお、NMIは一般的なPCHの機能を使うことで発行可能である。 When the condition is not satisfied (step S820; No), the debug function 410 determines whether or not the recovery_mode_dump is set in the recovery of the ASSERT_EX (step S840). If this condition is satisfied, the debug function 410 executes an OS dump interrupt (step S850). Generally, an NMI (Non-Maskable Interrupt) is used for the OS dump interrupt. The NMI can be issued by using a general PCH function.

ステップS790、ステップS830、ステップS850の何れかの実行後、又はステップS760かステップS840の判断がNoの場合、SMMレイヤ40は、ステップS750で格納した情報を参照し、SMI割り込み時の状態に復旧し(ステップS860)、SMM終了コマンドを発行する(ステップS870)。 After executing any of step S790, step S830, and step S850, or when the determination of step S760 or step S840 is No, the SMM layer 40 refers to the information stored in step S750 and restores the state at the time of the SMI interrupt. Then, the SMM end command is issued (step S860) (step S870).

本実施形態によれば、出荷モードにおいても、BIOSのコード領域(SMMプログラム、非SMMプログラムを含む)で発生した障害情報を採取することができる。さらに拡張されたアサーション(ASSERT_EX)を使用した場合には、詳細な動作指定とリカバリ処理を設定することができるので、解析性と可用性を両立させることが可能である。特に出荷モードにおいてシステムの通常運用を継続しつつ、問題解析に必要なデータを採取することができる。 According to this embodiment, even in the shipping mode, it is possible to collect the failure information generated in the BIOS code area (including the SMM program and the non-SMM program). When the further expanded assertion (ASSERT_EX) is used, detailed operation designation and recovery processing can be set, so that it is possible to achieve both analyticity and availability. In particular, in the shipping mode, it is possible to collect data necessary for problem analysis while continuing normal operation of the system.

<他の実施形態>
なお、図1では、第一実施形態と第二実施形態の両方の機能を備えたデバッグシステム1の構成例を示したが、第一実施形態の機能のみを実装した構成とすることが可能である。具体的には、一つの実施形態では、図9に示すようにデバッグシステム1Aを構成することが可能である。デバッグシステム1Aにおいて、OS10は、IDT110と、OS例外割り込みハンドリング機能120と、OS初期完了通知機能130とを備える。BIOS20において、非SMMレイヤ30は、SMI発行機能310と、Debug/Release切り替え機能320と、BIOS例外割り込みハンドリング機能330と、IDT書き換え機能340とを備え、SMMレイヤ40はデバッグ機能410を備える。
<Other Embodiments>
Although FIG. 1 shows a configuration example of the debug system 1 having the functions of both the first embodiment and the second embodiment, a configuration in which only the functions of the first embodiment are mounted may be used. is there. Specifically, in one embodiment, the debug system 1A can be configured as shown in FIG. In the debug system 1A, the OS 10 includes an IDT 110, an OS exception interrupt handling function 120, and an OS initial completion notification function 130. In the BIOS 20, the non-SMM layer 30 includes an SMI issuing function 310, a Debug/Release switching function 320, a BIOS exception interrupt handling function 330, and an IDT rewriting function 340, and the SMM layer 40 includes a debug function 410.

また、第二実施形態の機能のみを実装した図10に示すデバッグシステム1Bの構成とすることが可能である。デバッグシステム1BではBIOS20において、非SMMレイヤ30は、SMI発行機能310と、Debug/Release切り替え機能320と、アサーションハンドリング機能350とを備え、SMMレイヤ40は、デバッグ機能410を備える。 Further, it is possible to configure the debug system 1B shown in FIG. 10 in which only the functions of the second embodiment are mounted. In the debug system 1B in the BIOS 20, the non-SMM layer 30 includes an SMI issuing function 310, a Debug/Release switching function 320, and an assertion handling function 350, and the SMM layer 40 includes a debug function 410.

図11は、本発明の各実施形態によるデバッグシステムの最小構成を示す図である。
図11に示すようにデバッグシステム50は、少なくとも例外検出部501と、SMI発行部502と、デバッグ機能部503を備える。
例外検出部501は、BIOSのコード領域で発生する例外を検出する。例外検出部501は、上記実施形態のBIOS例外割り込みハンドリング機能330、アサーションハンドリング機能350に対応する。
SMI発行部502は、例外検出部501が例外を検出するとSMIを発行する。SMI発行部502は、SMI発行機能310に対応する。
デバッグ機能部503は、SMMでデバッグ機能を実行する。デバッグ機能部503は、デバッグ機能410に対応する。
一つの実施形態では、デバッグシステム50は、上記実施形態のBIOS20の非SMMレイヤ30に実装される。
FIG. 11 is a diagram showing the minimum configuration of the debug system according to each embodiment of the present invention.
As shown in FIG. 11, the debug system 50 includes at least an exception detection unit 501, an SMI issuing unit 502, and a debug function unit 503.
The exception detection unit 501 detects an exception that occurs in the BIOS code area. The exception detection unit 501 corresponds to the BIOS exception interrupt handling function 330 and the assertion handling function 350 of the above embodiment.
The SMI issuing unit 502 issues an SMI when the exception detecting unit 501 detects an exception. The SMI issuing unit 502 corresponds to the SMI issuing function 310.
The debug function unit 503 executes the debug function using SMM. The debug function unit 503 corresponds to the debug function 410.
In one embodiment, the debug system 50 is implemented in the non-SMM layer 30 of the BIOS 20 of the above embodiments.

図12は、本発明の各実施形態におけるデバッグシステムを搭載した情報処理装置のハードウェア構成の一例を示す図である。
コンピュータ900は、CPU901、主記憶装置902、補助記憶装置903、入出力インタフェース904、通信インタフェース905を備える。
CPU901は、SMMでの動作が可能なプロセッサである。CPU901は、例えば、インテル社のIntel64およびIA−32アーキテクチャのCPUである。上述のOS10、BIOS20は、プログラムの形式で補助記憶装置903に格納されている。そして、CPU901は、プログラムを補助記憶装置903から読み出して主記憶装置902に展開し、当該プログラムに従って上記処理を実行する。また、CPU901は、プログラムに従って、記憶領域を主記憶装置902に確保する。
FIG. 12 is a diagram showing an example of a hardware configuration of an information processing apparatus equipped with a debug system according to each embodiment of the present invention.
The computer 900 includes a CPU 901, a main storage device 902, an auxiliary storage device 903, an input/output interface 904, and a communication interface 905.
The CPU 901 is a processor capable of operating in SMM. The CPU 901 is, for example, a CPU of Intel Intel 64 and IA-32 architecture. The OS 10 and the BIOS 20 described above are stored in the auxiliary storage device 903 in the form of programs. Then, the CPU 901 reads the program from the auxiliary storage device 903, expands it in the main storage device 902, and executes the above-described processing according to the program. Further, the CPU 901 secures a storage area in the main storage device 902 according to the program.

なお、少なくとも1つの実施形態において、補助記憶装置903は、例えば、マザーボード上のROMであって、BIOS20は、このROMに記憶されている。また、他の1つの実施形態において、補助記憶装置903は、一時的でない有形の媒体の一例である。一時的でない有形の媒体の他の例としては、入出力インタフェース904を介して接続される磁気ディスク、光磁気ディスク、CD−ROM、DVD−ROM、半導体メモリ等が挙げられる。また、このプログラムが通信回線によってコンピュータ900に配信される場合、配信を受けたコンピュータ900が当該プログラムを主記憶装置902に展開し、上記処理を実行しても良い。また、当該プログラムは、前述した機能の一部を実現するためのものであっても良い。さらに、当該プログラムは、前述した機能を補助記憶装置903に既に記憶されている他のプログラムとの組み合わせで実現するもの、いわゆる差分ファイル(差分プログラム)であっても良い。また、補助記憶装置903は、CPU901を備える演算装置とは別体として構成されていてもよい。 Note that in at least one embodiment, the auxiliary storage device 903 is, for example, a ROM on a motherboard, and the BIOS 20 is stored in this ROM. Further, in another embodiment, the auxiliary storage device 903 is an example of a non-transitory tangible medium. Other examples of non-transitory tangible media include magnetic disks, magneto-optical disks, CD-ROMs, DVD-ROMs, semiconductor memories, etc. connected via the input/output interface 904. Further, when this program is distributed to the computer 900 via a communication line, the computer 900 that has received the distribution may expand the program in the main storage device 902 and execute the above processing. Further, the program may be for realizing some of the functions described above. Further, the program may be a so-called difference file (difference program) that realizes the above-mentioned function in combination with another program already stored in the auxiliary storage device 903. Further, the auxiliary storage device 903 may be configured as a separate body from the arithmetic device including the CPU 901.

その他、本発明の趣旨を逸脱しない範囲で、上記した実施の形態における構成要素を周知の構成要素に置き換えることは適宜可能である。また、この発明の技術範囲は上記の実施形態に限られるものではなく、本発明の趣旨を逸脱しない範囲において種々の変更を加えることが可能である。
UEFI Memory Mapは、BIOSに割り当てられたアドレス領域の範囲の一例である。
In addition, it is possible to appropriately replace the components in the above-described embodiments with known components without departing from the spirit of the present invention. Further, the technical scope of the present invention is not limited to the above-described embodiment, and various modifications can be made without departing from the spirit of the present invention.
The UEFI Memory Map is an example of the range of the address area assigned to the BIOS.

1、1A、1B、50・・・デバッグシステム
10・・・OS
110・・・IDT
120・・・OS例外割り込みハンドリング機能
130・・・OS初期化完了通知機能
20・・・BIOS
30・・・非SMMレイヤ
310・・・SMI発行機能
320・・・Debug/Release切り替え機能
330・・・BIOS例外割り込みハンドリング機能
340・・・IDT書き換え機能
350・・・アサーションハンドリング機能
40・・・SMMレイヤ
410・・・デバッグ機能
501・・・例外検出部
502・・・SMI発行部
503・・・デバッグ機能部
900・・・コンピュータ
901・・・CPU
902・・・主記憶装置
903・・・補助記憶装置
904・・・入出力インタフェース
905・・・通信インタフェース
1, 1A, 1B, 50... Debug system 10... OS
110... IDT
120...OS exception interrupt handling function 130...OS initialization completion notification function 20...BIOS
30... Non-SMM layer 310... SMI issuing function 320... Debug/Release switching function 330... BIOS exception interrupt handling function 340... IDT rewriting function 350... Assertion handling function 40... SMM layer 410... Debug function 501... Exception detection unit 502... SMI issuing unit 503... Debug function unit 900... Computer 901... CPU
902... Main storage device 903... Auxiliary storage device 904... Input/output interface 905... Communication interface

Claims (10)

BIOS(Basic Input/Output System)で発生する例外を検出する例外検出部と、
前記例外検出部が例外を検出するとSMI(System Management Interrupt)を発行するSMI発行部と、
SMM(System Management Mode)でデバッグ機能を実行するデバッグ機能部と、
を備えるデバッグシステム。
An exception detection unit that detects exceptions that occur in BIOS (Basic Input/Output System),
An SMI issuing unit that issues an SMI (System Management Interrupt) when the exception detecting unit detects an exception;
A debug function unit that executes a debug function in SMM (System Management Mode),
Debug system with.
前記例外検出部は、オペレーティングシステムが備える例外割り込みを検出する機能に基づいて前記例外の発生を検出し、検出した前記例外の発生場所のアドレスとBIOSに割り当てられたアドレス領域の範囲とに基づいて、BIOSで例外を検出する、
請求項1に記載のデバッグシステム。
The exception detection unit detects the occurrence of the exception based on a function of detecting an exception interrupt included in the operating system, and based on the detected address of the occurrence place of the exception and the range of the address area assigned to the BIOS. , Detect exception in BIOS,
The debug system according to claim 1.
前記例外検出部が、
IDTに所定の例外割り込みベクタに対応付けて登録される割り込みハンドラである、
請求項1または請求項2に記載のデバッグシステム。
The exception detection unit,
An interrupt handler registered in the IDT in association with a predetermined exception interrupt vector,
The debug system according to claim 1 or 2.
前記例外検出部は、BIOSのプログラムに記載されたアサーションの評価式の値に基づいて、BIOSでの例外の発生を検出する、
請求項1から請求項3の何れか1項に記載のデバッグシステム。
The exception detection unit detects the occurrence of an exception in the BIOS based on the value of the assertion evaluation expression described in the BIOS program.
The debug system according to any one of claims 1 to 3.
前記アサーションでは、前記評価式に加え、前記評価式の値がTrueではない場合のデバッガの実行に関する設定を行うことができる、
請求項4に記載のデバッグシステム。
In the assertion, in addition to the evaluation expression, settings relating to execution of a debugger when the value of the evaluation expression is not True can be set.
The debug system according to claim 4.
前記デバッガの実行に関する設定では、システムの通常運用時にデバッガを起動するか否かの設定を行うことができる、
請求項5に記載のデバッグシステム。
In the setting related to the execution of the debugger, it is possible to set whether to start the debugger during normal operation of the system,
The debug system according to claim 5.
前記アサーションでは、さらに前記プログラムに対するリカバリ処理の設定を行うことができる、
請求項5または請求項6に記載のデバッグシステム。
The assertion can further set recovery processing for the program.
The debug system according to claim 5 or 6.
非SMMレイヤに
BIOSで発生する例外を検出する例外検出部と、
前記例外検出部が例外を検出するとSMIを発行するSMI発行部と、
SMMでデバッグ機能を実行するデバッグ機能部と、
を備えるBIOS。
An exception detection unit that detects an exception that occurs in the BIOS in the non-SMM layer,
An SMI issuing unit that issues an SMI when the exception detecting unit detects an exception;
A debug function unit that executes the debug function in SMM,
BIOS with.
SMMでの動作が可能なプロセッサと、
請求項8に記載のBIOSと、
を備える情報処理装置。
A processor capable of operating in SMM,
BIOS according to claim 8,
An information processing apparatus including.
BIOSで発生する例外を検出するステップと、
前記例外を検出するとSMIを発行させるステップと、
前記SMI発行により遷移したSMMでデバッグ機能を実行するステップと、
を有するデバッグ方法。
Detecting an exception that occurs in the BIOS,
Issuing an SMI when the exception is detected,
Executing a debug function in the SMM transitioned by issuing the SMI;
A debugging method having.
JP2018219672A 2018-11-22 2018-11-22 Debug system, BIOS, information processing device and debugging method Active JP6996748B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2018219672A JP6996748B2 (en) 2018-11-22 2018-11-22 Debug system, BIOS, information processing device and debugging method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2018219672A JP6996748B2 (en) 2018-11-22 2018-11-22 Debug system, BIOS, information processing device and debugging method

Publications (2)

Publication Number Publication Date
JP2020086872A true JP2020086872A (en) 2020-06-04
JP6996748B2 JP6996748B2 (en) 2022-01-17

Family

ID=70909984

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2018219672A Active JP6996748B2 (en) 2018-11-22 2018-11-22 Debug system, BIOS, information processing device and debugging method

Country Status (1)

Country Link
JP (1) JP6996748B2 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1529241A (en) * 2003-10-08 2004-09-15 威盛电子股份有限公司 Debugging device and method thereof
US20050229160A1 (en) * 2004-03-18 2005-10-13 Rothman Michael A Method and system to provide debugging of a computer system from firmware
CN102455956A (en) * 2010-10-21 2012-05-16 英业达股份有限公司 Method for displaying picture in interrupt management mode
CN103257922A (en) * 2013-04-16 2013-08-21 合肥联宝信息技术有限公司 Method for quickly testing reliability of BIOS (basic input output system) and OS (operating system) interface codes
US9298524B2 (en) * 2013-03-22 2016-03-29 Insyde Software Corp. Virtual baseboard management controller
US10127137B2 (en) * 2015-06-03 2018-11-13 Fengwei Zhang Methods and systems for increased debugging transparency

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1529241A (en) * 2003-10-08 2004-09-15 威盛电子股份有限公司 Debugging device and method thereof
US20050229160A1 (en) * 2004-03-18 2005-10-13 Rothman Michael A Method and system to provide debugging of a computer system from firmware
CN102455956A (en) * 2010-10-21 2012-05-16 英业达股份有限公司 Method for displaying picture in interrupt management mode
US9298524B2 (en) * 2013-03-22 2016-03-29 Insyde Software Corp. Virtual baseboard management controller
CN103257922A (en) * 2013-04-16 2013-08-21 合肥联宝信息技术有限公司 Method for quickly testing reliability of BIOS (basic input output system) and OS (operating system) interface codes
US10127137B2 (en) * 2015-06-03 2018-11-13 Fengwei Zhang Methods and systems for increased debugging transparency

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHANG, F. ET AL.: "Using Hardware Features for Increased Debugging Transparency", PROCEEDINGS OF 2015 IEEE SYMPOSIUM ON SECURITY AND PRIVACY, JPN6021035726, 17 May 2015 (2015-05-17), pages 55 - 69, XP033177709, ISSN: 0004592930, DOI: 10.1109/SP.2015.11 *

Also Published As

Publication number Publication date
JP6996748B2 (en) 2022-01-17

Similar Documents

Publication Publication Date Title
JP5905904B2 (en) Controlling debug exception generation
US10139876B2 (en) Efficient reboot of an operating system executed in a virtual machine
US10318737B2 (en) Secure booting of virtualization managers
JP6124994B2 (en) Method and system for restoring from legacy OS environment to Unified Extensible Firmware Interface (UEFI) pre-boot environment, and computer program
US11169819B2 (en) Information handling system (IHS) and method to proactively restore firmware components to a computer readable storage device of an IHS
US10127068B2 (en) Performance variability reduction using an opportunistic hypervisor
US7356735B2 (en) Providing support for single stepping a virtual machine in a virtual machine environment
US20050216895A1 (en) Method and apparatus for remote debugging of kernel and application software
US20050246453A1 (en) Providing direct access to hardware from a virtual environment
US10909247B2 (en) Computing device having two trusted platform modules
US8595552B2 (en) Reset method and monitoring apparatus
Fattori et al. Dynamic and transparent analysis of commodity production systems
US20070011507A1 (en) System and method for remote system support
CN103430158B (en) Use Execution Single Step to Diagnose Coding
US7363544B2 (en) Program debug method and apparatus
KR20150102090A (en) Mechanism to support reliability, availability, and serviceability (ras) flows in a peer monitor
US20100153786A1 (en) Processor, multiprocessor, and debugging method
JP5609242B2 (en) Information processing apparatus and memory dump collection method
TWI470434B (en) Method executing in computer system, computer system, and processor
US8639919B2 (en) Tracer configuration and enablement by reset microcode
US10586048B2 (en) Efficient reboot of an operating system
CN116225765A (en) Method for executing instruction in virtual machine and virtual machine monitor
US20060075274A1 (en) Method and apparatus for enabling run-time recovery of a failed platform
US20160292108A1 (en) Information processing device, control program for information processing device, and control method for information processing device
US11550664B2 (en) Early boot event logging system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20200306

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210608

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210713

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210914

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20211101

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: 20211116

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20211209

R150 Certificate of patent or registration of utility model

Ref document number: 6996748

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150