JP2009266050A - Information processor - Google Patents

Information processor Download PDF

Info

Publication number
JP2009266050A
JP2009266050A JP2008116544A JP2008116544A JP2009266050A JP 2009266050 A JP2009266050 A JP 2009266050A JP 2008116544 A JP2008116544 A JP 2008116544A JP 2008116544 A JP2008116544 A JP 2008116544A JP 2009266050 A JP2009266050 A JP 2009266050A
Authority
JP
Japan
Prior art keywords
address
input
output device
central processing
virtual device
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
JP2008116544A
Other languages
Japanese (ja)
Inventor
Keisuke Toyama
圭介 十山
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 JP2008116544A priority Critical patent/JP2009266050A/en
Publication of JP2009266050A publication Critical patent/JP2009266050A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To cope with the problem of sharing a device driver which is software for controlling devices without changing nor deteriorating execution performance, in a multi-core environment in which generally, a plurality of concurrently-operating CPUs each of which is under a different OS from one another, while the number of devices such as I/O devices and accelerator IPs is restricted, and the devices are required to be shared among the plurality of CPUs or OSs. <P>SOLUTION: In order to solve the problem, a virtual machine control mechanism (VMM) assigns access to the devices from the plurality of OSs and gives an image occupying the devices to the OSs. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、情報処理装置、およびその装置上で動作するソフトウェアによって構成されるシステムに関するものである。   The present invention relates to an information processing apparatus and a system configured by software that operates on the apparatus.

マイクロプロセッサにおける集積化が進み、マルチコアシステムとして中央処理装置(CPU)を複数個搭載したマイクロプロセッサが開発されている。それら複数のCPUを搭載したマイクロプロセッサ上でアプリケーションプログラムを動作させる場合、基本システムであるオペレーティングシステム(OS)も複数になり、それらのOS間でのデータのやりとりや、別のOS上にある機能を複数のCPUやOSの存在を意識させないで実行する方式が必要になってくる。このような状況において、上記のようなマルチプロセッサシステム上でOSとアプリケーションの実行を制御するシステムとしては、例えば、特許文献1に開示されるように、マルチプロセッサ上でシングルプロセッサ向けOSと既存のアプリケーションを動作させ並列処理を実現できるようにする従来技術がある。このように物理的なCPUなどシステム構成資源とOSやアプリケーションとの結びつきを自由にする機構は仮想化と呼ばれ、サーバなどの分野で広く用いられるようになってきている。OSと連携して仮想化を実現し管理する機構は仮想マシン制御機構(VMM)と呼ばれている。入出力 (以下、「I/O」と呼ぶ。)を対象として仮想化し、複数のOSが入出力デバイスを共有する方式については、例えば特許文献2に開示される従来技術がある。   With the progress of integration in microprocessors, microprocessors equipped with a plurality of central processing units (CPUs) have been developed as multi-core systems. When an application program is operated on a microprocessor equipped with a plurality of CPUs, there are a plurality of operating systems (OS) as a basic system, data exchange between these OSs, and functions on different OSs. It is necessary to have a method for executing the process without being aware of the existence of a plurality of CPUs and OSs. In such a situation, as a system for controlling the execution of the OS and application on the multiprocessor system as described above, for example, as disclosed in Patent Document 1, an OS for a single processor and an existing one are used on the multiprocessor. There is a conventional technique that allows an application to operate and realize parallel processing. Such a mechanism for freely linking system configuration resources such as a physical CPU and an OS or application is called virtualization, and has been widely used in the field of servers and the like. A mechanism for realizing and managing virtualization in cooperation with the OS is called a virtual machine control mechanism (VMM). As a method for virtualizing input / output (hereinafter referred to as “I / O”) and sharing a plurality of OSs with input / output devices, there is, for example, a conventional technique disclosed in Patent Document 2.

また、I/Oを仮想化する方式には非特許文献1や非特許文献2に示されるように、大きく分けて、デバイスエミュレーション方式、仮想デバイスドライバ方式、直接I/O方式、の3つが存在する。デバイスエミュレーション方式は、I/Oデバイスのハードウェアをソフトウェアによって模擬する方法であり、ゲストOSのCPUからデバイスの制御レジスタにアクセスされるたびに制御をVMMに移行して動作をエミュレートするものである。この方式は、制御レジスタへのアクセスのたびにVMMに制御を移行する必要があり、原理的に実行オーバヘッドの大きいものである。   Further, as shown in Non-Patent Document 1 and Non-Patent Document 2, there are three types of methods for virtualizing I / O: a device emulation method, a virtual device driver method, and a direct I / O method. To do. The device emulation method is a method of simulating the hardware of an I / O device by software, and emulates the operation by transferring control to the VMM whenever the guest OS CPU accesses the device control register. is there. In this method, it is necessary to transfer control to the VMM every time the control register is accessed, and the execution overhead is large in principle.

仮想デバイス方式は、抽象的な仮想デバイスを定義してそれ専用のデバイスドライバ(仮想ドライバ)をゲストOSにインストールして利用する方式である。ここで実際のI/Oデバイスは管理OSによって占有され、仮想ドライバがVMMを経由して管理OSからアクセスすることになる。   The virtual device method is a method in which an abstract virtual device is defined and a dedicated device driver (virtual driver) is installed and used in the guest OS. Here, the actual I / O device is occupied by the management OS, and the virtual driver accesses from the management OS via the VMM.

直接I/O方式は、ゲストOSからI/Oデバイスに直接アクセスする方式であり、ゲストOSが通常のデバイスドライバとほぼ同じものを用いて物理デバイスを制御する。この方式では単一のOSがそのI/Oデバイスを占有している場合と同等の性能が出せるが、一般には複数のゲストOS間でデバイスを共有することはできない。非特許文献3に示されるように、物理デバイス側に複数のレジスタセットを持つなどして直接方式で共有の機能をもたせる方式を採ろうとするものもある。   The direct I / O method is a method in which an I / O device is directly accessed from a guest OS, and the guest OS controls a physical device using almost the same device driver as a normal device driver. This method can provide the same performance as when a single OS occupies the I / O device, but in general, a device cannot be shared among a plurality of guest OSes. As shown in Non-Patent Document 3, there is a method in which a physical device is provided with a shared function by having a plurality of register sets on the physical device side.

特開2003−345614号公報JP 2003-345614 A 特開2003−202999号公報JP 2003-202999 A Intel Virtualization Technologyの全貌 第2回 日経ITプロ 2006年 11月The whole picture of Intel Virtualization Technology 2nd Nikkei IT Pro November 2006 PRIMEQUEST仮想マシン機能 ホワイトペーパ 富士通株式会社 2007年4月PRIMEQUEST Virtual Machine Function White Paper Fujitsu Limited April 2007 日経バイト 2005年11月号 28ページ〜33ページNikkei Bytes November 2005, pages 28-33

単一チップ上に多数のCPUやIPが集積されたマルチコアシステムでは、複雑化した機能が互いに関連し、同時に動作するため、一つの物理的なデバイスを複数のコアおよびそれらコア上で動作するOSで共有する状況が起こる。この共有において、共有の主体となるOSは、時分割で動作していて一時期には一つのOSだけがアクティブ状態であるということではなく、それぞれが常にアクティブで並列に動作してI/Oデバイスを使用するという状況である。そのような場合、実デバイスを制御するための制御レジスタ群は一つであるので、何らかの形でそれらに対するアクセスを調停し、1セットの制御レジスタ群を仮想的に複数に見せて、複数のOSからのアクセスを処理する必要がある。   In a multi-core system in which a large number of CPUs and IPs are integrated on a single chip, complicated functions are related to each other and operate at the same time. Therefore, one physical device is operated by a plurality of cores and an OS that operates on these cores. Share situations occur. In this sharing, the OS that is the main subject of sharing does not mean that only one OS is active at a time, and that each is always active and operates in parallel. Is the situation of using. In such a case, since there is one control register group for controlling the real device, access to them is arbitrated in some form, and one set of control register group is virtually shown as a plurality of OSs. Need to handle access from.

