JPS6221140B2 - - Google Patents

Info

Publication number
JPS6221140B2
JPS6221140B2 JP54024105A JP2410579A JPS6221140B2 JP S6221140 B2 JPS6221140 B2 JP S6221140B2 JP 54024105 A JP54024105 A JP 54024105A JP 2410579 A JP2410579 A JP 2410579A JP S6221140 B2 JPS6221140 B2 JP S6221140B2
Authority
JP
Japan
Prior art keywords
memory
key
real
virtual
protection
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
Application number
JP54024105A
Other languages
Japanese (ja)
Other versions
JPS55116149A (en
Inventor
Shigeo Sawada
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2410579A priority Critical patent/JPS55116149A/en
Publication of JPS55116149A publication Critical patent/JPS55116149A/en
Publication of JPS6221140B2 publication Critical patent/JPS6221140B2/ja
Granted legal-status Critical Current

Links

Landscapes

  • Storage Device Security (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Description

【発明の詳細な説明】 本発明は、メモリ機密保護方式に関し、特にエ
ミユレーシヨン・プログラム実行時におけるメモ
リの機密保護方式に関するものである。
DETAILED DESCRIPTION OF THE INVENTION The present invention relates to a memory security system, and more particularly to a memory security system during execution of an emulation program.

ハードウエアあるいはソフトウエアの誤りによ
り、主記憶装置に対して不正な書込み、あるいは
読出しが行われたとき、記憶保護装置はこれを検
出して主記憶装置の内容が破壊されることを防止
するとともに、プログラムの暴走等を防止する。
When unauthorized writing or reading is performed on the main memory due to a hardware or software error, the memory protection device detects this and prevents the contents of the main memory from being destroyed. , to prevent programs from running out of control.

演算処理装置(以下CPU)の動作および状態
を規定するためにPSW(プログラム状態語)が
設けられ、主記憶装置の特定位置に格納される。
命令を実行する場合には、このPSWの制御を受
ける。
A program status word (PSW) is provided to define the operation and status of the arithmetic processing unit (hereinafter referred to as CPU) and is stored in a specific location in the main memory.
When executing an instruction, it is controlled by this PSW.

PSWには、CPUの基本制御モードと拡張制御
モードにより2種類の形式があり、いずれも2語
64ビツトから形成されている。第1図は、基本制
御モードのPSWにおける各ビツト構成を示した
ものである。入出力割込みを制御するチヤネル・
マスクCH MSK、割込み発生時に割込みの種類
を示す割込みコードINTCD、割込み発生時に最
後に読出した命令の語長ILC、命令実行時の条件
コードCCおよび次に実行する命令の先頭バイ
ト・アドレスNIA等のほか、PSWのビツト8〜
11にはCPUが主記憶装置の読出し、書込みを
行うとき、主記憶キーと比較して記憶保護を行う
保護キーKYが格納されている。
There are two types of PSW formats depending on the CPU's basic control mode and extended control mode, and both are two-word formats.
It is formed from 64 bits. FIG. 1 shows the configuration of each bit in the PSW in the basic control mode. Channels that control input/output interrupts
Mask CH MSK, interrupt code INTCD that indicates the type of interrupt when an interrupt occurs, word length ILC of the last instruction read when an interrupt occurs, condition code CC when executing the instruction, first byte address NIA of the next instruction to be executed, etc. In addition, PSW bit 8~
A protection key KY is stored in 11, which protects the memory by comparing it with the main memory key when the CPU reads or writes to the main memory.

一方、入出力動作では、32ビツトから成るチヤ
ネル・アドレス語(以下CAW)の上位4ビツト
に保護キーが与えられており、入出力動作にとも
なう主記憶装置の読出し、書込みを行うときに主
記憶キーとの比較を行う。
On the other hand, for input/output operations, a protection key is assigned to the upper 4 bits of the 32-bit channel address word (hereinafter referred to as CAW). Compare with key.

入出力割込みが発生する場合には、その要因お
よび動作の終了状態を示すためにCSW(チヤネ
ル状態語)が設けられ、主記憶装置の特定位置に
格納される。CSWも2語64ビツトから形成され
るが、ビツト0〜3には入出力動作中に使用した
保護キーが格納されている。
When an input/output interrupt occurs, a CSW (channel status word) is provided to indicate the cause and the end state of the operation, and is stored in a specific location in the main memory. CSW is also formed from two words and 64 bits, and bits 0 to 3 store the protection key used during input/output operations.

他方、主記憶装置は一定バイト(例えば2048バ
イト)ごとのブロツクに分割され、各ブロツクに
対して主記憶キーが設けられる。主記憶キーは、
第2図aに示すように、対応するブロツクに情報
の読出し書込みを行うときPSW、CAWの保護キ
ーと一致しているかを比較するアクセス保護ビツ
トKEY、記憶保護を書込みだけ「0」または読
書き「1」に適用する読出し保護ビツトF、ブロ
ツクに対し書込みまたは読出しを行うとき関係す
る参照ビツトR、変更ビツトCからなる。
On the other hand, the main memory is divided into blocks each having a certain number of bytes (for example, 2048 bytes), and a main memory key is provided for each block. The main memory key is
As shown in Figure 2a, when reading or writing information to the corresponding block, the access protection bit KEY is compared to see if it matches the protection key of PSW and CAW, and the memory protection is set to ``0'' for writing only or for reading and writing. It consists of a read protection bit F applied to "1", a reference bit R and a change bit C, which are related when writing or reading to a block.

CPUから、あるいはチヤネルから主記憶装置
がアクセスされるとき、PSWあるいはCAWの保
護キーKYと主記憶装置の各ブロツクごとの主記
憶キーKEYとが比較され、例えば、主記憶キー
のKEYとFおよび保護キーKYの内容により、第
2図bに示すような制御が行われる。第2図bで
は、各条件CNDにおいて、読出しRDと書込み
WTが許可されるときOK、許可されないときNO
で示されている。
When the main memory is accessed from the CPU or channel, the protection key KY of PSW or CAW is compared with the main memory key KEY of each block of the main memory. For example, the main memory key KEY and F and Depending on the contents of the protection key KY, control as shown in FIG. 2b is performed. In Figure 2b, read RD and write
OK when WT is allowed, NO when not allowed
is shown.

ところで、最近、ソフトウエアとハードウエア
の両方を駆使して、ある計算機のプログラムを他
の計算機の仮想アドレスに変換してジヨブを実行
するいわゆるエミユレーシヨンが多く用いられて
いる。
Incidentally, in recent years, so-called emulation, in which a program on one computer is converted to a virtual address on another computer to execute a job by making full use of both software and hardware, has been widely used.

すなわち、新しい計算機が開発されて、旧機種
と入れ替えられる際に、旧機種で開発され、使用
されてきたプログラムを新機種に受け継ぐ必要が
ある場合、ハードウエアの助けを得てエミユレー
シヨンを行う。通常、エミユレータはホスト計算
機つまり新機種の計算機の動作をするネイテイブ
モードと、ターゲツト計算機つまり旧機種の計算
機の動作をするエミユレーシヨンモードとに切り
替えて動作が行われる。この場合、エミユレーシ
ヨンジヨブは、新しい計算機のオペレーテイング
システムのもとで、他のジヨブと同等に1つのジ
ヨブとして処理され、複数のエミユレーシヨンジ
ヨブを含む多重プログラミングが可能である。す
なわち、第3図bに示すように、ネイテイブモー
ドでは、処理プログラムB,C,Dは直接新しい
計算機のオペレーテイングシステムOSのもとで
動作するが、エミユレーシヨンモードでは、点線
内のように、エミユレーシヨンを制御するプログ
ラムAのもとに処理プログラムBG,F1,F2
が動作することになり、OSから見ると3階層と
なる。
That is, when a new computer is developed and replaced with an old model, and it is necessary to carry over the programs developed and used in the old model to the new model, emulation is performed with the help of hardware. Normally, an emulator operates by switching between a native mode in which it operates as a host computer, that is, a new computer model, and an emulation mode in which it operates as a target computer, that is, an old model computer. In this case, the emulation job is processed as one job in the same manner as other jobs under the operating system of the new computer, and multiple programming including multiple emulation jobs is possible. That is, as shown in Figure 3b, in native mode, processing programs B, C, and D run directly under the new computer's operating system OS, but in emulation mode, they run as shown in the dotted line. Under program A that controls emulation, processing programs BG, F1, F2 are executed.
will operate, and from the OS's perspective, there will be three layers.

エミユレーシヨンを行わない計算機システムで
は、第3図aに示すように、オペレーテイング・
システムDOSのもとで各ユーザ・プログラム
BG,F1,F2が実行される。
In a computer system that does not perform emulation, as shown in Figure 3a, the operating
Each user program under system DOS
BG, F1, and F2 are executed.

その場合にはメモリ機密保護のために、オペレ
ーテイング・システムDOSには保護キーK=0
を、また各ユーザ・プログラムBG,F1,F2
にはそれぞれK=1,K=2,K=3が付与され
る。
In that case, for memory security, the operating system DOS has a protection key K=0.
and each user program BG, F1, F2
are assigned K=1, K=2, and K=3, respectively.

すなわち、この場合は、4ビツトの「0」と
「1」の組合せにより16種類の保護キーKを付与
でき、K=「0000」のみは特別に主記憶装置のど
の領域にもアクセスが許可される。
In other words, in this case, 16 types of protection keys K can be assigned by combinations of 4 bits "0" and "1", and only K = "0000" is specially allowed to access any area of the main memory. Ru.

したがつて、オペレーテイング・システム
DOS以外は、他のユーザからのアクセスを防止
することができ、メモリの機密は有効に保護され
ることになる。
Therefore, the operating system
Access from other users other than DOS can be prevented, and the confidentiality of the memory can be effectively protected.

これに対して、第3図aに示すシステムをエミ
ユレートする計算機システムにおいては、第3図
bに示すように、被エミユレート・オペレーテイ
ング・システムDOSで行つていたメモリ保護の
ためのキー管理、メモリ管理は、すべて上位のオ
ペレーテイング・システムOSにより制御される
ため、被エミユレート・オペレーテイング・シス
テムはDOSは1つのユーザ・ジヨブAとして処
理されることになる。したがつて、第3図bの破
線内で示すように、一般的には1つの保護キー、
ここではK=1が割当てられ、被エミユレート・
オペレーテイング・システムDOSと他のユー
ザ・プログラムBG,F1,F2の保護キーはい
ずれも同一となる。
On the other hand, in a computer system that emulates the system shown in Figure 3a, as shown in Figure 3b, the key management for memory protection performed by the emulated operating system DOS, Since all memory management is controlled by the upper operating system OS, the emulated operating system DOS will be treated as one user job A. Therefore, as shown within the dashed line in Figure 3b, there is generally one protection key,
Here K=1 is assigned and the emulated
The protection keys of the operating system DOS and other user programs BG, F1, and F2 are all the same.

すなわち、被エミユレート・オペレーテイン
グ・システムDOSのもとで複数のプログラムを
実行させる場合には、本来互いに独立であるべき
プログラムBG,F1,F2に対しても1つのキ
ーしか付与されないため、被エミユレート・プロ
グラムの誤りあるいは故意により他の被エミユレ
ート・プログラムの内容を参照あるいは書換えが
可能となり、機密が保護できない。
In other words, when multiple programs are executed under the emulated operating system DOS, only one key is assigned to programs BG, F1, and F2, which should originally be independent from each other. - The contents of other emulated programs can be referenced or rewritten due to a program error or intentionality, and confidentiality cannot be protected.

なお、第3図bにおいて、エミユレーシヨン動
作がどのように行われるかは、周知の技術であ
り、本発明と直接関係がないので、説明を省略す
る(例えば、昭和52年4月19日産業図書(株)発行の
「マイクロプログラミング」(萩原宏著)pp.143
〜165参照)。
It should be noted that the explanation of how the emulation operation is performed in FIG. "Microprogramming" (written by Hiroshi Hagiwara) published by Co., Ltd. pp.143
~165).

本発明の目的は、このような欠点を解消するた
め、被エミユレート・オペレーテイング・システ
ムのもとで、複数個のプログラムを実行させる場
合でも、確実にメモリの機密保護を行える方式を
提供することにある。
An object of the present invention is to provide a method for reliably protecting memory security even when a plurality of programs are executed under an emulated operating system, in order to eliminate such drawbacks. It is in.

本発明では、被エミユレート・オペレーテイン
グ・システムが従来と同じように上位のオペレー
テイング・システムとは関係なく、メモリ保護の
ためのキー管理、メモリ管理を行うようにし、か
つ被エミユレート・プログラムはすべて上位オペ
レーテイング・システムの機密保護管理を受ける
ことによつて、上記の目的を達成する。
In the present invention, the emulated operating system performs key management and memory management for memory protection independently of the upper operating system as in the past, and all emulated programs The above objectives are achieved by being subject to the security control of the upper operating system.

以下、図面により、本発明の実施例を説明す
る。
Embodiments of the present invention will be described below with reference to the drawings.

第4図では、第3図bの被エミユレート・プロ
グラムBG,F1,F2に対するメモリ保護のキ
ー管理を被エミユレート・オペレーテイング・シ
ステムDOSが行つている。
In FIG. 4, the emulated operating system DOS manages memory protection keys for the emulated programs BG, F1, and F2 of FIG. 3b.

この場合、被エミユレート・システムA,
BG,F1,F2は仮想計算機を構成し、この仮
想計算機をオペレーテイング・システムOSが制
御している。
In this case, the emulated system A,
BG, F1, and F2 constitute a virtual computer, which is controlled by an operating system OS.

なお、マイクロプログラミング方式が発展する
に伴つて、エミユレーシヨンはさらに広く解釈さ
れるようになり、制御記憶に入れたときにある計
算機を定義する完全なマイクロプログラムの組を
表わすものをエミユレータと呼んでいる。そし
て、エミユレータで実現される計算機(すなわ
ち、ターゲツト計算機)を仮想計算機(Virtual
Machine)と呼んでいる。
As microprogramming methods have evolved, emulation has come to be interpreted more broadly, and an emulator refers to a complete set of microprograms that define a computer when stored in control memory. . Then, the computer realized by the emulator (that is, the target computer) is converted into a virtual computer (Virtual computer).
Machine).

