JPH07105091A - Device and method for controlling cache - Google Patents

Device and method for controlling cache

Info

Publication number
JPH07105091A
JPH07105091A JP5269978A JP26997893A JPH07105091A JP H07105091 A JPH07105091 A JP H07105091A JP 5269978 A JP5269978 A JP 5269978A JP 26997893 A JP26997893 A JP 26997893A JP H07105091 A JPH07105091 A JP H07105091A
Authority
JP
Japan
Prior art keywords
cache
processor
main memory
contents
program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5269978A
Other languages
Japanese (ja)
Inventor
Toshiharu Tanaka
俊治 田中
Toshiaki Arai
利明 新井
Toru Horie
亨 堀江
Yoshihide Jin
好秀 神
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 JP5269978A priority Critical patent/JPH07105091A/en
Publication of JPH07105091A publication Critical patent/JPH07105091A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide a virtual computer system in the computer of multi- processor configuration, whereby the invalidation instruction of a cache issued by an operating system(OS) in the virtual computer is efficiently executed, and to provide the virtual computer system capable of efficiently control the cache at the time of switching of running (OS) in the processor. CONSTITUTION:When OS in the virtual computer issues the invalidation instruction of the cache in a processor 100-1, a control circuit 250-1 permits a cache memory 270-1 to be an invalid state and, then, requests cache invalidation to the cache 300-2. In the cache 300-2, a cache invalidating signal is transmitted to a control circuit 250-2 only when OS issuing the invalidation instruction coincides with OS running in the processor 100-2 and permits the cache memory 270-2 to be invalidated. Thus, the virtual computer system whereby IS efficiently utilizes the cache is provided.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、キャッシュの制御装置
および制御方法に関し、特に、仮想計算機が効率良くキ
ャッシュを利用することを可能とするキャッシュの制御
装置および制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cache control device and control method, and more particularly to a cache control device and control method that enables a virtual computer to use the cache efficiently.

【0002】[0002]

【従来の技術】仮想計算機システム(VMS:Virtual
Machine System)とは、特開昭57−212680号公
報に記載のように、1台の計算機上に論理的な計算機で
ある仮想計算機(VM:Virtual Machine )を複数台生
成し、これらの各仮想計算機において、各々1つのオペ
レーティング・システム(OS:Operating System)の
走行を可能とするシステムである。
2. Description of the Related Art Virtual computer system (VMS: Virtual
Machine System), as described in Japanese Patent Application Laid-Open No. 57-212680, generates a plurality of virtual machines (VM: Virtual Machines) which are logical machines on one machine, and each of these virtual machines is created. It is a system that enables each computer to run one operating system (OS).

【0003】仮想計算機システムでは、1台の計算機上
で、複数のOSの並列運転が可能である。このため、仮
想計算機システムは、使用目的の異なる複数のOSを1
台の計算機で運用したり、旧OSから新OSへのOS移
行時に新旧2つのOSを1台の計算機で運用したり、O
Sのテストを並列に1台の計算機で実行するためのツー
ルとして主に利用されている。
In a virtual computer system, a plurality of OSs can be operated in parallel on one computer. For this reason, the virtual computer system uses a plurality of OSs for different purposes.
Operating on one computer, operating two OSs old and new on one computer at the time of OS transition from the old OS to the new OS,
It is mainly used as a tool for executing the S test in parallel on one computer.

【0004】この仮想計算機システムにおいて、仮想計
算機モニタ(VMM:Virtual Machine Monitor )は、
各仮想計算機に計算機資源を割り当てたり、仮想計算機
のスケジューリングや起動を行なったり、OSが発行し
た命令のうち実計算機では直接実行できない命令のシミ
ュレーション処理等を行なう。この仮想計算機システム
では、各OSはあたかも独立した計算機を専有している
かのような環境を与えられる。
In this virtual computer system, the virtual machine monitor (VMM) is
It allocates computer resources to each virtual computer, schedules and activates the virtual computer, and performs simulation processing of instructions issued by the OS that cannot be directly executed by the real computer. In this virtual computer system, each OS is provided with an environment as if it occupies an independent computer.

【0005】仮想計算機システムにおいて、実計算機を
構成する中央プロセッサ(以後、プロセッサ、と呼ぶ)
の数は、1つでも良いし、また、複数であっても良い。
プロセッサを複数有する実計算機を、マルチプロセッサ
構成の実計算機という。また、論理的なプロセッサ(以
後、仮想プロセッサ、と呼ぶ)を複数有する仮想計算機
を、仮想マルチプロセッサ構成の仮想計算機という。マ
ルチプロセッサ構成の実計算機上の仮想マルチプロセッ
サ構成の仮想計算機では、同時に複数のプロセッサ上で
同一のOSが走行可能である。
In a virtual computer system, a central processor (hereinafter referred to as a processor) that constitutes a real computer
The number may be one or plural.
A real computer having a plurality of processors is called a multiprocessor real computer. A virtual computer having a plurality of logical processors (hereinafter referred to as virtual processors) is called a virtual computer having a virtual multiprocessor configuration. In a virtual computer having a virtual multiprocessor configuration on a real computer having a multiprocessor configuration, the same OS can run on a plurality of processors at the same time.

【0006】従来、仮想計算機システムは、汎用大型計
算機の分野において、広く使用されてきた。しかしなが
ら、マイクロプロセッサの性能向上により、ワークステ
ーションにおいても用途に応じた複数のOSを走行させ
る要求がおこり、ワークステーション上の仮想計算機シ
ステムが必要となりつつある。
Conventionally, virtual computer systems have been widely used in the field of general-purpose large-scale computers. However, due to the improvement in the performance of the microprocessor, there is a demand for a workstation to run a plurality of OSs depending on the application, and a virtual computer system on the workstation is becoming necessary.

【0007】このマイクロプロセッサの分野では、近
年、縮小命令セットコンピュータ(RISC:Reduced
Instruction Set Computer)のアーキテクチャの採用が
盛んである。例えば、ヒューレット・パッカード・ジャ
ーナル1986年8月号(HEWLETT-PACKARD JOURNAL, A
UGUST 1986)の16ページおよび17ページには、RI
SCプロセッサにおけるキャッシュのアーキテクチャが
紹介されている。キャッシュは、メインメモリの一部を
保持し、プロセッサが高速にアクセス可能なメモリバッ
ファである。
In the field of this microprocessor, a reduced instruction set computer (RISC: Reduced) has recently been developed.
Instruction Set Computer) architecture is popular. For example, the Hewlett-Packard Journal August 1986 issue (HEWLETT-PACKARD JOURNAL, A
UGUST 1986), pages 16 and 17 include RI
The cache architecture in the SC processor is introduced. The cache is a memory buffer that holds part of the main memory and that can be accessed by the processor at high speed.

【0008】このRISCプロセッサでは、キャッシュ
およびメインメモリへの書き込みは次のように行なわれ
る。まず、プロセッサが書き込みを要求したメインメモ
リのブロックのコピーがキャッシュにある場合、このキ
ャッシュメモリが更新される。また、該当ブロックがキ
ャッシュになければ、メインメモリのブロックをキャッ
シュにコピーし、このコピーしたキャッシュのブロック
が更新される。
In this RISC processor, writing to the cache and main memory is performed as follows. First, if a copy of the block of main memory that the processor has requested to write is in the cache, this cache memory is updated. If the block is not in the cache, the block in the main memory is copied to the cache, and the copied block in the cache is updated.

【0009】さらに、書き込み要求時にキャシュ内に空
きブロックがないときは、まず、予め定めたアルゴリズ
ムに従って選択されたキャッシュのブロックがメインメ
モリにコピーされ、そのキャッシュのブロックは空き状
態にされる。そして、この空き状態となったブロック
に、書き込みが要求されたメインメモリのブロックがコ
ピーされ、このキャッシュ内のブロックに対して書き込
みが行なわれる。
Further, when there is no empty block in the cache at the time of write request, first, the block of the cache selected according to a predetermined algorithm is copied to the main memory, and the block of the cache is made empty. Then, the block of the main memory to which the writing is requested is copied to the block in the empty state, and the writing is performed to the block in this cache.

【0010】このように、RISCプロセッサでは、キ
ャッシュとメインメモリの更新は同期的には行なわれな
い。すなわち、キャッシュが更新されたとき同時にメイ
ンメモリも更新されるとは限らない。このため、キャッ
シュの内容とメインメモリの内容とは、必ずしも一致し
ない。
As described above, in the RISC processor, the cache and the main memory are not updated synchronously. That is, when the cache is updated, the main memory is not always updated at the same time. Therefore, the contents of the cache and the contents of the main memory do not always match.

【0011】また、このRISCプロセッサには、キャ
ッシュを制御するための命令として、PURGE CA
CHE命令およびFLUSH CACHE命令がある。
マルチプロセッサ構成の計算機システムの1つのプロセ
ッサにおいて、PURGECACHE命令を発行する
と、全てのプロセッサにこの要求がブロードキャストさ
れて、全プロセッサのキャッシュの内容が無効化され
る。また、マルチプロセッサ構成の計算機システムの1
つのプロセッサにおいて、FLUSH CACHE命令
を発行すると、全てのプロセッサにこの要求がブロード
キャストされて、全プロセッサについて、キャッシュの
内容がメインメモリにコピーされた後、キャッシュの内
容が無効化される。
Further, this RISC processor has a PURGE CA as an instruction for controlling the cache.
There are CHE and FLUSH CACHE instructions.
When a PURGECACHE instruction is issued in one processor of a computer system having a multiprocessor configuration, this request is broadcast to all the processors, and the cache contents of all the processors are invalidated. In addition, one of the computer systems of multiprocessor configuration
When a FLUSH CACHE instruction is issued in one processor, this request is broadcast to all the processors, and the cache contents are invalidated after the cache contents are copied to the main memory for all the processors.