上記のように、マルチコア環境においては、複数のCPUが同時に稼動し、そのそれぞれが別のOS下にあるということが一般的である。一方、I/O装置やアクセラレータIPなどのデバイスは個数が限られており、それら複数のCPUやOSで共有を行いたいという要求がある。そのような共有の状況としては、例えばハードディスクを装備したカーナビゲーションシステムにおいて、一つのハードディスク装置を地図データの格納と音楽データの格納に用い、それらを別々のプロセッサで動作する経路探索と音楽再生で同時にアクセスしたい場合などがある。   As described above, in a multi-core environment, it is common that a plurality of CPUs operate simultaneously, and each of them is under a different OS. On the other hand, the number of devices such as I / O devices and accelerator IPs is limited, and there is a demand to share these multiple CPUs and OSs. For example, in a car navigation system equipped with a hard disk, one hard disk device is used for storing map data and music data, and they are used for path search and music playback that operate on separate processors. Sometimes you want to access them at the same time.

この要求を実現するために、上述したデバイスエミュレーション方式や仮想デバイス方式では、一つの物理デバイスを管理するOSは、管理OSとして専用のものを一つ置き、それに任せることになる。この方式ではデバイスの割当てなどは簡潔に行えるが、仮想マシン制御機構(VMM)層での処理が大きくなったり、管理OS以外のゲストとなるOSでデバイスドライバを変更したりすることが必要になる。また、管理OSを経由するため処理性能が落ちることがありうる。   In order to realize this request, in the above-described device emulation method and virtual device method, an OS that manages one physical device is placed as a management OS and is left to that. In this method, device allocation and the like can be performed simply, but it is necessary to increase the processing in the virtual machine control mechanism (VMM) layer, or to change the device driver in the guest OS other than the management OS. . In addition, the processing performance may be deteriorated because it passes through the management OS.

直接I/O方式を用いればこのようなオーバヘッドは生じないが、現状ではI/Oデバイス側に複数の制御レジスタセットを持つなど共有用のハードウェア機構の実装を要求することになる。   If the direct I / O method is used, such an overhead does not occur, but at present, it is required to implement a shared hardware mechanism such as having a plurality of control register sets on the I / O device side.

上記の課題に対して本発明においては、第1のオペレーティングシステムを実行する第1の中央処理装置と、第2のオペレーティングシステムを実行する第2の中央処理装置と、前記第1及び第2の中央処理装置からアドレスが指定されアクセスされるメモリと、前記第1及び第2の中央処理装置からアドレスが指定されアクセスされる入出力装置とを具備し、前記入出力装置へのアクセスが前記第1のオペレーティングシステムに割り当てられている際において、前記第1の中央処理装置が前記入出力装置を指定するアドレスを出力した場合は、前記入出力装置を指定するアドレスを変換せずに前記入出力装置へアクセスし、前記第2の中央処理装置が前記入出力装置を指定するアドレスを出力した場合は、前記入出力装置を指定するアドレスを前記メモリ内に設けられた仮想デバイス領域に対応するアドレスに変換し、前記第2の中央処理装置が出力したデータを前記仮想デバイス領域に格納する。   In order to solve the above problems, in the present invention, a first central processing unit that executes a first operating system, a second central processing unit that executes a second operating system, and the first and second A memory that is designated and accessed by a central processing unit; and an input / output device that is designated and accessed by the first and second central processing units. If the first central processing unit outputs an address designating the input / output device when assigned to one operating system, the input / output is performed without converting the address designating the input / output device. When accessing the device and the second central processing unit outputs an address designating the input / output device, an address designating the input / output device is designated. Converts the scan into the address corresponding to the virtual device area provided in the memory, it stores the data in which the second central processing unit is output to the virtual device region.

または、複数のオペレーティングシステムを実行する複数の中央処理装置と、前記複数の中央処理装置からアドレスが指定されアクセスされるメモリと、前記複数の中央処理装置からアドレスが指定されアクセスされる制御レジスタを有する入出力装置と、前記複数の中央処理装置が出力するアドレスを所定の条件に従って変換するアドレス変換機構とを具備し、前記制御レジスタと前記メモリは、一つのアドレス空間に含まれ、前記メモリは、前記複数のオペレーティングシステムの夫々に対応する複数の仮想デバイス領域を有し、前記アドレス変換機構は、前記複数のオペレーティングシステムのうち前記入出力装置が割り当てられたオペレーティングシステムを実行する中央処理装置が前記制御レジスタを指定するアドレスを出力した場合、アドレス変換を行なわず、前記複数のオペレーティングシステムのうち前記入出力装置が割り当てられていないオペレーティングシステムを実行する中央処理装置から前記制御レジスタを指定するアドレスが出力された場合、前記複数の仮想デバイス領域のうち対応する一つを指定するアドレスに変換する。   Alternatively, a plurality of central processing units that execute a plurality of operating systems, a memory that is designated and accessed by the plurality of central processing units, and a control register that is designated and accessed by the plurality of central processing units And an input / output device having an address conversion mechanism for converting addresses output from the plurality of central processing units according to a predetermined condition, wherein the control register and the memory are included in one address space, A plurality of virtual device areas corresponding to each of the plurality of operating systems, and the address conversion mechanism is a central processing unit that executes an operating system to which the input / output device is allocated among the plurality of operating systems. Outputs an address specifying the control register When the address specifying the control register is output from a central processing unit that executes an operating system to which the input / output device is not assigned among the plurality of operating systems without performing address conversion, the plurality of virtual Convert the corresponding one of the device areas to the specified address.

本願において開示される発明によれば、マルチコア環境において、ソフトウェア開発に要する期間が短縮でき、また入出力処理の効率化が可能になる。   According to the invention disclosed in the present application, the time required for software development can be shortened in a multi-core environment, and the efficiency of input / output processing can be improved.

本明細書に開示される主な発明は、単一のチップにおいて複数の中央処理装置(CPU)が単一のメモリを共有し、それら複数のCPU上でそれぞれ複数のオペレーティングシステム(OS)が入出力装置(I/O)を共有しながら稼動する環境でのアプリケーションプログラムの実行における該I/Oの共有方式に関する技術である。また、本明細書に開示される主な発明の概略を先に述べると、複数のOSが同時にアクティブ状態で動作しており、それらが一つのデバイスを共有し、同時にアクセスする場合に、複数のOSからの該アクセスを振分け、それぞれのOSにI/Oデバイスを占有しているイメージを与えることで、入出力動作を並行して行える。この場合、仮想マシン制御機構(VMM)が前記複数のOSからの前記デバイスに対するアクセスを振分けるとよい。これにより、それぞれのOSで提供されるI/Oデバイスドライバは変更することなく使用でき、また、共有使用されるI/Oデバイスも特別な機構が不要であり、従来からのものをそのまま利用できる。さらに、仮想マシン制御機構(VMM)が制御レジスタのアクセス毎に介入しなくてもよく、処理オーバヘッドを低減できる。   In the main invention disclosed in this specification, a plurality of central processing units (CPUs) share a single memory in a single chip, and a plurality of operating systems (OS) are installed on each of the plurality of CPUs. This is a technique related to an I / O sharing method in the execution of an application program in an environment that operates while sharing an output device (I / O). The outline of the main invention disclosed in this specification will be described first. When a plurality of OSs are operating in the active state at the same time and share one device and access them simultaneously, By assigning the access from the OS and giving each OS an image that occupies the I / O device, the input / output operations can be performed in parallel. In this case, a virtual machine control mechanism (VMM) may distribute access to the device from the plurality of OSs. As a result, the I / O device driver provided by each OS can be used without change, and the shared I / O device does not require a special mechanism, and the conventional one can be used as it is. . Furthermore, the virtual machine control mechanism (VMM) does not need to intervene every time the control register is accessed, and the processing overhead can be reduced.