仮想計算機では仮想メモリに対してアクセスが
行われ、実計算機により仮想アドレスから実アド
レスに変換された後、実メモリがアクセスされ
る。
A virtual computer accesses virtual memory, and after the virtual address is converted into a real address by a real computer, the real memory is accessed.

本発明では、新たに仮想計算機の仮想メモリに
対して仮想メモリ・キーを、また仮想計算機のプ
ログラムに対して仮想アドレス保護キーをそれぞ
れ割当てるのである。すなわち、被エミユレー
ト・オペレーテイング・システムDOSに対して
保護キーK′=0を、被エミユレート・プログラ
ムBG,F1,F2に対してそれぞれ保護キー
K′=1,K′=2,K′=3を割当てる。これによ
り、被エミユレート・オペレーテイング・システ
ムDOS以外は、ユーザ・プログラムBG,F1,
F2の各々に対して他のユーザからのアクセスを
防止することができ、仮想メモリ内の機密が保護
される。
In the present invention, a virtual memory key is newly assigned to the virtual memory of the virtual machine, and a virtual address protection key is newly assigned to the program of the virtual machine. That is, the protection key K'=0 is set for the emulated operating system DOS, and the protection key K'=0 is set for the emulated programs BG, F1, and F2.
Assign K'=1, K'=2, K'=3. This allows user programs BG, F1,
Access to each F2 from other users can be prevented, and the confidentiality in the virtual memory is protected.