【0012】[0012]

【発明が解決しようとする課題】前述のRISCプロセ
ッサの計算機上に仮想計算機システムを構築しようとす
ると、キャッシュ制御に関して、以下の課題がある。
When attempting to construct a virtual computer system on the computer of the RISC processor described above, there are the following problems regarding cache control.

【0013】(1)第1の課題は、実計算機がマルチプ
ロセッサ構成(実プロセッサが複数、プロセッサごとに
キャッシュを備えメインメモリは共有)のとき、仮想計
算機上のOSが発行したキャッシュの無効化命令の実行
に関する。
(1) The first problem is that when a real computer has a multiprocessor configuration (a plurality of real processors, each processor has a cache and a main memory is shared), the cache issued by the OS on the virtual machine is invalidated. Regarding execution of instructions.

【0014】実計算機がマルチプロセッサ構成であり、
第1および第2のプロセッサにおいてそれぞれ第1およ
び第2のOSが走行中であるとする。このとき、第1の
OSが発行したキャッシュの無効化命令をそのまま実行
してしまうと、第2のプロセッサのキャッシュも不当に
無効化されてしまう。この結果、第2のOSのメモリの
内容に不一致が発生し、第2のOSが正しい処理を行な
えなくなる。すなわち、マルチプロセッサ構成の計算機
において、仮想計算機上のOSが発行したキャッシュの
無効化命令をどのように実行すれば良いか、という課題
がある。
The real computer has a multiprocessor configuration,
It is assumed that the first and second OSs are running on the first and second processors, respectively. At this time, if the cache invalidation instruction issued by the first OS is executed as it is, the cache of the second processor is also invalidated inappropriately. As a result, the contents of the memory of the second OS do not match, and the second OS cannot perform the correct processing. That is, there is a problem of how to execute a cache invalidation instruction issued by an OS on a virtual computer in a computer having a multiprocessor configuration.

【0015】(2)第2の課題は、プロセッサにおける
走行OSの切り替えに関する。これは、実計算機がプロ
セッサ1個の場合および複数の場合の両方において存在
する課題である。
(2) The second problem relates to switching of the running OS in the processor. This is a problem that exists in both the case where the real computer has one processor and the case where the real computer has a plurality of processors.

【0016】第1のOSが走行した後、同一のプロセッ
サにおいて第2のOSが走行し、この第2のOSがキャ
ッシュの内容の無効化命令を発行したとする。このと
き、この無効化命令をそのまま実行してしまうと、前
回、第1のOSが走行中に形成したキャッシュの内容が
不当に無効化され、失われてしまう。この結果、次に第
1のOSを走行させたとき、メモリの内容に不一致が発
生し、第1のOSが正しい処理を行なえなくなる。すな
わち、1つのプロセッサを有する計算機上で複数の仮想
計算機が走行する場合に、キャッシュをどのように制御
すれば良いか、という課題がある。
It is assumed that after the first OS runs, the second OS runs in the same processor, and the second OS issues a cache content invalidation instruction. At this time, if the invalidation instruction is executed as it is, the contents of the cache formed while the first OS was running last time are invalidated and lost. As a result, when the first OS is run next time, a mismatch occurs in the memory contents, and the first OS cannot perform correct processing. That is, when a plurality of virtual computers run on a computer having one processor, there is a problem of how to control the cache.

【0017】本発明の目的は、マルチプロセッサ構成の
計算機において、仮想計算機上のOSが発行したキャッ
シュの無効化命令を、効率良く実行することが可能な仮
想計算機システムを提供することにある。
It is an object of the present invention to provide a virtual computer system capable of efficiently executing a cache invalidation instruction issued by an OS on a virtual computer in a multiprocessor computer.

【0018】本発明の他の目的は、プロセッサにおける
走行OSの切り替え時に、キャッシュを効率良く制御可
能な仮想計算機システムを提供することにある。
Another object of the present invention is to provide a virtual computer system capable of efficiently controlling a cache when switching a running OS in a processor.

【0019】[0019]

【課題を解決するための手段】上記目的を達成するた
め、本発明は、複数のプロセッサと、前記複数のプロセ
ッサによって共有されるメインメモリと、前記プロセッ
サ毎に設けられたキャッシュとを有する1台の計算機上
で、複数のオペレーティング・システムが走行する仮想
計算機システムにおけるキャッシュの制御装置およびそ
の方法であって、前記複数のプロセッサ中の第1のプロ
セッサにおいて走行中のオペレーティング・システム
が、キャッシュの内容を無効化する命令を発行したこと
に応じて、前記第1のプロセッサのキャッシュの内容を
無効化し、前記第1のプロセッサを除く各プロセッサに
おいて、前記走行中のオペレーティング・システムが走
行中か否かを判定し、前記判定が肯定的であるプロセッ
サのキャッシュの内容を無効化するようにしたことを特
徴とする。
In order to achieve the above object, the present invention provides a single unit having a plurality of processors, a main memory shared by the plurality of processors, and a cache provided for each processor. And a method of controlling a cache in a virtual computer system in which a plurality of operating systems run on a computer, the operating system running in a first processor among the plurality of processors, Whether or not the running operating system is running in each processor other than the first processor, the contents of the cache of the first processor are invalidated in response to issuance of an instruction to invalidate Content of the cache of the processor for which the determination is positive Characterized by being adapted to disable.

【0020】また、プロセッサとメインメモリとキャッ
シュとを有する1台の計算機上で複数のオペレーティン
グ・システムが走行する仮想計算機システムにおけるキ
ャッシュの制御装置およびその方法であって、前記プロ
セッサにおいて、次に走行させようとする第1のオペレ
ーティング・システムが、前記プロセッサで最後に走行
した第2のオペレーティング・システムと同一か否かを
判定し、前記判定結果が肯定的であることに応じて、前
記キャッシュの内容を前記メインメモリに複写すること
なく、前記第1のオペレーティング・システムを前記プ
ロセッサにおいて走行させ、あるいは前記判定結果が否
定的であることに応じて、前記キャッシュの内容を前記
メインメモリに複写して、前記第1のオペレーティング
・システムを前記プロセッサにおいて走行させるように
したことを特徴とする。
A cache control device and method in a virtual computer system in which a plurality of operating systems run on one computer having a processor, a main memory, and a cache. The first operating system that is to be run is the same as the second operating system last run on the processor, and in response to the positive result of the determination, the cache The first operating system is run on the processor without copying the contents to the main memory, or the contents of the cache are copied to the main memory in response to a negative result of the determination. The first operating system Characterized in that so as to travel in the processor.

【0021】さらに、本発明は、プロセッサとメインメ
モリと複数エントリを備えたキャッシュとを有する1台
の計算機上で複数のオペレーティング・システムが走行
する仮想計算機システムにおけるキャッシュの制御装置
であって、前記キャッシュの各エントリがいずれのオペ
レーティング・システムで使用されているかを示す識別
子を、各エントリごとに記憶するための記憶手段と、前
記メインメモリの一部を前記キャッシュメモリのエント
リに登録するとき、前記プロセッサで走行中のオペレー
ティング・システムの識別子を前記記憶手段の対応する
エントリの領域に書き込む手段と、前記プロセッサにお
いて走行中のオペレーティング・システムが、キャッシ
ュの内容を無効化する命令を発行したことに応じて、前
記走行中のオペレーティング・システムの識別子が付与
されたキャッシュメモリのエントリを無効化する手段と
を備えたことを特徴とする。
Further, the present invention relates to a cache control device in a virtual computer system in which a plurality of operating systems run on one computer having a processor, a main memory and a cache having a plurality of entries, wherein: A storage unit for storing, for each entry, an identifier indicating which operating system each entry of the cache is using, and when registering a part of the main memory in the entry of the cache memory, Means for writing the identifier of the operating system running in the processor into the area of the corresponding entry of the storage means, and in response to the operating system running in the processor issuing an instruction to invalidate the contents of the cache. The operating Characterized in that the identifier of the computing system and means for invalidating an entry in the cache memory granted.

【0022】また、本発明は、複数のプロセッサと、前
記複数のプロセッサによって共有されるメインメモリ
と、前記プロセッサ毎に設けられたキャッシュとを有す
る1台の計算機上で複数のプログラムが実行される計算
機システムにおけるキャッシュの制御装置およびその方
法であって、前記複数のプロセッサ中の第1のプロセッ
サにおいて実行中のプログラムが、キャッシュの内容を
無効化する命令を発行したことに応じて、前記第1のプ
ロセッサのキャッシュの内容を無効化し、前記第1のプ
ロセッサを除く各プロセッサにおいて、前記プログラム
が実行中か否かを判定し、前記判定が肯定的であるプロ
セッサのキャッシュの内容を無効化するようにしたこと
を特徴とする。
Further, according to the present invention, a plurality of programs are executed on one computer having a plurality of processors, a main memory shared by the plurality of processors, and a cache provided for each processor. A cache control device and method thereof in a computer system, wherein the first program among the plurality of processors executes a program in response to an instruction to invalidate the contents of the cache issued. To invalidate the cache contents of each processor, determine whether or not the program is being executed in each processor except the first processor, and invalidate the cache contents of the processor for which the determination is positive. It is characterized by having done.