言い換えれば、前記複数のOSからの前記デバイスに対するアクセスを振分け、以下の方式でそれぞれのOSに該デバイスを占有しているイメージを与えるようにする。
(1) 1つのデバイスを複数のOSで共有する場合に、物理アドレス変換機構(PAM)を使用してOSごとに必要なMMIO(メモリマップドIO)レジスタの領域アドレスを切替えることにより、デバイスに対するインスタンスを切替えて分配を行う。ここで、実際の制御レジスタ領域を実デバイス領域、切替え用に割当てた領域を仮想デバイス領域と呼ぶ。OS側のデバイスドライバからは、支配権を持ちデバイスが割当てられていれば実デバイス領域がアクセスでき、割当てられていなければ仮想デバイス領域がアクセスされるようにする。また、デバイス割当ての排他性は物理アドレス変換機構を用いて保証する。
(2) 仮想デバイス領域はデバイスを共有するOS毎に持つ。
(3) 仮想デバイス領域のデータにはそのデータが書込み用か否かの情報、書込み順序、関連する要素のアクセスの時間的な制約、書込み用データに対してはそのデータが書込まれたか否かの情報をもつ。
(4) VMM内にデバイススケジューラを持ち、このスケジューラはデバイス動作の終了通知や時間間隔に基づいて、共有されるデバイスをスケジュールして、共有している複数のOSに順次割当てる。
(5) 上記のデバイススケジューラによるデバイス割当ての切替えで、実デバイス領域と仮想デバイス領域のコピーをVMMにより行う。その際、書込みデータは前回の書込みから再度書込まれた場合にのみ仮想デバイス領域から実デバイス領域にコピーし、書込み順序に従って実デバイス領域に書込む。
In other words, access to the device from the plurality of OSs is distributed, and an image occupying the device is given to each OS by the following method.
(1) When a single device is shared by a plurality of OSs, the physical address translation mechanism (PAM) is used to switch the MMIO (memory-mapped IO) register area address required for each OS. Switch instances to distribute. Here, the actual control register area is called a real device area, and the area allocated for switching is called a virtual device area. From the device driver on the OS side, the real device area can be accessed if the device has the control right and the device is assigned, and the virtual device area is accessed if the device is not assigned. Also, device allocation exclusivity is guaranteed using a physical address translation mechanism.
(2) A virtual device area is provided for each OS sharing a device.
(3) Information on whether or not the data is for writing in the virtual device area, the order of writing, time restrictions on accessing related elements, and whether or not the data has been written to the data for writing Information.
(4) The VMM has a device scheduler, and this scheduler schedules shared devices based on device operation end notifications and time intervals, and sequentially assigns them to a plurality of shared OSs.
(5) The real device area and the virtual device area are copied by the VMM by switching the device assignment by the device scheduler. At this time, the write data is copied from the virtual device area to the real device area only when it is written again from the previous write, and written to the real device area in accordance with the write order.

以下、図を参照しながら、本発明における複数OSでのI/Oデバイスの共有方法の詳細について説明する。図1は、本発明におけるソフトウェア、ハードウェア構成の一例である。対象となるマルチコアシステムは、単一のメモリMEM(100)、CPU1〜CPU3の複数のCPU(101〜103)とIO1〜IO2の入出力装置(104、105)によって構成されている。さらに、それぞれのCPUの上でOSがそれぞれOS1、OS2、OS3(151〜153)と稼動し、その上でそれぞれアプリケーション(APPL)1、2、3(161〜163)が稼動する構成である。110は、仮想マシン制御機構(VMM)110と呼ぶOSより下位レベルの制御プログラムであり、CPUやメモリI/Oなどの資源とOSとの結びつけを行う。ここに資源分割・分配機能(RDD)120をもつ。さらにCPUからメモリ転送路(MEMTS)130を介してメモリへのアクセスが行われ、このメモリアクセスにおいてアクセスアドレスの変換を行う物理アドレス管理機構(PAM)140をもつ。ここで、アプリケーション161〜163、OS1〜OS3(151〜153)、VMM(資源分割・分配機能120を含む)110は、ソフトウェアで構成されており、その他はハードウェアで構成されている。また、これらのソフトウェアは、メモリMEM(100)に格納されている。   The details of the method for sharing an I / O device in a plurality of OSs according to the present invention will be described below with reference to the drawings. FIG. 1 shows an example of a software and hardware configuration in the present invention. The target multi-core system includes a single memory MEM (100), a plurality of CPUs (101 to 103) of CPU1 to CPU3, and input / output devices (104, 105) of IO1 to IO2. Further, the OS is operated as OS1, OS2, OS3 (151 to 153) on each CPU, and the applications (APPL) 1, 2, 3 (161 to 163) are operated thereon. 110 is a control program at a lower level than the OS called a virtual machine control mechanism (VMM) 110, and links resources such as CPU and memory I / O with the OS. This has a resource division / distribution function (RDD) 120. Further, a memory is accessed from the CPU via a memory transfer path (MEMTS) 130, and a physical address management mechanism (PAM) 140 that converts an access address in this memory access is provided. Here, the applications 161 to 163, the OS1 to OS3 (151 to 153), and the VMM (including the resource division / distribution function 120) 110 are configured by software, and the others are configured by hardware. These software are stored in the memory MEM (100).

資源分割・分配機能120は、アプリケーションやOSがメモリを参照するために用いるメモリアドレスをハードウェアによる物理アドレス管理機構PAM(140)と協調し、PAM内のエントリを設定して操作することにより、アドレス値に適当なオフセットを加算することで、アプリケーションやOSには意識されずに実際のメモリ100上での参照場所の物理配置をずらすことを可能にし、メモリを分割してCPU1用の領域、CPU2用の領域などとして分配する。   The resource division / distribution function 120 cooperates with the physical address management mechanism PAM (140) by hardware to set the memory address used by the application or OS to refer to the memory, and sets and operates an entry in the PAM. By adding an appropriate offset to the address value, the physical arrangement of the reference location on the actual memory 100 can be shifted without being conscious of the application or OS, and the memory is divided into an area for the CPU 1, It is distributed as an area for the CPU2.

一方、I/Oデバイスの使用に関して、入出力装置はその機能を動作させるための制御レジスタ(図示されていない)を持っており、メモリマップドIO(MMIO)としてそれらの制御レジスタはメモリアドレスとして番地付けしてマッピングされる。よって、CPUはメモリであるかのようにメモリアドレスを出力することでI/Oデバイスにアクセスする。具体的には、I/Oデバイスは、OSに搭載されるデバイスドライバと呼ばれる入出力管理プログラムによってアクセス制御される。一般的にはI/Oデバイスに対する直接の操作は、それに対するデバイスドライバによってのみ行われる。このようなMMIOデバイスとしては、例えばハードディスク装置などがある。   On the other hand, regarding the use of I / O devices, the input / output device has a control register (not shown) for operating its function, and these control registers are used as memory addresses as memory mapped IO (MMIO). The address is mapped. Therefore, the CPU accesses the I / O device by outputting the memory address as if it were a memory. Specifically, the I / O device is access-controlled by an input / output management program called a device driver installed in the OS. Generally, direct operations on I / O devices are performed only by device drivers for the I / O devices. Examples of such MMIO devices include a hard disk device.

ここで、例えばI/O装置(IO1)がOS1とOS2で共有される場合、IO1の制御レジスタとしてマッピングされている実デバイス領域がOS1とOS2の双方で共有されることになる。このため、VMMによって時分割でOS1、OS2に実デバイス領域の支配権を渡しながら入出力機能を実現することが求められる。   Here, for example, when the I / O device (IO1) is shared by OS1 and OS2, the real device area mapped as the control register of IO1 is shared by both OS1 and OS2. For this reason, the VMM is required to realize the input / output function while handing over the control of the real device area to the OS1 and OS2 in a time division manner.