さらに、本発明では、オペレーテイング・シス
テムOSによる実メモリに対するキー管理も同時
に受けるようにして、被エミユレート・オペレー
テイング・システムDOSにはK=1とK′=0、
被エミユレート・プログラムBGにはK=1と
K′=1、同じくF1にはK=1とK′=2、F2
にはK=1とK′=3が割当てられ、これらの2
つのキーについて実メモリと仮想メモリでそれぞ
れ内容が比較された結果、両方が一致しなければ
メモリへのアクセスを許可しないようにする。
Furthermore, in the present invention, keys for real memory are managed by the operating system OS at the same time, and the emulated operating system DOS has K=1 and K'=0.
The emulated program BG has K=1.
K'=1, similarly for F1, K=1 and K'=2, F2
are assigned K = 1 and K' = 3, and these 2
The contents of each key are compared in real memory and virtual memory, and if the two do not match, access to the memory will not be permitted.

第5図は、本発明における実メモリと仮想メモ
リの対応図である。
FIG. 5 is a diagram showing the correspondence between real memory and virtual memory in the present invention.

被エミユレート・プログラムEML PGMおよび
他のプログラムPGMA,PGMBは仮想メモリVM
上では連続した領域を与えられるが、実メモリ
RM上の実アドレスにはページと呼ばれる単位
(例えば2キロ・バイト)に細分化されて、必要
に応じてロードされる。
Emulated program EML PGM and other programs PGMA, PGMB are virtual memory VM
In the above, a contiguous area is given, but the real memory
The real address on the RM is divided into units called pages (for example, 2 kilobytes) and loaded as needed.