【0023】また、プロセッサとメインメモリとキャッ
シュとを有する1台の計算機上で複数のプログラムが実
行される計算機システムにおけるキャッシュの制御装置
およびその方法であって、前記プロセッサにおいて、次
に実行させようとする第1のプログラムが、前記プロセ
ッサで最後に実行した第2のプログラムと同一か否かを
判定し、前記判定結果が肯定的であることに応じて、前
記キャッシュの内容を前記メインメモリに複写すること
なく、前記第1のプログラムを前記プロセッサにおいて
実行させるようにし、あるいは前記判定結果が否定的で
あることに応じて、前記キャッシュの内容を前記メイン
メモリに複写して、前記第1のプログラムを前記プロセ
ッサにおいて実行させるようにしたことを特徴とする。
A cache control apparatus and method in a computer system in which a plurality of programs are executed on a single computer having a processor, a main memory and a cache, and the processor executes the program next. Determines whether the first program is the same as the second program executed last by the processor, and if the result of the determination is positive, the content of the cache is stored in the main memory. The first program is executed in the processor without copying, or the contents of the cache are copied to the main memory in response to a negative result of the determination, and the first program is executed. It is characterized in that the program is executed in the processor.

【0024】さらに、本発明は、プロセッサとメインメ
モリと複数エントリを備えたキャッシュとを有する1台
の計算機上で複数のプログラムが実行される計算機シス
テムにおけるキャッシュの制御装置であって、前記キャ
ッシュの各エントリがいずれのプログラムで使用されて
いるかを示す識別子を、各エントリごとに記憶するため
の記憶手段と、前記メインメモリの一部を前記キャッシ
ュメモリのエントリに登録するとき、前記プロセッサで
実行中のプログラムの識別子を前記記憶手段の対応する
エントリの領域に書き込む手段と、前記プロセッサにお
いて実行中のプログラムが、キャッシュの内容を無効化
する命令を発行したことに応じて、前記実行中のプログ
ラムの識別子が付与されたキャッシュメモリのエントリ
を無効化する手段とを備えたことを特徴とする。
Further, the present invention is a cache control device in a computer system in which a plurality of programs are executed on one computer having a processor, a main memory, and a cache having a plurality of entries. A storage unit for storing, for each entry, an identifier indicating which program is used for each entry, and a processor executing when a part of the main memory is registered in the entry of the cache memory. Means for writing the identifier of the program in the corresponding entry area of the storage means, and the program being executed in the processor issuing a command for invalidating the contents of the cache, A means for invalidating the cache memory entry to which an identifier is assigned Characterized by comprising a.

【0025】[0025]

【作用】以下、本発明の代表的な作用を説明する。The typical operation of the present invention will be described below.

【0026】複数の中の第1のプロセッサにおいて走行
中のオペレーティングシステム(以下、OSという)
が、キャッシュの無効化命令を発行したことに応じて、
第1のプロセッサのキャッシュを無効化する。さらに、
前記第1のプロセッサを除く各プロセッサにおいて、前
記OSが走行中か否かを判定し、この判定が肯定的であ
るプロセッサのキャッシュの内容を無効化する。
An operating system (hereinafter referred to as OS) running on the first processor among the plurality of processors
But in response to issuing the cache invalidation instruction,
Invalidate the cache of the first processor. further,
In each of the processors except the first processor, it is determined whether or not the OS is running, and the contents of the cache of the processor for which the determination is positive are invalidated.

【0027】以上のようにして、仮想計算機上のOSが
発行したキャッシュの無効化命令を、前記OSが走行中
のプロセッサに限定して実行することにより、他のOS
の走行に影響を与えないようにすることが出来る。この
ようにして、マルチプロセッサ構成の計算機において、
仮想計算機上のOSが発行したキャッシュの無効化命令
を、効率良く実行可能な仮想計算機システムが提供され
る。
As described above, by executing the cache invalidation instruction issued by the OS on the virtual machine only on the processor on which the OS is running, another OS is executed.
It is possible to prevent it from affecting the running of. In this way, in a computer with a multiprocessor configuration,
There is provided a virtual computer system capable of efficiently executing a cache invalidation instruction issued by an OS on a virtual computer.

【0028】また、仮想計算機モニタ(VMM)は、プ
ロセッサにおいて走行させようとする複数の中の第1の
OSが、前記プロセッサで最後に走行した第2のOSと
同一か否かを判定する。判定結果が肯定的であれば、仮
想計算機モニタ(VMM)は、キャッシュの内容をメイ
ンメモリに複写することなく、前記第1のOSを前記プ
ロセッサにおいて走行させる。一方、判定結果が否定的
であれば、仮想計算機モニタ(VMM)は、前記プロセ
ッサのキャッシュの内容をメインメモリに複写して、さ
らに、キャッシュの内容を全て無効化した後、前記第1
のOSを前記プロセッサにおいて走行させる。
Further, the virtual machine monitor (VMM) determines whether or not the first OS of the plurality of processors to be run in the processor is the same as the second OS last run in the processor. If the determination result is affirmative, the virtual machine monitor (VMM) causes the first OS to run on the processor without copying the cache contents to the main memory. On the other hand, if the determination result is negative, the virtual machine monitor (VMM) copies the cache contents of the processor to the main memory, further invalidates all the cache contents, and then executes the first
Of OS is run on the processor.

【0029】以上のようにすれば、第1のOSが走行を
開始した時点では、キャッシュに他のOSのメモリの内
容は保持されていないことになる。従って、第1のOS
が走行中に、キャッシュの無効化命令を発行しても、他
のOSのメモリの内容には、影響を与えない。さらに、
前回走行した第2のOSとは異なる第1のOSを走行さ
せるとき、キャッシュは全て無効化され、メインメモリ
に第1のOSの全てのメモリ内容が保存されている。従
って、第1のOSが走行中に、キャッシュ内の他のOS
のメモリ内容を誤って使用することはない。
In this way, when the first OS starts running, the cache does not hold the contents of the other OS's memory. Therefore, the first OS
Issuing a cache invalidation command during running does not affect the memory contents of other OSs. further,
When the first OS different from the second OS that was run last time is run, all caches are invalidated and all the memory contents of the first OS are saved in the main memory. Therefore, while the first OS is running, another OS in the cache
You will not accidentally use the memory contents of.

【0030】このようにして、プロセッサにおける走行
OSの切り替え時に、キャッシュを効率良く制御可能な
仮想計算機システムが提供される。
In this way, a virtual computer system capable of efficiently controlling the cache when switching the running OS in the processor is provided.

【0031】[0031]

【実施例】以下、本発明の2つの実施例を、図面を用い
て詳細に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Two embodiments of the present invention will be described in detail below with reference to the drawings.

【0032】(第1の実施例)(First embodiment)

【0033】1.計算機システムの構成 図1は、本発明の第1の実施例に係る計算機システムの
構成図である。図1において、各プロセッサ100−i
(i=1,2)は、メインメモリ200を共用してい
る。また、各プロセッサ100−iにはキャッシュ30
0−iが接続されている。さらに、メインメモリ200
には、仮想計算機モニタ(VMM)210およびOS−
k(k=1,2,3,4)がローディングされている。
1. Configuration of Computer System FIG. 1 is a configuration diagram of a computer system according to a first embodiment of the present invention. In FIG. 1, each processor 100-i
(I = 1, 2) shares the main memory 200. Further, each processor 100-i has a cache 30.
0-i are connected. In addition, the main memory 200
Includes a virtual machine monitor (VMM) 210 and an OS-
k (k = 1, 2, 3, 4) is loaded.

【0034】本実施例は、仮想計算機上のOSがプロセ
ッサ100−iにおいて発行したPURGE CACH
E命令およびFLUSH CACHE命令を、プロセッ
サ100−iにおいて走行中のOSと同一のOSが走行
中のプロセッサ100−jのキャッシュ300−jに限
定して実行する点に特徴がある。また、本実施例は、プ
ロセッサ100−iにおけるOSの切り替え時に、キャ
ッシュ300を初期化して次のOSを起動する点にも特
徴がある。
In this embodiment, the PURGE CACH issued by the OS on the virtual machine in the processor 100-i is used.
The E instruction and the FLUSH CACHE instruction are characterized in that the same OS as the running OS in the processor 100-i executes only in the cache 300-j of the running processor 100-j. The present embodiment is also characterized in that the cache 300 is initialized and the next OS is started when the OS is switched in the processor 100-i.

【0035】2.キャッシュ制御命令の実行 次に、図2を用いて、本実施例の仮想計算機上のOSが
発行したキャッシュ制御命令の実行動作を説明する。図
2は、図1のキャッシュ300−i(i=1,2)の詳
細な構成を示す。
2. Execution of Cache Control Instruction Next, the execution operation of the cache control instruction issued by the OS on the virtual machine of this embodiment will be described with reference to FIG. FIG. 2 shows a detailed configuration of the cache 300-i (i = 1, 2) shown in FIG.