上記によりOS1、OS2が入出力装置IO1を共有して実行する例における図1の構成要素の詳細を図2に示して説明する。OS1、OS2に含まれるデバイスドライバDRV1、DRV2は、それぞれのデバイスに対して物理的な制御を行うプログラムである。また、VMMは、図1に示される資源分割・分配機構120の他に、共有デバイススケジューラ(CDC)250を有し、また、共有デバイススケジューラ内に領域制御情報(RCI)260を有する。共有デバイススケジューラ250は、複数のOSで共有されているデバイスに対する使用権の調停を行い、また、領域制御情報260は、領域制御レジスタに格納されている情報がどのように使用されるかの属性を示すものである。更に、本図では、CPU1、CPU2がアクセスするためのアドレス空間が示されている。アドレス空間には、メモリ100がマッピングされるメモリ領域と、メモリマップドIO(MMIO)の制御レジスタがマッピングされる実デバイス領域が含まれている。メモリ100がマッピングされたメモリ領域には、OS1(CPU1)のための仮想デバイス領域1(221)と、OS2(CPU2)のための仮想デバイス領域2(222)が設けられる。また、夫々の仮想デバイス領域の中にアクセスしたIOが使用中か否かを示すフラグを示す領域271、272が設けられる。また、夫々の仮想デバイス領域221、222に対応して書込み監視機構WOS(281、282)が設けられる。この書込み監視機構は、それぞれの仮想デバイス領域に対して書込み操作が行われたかどうかの監視を行う。   Details of the components shown in FIG. 1 in an example in which the OS 1 and OS 2 share and execute the input / output device IO 1 will be described with reference to FIG. The device drivers DRV1 and DRV2 included in the OS1 and OS2 are programs that perform physical control on the respective devices. Further, the VMM has a shared device scheduler (CDC) 250 in addition to the resource dividing / distributing mechanism 120 shown in FIG. 1, and also has region control information (RCI) 260 in the shared device scheduler. The shared device scheduler 250 arbitrates usage rights for devices shared by a plurality of OSs, and the area control information 260 is an attribute of how information stored in the area control register is used. Is shown. Furthermore, in this figure, an address space for CPU 1 and CPU 2 to access is shown. The address space includes a memory area to which the memory 100 is mapped and a real device area to which a memory mapped IO (MMIO) control register is mapped. In the memory area to which the memory 100 is mapped, a virtual device area 1 (221) for OS1 (CPU1) and a virtual device area 2 (222) for OS2 (CPU2) are provided. Also, areas 271 and 272 indicating flags indicating whether or not the accessed IO is in use are provided in each virtual device area. A write monitoring mechanism WOS (281, 282) is provided corresponding to each virtual device region 221, 222. The write monitoring mechanism monitors whether a write operation has been performed on each virtual device area.

今、OS1がIO1に対して支配権を持ち、アクセスしているものとする。このとき、VMM(110)によってPAM(140)のエントリが設定されており、OS1からのIO1に対するデバイスアクセスはIO1の制御レジスタがマッピングされている実デバイス領域1(220)に対してなされるようになっている。すなわち、OS1内のデバイスドライバDRV1(230)からは、IO1の制御レジスタへアクセスするためのアドレス(231)が出力され、PAM(140)によって、実線矢印232に示すようにアドレス(231)は実デバイス領域1(220)に対してマップされ、そのアドレスによってデバイスが機能するようになっている。一方、デバイスに対して支配権のないOS2からIO1に対してアクセスがあると、OS2内のデバイスドライバDRV2(240)からIO1の制御レジスタへの参照が行われるが、このアクセスはPAM(140)によってアドレス(241)が所定のオフセット(オフセット2)を持つように変換され、点線矢印242として、IO1のOS2に対する仮想デバイス領域2(222)であるメモリ100へのアクセスへと変換される。支配権がない期間になされた仮想デバイス領域へのアクセス内容は、次に支配権を得た時に実デバイスに反映される。   Assume that OS1 has control over IO1 and is accessing it. At this time, an entry of PAM (140) is set by the VMM (110), and device access from the OS1 to the IO1 is made to the real device area 1 (220) to which the control register of the IO1 is mapped. It has become. That is, an address (231) for accessing the control register of IO1 is output from the device driver DRV1 (230) in the OS1, and the address (231) is real by the PAM (140) as indicated by a solid arrow 232. The device is mapped to the device area 1 (220), and the device functions according to the address. On the other hand, if there is an access from the OS 2 that does not have control over the device to the IO 1, the device driver DRV 2 (240) in the OS 2 refers to the control register of the IO 1. This access is performed by the PAM (140). Thus, the address (241) is converted to have a predetermined offset (offset 2), and is converted into an access to the memory 100 which is the virtual device area 2 (222) for the OS2 of the IO1 as a dotted arrow 242. The contents of access to the virtual device area made during a period when there is no control right are reflected in the real device the next time control right is obtained.

図3は、PAM(140)によるそのアドレス変換の処理過程を説明するものである。PAMは、夫々のOS(CPU)に対応して、複数のエントリ370を有する。夫々のエントリ370の中には、I/Oデバイスの制御レジスタがマッピングされているメモリのアドレス範囲を特定するための下限アドレス310と上限アドレス320を格納すると共に、そのアドレス範囲に属するI/Oデバイスにアクセスする際に、デバイスドライバによって出力されるアドレス指定信号350に対して加えるべきオフセット値330を格納する。PAMでは入力されたアドレス指定信号(350)の値に対して、OS指定信号(340)によってそれがどのOSやCPUから出力されたものであるかを得、アドレス変換に用いるべきPAMのエントリ(370)を得る。デバイスドライバによってOSから出力されるアドレス指定信号(350)を比較器COMP(360)に入力し、アドレス範囲の上下限値(310、320)と比較することでエントリ370を選択し、このアドレス信号に適用すべきオフセット値(330)を与え、これらを加算することで真のアクセスアドレス(380)を出力する。このハードウェア機構により、複数のCPU・OSから出力されるMMIOデバイスの制御レジスタへのアクセスを振分けて調停することが可能になる。   FIG. 3 explains the process of address conversion by the PAM (140). The PAM has a plurality of entries 370 corresponding to each OS (CPU). Each entry 370 stores a lower limit address 310 and an upper limit address 320 for specifying the address range of the memory to which the control register of the I / O device is mapped, and I / O belonging to the address range. When accessing the device, the offset value 330 to be added to the addressing signal 350 output by the device driver is stored. In the PAM, with respect to the value of the input address designation signal (350), the OS designation signal (340) is used to obtain which OS or CPU has output it, and the PAM entry (to be used for address translation) ( 370). The address designation signal (350) output from the OS by the device driver is input to the comparator COMP (360), and the entry 370 is selected by comparing with the upper and lower limit values (310, 320) of the address range. Is given an offset value (330) to be applied, and these are added to output a true access address (380). With this hardware mechanism, it is possible to distribute and arbitrate access to the control register of the MMIO device output from a plurality of CPUs / OSs.

OS1が対象のI/Oデバイス(IO1)に対する支配権をもっている場合、図2を用いて説明したとおり、PAMの設定によってOS1からのI/Oデバイス(IO1)に対するアクセス、すなわち、このデバイスの制御レジスタに対するアクセスは、対応する実デバイス領域(220)に対するものとしてマッピングされ、デバイスドライバからの制御レジスタアクセスは通常のデバイス操作と同じものとして扱われる。一方、このデバイス(IO1)に対する支配権のないOS2からの同デバイスに対するアクセスは、同じくPAMの設定によってオフセット値を加算することにより仮想デバイス領域2(222)に対するものとしてマッピングされ、この領域へのメモリアクセスとなっている。   When the OS1 has control over the target I / O device (IO1), as described with reference to FIG. 2, the access to the I / O device (IO1) from the OS1 by the setting of the PAM, that is, control of this device The access to the register is mapped as to the corresponding real device area (220), and the control register access from the device driver is treated as the same as the normal device operation. On the other hand, an access to the device from OS2 that does not have control over this device (IO1) is mapped as to the virtual device region 2 (222) by adding an offset value according to the setting of the PAM. Memory access.

以下、図4と図3および図2によって、PAMのエントリを設定することによる複数のOSからのI/Oへのアクセスすなわち、そのデバイスに対する実デバイス領域へのアクセスを調停する処理手順を示す。一例として、デバイスの支配権がOS1からOS2に変更される場合について説明する。   Hereinafter, FIG. 4, FIG. 3 and FIG. 2 show a processing procedure for arbitrating access to an I / O from a plurality of OSs by setting a PAM entry, that is, access to an actual device area for the device. As an example, a case where the control right of a device is changed from OS1 to OS2 will be described.