エミユレータで実現される計算機が仮想計算機
であるが、仮想計算機は仮想メモリVMに対する
仮想アドレスと、それに対応する仮想計算機の実
メモリ(VM REAL MEM)に対する実アドレス
とを有する。この場合、仮想計算機にとつての実
アドレスはそのまま実計算機の実メモリRM上の
実アドレスとはなり得ない。各仮想計算機にとつ
ての実アドレスは、実計算機にとつての仮想アド
レスであるから、これをもう一度アドレス変換す
れば、実メモリRM上の実アドレスとなる。この
ように、仮想計算機では、3段階のアドレスが存
在する。仮想計算機の仮想アドレスから実計算機
の実アドレスにアドレス変換するには、一般に
は、シヤドウテーブルを用いて変換する。シヤド
ウテーブルには、仮想計算機の仮想アドレスから
仮想計算機の実アドレスに変換したものを、さら
に実計算機の実アドレスに変換した値が、直接対
応して格納されている。また、仮想記憶方式を有
する計算機には、仮想アドレスとそれに対する実
アドレスとの対を複数個格納した連想記憶のアド
レス変換バツフア(TLB)が備えられている。
仮想計算機の仮想アドレスは、実計算機の実アド
レスの桁数にさらに大きい桁数を付加した形で設
定されており、セグメント番号とページ番号とペ
ージ内変位で表わされる。セグメント番号は仮想
空間の何番目のセグメントであるかを示し、ペー
ジ番号はそのセグメントの何番目のページである
かを示す。従つて、実計算機の実メモリRM上に
対応するページ単位に割当てると、第5図のRM
の斜線のように割当てられる。
A computer realized by an emulator is a virtual computer, and the virtual computer has a virtual address for the virtual memory VM and a corresponding real address for the real memory (VM REAL MEM) of the virtual computer. In this case, the real address for the virtual machine cannot directly become the real address on the real memory RM of the real computer. Since the real address for each virtual computer is a virtual address for the real computer, if this address is converted once again, it becomes a real address on the real memory RM. In this way, there are three levels of addresses in the virtual machine. Address conversion from a virtual address of a virtual computer to a real address of a real computer is generally performed using a shadow table. In the shadow table, values obtained by converting a virtual address of a virtual machine into a real address of a virtual machine, which is further converted into a real address of a real computer, are stored in direct correspondence. Further, a computer having a virtual memory system is equipped with an address translation buffer (TLB) of an associative memory that stores a plurality of pairs of virtual addresses and their corresponding real addresses.
The virtual address of the virtual computer is set by adding a larger number of digits to the number of digits of the real address of the real computer, and is expressed by a segment number, a page number, and a displacement within the page. The segment number indicates the number of the segment in the virtual space, and the page number indicates the number of the page of the segment. Therefore, if you allocate the corresponding pages on the real memory RM of the real computer, the RM in Figure 5
Assigned as indicated by the diagonal line.

