WO2013125012A1 - 計算機、アクセス管理方法およびアクセス管理プログラム - Google Patents

計算機、アクセス管理方法およびアクセス管理プログラム Download PDF

Info

Publication number
WO2013125012A1
WO2013125012A1 PCT/JP2012/054427 JP2012054427W WO2013125012A1 WO 2013125012 A1 WO2013125012 A1 WO 2013125012A1 JP 2012054427 W JP2012054427 W JP 2012054427W WO 2013125012 A1 WO2013125012 A1 WO 2013125012A1
Authority
WO
WIPO (PCT)
Prior art keywords
access
allocation table
allocated
unit
pci
Prior art date
Application number
PCT/JP2012/054427
Other languages
English (en)
French (fr)
Inventor
亮 岡部
Original Assignee
三菱電機株式会社
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 三菱電機株式会社 filed Critical 三菱電機株式会社
Priority to EP12869300.9A priority Critical patent/EP2819023A4/en
Priority to US14/371,891 priority patent/US9558364B2/en
Priority to KR1020147023181A priority patent/KR101571992B1/ko
Priority to CN201280070396.6A priority patent/CN104137088A/zh
Priority to JP2014500820A priority patent/JP5925288B2/ja
Priority to PCT/JP2012/054427 priority patent/WO2013125012A1/ja
Priority to TW101113163A priority patent/TW201335851A/zh
Publication of WO2013125012A1 publication Critical patent/WO2013125012A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45587Isolation or security of virtual machine instances