I/OデバイスIO1の支配権がOS1からOS2に変更される前は、OS1がIO1の支配権を有するため、IO1の制御レジスタのアドレスに対するオフセット値(330)の内容は0となっており、デバイスドライバから出力されるデバイス制御のアクセスのアドレス231がそのままアクセスアドレス(380)として出力される。次に、デバイススイッチの開始、即ち、支配権の変更は、PAMのエントリ内容の設定変更によって行われる。具体的には、まず、OS1の支配権の割当てを解除するため、実デバイス領域(220)のOS1に対応するPAMのエントリを変更してIO1に対する仮想デバイス領域1(221)を指すように設定する(410)。支配権を変更するに当たって、VMM(110)により、このオフセット値を図2のオフセット1(261)として設定し、点線矢印233に示すように、OS1用の仮想デバイス領域1(221)にマップされるようにする。図中の仮想デバイス領域1や仮想デバイス領域2は、図2の中で221、222としてメモリ内に確保されているものである。このような領域の確保やオフセット値の指定はシステム初期化時に行われる。   Before the control right of the I / O device IO1 is changed from OS1 to OS2, since the OS1 has the control right of the IO1, the content of the offset value (330) with respect to the address of the control register of the IO1 is 0. The device control access address 231 output from the device driver is output as is as the access address (380). Next, the start of the device switch, that is, the change of the control right is performed by changing the setting of the entry contents of the PAM. Specifically, first, in order to cancel the allocation of the OS1 control right, the PAM entry corresponding to OS1 in the real device area (220) is changed to point to the virtual device area 1 (221) for IO1. (410). When changing the control right, the VMM (110) sets this offset value as the offset 1 (261) in FIG. 2, and is mapped to the virtual device area 1 (221) for OS1 as indicated by the dotted arrow 233. So that The virtual device area 1 and the virtual device area 2 in the figure are secured in the memory as 221 and 222 in FIG. Such area reservation and offset value specification are performed at the time of system initialization.

次に、実デバイス領域(220)の内容を仮想デバイス領域に1(221)にコピーするため、仮想デバイス領域1(221)のデバイス使用中のフラグ(271)をONとして設定し、OS1から当デバイスへのアクセスを待たせるようにする(420)。次に、実デバイス領域(220)から、このデバイス割当てが解除されるOS1に対する仮想デバイス領域1に制御レジスタの内容をコピーし、実デバイス領域(220)の内容と同一の内容を仮想デバイス領域1(221)に持たせる(430)。仮想デバイス領域1のデバイス使用中フラグ(271)をOFFにする(440)。これにより、OS1は、I/Oデバイスの支配権が無い場合でも、仮想デバイス領域1から制御レジスタの情報を読み出すことが可能となる。ここで、デバイス使用中フラグは、そのデバイスが現在動作中であるかどうかを示すフラグで実際のデバイスに備えられているものであり、制御レジスタの一部(270)としてとして実デバイス領域に存在する。本発明においては、その領域のコピーが仮想デバイス領域1、仮想デバイス領域2にそれぞれ271、272として保持されている。後述するように、支配権を持たないOSからはこのコピーの領域を参照して制御する。   Next, in order to copy the contents of the real device area (220) to the virtual device area to 1 (221), the device in-use flag (271) of the virtual device area 1 (221) is set to ON, and this is set from OS1. Wait for access to the device (420). Next, the contents of the control register are copied from the real device area (220) to the virtual device area 1 for the OS1 whose device allocation is to be released, and the same contents as the contents of the real device area (220) are copied to the virtual device area 1. (221) is held (430). The device busy flag (271) in the virtual device area 1 is turned OFF (440). Thus, the OS 1 can read the control register information from the virtual device area 1 even when there is no I / O device control right. Here, the device busy flag is a flag indicating whether or not the device is currently operating and is provided in the actual device, and is present in the actual device area as a part (270) of the control register. To do. In the present invention, copies of the areas are held as 271 and 272 in the virtual device area 1 and the virtual device area 2, respectively. As will be described later, control is performed with reference to this copy area from the OS having no control right.

次に、これから支配権を得るOS2が実デバイス領域にアクセスできるようにする。このためには、図4、470に示すように、現在PAMでオフセット値がオフセット2(262)となっているエントリを0に設定して、OS2からのI/Oデバイスの制御レジスタ領域へのアクセスのためのアドレスが実デバイス領域(220)に対するものとなるようにする。この操作によって、デバイスへの直接のアクセス権がOS1からOS2に移り、OS1からは仮想デバイス領域1へのアクセスとなり、OS2からは実デバイス領域となって実際のデバイスにアクセスできるようになる。ここで、OS1からアクセスできる領域を最初に実デバイス領域から仮想デバイス領域にマップするようにし、次にOS2からアクセスできる領域を実デバイス領域にマップする操作は、この順序で単一のVMMで実行されるため、当I/Oデバイスに対して複数のOSから同じ実デバイス領域をアクセスする状況は発生せず、ここでデバイスの排他制御が行われることになる。   Next, the OS 2 that obtains the control right from now on can access the real device area. For this purpose, as shown in FIGS. 4 and 470, the entry whose offset value is offset 2 (262) in the current PAM is set to 0, and the control register area of the I / O device from OS2 is set to 0. The address for access is set to the real device area (220). By this operation, the direct access right to the device is transferred from the OS 1 to the OS 2, the OS 1 becomes the virtual device area 1, and the OS 2 becomes the real device area and can access the actual device. Here, the area that can be accessed from the OS 1 is first mapped from the real device area to the virtual device area, and then the area that can be accessed from the OS 2 is mapped to the real device area in this order by a single VMM. Therefore, a situation in which the same real device area is accessed from a plurality of OSs to the I / O device does not occur, and exclusive control of the device is performed here.

さらに、これまでOS2で行われていた該I/Oデバイスへの仮想的なアクセスの結果を実デバイスに反映させる。支配権がない状態のときに仮想デバイス領域2に書込まれていたデバイスに対する操作を実デバイスに反映する必要がある。このため、支配権が移動したタイミングで仮想デバイス領域の内容を実デバイスに対して書込む。図4、460において、今回デバイスに対して支配権を持つOS2の仮想デバイス領域2から実デバイス領域にコピーすることがこれに相当する。また、このコピー操作に先立って、450において、仮想デバイス領域2(222)のデバイス使用中のフラグ(272)をONとして設定し、OS2から当デバイスへのアクセスを待たせるようにする。   Furthermore, the result of virtual access to the I / O device that has been performed by the OS 2 so far is reflected on the actual device. It is necessary to reflect the operation for the device written in the virtual device area 2 when there is no control right to the real device. For this reason, the contents of the virtual device area are written to the real device at the timing when the control right moves. 4 and 460, this corresponds to copying from the virtual device area 2 of the OS 2 having control over the current device to the real device area. Prior to this copy operation, in 450, the device busy flag (272) in the virtual device area 2 (222) is set to ON so that the OS 2 can wait for access to the device.

上記において、VMMの中の管理情報として仮想デバイス領域の個々のデータに対してそれぞれ(1)アドレス、(2)サイズ、(3)書込みがなされるかどうか、(4)書込み順序、(5)関連するデータの書込みの時間的制約、という領域制御情報(260)を持つ。また、書込みデータに対してはさらに、個々の仮想デバイス領域について、データが以前の書込みから変化したかどうかを監視する書込み監視機構(281、282)を設ける。   In the above, (1) address, (2) size, (3) whether or not writing is performed for each piece of data in the virtual device area as management information in the VMM, (4) writing order, (5) It has area control information (260) such as a time restriction of writing related data. Further, for the write data, a write monitoring mechanism (281, 282) is provided for monitoring whether or not the data has changed from the previous write for each virtual device area.