従来より、実メモリRMに対応した主記憶キー
を格納する第1のキー・メモリRKSが設けられ
ているが、本発明では、さらに仮想メモリVM上
のエミユレート・プログラムEML PGMが格納さ
れている領域に対応して、仮想記憶キーを格納す
るそめの第2のキー・メモリVKSを設置する。
これらのキー・メモリRKS,VKSは実メモリRM
あるいは仮想メモリVMの2キロ・バイトごとに
用意され、実メモリRMを参照するとき、あるい
は書込みを行うときに、該当する実アドレス、仮
想アドレスに対応した第1、第2のキー・メモリ
RKS,VKSが読出される。
Conventionally, a first key memory RKS that stores a main memory key corresponding to the real memory RM has been provided, but in the present invention, an area in which the emulate program EML PGM on the virtual memory VM is stored is further provided. Correspondingly, a second key memory VKS for storing a virtual memory key is installed.
These key memories RKS and VKS are real memory RM
Or, it is prepared for every 2 kilobytes of virtual memory VM, and when referencing or writing to real memory RM, first and second key memories corresponding to the corresponding real address and virtual address are used.
RKS and VKS are read.

第6図は、本発明によるメモリ機密保護方式の
ブロツク図である。
FIG. 6 is a block diagram of a memory security scheme according to the present invention.

エミユレーシヨンを行わない場合には、実メモ
リの保護のみを行えばよいので、従来と同じよう
に、実アドレス保護キー・レジスタ3、第1のキ
ー・メモリ14、比較回路12およびオア・ゲー
ト10のみを用いて、PSW、CAW内の保護キー
と主記憶装置内の主記憶キーとの内容を比較器で
照合し、不一致のときに出力を保護例外検出線1
1に送出して、アクセスを禁止しプログラム割込
みINTを発生させるか、あるいはCSWに記憶保
護チエツクを表示する。
If emulation is not performed, only the real memory needs to be protected, so only the real address protection key register 3, first key memory 14, comparator circuit 12, and OR gate 10 are required, as in the conventional case. A comparator compares the contents of the protection key in the PSW and CAW with the main memory key in the main memory, and when they do not match, the output is sent to the protection exception detection line 1.
1 to prohibit access and generate a program interrupt INT, or display a memory protection check on CSW.

エミユレーシヨンを行う場合には、上方の仮想
メモリのチエツク部分も同時に起動させ、両者が
一致したときのみ、実メモリRMへのアクセスを
許可する。
When performing emulation, the upper virtual memory check section is activated at the same time, and only when the two match, access to the real memory RM is permitted.

先ず、エミユレーシヨンを開始する場合には、
エミユレータ・ラツチ入力線7を介してエミユレ
ータ・ラツチ8をセツトし、そのセツト出力をア
ンド・ゲート9に入力してアンド・ゲート9を活
性化させる。また、エミユレーシヨン終了時に
は、エミユレータ・ラツチ入力線7を介してエミ
ユレータ・ラツチ8をリセツトし、アンド・ゲー
ト9を不活性化し、比較回路6の出力がオア・ゲ
ート10に入力するのを禁止する。
First, when starting emulation,
Emulator latch 8 is set via emulator latch input line 7, and its set output is input to AND gate 9 to activate AND gate 9. Furthermore, at the end of emulation, the emulator latch 8 is reset via the emulator latch input line 7, the AND gate 9 is inactivated, and the output of the comparator circuit 6 is prohibited from being input to the OR gate 10.

仮想計算機では、主記憶装置内に仮想記憶領域
を設け、そこに仮想のハードウエア報報、すなわ
ちPSW、制御レジスタ、演算レジスタ等を保持
するが、これらはロード命令により外部メモリよ
りロードされる。
In a virtual computer, a virtual storage area is provided in the main storage device, and virtual hardware information, ie, PSW, control registers, operation registers, etc. are held there, and these are loaded from external memory by a load instruction.