Definitions

  • the present invention relates to, for example, a computer that manages access to a device from a plurality of operating systems (OS), an access management method, and an access management program.
  • OS operating systems
  • access management method access management method
  • access management program access management program
  • the virtual machine system is a system that operates multiple OSs.
  • virtual computer systems such as Xen (registered trademark) and KVM (Kernel-based Virtual Machine) (registered trademark).
  • a conventional virtual machine system starts up a plurality of OSs after setting in advance an I / O device to be occupied by each of a plurality of OSs.
  • a virtual machine monitor (VMM: Virtual Machine Monitor) permits access from each OS to a memory or a register of an I / O device occupied by the OS, and an I / O device occupied by another OS from each OS. Deny access to memory and registers.
  • the I / O device is a PCI device (including a PCI Express device; the same applies hereinafter)
  • the virtual machine monitor permits or denies access to the PCI configuration register. In this way, exclusive allocation of I / O devices to each OS has been performed. For example, in Xen, an I / O device to be occupied by the OS is specified in the setting file. In KVM, an I / O device to be occupied is specified by an OS activation option.
  • Patent Document 1 discloses a virtual machine system that switches during execution of an OS that occupies an I / O device as follows.
  • the VMM issues an I / O device occupation permission to the OS due to an I / O device occupation request by the OS or an event detection by the VMM.
  • the OS performs input / output with respect to the I / O device only when the occupation permission of the I / O device is given. For this reason, it is not necessary to perform prior setting for occupying the I / O device in any OS.
  • the memory and registers of the I / O device are not protected, it is possible to access the memory and registers of the I / O device from an OS that does not occupy the I / O device. For this reason, there is a possibility that the contents of the memory and register of the I / O device occupied by one OS may be destroyed by another OS.
  • An object of the present invention is to make it possible to correctly manage access to devices from a plurality of OSs, for example.
  • the calculator is A device allocation storage unit that stores a device allocation table for associating a device with an OS to which the device is allocated; When access to the device occurs, the OS to which the device is allocated is determined based on the device allocation table, and when the device is not allocated to any OS, the device and the access source OS Access management that updates the device allocation table to allow access to the device, and denies access to the device when the device is allocated to an OS other than the OS that is the access source.
  • OSs Operating Systems
  • access to a device from a plurality of OSs can be correctly managed.
  • FIG. 1 is a configuration diagram of a virtual computer system 100 according to Embodiment 1.
  • FIG. 3 is a flowchart showing the operation of the virtual machine system 100 according to the first embodiment.
  • FIG. 3 is a diagram illustrating a memory map of the virtual machine system 100 according to the first embodiment.
  • FIG. 6 is a diagram illustrating an initial state of the I / O allocation table 229 according to the first embodiment.
  • 5 is a flowchart showing initialization processing of the I / O allocation table 229 according to the first embodiment. The figure which shows the I / O allocation table 229 after the initialization process in Embodiment 1.
  • FIG. 5 is a flowchart showing an allocation process of the I / O device 110 according to the first embodiment.
  • FIG. 5 is a flowchart illustrating access processing to a PCI configuration register according to the first embodiment.
  • 5 is a flowchart showing a BAR change determination process (S500) in the first embodiment.
  • FIG. 10 is a diagram illustrating an I / O allocation table 229 according to the second embodiment.
  • FIG. 6 is a diagram illustrating a memory map of the virtual machine system 100 according to the second embodiment.
  • 10 is a flowchart showing initialization processing of an I / O allocation table 229 according to the second embodiment.
  • 10 is a flowchart showing an allocation process of the I / O device 110 according to the second embodiment.
  • 10 is a flowchart illustrating access processing to a PCI configuration register according to the second embodiment.
  • FIG. 4 is a configuration diagram of a virtual computer system 100 according to a third embodiment.
  • 10 is a flowchart showing initialization processing of an I / O allocation table 229 according to the third embodiment.
  • Embodiment 1 A virtual machine system that allocates a device to an OS (Operating System) of the virtual machine and occupies the device in the OS of the virtual machine will be described.
  • a virtual machine system is an example of a system in which a plurality of OSs operate.
  • FIG. 1 is a configuration diagram of a virtual computer system 100 according to the first embodiment. A hardware configuration and functional configuration of the virtual machine system 100 according to the first embodiment will be described with reference to FIG.
  • the virtual computer system 100 includes a physical computer 200 and a plurality of I / O devices 110a-c (Input / Output devices) connected to the physical computer 200.
  • the number of I / O devices 110 may be two or four or more.
  • the I / O devices 110a-c are PCI devices that use PCI (Peripheral Components Interconnect bus) as an interface.
  • the I / O device connected to the physical computer 200 may be a device other than a PCI device.
  • the PCI device stores a PCI configuration register including a BAR (base address register).
  • the BAR of the PCI configuration register indicates the base address (start address) and size of the memory space or register space (both storage areas) allocated to the PCI device.
  • a display device, a keyboard, a mouse, a printer, a communication board, an external storage device, and the like are examples of the I / O device 110.
  • the physical computer 200 (an example of a computer or a computer) is a computer including hardware 210 such as processors 211a and 211b, a main memory 212, an auxiliary storage device 213, and an interrupt controller 214.
  • the processors 211a and 211b are processing devices that control the physical computer 200, and a CPU (Central Processing Unit) is an example of the processors 211a and 211b.
  • the number of processors 211 may be one or three or more.
  • the main memory 212 is a storage device that is also called a primary storage device, and a RAM (Random Access Memory) and a ROM (Read Only Memory) are examples of the main memory 212.
  • the auxiliary storage device 213 is a storage device also called a secondary storage device, and a magnetic disk device and a flash memory are examples of the auxiliary storage device 213.
  • the interrupt controller 214 is a device that controls interrupts from the I / O devices 110a-c. For example, the interrupt controller 214 notifies the processor 211a-b of an interrupt from the I / O devices 110a-c.
  • the physical computer 200 further includes a VMM unit 220 that operates using the hardware 210 and a plurality of VM units 230a and 230b.
  • the number of VM units 230 may be three or more.
  • the VM unit 230a executes the OS 231a, the device driver 232a, and the PCI driver 233a, and operates as a virtual machine (VM).
  • the VM unit 230b executes the OS 231b, the device driver 232b, and the PCI driver 233b, and operates as a virtual computer.
  • the virtual computer is a computer that is virtually constructed by a virtual computer monitor (VMM) described later.
  • the VM unit 230a operates using the processor 211a, and the VM unit 230b operates using the processor 211b.
  • the OSs 231a and b are virtual machine OSs (or execution units that execute the virtual machine OSs).
  • the OS 231a / b does not support the virtual address space.
  • the OSs 231a and b operate with a single processor or a multiprocessor. In the embodiment, the OS 231a and b operating on a single processor will be described as an example. However, the OS 231a / b may be an OS that operates on a multiprocessor.
  • the OSs 231a and b operate by recognizing a virtual address space constructed by the memory management unit 224 as a physical address space.
  • the device drivers 232a and b are software (or execution units that execute software) for accessing the memories and registers of the I / O devices 110a-c and individually controlling the I / O devices 110a-c. Access mainly means reading data or writing data (the same applies hereinafter).
  • the PCI drivers 233a and 233b are software (or an execution unit that executes software) for accessing the PCI configuration registers of the I / O devices 110a-c.
  • the VMM unit 220 executes a virtual machine monitor (VMM) and controls a plurality of virtual machines (VM units 230a and 230b).
  • the virtual machine monitor is software for allocating hardware resources (for example, storage areas of the processor 211 and the main memory 212) to each virtual machine and constructing a plurality of virtual machines.
  • the VMM unit 220 includes a PCI emulation unit 221, an I / O emulation unit 222, an I / O allocation unit 223, a memory management unit 224, and a control unit 228.
  • the PCI emulation unit 221 emulates access to the PCI configuration register from the PCI driver 233a / b. That is, the PCI emulation unit 221 intercepts access to the PCI configuration register and accesses the PCI configuration register instead of the PCI drivers 233a and 233b.
  • the I / O emulation unit 222 emulates access to the memory and registers of the I / O device from the device drivers 232a and b. In other words, the I / O emulation unit 222 intercepts access to the memory and registers of the I / O device and accesses the memory and registers of the I / O device instead of the device drivers 232a and 232b.
  • the I / O allocation unit 223 refers to an I / O allocation table 229 described later, determines the OS 231 allocated to the I / O device 110 that has been accessed, and updates the I / O allocation table 229.
  • the memory management unit 224 defines a virtual address space for the VM unit 230a / b (OS 231a / b). For example, the memory management unit 224 generates a mapping table that associates a virtual address indicating a storage area in the virtual address space with a physical address indicating a storage area in the physical address space. That is, the memory management unit 224 maps the virtual address space and the physical address space using the mapping table.
  • the mapping mainly means associating a virtual address in the virtual address space with a physical address in the physical address space (the same applies hereinafter).
  • the control unit 228 controls the VM units 230a and 230b and initializes an I / O allocation table 229 described later.
  • FIG. 2 is a flowchart showing the operation of the virtual machine system 100 according to the first embodiment. The operation of the virtual computer system 100 in the first embodiment will be described with reference to FIG.
  • the physical computer 200 is activated.
  • a start processing unit (not shown) of the physical computer 200 executes predetermined software such as a basic input / output system (BIOS) or a boot loader (start processing of the physical computer 200).
  • BIOS basic input / output system
  • start processing of the physical computer 200 For example, in the starting process of the physical computer 200, initial setting of the physical address space and initial setting of the PCI configuration register are performed.
  • FIG. 3 is a diagram illustrating a memory map of the virtual machine system 100 according to the first embodiment. A memory map of the virtual machine system 100 according to the first embodiment will be described with reference to FIG.
  • Data in the physical memory map 310 is stored and managed by the processor 211 and the main memory 212.
  • a VM memory space 311, an I / O memory space 312, an I / O register space 313, and the like are secured.
  • the VM memory space 311 is a storage area allocated for the VMM and the OS 231.
  • the I / O memory space 312 is a storage area allocated for the memory of the I / O devices 110a-c.
  • the I / O register space 313 is a storage area allocated for registers of the I / O devices 110a-c.
  • a VM memory space 311, an I / O memory space 312, an I / O register space 313, etc. are secured in the physical address space.
  • a storage area for the VMM unit 220 is secured in the VM memory space 311, and a VMM program and data are loaded (read) from the auxiliary storage device 213 into the storage area for the VMM unit 220.
  • An I / O allocation table 229, which will be described later, is an example of data loaded into the storage area for the VMM unit 220.
  • a memory space for each of the I / O devices 110a-c is secured in the I / O memory space 312.
  • each register space of the I / O devices 110a-c is secured in the I / O register space 313 (FIG. 3 shows only the register space of the I / O device 110b).
  • the registers of the I / O devices 110a-c can be accessed.
  • the virtual memory map 320a is a diagram or data representing the usage of the virtual address space for the OS 231a
  • the virtual memory map 320b is a diagram or data representing the usage of the virtual address space for the OS 231b.
  • Data in the virtual memory maps 320a and 320b is stored and managed by the memory management unit 224 of the VMM unit 220.
  • the virtual address space for the OS 231a / b will be described later.
  • FIG. 4 is a diagram illustrating an initial state of the I / O allocation table 229 according to the first embodiment.
  • the I / O allocation table 229 according to the first embodiment will be described with reference to FIG.
  • the I / O allocation table 229 (an example of a device allocation table) is data for associating the I / O device 110 (memory or register thereof) with the OS 231 to which the I / O device 110 is allocated.
  • the I / O allocation table 229 includes “device identifier”, “allocation destination”, and “area (0 to 5)”.
  • the storage area indicated by “area n (n is 0 to 5)” corresponds to the storage area indicated by BARn of the PCI configuration register. Instead of using a single “area n” to represent a 32-bit storage area, two “areas n” may be used to represent a 64-bit storage area in the same manner as the BAR of the PCI configuration register.
  • “Area (0 to 5)” includes “base address”, “size”, and “attribute”. In the initial state, none of the items are set. Further, other information (for example, a prefetch enable / disable flag) may be included in the “area (0 to 5)”.
  • Device identifier indicates an identifier of the I / O device 110.
  • a set of a domain number, a bus number, a device number, and a function number is used as a device identifier.
  • Allocation destination indicates an identifier of the OS 231 to which the I / O device 110 is allocated.
  • NULL set in “allocation destination” means that the I / O device 110 is not allocated to any OS 231.
  • Base address indicates the top physical address of the storage area allocated for the I / O device 110.
  • the base address indicated by BARn of the PCI configuration register is set in the “base address” of “area n (n is 0 to 5)”.
  • Size indicates the size of the allocated storage area.
  • Size indicated by BARn of the PCI configuration register is set in the “size” of “area n”.
  • Attribute indicates the use of the allocated storage area. “Memory” set to “attribute” means that the allocated storage area is a memory space, and “register” set to “attribute” means that the allocated storage area is a register space. To do.
  • the VMM unit 220 is activated.
  • the control unit 228 of the VMM unit 220 executes an initialization process of the I / O allocation table 229 (see FIG. 4). The initialization process of the I / O allocation table 229 will be described later.
  • the control unit 228 of the VMM unit 220 secures a storage area for the OS 231a / b in the VM memory space 311 (see FIG. 3), and stores a VM program or data in the storage area for the OS 231a / b as an auxiliary storage device. Load (read) from 213.
  • the OS 231a / b, the device driver 232a / b, and the PCI driver 233a / b are examples of programs loaded in the storage area for the OS 231a / b.
  • the securing of the storage area for the OS 231a / b and the loading of the VM program and data may be executed in the startup process (S110) of the physical computer 200.
  • the memory management unit 224 of the VMM unit 220 defines a virtual address space for the OS 231a / b and maps a storage area for the OS 231a / b to the virtual address space (see the virtual memory map 320a / b in FIG. 3). .
  • the memory management unit 224 generates a mapping table that associates the physical address of the physical address space with the virtual address of the virtual address space. Then, the control unit 228 of the VMM unit 220 activates the VM units 230a and b.
  • the VM units 230a and b start operating.
  • the VM unit 230a / b starts operation, access to the memory and register of the I / O device 110a-c and access to the PCI configuration register occur. Processing when access occurs will be described later.
  • the VM units 230a and 230b are operated in the physical computer 200 by the operation of the virtual computer system 100 as shown in the flowchart of FIG.
  • FIG. 5 is a flowchart showing the initialization process of the I / O allocation table 229 according to the first embodiment. An initialization process for the I / O allocation table 229 according to the first embodiment will be described with reference to FIG.
  • the control unit 228 of the VMM unit 220 executes the processing from S210 to S230 for each I / O device 110 used in the physical computer 200. That is, the control unit 228 executes the processing from S210 to S230 for each of the I / O devices 110a-c.
  • the control unit 228 determines whether the memory space and the register space of the I / O device 110 are aligned on a page boundary. At this time, the control unit 228 refers to each BAR in the PCI configuration register of the I / O device 110. In each BAR, the base address and size of the memory space or register space of the I / O device 110 are set. The control unit 228 determines whether or not the base address set in each BAR is a page boundary address (page size (for example, 4 Kbyte) unit address). When the base address set in each BAR is a page boundary address, the memory space and register space of the I / O device 110 are aligned on the page boundary.
  • page boundary address page size (for example, 4 Kbyte) unit address
  • the process proceeds to S230. If the memory space and register space of the I / O device 110 are not aligned on the page boundary (NO), the process proceeds to S220.
  • control unit 228 sets the page boundary address before or after the base address to the BAR in which the base address that is not the page boundary address is set. Thereby, the memory space and the register space of the I / O device 110 can be aligned on the page boundary. After S220, the process proceeds to S230.
  • control unit 228 uses the setting value of the PCI configuration register of the I / O device 110 to store the “device identifier”, “base address”, “size”, “attribute” of the I / O device 110 in the I / O allocation table 229. "Is set. Further, the control unit 228 sets “NULL (no assigned OS 231)” as the “assignment destination” of the I / O assignment table 229.
  • FIG. 6 is a diagram showing the I / O allocation table 229 after the initialization process in the first embodiment. An example of the I / O allocation table 229 after the initialization process is shown in FIG.
  • FIG. 7 is a flowchart showing the allocation processing of the I / O device 110 according to the first embodiment. The allocation process of the I / O device 110 in the first embodiment will be described with reference to FIG.
  • the allocation processing of the I / O device 110 is executed as follows.
  • a case where access from the OS 231a to the memory space of the I / O device 110a occurs will be described.
  • the processing contents are the same as the following.
  • the OS 231b accesses any memory space or register space of the I / O devices 110a-c, the processing contents are the same as the following.
  • the device driver 232a of the OS 231a accesses the memory space of the I / O device 110a.
  • the device driver 232a designates the physical address of the memory space of the I / O device 110a and outputs an access command to the processor 211a.
  • the process proceeds to S320.
  • the processor 211a refers to the mapping table generated by the memory management unit 224 when the VMM unit 220 is activated. At this time, the virtual address corresponding to the physical address of the memory space of the I / O device 110a is not set (mapped) in the mapping table. Therefore, the processor 211a calls the VMM unit 220 by generating a page fault exception (or TLB miss exception; the same applies hereinafter).
  • the page fault exception information (data) includes the physical address of the access destination. For example, the calling of the VMM unit 220 when a page fault exception occurs may be set in the exception handler of the OS 231a / b.
  • the VMM unit 220 may be called using an exception preemption function that is a part of the virtualization support function of the physical computer 200.
  • the OS 231a / b may be operated in the non-privileged mode, and the calling of the VMM unit 220 when a page fault exception (an example of privilege violation) occurs may be set in the OS 231a / b exception vector. After S320, the process proceeds to S330.
  • the I / O allocation unit 223 of the VMM unit 220 refers to the I / O allocation table 229, and determines whether or not the cause of the page fault exception is access to the memory space or register space of the I / O device 110a. Determine. At this time, the I / O allocation unit 223 determines whether or not each “area (0 to 5)” of each I / O device registered in the I / O allocation table 229 includes an access destination physical address. To do. When the physical address of the access destination is included in the “area (0 to 5)” of any I / O device, the cause of the page fault exception is access to the memory space or register space of the I / O device 110. .
  • the I / O allocation unit 223 of the VMM unit 220 refers to the I / O allocation table 229 and determines whether or not the access destination I / O device 110a is occupied by another OS 231b.
  • the I / O allocation unit 223 sets the identifier of the other OS 231b in the “allocation destination” associated with the “device identifier” of the access destination (I / O device 110a) in the I / O allocation table 229. It is determined whether or not.
  • the access destination I / O device 110a is occupied by the other OS 231b.
  • the access destination I / O device 110a is occupied by another OS 231b (YES)
  • the process proceeds to S350. If the accessed I / O device 110a is not occupied by another OS 231b (NO), the process proceeds to S340.
  • the I / O allocation unit 223 of the VMM unit 220 sets the I / O allocation table 229. At this time, the I / O allocation unit 223 sets the identifier of the access source (OS 231a) in the “allocation destination” associated with the “device identifier” of the access destination (I / O device 110a). After S340, the process proceeds to S341.
  • the memory management unit 224 of the VMM unit 220 refers to the I / O allocation table 229, and “area (0 to 5)” associated with the “device identifier” of the access destination (I / O device 110a). Are mapped to the virtual address space of the access source OS 231a. In other words, the memory management unit 224 associates the physical address of the “area (0 to 5)” with the virtual address in the virtual address space of the OS 231a and sets it in the mapping table. After S341, the process proceeds to S342.
  • the I / O emulation unit 222 of the VMM unit 220 emulates access to the memory space of the I / O device 110a. That is, the I / O emulation unit 222 accesses the memory space of the I / O device 110a instead of the device driver 232a of the OS 231a. For example, the I / O emulation unit 222 outputs an access command to the processor 211a, and the processor 211a accesses the memory space of the I / O device 110a.
  • the process proceeds to S360.
  • control unit 228 of the VMM unit 220 executes predetermined abnormality processing for page fault exception. For example, the control unit 228 notifies the OS 231a of an error, or emulates and executes a page fault exception. After S350, the process proceeds to S360.
  • control unit 228 of the VMM unit 220 returns control to the OS 231a.
  • allocation processing of the I / O device 110 ends.
  • the processor 211a accesses the memory space of the I / O device 110a from the OS 231a.
  • the page fault exception is not generated, and the memory space of the I / O device 110a is accessed according to the access instruction.
  • the VMM unit 220 does not emulate access to the memory space of the I / O device 110a.
  • FIG. 8 is a diagram illustrating the I / O allocation table 229 after the I / O devices 110a and 110b are allocated in the first embodiment.
  • I / O allocation table 229 when the I / O device 110a is allocated to the OS 231a that has accessed the memory of the I / O device 110a, and the I / O device 110b is allocated to the OS 231b that has accessed the memory or register of the I / O device 110b. Is shown in FIG.
  • FIG. 9 is a diagram illustrating virtual memory maps 320a and 320b after the I / O devices 110a and 110b according to the first embodiment are allocated.
  • Virtual memory map 320a when the memory space of the I / O device 110a is mapped to the virtual address space of the OS 231a, and virtual memory when the memory space and register space of the I / O device 110b are mapped to the virtual address space of the OS 231b
  • a map 320b is shown in FIG.
  • FIG. 10 is a flowchart illustrating access processing to the PCI configuration register according to the first embodiment. Processing when the PCI driver 233a of the OS 231a accesses the PCI configuration register of the I / O device 110a will be described with reference to FIG. However, when the PCI driver 233a of the OS 231a accesses the PCI configuration register of the I / O devices 110b and 110c, the processing content is the same as the following. Further, when the PCI driver 233b of the OS 231b accesses the PCI configuration register of the I / O devices 110a-c, the processing content is the same as the following.
  • the PCI driver 233a of the OS 231a accesses the PCI configuration register of the I / O device 110a.
  • the PCI driver 233a specifies an address or a register number in the PCI configuration register of the I / O device 110a and outputs an access command to the processor 211a.
  • the process proceeds to S420.
  • the VMM unit 220 intercepts access to the PCI configuration register of the I / O device 110a. For example, a page in which registers (CONFIG_ADDR register and CONFIG_DATA register) for accessing the PCI configuration space are arranged is set in the processor 211a / b as a page that cannot be accessed from the OS 231a / b.
  • the processor 211a / b accesses the page (access to the PCI configuration register)
  • the processor 211a / b generates a page fault exception (or a TLB miss exception; the same applies hereinafter), and causes the VMM unit 220 to operate. call.
  • the OS 231a / b may call the VMM unit 220 to access a register for accessing the PCI configuration space. Further, when the register for accessing the PCI configuration space is mapped to the I / O address space instead of the memory space, the VMM unit 220 may be called by the protection function of the I / O address space. After S420, the process proceeds to S430.
  • the PCI emulation unit 221 of the VMM unit 220 refers to the I / O allocation table 229 and determines whether or not the access destination I / O device 110a (PCI device) is allocated to the access source OS 231a. .
  • the access destination I / O device 110a is the access source It is assigned to the OS 231a.
  • the process proceeds to S440. If the access destination I / O device 110a is not assigned to the access source OS 231a (NO), the process proceeds to S450.
  • the PCI emulation unit 221 of the VMM unit 220 determines whether the access content includes a change in the BAR of the PCI configuration register. If the access content includes a change in the BAR of the PCI configuration register (YES), the process proceeds to a BAR change determination process (S500), and then proceeds to S441. The BAR change determination process (S500) will be described separately. If the access content does not include a change in the BAR of the PCI configuration register (NO), the process proceeds to S442.
  • the PCI emulation unit 221 of the VMM unit 220 emulates access to the PCI configuration register.
  • the PCI emulation unit 221 accesses the PCI configuration register instead of the PCI driver 233a.
  • the PCI emulation unit 221 outputs an access command to the processor 211a, and the processor 211a accesses the PCI configuration register.
  • the PCI emulation unit 221 of the VMM unit 220 executes a predetermined abnormality process when accessing the PCI configuration register. For example, the PCI emulation unit 221 notifies the OS 231a of an error. After S450, the process proceeds to S460.
  • FIG. 11 is a flowchart showing the BAR change determination process (S500) in the first embodiment.
  • the BAR change determination process (S500) included in the PCI configuration register access process (see FIG. 10) will be described with reference to FIG.
  • the PCI emulation unit 221 of the VMM unit 220 determines whether or not the storage area indicated by the changed BAR is a correct storage area. For example, when the base address of the changed BAR matches the address of the page boundary, the PCI emulation unit 221 determines that the storage area indicated by the changed BAR is a correct storage area. Further, the PCI emulation unit 221 determines that the storage area indicated by the changed BAR fits in the I / O memory space 312 or the I / O register space 313. If the storage area indicated by the changed BAR is a correct storage area (YES), the process proceeds to S511. When the storage area indicated by the changed BAR is not a correct storage area (NO), the processing result of the BAR change determination process (S500) is “NG” (S530).
  • the PCI emulation unit 221 of the VMM unit 220 refers to the I / O allocation table 229 and determines whether the storage area indicated by the changed BAR is occupied by another OS 231b. At this time, the PCI emulation unit 221 uses a part of the storage area indicated by the BAR after the change to “area (0 to 5)” associated with “allocation destination” in which the identifier of the OS 231b other than the access source is set. Alternatively, it is determined whether or not everything is included.
  • the processing result of the BAR change determination process (S500) is “NG” (S530). If the storage area indicated by the changed BAR is not occupied by another OS 231b (NO), the process proceeds to S520.
  • the PCI emulation unit 221 of the VMM unit 220 includes “area (0 to 5)” associated with the “device identifier” of the access destination (I / O device 110a) of the I / O allocation table 229.
  • the “base address” and “size” of the “area (any of 0 to 5)” corresponding to the changed BAR are changed.
  • the memory management unit 224 of the VMM unit 220 changes the mapping table of the I / O device 110a according to the change of the BAR. That is, the memory management unit 224 unmaps the storage area indicated by the BAR before change from the virtual address space of the I / O device 110a, and changes the storage area indicated by the BAR after change to the virtual address space of the I / O device 110a. Map.
  • the processing result of the BAR change determination process (S500) is “OK” (S522).
  • the processors 211a and 211b are connected to the main memory 212, the auxiliary storage device 213, the interrupt controller 214, the I / O devices 110a-c and other hardware via a bus (not shown), and control these hardware. .
  • the main memory 212 or the auxiliary storage device 213 stores a program group and a file group (not shown).
  • the program group includes programs that execute the functions described as “ ⁇ units” in the embodiments.
  • a program (for example, an access control program or a virtual machine program) is read and executed by the processor 211.
  • the program causes the computer to function as “to part” and causes the computer to execute the procedures and methods of “to part”.
  • the file group includes various data (input, output, determination result, calculation result, processing result, etc.) used in “ ⁇ unit” described in the embodiment.
  • arrows included in the configuration diagrams and flowcharts mainly indicate input and output of data and signals. Processing described based on a flowchart or the like is executed using hardware 210 (for example, processor 211).
  • what is described as “to part” may be “to circuit”, “to apparatus”, and “to device”, and “to step”, “to procedure”, and “to processing”. May be. That is, what is described as “ ⁇ unit” may be implemented by any of firmware, software, hardware, or a combination thereof.
  • the virtual machine OSs 231a and b in the first embodiment are an example of a plurality of OSs operating on the physical computer 200.
  • a multi-operating system may be mounted on the physical computer 200, and the physical computer 200 may operate a plurality of OSs other than the OS of the virtual computer.
  • the register space of the PCI device is mapped to the memory space.
  • the register space of the PCI device may be mapped to the I / O address space as in a PC / AT compatible machine (PC / AT is a registered trademark).
  • PC / AT is a registered trademark
  • the protection of the register space of the PCI device mapped to the I / O address space is the I / O privilege level, the I / O permission bitmap, or the hardware virtualization support function I This can be realized by using the / O access preemption function (Intel is a registered trademark).
  • the physical computer 200 does not pre-allocate the I / O devices 110a-c to the OSs 231a and b. Instead, when the OS 231a accesses the memory space or register space of the I / O device 110a, the physical computer 200 allocates the I / O device 110a to the OS 231a in the order of arrival. Thereby, the physical computer 200 protects the memory space, the register space, and the PCI configuration register of the I / O device 110a from the OS 231b other than the OS 231a. That is, the physical computer 200 prevents access to the I / O device 110a from the OS 231b other than the OS 231a to which the I / O device 110a is allocated.
  • the prior setting of the allocation of the I / O devices 110a-c becomes unnecessary, and the memory space, the register space, and the PCI configuration register of the I / O device 110a allocated to the OS 231a It is possible to protect from the OS 231b.
  • the computer operates a plurality of OSs (OSs 231a and b) that access devices (I / O devices 110a-c).
  • the computer includes a device allocation storage unit and an access management unit (VMM unit 220).
  • the device allocation storage unit stores a device allocation table (I / O allocation table 229) for associating the device with the OS to which the device is allocated.
  • the access management unit determines an OS to which the device is allocated based on the device allocation table.
  • the access management unit updates the device assignment table to associate the device with the OS that is the access source, and permits access to the device.
  • the access management unit denies access to the device when the device is assigned to an OS other than the OS that is the access source.
  • the device allocation table is data indicating the physical address space of the device in association with the OS to which the device is allocated.
  • the access management unit further maps the physical address space of the device indicated by the device allocation table to the virtual address space of the OS of the access source.
  • the access management unit determines the OS to which the device is allocated based on the device allocation table.
  • the access management unit permits access to the PCI configuration register when the device is allocated to an access source OS.
  • the access management unit rejects access to the PCI configuration register when the device is not assigned to the OS of the access source.
  • the access management unit operates as follows when the access to the PCI configuration register is a change of the base address and the device is assigned to the OS of the access source.
  • the access management unit updates information on the physical address space of the device in the device allocation table based on the changed base address.
  • the access management unit maps the physical address space of the device indicated by the updated information to the virtual address space of the access source OS.
  • Embodiment 2 A mode in which reading of data from a memory or a register of a device is permitted to a plurality of OSs (or all OSs) according to the type of device to be accessed will be described.
  • OSs or all OSs
  • FIG. 1 A mode in which reading of data from a memory or a register of a device is permitted to a plurality of OSs (or all OSs) according to the type of device to be accessed will be described.
  • items different from the first embodiment will be mainly described. Matters whose description is omitted are the same as those in the first embodiment.
  • the configuration of the virtual machine system 100 is the same as that of the first embodiment (see FIG. 1). However, the configuration of the I / O allocation table 229 is partially different.
  • FIG. 12 is a diagram illustrating the I / O allocation table 229 according to the second embodiment.
  • the I / O allocation table 229 according to the second embodiment will be described with reference to FIG.
  • the I / O allocation table 229 includes “device type” in addition to the items described in the first embodiment (see FIGS. 4, 6, and 8). “Device type” indicates the device type (for example, bridge) of the I / O device 110.
  • the I / O allocation table 229 in FIG. 12 indicates that the I / O device 110c is “bridge”. The I / O device 110c (bridge) is not assigned to any OS 231a / b.
  • PCI configuration registers of PCI Express switches and PCI bridges are associated with other PCI devices by a tree structure and may be referred to by a plurality of OSs 231a and b. Therefore, in the second embodiment, the I / O device 110c whose allocation type is “bridge” is not allocated to any OS 231a / b, and access from each OS 231a / b to the PCI configuration register is read-only (read-only). ) Further, writing to the PCI configuration register of the I / O device 110c is permitted only to a specific management OS such as the OS (not shown) of the third VM unit and the OS (not shown) of the physical computer 200. However, the memory, register, or PCI configuration register of the I / O devices 110a ⁇ b other than the bridge may be read-only with respect to the OS 231a ⁇ b.
  • FIG. 13 is a diagram illustrating a memory map of the virtual machine system 100 according to the second embodiment.
  • the memory space of the I / O device 110c is mapped to the virtual memory map 320 (virtual address space) of both the OS 231a and the OS 231b.
  • the memory management unit 224 sets an access attribute indicating that the memory space of the I / O device 110c is read-only in the mapping table.
  • the memory management unit 224 also maps the memory space of the I / O device 110c to the virtual address space of the management OS as necessary, and sets an access attribute indicating that the memory space of the I / O device 110c is writable. Set in the mapping table.
  • FIG. 14 is a flowchart showing initialization processing of the I / O allocation table 229 according to the second embodiment. The initialization process of the I / O allocation table 229 according to the second embodiment will be described with reference to FIG.
  • the initialization process of the I / O allocation table 229 includes S240 and S241 in addition to the process described in the first embodiment (see FIG. 5). Hereinafter, S240 and S241 will be described.
  • the control unit 228 of the VMM unit 220 refers to the PCI configuration register (including information on the device type) of the I / O device 110 and determines whether the I / O device 110 is a PCI Express switch or a PCI bridge. To do. If the I / O device 110 is a PCI Express switch or a PCI bridge (YES), the process proceeds to S241. When the I / O device 110 is neither a PCI Express switch nor a PCI bridge (NO), the processing for the I / O device 110 ends.
  • control unit 228 of the VMM unit 220 sets “bridge” as the “device type” associated with the “device identifier” of the I / O device 110 in the I / O allocation table 229.
  • the processing for the I / O device 110 ends.
  • FIG. 15 is a flowchart showing the allocation processing of the I / O device 110 according to the second embodiment. The allocation process of the I / O device 110 according to the second embodiment will be described with reference to FIG.
  • the allocation process of the I / O device 110 includes S332 and S333 in addition to the process described in the first embodiment (see FIG. 7). Hereinafter, S332 will be described.
  • the I / O allocation unit 223 of the VMM unit 220 determines whether the access from the OS 231a / b is a write or read to the memory space or register space of the bridge (I / O device 110c). At this time, the I / O allocation unit 223 determines whether the content of the access command is “write” or “read”. Also, the I / O allocation unit 223 refers to the I / O allocation table 229 and determines whether the “device type” associated with the “device identifier” of the I / O device 110 to be accessed is “bridge”. Determine whether.
  • the access from the OS 231a / b is a write to the memory space or register space of the bridge (I / O device 110c) or Read. If the access from the OS 231a / b is a write to the memory space or register space of the bridge (I / O device 110c) (YES [write]), the process proceeds to S350. When the access from the OS 231a / b is reading into the memory space or register space of the bridge (I / O device 110c) (YES [reading]), the process proceeds to S333. If the access from the OS 231a / b is not writing to or reading from the memory space or register space of the bridge (I / O device 110c) (NO), the process proceeds to S331.
  • the I / O allocation unit 223 does not perform registration in the I / O allocation table 229, and maps the memory space and register space of the I / O device 110c to the virtual address space in a read-only manner. After S333, the process proceeds to S342.
  • FIG. 16 is a flowchart illustrating access processing to the PCI configuration register according to the second embodiment. The access processing to the PCI configuration register in the second embodiment will be described with reference to FIG.
  • the access processing to the PCI configuration register includes S421 in addition to the processing described in the first embodiment (see FIG. 10). Hereinafter, S421 will be described.
  • the PCI emulation unit 221 of the VMM unit 220 determines whether or not the access from the OS 231a / b is writing or reading to the PCI configuration register of the bridge (I / O device 110c).
  • the access from the OS 231a / b is a write to the PCI configuration register of the bridge (I / O device 110c) (YES [write])
  • the process proceeds to S450.
  • the PCI emulation unit 221 may determine whether the write access to the PCI configuration register of the bridge (I / O device 110c) is an access from a predetermined management OS. When the write access to the PCI configuration register of the bridge (I / O device 110c) is an access from a predetermined management OS, the process proceeds to S430 instead of S450. That is, the PCI emulation unit 221 permits writing to the PCI configuration register.
  • the second embodiment it is possible to prevent problems caused by a certain OS 231a occupying a PCI bridge (an example of a predetermined type of device) without permission or by arbitrarily changing the PCI configuration register of the PCI bridge. Can do. For example, it is possible to prevent a problem that another OS 231b becomes inaccessible to the PCI bridge and does not trace the PCI tree structure below the PCI bridge.
  • the access management unit rejects the write access when a write access occurs to the PCI configuration register of a predetermined type of device (for example, a bridge).
  • the access management unit permits the read access when a read access occurs to the PCI configuration register of the predetermined type of device.
  • the access management unit permits the write access when a write access to the PCI configuration register of the predetermined type device occurs from a predetermined management OS.
  • Embodiment 3 A mode in which the previous allocation result of the I / O devices 110a-c is used in the next virtual computer system 100 will be described.
  • items different from the first and second embodiments will be mainly described. Matters whose description is omitted are the same as in the first and second embodiments.
  • FIG. 17 is a configuration diagram of the virtual machine system 100 according to the third embodiment. The configuration of the virtual machine system 100 according to the third embodiment will be described with reference to FIG.
  • the VMM unit 220 of the physical computer 200 includes a table storage unit 225 in addition to the configuration described in the first embodiment (see FIG. 1).
  • the table storage unit 225 stores the I / O allocation table 229 (see FIG. 12) in the auxiliary storage device 213 at the end of execution of the VMM unit 220 (or at the end of execution of the VM units 230a and b).
  • the stored I / O allocation table 229 is used in the initialization process of the I / O allocation table 229 when the physical computer 200 is started next time.
  • FIG. 18 is a flowchart showing the initialization process of the I / O allocation table 229 according to the third embodiment. An initialization process for the I / O allocation table 229 according to the third embodiment will be described with reference to FIG.
  • the initialization process of the I / O allocation table 229 includes S250 to S253 in addition to the process described in the second embodiment (see FIG. 14). Hereinafter, S250 to S253 will be described.
  • the process proceeds to S250. If the third embodiment is applied to the initialization process (see FIG. 5) of the I / O allocation table 229 according to the first embodiment, the process proceeds to S250 after S230.
  • the control unit 228 of the VMM unit 220 uses the previous (or past) I / O allocation table 229 stored by the table storage unit 225 in the mode (hereinafter referred to as “takeover mode”). It is determined whether it has started. For example, the VMM unit 220 is activated by specifying a mode type indicating whether or not the user is in the takeover mode as the activation option, and the control unit 228 determines based on the mode type of the activation option. In addition, the user may switch the mode with a dip switch of the physical computer 200.
  • the previous (or past) I / O allocation table 229 is referred to as a “storage allocation table”.
  • the control unit 228 refers to the storage allocation table of the auxiliary storage device 213, and determines whether the I / O device 110 is allocated to any OS 231a / b. That is, the control unit 228 refers to the storage allocation table and determines whether any of the OSs 231a and b is set in the “allocation destination” associated with the “device identifier” of the I / O device 110. To do.
  • the I / O device 110 is assigned to any OS 231a / b (YES)
  • the process proceeds to S252. If the I / O device 110 is not assigned to any of the OSs 231a and b (NO), the processing for the I / O device 110 ends.
  • the control unit 228 allocates the I / O device 110 to the OS 231 (a or b) to which the I / O device 110 has been allocated. That is, the control unit 228 has the OS 231 in which the I / O device 110 is allocated to the “allocation destination” associated with the “device identifier” of the I / O device 110 in the I / O allocation table 229. Set the identifier. After S252, the process proceeds to S253.
  • control unit 228 (or the memory management unit 224) refers to the I / O allocation table 229, and stores the memory of the I / O device 110 in the virtual address space of the OS 231 to which the I / O device 110 is allocated. Map space and register space (physical address space). The processing for the I / O device 110 is terminated by S253.
  • the third embodiment by using the I / O allocation table 229 stored in the auxiliary storage device 213, it is possible to reduce the overhead required for allocation and mapping of the I / O devices 110a-c for each OS 231a / b.
  • the access management unit (VMM unit 220) stores the device allocation table (I / O allocation table 229) as a storage allocation table when the operation ends, and uses the storage allocation table to start a new operation when the operation starts. Generate a device allocation table.
  • 100 virtual machine system 110 I / O device, 200 physical computer, 210 hardware, 211 processor, 212 main memory, 213 auxiliary storage, 214 interrupt controller, 220 VMM unit, 221 PCI emulation unit, 222 I / O emulation unit 223 I / O allocation unit, 224 memory management unit, 225 table storage unit, 228 control unit, 229 I / O allocation table, 230 VM unit, 231 OS, 232 device driver, 233 PCI driver, 310 physical memory map, 311 VM memory space, 312 I / O memory space, 313 I / O register space, 320 virtual memory map.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Storage Device Security (AREA)