460のコピー操作では、まず、状態変更が生じない、すなわちデバイスの状態など読出しのみがなされる操作に対するコマンドとなるデータを実デバイス領域に書込む。次に状態変更がなされるデータすなわちデバイスの状態を変更させる操作に対するコマンドとなるデータについて、以前の書込みから変化のあったものを書込む。これら書込みの順序は領域制御情報(250)内にある書込み順序情報によって行い、書込みデータ間に時間的な制約がある場合は、それを守って書込む。さらに、書込むデータは、支配権がない時に仮想デバイス領域に書込まれた場合に限ることとし、書込みがなされたかどうかを書込み監視機構(図2、281、282)によって行う。実際の動作においては、一例として、書込み対象となっているデータを、IO動作としては設定されない特別な値に初期化しておき、その値から変更があったかによって書込みが行われたかどうかを監視する方法などが採られる。   In the 460 copy operation, first, data that becomes a command for an operation that does not change the state, that is, only the read operation such as the device state, is written in the actual device area. Next, with respect to data to be changed, that is, data serving as a command for an operation for changing the state of the device, data that has changed from the previous writing is written. The order of writing is performed based on the writing order information in the area control information (250). If there is a time restriction between the writing data, the writing is performed in compliance with the time restriction. Further, the data to be written is limited to the case where the data is written in the virtual device area when there is no control right, and whether or not the data has been written is determined by the write monitoring mechanism (FIGS. 2, 281 and 282). In an actual operation, as an example, a method of initializing data to be written to a special value that is not set as an IO operation, and monitoring whether or not the writing has been performed depending on whether the value has changed Etc. are taken.

図5において仮想デバイス領域610から実デバイス領域620へのコピー操作を説明する。状態変更が生じない操作に対するコマンドとなるデータである状態変更無しデータ1(611)、状態変更無しデータ2(612)、状態変更無しデータ3(613)は、630によりそれぞれ、実デバイス領域620の対応する状態変更無しデータ1(621)、状態変更無しデータ2(622)、状態変更無しデータ3(623)の領域にコピーされるよう書込まれる。状態変更がなされる操作に対するコマンドとなるデータは、状態変更有りデータ1(614)が書込み監視機構において書込み有り(616)となっているので、実デバイス領域620の状態変更有りデータ1(624)として630によりコピーされる。状態変更有りデータ2(615)は書込み監視機構において書込み無し(617)となっているため、実デバイス領域620にはコピーされない。もし、617が書込み有りとなっている場合は、書込み順序(618、619)が示す順序にしたがって、状態変更有りデータ1(614)のコピー後に状態変更有りデータ2(615)をコピーする。   A copy operation from the virtual device area 610 to the real device area 620 will be described with reference to FIG. State change no data 1 (611), state change no data 2 (612), and no state change data 3 (613), which are data serving as commands for operations that do not cause a state change, are stored in the actual device area 620 by 630, respectively. It is written so as to be copied to the corresponding areas of no-change data 1 (621), no-change data 2 (622), and no-change data 3 (623). Since the data to be a command for the operation to change the state is the state change data 1 (614) is written in the write monitoring mechanism (616), the state change data 1 (624) in the actual device area 620 Is copied by 630. Since the data 2 with status change (615) is not written (617) in the write monitoring mechanism, it is not copied to the actual device area 620. If 617 is written, the data with status change 2 (615) is copied after copying the data with status change 1 (614) according to the order indicated by the write order (618, 619).

ここで、状態変更がなされる操作に対するコマンドとなるデータは、実際の物理的なデバイスに動作を発生させ、状態の変化を引起すものであるので、支配権のないOSからは同種の動作に対しては1度しか発行できず、またそれらを発生させる順序を保持する必要がある。このため、書込み監視を行い、また、書込みの順序を保持している。同種の書込み動作が行われると、この操作に対する終了報告がなされないことによって、以降の書込み動作が保留状態となる。   Here, the data used as the command for the operation to change the state causes the actual physical device to generate an operation, and causes the change of the state. It can only be issued once, and the order in which they are generated must be maintained. For this reason, write monitoring is performed and the order of writing is maintained. When the same kind of write operation is performed, the end report for this operation is not made, and the subsequent write operation is put on hold.

以上の操作により、これまで支配していないデバイスに対してなされていた操作が、支配権を得た時に実際のデバイスに反映され、以降、支配権を持ち真に実デバイス領域への通常の制御レジスタへの操作でデバイスドライバが機能することになる。最後に仮想デバイス領域のデバイス使用中フラグをOFFとする(480)。   As a result of the above operations, the operations that have been performed on devices that have not been controlled so far are reflected in the actual device when control is obtained. The device driver functions by operating the registers. Finally, the device busy flag in the virtual device area is turned OFF (480).

共有デバイスの割当てに対するスケジューリングの処理過程は、図6に示すようになる。これは物理的に1つだけ存在するI/Oデバイスを使用する権利をスケジューリングして、それを同時にアクティブである複数のOSに対して順に割当てるようスケジューリングする共有デバイススケジューラ(図2、250)の処理アルゴリズムの一例である。   The scheduling process for the shared device allocation is as shown in FIG. This is a shared device scheduler (FIG. 2, 250) that schedules the right to use only one physical I / O device and schedules it to be assigned to multiple active OSs in order. It is an example of a processing algorithm.

共有デバイススケジューラは、通常は割当て処理を行わないアイドル状態(500)にあり、タイマ割込みなどによって一定の間隔で共有対象となる入出力デバイス(本例ではIO1)の状態をチェックする。このチェックは例えば、デバイス自身に装備されている「使用中フラグ」(図2、270)を参照することによって行われる。この処理の際、VMM(図2、200)がこの制御を行うので、共有デバイススケジューラ自身は実デバイス領域にアクセスすることが可能となっている。   The shared device scheduler is normally in an idle state (500) in which no allocation process is performed, and checks the state of the input / output device (IO1 in this example) to be shared at regular intervals by a timer interrupt or the like. This check is performed, for example, by referring to the “in-use flag” (FIG. 2, 270) installed in the device itself. During this process, the VMM (FIG. 2, 200) performs this control, so that the shared device scheduler itself can access the real device area.

IOの処理が進行し、デバイスから終了割込みが発生した場合(510)、このような割込みは一旦VMMが捕捉し、割込み処理が開始される。520において割込みの要因を判定し、デバイス終了割込みの場合(521)、当該デバイスでの処理が終了しているので、支配権を他の(スケジューラが仮定している順序で次の)OSに移し(530)、この終了割込み自体は今までこのデバイスに対して支配権をもってきたOS(OS1)にそのまま送ることになる(540)。   When the processing of the IO progresses and an end interrupt is generated from the device (510), such an interrupt is once captured by the VMM, and interrupt processing is started. In 520, the cause of the interrupt is determined, and in the case of a device end interrupt (521), since the processing in the device has ended, control is transferred to another OS (next in the order assumed by the scheduler). (530) The end interrupt itself is sent as it is to the OS (OS1) that has been in control of the device so far (540).

一方、タイマ割込みである場合(522)、使用中フラグ(図2、270)を参照してデバイスが使用中であるかどうかを検査する(550)。使用中フラグがONでデバイスが使用中であるときは、スケジューラは何もせず当デバイスへのアクセス権は当該OSに設定されたままである(551)。使用中フラグがOFFでデバイスが使用中ではない場合(552)、530で行ったのと同様に、別のOSに支配権を渡す(560)。ここで、支配権を与える別のOSの選択には、本例で示したような、順に次のものに割当てる方法に限らず、あらかじめ指定された順序で交代に行う方法や、OSごとに他のOSに対する優先権を設定しその優先権に基づいて、その時点で最高の優先度をもつOSに与えるなどの方法がある。割込み要因がその他の場合(523)、該割込みを、それを受取って処理すべきOSに送る。   On the other hand, if it is a timer interrupt (522), it is checked whether the device is in use with reference to the busy flag (FIG. 2, 270) (550). When the in-use flag is ON and the device is in use, the scheduler does nothing and the access right to the device remains set in the OS (551). When the in-use flag is OFF and the device is not in use (552), the control right is handed over to another OS in the same manner as in 530 (560). Here, the selection of another OS to which control is given is not limited to the method of sequentially assigning to the next one as shown in this example. There is a method of setting a priority for the OS and giving it to the OS having the highest priority at that time based on the priority. If the interrupt factor is other (523), the interrupt is sent to the OS to receive and process.