被エミユレート・オペレーテイング・システム
で発行するロードPSW(LPSW)命令のオペラ
ンドであるPSWのキー部を、エミユレータ保護
キー入力線1を介してエミユレータ保護キー・レ
ジスタ2にセツトする。また、同じように、被エ
ミユレート・オペレーテイング・システムでスト
レージ・キー設定(SSK)命令が発行された場合
には、上位オペレーテイング・システムがエミユ
レータに割当てている仮想メモリVMの該当する
仮想アドレスVAを、仮想アドレス線5を介して
送出し、VMに対応する第2のキー・メモリ4を
更新する。
The key part of the PSW, which is the operand of the load PSW (LPSW) instruction issued by the emulated operating system, is set in the emulator protection key register 2 via the emulator protection key input line 1. Similarly, when a storage key setting (SSK) instruction is issued in the emulated operating system, the corresponding virtual address VA of the virtual memory VM assigned to the emulator by the upper operating system is sent via the virtual address line 5 to update the second key memory 4 corresponding to the VM.

一方、エミユレータ・ラツチ8がリセツトされ
ているときに、上位オペレーテイング・システム
からLPSW命令が発行されると、その命令のオペ
ランドであるPSWのキー部が実アドレス保護キ
ー入力線13を介して実アドレス保護キー・レジ
スタ3にセツトされる。また、上位オペレーテイ
ング・システムからSSK命令が発行されると、実
アドレス線15を介して実メモリRMの該当する
アドレスRAが送出され、RMに対応する第1の
キー・メモリ14が更新される。
On the other hand, if an LPSW instruction is issued from the upper operating system while the emulator latch 8 is reset, the key part of the PSW, which is the operand of that instruction, is transmitted via the real address protection key input line 13 to the LPSW instruction. Set in address protection key register 3. Furthermore, when an SSK command is issued from the upper operating system, the corresponding address RA of the real memory RM is sent out via the real address line 15, and the first key memory 14 corresponding to the RM is updated. .

エミユレーシヨン時には、エミユレータ保護キ
ー・レジスタ2の出力と、アクセスされる仮想ア
ドレスVAに対応する第2のキー・メモリ4の出
力とが、比較回路6で比較され、不一致ならばそ
の出力が発生されて、アンド・ゲート9に入力さ
れる。エミユレーシヨン時には、エミユレータ・
ラツチ8がセツトされ、アンド・ゲート9が活性
化されているため、不一致信号がアンド・ゲート
9を介してオア・ゲート10に入力される。これ
により、保護例外検出線11に保護例外のプログ
ラム割込み要求INTが発生し、実メモリの参照、
更新を抑止するとともに、プログラム割込みを発
生させる。
During emulation, the output of the emulator protection key register 2 and the output of the second key memory 4 corresponding to the accessed virtual address VA are compared in the comparison circuit 6, and if they do not match, the output is generated. , are input to AND gate 9. During emulation, the emulator
Since latch 8 is set and AND gate 9 is activated, the mismatch signal is input through AND gate 9 to OR gate 10. As a result, a protection exception program interrupt request INT is generated on the protection exception detection line 11, and the real memory is referenced.
Suppresses updates and generates a program interrupt.

これと同時に、実アドレス保護キー・レジスタ
3の出力と、アクセスされる実アドレスRAに対
応する第1のキー・メモリ14の出力とが比較回
路12で比較され、不一致ならばその出力がオ
ア・ゲート10を介して保護例外検出線11に発
生し、保護例外のプログラム割込みINTが発生す
る。
At the same time, the output of the real address protection key register 3 and the output of the first key memory 14 corresponding to the real address RA to be accessed are compared in the comparison circuit 12, and if they do not match, the output is ORed. A protection exception detection line 11 is generated through a gate 10, and a protection exception program interrupt INT is generated.

次に、このハードウエアを制御するオペレーテ
イング・システムの動作を、第4図〜第6図によ
り説明する。
Next, the operation of the operating system that controls this hardware will be explained with reference to FIGS. 4 to 6.

上位オペレーテイング・システムOSは、被エ
ミユレート・オペレーテイング・システムDOS
を1つのプログラムAとして、同時に実行中の他
のプログラムB,C,Dとともに排他的な保護キ
ーK=1,K=2,K=3,K=4を付与するこ
とにより、プログラム相互間の機密保護を行う。
これらは、実メモリRMの保護キーだけの管理で
行うことができ、これによつて被エミユレート・
オペレーテイング・システムDOS中に誤りがあ
つても、他のプログラムB,C,Dの領域に入り
込むことは防止できる。
The upper operating system OS is the emulated operating system DOS
By assigning exclusive protection keys K=1, K=2, K=3, and K=4 to other programs B, C, and D that are running simultaneously, the Provide confidentiality.
These can be done by managing only the protection key of the real memory RM, which allows the emulated
Even if an error occurs in the operating system DOS, it can be prevented from entering the areas of other programs B, C, and D.