Abstract

 OS231aからI/Oデバイス110aへのアクセスが発生した場合、I/O割り付け部223はI/O割り付けテーブル229を参照し、I/Oデバイス110aが他のOS231bに割り付けられているか否かを判定する。I/Oデバイス110aが他のOS231bに割り付けられている場合、制御部228はOS231aにエラーを通知する。I/Oデバイス110aがいずれのOS231a・bにも割り付けられていない場合、I/O割り付け部223はI/Oデバイス110aをOS231aに割り付けるためにI/O割り付けテーブル229を更新し、I/Oエミュレーション部222はI/Oデバイス110aへのアクセスをエミュレーションする。

Description

計算機、アクセス管理方法およびアクセス管理プログラム
 本発明は、例えば、複数のOS(Operating System)からデバイスへのアクセスを管理する計算機、アクセス管理方法およびアクセス管理プログラムに関するものである。
 仮想計算機システムは、複数のOSを動作させるシステムである。例えば、Xen(登録商標)やKVM(Kernel-based Virtual Machine)(登録商標)などの仮想計算機システムが存在する。
 従来の仮想計算機システムは、複数のOSそれぞれに対して占有させるI/Oデバイスを事前に設定してから複数のOSを起動する。そして、仮想計算機モニタ(VMM:Virtual Machine Monitor)は、各OSから当該OSが占有するI/Oデバイスのメモリやレジスタへのアクセスを許可し、各OSから他のOSが占有するI/Oデバイスのメモリやレジスタへのアクセスを拒否する。I/OデバイスがPCIデバイス(PCI Expressデバイスを含む。以下同様)である場合、仮想計算機モニタは、PCIコンフィグレーションレジスタへのアクセスを許可または拒否する。このようにして、各OSに対するI/Oデバイスの排他的な割り付けが行われていた。
 例えば、XenではOSに占有させるI/Oデバイスを設定ファイルに指定する。また、KVMではOSの起動オプションで占有させるI/Oデバイスを指定する。
 XenやKVMなどの従来の仮想計算機システムは、OSごとに占有させるI/Oデバイスの事前設定が必要である。このため、多数のOSが動作して各OSが多数のI/Oデバイスを占有する場合、事前設定が煩雑になってしまう。
 特許文献1は、以下のようにして、I/Oデバイスを占有するOSを実行中に切り替える仮想計算機システムを開示している。
 特許文献1の仮想計算機システムにおいて、VMMはOSによるI/Oデバイス占有要求やVMMによるイベント検知を要因としてOSにI/Oデバイスの占有許可を出す。そして、OSはI/Oデバイスの占有許可が出た場合にのみI/Oデバイスに対する入出力を行う。このため、I/OデバイスをいずれかのOSに占有させるための事前設定が不要である。
 しかし、I/Oデバイスのメモリやレジスタの保護は行われないため、I/Oデバイスを占有中でないOSから当該I/Oデバイスのメモリやレジスタにアクセスすることが可能である。そのため、あるOSが占有中のI/Oデバイスのメモリやレジスタの内容を他のOSが破壊してしまう可能性がある。
