JP2936603B2 - Memory management device - Google Patents

Memory management device

Info

Publication number
JP2936603B2
JP2936603B2 JP1288411A JP28841189A JP2936603B2 JP 2936603 B2 JP2936603 B2 JP 2936603B2 JP 1288411 A JP1288411 A JP 1288411A JP 28841189 A JP28841189 A JP 28841189A JP 2936603 B2 JP2936603 B2 JP 2936603B2
Authority
JP
Japan
Prior art keywords
mode
memory protection
protection exception
cpu
address
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.)
Expired - Lifetime
Application number
JP1288411A
Other languages
Japanese (ja)
Other versions
JPH03148735A (en
Inventor
滋 川又
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 Corp
Original Assignee
Nippon Electric Co 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP1288411A priority Critical patent/JP2936603B2/en
Publication of JPH03148735A publication Critical patent/JPH03148735A/en
Application granted granted Critical
Publication of JP2936603B2 publication Critical patent/JP2936603B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Storage Device Security (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はメモリ管理装置に関し、特に中央処理ユニッ
ト(以下、CPUと略記する)の非特権モードで走行する
アプリケーションプログラム(以下、APと略記する)が
参照を許可されていない仮想空間を参照したときに不正
な参照(以下、メモリ保護例外という)が起こったこと
を検出してあらかじめ設定されているアドレスにCPUの
制御を移して特定の処理(以下、メモリ保護例外処理と
いう)を行わせるメモリ管理装置に関する。
The present invention relates to a memory management device, and more particularly to an application program (hereinafter abbreviated as AP) which runs in a non-privileged mode of a central processing unit (hereinafter abbreviated as CPU). ) Detects an illegal reference (hereinafter referred to as a memory protection exception) when referring to a virtual space for which reference is not permitted, and transfers CPU control to a preset address to perform specific processing. (Hereinafter referred to as memory protection exception processing).

〔従来の技術〕[Conventional technology]

従来、この種のメモリ管理装置は、CPUの非特権モー
ドで走行するAPによるメモリ保護例外が検出されたとき
にCPUにメモリ保護例外の発生を通知しており、CPUは、
この通知を受けて走行モードを非特権から特権モードに
切り換えた後に、あらかじめ設定されているアドレスに
制御を移してメモリ保護例外処理を実行していた。
Conventionally, this type of memory management device notifies the CPU of the occurrence of a memory protection exception when a memory protection exception is detected by an AP running in a non-privileged mode of the CPU.
In response to this notification, after switching the running mode from the non-privileged mode to the privileged mode, the control is shifted to a preset address to execute the memory protection exception processing.

このように、メモリ保護例外の発生時にCPUの走行モ
ードを非特権コードから特権モードに切り換えるのは、
メモリ保護例外が発生するのは、通常、APが本来参照し
てはいけないアドレスを参照した場合であるので、これ
を検出および処理するのはオペレーティングシステム
(以下、OSと略記する)の役割だからである。
As described above, switching the CPU run mode from non-privileged code to privileged mode when a memory protection exception occurs is as follows.
Since a memory protection exception usually occurs when an AP refers to an address that should not be referenced, it is the responsibility of the operating system (hereinafter abbreviated as OS) to detect and process this. is there.

ところで、OSでは、一般に、複数のAPが自分の仮想空
間に同一の物理空間を割り付けてその物理空間を共有す
る手段を提供している。このようなOSにおいて、あるAP
1およびAP2が物理空間を共有している場合に、AP1が同
一の物理空間を割り付けられている仮想空間に、例えば
書込みを行ったことをAP2が検出できる仕組みを実現し
ようとすると、AP1の同一の物理空間を割り付けられて
いる仮想空間に対する書込みの参照権をあらかじめなく
しておき、メモリ保護例外が発生したときに書込みが起
こったことをOSからAP2に通知するという手続きが必要
であった。
By the way, in the OS, generally, a plurality of APs provide means for allocating the same physical space to their own virtual space and sharing the physical space. In such an OS, an AP
If 1 and AP2 share a physical space, AP1 tries to realize a mechanism that can detect that AP1 has written, for example, to a virtual space to which the same physical space has been allocated. In this case, it is necessary to remove the right to refer to the virtual space to which the physical space is allocated in advance and to notify the AP 2 of the occurrence of the write to the AP 2 when a memory protection exception occurs.

詳しくは、従来のメモリ管理装置を使った場合、AP1
の同一の物理空間を割り付けられている仮想空間および
AP2の同一の物理空間を割り付けられている仮想空間の
ページテーブル中にある書込み可能かどうかを示すペー
ジ参照権フラグを落として(オフとして)おき、AP1お
よびAP2のどちらかが同一の物理空間を割り付けられて
いる仮想空間の書込みを行った際に発生したメモリ保護
例外をメモリ保護例外処理の中でもう一方のAPに知らせ
るようにしていた。
Specifically, when using a conventional memory management device, AP1
Virtual space and the same physical space
Turn off (turn off) the page reference right flag in the page table of the virtual space to which the same physical space of AP2 is allocated in the virtual space page table, and either AP1 or AP2 uses the same physical space. A memory protection exception that occurred when writing to the allocated virtual space was notified to the other AP in the memory protection exception processing.

しかし、ページ参照権フラグをあえて落としてある仮
想空間への書込みは本来は正当な書込み(不正な領域へ
の書込みではない)であり、書込みの頻度も高い。した
がって、このような処理をするためだけにメモリ保護例
外の発生時にCPUの走行モードを非特権モードから特権
モードへと切り換えていたのでは、AP1が同一の物理空
間に割り付けられた仮想空間を参照するたびにCPUの走
行モードを切り換えるという操作が必要となるばかりで
なく、メモリ保護例外処理の終了時に再びCPUの走行モ
ードを特権モードから非特権モードに切り換えなければ
ならないので、OSのオーバヘッドが高くなってしまう。
However, writing to a virtual space in which the page reference right flag is intentionally dropped is originally a valid writing (not a writing to an illegal area), and the writing frequency is high. Therefore, if the CPU running mode was switched from non-privileged mode to privileged mode when a memory protection exception occurred just for such processing, AP1 refers to the virtual space allocated to the same physical space. In addition to the operation of switching the CPU running mode every time the CPU is running, the operating mode of the CPU must be switched from the privileged mode to the non-privileged mode again at the end of the memory protection exception handling, resulting in high OS overhead. turn into.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

上述した従来のメモリ管理装置では、メモリ保護例外
が発生するたびにCPUの走行モードを非特権モードから
特権モードに切り換えていたので、CPUの走行モードの
非特権モードから特権モードへの切換えによるOSのオー
バヘッドが大きくなるとともに、CPUの走行モードを特
権モードから非特権モードに戻すための切換えも必要に
なり、そのためのOSのオーバヘッドも大きくなるという
欠点がある。
In the conventional memory management device described above, the CPU running mode is switched from the non-privileged mode to the privileged mode every time a memory protection exception occurs. However, there is a drawback in that the overhead of the CPU becomes large, and it is necessary to switch the running mode of the CPU from the privileged mode to the non-privileged mode, thereby increasing the overhead of the OS.

本発明の目的は、上述の点に鑑み、仮想空間の特定の
領域ごとにモード不変更フラグを設けてメモリ保護例外
の発生時にモード不変更フラグがモード不変更を示して
いるかどうかを判定し、モード不変更を示している場合
にはCPUの走行モードが非特権モードのままメモリ保護
例外処理を行うようにしたメモリ管理装置を提供するこ
とにある。
In view of the above, an object of the present invention is to provide a mode non-change flag for each specific area of the virtual space and determine whether the mode non-change flag indicates a mode non-change when a memory protection exception occurs, An object of the present invention is to provide a memory management device in which when the mode is not changed, the memory protection exception process is performed while the CPU running mode is in the non-privileged mode.

〔課題を解決するための手段〕[Means for solving the problem]

本発明のメモリ管理装置は、記憶装置の物理アドレス
をCPUが認識するアドレス空間である仮想空間に割り付
けるアドレス変換機構を有し、CPUの非特権モードで走
行するアプリケーションプログラムが参照を許可されて
いない仮想空間を参照したときにメモリ保護例外が発生
したことをメモリ保護例外検出手段が検出してあらかじ
め設定されているアドレスにCPUの制御を移してメモリ
保護例外処理を行わせるメモリ管理装置において、仮想
空間の特定の領域ごとにCPUの特権モードおよび非特権
モードのいずれでメモリ保護例外処理を実行するかを示
すモード不変更フラグと、前記メモリ保護例外検出手段
によりメモリ保護例外が検出されたときに前記モード不
変更フラグを参照して非特権モードでのメモリ保護例外
処理が指示されていればCPUの非特権モードから特権モ
ードへの切換えを制御させるモード不変更フラグ判定手
段とを有する。
The memory management device of the present invention has an address translation mechanism that allocates a physical address of a storage device to a virtual space that is an address space recognized by a CPU, and an application program running in a non-privileged mode of the CPU is not permitted to refer to the application program. In a memory management device that detects the occurrence of a memory protection exception when referring to a virtual space, the memory protection exception detection means detects the occurrence of the memory protection exception, and transfers control of the CPU to a preset address to perform memory protection exception processing. A mode non-change flag indicating whether the memory protection exception processing is executed in the privileged mode or the non-privileged mode of the CPU for each specific area of the space, and when a memory protection exception is detected by the memory protection exception detecting means. If memory protection exception processing in the non-privileged mode is instructed with reference to the mode unchange flag, the CPU Having a privileged mode and a mode not change flag determination means for controlling the switching to a privileged mode.

〔作用〕[Action]

本発明のメモリ管理装置では、モード不変更フラグが
仮想空間の特定の領域ごとにCPUの特権モードおよび非
特権モードのいずれでメモリ保護例外処理を実行するか
を示し、モード不変更フラグ判定手段がメモリ保護例外
検出手段によりメモリ保護例外が検出されたときにモー
ド不変更フラグを参照して非特権モードでのメモリ保護
例外処理が指示されていればCPUの非特権モードから特
権モードへの切換えを制御させる。
In the memory management device of the present invention, the mode non-change flag indicates whether to execute the memory protection exception processing in the privileged mode or the non-privileged mode of the CPU for each specific area of the virtual space, If memory protection exception detection means detects a memory protection exception and refers to the mode non-change flag, if memory protection exception handling in non-privileged mode is instructed, the CPU switches from non-privileged mode to privileged mode. Control.

〔実施例〕〔Example〕

次に、本発明について図面を参照して詳細に説明す
る。
Next, the present invention will be described in detail with reference to the drawings.

第1図は、本発明の一実施例に係るメモリ管理装置の
構成を示すブロック図である。本実施例のメモリ管理装
置1は、アドレス変換機構2と、メモリ保護例外検出手
段3と、モード不変更フラグ判定手段4とを含んで構成
されている。
FIG. 1 is a block diagram showing a configuration of a memory management device according to one embodiment of the present invention. The memory management device 1 according to the present embodiment includes an address translation mechanism 2, a memory protection exception detection unit 3, and a mode unchange flag determination unit 4.

アドレス変換機構2は、CPU5から出力される仮想アド
レス6を物理アドレス7に変換する。
The address translation mechanism 2 translates the virtual address 6 output from the CPU 5 into a physical address 7.

メモリ保護例外検出手段3は、アドレス変換機構2に
おけるメモリ保護例外の発生を監視し、メモリ保護例外
が検出されたときにメモリ保護例外通知信号8をCPU5に
通知する。
The memory protection exception detecting means 3 monitors occurrence of a memory protection exception in the address translation mechanism 2, and notifies the CPU 5 of a memory protection exception notification signal 8 when a memory protection exception is detected.

モード不変更フラグ判定手段4は、メモリ保護例外検
出手段3によるメモリ保護例外の検出時にアドレス変換
機構2におけるモード不変更フラグ11a(第2図参照)
を参照して、モード不変更フラグ11aがオンのとき(非
特権モードでのメモリ保護例外処理が指示されていると
き)には、CPU5にモード不変更通知信号9を通知する。
The mode non-change flag determining means 4 is a mode non-change flag 11a in the address conversion mechanism 2 when the memory protection exception detecting means 3 detects a memory protection exception (see FIG. 2).
When the mode non-change flag 11a is ON (when the memory protection exception processing in the non-privileged mode is instructed), the CPU 5 is notified of the mode non-change notification signal 9.

CPU5は、メモリ保護例外通知信号8を受けたが、モー
ド不変更通知信号9を受けなかったときには、走行モー
ドを非特権モードから特権モードに切り換え、あらかじ
め設定されたアドレスに制御を移してメモリ保護例外処
理を特権モードで実行する。また、CPU5は、モード不変
更通知信号9を受けたときには、メモリ保護例外通知信
号8を受けたにもかかわらず、走行モードの非特権モー
ドから特権モードへの切換えを制御し、あらかじめ設定
されたアドレスに制御を移してメモリ保護例外処理を非
特権モードで実行する。
When the CPU 5 receives the memory protection exception notification signal 8 but does not receive the mode non-change notification signal 9, the CPU 5 switches the running mode from the non-privileged mode to the privileged mode, and transfers control to a preset address to protect the memory. Execute exception handling in privileged mode. Also, when receiving the mode non-change notification signal 9, the CPU 5 controls the switching of the driving mode from the non-privileged mode to the privileged mode despite receiving the memory protection exception notification signal 8, and is set in advance. Control is transferred to the address to execute the memory protection exception processing in the non-privileged mode.

第2図は、アドレス変換機構2によるアドレス変換の
概要を説明するための図である。アドレス変換機構2で
は、仮想アドレス6を物理アドレス7に変換するために
エリアテーブル10およびページテーブル20を使用してお
り、仮想アドレス6を分解した値を用いてエリアテーブ
ル10とページテーブル20とを参照している。すなわち、
アドレス変換機構2は、仮想アドレス6を、エリアテー
ブルエントリ決定フィールド6a,ページテーブルエント
リー決定フィールド6bおよびページ内オフセット決定フ
ィールド6cのように分解して認識する。
FIG. 2 is a diagram for explaining an outline of address translation by the address translation mechanism 2. The address translation mechanism 2 uses the area table 10 and the page table 20 to translate the virtual address 6 into the physical address 7, and uses the decomposed value of the virtual address 6 to convert the area table 10 and the page table 20. Is referring. That is,
The address translation mechanism 2 recognizes the virtual address 6 by decomposing it into an area table entry determination field 6a, a page table entry determination field 6b, and an intra-page offset determination field 6c.

エリアテーブル10は、複数のエリアテーブルエントリ
11から構成されており、仮想アドレス6のエリアテーブ
ルエントリ決定フィールド6aの値によって1つのエリア
テーブルエントリ11が指示される。
The area table 10 has a plurality of area table entries.
The area table entry 11 is designated by the value of the area table entry determination field 6a of the virtual address 6.

エリアテーブルエントリ11には、メモリ保護例外が発
生したときにメモリ保護例外処理をCPU5の特権モードで
行うか非特権モードで行うかを示すモード不変更フラグ
11aが設けられている。
Area table entry 11 has a mode unchangeable flag indicating whether memory protection exception processing is performed in the privileged mode or non-privileged mode of CPU 5 when a memory protection exception occurs.
11a is provided.

ページテーブル20は、複数のページテーブルエントリ
21から構成されており、仮想アドレス6のページテーブ
ルエントリ決定フィールド6bの値によって1つのページ
テーブルエントリ21が指示される。
The page table 20 contains multiple page table entries
21. One page table entry 21 is specified by the value of the page table entry determination field 6b of the virtual address 6.

ページテーブルエントリ21には、物理空間40上の物理
ページ41への参照が可能がどうかを示すページ参照権フ
ラグ21aが設けられている。第2図の例では、ページ参
照権フラグ21aとして読出し、書込みおよび実行の3つ
のフラグが設けられている。
The page table entry 21 is provided with a page reference right flag 21a indicating whether reference to the physical page 41 in the physical space 40 is possible. In the example of FIG. 2, three flags of reading, writing, and execution are provided as page reference right flags 21a.

次に、このように構成された本実施例のメモリ管理装
置の動作について説明する。
Next, the operation of the memory management device of the present embodiment thus configured will be described.

あるAPが仮想空間の参照を許可されれいる(ページ参
照権フラグ12がオンしている)ページの仮想アドレス6
を参照した場合には、CPU5から出力された仮想アドレス
6は、メモリ管理装置1のアドレス変換機構2により物
理アドレス7にアドレス変換される。
Virtual address 6 of a page to which a certain AP is permitted to refer to the virtual space (the page reference right flag 12 is on)
Is referred, the virtual address 6 output from the CPU 5 is translated into a physical address 7 by the address translation mechanism 2 of the memory management device 1.

詳しくは、アドレス変換機構2は、まず仮想アドレス
6のエリアテーブルエントリ決定フィールド6aを使用し
て、エリアテーブル10中の1つのエリアテーブルエント
リ11を選ぶ。次に、アドレス変換機構2は、選んだエリ
アテーブルエントリ11中のページテーブル20のアドレス
と仮想アドレス6のページテーブルエントリ決定フィー
ルド6bとを使用して、ページテーブル20中の1つのペー
ジテーブルエントリ21を選ぶ。最後に、アドレス変換機
構2は、選んだページテーブルエントリ21中の物理アド
レス内の物理ページ41の番号と仮想アドレス6のページ
内オフセット決定フィールド6cとを使用して、物理空間
40の物理ページ41中の物理アドレス7を決定する。
More specifically, the address translation mechanism 2 first selects one area table entry 11 in the area table 10 using the area table entry determination field 6a of the virtual address 6. Next, the address translation mechanism 2 uses the address of the page table 20 in the selected area table entry 11 and the page table entry determination field 6b of the virtual address 6 to make one page table entry 21 in the page table 20. Choose Finally, the address translation mechanism 2 uses the number of the physical page 41 in the physical address in the selected page table entry 21 and the in-page offset determination field 6c of the virtual address 6 to determine the physical space.
The physical address 7 in the 40 physical pages 41 is determined.

アドレス変換機構2によりCPU5から出力された仮想ア
ドレス6がアドレス変換されている最中に、メモリ保護
例外検出手段3は、ページテーブルエントリ21のページ
参照権フラグ21aを参照して正当な仮想アドレス6かど
うかをチェックする。正当な仮想アドレス6の場合に
は、アドレス変換機構2は、物理アドレス7を出力す
る。この結果、記憶装置の物理メモリの参照が行われ
る。
While the virtual address 6 output from the CPU 5 is being translated by the address translation mechanism 2, the memory protection exception detecting means 3 refers to the page reference right flag 21 a of the page table entry 21 to check the valid virtual address 6. Check whether or not. In the case of a valid virtual address 6, the address translation mechanism 2 outputs a physical address 7. As a result, the physical memory of the storage device is referred to.

一方、あるAPが仮想空間の参照を許可されていない
(ページ参照権フラグ21aがオンでない)ページの仮想
アドレス6を参照した場合には、アドレス変換機構2に
よりCPU5から出力された仮想アドレス6をアドレス変換
している最中に、メモリ保護例外検出手段3は、ページ
テーブルエントリ21のページ参照権フラグ21aを参照し
て正当な仮想アドレス6かどうかチェックして、参照が
許可されていない不正な仮想アドレス6であるので、メ
モリ保護例外の発生を検出して、CPU5にメモリ保護例外
通知信号8を出力する。
On the other hand, when a certain AP refers to a virtual address 6 of a page for which reference to the virtual space is not permitted (the page reference right flag 21a is not on), the virtual address 6 output from the CPU 5 by the address translation mechanism 2 is used. During the address conversion, the memory protection exception detecting means 3 refers to the page reference right flag 21a of the page table entry 21 to check whether the virtual address 6 is a valid virtual address 6. Since the address is the virtual address 6, the occurrence of the memory protection exception is detected, and the memory protection exception notification signal 8 is output to the CPU 5.

また、メモリ保護例外手段3によりメモリ保護例外の
発生が検出された場合には、モード不変更フラグ判定手
段4は、エリアテーブルエントリ11のモード不変更フラ
グ11aを参照してCPU5の走行モードを非特権モードから
特権モードに切り換えるかどうかを決定し、CPU5の走行
モードを切換えが指示されているときにはCPU5にモード
不変更通知信号9を出力しない。このため、CPU5は、メ
モリ保護例外通知信号8を受けて走行モードを非特権モ
ードから特権モードに切り換えた後に、あらかじめ設定
されているアドレスに制御を移して特権モードでメモリ
保護例外処理を実行する。
When the occurrence of a memory protection exception is detected by the memory protection exception unit 3, the mode unchange flag determination unit 4 refers to the mode unchange flag 11a of the area table entry 11 to disable the running mode of the CPU 5. It is determined whether to switch from the privileged mode to the privileged mode, and when the switching of the running mode of the CPU 5 is instructed, the mode change notification signal 9 is not output to the CPU 5. For this reason, after receiving the memory protection exception notification signal 8, the CPU 5 switches the running mode from the non-privileged mode to the privileged mode, shifts control to a preset address, and executes the memory protection exception processing in the privileged mode. .

他方、エリアテーブルエントリ11のモード不変更フラ
グ11aを参照してCPU5の走行モードの切換えが指示され
ていないときには、モード不変更フラグ判定手段4は、
CPU5にモード不変更通知信号9を出力する。このため、
CPU5は、メモリ保護例外通知信号8を受けたにもかかわ
らず、走行モードを変更せずにあらかじめ設定されてい
るアドレスに制御を移して非特権モードでメモリ保護例
外処理を実行する。
On the other hand, when the switching of the driving mode of the CPU 5 is not instructed with reference to the mode non-change flag 11a of the area table entry 11, the mode non-change flag determination means 4
The mode change notification signal 9 is output to the CPU 5. For this reason,
Despite receiving the memory protection exception notification signal 8, the CPU 5 shifts the control to a preset address without changing the running mode and executes the memory protection exception processing in the non-privileged mode.

このように、非特権モードで走行しているAPがメモリ
保護例外を起こしたときには、モード不変更フラグ11a
のオン/オフに応じて、選択的に非特権モードでメモリ
保護例外処理を実行することができる。
As described above, when the AP running in the non-privileged mode causes a memory protection exception, the mode unchanged flag 11a
, The memory protection exception processing can be selectively executed in the non-privileged mode.

第3図を参照すると、AP1およびAP2は、同一の物理空
間32をそれぞれの仮想空間34および35に割り付けてい
る。ここで、例えばAP1とAP2とがお互いに相手が仮想空
間34または仮想空間35に書込みを行ったことを検出する
仕組みをOSが提供しようとしたとする。
Referring to FIG. 3, AP1 and AP2 allocate the same physical space 32 to their respective virtual spaces 34 and 35. Here, for example, it is assumed that the OS attempts to provide a mechanism in which AP1 and AP2 mutually detect that the other party has written in the virtual space 34 or the virtual space 35.

本実施例のメモリ管理装置1を使用した場合には、AP
1の仮想空間31およびAP2の仮想空間33の通信領域36およ
び38に同一の物理空間37をそれぞれ割り付けておき、対
応するページテーブルエントリ21のページ参照権フラグ
21aをオフしておき、対応するエリアテーブルエントリ1
1のモード不変更フラグ11aをオンとしておく。そして、
例えばAP1が仮想空間34に書込みを行った場合には、メ
モリ保護例外が検出されるものの、CPU5の走行モードの
切換えは行われず、メモリ保護例外処理が非特権モード
で行われるので、そのメモリ保護例外処理の中で通信領
域36にメモリ保護例外が発生したことを書いておく。す
ると、AP2は、自分が動作を始めたときに通信領域38を
見ることにより、AP1が仮想空間34に書込みを行ったこ
とを知ることができる。このように、AP1の仮想空間34
への書込み時にCPU5の走行モードの切換えが起らないた
めに、OSのオーバヘッドを最小限に抑えることができ
る。
When the memory management device 1 of the present embodiment is used, the AP
The same physical space 37 is allocated to each of the communication areas 36 and 38 of the virtual space 31 of 1 and the virtual space 33 of AP2, and the page reference right flag of the corresponding page table entry 21
Turn off 21a and set the corresponding area table entry 1
The mode non-change flag 11a of 1 is turned on. And
For example, when AP1 writes to the virtual space 34, although a memory protection exception is detected, the running mode of the CPU 5 is not switched, and the memory protection exception processing is performed in the non-privileged mode. It is noted that a memory protection exception has occurred in the communication area 36 during the exception processing. Then, AP2 can know that AP1 has written to the virtual space 34 by looking at the communication area 38 when it starts operating. Thus, the virtual space 34 of AP1
Since the switching of the running mode of the CPU 5 does not occur at the time of writing to the OS, the overhead of the OS can be minimized.

なお、上記実施例では、モード不変更フラグ11aを仮
想空間のエリア単位となるようにエリアテーブルエント
リ11に設けた場合について説明したが、モード不変更フ
ラグは仮想空間のページ単位となるようにページテーブ
ルエントリ21中に設けるようにしても本発明が同様に適
用できることはいうまでもない。
In the above embodiment, the case where the mode non-change flag 11a is provided in the area table entry 11 so as to be in units of the area of the virtual space has been described. It goes without saying that the present invention can be similarly applied even if it is provided in the table entry 21.

〔発明の効果〕〔The invention's effect〕

以上説明したようにっ本発明は、仮想空間の特定の領
域ごとにモード不変更フラグを設けてメモリ保護例外の
発生時にモード不変更フラグ判定手段によりモード不変
更であるかどうか判定し、モード不変更の場合にはCPU
の走行モード非特権モードのままメモリ保護例外処理を
行うようにしたことにより、CPUの走行モードの非特権
モードから特権モードへの変更に伴うOSのオーバヘッド
を削減することができるとともに、メモリ保護例外処理
の終了時にCPUの走行モードを特権モードから非特権モ
ードに戻すためのOSのオーバヘッドも削減することがで
きるという効果がある。
As described above, according to the present invention, the mode non-change flag is provided for each specific area of the virtual space, and when a memory protection exception occurs, the mode non-change flag determination means determines whether or not the mode is not changed. CPU in case of change
The memory protection exception handling is performed in the non-privileged mode of the running mode, so that the overhead of the OS caused by changing the CPU running mode from the non-privileged mode to the privileged mode can be reduced, and the memory protection exception can be reduced. There is an effect that the overhead of the OS for returning the running mode of the CPU from the privileged mode to the non-privileged mode at the end of the processing can be reduced.

【図面の簡単な説明】[Brief description of the drawings]

第1図は本発明の一実施例に係るメモリ管理装置の構成
を示すブロック図、 第2図は第1図中のアドレス変換機構によるアドレス変
換を説明するための図、 第3図は異なったAPが同一の物理空間を共有している一
例を示す図である。 図において、 1……メモリ管理装置、 2……アドレス変換機構、 3……メモリ保護例外検出手段、 4……モード不変更フラグ判定手段、 5……CPU、 6……仮想アドレス、 6a……エリアテーブルエントリ決定フィールド、 6b……ページテーブルエントリ決定フィールド、 6c……ページ内オフセット決定フィールド、 7……物理アドレス、 8……メモリ保護例外通知信号、 9……モード不変更通知信号、 10……エリアテーブル、 11……エリアテーブルエントリ、 11a……モード不変更フラグ、 20……ページテーブル、 21……ページテーブルエントリ、 21a……ページ参照権フラグ、 40……物理空間、 41……物理ページである。
FIG. 1 is a block diagram showing a configuration of a memory management device according to an embodiment of the present invention, FIG. 2 is a diagram for explaining address translation by an address translation mechanism in FIG. 1, and FIG. FIG. 3 is a diagram illustrating an example in which APs share the same physical space. In the figure, 1... Memory management device, 2... Address conversion mechanism, 3... Memory protection exception detecting means, 4... Mode unchange flag judging means, 5... CPU, 6... Virtual address, 6 a. Area table entry decision field 6b Page table entry decision field 6c Offset decision field within page 7 Physical address 8 Memory protection exception notification signal 9 Mode change notification signal 10 ... area table, 11 ... area table entry, 11a ... mode unchangeable flag, 20 ... page table, 21 ... page table entry, 21a ... page reference right flag, 40 ... physical space, 41 ... physical Page.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】記憶装置の物理アドレスをCPUが認識する
アドレス空間である仮想空間に割り付けるアドレス変換
機構を有し、CPUの非特権モードで走行するアプリケー
ションプログラムが参照を許可されていない仮想空間を
参照したときにメモリ保護例外検出手段がメモリ保護例
外が発生したことを検出してあらかじめ設定されている
アドレスにCPUの制御を移してメモリ保護例外処理を行
わせるメモリ管理装置において、 仮想空間の特定の領域ごとにCPUの特権モードおよび非
特権モードのいずれでメモリ保護例外処理を実行するか
を示すモード不変更フラグと、 前記メモリ保護例外検出手段によりメモリ保護例外が検
出されたときに前記モード不変更フラグを参照して非特
権モードでのメモリ保護例外処理が指示されていればCP
Uの非特権モードから特権モードへの切換えを制御させ
るモード不変更フラグ判定手段と を有することを特徴とするメモリ管理装置。
An address translation mechanism for allocating a physical address of a storage device to a virtual space which is an address space recognized by a CPU, wherein a virtual space to which an application program running in a non-privileged mode of the CPU is not permitted to refer is assigned. The memory management device that detects the occurrence of a memory protection exception when it is referred to and transfers the control of the CPU to a preset address to perform the memory protection exception processing. A mode non-change flag indicating whether the memory protection exception processing is executed in the privileged mode or the non-privileged mode of the CPU for each area, and when the memory protection exception is detected by the memory protection exception detection means, the mode is disabled. If memory protection exception handling in non-privileged mode is instructed by referring to the change flag, CP
And a mode non-change flag judging means for controlling switching of the U from the non-privileged mode to the privileged mode.
JP1288411A 1989-11-06 1989-11-06 Memory management device Expired - Lifetime JP2936603B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP1288411A JP2936603B2 (en) 1989-11-06 1989-11-06 Memory management device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP1288411A JP2936603B2 (en) 1989-11-06 1989-11-06 Memory management device

Publications (2)

Publication Number Publication Date
JPH03148735A JPH03148735A (en) 1991-06-25
JP2936603B2 true JP2936603B2 (en) 1999-08-23

Family

ID=17729863

Family Applications (1)

Application Number Title Priority Date Filing Date
JP1288411A Expired - Lifetime JP2936603B2 (en) 1989-11-06 1989-11-06 Memory management device

Country Status (1)

Country Link
JP (1) JP2936603B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7076637B2 (en) * 2003-10-29 2006-07-11 Qualcomm Inc. System for providing transitions between operating modes of a device
JP5414057B2 (en) * 2009-05-22 2014-02-12 ルネサスエレクトロニクス株式会社 Microcomputer

Also Published As

Publication number Publication date
JPH03148735A (en) 1991-06-25

Similar Documents

Publication Publication Date Title
US5459869A (en) Method for providing protected mode services for device drivers and other resident software
US5987604A (en) Method and apparatus for providing execution of system management mode services in virtual mode
US4459661A (en) Channel address control system for a virtual machine system
US7809896B2 (en) Efficient sharing of memory between applications running under different operating systems on a shared hardware system
US4347565A (en) Address control system for software simulation
EP0557908A2 (en) Method and system for avoiding selector loads
EP0423453A2 (en) Address translation and copying process
CN114077379B (en) Computer equipment, exception handling method and interrupt handling method
JPS6248258B2 (en)
JP2936603B2 (en) Memory management device
JPH05257808A (en) Microprocessor and its operation converting method
EP0171475A1 (en) Data processing system with logical processor facility
US6263412B1 (en) Method and apparatus for RAM emulation using a processor register set
EP1901171A1 (en) Apparatus and method for handling interrupt disabled section and page pinning apparatus and method
JP3018336B2 (en) Information processing device
JP2585905B2 (en) Multitask execution device
US5924110A (en) Multischeme memory management system for computer
JP2002189633A (en) Method and device for protecting memory in virtual space
KR100259456B1 (en) A system and method for selecting an interrupt system for a high performance multiprocessor system
JPS6336012B2 (en)
JPH0271328A (en) Control system for branching history table
IE970262A1 (en) A computer and a method for preventing access to a hard�disc in a computer on booting-up from a floppy disc
JP2000347940A (en) Memory managing device
JPS62251941A (en) Data processor
JPH06202901A (en) Rom emulation system debugger and rom emulation method