【0036】図2において、要求VMレジスタ210−
i(i=1,2)は、PURGECACHE命令あるい
はFLUSH CACHE命令を発行したOSの識別子
を保持するレジスタである。走行VMレジスタ220−
iは、プロセッサ100−iにおいて走行中のOSの識
別子を保持するレジスタである。
In FIG. 2, the request VM register 210-
i (i = 1, 2) is a register that holds the identifier of the OS that issued the PURGECACHE command or the FLUSH CACHE command. Running VM register 220-
i is a register that holds the identifier of the OS running in the processor 100-i.

【0037】仮想計算機モニタ(VMM)210は、各
OSに1以上の値を識別子として付与しており、OSの
起動時にデータ線400−iを通して、キャッシュ30
0−iにこのOSの識別子を送る。送られたOSの識別
子が、走行VMレジスタ220−iに格納される。ま
た、仮想計算機モニタ(VMM)210自身が実行中の
ときには、データ線400−iには0が送られ、走行V
Mレジスタ220−iには0が格納されることになる。
The virtual machine monitor (VMM) 210 gives each OS a value of 1 or more as an identifier, and when the OS is started, the cache 30 is passed through the data line 400-i.
The identifier of this OS is sent to 0-i. The sent OS identifier is stored in the running VM register 220-i. Further, when the virtual machine monitor (VMM) 210 itself is executing, 0 is sent to the data line 400-i, and the running V
0 is stored in the M register 220-i.

【0038】キャッシュ300−i内の比較器230−
i、セレクタ240−i、および制御回路250−iの
動作については、後で詳しく述べる。
Comparator 230-in cache 300-i
The operations of i, the selector 240-i, and the control circuit 250-i will be described in detail later.

【0039】タグ260−iおよびキャッシュメモリ2
70−iは、それぞれ複数のエントリから構成される。
タグ260−iの各エントリとキャッシュメモリ270
−iの各エントリとは、1対1に対応付けられている。
タグ260−iの各エントリは、有効ビット(V)とア
ドレスフィールドから構成される。有効ビット(V)が
1(有効)のとき、このエントリのアドレスフィールド
に格納されているアドレスで指し示されるメインメモリ
200上のバッファが、該エントリに対応するキャッシ
ュメモリ270のエントリに保持されていることを示
す。また、有効ビット(V)が0(無効)のとき、キャ
ッシュメモリ270の対応するエントリが空き状態であ
ることを示す。
Tag 260-i and cache memory 2
Each 70-i is composed of a plurality of entries.
Each entry of tag 260-i and cache memory 270
There is a one-to-one correspondence with each entry of -i.
Each entry of the tag 260-i is composed of a valid bit (V) and an address field. When the valid bit (V) is 1 (valid), the buffer in the main memory 200 indicated by the address stored in the address field of this entry is held in the entry of the cache memory 270 corresponding to the entry. Indicates that When the valid bit (V) is 0 (invalid), it indicates that the corresponding entry in the cache memory 270 is empty.

【0040】(a)PURGE CACHE命令の実行 プロセッサ100−1において走行中のOS−1がPU
RGE CACHE命令を発行したときの動作を説明す
る。
(A) Execution of PURGE CACHE instruction In the processor 100-1, the running OS-1 is PU
The operation when the RGE CACHE instruction is issued will be described.

【0041】まず、プロセッサ100−1は、信号線4
10−1を介して、制御回路250−1にパージ要求信
号を送る。パージ要求信号を受け取った制御回路250
−1は、タグ260−1の全てのエントリの有効ビット
(V)に0(無効)を格納し、キャッシュメモリ270
−1の全てのエントリを空き状態とする。その後、制御
回路250−1は、パージ要求信号を信号線420−1
に送るとともに、データ線400−1を介して受け取っ
たOS−1の識別子である1をデータ線430−1に送
る。
First, the processor 100-1 uses the signal line 4
A purge request signal is sent to the control circuit 250-1 via 10-1. Control circuit 250 that received the purge request signal
-1 stores 0 (invalid) in the valid bit (V) of all entries of the tag 260-1, and the cache memory 270
All the entries of -1 are made empty. Thereafter, the control circuit 250-1 sends a purge request signal to the signal line 420-1.
In addition to sending to the data line 400-1, the OS-1 identifier 1 received via the data line 400-1 is sent to the data line 430-1.

【0042】この結果、キャッシュ300−2内のデー
タ線440−2にはPURGE CACHE命令をプロ
セッサ100−1において発行したOS−1の識別子で
ある1が送られ、要求VMレジスタ210−2に格納さ
れる。また、キャッシュ300−2には、信号線450
−2を介してパージ要求信号が送られる。
As a result, 1 which is the identifier of OS-1 which issued the PURGE CACHE instruction in the processor 100-1 is sent to the data line 440-2 in the cache 300-2 and stored in the request VM register 210-2. To be done. Further, a signal line 450 is connected to the cache 300-2.
The purge request signal is sent via -2.

【0043】比較器230−2は、PURGE CAC
HE命令を発行したOSの識別子を保持する要求VMレ
ジスタ210−2とプロセッサ100−2で走行中のO
Sの識別子を保持する走行VMレジスタ220−2との
値を比較し、比較結果を出力する。セレクタ240−2
は、比較器230による比較結果が同一OSを示す場合
に限って、信号線450−2から入力されたパージ要求
信号を制御回路250−2に送る。
The comparator 230-2 is a PURGE CAC.
A request VM register 210-2 holding the identifier of the OS that issued the HE instruction and an O running on the processor 100-2.
The value of the running VM register 220-2 holding the identifier of S is compared, and the comparison result is output. Selector 240-2
Sends the purge request signal input from the signal line 450-2 to the control circuit 250-2 only when the comparison result by the comparator 230 indicates the same OS.

【0044】パージ要求信号を送られた制御回路250
−2は、タグ260−2の全てのエントリの有効ビット
(V)に0(無効)を格納することにより、キャッシュ
メモリ270−2の全てのエントリを空き状態とする。
The control circuit 250 to which the purge request signal is sent
-2 stores 0 (invalid) in the valid bit (V) of all the entries of the tag 260-2 to make all the entries of the cache memory 270-2 empty.

【0045】(b)FLUSH CACHE命令の実行 プロセッサ−1において走行中のOS−1がFLUSH
CACHE命令を発行したときの動作を説明する。
(B) Execution of FLUSH CACHE instruction The OS-1 running on the processor-1 is FLUSH
The operation when the CACHE instruction is issued will be described.

【0046】まず、上述のPURGE CACHE命令
の場合と同様に、プロセッサ100−1は、信号線41
0−1を介して、制御回路250−1にフラッシュ要求
信号を送る。フラッシュ要求信号を受け取った制御回路
250−1は、タグ260−1のエントリの有効ビット
(V)が1(有効)を示すエントリのアドレスフィール
ドが指し示すメインメモリ200上の領域に、キャッシ
ュメモリ270−1が保持するバッファの内容を、デー
タ線460−1を介して格納する。それとともに、タグ
260−1の全てのエントリの有効ビット(V)に0
(無効)を格納し、キャッシュメモリ270−1の全て
のエントリを空き状態とする。その後、制御回路250
−1は、フラッシュ要求信号を信号線420−1に送る
とともに、データ線400−1を介して受け取ったOS
−1の識別子である1をデータ線430−1に送る。
First, as in the case of the above-mentioned PURGE CACHE instruction, the processor 100-1 has the signal line 41.
A flash request signal is sent to the control circuit 250-1 via 0-1. Upon receiving the flush request signal, the control circuit 250-1 places the cache memory 270-in the area on the main memory 200 indicated by the address field of the entry in which the valid bit (V) of the entry of the tag 260-1 indicates 1 (valid). The contents of the buffer held by 1 are stored via the data line 460-1. At the same time, 0 is set in the valid bit (V) of all the entries of the tag 260-1.
(Invalid) is stored and all the entries in the cache memory 270-1 are made empty. After that, the control circuit 250
-1 sends the flash request signal to the signal line 420-1 and receives the OS via the data line 400-1.
-1, which is the identifier of -1, is sent to the data line 430-1.

【0047】この結果、キャッシュ300−2内のデー
タ線440−2には、FLUSHCACHE命令をプロ
セッサ100−1において発行したOS−1の識別子で
ある1が送られ、要求VMレジスタ210−2に格納さ
れる。また、キャッシュ300−2には、信号線450
−2を介してフラッシュ要求信号が送られる。
As a result, the identifier 1 of the OS-1 that issued the FLUSHCACHE instruction in the processor 100-1 is sent to the data line 440-2 in the cache 300-2 and stored in the request VM register 210-2. To be done. Further, a signal line 450 is connected to the cache 300-2.
The flash request signal is sent via -2.

【0048】比較器230−2は、FLUSH CAC
HE命令を発行したOSの識別子を保持する要求VMレ
ジスタ210−2とプロセッサ100−2で走行中のO
Sの識別子を保持する走行VMレジスタ220−2との
値を比較し、比較結果を出力する。セレクタ240−2
は、比較器230による比較結果が同一OSを示す場合
に限って、信号線450−2から入力されたフラッシュ
要求信号を制御回路250−2に送る。
The comparator 230-2 is a FLUSH CAC.
A request VM register 210-2 holding the identifier of the OS that issued the HE instruction and an O running on the processor 100-2.
The value of the running VM register 220-2 holding the identifier of S is compared, and the comparison result is output. Selector 240-2
Sends the flash request signal input from the signal line 450-2 to the control circuit 250-2 only when the comparison result by the comparator 230 indicates the same OS.