特開2007-220086号公報
 本発明は、例えば、複数のOSからデバイスへのアクセスを正しく管理できるようにすることを目的とする。
 本発明の計算機は、デバイスにアクセスする複数のOS(Operating System)が動作する。
 前記計算機は、
 デバイスとデバイスが割り付けられたOSとを対応付けるためのデバイス割り付けテーブルを記憶するデバイス割り付け記憶部と、
 前記デバイスへのアクセスが発生した場合、前記デバイスが割り付けられているOSを前記デバイス割り付けテーブルに基づいて判定し、前記デバイスがいずれのOSにも割り付けられていない場合、前記デバイスとアクセス元のOSとを対応付けるために前記デバイス割り付けテーブルを更新して前記デバイスへのアクセスを許可し、前記デバイスが前記アクセス元のOS以外のOSに割り付けられている場合、前記デバイスへのアクセスを拒否するアクセス管理部とを備える。
 本発明によれば、例えば、複数のOSからデバイスへのアクセスを正しく管理することができる。
実施の形態1における仮想計算機システム100の構成図。 実施の形態1における仮想計算機システム100の動作を示すフローチャート。 実施の形態1における仮想計算機システム100のメモリマップを表す図。 実施の形態1におけるI/O割り付けテーブル229の初期状態を示す図。 実施の形態1におけるI/O割り付けテーブル229の初期化処理を示すフローチャート。 実施の形態1における初期化処理後のI/O割り付けテーブル229を示す図。 実施の形態1におけるI/Oデバイス110の割り付け処理を示すフローチャート。 実施の形態1におけるI/Oデバイス110a・bを割り付けた後のI/O割り付けテーブル229を示す図。 実施の形態1におけるI/Oデバイス110a・bを割り付けた後の仮想メモリマップ320a・bを示す図。 実施の形態1におけるPCIコンフィグレーションレジスタへのアクセス処理を示すフローチャート。 実施の形態1におけるBAR変更判定処理(S500)を示すフローチャート。 実施の形態2におけるI/O割り付けテーブル229を示す図。 実施の形態2における仮想計算機システム100のメモリマップを表す図。 実施の形態2におけるI/O割り付けテーブル229の初期化処理を示すフローチャート。 実施の形態2におけるI/Oデバイス110の割り付け処理を示すフローチャート。 実施の形態2におけるPCIコンフィグレーションレジスタへのアクセス処理を示すフローチャート。 実施の形態3における仮想計算機システム100の構成図。 実施の形態3におけるI/O割り付けテーブル229の初期化処理を示すフローチャート。
 実施の形態1.
 仮想計算機のOS(Operating System)にデバイスを割り付けて仮想計算機のOSにデバイスを占有させる仮想計算機システムについて説明する。仮想計算機システムは複数のOSが動作するシステムの一例である。
 図1は、実施の形態1における仮想計算機システム100の構成図である。
 実施の形態1における仮想計算機システム100のハードウェア構成および機能構成について、図1に基づいて説明する。
 仮想計算機システム100は、物理計算機200と、物理計算機200に接続する複数のI/Oデバイス110a-c(Input/Outputデバイス)とを備える。I/Oデバイス110の数は2つまたは4つ以上であっても構わない。
 実施の形態において、I/Oデバイス110a-cがPCI(Peripheral Components Interconnect bus)をインタフェースとして用いるPCIデバイスであるものとして説明を行う。但し、物理計算機200に接続するI/OデバイスはPCIデバイス以外のデバイスであっても構わない。
 PCIデバイスは、BAR(ベースアドレスレジスタ)を含んだPCIコンフィグレーションレジスタを記憶する。PCIコンフィグレーションレジスタのBARは、PCIデバイスに割り当てられたメモリ空間またはレジスタ空間(共に記憶領域)のベースアドレス(先頭アドレス)とサイズとを示す。
 ディスプレイ装置、キーボード、マウス、プリンタ、通信ボード、外部記憶装置などは、I/Oデバイス110の一例である。
 物理計算機200(計算機、コンピュータの一例)は、プロセッサ211a・b、メインメモリ212、補助記憶装置213および割込みコントローラ214などのハードウェア210を備えるコンピュータである。
 プロセッサ211a・bは物理計算機200を制御する処理装置であり、CPU(Central Processing Unit)はプロセッサ211a・bの一例である。プロセッサ211の数は1つまたは3つ以上であっても構わない。
 メインメモリ212は一次記憶装置とも呼ばれる記憶装置であり、RAM(Random Access Memory)やROM(Read Only Memory)はメインメモリ212の一例である。
 補助記憶装置213は二次記憶装置とも呼ばれる記憶装置であり、磁気ディスク装置やフラッシュメモリは補助記憶装置213の一例である。
 割込みコントローラ214はI/Oデバイス110a-cからの割り込みを制御する装置である。例えば、割込みコントローラ214はI/Oデバイス110a-cからの割り込みをプロセッサ211a・bに通知する。
 物理計算機200は、さらに、ハードウェア210を用いて動作するVMM部220および複数のVM部230a・bを備える。VM部230の数は3つ以上であっても構わない。
 VM部230aは、OS231a、デバイスドライバ232aおよびPCIドライバ233aを実行し、仮想計算機(VM)として動作する。同様に、VM部230bは、OS231b、デバイスドライバ232bおよびPCIドライバ233bを実行し、仮想計算機として動作する。仮想計算機は後述する仮想計算機モニタ(VMM)によって仮想的に構築される計算機である。VM部230aはプロセッサ211aを用いて動作し、VM部230bはプロセッサ211bを用いて動作するものとする。
 OS231a・bは、仮想計算機のOS(または仮想計算機のOSを実行する実行部)である。OS231a・bは仮想アドレス空間をサポートしない。また、OS231a・bはシングルプロセッサまたはマルチプロセッサで動作する。実施の形態ではシングルプロセッサで動作するOS231a・bを例にして説明する。但し、OS231a・bはマルチプロセッサで動作するOSであっても構わない。また、OS231a・bは、メモリ管理部224によって構築される仮想アドレス空間を物理アドレス空間として認識して動作する。
 デバイスドライバ232a・bは、I/Oデバイス110a-cのメモリやレジスタにアクセスしてI/Oデバイス110a-cを個別に制御するためのソフトウェア(またはソフトウェアを実行する実行部)である。アクセスとは、主に、データの読み取りまたはデータの書き込みを意味する(以下同様)。
 PCIドライバ233a・bは、I/Oデバイス110a-cのPCIコンフィグレーションレジスタにアクセスするためのソフトウェア(またはソフトウェアを実行する実行部)である。
 VMM部220(デバイス割り付け記憶部、アクセス管理部の一例)は、仮想計算機モニタ(VMM)を実行して複数の仮想計算機(VM部230a・b)を制御する。仮想計算機モニタはハードウェア資源(例えば、プロセッサ211、メインメモリ212の記憶領域)を各仮想計算機に割り当てて複数の仮想計算機を構築するためのソフトウェアである。
 VMM部220は、PCIエミュレーション部221と、I/Oエミュレーション部222と、I/O割り付け部223と、メモリ管理部224と、制御部228とを備える。
 PCIエミュレーション部221は、PCIドライバ233a・bからPCIコンフィグレーションレジスタへのアクセスをエミュレーションする。つまり、PCIエミュレーション部221は、PCIコンフィグレーションレジスタへのアクセスを横取りし、PCIドライバ233a・bの代わりにPCIコンフィグレーションレジスタにアクセスする。
 I/Oエミュレーション部222は、デバイスドライバ232a・bからI/Oデバイスのメモリやレジスタへのアクセスをエミュレーションする。つまり、I/Oエミュレーション部222は、I/Oデバイスのメモリやレジスタへのアクセスを横取りし、デバイスドライバ232a・bの代わりにI/Oデバイスのメモリやレジスタにアクセスする。
 I/O割り付け部223は、後述するI/O割り付けテーブル229を参照し、アクセスが発生したI/Oデバイス110に割り付けられているOS231を判定し、I/O割り付けテーブル229を更新する。
 メモリ管理部224は、VM部230a・b(OS231a・b)用の仮想アドレス空間を定義する。例えば、メモリ管理部224は、仮想アドレス空間内の記憶領域を示す仮想アドレスと物理アドレス空間内の記憶領域を示す物理アドレスとを対応付けるマッピングテーブルを生成する。つまり、メモリ管理部224は仮想アドレス空間と物理アドレス空間とをマッピングテーブルを用いてマッピングする。マッピングとは、主に、仮想アドレス空間の仮想アドレスと物理アドレス空間の物理アドレスとを対応付けることを意味する(以下同様)。
 制御部228は、VM部230a・bの制御や後述するI/O割り付けテーブル229の初期化を行う。
 図2は、実施の形態1における仮想計算機システム100の動作を示すフローチャートである。
 実施の形態1における仮想計算機システム100の動作について、図2に基づいて説明する。
 S110において、物理計算機200が起動する。物理計算機200が起動する場合、物理計算機200の起動処理部(図示省略)はBIOS(Basic Input/Output System)やブートローダなどの所定のソフトウェアを実行する(物理計算機200の起動処理)。
 例えば、物理計算機200の起動処理において、物理アドレス空間の初期設定やPCIコンフィグレーションレジスタの初期設定が行われる。
 図3は、実施の形態1における仮想計算機システム100のメモリマップを表す図である。
 実施の形態1における仮想計算機システム100のメモリマップについて、図3に基づいて説明する。
 物理メモリマップ310のデータは、プロセッサ211やメインメモリ212によって記憶管理される。
 物理アドレス空間には、VM用メモリ空間311、I/O用メモリ空間312、I/O用レジスタ空間313などが確保される。VM用メモリ空間311は、VMMやOS231用に割り当てる記憶領域である。I/O用メモリ空間312は、I/Oデバイス110a-cのメモリ用に割り当てる記憶領域である。I/O用レジスタ空間313は、I/Oデバイス110a-cのレジスタ用に割り当てる記憶領域である。
 物理計算機200の起動処理(図2のS110)において、以下のような物理アドレス空間の初期設定が行われる。
 物理アドレス空間にVM用メモリ空間311、I/O用メモリ空間312、I/O用レジスタ空間313などが確保される。
 VM用メモリ空間311にVMM部220用の記憶領域が確保され、VMM部220用の記憶領域にVMMのプログラムやデータが補助記憶装置213からロード(読み込み)される。後述するI/O割り付けテーブル229はVMM部220用の記憶領域にロードされるデータの一例である。
 I/O用メモリ空間312にI/Oデバイス110a-cそれぞれのメモリ空間が確保される。I/Oデバイス110a-cのメモリ空間にアクセスすることにより、I/Oデバイス110a-cのメモリにアクセスすることができる。
 I/O用レジスタ空間313にI/Oデバイス110a-cそれぞれのレジスタ空間が確保される(図3ではI/Oデバイス110bのレジスタ空間のみを示す)。I/Oデバイス110a-cのレジスタ空間にアクセスすることにより、I/Oデバイス110a-cのレジスタにアクセスすることができる。
 仮想メモリマップ320aはOS231a用の仮想アドレス空間の用途を表す図またはデータであり、仮想メモリマップ320bはOS231b用の仮想アドレス空間の用途を表す図またはデータである。仮想メモリマップ320a・bのデータはVMM部220のメモリ管理部224によって記憶管理される。OS231a・b用の仮想アドレス空間については後述する。
 図4は、実施の形態1におけるI/O割り付けテーブル229の初期状態を示す図である。
 実施の形態1におけるI/O割り付けテーブル229について、図4に基づいて説明する。
 I/O割り付けテーブル229(デバイス割り付けテーブルの一例)は、I/Oデバイス110(のメモリやレジスタ)とI/Oデバイス110が割り当てられたOS231とを対応付けるためのデータである。
 I/O割り付けテーブル229は、「デバイス識別子」と「割り付け先」と「領域(0から5)」とを含む。「領域n(nは0から5)」が示す記憶領域はPCIコンフィグレーションレジスタのBARnが示す記憶領域に対応している。1つの「領域n」を用いて32ビットの記憶領域を表す代わりに、PCIコンフィグレーションレジスタのBARと同様に2つの「領域n」を用いて64ビットの記憶領域を表しても構わない。
 「領域(0から5)」は「ベースアドレス」「サイズ」「属性」を含む。初期状態ではいずれの項目も設定されていない。また、「領域(0から5)」にその他の情報(例えば、プリフェッチ可否フラグ)を含めてもよい。
 後に設定される各項目は、以下のように機能する。
 「デバイス識別子」は、I/Oデバイス110の識別子を示す。例えば、PCIデバイスの場合、ドメイン番号、バス番号、デバイス番号、ファンクション番号の組をデバイス識別子として使用する。
 「割り付け先」は、I/Oデバイス110が割り付けられたOS231の識別子を示す。「割り付け先」に設定される「NULL」はI/Oデバイス110がいずれのOS231にも割り付けられていないことを意味する。
 「ベースアドレス」は、I/Oデバイス110用に割り当てられた記憶領域の先頭の物理アドレスを示す。「領域n(nは0から5)」の「ベースアドレス」にはPCIコンフィグレーションレジスタのBARnが示すベースアドレスが設定される。
 「サイズ」は、割り当てられた記憶領域の大きさを示す。「領域n」の「サイズ」にはPCIコンフィグレーションレジスタのBARnが示すサイズが設定される。
 「属性」は、割り当てられた記憶領域の用途を示す。「属性」に設定される「メモリ」は割り当てられた記憶領域がメモリ空間であることを意味し、「属性」に設定される「レジスタ」は割り当てられた記憶領域がレジスタ空間であることを意味する。
 図2に戻り、仮想計算機システム100の動作について説明を続ける。
 S120において、VMM部220が起動する。VMM部220が起動した場合、VMM部220の制御部228は、I/O割り付けテーブル229(図4参照)の初期化処理を実行する。I/O割り付けテーブル229の初期化処理については後述する。
 さらに、VMM部220の制御部228は、VM用メモリ空間311(図3参照)にOS231a・b用の記憶領域を確保し、OS231a・b用の記憶領域にVMのプログラムやデータを補助記憶装置213からロード(読み込み)する。OS231a・b、デバイスドライバ232a・bおよびPCIドライバ233a・bは、OS231a・b用の記憶領域にロードされるプログラムの一例である。OS231a・b用の記憶領域の確保およびVMのプログラムやデータのロードは物理計算機200の起動処理(S110)で実行してもよい。
 また、VMM部220のメモリ管理部224は、OS231a・b用の仮想アドレス空間を定義し、仮想アドレス空間にOS231a・b用の記憶領域をマッピングする(図3の仮想メモリマップ320a・b参照)。このとき、メモリ管理部224は、物理アドレス空間の物理アドレスと仮想アドレス空間の仮想アドレスとを対応付けるマッピングテーブルを生成する。
 そして、VMM部220の制御部228はVM部230a・bを起動する。
 S130において、VM部230a・bが動作を開始する。VM部230a・bが動作を開始した場合、I/Oデバイス110a-cのメモリやレジスタへのアクセスおよびPCIコンフィグレーションレジスタへのアクセスが発生する。アクセスが発生した場合の処理については後述する。
 図2のフローチャートに示すような仮想計算機システム100の動作によって、物理計算機200でVM部230a・bが稼働する。
 図5は、実施の形態1におけるI/O割り付けテーブル229の初期化処理を示すフローチャートである。
 実施の形態1におけるI/O割り付けテーブル229の初期化処理について、図5に基づいて説明する。
 VMM部220の制御部228は、物理計算機200で使用されるI/Oデバイス110別にS210からS230の処理を実行する。つまり、制御部228は、I/Oデバイス110a-cそれぞれについてS210からS230の処理を実行する。
 S210において、制御部228は、I/Oデバイス110のメモリ空間およびレジスタ空間がページ境界に整列しているか否かを判定する。
 このとき、制御部228は、I/Oデバイス110のPCIコンフィグレーションレジスタ内の各BARを参照する。各BARにはI/Oデバイス110のメモリ空間またはレジスタ空間のベースアドレスおよびサイズが設定されている。制御部228は、各BARに設定されているベースアドレスがページ境界のアドレス(ページサイズ(例えば、4Kバイト)単位のアドレス)であるか否かを判定する。各BARに設定されているベースアドレスがページ境界のアドレスである場合、I/Oデバイス110のメモリ空間およびレジスタ空間はページ境界に整列している。
 I/Oデバイス110のメモリ空間およびレジスタ空間がページ境界に整列している場合(YES)、処理はS230に進む。
 I/Oデバイス110のメモリ空間およびレジスタ空間がページ境界に整列していない場合(NO)、処理はS220に進む。
 S220において、制御部228は、ページ境界のアドレスでないベースアドレスが設定されているBARに当該ベースアドレスの前後いずれかのページ境界のアドレスを設定する。
 これにより、I/Oデバイス110のメモリ空間およびレジスタ空間をページ境界に整列させることができる。
 S220の後、処理はS230に進む。
 S230において、制御部228は、I/Oデバイス110のPCIコンフィグレーションレジスタの設定値を用いてI/O割り付けテーブル229にI/Oデバイス110の「デバイス識別子」「ベースアドレス」「サイズ」「属性」を設定する。また、制御部228は、I/O割り付けテーブル229の「割り付け先」には「NULL(割り付けられているOS231が無い)」を設定する。
 図6は、実施の形態1における初期化処理後のI/O割り付けテーブル229を示す図である。初期化処理後のI/O割り付けテーブル229の一例を図6に示す。
 図7は、実施の形態1におけるI/Oデバイス110の割り付け処理を示すフローチャートである。
 実施の形態1におけるI/Oデバイス110の割り付け処理について、図7に基づいて説明する。
 いずれのOS231a・bにも割り付けられていないI/Oデバイス110のメモリ空間またはレジスタ空間にアクセスが発生した場合、以下のようにI/Oデバイス110の割り付け処理が実行される。
 以下、OS231aからI/Oデバイス110aのメモリ空間にアクセスが発生した場合について説明する。但し、OS231aからI/Oデバイス110aのレジスタ空間にアクセスが発生した場合、およびOS231aからI/Oデバイス110bまたはcのメモリ空間またはレジスタ空間にアクセスが発生した場合も処理内容は以下と同様である。さらに、OS231bからI/Oデバイス110a-cのいずれかのメモリ空間またはレジスタ空間にアクセスが発生した場合も処理内容は以下と同様である。
 S310において、OS231aのデバイスドライバ232aは、I/Oデバイス110aのメモリ空間にアクセスする。例えば、デバイスドライバ232aは、I/Oデバイス110aのメモリ空間の物理アドレスを指定してアクセス命令をプロセッサ211aに出力する。
 S310の後、処理はS320に進む。
 S320において、プロセッサ211aは、VMM部220の起動時にメモリ管理部224によって生成されたマッピングテーブルを参照する。このとき、I/Oデバイス110aのメモリ空間の物理アドレスに対応する仮想アドレスはマッピングテーブルに設定(マッピング)されていない。そのため、プロセッサ211aは、ページフォルト例外(またはTLBミス例外。以下同様)を発生させてVMM部220を呼び出す。ページフォルト例外の情報(データ)には、アクセス先の物理アドレスが含まれる。
 例えば、ページフォルト例外の発生時のVMM部220の呼び出しをOS231a・bの例外ハンドラに設定しておいてもよい。または、物理計算機200の仮想化支援機能の一部である例外横取り機能を用いてVMM部220を呼び出してもよい。または、OS231a・bを非特権モードで動作させ、ページフォルト例外(特権違反の一例)の発生時のVMM部220の呼び出しをOS231a・bの例外ベクタに設定しておいてもよい。
 S320の後、処理はS330に進む。
 S330において、VMM部220のI/O割り付け部223は、I/O割り付けテーブル229を参照し、ページフォルト例外の原因がI/Oデバイス110aのメモリ空間またはレジスタ空間へのアクセスであるか否かを判定する。
 このとき、I/O割り付け部223は、I/O割り付けテーブル229に登録された各I/Oデバイスの各「領域(0から5)」にアクセス先の物理アドレスが含まれるか否かを判定する。アクセス先の物理アドレスがいずれかのI/Oデバイスの「領域(0から5)」に含まれる場合、ページフォルト例外の原因は該I/Oデバイス110のメモリ空間またはレジスタ空間へのアクセスである。
 ページフォルト例外の原因がI/Oデバイス110aのメモリ空間またはレジスタ空間へのアクセスである場合(YES)、処理はS331に進む。
 ページフォルト例外の原因がI/Oデバイス110aのメモリ空間またはレジスタ空間へのアクセスでない場合(NO)、処理はS350に進む。
 S331において、VMM部220のI/O割り付け部223は、I/O割り付けテーブル229を参照し、アクセス先のI/Oデバイス110aが他のOS231bに占有されているか否かを判定する。
 このとき、I/O割り付け部223は、I/O割り付けテーブル229でアクセス先(I/Oデバイス110a)の「デバイス識別子」に対応付けられた「割り付け先」に他のOS231bの識別子が設定されているか否かを判定する。「割り付け先」に他のOS231bの識別子が設定されている場合、アクセス先のI/Oデバイス110aは他のOS231bに占有されている。
 アクセス先のI/Oデバイス110aが他のOS231bに占有されている場合(YES)、処理はS350に進む。
 アクセス先のI/Oデバイス110aが他のOS231bに占有されていない場合(NO)、処理はS340に進む。
 S340において、VMM部220のI/O割り付け部223は、I/O割り付けテーブル229の設定を行う。このとき、I/O割り付け部223は、アクセス先(I/Oデバイス110a)の「デバイス識別子」に対応付けられた「割り付け先」にアクセス元(OS231a)の識別子を設定する。
 S340の後、処理はS341に進む。
 S341において、VMM部220のメモリ管理部224は、I/O割り付けテーブル229を参照し、アクセス先(I/Oデバイス110a)の「デバイス識別子」に対応付けられた「領域(0から5)」が示す全てのメモリ空間およびレジスタ空間をアクセス元のOS231aの仮想アドレス空間にマッピングする。つまり、メモリ管理部224は、当該「領域(0から5)」の物理アドレスとOS231aの仮想アドレス空間の仮想アドレスとを対応付けてマッピングテーブルに設定する。
 S341の後、処理はS342に進む。
 S342において、VMM部220のI/Oエミュレーション部222は、I/Oデバイス110aのメモリ空間へのアクセスをエミュレーションする。つまり、I/Oエミュレーション部222は、OS231aのデバイスドライバ232aの代わりにI/Oデバイス110aのメモリ空間にアクセスする。例えば、I/Oエミュレーション部222がアクセス命令をプロセッサ211aに出力し、プロセッサ211aがI/Oデバイス110aのメモリ空間にアクセスする。
 S342の後、処理はS360に進む。
 S350において、VMM部220の制御部228は、ページフォルト例外用の所定の異常処理を実行する。例えば、制御部228は、OS231aにエラー通知を行い、またはページフォルト例外をエミュレーションして実行する。
 S350の後、処理はS360に進む。
 S360において、VMM部220の制御部228はOS231aに制御を戻す。
 S360により、I/Oデバイス110の割り付け処理は終了する。
 OS231aにI/Oデバイス110aが割り付けられ、I/Oデバイス110aのメモリ空間とOS231aの仮想アドレス空間とがマッピングされた場合、プロセッサ211aはOS231aからI/Oデバイス110aのメモリ空間へアクセスが発生してもページフォルト例外を発生させず、アクセス命令に従ってI/Oデバイス110aのメモリ空間にアクセスする。この場合、VMM部220はI/Oデバイス110aのメモリ空間へのアクセスをエミュレートしない。
 図8は、実施の形態1におけるI/Oデバイス110a・bを割り付けた後のI/O割り付けテーブル229を示す図である。
 I/Oデバイス110aのメモリにアクセスしたOS231aにI/Oデバイス110aを割り付け、I/Oデバイス110bのメモリまたはレジスタにアクセスしたOS231bにI/Oデバイス110bを割り付けた場合のI/O割り付けテーブル229を図8に示す。
 図9は、実施の形態1におけるI/Oデバイス110a・bを割り付けた後の仮想メモリマップ320a・bを示す図である。
 I/Oデバイス110aのメモリ空間をOS231aの仮想アドレス空間にマッピングした場合の仮想メモリマップ320aと、I/Oデバイス110bのメモリ空間とレジスタ空間とをOS231bの仮想アドレス空間にマッピングした場合の仮想メモリマップ320bとを図9に示す。
 図10は、実施の形態1におけるPCIコンフィグレーションレジスタへのアクセス処理を示すフローチャートである。
 OS231aのPCIドライバ233aがI/Oデバイス110aのPCIコンフィグレーションレジスタにアクセスした場合の処理について、図10に基づいて説明する。但し、OS231aのPCIドライバ233aがI/Oデバイス110b・cのPCIコンフィグレーションレジスタにアクセスした場合も処理内容は以下と同様である。さらに、OS231bのPCIドライバ233bがI/Oデバイス110a-cのPCIコンフィグレーションレジスタにアクセスした場合も処理内容は以下と同様である。
 S410において、OS231aのPCIドライバ233aがI/Oデバイス110aのPCIコンフィグレーションレジスタにアクセスする。例えば、PCIドライバ233aは、I/Oデバイス110aのPCIコンフィグレーションレジスタ内のアドレスやレジスタ番号を指定してアクセス命令をプロセッサ211aに出力する。
 S410の後、処理はS420に進む。
 S420において、VMM部220は、I/Oデバイス110aのPCIコンフィグレーションレジスタへのアクセスを横取りする。
 例えば、PCIコンフィグレーション空間へのアクセス用のレジスタ(CONFIG_ADDRレジスタおよびCONFIG_DATAレジスタ)が配置されているページをOS231a・bからアクセスできないページとしてプロセッサ211a・bに設定しておく。そして、OS231a・bから当該ページへのアクセス(PCIコンフィグレーションレジスタへのアクセス)が発生した場合、プロセッサ211a・bはページフォルト例外(またはTLBミス例外。以下同様)を発生してVMM部220を呼び出す。また、OS231a・bが、PCIコンフィグレーション空間へのアクセス用のレジスタにアクセスするために、VMM部220を呼び出してもよい。また、PCIコンフィグレーション空間へのアクセス用のレジスタがメモリ空間ではなくI/Oアドレス空間にマップされる場合、I/Oアドレス空間の保護機能によってVMM部220を呼び出すようにしてもよい。
 S420の後、処理はS430に進む。
 S430において、VMM部220のPCIエミュレーション部221は、I/O割り付けテーブル229を参照し、アクセス先のI/Oデバイス110a(PCIデバイス)がアクセス元のOS231aに割り付けられているか否かを判定する。アクセス先(I/Oデバイス110a)の「デバイス識別子」に対応付けられた「割り付け先」にアクセス元(OS231a)の識別子が設定されている場合、アクセス先のI/Oデバイス110aはアクセス元のOS231aに割り付けられている。
 アクセス先のI/Oデバイス110aがアクセス元のOS231aに割り付けられている場合(YES)、処理はS440に進む。
 アクセス先のI/Oデバイス110aがアクセス元のOS231aに割り付けられていない場合(NO)、処理はS450に進む。
 S440において、VMM部220のPCIエミュレーション部221は、アクセス内容がPCIコンフィグレーションレジスタのBARの変更を含むか否かを判定する。
 アクセス内容がPCIコンフィグレーションレジスタのBARの変更を含む場合(YES)、処理はBAR変更判定処理(S500)に進み、その後、S441に進む。BAR変更判定処理(S500)については別途説明する。
 アクセス内容がPCIコンフィグレーションレジスタのBARの変更を含まない場合(NO)、処理はS442に進む。
 S441において、BAR変更判定処理(S500)の処理結果が「OK」である場合、処理はS442に進む。また、BAR変更判定処理(S500)の処理結果が「NG」である場合、処理はS450に進む。
 S442において、VMM部220のPCIエミュレーション部221は、PCIコンフィグレーションレジスタへのアクセスをエミュレーションする。このとき、PCIエミュレーション部221は、PCIドライバ233aの代わりにPCIコンフィグレーションレジスタにアクセスする。例えば、PCIエミュレーション部221がアクセス命令をプロセッサ211aに出力し、プロセッサ211aがPCIコンフィグレーションレジスタにアクセスする。
 S442の後、処理はS460に進む。
 S450において、VMM部220のPCIエミュレーション部221は、PCIコンフィグレーションレジスタへのアクセス時の所定の異常処理を実行する。例えば、PCIエミュレーション部221は、OS231aにエラー通知を行う。
 S450の後、処理はS460に進む。
 S460において、VMM部220のPCIエミュレーション部221はOS231aに制御を戻す。
 S460により、PCIコンフィグレーションレジスタへのアクセス処理は終了する。
 図11は、実施の形態1におけるBAR変更判定処理(S500)を示すフローチャートである。
 PCIコンフィグレーションレジスタへのアクセス処理(図10参照)に含まれるBAR変更判定処理(S500)について、図11に基づいて説明する。
 S510において、VMM部220のPCIエミュレーション部221は、変更後のBARが示す記憶領域が正しい記憶領域であるか否かを判定する。例えば、PCIエミュレーション部221は、変更後のBARのベースアドレスがページ境界のアドレスと一致する場合に変更後のBARが示す記憶領域が正しい記憶領域であると判定する。さらに、PCIエミュレーション部221は、変更後のBARが示す記憶領域がI/O用メモリ空間312やI/O用レジスタ空間313に収まることを判定する。
 変更後のBARが示す記憶領域が正しい記憶領域である場合(YES)、処理はS511に進む。
 変更後のBARが示す記憶領域が正しい記憶領域でない場合(NO)、BAR変更判定処理(S500)の処理結果は「NG」である(S530)。
 S511において、VMM部220のPCIエミュレーション部221は、I/O割り付けテーブル229を参照し、変更後のBARが示す記憶領域が他のOS231bに占有されているか否かを判定する。
 このとき、PCIエミュレーション部221は、アクセス元以外のOS231bの識別子が設定されている「割り付け先」に対応付けられた「領域(0から5)」に変更後のBARが示す記憶領域の一部または全部が含まれているか否かを判定する。
 変更後のBARが示す記憶領域が他のOS231bに占有されている場合(YES)、BAR変更判定処理(S500)の処理結果は「NG」である(S530)。
 変更後のBARが示す記憶領域が他のOS231bに占有されていない場合(NO)、処理はS520に進む。
 S520において、VMM部220のPCIエミュレーション部221は、I/O割り付けテーブル229のアクセス先(I/Oデバイス110a)の「デバイス識別子」に対応付けられた「領域(0から5)」のうち、変更したBARに対応する「領域(0から5のいずれか)」の「ベースアドレス」および「サイズ」を変更する。
 S520の後、処理はS521に進む。
 S521において、VMM部220のメモリ管理部224は、BARの変更に応じてI/Oデバイス110aのマッピングテーブルを変更する。つまり、メモリ管理部224は、変更前のBARが示す記憶領域をI/Oデバイス110aの仮想アドレス空間からアンマップし、変更後のBARが示す記憶領域をI/Oデバイス110aの仮想アドレス空間にマッピングする。
 BAR変更判定処理(S500)の処理結果は「OK」である(S522)。
 ここで、実施の形態における仮想計算機システム100のハードウェアについて補足する。
 プロセッサ211a・bは、バス(図示省略)を介してメインメモリ212、補助記憶装置213、割込みコントローラ214、I/Oデバイス110a-cおよびその他のハードウェアと接続され、これらのハードウェアを制御する。
 メインメモリ212または補助記憶装置213には、プログラム群やファイル群が記憶されている(図示省略)。
 プログラム群には、実施の形態において「~部」として説明した機能を実行するプログラムが含まれる。プログラム(例えば、アクセス制御プログラム、仮想計算機プログラム)は、プロセッサ211により読み出され実行される。すなわち、プログラムは、「~部」としてコンピュータを機能させるものであり、また「~部」の手順や方法をコンピュータに実行させるものである。
 ファイル群には、実施の形態において説明する「~部」で使用される各種データ(入力、出力、判定結果、計算結果、処理結果など)が含まれる。
 実施の形態において構成図およびフローチャートに含まれている矢印は主としてデータや信号の入出力を示す。
 フローチャートなどに基づいて説明する処理はハードウェア210(例えば、プロセッサ211)を用いて実行される。
 実施の形態において「~部」として説明するものは「~回路」、「~装置」、「~機器」であってもよく、また「~ステップ」、「~手順」、「~処理」であってもよい。すなわち、「~部」として説明するものは、ファームウェア、ソフトウェア、ハードウェアまたはこれらの組み合わせのいずれで実装されても構わない。
 実施の形態1における仮想計算機のOS231a・bは物理計算機200で動作する複数のOSの一例である。物理計算機200にマルチオペレーティングシステムを実装し、仮想計算機のOS以外の複数のOSを物理計算機200が動作させても構わない。
 実施の形態1において、物理計算機200は、PCIデバイスのレジスタ空間がメモリ空間にマップされている。但し、物理計算機200は、PC/AT互換機のように、PCIデバイスのレジスタ空間がI/Oアドレス空間にマップされても構わない(PC/ATは登録商標)。例えば、Intel x86 CPUの場合、I/Oアドレス空間にマップされたPCIデバイスのレジスタ空間の保護は、I/O特権レベルやI/O許可ビットマップ、あるいは、ハードウェアの仮想化支援機能のI/Oアクセス横取り機能を用いることにより実現可能である(Intelは登録商標)。
 実施の形態1において、物理計算機200は、OS231a・bに対するI/Oデバイス110a-cの事前割り付けを行わない。その代りに、物理計算機200は、OS231aによるI/Oデバイス110aのメモリ空間やレジスタ空間へのアクセスが発生した際に、先着順で、該OS231aに該I/Oデバイス110aを割り付ける。これにより、物理計算機200は、該I/Oデバイス110aのメモリ空間とレジスタ空間とPCIコンフィグレーションレジスタとを該OS231a以外のOS231bから保護する。つまり、物理計算機200は該I/Oデバイス110aを割り付けたOS231a以外のOS231bから該I/Oデバイス110aにアクセスできないようにする。
 実施の形態1により、I/Oデバイス110a-cの割り付けの事前設定が不要になり、かつ、OS231aに割り付けられたI/Oデバイス110aのメモリ空間とレジスタ空間とPCIコンフィグレーションレジスタとを他のOS231bから保護することが可能となる。
 実施の形態1において、例えば、以下のような計算機(物理計算機200)について説明した。
 計算機は、デバイス(I/Oデバイス110a-c)にアクセスする複数のOS(OS231a・b)を動作させる。
 計算機は、デバイス割り付け記憶部とアクセス管理部(VMM部220)とを備える。
 デバイス割り付け記憶部は、前記デバイスと前記デバイスが割り付けられたOSとを対応付けるためのデバイス割り付けテーブル(I/O割り付けテーブル229)を記憶する。
 アクセス管理部は、前記デバイスへのアクセスが発生した場合、前記デバイスが割り付けられているOSを前記デバイス割り付けテーブルに基づいて判定する。アクセス管理部は、前記デバイスがいずれのOSにも割り付けられていない場合、前記デバイスとアクセス元のOSとを対応付けるために前記デバイス割り付けテーブルを更新して前記デバイスへのアクセスを許可する。アクセス管理部は、前記デバイスが前記アクセス元のOS以外のOSに割り付けられている場合、前記デバイスへのアクセスを拒否する。
 前記デバイス割り付けテーブルは、前記デバイスの物理アドレス空間と前記デバイスが割り付けられたOSとを対応付けて示すデータである。
 前記アクセス管理部は、前記デバイスがいずれのOSにも割り付けられていない場合、さらに、前記デバイス割り付けテーブルが示す前記デバイスの物理アドレス空間を前記アクセス元のOSの仮想アドレス空間にマッピングする。
 前記アクセス管理部は、前記デバイスのPCIコンフィグレーションレジスタへのアクセスが発生した場合、前記デバイスが割り付けられているOSを前記デバイス割り付けテーブルに基づいて判定する。前記アクセス管理部は、前記デバイスがアクセス元のOSに割り付けられている場合、前記PCIコンフィグレーションレジスタへのアクセスを許可する。前記アクセス管理部は、前記デバイスが前記アクセス元のOSに割り付けられていない場合、前記PCIコンフィグレーションレジスタへのアクセスを拒否する。
 前記アクセス管理部は、前記PCIコンフィグレーションレジスタへのアクセスがベースアドレスの変更であり、前記デバイスが前記アクセス元のOSに割り付けられている場合、以下のように動作する。前記アクセス管理部は、変更後のベースアドレスに基づいて前記デバイス割り付けテーブル内の前記デバイスの物理アドレス空間の情報を更新する。前記アクセス管理部は、更新後の前記情報が示す前記デバイスの物理アドレス空間を前記アクセス元のOSの仮想アドレス空間にマッピングする。
 実施の形態2.
 アクセスするデバイスの種類によってデバイスのメモリやレジスタからのデータの読み込みを複数のOS(または全てのOS)に許可する形態について説明する。
 以下、実施の形態1と異なる事項について主に説明する。説明を省略する事項については実施の形態1と同様である。
 仮想計算機システム100の構成は、実施の形態1と同様である(図1参照)。
 但し、I/O割り付けテーブル229の構成が一部異なる。
 図12は、実施の形態2におけるI/O割り付けテーブル229を示す図である。
 実施の形態2におけるI/O割り付けテーブル229について、図12に基づいて説明する。
 I/O割り付けテーブル229は、実施の形態1で説明した項目(図4,6,8参照)に加えて、「デバイス種別」を有する。
 「デバイス種別」は、I/Oデバイス110のデバイス種別(例えば、ブリッジ)を示す。
 図12のI/O割り付けテーブル229は、I/Oデバイス110cが「ブリッジ」であることを示している。I/Oデバイス110c(ブリッジ)はいずれのOS231a・bにも割り付けられていない。
 PCI ExpressスイッチやPCIブリッジ(いずれもブリッジの一例)のPCIコンフィグレーションレジスタはツリー構造によって他のPCIデバイスと関連付けられているため、複数のOS231a・bから参照される場合がある。
 そこで、実施の形態2では、割り付け種別が「ブリッジ」であるI/Oデバイス110cをいずれのOS231a・bにも割り付けず、各OS231a・bからPCIコンフィグレーションレジスタへのアクセスをリードオンリー(読み取り専用)で許可する。また、I/Oデバイス110cのPCIコンフィグレーションレジスタへの書き込みは、第3のVM部のOS(図示省略)や物理計算機200のOS(図示省略)などの特定の管理OSだけに許可する。但し、ブリッジ以外のI/Oデバイス110a・bのメモリ、レジスタまたはPCIコンフィグレーションレジスタをOS231a・bに対してリードオンリーにしてもよい。
 図13は、実施の形態2における仮想計算機システム100のメモリマップを表す図である。
 図13に示すように、I/Oデバイス110cのメモリ空間はOS231aとOS231bとの両方の仮想メモリマップ320(仮想アドレス空間)にマッピングする。このとき、メモリ管理部224は、I/Oデバイス110cのメモリ空間がリードオンリーであることを示すアクセス属性をマッピングテーブルに設定する。また、メモリ管理部224は、必要に応じて管理OSの仮想アドレス空間にI/Oデバイス110cのメモリ空間をマッピングし、I/Oデバイス110cのメモリ空間が書き込み可能であることを示すアクセス属性をマッピングテーブルに設定する。
 図14は、実施の形態2におけるI/O割り付けテーブル229の初期化処理を示すフローチャートである。
 実施の形態2におけるI/O割り付けテーブル229の初期化処理について、図14に基づいて説明する。
 I/O割り付けテーブル229の初期化処理は、実施の形態1で説明した処理(図5参照)に加えて、S240とS241とを含む。以下、S240とS241とについて説明する。
 S240において、VMM部220の制御部228は、I/Oデバイス110のPCIコンフィグレーションレジスタ(デバイス種別の情報を含む)を参照し、I/Oデバイス110がPCI ExpressスイッチまたはPCIブリッジであるか判定する。
 I/Oデバイス110がPCI ExpressスイッチまたはPCIブリッジである場合(YES)、処理はS241に進む。
 I/Oデバイス110がPCI ExpressスイッチとPCIブリッジとのいずれでもない場合(NO)、当該I/Oデバイス110に対する処理は終了する。
 S241において、VMM部220の制御部228は、I/O割り付けテーブル229に対して、I/Oデバイス110の「デバイス識別子」に対応付けられた「デバイス種別」に「ブリッジ」を設定する。
 S241により、当該I/Oデバイス110に対する処理は終了する。
 図15は、実施の形態2におけるI/Oデバイス110の割り付け処理を示すフローチャートである。
 実施の形態2におけるI/Oデバイス110の割り付け処理について、図15に基づいて説明する。
 I/Oデバイス110の割り付け処理は、実施の形態1で説明した処理(図7参照)に加えて、S332およびS333を含む。以下、S332について説明する。
 S332において、VMM部220のI/O割り付け部223は、OS231a・bからのアクセスがブリッジ(I/Oデバイス110c)のメモリ空間またはレジスタ空間への書き込みまたは読み込みであるか否かを判定する。
 このとき、I/O割り付け部223は、アクセス命令の内容が「書き込み」または「読み込み」であるか否かを判定する。また、I/O割り付け部223は、I/O割り付けテーブル229を参照し、アクセス先のI/Oデバイス110の「デバイス識別子」に対応付けられた「デバイス種別」が「ブリッジ」であるか否かを判定する。アクセス命令の内容が「書き込み」または読み込みであって「デバイス種別」が「ブリッジ」である場合、OS231a・bからのアクセスはブリッジ(I/Oデバイス110c)のメモリ空間またはレジスタ空間への書き込みまたは読み込みである。
 OS231a・bからのアクセスがブリッジ(I/Oデバイス110c)のメモリ空間またはレジスタ空間への書き込みである場合(YES[書き込み])、処理はS350に進む。
 OS231a・bからのアクセスがブリッジ(I/Oデバイス110c)のメモリ空間またはレジスタ空間への読み込みである場合(YES[読み込み])、処理はS333に進む。
 OS231a・bからのアクセスがブリッジ(I/Oデバイス110c)のメモリ空間またはレジスタ空間への書き込みおよび読み込みでない場合(NO)、処理はS331に進む。
 S333において、I/O割り付け部223は、I/O割り付けテーブル229への登録は行わず、仮想アドレス空間に該I/Oデバイス110cのメモリ空間およびレジスタ空間をリードオンリーでマップする。
 S333の後、処理はS342に進む。
 図16は、実施の形態2におけるPCIコンフィグレーションレジスタへのアクセス処理を示すフローチャートである。
 実施の形態2におけるPCIコンフィグレーションレジスタへのアクセス処理について、図16に基づいて説明する。
 PCIコンフィグレーションレジスタへのアクセス処理は、実施の形態1で説明した処理(図10参照)に加えて、S421を含む。以下、S421について説明する。
 S421において、VMM部220のPCIエミュレーション部221は、OS231a・bからのアクセスがブリッジ(I/Oデバイス110c)のPCIコンフィグレーションレジスタへの書き込みまたは読み込みであるか否かを判定する。
 OS231a・bからのアクセスがブリッジ(I/Oデバイス110c)のPCIコンフィグレーションレジスタへの書き込みである場合(YES[書き込み])、処理はS450に進む。
 OS231a・bからのアクセスがブリッジ(I/Oデバイス110c)のPCIコンフィグレーションレジスタへの読み込みである場合(YES[読み込み])、デバイスが自OSに割り付けられているかどうかの検査を省略し、S442に進む。
 OS231a・bからのアクセスがブリッジ(I/Oデバイス110c)のPCIコンフィグレーションレジスタへの書き込みおよび読み込みでない場合(NO)、処理はS430に進む。
 S421において、PCIエミュレーション部221は、ブリッジ(I/Oデバイス110c)のPCIコンフィグレーションレジスタへの書き込みのアクセスが所定の管理OSからのアクセスであるか否かを判定してもよい。ブリッジ(I/Oデバイス110c)のPCIコンフィグレーションレジスタへの書き込みのアクセスが所定の管理OSからのアクセスである場合、S450ではなくS430に進む。つまり、PCIエミュレーション部221はPCIコンフィグレーションレジスタへの書き込みを許可する。
 実施の形態2により、あるOS231aが勝手にPCIブリッジ(所定の種類のデバイスの一例)を占有したり、勝手にPCIブリッジのPCIコンフィグレーションレジスタを変更したりしてしまうことによる不具合を防止することができる。例えば、他のOS231bが該PCIブリッジにアクセス不能となり、該PCIブリッジ以下のPCIのツリー構造をたどれなくなってしまう、という不具合を防止することができる。
 実施の形態2において、例えば、以下のような計算機(物理計算機200)について説明した。
 アクセス管理部(VMM部220)は、所定の種類のデバイス(例えば、ブリッジ)のPCIコンフィグレーションレジスタへ書き込みのアクセスが発生した場合、前記書き込みのアクセスを拒否する。アクセス管理部は、前記所定の種類のデバイスのPCIコンフィグレーションレジスタへ読み取りのアクセスが発生した場合、前記読み取りのアクセスを許可する。
 アクセス管理部は、前記所定の種類のデバイスのPCIコンフィグレーションレジスタへ書き込みのアクセスが所定の管理OSから発生した場合、前記書き込みのアクセスを許可する。
 実施の形態3.
 前回のI/Oデバイス110a-cの割り付け結果を次回の仮想計算機システム100で使用する形態について説明する。
 以下、実施の形態1、2と異なる事項について主に説明する。説明を省略する事項については実施の形態1、2と同様である。
 図17は、実施の形態3における仮想計算機システム100の構成図である。
 実施の形態3における仮想計算機システム100の構成について、図17に基づいて説明する。
 物理計算機200のVMM部220は、実施の形態1で説明した構成(図1参照)に加えて、テーブル保存部225を備える。
 テーブル保存部225は、VMM部220の実行終了時(またはVM部230a・bの実行終了時)にI/O割り付けテーブル229(図12参照)を補助記憶装置213に保存する。保存されたI/O割り付けテーブル229は、物理計算機200の次回以降の起動時のI/O割り付けテーブル229の初期化処理で使用される。
 図18は、実施の形態3におけるI/O割り付けテーブル229の初期化処理を示すフローチャートである。
 実施の形態3におけるI/O割り付けテーブル229の初期化処理について、図18に基づいて説明する。
 I/O割り付けテーブル229の初期化処理は、実施の形態2で説明した処理(図14参照)に加えて、S250からS253を含む。以下、S250からS253について説明する。
 S240でI/Oデバイス110がPCI ExpressスイッチとPCIブリッジとのいずれでもない場合(NO)、処理はS250に進む。
 また、実施の形態1のI/O割り付けテーブル229の初期化処理(図5参照)に実施の形態3を適用する場合はS230の後にS250に進む。
 S250において、VMM部220の制御部228は、テーブル保存部225によって保存された前回(または過去)のI/O割り付けテーブル229を利用するモード(以下、「引き継ぎモード」という)でVMM部220が起動したか否かを判定する。例えば、ユーザが引き継ぎモードか否かを示すモード種別を起動オプションとして指定してVMM部220を起動し、制御部228は起動オプションのモード種別によって判定する。また、ユーザが物理計算機200のディップスイッチによってモードを切り替えてもよい。以下、前回(または過去)のI/O割り付けテーブル229を「保存割り付けテーブル」という。
 VMM部220が引き継ぎモードで起動した場合(YES)、処理はS251に進む。
 VMM部220が引き継ぎモードで起動しなかった場合(NO)、当該I/Oデバイス110に対する処理は終了する。
 S251において、制御部228は、補助記憶装置213の保存割り付けテーブルを参照し、当該I/Oデバイス110がいずれかのOS231a・bに割り付けられていたか否かを判定する。つまり、制御部228は、保存割り付けテーブルを参照し、当該I/Oデバイス110の「デバイス識別子」に対応付けられた「割り付け先」にいずれかのOS231a・bが設定されているか否かを判定する。
 当該I/Oデバイス110がいずれかのOS231a・bに割り付けられていた場合(YES)、処理はS252に進む。
 当該I/Oデバイス110がいずれかのOS231a・bにも割り付けられていなかった場合(NO)、当該I/Oデバイス110に対する処理は終了する。
 S252において、制御部228は、当該I/Oデバイス110が割り付けられていたOS231(aまたはb)に当該I/Oデバイス110を割り付ける。つまり、制御部228は、I/O割り付けテーブル229に対して、I/Oデバイス110の「デバイス識別子」に対応付けられた「割り付け先」に当該I/Oデバイス110が割り付けられていたOS231の識別子を設定する。
 S252の後、処理はS253に進む。
 S253において、制御部228(またはメモリ管理部224)は、I/O割り付けテーブル229を参照し、当該I/Oデバイス110が割り付けられていたOS231の仮想アドレス空間に当該I/Oデバイス110のメモリ空間およびレジスタ空間(物理アドレス空間)をマッピングする。
 S253により、当該I/Oデバイス110に対する処理は終了する。
 実施の形態3により、補助記憶装置213に保存されたI/O割り付けテーブル229を利用し、各OS231a・bに対するI/Oデバイス110a-cの割り付けおよびマッピングに要するオーバヘッドを削減することができる。
 実施の形態3において、例えば、以下のような計算機(物理計算機200)について説明した。
 アクセス管理部(VMM部220)は、動作が終了する場合にデバイス割り付けテーブル(I/O割り付けテーブル229)を保存割り付けテーブルとして保存し、動作が開始する場合に前記保存割り付けテーブルを用いて新たなデバイス割り付けテーブルを生成する。
 100 仮想計算機システム、110 I/Oデバイス、200 物理計算機、210 ハードウェア、211 プロセッサ、212 メインメモリ、213 補助記憶装置、214 割込みコントローラ、220 VMM部、221 PCIエミュレーション部、222 I/Oエミュレーション部、223 I/O割り付け部、224 メモリ管理部、225 テーブル保存部、228 制御部、229 I/O割り付けテーブル、230 VM部、231 OS、232 デバイスドライバ、233 PCIドライバ、310 物理メモリマップ、311 VM用メモリ空間、312 I/O用メモリ空間、313 I/O用レジスタ空間、320 仮想メモリマップ。