以上のようにして、本発明では、マルチコアシステムにおいて同時に稼動している複数のOSから、1つのデバイスを共有してアクセスするために、OSに備えられているデバイスドライバを変更することなく、そのまま稼動させることで実現できる。また、同時に動作している他のOSからの該デバイスに対するアクセスの影響を気にすることなく柔軟なアクセスを可能にすることができ、支配権の調停をハードウェアであるPAMを用いて行うため、VMMの介入する部分が少なくなり実行性能が低下しないようにできる。   As described above, in the present invention, in order to share and access one device from a plurality of OSs operating simultaneously in a multi-core system, the device driver provided in the OS is not changed, and the device driver is not changed. It can be realized by operating. Moreover, flexible access can be made possible without worrying about the influence of access to the device from other OSs operating simultaneously, and control arbitration is performed using PAM, which is hardware. Therefore, it is possible to prevent the execution performance from deteriorating because the VMM intervenes.

システム構成全体概要を示した図。The figure which showed the whole system structure outline | summary. 詳細なシステム構成を示した図。The figure which showed the detailed system configuration. 物理アドレス管理機構(PAM)を示した図。The figure which showed the physical address management mechanism (PAM). デバイス割当て切替え処理のフローを示した図。The figure which showed the flow of the device allocation switching process. 仮想デバイス領域から実デバイス領域へのコピー操作を示した図。The figure which showed copy operation from a virtual device area to a real device area. デバイススケジューリング処理のフローを示した図。The figure which showed the flow of the device scheduling process.

符号の説明Explanation of symbols

100:メモリ、101・102・103:CPU、104・105:入出力機器、110:仮想マシン制御機構(VMM)、120:資源分割・分配機構、130:メモリ転送路、140:物理アドレス管理機構(PAM)、151・152・153:オペレーティングシステム、161・162・163:アプリケーション、220:実デバイス領域、221・222:仮想デバイス領域、230・240:デバイスドライバ、231・232・233・241・242:制御レジスタアクセスアドレス、250:共有デバイススケジューラ、260:領域制御情報、261・262:オフセット値、270・271・272:使用中フラグ、281・282:書込み監視機構、310:下限アドレスエントリ、320:上限アドレスエントリ、330:オフセット値、340:OS指定信号、350:アドレス指定信号、360:比較器、370:PAMのエントリ、380:真のアクセスアドレス、410:解除側PAM設定処理、420・440:解除側デバイス使用中フラグ設定処理、430:解除側コピー処理、450・480:割当て側デバイス使用中フラグ設定処理、460:割当て側コピー処理、470:割当て側PAM設定処理、500:アイドル状態、510:割込み発生、520:割込み要因に解析処理、521・522・523:割込み要因の区別、530・560:次のOSへの支配権の移行処理、540・570:割込みの転送処理、550:デバイスが使用中かの検査、551・552:使用中かどうかの検査結果、610:仮想デバイス領域、611・612・613・614・615:コマンドとなる制御用データ、616・617:書込み監視機構、618・619:書込み順序、620:実デバイス領域、621・622・623・624・625:コマンドとなる制御用データ。   100: Memory, 101, 102, 103: CPU, 104, 105: Input / output device, 110: Virtual machine control mechanism (VMM), 120: Resource division / distribution mechanism, 130: Memory transfer path, 140: Physical address management mechanism (PAM), 151, 152, 153: operating system, 161, 162, 163: application, 220: real device area, 221, 222: virtual device area, 230, 240: device driver, 231, 232, 233, 241, 242: Control register access address, 250: Shared device scheduler, 260: Area control information, 261, 262: Offset value, 270, 271, 272: In-use flag, 281, 282: Write monitoring mechanism, 310: Lower limit address entry, 320: Upper limit address , 330: Offset value, 340: OS designation signal, 350: Address designation signal, 360: Comparator, 370: PAM entry, 380: True access address, 410: Release side PAM setting process, 420/440: Release -Side device busy flag setting processing, 430: release-side copy processing, 450 and 480: assignment-side device busy flag setting processing, 460: assignment-side copy processing, 470: assignment-side PAM setting processing, 500: idle state, 510: Interrupt generation, 520: Analysis processing for interrupt factor, 521, 522, 523: Distinguish between interrupt factors, 530, 560: Transfer processing of control to next OS, 540, 570: Transfer processing of interrupt, 550: Device In-use inspection, 551 and 552: In-use inspection result, 610: Virtual device area 611, 612, 613, 614, 615: control data to be commands, 616, 617: write monitoring mechanism, 618, 619: write order, 620: actual device area, 621, 622, 623, 624, 625: command Control data.

Claims (13)