【0049】フラッシュ要求信号を送られた制御回路2
50−2は、タグ260−2のエントリの有効ビット
(V)が1(有効)を示すエントリのアドレスフィール
ドが指し示すメインメモリ200上の領域に、キャッシ
ュメモリ270−2が保持するバッファの内容を、デー
タ線460−2を介して格納する。また、タグ260−
2の全てのエントリの有効ビット(V)に0(無効)を
格納することにより、キャッシュメモリ270−2の全
てのエントリを空き状態とする。
Control circuit 2 to which the flash request signal is sent
50-2 stores the contents of the buffer held by the cache memory 270-2 in the area on the main memory 200 indicated by the address field of the entry in which the valid bit (V) of the entry of the tag 260-2 indicates 1 (valid). , Through the data line 460-2. Also, the tag 260-
By storing 0 (invalid) in the valid bit (V) of all entries of No. 2, all entries of the cache memory 270-2 are made empty.

【0050】3.走行OSの切り替え処理 図3は、本実施例の仮想計算機モニタ(VMM)210
による走行OSの切り替え処理のフローチャートであ
る。
3. Switching Processing of Running OS FIG. 3 shows a virtual machine monitor (VMM) 210 of this embodiment.
5 is a flowchart of a traveling OS switching process by the.

【0051】プロセッサ100−iにおけるOS−kの
走行(ステップ3000)が、タイムスライスの終了等
により中断される(ステップ3010)と、タイマ割込
みの発生等により、仮想計算機モニタ(VMM)210
に制御が渡る。仮想計算機モニタ(VMM)210は、
そのスケジューリングに基づいて、次に走行させるOS
−mを選択する(ステップ3020)。そして、この選
択したOS−mがプロセッサ100−iで最後に走行し
たOS−kと同一かを判定(ステップ3030)する。
When the running of the OS-k (step 3000) in the processor 100-i is interrupted (step 3010) due to the end of the time slice or the like (step 3010), the virtual machine monitor (VMM) 210 is generated due to the occurrence of a timer interrupt or the like.
Control over. The virtual machine monitor (VMM) 210 is
OS to run next based on the scheduling
-M is selected (step 3020). Then, it is determined whether the selected OS-m is the same as the OS-k last run on the processor 100-i (step 3030).

【0052】判定の結果、同一のOSであれば、選択し
たOS−mを起動(ステップ3050)する。同一のO
Sであるから、キャッシュはそのままである。
As a result of the judgment, if the OSs are the same, the selected OS-m is started (step 3050). Same O
Since S, the cache remains unchanged.

【0053】また、判定の結果、異なるOSであれば、
FLUSH CACHE命令を実行して、プロセッサ1
00−iのキャッシュ300−iの内容をメインメモリ
200に複写した後、無効化して(ステップ304
0)、選択したOS−mを起動(ステップ3050)す
る。
As a result of the determination, if the OS is different,
The FLUSH CACHE instruction is executed to execute the processor 1
After copying the contents of the cache 300-i of 00-i to the main memory 200, it is invalidated (step 304
0), start the selected OS-m (step 3050).

【0054】以上のようにすれば、プロセッサ100−
iにおけるOS−mの起動開始時には、キャッシュ30
0−iの内容は全て無効であるか、またはもともとのO
S−mのメモリ情報のみを有することになる。すなわ
ち、キャッシュ300−iは、OS−m以外のメモリ情
報は有しない。従って、走行中のOS−mがFLUSH
With the above arrangement, the processor 100-
At the start of booting OS-m in i, the cache 30
The contents of 0-i are either all invalid or the original O
It will have only S-m memory information. That is, the cache 300-i has no memory information other than OS-m. Therefore, the running OS-m is FLUSH

【0055】CACHE命令あるいはPURGE CA
CHE命令を発行しても、他のOSのメモリの内容には
何ら影響を与えない。
CACHE instruction or PURGE CA
Issuing the CHE command does not affect the contents of the memory of other OSs.

【0056】以上説明したように、本実施例によれば、
マルチプロセッサ構成の計算機において、仮想計算機上
のOSが発行したキャッシュの無効化命令を効率良く実
行可能な仮想計算機システムを提供できる。
As described above, according to this embodiment,
In a computer having a multiprocessor configuration, it is possible to provide a virtual computer system that can efficiently execute a cache invalidation instruction issued by an OS on a virtual computer.

【0057】また、本実施例によれば、プロセッサにお
ける走行OSの切り替え時に、キャッシュを効率良く制
御可能な仮想計算機システムを提供できる。
Further, according to this embodiment, it is possible to provide a virtual computer system capable of efficiently controlling the cache when switching the running OS in the processor.

【0058】なお、仮想計算機システムに限らず、1台
の計算機上で複数のOSが走行可能な計算機システム
に、本発明が適用できることは明らかであろう。また、
仮想計算機システムに限らず、1台の計算機上で複数の
プログラムが実行される一般の計算機システムに、本発
明が適用できることも明らかであろう。
It will be apparent that the present invention can be applied not only to the virtual computer system but also to a computer system in which a plurality of OSs can run on one computer. Also,
It will be apparent that the present invention can be applied to not only the virtual computer system but also a general computer system in which a plurality of programs are executed on one computer.

【0059】さらに、本実施例では、キャッシュのパー
ジおよびフラッシュは、キャッシュ全体に対して実行さ
れるとしたが、キャッシュの一部(例えば、特定のペー
ジ)に対して実行される場合にも、本発明が適用できる
ことは明らかであろう。
Further, in the present embodiment, the purging and flushing of the cache is executed for the entire cache, but even when it is executed for a part of the cache (for example, a specific page), It will be clear that the invention is applicable.

【0060】(第2の実施例)次に、本発明の第2の実
施例を説明する。本実施例においても、図1に示す計算
機システムの構成を前提とする。ただし、本実施例は、
キャッシュ300−iをOS間で共用し、仮想計算機上
のOSがプロセッサ100−iにおいて発行したPUR
GE CACHE命令およびFLUSH CACHE命
令を、プロセッサ100−iにおいて走行中のOSの識
別子が付与されたキャッシュ300−iのエントリに限
定して実行する点に特徴がある。
(Second Embodiment) Next, a second embodiment of the present invention will be described. The present embodiment also assumes the configuration of the computer system shown in FIG. However, in this embodiment,
A PUR issued by the OS on the virtual machine in the processor 100-i by sharing the cache 300-i between the OSs
It is characterized in that the GE CACHE instruction and the FLUSH CACHE instruction are executed only in the entry of the cache 300-i to which the identifier of the OS running in the processor 100-i is given.

【0061】図4を用いて、仮想計算機上のOSが発行
したキャッシュ制御命令の実行動作を説明する。図4
は、本実施例におけるキャッシュ300−i(i=1,
2)の詳細な構成を示す。
The execution operation of the cache control instruction issued by the OS on the virtual machine will be described with reference to FIG. Figure 4
Is a cache 300-i (i = 1, 1 in this embodiment.
The detailed configuration of 2) is shown.

【0062】図4において、仮想計算機モニタ(VM
M)210は、各OSに1以上の値を識別子として付与
しており、OSの起動時にデータ線400−iを通し
て、キャッシュ300−iにこのOSの識別子を送る。
また、仮想計算機モニタ(VMM)210自身が実行中
のときには、データ線400−iには0が送られるもの
とする。制御回路250−iの動作については、後で詳
しく述べる。
In FIG. 4, a virtual computer monitor (VM
M) 210 gives each OS a value of 1 or more as an identifier, and sends the identifier of this OS to the cache 300-i through the data line 400-i when the OS is activated.
Further, when the virtual machine monitor (VMM) 210 itself is executing, 0 is sent to the data line 400-i. The operation of the control circuit 250-i will be described in detail later.

【0063】タグ260−iおよびキャッシュメモリ2
70−iは、それぞれ複数のエントリから構成される。
タグ260−iの各エントリとキャッシュメモリ270
−iの各エントリとは、1対1に対応付けられている。
タグ260−iの各エントリは、有効ビット(V)とア
ドレスフィールドと仮想計算機識別子(VMID)フィ
ールドとから構成される。
Tag 260-i and cache memory 2
Each 70-i is composed of a plurality of entries.
Each entry of tag 260-i and cache memory 270
There is a one-to-one correspondence with each entry of -i.
Each entry of the tag 260-i is composed of a valid bit (V), an address field and a virtual machine identifier (VMID) field.