Claims (9)

  1.  デバイスにアクセスする複数のOS(Operating System)が動作する計算機であって、
     デバイスとデバイスが割り付けられたOSとを対応付けるためのデバイス割り付けテーブルを記憶するデバイス割り付け記憶部と、
     前記デバイスへのアクセスが発生した場合、前記デバイスが割り付けられているOSを前記デバイス割り付けテーブルに基づいて判定し、前記デバイスがいずれのOSにも割り付けられていない場合、前記デバイスとアクセス元のOSとを対応付けるために前記デバイス割り付けテーブルを更新して前記デバイスへのアクセスを許可し、前記デバイスが前記アクセス元のOS以外のOSに割り付けられている場合、前記デバイスへのアクセスを拒否するアクセス管理部と
    を備えることを特徴とする計算機。
  2.  前記デバイス割り付けテーブルは、前記デバイスの物理アドレス空間と前記デバイスが割り付けられたOSとを対応付けて示すデータであり、
     前記アクセス管理部は、前記デバイスがいずれのOSにも割り付けられていない場合、さらに、前記デバイス割り付けテーブルが示す前記デバイスの物理アドレス空間を前記アクセス元のOSの仮想アドレス空間にマッピングする
    ことを特徴とする請求項1記載の計算機。
  3.  前記アクセス管理部は、前記デバイスのPCI(Peripheral Components Interconnect bus)コンフィグレーションレジスタへのアクセスが発生した場合、前記デバイスが割り付けられているOSを前記デバイス割り付けテーブルに基づいて判定し、前記デバイスがアクセス元のOSに割り付けられている場合、前記アクセスを許可し、前記デバイスが前記アクセス元のOSに割り付けられていない場合、前記アクセスを拒否する
    ことを特徴とする請求項2記載の計算機。
  4.  前記アクセス管理部は、前記PCIコンフィグレーションレジスタへのアクセスがベースアドレスの変更であり、前記デバイスが前記アクセス元のOSに割り付けられている場合、変更後のベースアドレスに基づいて前記デバイス割り付けテーブル内の前記デバイスの物理アドレス空間の情報を更新し、更新後の前記情報が示す前記デバイスの物理アドレス空間を前記アクセス元のOSの仮想アドレス空間にマッピングする
    ことを特徴とする請求項3記載の計算機。
  5.  前記アクセス管理部は、所定の種類のデバイスのPCIコンフィグレーションレジスタへ書き込みのアクセスが発生した場合、前記書き込みのアクセスを拒否し、前記所定の種類のデバイスのPCIコンフィグレーションレジスタへ読み取りのアクセスが発生した場合、前記読み取りのアクセスを許可する
    ことを特徴とする請求項4記載の計算機。
  6.  前記アクセス管理部は、前記所定の種類のデバイスのPCIコンフィグレーションレジスタへ書き込みのアクセスが前記複数のOS以外の所定の管理OSから発生した場合、前記書き込みのアクセスを許可する
    ことを特徴とする請求項5記載の計算機。
  7.  前記アクセス管理部は、動作が終了する場合に前記デバイス割り付けテーブルを保存割り付けテーブルとして保存し、動作が開始する場合に前記保存割り付けテーブルを用いて新たなデバイス割り付けテーブルを生成する
    ことを特徴とする請求項1から請求項6いずれかに記載の計算機。
  8.  デバイスにアクセスする複数のOS(Operating System)が動作する計算機によって実行するアクセス管理方法であって、
     前記計算機は、デバイスとデバイスが割り付けられたOSとを対応付けるためのデバイス割り付けテーブルを記憶するデバイス割り付け記憶部と、アクセス管理部とを備え、
     前記アクセス管理部が、前記デバイスへのアクセスが発生した場合、前記デバイスが割り付けられているOSを前記デバイス割り付けテーブルに基づいて判定し、前記デバイスがいずれのOSにも割り付けられていない場合、前記デバイスとアクセス元のOSとを対応付けるために前記デバイス割り付けテーブルを更新して前記デバイスへのアクセスを許可し、前記デバイスが前記アクセス元のOS以外のOSに割り付けられている場合、前記デバイスへのアクセスを拒否する
    ことを特徴とするアクセス管理方法。
  9.  請求項8記載のアクセス管理方法をコンピュータに実行させるためのアクセス管理プログラム。