被エミレート・オペレーテイング・システム
DOSは、上位オペレーテイング・システムOSに
より付与された実メモリRMのキーK=1の他
に、被エミユレート・オペレーテイング・システ
ムDOSの制御下にある被エミユレート・プログ
ラム群BG,F1,F2に対して仮想メモリVMの
保護キーK=1,K′=2,K′=3をそれぞれ排
他的に付与するので、エミユレート・プログラム
BG,F1,F2相互間の機密保護を行うことが
できる。
Emulated operating system
In addition to the key K=1 of the real memory RM assigned by the upper operating system OS, DOS also controls the emulated program groups BG, F1, and F2 under the control of the emulated operating system DOS. Since the protection keys K = 1, K' = 2, and K' = 3 are exclusively assigned to the virtual memory VM, the emulating program
Mutual security protection between BG, F1, and F2 can be performed.

エミユレーシヨンの起動は、上位オペレーテイ
ング・システムOSによるエミユレータ起動命令
により行われ、入出力割込みあるいはプログラム
割込み等の割込みで終結する。
Activation of emulation is performed by an emulator activation command from the upper operating system OS, and is terminated by an interrupt such as an input/output interrupt or a program interrupt.

LPSW命令およびSSK命令は特権命令であり、
オペレーテイング・システムOSでのみ使用可能
であり、ユーザ・プログラムで発行するとプログ
ラム割込みとして検出され、実行されることはな
い。しかし、エミユレーシヨン時に被エミユレー
ト・オペレーテイング・システムDOSで発行す
るLPSW命令は、PSWのキー部をエミユレータ
保護キー2に取込んでからプログラム割込みを発
生させる。
LPSW and SSK instructions are privileged instructions,
It can only be used by the operating system OS, and if issued by a user program, it will be detected as a program interrupt and will not be executed. However, the LPSW command issued by the emulated operating system DOS during emulation captures the key part of the PSW into the emulator protection key 2 and then generates a program interrupt.

また、SSK命令は、対応する第2のキー・メモ
リ4に指定された値を設定してから、プログラム
割込みを発生させる。上位オペレーテイング、シ
ステムOSは、エミユレータよりのプログラム割
込みであることを識別して、特権命令のシミユレ
ーシヨンを行い、エミユレータ起動命令で被エミ
ユレート・オペレーテイング・システムDOSに
制御を渡す。
Further, the SSK instruction sets a specified value in the corresponding second key memory 4 and then generates a program interrupt. The upper operating system, the system OS, identifies that it is a program interrupt from the emulator, simulates a privileged instruction, and passes control to the emulated operating system, DOS, with an emulator startup instruction.

以上説明したように、本発明によれば、仮想メ
モリに対応する第2のキー・メモリと仮想アドレ
ス保護キー保持レジスタを新しく設けることによ
り、エミユレーシヨン・プログラム実行時にも被
エミユレート・プログラム相互間あるいはデータ
間でメモリ機密保護を行うことができ、かつ従来
の実メモリに対応する第1のキー・メモリと実ア
ドレスに対する保護キー保持レジスタの比較結果
を併用することにより、被エミユレート・オペレ
ーテイング・システムと同時に実行中のプログラ
ムとの間で機密保護を行うことができる。
As explained above, according to the present invention, by newly providing the second key memory corresponding to the virtual memory and the virtual address protection key holding register, it is possible to transfer data between the emulated programs and the data even when the emulation program is executed. By using the comparison result of the first key memory corresponding to the conventional real memory and the protection key holding register for the real address, the emulated operating system and the Security can be maintained between programs that are running at the same time.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は基本制御モードにおけるPSWのビツ
ト構成図、第2図は主記憶キーのビツト構成およ
びメモリ保護の一例を示す条件説明図、第3図は
エミユレーシヨン時における保護キーの割当図、
第4図は本発明の原理を示す説明図、第5図は本
発明における実メモリと仮想メモリの対応図、第
6図は本発明の実施例を示すメモリ機密保護方式
のブロツク図である。 1:エミユレータ保護キー入力線、2:エミユ
レータ保護キー・レジスタ、3:実アドレス保護
キー・レジスタ、4:第2のキー・メモリ(仮想
キー・メモリ)、5:仮想アドレス線、6,1
2:比較回路、7:エミユレータ・ラツチ入力
線、8:エミユレータ・ラツチ、9:アンド・ゲ
ート、10:オア・ゲート、11:保護例外検出
線、13:実アドレス保護キー入力線、14:第
1のキー・メモリ(実キー・メモリ)、15:実
アドレス線、VA:仮想アドレス、RA:実アドレ
ス、VM:仮想メモリ、RM:実メモリ、K=0
〜4:実アドレス保護キー、K′=0〜3:エミ
ユレータ保護キー。
Fig. 1 is a diagram of the bit configuration of the PSW in basic control mode, Fig. 2 is a condition explanatory diagram showing the bit configuration of the main memory key and an example of memory protection, and Fig. 3 is an allocation diagram of the protection key during emulation.
FIG. 4 is an explanatory diagram showing the principle of the present invention, FIG. 5 is a correspondence diagram between real memory and virtual memory in the present invention, and FIG. 6 is a block diagram of a memory security system showing an embodiment of the present invention. 1: Emulator protection key input line, 2: Emulator protection key register, 3: Real address protection key register, 4: Second key memory (virtual key memory), 5: Virtual address line, 6,1
2: Comparison circuit, 7: Emulator latch input line, 8: Emulator latch, 9: AND gate, 10: OR gate, 11: Protection exception detection line, 13: Real address protection key input line, 14: No. 1 key memory (real key memory), 15: real address line, VA: virtual address, RA: real address, VM: virtual memory, RM: real memory, K=0
~4: Real address protection key, K'=0~3: Emulator protection key.