【0064】有効ビット(V)が1(有効)のとき、こ
のエントリのアドレスフィールドに格納されているアド
レスで指し示されるメインメモリ200上のバッファ
が、該エントリに対応するキャッシュメモリ270のエ
ントリに保持されていることを示す。また、制御回路2
50−iは、このエントリを書き込んだときプロセッサ
100−iで走行中であったOSの識別子(これは、デ
ータ線400−iから制御回路250−iに入力されて
いる)を、そのエントリのVMIDフィールドに格納す
る。さらに、有効ビット(V)が0(無効)のとき、キ
ャッシュメモリ270の対応するエントリが空き状態で
あることを示す。
When the valid bit (V) is 1 (valid), the buffer in the main memory 200 pointed to by the address stored in the address field of this entry becomes the entry of the cache memory 270 corresponding to the entry. Indicates that it is held. In addition, the control circuit 2
50-i writes the identifier of the OS running on the processor 100-i when this entry is written (this is input to the control circuit 250-i from the data line 400-i) to that entry. Store in the VMID field. Further, when the valid bit (V) is 0 (invalid), it indicates that the corresponding entry in the cache memory 270 is empty.

【0065】(a)PURGE CACHE命令の実行 プロセッサ100−1において走行中のOS−1がPU
RGE CACHE命令を発行したときの動作を説明す
る。
(A) Execution of PURGE CACHE instruction In the processor 100-1, the running OS-1 is PU
The operation when the RGE CACHE instruction is issued will be described.

【0066】まず、プロセッサ100−1は、信号線4
10−1を介して、制御回路250−1にパージ要求信
号を送る。パージ要求信号を受け取った制御回路250
−1は、タグ260−1のVMIDフィールドの値がデ
ータ線400−1から送られた1であるエントリの有効
ビット(V)に、0(無効)を格納する。これにより、
OS−1が使用していたキャッシュメモリ270−1の
エントリが、空き状態とされる。その後、制御回路25
0−1は、パージ要求信号を信号線420−1に送ると
ともに、データ線400−1を介して受け取ったOS−
1の識別子である1をデータ線430−1に送る。
First, the processor 100-1 uses the signal line 4
A purge request signal is sent to the control circuit 250-1 via 10-1. Control circuit 250 that received the purge request signal
-1 stores 0 (invalid) in the valid bit (V) of the entry in which the value of the VMID field of the tag 260-1 is 1 sent from the data line 400-1. This allows
The entry of the cache memory 270-1 used by the OS-1 is made empty. After that, the control circuit 25
0-1 sends a purge request signal to the signal line 420-1 and receives OS- received via the data line 400-1.
The identifier 1 of 1 is sent to the data line 430-1.

【0067】この結果、キャッシュ300−2内のデー
タ線440−2にはPURGE CACHE命令をプロ
セッサ100−1において発行したOS−1の識別子で
ある1が送られる。また、キャッシュ300−2には、
信号線450−2を介してパージ要求信号が送られる。
As a result, the identifier 1 of the OS-1 that issued the PURGE CACHE instruction in the processor 100-1 is sent to the data line 440-2 in the cache 300-2. In addition, in the cache 300-2,
A purge request signal is sent via the signal line 450-2.

【0068】パージ要求信号を送られた制御回路250
−2は、タグ260−2のVMIDフィールドの値がデ
ータ線440−2から送られた1であるエントリの有効
ビット(V)に、0(無効)を格納する。これにより、
OS−1が使用していたキャッシュメモリ270−2の
エントリが、空き状態となる。
The control circuit 250 to which the purge request signal is sent
-2 stores 0 (invalid) in the valid bit (V) of the entry whose VMID field value of the tag 260-2 is 1 sent from the data line 440-2. This allows
The entry of the cache memory 270-2 used by the OS-1 becomes empty.

【0069】(b)FLUSH CACHE命令の実行 プロセッサ−1において走行中のOS−1がFLUSH
CACHE命令を発行したときの動作を説明する。
(B) Execution of FLUSH CACHE instruction When OS-1 running on processor-1 is FLUSH
The operation when the CACHE instruction is issued will be described.

【0070】まず、上述のPURGE CACHE命令
の場合と同様に、プロセッサ100−1は、信号線41
0−1を介して、制御回路250−1にフラッシュ要求
信号を送る。フラッシュ要求信号を受け取った制御回路
250−1は、タグ260−1のエントリの有効ビット
(V)が1(有効)でありかつVMIDフィールドの値
がデータ線400−1から送られた1であるエントリの
アドレスフィールドが指し示すメインメモリ200上の
領域に、キャッシュメモリ270−1が保持するバッフ
ァの内容を、データ線460−1を介して格納する。そ
れとともに、このエントリの有効ビット(V)に0(無
効)を格納し、OS−1が使用していたキャッシュメモ
リ270−1のエントリを空き状態とする。その後、制
御回路250−1は、フラッシュ要求信号を信号線42
0−1に送るとともに、データ線400−1を介して受
け取ったOS−1の識別子である1をデータ線430−
1に送る。
First, as in the case of the above-mentioned PURGE CACHE instruction, the processor 100-1 uses the signal line 41
A flash request signal is sent to the control circuit 250-1 via 0-1. The control circuit 250-1 which has received the flush request signal has the valid bit (V) of the entry of the tag 260-1 being 1 (valid) and the value of the VMID field being 1 sent from the data line 400-1. The contents of the buffer held by the cache memory 270-1 are stored in the area on the main memory 200 indicated by the address field of the entry via the data line 460-1. At the same time, 0 (invalid) is stored in the valid bit (V) of this entry, and the entry of the cache memory 270-1 used by OS-1 is made empty. After that, the control circuit 250-1 sends the flash request signal to the signal line 42.
0-1 which is the identifier of OS-1 received via the data line 400-1 while being sent to the data line 430-.
Send to 1.

【0071】この結果、キャッシュ300−2内のデー
タ線440−2には、FLUSHCACHE命令をプロ
セッサ100−1において発行したOS−1の識別子で
ある1が送られる。また、キャッシュ300−2には、
信号線450−2を介してフラッシュ要求信号が送られ
る。
As a result, 1 which is the identifier of OS-1 which issued the FLUSHCACHE instruction in the processor 100-1 is sent to the data line 440-2 in the cache 300-2. In addition, in the cache 300-2,
A flash request signal is sent via the signal line 450-2.

【0072】フラッシュ要求信号を送られた制御回路2
50−2は、タグ260−2のエントリの有効ビット
(V)が1(有効)であり、かつVMIDフィールドの
値がデータ線440−2から送られた1であるエントリ
のアドレスフィールドが指し示すメインメモリ200上
の領域に、キャッシュメモリ270−2が保持するバッ
ファの内容を、データ線460−2を介して格納する。
また、このエントリの有効ビット(V)に0(無効)を
格納することにより、OS−1が使用していたキャッシ
ュメモリ270−2のエントリを空き状態とする。
Control circuit 2 to which the flash request signal is sent
50-2 is a main pointed to by the address field of the entry whose valid bit (V) of the tag 260-2 is 1 (valid) and whose VMID field value is 1 sent from the data line 440-2. The contents of the buffer held by the cache memory 270-2 are stored in the area on the memory 200 via the data line 460-2.
Further, by storing 0 (invalid) in the valid bit (V) of this entry, the entry of the cache memory 270-2 used by OS-1 is made empty.

【0073】以上のようにして、本実施例によれば、キ
ャッシュを複数のOS間で効率良く共用可能な仮想計算
機システムを提供できる。
As described above, according to this embodiment, it is possible to provide a virtual computer system in which a cache can be efficiently shared among a plurality of OSs.

【0074】[0074]

【発明の効果】本発明によれば、マルチプロセッサ構成
の計算機において、仮想計算機上のOSが発行したキャ
ッシュの無効化命令を、効率良く実行することが可能な
仮想計算機システムが提供される。また、各プロセッサ
における走行OSの切り替え時に、キャッシュを効率良
く制御することが可能な仮想計算機システムが提供され
る。
According to the present invention, there is provided a virtual computer system capable of efficiently executing a cache invalidation instruction issued by an OS on a virtual computer in a computer having a multiprocessor configuration. Further, there is provided a virtual computer system capable of efficiently controlling the cache when switching the running OS in each processor.

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

【図1】実施例の計算機システムの構成図。FIG. 1 is a configuration diagram of a computer system according to an embodiment.

【図2】第1の実施例におけるキャッシュ制御命令の実
行回路図。
FIG. 2 is an execution circuit diagram of a cache control instruction according to the first embodiment.

【図3】第1の実施例における走行OSの切り替え処理
のフローチャート。
FIG. 3 is a flowchart of a traveling OS switching process according to the first embodiment.

【図4】第2の実施例におけるキャッシュ制御命令の実
行回路図。
FIG. 4 is an execution circuit diagram of a cache control instruction in the second embodiment.

【符号の説明】[Explanation of symbols]

100−i:プロセッサ、200:メインメモリ、21
0:仮想計算機モニタ,300−i:キャッシュ。
100-i: processor, 200: main memory, 21
0: virtual machine monitor, 300-i: cache.

───────────────────────────────────────────────────── フロントページの続き (72)発明者 神 好秀 神奈川県横浜市戸塚区戸塚町5030番地 株 式会社日立製作所ソフトウェア開発本部内 ─────────────────────────────────────────────────── ─── Continuation of the front page (72) Inventor Yoshihide Kami 5030 Totsuka-cho, Totsuka-ku, Yokohama-shi, Kanagawa Prefecture Hitachi Ltd. Software Development Division

Claims (10)