第1のオペレーティングシステムを実行する第1の中央処理装置と、
第2のオペレーティングシステムを実行する第2の中央処理装置と、
前記第1及び第2の中央処理装置からアドレスが指定されアクセスされるメモリと、
前記第1及び第2の中央処理装置からアドレスが指定されアクセスされる入出力装置とを具備し、
前記入出力装置へのアクセスが前記第1のオペレーティングシステムに割り当てられている際において、
前記第1の中央処理装置が前記入出力装置を指定するアドレスを出力した場合は、前記入出力装置を指定するアドレスを変換せずに前記入出力装置へアクセスし、
前記第2の中央処理装置が前記入出力装置を指定するアドレスを出力した場合は、前記入出力装置を指定するアドレスを前記メモリ内に設けられた仮想デバイス領域に対応するアドレスに変換し、前記第2の中央処理装置が出力したデータを前記仮想デバイス領域に格納することを特徴とする情報処理装置。
A first central processing unit executing a first operating system;
A second central processing unit executing a second operating system;
A memory whose address is designated and accessed from the first and second central processing units;
An input / output device that is designated and accessed by the first and second central processing units;
When access to the input / output device is assigned to the first operating system,
When the first central processing unit outputs an address designating the input / output device, it accesses the input / output device without converting the address designating the input / output device,
When the second central processing unit outputs an address designating the input / output device, the address designating the input / output device is converted into an address corresponding to a virtual device area provided in the memory, An information processing apparatus, wherein data output from a second central processing unit is stored in the virtual device area.
請求項1において、
前記情報処理装置は、前記入出力装置の終了通知又は所定の時間が経過した際に、前記入出力装置へアクセスが割り当てられるオペレーティングシステムを変更するための割り当てスケジューラを更に有することを特徴とする情報処理装置。
In claim 1,
The information processing apparatus further includes an allocation scheduler for changing an operating system to which access is allocated to the input / output device when a predetermined time elapses or a notification of termination of the input / output device has elapsed. Processing equipment.
請求項2において、
前記入出力装置は、前記入出力装置を指定するアドレスで指定され、コマンドであるデータが書込まれる制御レジスタを有し、
前記情報処理装置は、前記中央処理装置から出力される前記制御レジスタを指定するアドレスを変換するアドレス変換機構を更に具備することを特徴とする情報処理装置。
In claim 2,
The input / output device is designated by an address that designates the input / output device, and has a control register in which data as a command is written,
The information processing apparatus further comprises an address conversion mechanism for converting an address designating the control register output from the central processing unit.
請求項3において、
上記メモリは、前記第1のオペレーティングシステム及び前記第2のオペレーティングシステムの夫々に対応する仮想デバイス領域を有することを特徴とする情報処理装置。
In claim 3,
The information processing apparatus, wherein the memory has virtual device areas corresponding to the first operating system and the second operating system, respectively.
請求項2において、
前記割り当てスケジューラは、仮想デバイス領域のデータに対して、そのデータが書込み用か否かの情報、書込み順序、および関連する要素間の書込みの時間間隔制約、の情報をもつことを特徴とする情報処理装置。
In claim 2,
The allocation scheduler has information on whether or not the data in the virtual device area is information for writing, information on the order of writing, and information on a time interval for writing between related elements. Processing equipment.
請求項5において、前記割り当てスケジューラによる割り当ての切替えに際して、割り当てが解除されたオペレーティングシステムに対応する仮想デバイス領域に前記入出力装置から、また新たに割当てられたオペレーティングシステムに対応する仮想デバイス領域から前記入出力装置へ、それぞれデータのコピーを行うことを特徴とする情報処理装置。   6. The allocation switching by the allocation scheduler according to claim 5, wherein a virtual device area corresponding to an operating system whose allocation has been canceled is transferred from the input / output device to a virtual device area corresponding to a newly allocated operating system and a virtual device area corresponding to a newly allocated operating system. An information processing apparatus for copying data to an entry / output apparatus. 請求項6において、
前記情報処理装置は、前記仮想デバイス領域について、データが以前の書込みから変化したかどうかを監視する書込み監視機構を更に具備し、
前記割当てスケジューラによる割当ての切替えにおいて、前記仮想デバイス領域から前記入出力装置へデータのコピーを行うに際し、前記情報処理装置は、前記書込み監視機構の情報を参照し、前回の書込みから再度書込まれた場合にのみ、書込み順序に従って、前記入出力装置に書込むことを特徴とする情報処理装置。
In claim 6,
The information processing apparatus further includes a write monitoring mechanism that monitors whether data has changed from a previous write for the virtual device area,
In the allocation switching by the allocation scheduler, when copying data from the virtual device area to the input / output device, the information processing device refers to the information of the write monitoring mechanism and is rewritten from the previous writing. An information processing apparatus that writes data to the input / output device according to a writing order only when the data is written.
請求項7において、
前記書込み監視機構は、前記仮想デバイス領域内に書込まれるデータとして使用されない値を用い、それが変更されたかどうかによって、データが以前の書込みから変化したかどうかを判定することを特徴とする情報処理装置。
In claim 7,
The write monitoring mechanism uses a value that is not used as data to be written in the virtual device area, and determines whether the data has changed from a previous write depending on whether the data has been changed. Processing equipment.
複数のオペレーティングシステムを実行する複数の中央処理装置と、
前記複数の中央処理装置からアドレスが指定されアクセスされるメモリと、
前記複数の中央処理装置からアドレスが指定されアクセスされる制御レジスタを有する入出力装置と、
前記複数の中央処理装置が出力するアドレスを所定の条件に従って変換するアドレス変換機構とを具備し、
前記制御レジスタと前記メモリは、一つのアドレス空間に含まれ、
前記メモリは、前記複数のオペレーティングシステムの夫々に対応する複数の仮想デバイス領域を有し、
前記アドレス変換機構は、前記複数のオペレーティングシステムのうち前記入出力装置が割り当てられたオペレーティングシステムを実行する中央処理装置が前記制御レジスタを指定するアドレスを出力した場合、アドレス変換を行なわず、前記複数のオペレーティングシステムのうち前記入出力装置が割り当てられていないオペレーティングシステムを実行する中央処理装置から前記制御レジスタを指定するアドレスが出力された場合、前記複数の仮想デバイス領域のうち対応する一つを指定するアドレスに変換することを特徴とする情報処理装置。
Multiple central processing units running multiple operating systems;
A memory that is addressed and accessed from the plurality of central processing units;
An input / output device having a control register whose address is designated and accessed from the plurality of central processing units;
An address conversion mechanism for converting addresses output by the plurality of central processing units according to a predetermined condition;
The control register and the memory are included in one address space,
The memory has a plurality of virtual device areas corresponding to the plurality of operating systems,
The address conversion mechanism does not perform address conversion when a central processing unit that executes the operating system to which the input / output device is assigned among the plurality of operating systems outputs an address that specifies the control register, and When an address for designating the control register is output from a central processing unit that executes an operating system to which the input / output device is not assigned among the operating systems, the corresponding one of the virtual device areas is designated. An information processing apparatus that converts the information into an address to be processed.
請求項9において、
前記アドレス変換機構は、前記複数のオペレーティングシステムの夫々に対応した複数のエントリを有し、
前記複数のエントリの夫々は、前記制御レジスタが含まれるアドレス範囲と、加算すべきオフセット値を有することを特徴とする情報処理装置。
In claim 9,
The address translation mechanism has a plurality of entries corresponding to each of the plurality of operating systems;
Each of the plurality of entries has an address range including the control register and an offset value to be added.
請求項9において、
前記複数の仮想デバイス領域の夫々は、対応するオペレーティングシステムが前記入出力装置の割り当てを解除された場合に、前記制御レジスタの内容がコピーされ、
前記制御レジスタは、前記入出力装置に割り当てられるオペレーティングシステムが変更された場合に、新規に割り当てられたオペレーティングシステムに対応する仮想デバイス領域の内容がコピーされることを特徴とする情報処理装置。
In claim 9,
Each of the plurality of virtual device areas is copied with the contents of the control register when the corresponding operating system is deallocated with the input / output device,
The information processing apparatus according to claim 1, wherein when the operating system assigned to the input / output device is changed, the contents of a virtual device area corresponding to the newly assigned operating system are copied to the control register.
請求項11において、
前記複数の仮想デバイス領域の夫々は、使用中フラグを有し、
前記使用中フラグがオフされている場合は、アクセス可能であることを特徴とする情報処理装置。
In claim 11,
Each of the plurality of virtual device areas has a busy flag,
The information processing apparatus is accessible when the busy flag is off.
請求項12において、
前記複数の仮想デバイス領域の一つの内容を前記制御レジスタへコピーしている間、及び、前記制御レジスタの内容を前記複数の仮想デバイス領域の一つへコピーしている間は、前記使用中フラグは、オンされており、アクセス不能とされることを特徴とする情報処理装置。
In claim 12,
While the contents of one of the plurality of virtual device areas are copied to the control register and while the contents of the control register are copied to one of the plurality of virtual device areas, the busy flag Is turned on and inaccessible.
JP2008116544A 2008-04-28 2008-04-28 Information processor Pending JP2009266050A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008116544A JP2009266050A (en) 2008-04-28 2008-04-28 Information processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008116544A JP2009266050A (en) 2008-04-28 2008-04-28 Information processor

Publications (1)

Publication Number Publication Date
JP2009266050A true JP2009266050A (en) 2009-11-12

Family

ID=41391804

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008116544A Pending JP2009266050A (en) 2008-04-28 2008-04-28 Information processor

Country Status (1)

Country Link
JP (1) JP2009266050A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013546111A (en) * 2010-12-23 2013-12-26 インテル・コーポレーション Direct sharing of smart devices through virtualization
JP2017515225A (en) * 2014-05-05 2017-06-08 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Coherent accelerator function separation method, system, and computer program for virtualization

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013546111A (en) * 2010-12-23 2013-12-26 インテル・コーポレーション Direct sharing of smart devices through virtualization
JP2017515225A (en) * 2014-05-05 2017-06-08 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Coherent accelerator function separation method, system, and computer program for virtualization

Similar Documents

Publication Publication Date Title
JP7384534B2 (en) Parallel processing device, computer readable storage device and method
TWI417790B (en) Logical partitioning and virtualization in a heterogeneous architecture
US8943584B2 (en) Centralized device virtualization layer for heterogeneous processing units
JP4322232B2 (en) Information processing apparatus, process control method, and computer program
JP5241737B2 (en) Method and apparatus enabling identification of resource assignments at the instruction level in a processor system
JP4668166B2 (en) Method and apparatus for guest to access memory converted device
US20060064697A1 (en) Method and apparatus for scheduling virtual machine access to shared resources
JP2005122640A (en) Server system and method for sharing i/o slot
JP5498505B2 (en) Resolving contention between data bursts
JP2005501333A (en) System for transferring to a processor
KR20070057692A (en) Information processing device, process control method, and computer program
WO2010097925A1 (en) Information processing device
US10459771B2 (en) Lightweight thread synchronization using shared memory state
Kim et al. Allowing shared libraries while supporting hardware isolation in multicore real-time systems
JP2013161299A (en) Information processing apparatus and interface access method
JP2008021252A (en) Computer system and address allocating method
US10459747B2 (en) Exitless timer access for virtual machines
US8010963B2 (en) Method, apparatus and program storage device for providing light weight system calls to improve user mode performance
WO2020008757A1 (en) Method of accessing device in virtualized environment
JP2009266050A (en) Information processor
CN108845969B (en) Operation control method and operation system suitable for incompletely symmetrical multi-processing microcontroller
Sousa et al. Runtime reconfigurable bus arbitration for concurrent applications on heterogeneous MPSoC architectures
Kim Combining hardware management with mixed-criticality provisioning in multicore real-time systems
Wellings et al. Beyond ada 2005: allocating tasks to processors in smp systems
TW201432461A (en) High throughput low latency user mode drivers implemented in managed code