PCT/JP2012/054427 2012-02-23 2012-02-23 計算機、アクセス管理方法およびアクセス管理プログラム WO2013125012A1 (ja)

Priority Applications (7)

Application Number Priority Date Filing Date Title
EP12869300.9A EP2819023A4 (en) 2012-02-23 2012-02-23 COMPUTER DEVICE, ACCESS MANAGEMENT METHOD, AND ACCESS MANAGEMENT PROGRAM
US14/371,891 US9558364B2 (en) 2012-02-23 2012-02-23 Computing machine, access management method, and access management program
KR1020147023181A KR101571992B1 (ko) 2012-02-23 2012-02-23 계산기, 액세스 관리 방법 및 컴퓨터 판독 가능한 기억 매체
CN201280070396.6A CN104137088A (zh) 2012-02-23 2012-02-23 计算机、访问管理方法以及访问管理程序
JP2014500820A JP5925288B2 (ja) 2012-02-23 2012-02-23 計算機、アクセス管理方法およびアクセス管理プログラム
PCT/JP2012/054427 WO2013125012A1 (ja) 2012-02-23 2012-02-23 計算機、アクセス管理方法およびアクセス管理プログラム
TW101113163A TW201335851A (zh) 2012-02-23 2012-04-13 計算機、存取管理方法及記錄有存取管理程式之媒體

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2012/054427 WO2013125012A1 (ja) 2012-02-23 2012-02-23 計算機、アクセス管理方法およびアクセス管理プログラム