【特許請求の範囲】[Claims] 【請求項1】複数のプロセッサと、前記複数のプロセッ
サによって共有されるメインメモリと、前記プロセッサ
毎に設けられたキャッシュとを有する1台の計算機上で
複数のオペレーティング・システムが走行する仮想計算
機システムにおけるキャッシュの制御装置であって、 前記複数のプロセッサ中の第1のプロセッサにおいて走
行中のオペレーティング・システムが、キャッシュの内
容を無効化する命令を発行したことに応じて、前記第1
のプロセッサのキャッシュの内容を無効化する手段と、 前記第1のプロセッサを除く各プロセッサにおいて、前
記走行中のオペレーティング・システムが走行中か否か
を判定する手段と、 前記判定が肯定的であるプロセッサのキャッシュの内容
を無効化する手段とを備えたことを特徴とするキャッシ
ュの制御装置。
1. A virtual computer system in which a plurality of operating systems run on one computer having a plurality of processors, a main memory shared by the plurality of processors, and a cache provided for each processor. In the first processor of the plurality of processors, the first controller responsive to an instruction for invalidating the contents of the cache issued by an operating system running in the first processor.
Means for invalidating the cache contents of the processor, a means for determining whether or not the running operating system is running in each processor except the first processor, and the determination is positive. And a means for invalidating the contents of the cache of the processor.
【請求項2】プロセッサとメインメモリとキャッシュと
を有する1台の計算機上で複数のオペレーティング・シ
ステムが走行する仮想計算機システムにおけるキャッシ
ュの制御装置であって、 前記プロセッサにおいて、次に走行させようとする第1
のオペレーティング・システムが、前記プロセッサで最
後に走行した第2のオペレーティング・システムと同一
か否かを判定する手段と、 前記判定結果が肯定的であることに応じて、前記キャッ
シュの内容を前記メインメモリに複写することなく、前
記第1のオペレーティング・システムを前記プロセッサ
において走行させる手段と、 前記判定結果が否定的であることに応じて、前記キャッ
シュの内容を前記メインメモリに複写して、前記第1の
オペレーティング・システムを前記プロセッサにおいて
走行させる手段とを備えたことを特徴とするキャッシュ
の制御装置。
2. A cache control device in a virtual computer system in which a plurality of operating systems run on one computer having a processor, a main memory and a cache, wherein the processor attempts to run next. First to do
Means for determining whether the operating system of the second operating system is the same as the second operating system last run on the processor, and the content of the cache is stored in the main memory in response to a positive result of the determination. Means for running the first operating system on the processor without copying to memory, and copying the contents of the cache to the main memory in response to a negative result of the determination, And a means for running a first operating system on the processor.
【請求項3】プロセッサとメインメモリと複数エントリ
を備えたキャッシュとを有する1台の計算機上で複数の
オペレーティング・システムが走行する仮想計算機シス
テムにおけるキャッシュの制御装置であって、 前記キャッシュの各エントリがいずれのオペレーティン
グ・システムで使用されているかを示す識別子を、各エ
ントリごとに記憶するための記憶手段と、 前記メインメモリの一部を前記キャッシュメモリのエン
トリに登録するとき、前記プロセッサで走行中のオペレ
ーティング・システムの識別子を前記記憶手段の対応す
るエントリの領域に書き込む手段と、 前記プロセッサにおいて走行中のオペレーティング・シ
ステムが、キャッシュの内容を無効化する命令を発行し
たことに応じて、前記走行中のオペレーティング・シス
テムの識別子が付与されたキャッシュメモリのエントリ
を無効化する手段とを備えたことを特徴とするキャッシ
ュの制御装置。
3. A cache controller in a virtual computer system in which a plurality of operating systems run on one computer having a processor, a main memory, and a cache having a plurality of entries, each entry of the cache A storage unit for storing, for each entry, an identifier indicating which operating system is used, and when a part of the main memory is registered in the entry of the cache memory, the processor is running. Means for writing the identifier of the operating system in the area of the corresponding entry of the storage means, and the operating system running in the processor issuing a command to invalidate the contents of the cache. Operating system in Controller cache, wherein a beam identifier and means for invalidating an entry in the cache memory granted.
【請求項4】複数のプロセッサと、前記複数のプロセッ
サによって共有されるメインメモリと、前記プロセッサ
毎に設けられたキャッシュとを有する1台の計算機上で
複数のオペレーティング・システムが走行する仮想計算
機システムにおけるキャッシュの制御方法であって、 前記複数のプロセッサ中の第1のプロセッサにおいて走
行中のオペレーティング・システムが、キャッシュの内
容を無効化する命令を発行したことに応じて、前記第1
のプロセッサのキャッシュの内容を無効化するステップ
と、 前記第1のプロセッサを除く各プロセッサにおいて、前
記走行中のオペレーティング・システムが走行中か否か
を判定するステップと、 前記判定が肯定的であるプロセッサのキャッシュの内容
を無効化するステップとを備えたことを特徴とするキャ
ッシュの制御方法。
4. A virtual computer system in which a plurality of operating systems run on a single computer having a plurality of processors, a main memory shared by the plurality of processors, and a cache provided for each processor. In the first processor of the plurality of processors, wherein the operating system running in the first processor issues a command for invalidating the contents of the cache.
Invalidating the contents of the cache of the processor, the step of determining whether or not the running operating system is running in each processor except the first processor, and the determination is positive. And a step of invalidating the contents of the cache of the processor.
【請求項5】プロセッサとメインメモリとキャッシュと
を有する1台の計算機上で複数のオペレーティング・シ
ステムが走行する仮想計算機システムにおけるキャッシ
ュの制御方法であって、 前記プロセッサにおいて、次に走行させようとする第1
のオペレーティング・システムが、前記プロセッサで最
後に走行した第2のオペレーティング・システムと同一
か否かを判定するステップと、 前記判定結果が肯定的であることに応じて、前記キャッ
シュの内容を前記メインメモリに複写することなく、前
記第1のオペレーティング・システムを前記プロセッサ
において走行させるステップと、 前記判定結果が否定的であることに応じて、前記キャッ
シュの内容を前記メインメモリに複写して、前記第1の
オペレーティング・システムを前記プロセッサにおいて
走行させるステップとを備えたことを特徴とするキャッ
シュの制御方法。
5. A cache control method in a virtual computer system in which a plurality of operating systems run on one computer having a processor, a main memory, and a cache, wherein the processor attempts to run next. First to do
The operating system of the processor determines whether it is the same as the second operating system last run on the processor, and if the result of the determination is positive, the contents of the cache are stored in the main memory. Running the first operating system on the processor without copying to memory; copying the contents of the cache to the main memory in response to a negative determination result; A step of running a first operating system on the processor.
【請求項6】複数のプロセッサと、前記複数のプロセッ
サによって共有されるメインメモリと、前記プロセッサ
毎に設けられたキャッシュとを有する1台の計算機上で
複数のプログラムが実行される計算機システムにおける
キャッシュの制御装置であって、 前記複数のプロセッサ中の第1のプロセッサにおいて実
行中のプログラムが、キャッシュの内容を無効化する命
令を発行したことに応じて、前記第1のプロセッサのキ
ャッシュの内容を無効化する手段と、 前記第1のプロセッサを除く各プロセッサにおいて、前
記プログラムが実行中か否かを判定する手段と、 前記判定が肯定的であるプロセッサのキャッシュの内容
を無効化する手段とを備えたことを特徴とするキャッシ
ュの制御装置。
6. A cache in a computer system in which a plurality of programs are executed on a single computer having a plurality of processors, a main memory shared by the plurality of processors, and a cache provided for each processor. Of the cache of the first processor in response to the program being executed in the first processor of the plurality of processors issuing an instruction to invalidate the contents of the cache. Means for invalidating, means for determining whether or not the program is being executed in each processor except the first processor, and means for invalidating the cache contents of the processor for which the determination is positive. A cache control device characterized by being provided.
【請求項7】プロセッサとメインメモリとキャッシュと
を有する1台の計算機上で複数のプログラムが実行され
る計算機システムにおけるキャッシュの制御装置であっ
て、 前記プロセッサにおいて、次に実行させようとする第1
のプログラムが、前記プロセッサで最後に実行した第2
のプログラムと同一か否かを判定する手段と、 前記判定結果が肯定的であることに応じて、前記キャッ
シュの内容を前記メインメモリに複写することなく、前
記第1のプログラムを前記プロセッサにおいて実行させ
る手段と、 前記判定結果が否定的であることに応じて、前記キャッ
シュの内容を前記メインメモリに複写して、前記第1の
プログラムを前記プロセッサにおいて実行させる手段と
を備えたことを特徴とするキャッシュの制御装置。
7. A cache control device in a computer system in which a plurality of programs are executed on one computer having a processor, a main memory, and a cache, wherein the processor intends to execute the program next. 1
The second program last executed by the processor
Determining whether or not the program is the same as the above program, and executing the first program in the processor without copying the contents of the cache to the main memory in response to the affirmative result. And a means for causing the processor to execute the first program by copying the contents of the cache to the main memory in response to a negative result of the determination. Control unit for cache.
【請求項8】プロセッサとメインメモリと複数エントリ
を備えたキャッシュとを有する1台の計算機上で複数の
プログラムが実行される計算機システムにおけるキャッ
シュの制御装置であって、 前記キャッシュの各エントリがいずれのプログラムで使
用されているかを示す識別子を、各エントリごとに記憶
するための記憶手段と、 前記メインメモリの一部を前記キャッシュメモリのエン
トリに登録するとき、前記プロセッサで実行中のプログ
ラムの識別子を前記記憶手段の対応するエントリの領域
に書き込む手段と、 前記プロセッサにおいて実行中のプログラムが、キャッ
シュの内容を無効化する命令を発行したことに応じて、
前記実行中のプログラムの識別子が付与されたキャッシ
ュメモリのエントリを無効化する手段とを備えたことを
特徴とするキャッシュの制御装置。
8. A cache control device in a computer system in which a plurality of programs are executed on one computer having a processor, a main memory, and a cache having a plurality of entries, wherein each entry of the cache is Storage means for storing, for each entry, an identifier indicating whether it is used in the program, and an identifier of the program being executed by the processor when a part of the main memory is registered in the entry of the cache memory In a region of the corresponding entry of the storage means, and in response to the program running in the processor issuing an instruction to invalidate the contents of the cache,
And a means for invalidating an entry in the cache memory to which the identifier of the program being executed is added.
【請求項9】複数のプロセッサと、前記複数のプロセッ
サによって共有されるメインメモリと、前記プロセッサ
毎に設けられたキャッシュとを有する1台の計算機上で
複数のプログラムが実行される計算機システムにおける
キャッシュの制御方法であって、 前記複数のプロセッサ中の第1のプロセッサにおいて実
行中のプログラムが、キャッシュの内容を無効化する命
令を発行したことに応じて、前記第1のプロセッサのキ
ャッシュの内容を無効化するステップと、 前記第1のプロセッサを除く各プロセッサにおいて、前
記プログラムが実行中か否かを判定するステップと、 前記判定が肯定的であるプロセッサのキャッシュの内容
を無効化するステップとを備えたことを特徴とするキャ
ッシュの制御方法。
9. A cache in a computer system in which a plurality of programs are executed on a single computer having a plurality of processors, a main memory shared by the plurality of processors, and a cache provided for each processor. The method of controlling the cache content of the first processor in response to a program being executed in the first processor of the plurality of processors issuing an instruction to invalidate the content of the cache. A step of invalidating, a step of determining whether or not the program is being executed in each processor except the first processor, and a step of invalidating the cache contents of the processor for which the determination is positive. A method for controlling a cache, which comprises:
【請求項10】プロセッサとメインメモリとキャッシュ
とを有する1台の計算機上で複数のプログラムが実行さ
れる計算機システムにおけるキャッシュの制御方法であ
って、 前記プロセッサにおいて、次に実行させようとする第1
のプログラムが、前記プロセッサで最後に実行した第2
のプログラムと同一か否かを判定するステップと、 前記判定結果が肯定的であることに応じて、前記キャッ
シュの内容を前記メインメモリに複写することなく、前
記第1のプログラムを前記プロセッサにおいて実行させ
るステップと、 前記判定結果が否定的であることに応じて、前記キャッ
シュの内容を前記メインメモリに複写して、前記第1の
プログラムを前記プロセッサにおいて実行させるステッ
プとを備えたことを特徴とするキャッシュの制御方法。
10. A cache control method in a computer system in which a plurality of programs are executed on a single computer having a processor, a main memory, and a cache, wherein the processor attempts to execute the program next. 1
The second program last executed by the processor
Determining whether or not the program is the same as the above program, and executing the first program in the processor without copying the contents of the cache to the main memory in response to the affirmative result. And a step of causing the processor to execute the first program by copying the contents of the cache to the main memory in response to a negative result of the determination. How to control cache.
JP5269978A 1993-10-01 1993-10-01 Device and method for controlling cache Pending JPH07105091A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5269978A JPH07105091A (en) 1993-10-01 1993-10-01 Device and method for controlling cache

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5269978A JPH07105091A (en) 1993-10-01 1993-10-01 Device and method for controlling cache