Claims (1)

【特許請求の範囲】[Claims] 1 プログラムを仮想アドレスに変換してエミユ
レートする処理装置において、実メモリに対応す
る第1のキー・メモリと実アドレス保護キー保持
手段と上記各内容を比較する第1の比較手段を備
えるとともに、仮想メモリに対応する第2のキ
ー・メモリと仮想アドレス保護キー保持手段と、
上記各内容を比較する第2の比較手段を備え、上
記第1と第2の比較手段で内容が一致したとき実
メモリのアクセスを許可することを特徴とするメ
モリ機密保護方式。
1 A processing device that converts a program into a virtual address and emulates it, comprising a first key memory corresponding to the real memory, a real address protection key holding means, and a first comparing means for comparing each of the above contents, and a second key memory corresponding to the memory and virtual address protection key holding means;
A memory security system comprising: a second comparing means for comparing each of the above contents, and permitting access to the real memory when the contents match between the first and second comparing means.
JP2410579A 1979-02-28 1979-02-28 Memory secrecy protection system Granted JPS55116149A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2410579A JPS55116149A (en) 1979-02-28 1979-02-28 Memory secrecy protection system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2410579A JPS55116149A (en) 1979-02-28 1979-02-28 Memory secrecy protection system

Publications (2)

Publication Number Publication Date
JPS55116149A JPS55116149A (en) 1980-09-06
JPS6221140B2 true JPS6221140B2 (en) 1987-05-11

Family

ID=12129059

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2410579A Granted JPS55116149A (en) 1979-02-28 1979-02-28 Memory secrecy protection system

Country Status (1)

Country Link
JP (1) JPS55116149A (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS60129860A (en) * 1983-12-19 1985-07-11 Hitachi Ltd Detection system for addressing exception
JP2559398B2 (en) * 1987-03-18 1996-12-04 株式会社日立製作所 Virtual computer system

Also Published As

Publication number Publication date
JPS55116149A (en) 1980-09-06

Similar Documents

Publication Publication Date Title
US11210239B2 (en) Protection key management and prefixing in virtual address space legacy emulation system
US5280614A (en) Apparatus and method for controlling access to data using domains
US4347565A (en) Address control system for software simulation
JP6306578B2 (en) Memory protection device and protection method
US5809546A (en) Method for managing I/O buffers in shared storage by structuring buffer table having entries including storage keys for controlling accesses to the buffers
CN109359487B (en) Extensible security shadow storage and tag management method based on hardware isolation
US5220669A (en) Linkage mechanism for program isolation
JP5914145B2 (en) Memory protection circuit, processing device, and memory protection method
US4945480A (en) Data domain switching on program address space switching and return
JPH0769844B2 (en) Apparatus and method for common access to data space
JP4295111B2 (en) Memory management system and memory access security grant method based on linear address
US20020046305A1 (en) Method for effective binary translation between different instruction sets using emulated supervisor flag and multiple page tables
US7506096B1 (en) Memory segment emulation model for virtual machine
JPS6248258B2 (en)
Tang et al. Exploring control flow guard in windows 10
US5724551A (en) Method for managing I/O buffers in shared storage by structuring buffer table having entries include storage keys for controlling accesses to the buffers
JP7291149B2 (en) Controlling protection tag checking on memory accesses
JPS6221140B2 (en)
JPH06332803A (en) Tlb control method in virtual computer system
JP2535086B2 (en) Ring reduction logic device
JP3674446B2 (en) Individual application patch management apparatus and individual application patch management method
JP6708860B2 (en) Protected Key Management and Prefix Translation in Virtual Address Space Legacy Emulation System
JPS588073B2 (en) address translation device
JPH0241772B2 (en)
JPS6118224B2 (en)