Publications (1)

Publication Number Publication Date
WO2013125012A1 true WO2013125012A1 (ja) 2013-08-29

Family

ID=49005232

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/054427 WO2013125012A1 (ja) 2012-02-23 2012-02-23 計算機、アクセス管理方法およびアクセス管理プログラム

Country Status (7)

Country Link
US (1) US9558364B2 (ja)
EP (1) EP2819023A4 (ja)
JP (1) JP5925288B2 (ja)
KR (1) KR101571992B1 (ja)
CN (1) CN104137088A (ja)
TW (1) TW201335851A (ja)
WO (1) WO2013125012A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107783821A (zh) * 2017-01-25 2018-03-09 问众智能信息科技(北京)有限公司 车载一体虚拟化方法和装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106325563B (zh) * 2015-06-15 2021-06-04 联想企业解决方案(新加坡)有限公司 用于标识电子设备的数据存储设备及相应的方法
CN106648877B (zh) * 2015-10-28 2020-08-25 阿里巴巴集团控股有限公司 资源申请、释放方法及装置
CN109981434A (zh) * 2019-03-25 2019-07-05 华勤通讯技术有限公司 一种车载智能系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007220086A (ja) 2006-01-17 2007-08-30 Ntt Docomo Inc 入出力制御装置、入出力制御システム及び入出力制御方法
JP2008158710A (ja) * 2006-12-22 2008-07-10 Hitachi Ltd 計算機システム
JP2010186465A (ja) * 2008-12-08 2010-08-26 Nvidia Corp ヘテロジニアス処理ユニットのための集中デバイス仮想化レイヤ

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6086657A (ja) 1983-10-19 1985-05-16 Hitachi Ltd 入出力装置の占有制御装置
US5414851A (en) 1992-06-15 1995-05-09 International Business Machines Corporation Method and means for sharing I/O resources by a plurality of operating systems
JP2972501B2 (ja) 1993-09-20 1999-11-08 富士通株式会社 I/oサブシステム及びi/oサブシステムにおける排他制御方法
JPH1083373A (ja) * 1996-09-06 1998-03-31 Mitsubishi Electric Corp プログラマブルコントローラ
US6453392B1 (en) * 1998-11-10 2002-09-17 International Business Machines Corporation Method of and apparatus for sharing dedicated devices between virtual machine guests
US6820164B2 (en) * 2001-04-17 2004-11-16 International Business Machines Corporation Peripheral component interconnect bus detection in logically partitioned computer system involving authorizing guest operating system to conduct configuration input-output operation with functions of pci devices
CN1922576A (zh) * 2003-09-30 2007-02-28 扎鲁纳股份有限公司 操作系统
US7392172B2 (en) 2005-04-28 2008-06-24 Hewlett-Packard Development Company, L.P. Providing virtual device access via firmware
US8099730B2 (en) * 2006-03-30 2012-01-17 Intel Corporation Heterogeneous virtualization of host and guest OS having different register sizes using translation layer to extract device port numbers for host OS system memory addresses
JP2010128943A (ja) 2008-11-28 2010-06-10 Toshiba Corp 情報処理装置および情報処理装置の制御方法
JP5352848B2 (ja) 2008-11-28 2013-11-27 株式会社日立製作所 仮想計算機の制御方法及び計算機装置
JP4705982B2 (ja) 2008-12-11 2011-06-22 株式会社日立製作所 情報処理システム、情報処理方法、及び管理装置
JP2010186456A (ja) 2009-02-11 2010-08-26 Saito Seisakusho:Kk 電気自動車の運転音および警報の発生方法
JP2011145912A (ja) * 2010-01-15 2011-07-28 Fujitsu Ltd 仮想計算機を使用したクライアントシステム、仮想計算機を使用したクライアント制御方法及びそのプログラム
US8977724B2 (en) * 2010-03-31 2015-03-10 International Business Machines Corporation Method and system for automated operating system image loading

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007220086A (ja) 2006-01-17 2007-08-30 Ntt Docomo Inc 入出力制御装置、入出力制御システム及び入出力制御方法
JP2008158710A (ja) * 2006-12-22 2008-07-10 Hitachi Ltd 計算機システム
JP2010186465A (ja) * 2008-12-08 2010-08-26 Nvidia Corp ヘテロジニアス処理ユニットのための集中デバイス仮想化レイヤ

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2819023A4

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107783821A (zh) * 2017-01-25 2018-03-09 问众智能信息科技(北京)有限公司 车载一体虚拟化方法和装置