Publications (1)

Publication Number Publication Date
JPH07105091A true JPH07105091A (en) 1995-04-21

Family

ID=17479875

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5269978A Pending JPH07105091A (en) 1993-10-01 1993-10-01 Device and method for controlling cache

Country Status (1)

Country Link
JP (1) JPH07105091A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005011336A (en) * 2003-05-29 2005-01-13 Matsushita Electric Ind Co Ltd Information processor capable of switching operation systems
JP2008293472A (en) * 2007-04-24 2008-12-04 Fujitsu Ltd Computer device and its cache recovery method
JP2009282920A (en) * 2008-05-26 2009-12-03 Toshiba Corp Cache memory device
US8161161B2 (en) 2005-10-31 2012-04-17 Sony Computer Entertainment, Inc. Information processing method and information processing apparatus
JP2013257911A (en) * 2004-07-30 2013-12-26 Intel Corp Holding of processor resource between architecture events
JP2015176426A (en) * 2014-03-17 2015-10-05 日本電気株式会社 Information processing device, information processing method, and information processing program
US9218287B2 (en) 2011-01-24 2015-12-22 Panasonic Intellectual Property Corporation Of America Virtual computer system, virtual computer control method, virtual computer control program, recording medium, and integrated circuit
JP2019185744A (en) * 2018-03-30 2019-10-24 インテル・コーポレーション Techniques for dynamic resource allocation among cryptographic domains
JP2020123382A (en) * 2020-04-16 2020-08-13 株式会社三菱Ufj銀行 Control program

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005011336A (en) * 2003-05-29 2005-01-13 Matsushita Electric Ind Co Ltd Information processor capable of switching operation systems
US9164901B2 (en) 2004-07-30 2015-10-20 Intel Corporation Maintaining processor resources during architectural events
US9152561B2 (en) 2004-07-30 2015-10-06 Intel Corporation Maintaining processor resources during architectural events
US10740249B2 (en) 2004-07-30 2020-08-11 Intel Corporation Maintaining processor resources during architectural events
JP2013257911A (en) * 2004-07-30 2013-12-26 Intel Corp Holding of processor resource between architecture events
US9164918B2 (en) 2004-07-30 2015-10-20 Intel Corporation Maintaining processor resources during architectural events
US10303620B2 (en) 2004-07-30 2019-05-28 Intel Corporation Maintaining processor resources during architectural events
US9996475B2 (en) 2004-07-30 2018-06-12 Intel Corporation Maintaining processor resources during architectural events
US9507730B2 (en) 2004-07-30 2016-11-29 Intel Corporation Maintaining processor resources during architectural events
US9086958B2 (en) 2004-07-30 2015-07-21 Intel Corporation Maintaining processor resources during architectural events
US8161161B2 (en) 2005-10-31 2012-04-17 Sony Computer Entertainment, Inc. Information processing method and information processing apparatus
JP2008293472A (en) * 2007-04-24 2008-12-04 Fujitsu Ltd Computer device and its cache recovery method
JP2009282920A (en) * 2008-05-26 2009-12-03 Toshiba Corp Cache memory device
US9218287B2 (en) 2011-01-24 2015-12-22 Panasonic Intellectual Property Corporation Of America Virtual computer system, virtual computer control method, virtual computer control program, recording medium, and integrated circuit
JP2015176426A (en) * 2014-03-17 2015-10-05 日本電気株式会社 Information processing device, information processing method, and information processing program
JP2019185744A (en) * 2018-03-30 2019-10-24 インテル・コーポレーション Techniques for dynamic resource allocation among cryptographic domains
JP2020123382A (en) * 2020-04-16 2020-08-13 株式会社三菱Ufj銀行 Control program

Similar Documents

Publication Publication Date Title
US5761729A (en) Validation checking of shared memory accesses
US8234642B2 (en) Filtering processor requests based on identifiers
US5802585A (en) Batched checking of shared memory accesses
US7073044B2 (en) Method and apparatus for sharing TLB entries
US5787480A (en) Lock-up free data sharing
US6456891B1 (en) System and method for transparent handling of extended register states
US5758183A (en) Method of reducing the number of overhead instructions by modifying the program to locate instructions that access shared data stored at target addresses before program execution
CN101097544B (en) Global overflow method for virtualized transactional memory
US7165164B2 (en) Method and apparatus including heuristic for sharing TLB entries
US5933598A (en) Method for sharing variable-grained memory of workstations by sending particular block including line and size of the block to exchange shared data structures
US8380907B2 (en) Method, system and computer program product for providing filtering of GUEST2 quiesce requests
US6233599B1 (en) Apparatus and method for retrofitting multi-threaded operations on a computer by partitioning and overlapping registers
US8255591B2 (en) Method and system for managing cache injection in a multiprocessor system
US8032716B2 (en) System, method and computer program product for providing a new quiesce state
US7020761B2 (en) Blocking processing restrictions based on page indices
US20140025922A1 (en) Providing multiple quiesce state machines in a computing environment
US7500049B2 (en) Providing a backing store in user-level memory
US8458438B2 (en) System, method and computer program product for providing quiesce filtering for shared memory
JP2618178B2 (en) Scalar / vector hybrid processing system, cross-query device for scalar / vector hybrid processing system, and method for maintaining data coherence
US5293602A (en) Multiprocessor computer system with dedicated synchronizing cache
US5896520A (en) Virtual computer system of multi-processor constitution
JP3862959B2 (en) Microprocessor load / store instruction control circuit and load / store instruction control method
US20060149940A1 (en) Implementation to save and restore processor registers on a context switch
JPH07105091A (en) Device and method for controlling cache
EP0404560B1 (en) multiprocessor system and method