Also Published As

Publication number Publication date
CN104137088A (zh) 2014-11-05
KR101571992B1 (ko) 2015-11-25
EP2819023A4 (en) 2016-06-08
EP2819023A1 (en) 2014-12-31
JP5925288B2 (ja) 2016-05-25
KR20140124787A (ko) 2014-10-27
US20150302222A1 (en) 2015-10-22
JPWO2013125012A1 (ja) 2015-05-21
TW201335851A (zh) 2013-09-01
US9558364B2 (en) 2017-01-31

Similar Documents

Publication Publication Date Title
Neiger et al. Intel virtualization technology: Hardware support for efficient processor virtualization.
US20180129619A1 (en) Virtualizing interrupt prioritization and delivery
US8595487B2 (en) Virtualization hardware for device driver isolation
JP4756603B2 (ja) データプロセッサ
JP4668166B2 (ja) ゲストがメモリ変換されたデバイスにアクセスする方法及び装置
WO2015175942A1 (en) Method and apparatus for on-demand i/o channels for secure applications
US10387184B2 (en) Address based host page table selection
US20080228971A1 (en) Device modeling in a multi-core environment
JP2008305106A (ja) 仮想計算機の制御プログラムおよび仮想計算機システム
US10664304B2 (en) Application memory protection using an extended page table switching virtual machine function
US20160188354A1 (en) Efficient enabling of extended page tables
US9436495B2 (en) Protection against interrupts in virtual machine functions
JP2013161299A (ja) 情報処理装置、インタフェースアクセス方法
US10963280B2 (en) Hypervisor post-write notification of control and debug register updates
JP5925288B2 (ja) 計算機、アクセス管理方法およびアクセス管理プログラム
US20130007379A1 (en) Secure and virtualizable performance counters
Chakrabarti et al. Intel® software guard extensions (Intel® SGX) architecture for oversubscription of secure memory in a virtualized environment
US9459907B2 (en) Guest controlled malicious payload protection
US10162663B2 (en) Computer and hypervisor-based resource scheduling method
JP6679419B2 (ja) メモリ保護ユニット、メモリ管理ユニット、及びマイクロコントローラ
US9477509B2 (en) Protection against interrupts in virtual machine functions
US20160292108A1 (en) Information processing device, control program for information processing device, and control method for information processing device
Zabaljáuregui Hardware assisted virtualization intel virtualization technology
JP2001175486A (ja) 計算機システム
Uchiyama et al. Software Environments

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12869300

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2014500820

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 14371891

Country of ref document: US

REEP Request for entry into the european phase

Ref document number: 2012869300

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2012869300

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 20147023181

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE