WO2016088220A1 - Computer and control method for logical processors - Google Patents

Computer and control method for logical processors Download PDF

Info

Publication number
WO2016088220A1
WO2016088220A1 PCT/JP2014/081967 JP2014081967W WO2016088220A1 WO 2016088220 A1 WO2016088220 A1 WO 2016088220A1 JP 2014081967 W JP2014081967 W JP 2014081967W WO 2016088220 A1 WO2016088220 A1 WO 2016088220A1
Authority
WO
WIPO (PCT)
Prior art keywords
logical
physical
processor
memory
monitor
Prior art date
Application number
PCT/JP2014/081967
Other languages
French (fr)
Japanese (ja)
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 PCT/JP2014/081967 priority Critical patent/WO2016088220A1/en
Publication of WO2016088220A1 publication Critical patent/WO2016088220A1/en

Links

Images

Classifications

    • 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
    • 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]

Definitions

  • the present invention relates to suspension control of a logical CPU in a virtual machine.
  • a virtualization unit such as a hypervisor logically divides a computer resource of a physical computer, assigns it to each of a plurality of virtual computers, and operates an OS (Operating System) on the virtual computer.
  • OS Operating System
  • the virtual machine is also referred to as LPAR (Logical Partition).
  • the virtualization unit dynamically allocates a plurality of physical CPUs according to the states of the logical CPUs of the plurality of LPARs on the physical computer (see, for example, Patent Document 1).
  • Patent Document 1 describes that when a logical CPU transitions from an execution state to a dormant state, the virtualization unit releases the physical CPU assignment assigned to the logical CPU. The released physical CPU can be assigned to another logical CPU. By the control as described above, the limited computer resources possessed by the physical computer can be effectively utilized.
  • the MONITOR / MWAIT system is known as a conventional physical CPU sleep control system.
  • a physical CPU that implements the MONITOR / MWAIT system includes an instruction execution unit that executes an instruction and a MONITOR unit.
  • the MONITOR unit periodically monitors the value of a specific memory area (hereinafter referred to as a monitor area) on the physical memory registered in advance for each physical CPU. Note that a MONITOR instruction issued by the OS is used for registering the monitor area.
  • the physical CPU can be put into a sleep state by the MWAIT command issued from the OS.
  • the physical CPU that has entered the hibernation state operates in a power saving state by stopping the instruction execution unit.
  • the MONITOR section monitors the value in the monitor area even while the physical CPU is in the dormant state.
  • the OS writes a value in the monitor area via a CPU other than the CPU in the power saving state in order to release the power saving state.
  • the MONITOR unit of the physical CPU in the dormant state detects writing to the monitor area, the MONITOR unit releases the dormant state of the physical CPU by operating the instruction execution unit. As a result, the operation of the instruction execution unit is resumed.
  • the MONITOR unit that changes the physical CPU from the execution state to the hibernation state in response to a request from the OS, and that operates even when the physical CPU is in the hibernation state, In response to a request from, the physical CPU can be quickly transitioned from the sleep state to the execution state.
  • the logical CPU of the LPAR there are various correspondences between the logical CPU of the LPAR and the physical CPU of the physical computer depending on the setting. For example, there are associations in which one physical CPU is shared by a plurality of logical CPUs, associations in which a plurality of physical CPUs are assigned to one logical CPU, and the like. In the association as described above, the same physical CPU is not always assigned to the logical CPU, but the physical CPU is dynamically assigned to the logical CPU.
  • the MONITOR part of the physical CPU monitors only one monitor area. Therefore, the guest OS on each LPAR cannot register the monitor area of the logical CPU. Therefore, when the guest OS writes a value to the monitor area of the logical CPU, the MONITOR part of the physical CPU cannot detect writing to the monitor area. Accordingly, the logical CPU cannot realize the MONITOR / MWAIT control similar to the physical CPU.
  • a typical example of the invention disclosed in the present application is as follows. That is, as a computer resource, a computer including a plurality of physical processors and a physical memory connected to each of the plurality of physical processors, wherein the physical memory is logically divided into a plurality of logical partitions.
  • An operating system that stores a program that realizes a virtualization unit that allocates the computer resources, manages a plurality of logical processors and a logical memory in each of the plurality of logical partitions, and the virtualization unit
  • the plurality of physical processors manage the allocation of the plurality of physical processors so that the plurality of logical processors included in each of the logical partitions share the same plurality of physical processors.
  • Two physical processors and the operating system includes: A MONITOR instruction that designates a monitor area that is a memory area to be monitored in order to transition the processor to be managed from the hibernation state to the execution state;
  • the plurality of logical partitions includes a first logical partition having a first logical processor, a second logical processor, and a first logical memory, and running a first operating system;
  • the virtualization unit holds monitor area management information for managing an association between an identifier of a logical processor that is a target of the MONITOR instruction and an address of the monitor area in an address space managed by the operating system.
  • a MWAIT instruction for a processor is detected, the first logical processor is transitioned from an execution state to a sleep state, the first physical processor is unassigned from the first logical processor, and the second logical processor is released.
  • the virtualization unit can realize suspension control of the MONITOR / MWAIT system even in the logical processor of the logical partition by emulating various instructions in the MONITOR / MWAIT system.
  • FIG. 3 is an explanatory diagram illustrating an example of a configuration of a physical computer according to the first embodiment. It is explanatory drawing which shows the correspondence of the guest physical address space of Example 1, and a kernel virtual address space.
  • FIG. 3 is an explanatory diagram illustrating an example of CPU configuration information according to the first embodiment.
  • FIG. 3 is an explanatory diagram illustrating an example of memory configuration information according to the first embodiment.
  • FIG. 6 is an explanatory diagram illustrating an example of monitor area management information according to the first embodiment.
  • FIG. 10 is a sequence diagram illustrating a flow of instruction emulation processing in the MONITOR / MWAIT system of the shared mode logical CPU according to the first embodiment.
  • 6 is a flowchart illustrating an example of a monitor area registration process executed by the hypervisor according to the first embodiment.
  • 6 is a flowchart for explaining hibernation state transition processing executed by the hypervisor according to the first embodiment.
  • 6 is a flowchart illustrating an execution state transition process executed by the hypervisor according to the first embodiment.
  • 10 is a flowchart illustrating an execution state transition process executed by a hypervisor according to the second embodiment.
  • FIG. 1 is an explanatory diagram illustrating an example of the configuration of the physical computer according to the first embodiment.
  • the physical computer 100 includes a plurality of physical CPUs 101 and one or more physical memories 102 as computer resources.
  • the physical computer 100 includes four physical CPUs 101, a physical CPU 1 (101-1), a physical CPU 2 (101-2), a physical CPU 3 (101-3), and a physical CPU 4 (101-4).
  • the plurality of physical CPUs 101 and one or more physical memories 102 are connected via a bus or the like.
  • the physical computer 100 includes, as computer resources, storage devices such as NIC (Network Interface Card) and IO devices such as HBA (Host Bus Adapter), HDD (Hard Disk Drive), and SSD (Solid State Drive). May be.
  • storage devices such as NIC (Network Interface Card) and IO devices such as HBA (Host Bus Adapter), HDD (Hard Disk Drive), and SSD (Solid State Drive). May be.
  • HBA Hyper Bus Adapter
  • HDD Hard Disk Drive
  • SSD Solid State Drive
  • the physical CPU 101 executes a program stored in the physical memory 102.
  • the physical CPU 101 of this embodiment includes an instruction execution unit 110 and a MONITOR unit 111.
  • the instruction execution unit 110 executes various arithmetic processes according to a program.
  • the MONITOR unit 111 controls the MONITOR / MWAIT system.
  • Various functions of the physical computer 100 can be realized by the instruction execution unit 110 of the physical CPU 101 executing the program.
  • the instruction execution unit 110 of the physical CPU 101 executing the program.
  • it indicates that the program is being executed by the physical CPU 101.
  • the MONITOR unit 111 When the MONITOR unit 111 receives an MWAIT command from the OS, the MONITOR unit 111 causes the physical CPU 101 to transition from the execution state to the sleep state, and periodically monitors the value of a predetermined memory area of the physical memory 102. Also, the MONITOR unit 111 cancels the sleep state of the physical CPU 101 when detecting a WRITE command for a predetermined memory area.
  • the MWAIT instruction is an instruction for causing the processor managed by the OS to transition from the execution state to the hibernation state.
  • a predetermined memory area monitored by the MONITOR unit 111 is also referred to as a monitor area.
  • the monitor area is set by a MONITOR instruction issued by the OS.
  • the MONITOR instruction is an instruction for designating a monitor area for transitioning the CPU managed by the OS from the sleep state to the execution state.
  • a virtual environment is constructed on the physical computer 100 using the computer resources described above.
  • the virtual environment is managed by the hypervisor 120.
  • the hypervisor 120 logically divides computer resources and allocates the divided computer resources to a plurality of virtual computers (LPARs 130).
  • Each LPAR 130 includes one or more logical CPUs 131 and one or more logical memories 132, and a guest OS 140 runs on each LPAR 130.
  • the computer resource of the physical computer 100 is allocated to each of three LPAR1 (130-1), LPAR2 (130-2), and LPAR3 (130-3).
  • the guest OS1 (140-1) operates in the LPAR1 (130-1)
  • the guest OS2 (140-2) operates in the LPAR2 (130-2)
  • the guest OS3 (130-3) in the LPAR3 (130-3). 140-3) operates.
  • the LPAR1 (130-1) includes a logical CPU1 (131-1), a logical CPU2 (131-2), and a logical memory 1 (132-1).
  • the LPAR2 (130-2) includes the logical CPU3 (131-). 3), logical CPU 4 (131-4), and logical memory 2 (132-2), and LPAR 3 (130-3) includes logical CPU 5 (131-5), logical CPU 6 (131-6), And a logical memory 1 (132-3).
  • the hypervisor 120 has a physical CPU 1 (101-1) and a physical CPU 2 for the logical CPU 1 (131-1), the logical CPU 2 (131-2), the logical CPU 3 (131-3), and the logical CPU 4 (131-4). (101-2) is assigned. Specifically, the hypervisor 120 dynamically assigns the physical CPU 101 according to the usage state of the logical CPU 131. In the following description, a plurality of physical CPUs 101 are dynamically allocated according to the usage state of one logical CPU 131, that is, an allocation mode in which physical CPUs 101 are dynamically allocated to the logical CPU 131 is described as “shared mode”. To do.
  • the hypervisor 120 uniquely assigns the physical CPU 3 (101-3) to the logical CPU 5 (131-5) and uniquely assigns the physical CPU 4 (101-4) to the logical CPU 6 (131-6). assign.
  • an allocation mode in which one physical CPU 101 is uniquely assigned to one logical CPU 131 is referred to as an “occupancy mode”.
  • the hypervisor 120 also allocates a part of the memory area of the physical memory 102 as the memory area of the logical memory 132. Specifically, the hypervisor 120 manages the correspondence between the address space of the physical memory 102 and the address space of the logical memory 132. In the following description, the address space of the physical memory 102 is described as a hypervisor physical address space, and the address space of the logical memory 132 is described as a guest physical address space.
  • the guest OS 140 manages the logical memory 132 as a physical memory, and manages the correspondence between the address space and the virtual address space of the guest OS 140.
  • the hypervisor 120 includes a process scheduler 121, a memory write protection unit 122, and an instruction trap unit 123 in order to manage the configuration of the LPAR 130 and the computer resources allocated to the LPAR 130, and the LPAR configuration information 124, And monitor area management information 125 is held.
  • the process scheduler 121 manages the memory areas of the physical CPU 101 assigned to each logical CPU 131 of each LPAR 130 and the physical memory 102 assigned to each logical memory 132.
  • the memory write protector 122 prohibits writing to a part of the memory area of the physical memory 102.
  • the instruction trap unit 123 traps an instruction that matches a predetermined condition among the instructions issued from the guest OS 140.
  • the LPAR configuration information 124 is information for managing the configuration of the LPAR 130 and the computer resources allocated to the LPAR 130.
  • the LPAR configuration information 124 includes CPU configuration information 126 and memory configuration information 127. Details of the CPU configuration information 126 and the memory configuration information 127 will be described later with reference to FIGS. 3A and 3B.
  • the monitor area management information 125 is information for realizing the MONITOR / MWAIT system in the LPAR 130. Details of the monitor area management information 125 will be described later with reference to FIG.
  • the LPAR 130 is set so that the physical CPU 101 can be used directly without going through the hypervisor 120.
  • the MONITOR / MWAIT system in the logical CPU 131 can be realized.
  • the hypervisor 120 realizes the setting of the monitor area of each logical CPU 131 in order to realize the MONITOR / MWAIT method in the logical CPU 131 of the LPAR 130, and (2) each monitor area. It is necessary to implement monitoring of the issuance of WRITE instructions for Therefore, the hypervisor 120 solves the above two problems (1) and (2) using the memory write protector 122.
  • the memory write protection unit 122 when the issuance of a MONITOR instruction instructing the setting of the monitor area of the logical CPU 131 from the guest OS 140 is detected, the memory write protection unit 122 writes to the memory area related to the designated monitor area. Ban. That is, the memory write protection unit 122 sets write protection for the memory area. Furthermore, the hypervisor 120 sets the logical CPU 131 to a dormant state and cancels the assignment of the physical CPU 101 to the logical CPU 131. In addition, the hypervisor 120 monitors the issuance of a WRITE instruction to a memory area for which write protection is set via the physical CPU 101.
  • the hypervisor 120 When it is detected that a WRITE instruction is issued from the guest OS 140 to the memory area for which write protection has been set, the hypervisor 120 identifies the logical CPU 131 whose state is to be changed, and changes the identified logical CPU 131 from the sleep state to the execution state. Transition. Further, the hypervisor 120 assigns the physical CPU 101 to the logical CPU 131 according to the schedule. At this time, the memory write protection unit 122 cancels the write protection setting of the memory area where the WRITE instruction is issued.
  • the MONITOR / MWAIT control in the logical CPU 131 can be realized.
  • This problem will be described using the correspondence between the physical address space (guest physical address space 210) of the logical memory 132 managed by the LPAR 130 and the kernel virtual address space 220 managed by the guest OS 140.
  • FIG. 2 is an explanatory diagram illustrating a correspondence relationship between the guest physical address space 210 and the kernel virtual address space 220 according to the first embodiment.
  • the guest physical address space 210 is managed in units of pages, and the hypervisor 120 allocates a page of the guest physical address space 210 to a page of the kernel virtual address space 220 in response to a request from the guest OS 140.
  • the size of the monitor area designated by the conventional OS (guest OS 140) for the MONITOR unit 111 is 64 bytes corresponding to the size of the cache line.
  • the memory write protection unit 122 sets write protection for a memory area in units of pages (4 kilobytes).
  • the hypervisor 120 needs to monitor the issuance of a WRITE instruction for a memory area (page) larger than the monitor area specified by the guest OS 140.
  • the memory area excluding the monitor area among the pages for which writing is prohibited includes data variables not related to the MONITOR / MWAIT system.
  • the memory write protection function is used as it is, when the issuance (noise) of the WRITE instruction to the memory area other than the monitor area is detected among the memory areas (pages) described above, the hibernation state of the logical CPU 131 is released. .
  • the hypervisor 120 can determine which logical CPU 131 for the same reason as described above even if the memory write protection function is used as it is. It cannot be determined whether to cancel the hibernation state.
  • the hypervisor 120 manages the guest physical address of the monitor area specified by the guest OS 140, and when the issuance of the WRITE instruction to the memory area including the monitor area is detected, the guest included in the WRITE instruction Based on the physical address, the monitor area set for which logical CPU 131 is specified.
  • the problems (3) and (4) can be solved.
  • the hypervisor 120 previously sets the monitor area size (64 bytes) to the page size (4 kilobytes) for the guest OS 140.
  • the size of the monitor area matches the size of the memory area where the write protection is set, the occurrence of the problems (3) and (4) can be suppressed.
  • Example 1 describes the first method. The second method will be described in Example 2.
  • FIG. 3A is an explanatory diagram illustrating an example of the CPU configuration information 126 according to the first embodiment.
  • the CPU configuration information 126 stores information for managing the logical CPU 131 included in each LPAR 130.
  • the CPU configuration information 126 has one entry for one LPAR 130, and each entry includes an LPAR number 301, a scheduling mode 302, a logical CPU number 303, a physical CPU number 304, and a state 305.
  • the LPAR number 301 stores the identification number of the LPAR 130.
  • the scheduling mode 302 stores information related to the allocation mode of the physical CPU 101 in the logical CPU 131 included in the LPAR 130. Specifically, the scheduling mode 302 stores either “shared” indicating “shared mode” or “occupied” indicating “occupied mode”.
  • the logical CPU number 303 stores the identification number of the logical CPU 131 that the LPAR 130 has.
  • the entry of one LPAR 130 includes the same number of rows as the number of logical CPUs 131 included in the LPAR 130.
  • the physical CPU number 304 stores information indicating the allocation state of the physical CPU 101 to the logical CPU 131. Specifically, when the physical CPU 101 is assigned to the logical CPU 131, the physical CPU number 304 stores the identification number of the assigned physical CPU 101. If the physical CPU 101 is not assigned to the logical CPU 131, “no assignment” is stored in the physical CPU number 304.
  • the state 305 stores information indicating the state of the logical CPU 131. Specifically, the state 305 stores any one of “pause”, “running”, and “waiting for allocation”. “Suspended” indicates that the logical CPU 131 is in a suspended state, and “in execution” indicates that the logical CPU 131 is in an executing state and the physical CPU 101 is assigned to the logical CPU 131. “Waiting for allocation” indicates a state in which the logical CPU 131 is in an execution state but the physical CPU 101 is not allocated to the logical CPU 131.
  • FIG. 3B is an explanatory diagram illustrating an example of the memory configuration information 127 according to the first embodiment.
  • the memory configuration information 127 stores information for managing the memory area of the physical memory 102 allocated to the logical memory 132 included in the LPAR 130.
  • the memory configuration information 127 has one entry for one page of the physical memory 102, and each entry includes a hypervisor physical address 311, an allocation destination LPAR number 312, a guest physical address 313, and an attribute 314.
  • the hypervisor physical address 311 stores the start address of a page in the hypervisor physical address space.
  • the allocation LPAR number 312 stores the identification number of the LPAR 130 to which the page of the physical memory 102 is allocated.
  • the identification number of the logical CPU 131 stored in the allocation destination LPAR number 312 is the same as that stored in the LPAR number 301.
  • the guest physical address 313 stores the start address of the page of the logical memory 132 to which the page of the physical memory 102 in the guest physical address space 210 is allocated.
  • the attribute 314 stores information indicating the page attribute of the physical memory 102.
  • the attribute 314 stores information indicating that the write protection is set by the memory write protection unit 122. Specifically, when “write protection” is stored in the attribute 314, it indicates that the write protection is set for the page. When the attribute 314 is blank, the page is protected for write protection. Indicates that it has not been set.
  • the attribute 314 may store attribute information other than write protection.
  • FIG. 4 is an explanatory diagram illustrating an example of the monitor area management information 125 according to the first embodiment.
  • the monitor area management information 125 stores information for monitoring the monitor area designated for each logical CPU 131.
  • the monitor area management information 125 includes one entry for one logical CPU 131 for which a monitor area is set, and each entry includes a logical CPU number 401 and a monitor area address 402.
  • the logical CPU number 401 stores the identification number of the logical CPU 131 in which the monitor area is set.
  • the identification number of the logical CPU 131 stored in the logical CPU number 401 is the same as that stored in the LPAR number 301.
  • the monitor area address 402 stores the address of the monitor area of the logical CPU 131 in the address space managed by the guest OS 140.
  • the monitor area address 402 includes a virtual address 403 and a guest physical address 404.
  • the virtual address 403 stores a virtual address in the kernel virtual address space 220 of the monitor area specified by the guest OS 140.
  • the guest physical address 404 stores a guest physical address in the guest physical address space 210 of the monitor area.
  • the size of the monitor area is the same as the size of the conventional monitor area. That is, the size of the monitor area is 64 bytes.
  • the monitor area management information 125 manages information related to the monitor area of the logical CPU 131 in the “shared mode”. On the other hand, the monitor area of the logical CPU 131 in the “occupied mode” is not managed using the monitor area management information 125. This is because the logical CPU 131 and the physical CPU 101 in the “occupied mode” are associated one-to-one and the physical CPU 101 can be used as it is.
  • FIG. 5 is a sequence diagram illustrating the flow of instruction emulation processing in the MONITOR / MWAIT system of the shared mode logical CPU 131 according to the first embodiment.
  • the LPAR1 (130-1) having the logical CPU1 (131-1) and the logical CPU2 (131-2) in the shared mode will be described as an example. It is assumed that the physical CPU 1 (101-1) is assigned to the logical CPU 1 (131-1), and the physical CPU 2 (101-2) is assigned to the logical CPU 2 (131-2).
  • “pCPU1” is stored in the physical CPU number 304 of the row corresponding to the logical CPU1 (131-1) in the CPU configuration information 126, and “running” is stored in the state 305.
  • “pCPU2” is stored in the physical CPU number 304 of the row corresponding to the logical CPU2 (131-2), and “running” is stored in the state 305.
  • Guest OS1 (140-1) issues a MONITOR instruction to logical CPU1 (131-1) (step S501).
  • the physical CPU 1 (101-1) assigned to the logical CPU 1 (131-1) detects the issuance of the MONITOR instruction, it shifts from the processing mode of the guest OS 140 to the processing mode of the hypervisor 120 using the virtualization support function.
  • virtualization support functions “Intel VT-x” and “AMD-V” are known.
  • the hypervisor 120 refers to the CPU configuration information 126 and determines whether or not the logical CPU 1 (131-1) that sets the monitor area is in the “shared mode”. Since the logical CPU 1 (131-1) is in the “shared mode”, the instruction trap unit 123 of the hypervisor 120 traps the instruction (step S502) and executes the monitor area registration process (step S503).
  • write protection is set to the page including the monitor area designated by the guest OS1 (140-1). Details of the monitor area registration processing will be described later with reference to FIG. Note that the physical CPU 1 (101-1) shifts the processing mode of the hypervisor 120 to the processing mode of the guest OS 140 using the virtualization support function after the monitor area registration processing is completed.
  • the guest OS1 (140-1) issues an MWAIT command for the logical CPU1 (131-1) (step S504).
  • the hypervisor 120 refers to the CPU configuration information 126 and determines whether or not the logical CPU 1 (131-1) that sets the monitor area is in the “shared mode”. Since the logical CPU 1 (131-1) is in the “shared mode”, the instruction trap unit 123 of the hypervisor 120 traps the instruction (step S505) and executes a dormant state transition process (step S506).
  • the logical CPU 1 (131-1) transitions from the execution state to the dormant state, and the assignment of the physical CPU 1 (101-1) to the logical CPU 1 (131-1) is released. Details of the dormant state transition process will be described later with reference to FIG.
  • the physical CPU 1 (101-1) shifts from the processing mode of the hypervisor 120 to the processing mode of the guest OS 140 using the virtualization support function after the hibernation state transition processing is completed.
  • the guest OS1 (140-1) issues a WRITE command to the monitor area of the logical CPU1 (131-1) using the logical CPU2 (131-2) (step S507).
  • the physical CPU 2 (101-2) assigned to the logical CPU 2 (131-2) receives the WRITE command.
  • the process of the guest OS 140 is performed using the virtualization support function.
  • the mode is changed to the processing mode of the hypervisor 120.
  • the instruction trap unit 123 of the hypervisor 120 traps the WRITE instruction to the monitor area (step S508) and executes the execution state transition process (step S509).
  • the logical CPU 1 transitions from the sleep state to the execution state. Details of the execution state transition process will be described later with reference to FIG.
  • the physical CPU 2 (101-2) shifts from the processing mode of the hypervisor 120 to the processing mode of the guest OS 140 using the virtualization support function after the execution state transition processing is completed.
  • the process scheduler 121 of the hypervisor 120 assigns the physical CPU 1 (101-1) to the logical CPU 1 (131-1) according to the schedule (step S510), and further updates the CPU configuration information 126 (step S511).
  • the hypervisor 120 compares the priorities of the logical CPU 1 (131-1) and the logical CPU 3 (131-3).
  • the hypervisor 120 When the priority of the logical CPU 1 (131-1) is higher than the priority of the logical CPU 3 (131-3), the hypervisor 120 forcibly assigns the physical CPU 1 (101-1) to the logical CPU 3 (131-3). The physical CPU 1 (101-1) is assigned to the logical CPU 1 (131-1). When the priority of the logical CPU 1 (131-1) is lower than the priority of the logical CPU 3 (131-3), the hypervisor 120 deallocates the physical CPU 1 (101-1) to the logical CPU 3 (131-3). Wait for
  • FIG. 6 is a flowchart for explaining an example of the monitor area registration process executed by the hypervisor 120 according to the first embodiment.
  • the MONITOR instruction includes “Ad_mon10” as a virtual address of the monitor area.
  • the guest physical address corresponding to the virtual address “Ad_mon10” is assumed to be “L1_Ad_mon10”.
  • the hypervisor 120 refers to the CPU configuration information 126 based on the identification number of the logical CPU 131, and determines whether or not the allocation mode of the logical CPU 131 is “shared mode” (step S601). Specifically, the following processing is executed.
  • the hypervisor 120 searches for a line in which the logical CPU number 303 matches the identification number of the logical CPU 131 that is the target of the MONITOR instruction.
  • the hypervisor 120 determines whether or not the scheduling mode 302 of the retrieved row is “shared”. When the scheduling mode 302 of the retrieved row is “shared”, the hypervisor 120 determines that the allocation mode of the logical CPU 131 is “shared mode”.
  • the hypervisor 120 shifts from the processing mode of the hypervisor 120 to the processing mode of the guest OS 140 using the virtualization support function, and ends the processing.
  • the MONITOR instruction is directly executed on the physical CPU 101. That is, emulation by the hypervisor 120 is not performed.
  • the hypervisor 120 refers to the monitor area management information 125 (step S602), and the monitor area specified by the MONITOR instruction is specified in the monitor area management information 125. It is determined whether it is registered (step S603).
  • the hypervisor 120 searches for an entry in which the logical CPU number 401 matches the identification number of the logical CPU 131 that is the target of the MONITOR instruction. If the entry does not exist, the hypervisor 120 determines that the monitor area specified by the MONITOR instruction is not registered in the monitor area management information 125.
  • the hypervisor 120 registers the monitor area in the monitor area management information 125 (step S606). Thereafter, the hypervisor 120 proceeds to step S607.
  • the hypervisor 120 adds a new entry to the monitor area management information 125 and sets the identification number of the logical CPU 131 that is the target of the MONITOR instruction in the logical CPU number 401. Further, the hypervisor 120 sets the virtual address of the monitor area in the virtual address 403 of the added entry, and sets the guest physical address of the monitor area in the guest physical address 404. For example, “Ad_mon10” is set in the virtual address 403, and “L1_Ad_mon10” is set in the guest physical address 404.
  • the hypervisor 120 determines whether or not the registered monitor area matches the monitor area specified by the MONITOR instruction. Is determined (step S604).
  • the hypervisor 120 determines whether or not the virtual address 403 of the entry searched in step S603 matches the virtual address included in the MONITOR instruction. For example, the hypervisor 120 searches for an entry in which “Ad_mon10” is stored in the virtual address 403.
  • the hypervisor 120 ends the process.
  • the hypervisor 120 cancels the write protection setting of the memory area including the registered monitor area (step S605). Specifically, the following processing is executed.
  • the hypervisor 120 refers to the memory configuration information 127 and searches for an entry in which the guest physical address 313 matches the guest physical address 404 of the entry searched in step S603. For example, the hypervisor 120 searches for an entry whose guest physical address 313 is “L1_Ad_mon10”.
  • the memory write protection unit 122 of the hypervisor 120 cancels the write protection setting of the memory area including the monitor area based on the address set as the hypervisor physical address 311 of the retrieved entry. Further, the hypervisor 120 rewrites the attribute 314 of the searched entry to a blank.
  • the hypervisor 120 registers the monitor area in the monitor area management information 125 (step S606).
  • the hypervisor 120 changes the values of the virtual address 403 and guest physical address 404 of the entry searched in step S603 to the virtual address and guest physical address of the monitor area included in the MONITOR instruction. For example, the virtual address 403 is changed to “Ad_mon10”, and the guest physical address 404 is changed to “L1_Ad_mon10”.
  • the memory write protection unit 122 of the hypervisor 120 sets write protection for the page including the monitor area (step S607). Also, the memory configuration information 127 is updated (step S608). Thereafter, the hypervisor 120 ends the process.
  • the hypervisor 120 refers to the memory configuration information 127 and searches for an entry that matches the guest physical address 404 of the entry corresponding to the monitor area in which the guest physical address 313 is registered. The hypervisor 120 sets “write protection” to the attribute 314 of the retrieved entry.
  • FIG. 7 is a flowchart for explaining hibernation state transition processing executed by the hypervisor 120 according to the first embodiment.
  • the hypervisor 120 refers to the CPU configuration information 126 based on the identification number of the logical CPU 131 included in the MWAIT instruction, and determines whether or not the allocation mode of the logical CPU 131 is “shared mode” (step S701).
  • the process in step S701 is the same as the process in step S601.
  • the hypervisor 120 shifts from the processing mode of the hypervisor 120 to the processing mode of the guest OS 140 using the virtualization support function, and ends the processing.
  • the MWAIT instruction is directly executed to the physical CPU 101. That is, emulation by the hypervisor 120 is not performed.
  • the hypervisor 120 updates the CPU configuration information 126 (step S702).
  • the hypervisor 120 sets “pause” in the state 305 of the row of the logical CPU 131 searched in step S701.
  • the hypervisor 120 changes the state of the logical CPU 131 that is the target of the MWAIT instruction to the sleep state (step S703), and releases the physical CPU 101 assigned to the logical CPU 131 (step S704). Further, the hypervisor 120 updates the CPU configuration information 126 (step S705), and thereafter ends the process.
  • the hypervisor 120 sets “not assigned” to the physical CPU number 304 in the row of the logical CPU 131 searched in step S701.
  • FIG. 8 is a flowchart for explaining execution state transition processing executed by the hypervisor 120 according to the first embodiment.
  • the physical CPU 101 When the physical CPU 101 detects an exception process by the WRITE instruction for the memory area where the write protection is set, the physical CPU 101 shifts from the processing mode of the guest OS 140 to the processing mode of the hypervisor 120 using the virtualization support function.
  • the hypervisor 120 detects that it is a WRITE command for the memory area where the write protection is set by the transition of the processing mode described above (step S801).
  • the hypervisor 120 determines based on the monitor area management information 125 whether or not the WRITE instruction for the memory area for which write protection is set is a WRITE instruction for the monitor area (step S802). Specifically, the following processing is executed.
  • the hypervisor 120 searches for an entry in which the virtual address 403 matches the virtual address included in the WRITE instruction. If there is an entry in which the virtual address 403 matches the virtual address included in the WRITE instruction, the hypervisor 120 determines that the WRITE instruction for the memory area for which write protection is set is a WRITE instruction for the monitor area.
  • the hypervisor 120 identifies the logical CPU 131 that is the target of the WRITE instruction, and the state of the identified logical CPU 131 Is transitioned from the sleep state to the execution state (step S803).
  • the hypervisor 120 cancels the write protection setting set for the page including the monitor area (step S804). Specifically, the following processing is executed.
  • the hypervisor 120 identifies the logical CPU 131 that is the target of the WRITE instruction based on the logical CPU number 401 of the entry searched in step S802.
  • the hypervisor 120 refers to the CPU configuration information 126 and searches for a line in which the logical CPU number 303 matches the logical CPU number 401 of the searched entry.
  • the hypervisor 120 identifies the LPAR 130 having the logical CPU 131 that is the target of the WRITE instruction from the LPAR number 301 of the entry including the retrieved line.
  • the hypervisor 120 refers to the memory configuration information 127 and searches for an entry whose allocation destination LPAR number 312 matches the identification number of the specified LPAR 130. Further, the hypervisor 120 refers to the guest physical address 313 of the searched entry, and specifies a memory area including the guest physical address 404 of the entry searched in step S802. The memory write protection unit 122 of the hypervisor 120 cancels the write protection setting of the memory area.
  • the hypervisor 120 updates the CPU configuration information 126 and the memory configuration information 127 (step S805), and thereafter ends the processing. Specifically, the following processing is executed.
  • the hypervisor 120 refers to the CPU configuration information 126 and changes the state 305 of the line where the logical CPU number 303 matches the logical CPU number 401 of the retrieved entry to “waiting for allocation”.
  • the hypervisor 120 refers to the memory configuration information 127 and changes the row attribute 314 corresponding to the memory area specified in step S804 to a blank.
  • proxy WRITE processing is executed for the memory area for which write protection is set (step S806).
  • the hypervisor 120 writes data in a memory area where write protection is set instead of the guest OS 140.
  • Example 2 will be described with a focus on differences from Example 1.
  • the hypervisor 120 Since the configurations of the physical computer 100, the hypervisor 120, and the LPAR 130 of the second embodiment are the same as those of the first embodiment, description thereof is omitted. However, in the second embodiment, the hypervisor 120 has an interface that notifies the guest OS 140 of the size of the monitor area.
  • the hypervisor 120 When the guest OS 140 is operated on the LPAR 130, the hypervisor 120 notifies the guest OS 140 that the size of the monitor area is “4 kilobytes” in advance via the interface. As a result, the size of the memory area where the memory write protection unit 122 sets the write protection matches the size of the monitor area. Therefore, in the second embodiment, noise as in the first embodiment does not occur.
  • FIG. 9 is a flowchart for explaining execution state transition processing executed by the hypervisor 120 according to the second embodiment.
  • the physical CPU 101 When the physical CPU 101 detects an exception process by the WRITE instruction for the memory area where the write protection is set, the physical CPU 101 shifts from the processing mode of the guest OS 140 to the processing mode of the hypervisor 120 using the virtualization support function.
  • the hypervisor 120 detects that it is a WRITE command for the memory area where the write protection is set, that is, the monitor area, by the transition of the processing mode described above (step S901).
  • the hypervisor 120 identifies the logical CPU 131 that is the target of the WRITE instruction based on the monitor area management information 125, and changes the state of the identified logical CPU 131 from the sleep state to the execution state (step S902).
  • the process in step S902 is the same as the process in step S803.
  • the hypervisor 120 cancels the write protection setting set in the monitor area (step S903). Specifically, the following processing is executed.
  • the hypervisor 120 identifies the logical CPU 131 that is the target of the WRITE instruction based on the logical CPU number 401 of the entry searched in step S902.
  • the hypervisor 120 refers to the CPU configuration information 126 and searches for a line in which the logical CPU number 303 matches the logical CPU number 401.
  • the hypervisor 120 identifies the LPAR 130 including the logical CPU 131 that is the target of the WRITE instruction from the LPAR number 301 of the entry including the retrieved line.
  • the hypervisor 120 refers to the memory configuration information 127 and searches for an entry whose allocation destination LPAR number 312 matches the identification number of the specified LPAR 130. Further, the hypervisor 120 refers to the guest physical address 313 of the searched entry, and specifies a memory area corresponding to the guest physical address 404 of the entry searched in step S802. The memory write protection unit 122 of the hypervisor 120 cancels the write protection setting of the memory area.
  • the hypervisor 120 updates the CPU configuration information 126 and the memory configuration information 127 (step S904), and then ends the processing.
  • the process in step S904 is the same as the process in step S806.
  • the hypervisor 120 uses the memory write protector 122 and the monitor area management information 125 to monitor the MONITOR instruction, the MWAIT instruction, and the monitor for each logical CPU 131 in the shared mode.
  • a WRITE instruction to the area can be emulated.
  • the hypervisor 120 performs control so as to hide the difference between the size of the memory area to which the write protection is set and the size of the monitor area.
  • the MONITOR / MWAIT system control similar to that of the physical CPU 101 can also be realized in the logical CPU 131. Even if the physical CPU 101 does not support the MONITOR / MWAIT system, the MONITOR / MWAIT system can be controlled on the LPAR 130. Further, by releasing the assignment of the physical CPU 101 to the logical CPU 131 that has transitioned to the hibernation state, it can be assigned to another logical CPU 131. Therefore, computer resources can be used effectively.
  • this invention is not limited to the above-mentioned Example, Various modifications are included. Further, for example, the above-described embodiments are described in detail for easy understanding of the present invention, and are not necessarily limited to those provided with all the described configurations. Further, a part of the configuration of each embodiment can be added to, deleted from, or replaced with another configuration.
  • each of the above-described configurations, functions, processing units, processing means, and the like may be realized by hardware by designing a part or all of them with, for example, an integrated circuit.
  • the present invention can also be realized by software program codes that implement the functions of the embodiments.
  • a storage medium in which the program code is recorded is provided to the computer, and a CPU included in the computer reads the program code stored in the storage medium.
  • the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the program code itself and the storage medium storing it constitute the present invention.
  • Examples of storage media for supplying such program codes include flexible disks, CD-ROMs, DVD-ROMs, hard disks, SSDs (Solid State Drives), optical disks, magneto-optical disks, CD-Rs, magnetic tapes, A non-volatile memory card, ROM, or the like is used.
  • program code for realizing the functions described in this embodiment can be implemented by a wide range of programs or script languages such as assembler, C / C ++, Perl, Shell, PHP, Java, and the like.
  • the program code is stored in a storage means such as a hard disk or memory of a computer or a storage medium such as a CD-RW or CD-R.
  • the CPU included in the computer may read and execute the program code stored in the storage unit or the storage medium.
  • control lines and information lines indicate those that are considered necessary for the explanation, and do not necessarily indicate all the control lines and information lines on the product. All the components may be connected to each other.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

A computer provided with physical CPUs and a physical memory that stores a program for implementing a virtualization unit, wherein said virtualization unit: divides the physical CPUs into a plurality of logical CPUs and allocates a first logical CPU and a second logical CPU to a first LPAR on which a first OS operates; retains management information for managing associations between the identifiers of the logical CPUs and the addresses of monitored regions in an address space managed by the OS; registers, in the management information, information associating the identifier of the first logical CPU with the address of a monitored region for the first logical CPU, in the address space managed by the first OS, if the virtualization unit detects a MONITOR command for the first logical CPU issued from the first OS; and causes the first logical CPU to transition into a dormant state if the virtualization unit detects an MWAIT command for the first logical CPU issued from the first OS, or causes the first logical CPU to transition into a running state if the virtualization unit detects a WRITE command and this WRITE command is determined, by reference to the management information, to be a WRITE command for the monitored region for the first logical CPU.

Description

計算機及び論理プロセッサの制御方法Computer and logical processor control method
 本発明は、仮想計算機における論理CPUの休止制御に関する。 The present invention relates to suspension control of a logical CPU in a virtual machine.
 現在、物理CPU(Central Processing Unit)、物理メモリ、及びIOデバイス等を有する物理計算機の計算機資源を有効に活用するために仮想化技術の利用が一般化している。仮想化技術には、ハイパバイザのような仮想化部が物理計算機の計算機資源を論理的に分割して、複数の仮想計算機の各々に割り当て、仮想計算機上でOS(Operating System)を動作させる技術が知られている。ここでは、仮想計算機をLPAR(Logical Partition)とも記載する。 Currently, in order to effectively use computer resources of a physical computer having a physical CPU (Central Processing Unit), a physical memory, an IO device, and the like, the use of virtualization technology is generalized. In the virtualization technology, a virtualization unit such as a hypervisor logically divides a computer resource of a physical computer, assigns it to each of a plurality of virtual computers, and operates an OS (Operating System) on the virtual computer. Are known. Here, the virtual machine is also referred to as LPAR (Logical Partition).
 仮想化部は、物理計算機上の複数のLPARが有する論理CPUの状態に応じて、複数の物理CPUを動的に割り当てる(例えば、特許文献1を参照)。特許文献1には、仮想化部が、論理CPUが実行状態から休止状態に遷移した場合、当該論理CPUに割り当てられていた物理CPUの割当を解放することが記載されている。解放された物理CPUは、他の論理CPUへ割り当てることができる。前述のような制御によって、物理計算機が有する限られた計算機資源を有効に活用することができる。 The virtualization unit dynamically allocates a plurality of physical CPUs according to the states of the logical CPUs of the plurality of LPARs on the physical computer (see, for example, Patent Document 1). Patent Document 1 describes that when a logical CPU transitions from an execution state to a dormant state, the virtualization unit releases the physical CPU assignment assigned to the logical CPU. The released physical CPU can be assigned to another logical CPU. By the control as described above, the limited computer resources possessed by the physical computer can be effectively utilized.
 従来の物理CPUの休止制御方式としてMONITOR/MWAIT方式が知られている。MONITOR/MWAIT方式を実現する物理CPUは、命令を実行する命令実行部、及びMONITOR部を備える。MONITOR部は、物理CPU毎に事前に登録された物理メモリ上の特定のメモリ領域(以下、モニタ領域と記載する)の値を周期的に監視する。なお、モニタ領域の登録には、OSが発行するMONITOR命令が用いられる。 The MONITOR / MWAIT system is known as a conventional physical CPU sleep control system. A physical CPU that implements the MONITOR / MWAIT system includes an instruction execution unit that executes an instruction and a MONITOR unit. The MONITOR unit periodically monitors the value of a specific memory area (hereinafter referred to as a monitor area) on the physical memory registered in advance for each physical CPU. Note that a MONITOR instruction issued by the OS is used for registering the monitor area.
 MONITOR/MWAIT方式では、OSから発行されたMWAIT命令によって、物理CPUを休止状態にすることができる。休止状態になった物理CPUは、命令実行部を停止させることによって、省電力状態で稼働する。一方、MONITOR部は、物理CPUが休止状態の間もモニタ領域の値を監視する。また、OSは、省電力状態を解除するために、省電力状態のCPU以外の他のCPUを介してモニタ領域に値を書き込む。休止状態の物理CPUのMONITOR部は、モニタ領域に対する書込みを検知した場合、命令実行部を稼働させることによって当該物理CPUの休止状態を解除する。これによって、命令実行部の動作が再開される。 In the MONITOR / MWAIT system, the physical CPU can be put into a sleep state by the MWAIT command issued from the OS. The physical CPU that has entered the hibernation state operates in a power saving state by stopping the instruction execution unit. On the other hand, the MONITOR section monitors the value in the monitor area even while the physical CPU is in the dormant state. Further, the OS writes a value in the monitor area via a CPU other than the CPU in the power saving state in order to release the power saving state. When the MONITOR unit of the physical CPU in the dormant state detects writing to the monitor area, the MONITOR unit releases the dormant state of the physical CPU by operating the instruction execution unit. As a result, the operation of the instruction execution unit is resumed.
 前述したように、MONITOR/MWAIT方式による物理CPUの制御では、OSからの要求に応じて物理CPUを実行状態から休止状態に遷移させ、また、物理CPUが休止状態でも動作するMONITOR部が、OSからの要求に応じて、物理CPUを休止状態から実行状態に迅速に遷移させることが可能となる。 As described above, in the control of the physical CPU by the MONITOR / MWAIT system, the MONITOR unit that changes the physical CPU from the execution state to the hibernation state in response to a request from the OS, and that operates even when the physical CPU is in the hibernation state, In response to a request from, the physical CPU can be quickly transitioned from the sleep state to the execution state.
特開2013-250949号公報JP 2013-250949 A
 LPARが有する論理CPUと、物理計算機が有する物理CPUとの対応関係は、設定により様々存在する。例えば、一つの物理CPUを複数の論理CPUが共有する対応付け、及び一つの論理CPUに対して複数の物理CPUを割り当てる対応付け等がある。前述したような対応づけでは、論理CPUには常に同一の物理CPUが割り当てられているわけではなく、論理CPUに対して物理CPUが動的に割り当てられる。 There are various correspondences between the logical CPU of the LPAR and the physical CPU of the physical computer depending on the setting. For example, there are associations in which one physical CPU is shared by a plurality of logical CPUs, associations in which a plurality of physical CPUs are assigned to one logical CPU, and the like. In the association as described above, the same physical CPU is not always assigned to the logical CPU, but the physical CPU is dynamically assigned to the logical CPU.
 一方、物理CPUのMONITOR部はただ一つのモニタ領域を監視する。そのため、各LPAR上のゲストOSが論理CPUのモニタ領域を登録することができない。したがって、ゲストOSが論理CPUのモニタ領域へ値を書き込んだ場合、物理CPUのMONITOR部はモニタ領域への書込を検知できない。したがって、論理CPUでは、物理CPUと同様のMONITOR/MWAIT方式の制御を実現できない。 On the other hand, the MONITOR part of the physical CPU monitors only one monitor area. Therefore, the guest OS on each LPAR cannot register the monitor area of the logical CPU. Therefore, when the guest OS writes a value to the monitor area of the logical CPU, the MONITOR part of the physical CPU cannot detect writing to the monitor area. Accordingly, the logical CPU cannot realize the MONITOR / MWAIT control similar to the physical CPU.
 本願において開示される発明の代表的な一例を示せば以下の通りである。すなわち、計算機資源として、複数の物理プロセッサ、及び前記複数の物理プロセッサの各々に接続される物理メモリを備える計算機であって、前記物理メモリは、複数の論理区画の各々に論理的に分割された前記計算機資源を割り当てる仮想化部を実現するプログラムを格納し、前記複数の論理区画の各々では、複数の論理プロセッサ、及び論理メモリを管理するオペレーティングシステムが稼働し、前記仮想化部は、前記複数の論理区画の各々が有する前記複数の論理プロセッサが同一の複数の物理プロセッサを共有するように、前記複数の物理プロセッサの割り当てを管理し、前記複数の物理プロセッサは、第1の物理プロセッサ及び第2の物理プロセッサを含み、前記オペレーティングシステムは、前記オペレーティングシステムが管理するプロセッサを休止状態から実行状態に遷移させるために監視するメモリ領域であるモニタ領域を指定するMONITOR命令と、前記オペレーティングシステムが管理するプロセッサを実行状態から休止状態に遷移させるためのMWAIT命令と、を発行し、前記複数の論理区画は、第1の論理プロセッサ、第2の論理プロセッサ、及び第1の論理メモリを有し、第1のオペレーティングシステムが稼働する第1の論理区画を含み、前記仮想化部は、前記MONITOR命令の対象となる論理プロセッサの識別子、及び前記オペレーティングシステムが管理するアドレス空間における前記モニタ領域のアドレスの対応付けを管理するモニタ領域管理情報を保持し、前記第1の論理プロセッサに割り当てられる前記第1の物理プロセッサによって、前記第1のオペレーティングシステムから前記第1の論理プロセッサに対するMONITOR命令が検知された場合、前記第1の論理プロセッサの識別子、及び前記第1のオペレーティングシステムが管理するアドレス空間における前記第1の論理プロセッサのモニタ領域のアドレスを対応付けた情報を前記モニタ領域管理情報に登録し、前記第1の論理プロセッサに割り当てられる第1の物理プロセッサによって、前記第1のオペレーティングシステムから前記第1の論理プロセッサに対するMWAIT命令が検知された場合、前記第1の論理プロセッサを実行状態から休止状態に遷移させ、前記第1の論理プロセッサに対する前記第1の物理プロセッサの割り当てを解除し、前記第2の論理プロセッサに割り当てられる前記第2の物理プロセッサによって、前記第1のオペレーティングシステムから前記第1の論理プロセッサのモニタ領域に対するWRITE命令が検知された場合、前記モニタ領域管理情報を参照して、前記第1の論理プロセッサのモニタ領域に対するWRITE命令であることを特定し、前記第1の論理プロセッサを休止状態から実行状態に遷移させることを特徴とする。 A typical example of the invention disclosed in the present application is as follows. That is, as a computer resource, a computer including a plurality of physical processors and a physical memory connected to each of the plurality of physical processors, wherein the physical memory is logically divided into a plurality of logical partitions. An operating system that stores a program that realizes a virtualization unit that allocates the computer resources, manages a plurality of logical processors and a logical memory in each of the plurality of logical partitions, and the virtualization unit The plurality of physical processors manage the allocation of the plurality of physical processors so that the plurality of logical processors included in each of the logical partitions share the same plurality of physical processors. Two physical processors, and the operating system includes: A MONITOR instruction that designates a monitor area that is a memory area to be monitored in order to transition the processor to be managed from the hibernation state to the execution state; The plurality of logical partitions includes a first logical partition having a first logical processor, a second logical processor, and a first logical memory, and running a first operating system; The virtualization unit holds monitor area management information for managing an association between an identifier of a logical processor that is a target of the MONITOR instruction and an address of the monitor area in an address space managed by the operating system. The first physical processor assigned to the logical processor of When a MONITOR instruction for the first logical processor is detected by the first operating system, the identifier of the first logical processor and the first space in the address space managed by the first operating system are detected. Information that associates the address of the monitor area of the logical processor is registered in the monitor area management information, and the first logical processor assigns the first logical processor to the first logical processor. When a MWAIT instruction for a processor is detected, the first logical processor is transitioned from an execution state to a sleep state, the first physical processor is unassigned from the first logical processor, and the second logical processor is released. Said first assigned to a processor When a WRITE instruction for the monitor area of the first logical processor is detected by the second physical processor from the first operating system, the monitor area of the first logical processor is referred to by referring to the monitor area management information WRITE instruction is specified, and the first logical processor is changed from the sleep state to the execution state.
 本発明によれば、仮想化部は、MONITOR/MWAIT方式における各種命令をエミュレーションすることによって、論理区画の論理プロセッサにおいてもMONITOR/MWAIT方式の休止制御を実現できる。 According to the present invention, the virtualization unit can realize suspension control of the MONITOR / MWAIT system even in the logical processor of the logical partition by emulating various instructions in the MONITOR / MWAIT system.
 上記した以外の課題、構成及び効果は、以下の実施例の説明により明らかにされる。 Issues, configurations, and effects other than those described above will be clarified by the description of the following examples.
実施例1の物理計算機の構成の一例を示す説明図である。FIG. 3 is an explanatory diagram illustrating an example of a configuration of a physical computer according to the first embodiment. 実施例1のゲスト物理アドレス空間とカーネル仮想アドレス空間との対応関係を示す説明図である。It is explanatory drawing which shows the correspondence of the guest physical address space of Example 1, and a kernel virtual address space. 実施例1のCPU構成情報の一例を示す説明図である。FIG. 3 is an explanatory diagram illustrating an example of CPU configuration information according to the first embodiment. 実施例1のメモリ構成情報の一例を示す説明図である。FIG. 3 is an explanatory diagram illustrating an example of memory configuration information according to the first embodiment. 実施例1のモニタ領域管理情報の一例を示す説明図である。FIG. 6 is an explanatory diagram illustrating an example of monitor area management information according to the first embodiment. 実施例1の共有モードの論理CPUのMONITOR/MWAIT方式における命令のエミュレーション処理の流れを説明するシーケンス図である。FIG. 10 is a sequence diagram illustrating a flow of instruction emulation processing in the MONITOR / MWAIT system of the shared mode logical CPU according to the first embodiment. 実施例1のハイパバイザが実行するモニタ領域登録処理の一例を説明するフローチャートである。6 is a flowchart illustrating an example of a monitor area registration process executed by the hypervisor according to the first embodiment. 実施例1のハイパバイザが実行する休止状態遷移処理を説明するフローチャートである。6 is a flowchart for explaining hibernation state transition processing executed by the hypervisor according to the first embodiment. 実施例1のハイパバイザが実行する実行状態遷移処理を説明するフローチャートである。6 is a flowchart illustrating an execution state transition process executed by the hypervisor according to the first embodiment. 実施例2のハイパバイザが実行する実行状態遷移処理を説明するフローチャートである。10 is a flowchart illustrating an execution state transition process executed by a hypervisor according to the second embodiment.
 以下、図面を参照して、実施例を説明する。 Hereinafter, embodiments will be described with reference to the drawings.
 図1は、実施例1の物理計算機の構成の一例を示す説明図である。 FIG. 1 is an explanatory diagram illustrating an example of the configuration of the physical computer according to the first embodiment.
 物理計算機100は、計算機資源として、複数の物理CPU101、及び1つ以上の物理メモリ102を備える。図1に示す例では、物理計算機100は、物理CPU1(101-1)、物理CPU2(101-2)、物理CPU3(101-3)及び物理CPU4(101-4)の4つの物理CPU101を備える。複数の物理CPU101及び1つ以上の物理メモリ102は、バス等を介して接続される。 The physical computer 100 includes a plurality of physical CPUs 101 and one or more physical memories 102 as computer resources. In the example illustrated in FIG. 1, the physical computer 100 includes four physical CPUs 101, a physical CPU 1 (101-1), a physical CPU 2 (101-2), a physical CPU 3 (101-3), and a physical CPU 4 (101-4). . The plurality of physical CPUs 101 and one or more physical memories 102 are connected via a bus or the like.
 なお、物理計算機100は、計算機資源として、NIC(Network Interface Card)及びHBA(Host Bus Adapter)等のIOデバイス、並びに、HDD(Hard Disk Drive)及びSSD(Solid State Drive)等の記憶媒体を備えてもよい。 The physical computer 100 includes, as computer resources, storage devices such as NIC (Network Interface Card) and IO devices such as HBA (Host Bus Adapter), HDD (Hard Disk Drive), and SSD (Solid State Drive). May be.
 物理CPU101は、物理メモリ102に格納されるプログラムを実行する。本実施例の物理CPU101は、命令実行部110及びMONITOR部111を有する。命令実行部110は、プログラムにしたがって各種演算処理を実行する。MONITOR部111は、MONITOR/MWAIT方式の制御を行う。 The physical CPU 101 executes a program stored in the physical memory 102. The physical CPU 101 of this embodiment includes an instruction execution unit 110 and a MONITOR unit 111. The instruction execution unit 110 executes various arithmetic processes according to a program. The MONITOR unit 111 controls the MONITOR / MWAIT system.
 物理CPU101の命令実行部110がプログラムを実行することによって物理計算機100が有する各種機能を実現できる。以下の説明では、プログラムを主体に説明する場合、当該プログラムが物理CPU101によって実行されていることを示す。 Various functions of the physical computer 100 can be realized by the instruction execution unit 110 of the physical CPU 101 executing the program. In the following description, when a program is mainly described, it indicates that the program is being executed by the physical CPU 101.
 MONITOR部111は、OSからMWAIT命令を受け付けると、物理CPU101を実行状態から休止状態に遷移させ、物理メモリ102の所定のメモリ領域の値を周期的に監視する。また、MONITOR部111は、所定のメモリ領域に対するWRITE命令を検知した場合、物理CPU101の休止状態を解除する。ここで、MWAIT命令は、OSが管理するプロセッサを実行状態から休止状態に遷移させるための命令である。 When the MONITOR unit 111 receives an MWAIT command from the OS, the MONITOR unit 111 causes the physical CPU 101 to transition from the execution state to the sleep state, and periodically monitors the value of a predetermined memory area of the physical memory 102. Also, the MONITOR unit 111 cancels the sleep state of the physical CPU 101 when detecting a WRITE command for a predetermined memory area. Here, the MWAIT instruction is an instruction for causing the processor managed by the OS to transition from the execution state to the hibernation state.
 以下の説明では、MONITOR部111が監視する所定のメモリ領域をモニタ領域とも記載する。なお、モニタ領域は、OSが発行するMONITOR命令によって設定される。ここで、MONITOR命令は、OSが管理するCPUを休止状態から実行状態に遷移させるためのモニタ領域を指定するための命令である。 In the following description, a predetermined memory area monitored by the MONITOR unit 111 is also referred to as a monitor area. The monitor area is set by a MONITOR instruction issued by the OS. Here, the MONITOR instruction is an instruction for designating a monitor area for transitioning the CPU managed by the OS from the sleep state to the execution state.
 物理計算機100上には、前述した計算機資源を用いて仮想環境が構築される。仮想環境は、ハイパバイザ120によって管理される。具体的には、ハイパバイザ120は、計算機資源を論理的に分割して、複数の仮想計算機(LPAR130)に分割された計算機資源を割り当てる。各LPAR130は、一つ以上の論理CPU131及び一つ以上の論理メモリ132から構成され、また、各LPAR130上では、ゲストOS140が稼働する。 A virtual environment is constructed on the physical computer 100 using the computer resources described above. The virtual environment is managed by the hypervisor 120. Specifically, the hypervisor 120 logically divides computer resources and allocates the divided computer resources to a plurality of virtual computers (LPARs 130). Each LPAR 130 includes one or more logical CPUs 131 and one or more logical memories 132, and a guest OS 140 runs on each LPAR 130.
 図1に示す例では、3つのLPAR1(130-1)、LPAR2(130-2)、及びLPAR3(130-3)の各々に物理計算機100の計算機資源が割り当てられている。また、LPAR1(130-1)ではゲストOS1(140-1)が稼働し、LPAR2(130-2)ではゲストOS2(140-2)が稼働し、また、LPAR3(130-3)ではゲストOS3(140-3)が稼働する。 In the example shown in FIG. 1, the computer resource of the physical computer 100 is allocated to each of three LPAR1 (130-1), LPAR2 (130-2), and LPAR3 (130-3). In addition, the guest OS1 (140-1) operates in the LPAR1 (130-1), the guest OS2 (140-2) operates in the LPAR2 (130-2), and the guest OS3 (130-3) in the LPAR3 (130-3). 140-3) operates.
 LPAR1(130-1)は、論理CPU1(131-1)、論理CPU2(131-2)、及び論理メモリ1(132-1)を有し、LPAR2(130-2)は、論理CPU3(131-3)、論理CPU4(131-4)、及び論理メモリ2(132-2)を有し、また、LPAR3(130-3)は、論理CPU5(131-5)、論理CPU6(131-6)、及び論理メモリ1(132-3)を有する。 The LPAR1 (130-1) includes a logical CPU1 (131-1), a logical CPU2 (131-2), and a logical memory 1 (132-1). The LPAR2 (130-2) includes the logical CPU3 (131-). 3), logical CPU 4 (131-4), and logical memory 2 (132-2), and LPAR 3 (130-3) includes logical CPU 5 (131-5), logical CPU 6 (131-6), And a logical memory 1 (132-3).
 ハイパバイザ120は、論理CPU1(131-1)、論理CPU2(131-2)、論理CPU3(131-3)、及び論理CPU4(131-4)に対して、物理CPU1(101-1)及び物理CPU2(101-2)を割り当てる。具体的には、ハイパバイザ120は、論理CPU131の使用状態に応じて、物理CPU101を動的に割り当てる。以下の説明では、1つの論理CPU131の使用状態に応じて、複数の物理CPU101を動的に割り当てる等、すなわち、論理CPU131に対して物理CPU101を動的に割り当てる割当モードを「共有モード」と記載する。 The hypervisor 120 has a physical CPU 1 (101-1) and a physical CPU 2 for the logical CPU 1 (131-1), the logical CPU 2 (131-2), the logical CPU 3 (131-3), and the logical CPU 4 (131-4). (101-2) is assigned. Specifically, the hypervisor 120 dynamically assigns the physical CPU 101 according to the usage state of the logical CPU 131. In the following description, a plurality of physical CPUs 101 are dynamically allocated according to the usage state of one logical CPU 131, that is, an allocation mode in which physical CPUs 101 are dynamically allocated to the logical CPU 131 is described as “shared mode”. To do.
 また、ハイパバイザ120は、論理CPU5(131-5)に対して物理CPU3(101-3)を一意に割り当て、また、論理CPU6(131-6)に対して物理CPU4(101-4)を一意に割り当てる。以下の説明では、1つの論理CPU131に対して、1つの物理CPU101を一意に割り当てる割当モードを「占有モード」と記載する。 The hypervisor 120 uniquely assigns the physical CPU 3 (101-3) to the logical CPU 5 (131-5) and uniquely assigns the physical CPU 4 (101-4) to the logical CPU 6 (131-6). assign. In the following description, an allocation mode in which one physical CPU 101 is uniquely assigned to one logical CPU 131 is referred to as an “occupancy mode”.
 ハイパバイザ120は、また、物理メモリ102のメモリ領域の一部を論理メモリ132のメモリ領域として割り当てる。具体的には、ハイパバイザ120は、物理メモリ102のアドレス空間と論理メモリ132のアドレス空間との対応関係を管理する。以下の説明では、物理メモリ102のアドレス空間をハイパバイザ物理アドレス空間と記載し、論理メモリ132のアドレス空間をゲスト物理アドレス空間と記載する。 The hypervisor 120 also allocates a part of the memory area of the physical memory 102 as the memory area of the logical memory 132. Specifically, the hypervisor 120 manages the correspondence between the address space of the physical memory 102 and the address space of the logical memory 132. In the following description, the address space of the physical memory 102 is described as a hypervisor physical address space, and the address space of the logical memory 132 is described as a guest physical address space.
 ゲストOS140は、論理メモリ132を物理的なメモリとして管理し、また、当該アドレス空間とゲストOS140の仮想アドレス空間との対応関係を管理する。 The guest OS 140 manages the logical memory 132 as a physical memory, and manages the correspondence between the address space and the virtual address space of the guest OS 140.
 実施例1のハイパバイザ120は、LPAR130の構成及びLPAR130に割り当てる計算機資源を管理するために、プロセススケジューラ121、メモリ書込保護部122、及び命令トラップ部123を有し、また、LPAR構成情報124、及びモニタ領域管理情報125を保持する。 The hypervisor 120 according to the first embodiment includes a process scheduler 121, a memory write protection unit 122, and an instruction trap unit 123 in order to manage the configuration of the LPAR 130 and the computer resources allocated to the LPAR 130, and the LPAR configuration information 124, And monitor area management information 125 is held.
 プロセススケジューラ121は、各LPAR130の各論理CPU131に割り当てる物理CPU101、及び各論理メモリ132に割り当てる物理メモリ102のメモリ領域を管理する。メモリ書込保護部122は、物理メモリ102の一部のメモリ領域に対する書き込みを禁止する。命令トラップ部123は、ゲストOS140から発行された命令のうち、所定の条件に合致する命令をトラップする。 The process scheduler 121 manages the memory areas of the physical CPU 101 assigned to each logical CPU 131 of each LPAR 130 and the physical memory 102 assigned to each logical memory 132. The memory write protector 122 prohibits writing to a part of the memory area of the physical memory 102. The instruction trap unit 123 traps an instruction that matches a predetermined condition among the instructions issued from the guest OS 140.
 LPAR構成情報124は、LPAR130の構成及びLPAR130に割り当てられる計算機資源を管理するための情報である。LPAR構成情報124は、CPU構成情報126及びメモリ構成情報127を含む。CPU構成情報126及びメモリ構成情報127の詳細は、図3A及び図3Bを用いて後述する。モニタ領域管理情報125は、LPAR130におけるMONITOR/MWAIT方式を実現するための情報である。モニタ領域管理情報125の詳細は、図4を用いて後述する。 The LPAR configuration information 124 is information for managing the configuration of the LPAR 130 and the computer resources allocated to the LPAR 130. The LPAR configuration information 124 includes CPU configuration information 126 and memory configuration information 127. Details of the CPU configuration information 126 and the memory configuration information 127 will be described later with reference to FIGS. 3A and 3B. The monitor area management information 125 is information for realizing the MONITOR / MWAIT system in the LPAR 130. Details of the monitor area management information 125 will be described later with reference to FIG.
 ここで、LPAR130の論理CPU131におけるMONITOR/MWAIT方式の実現方法について説明する。 Here, a method for realizing the MONITOR / MWAIT system in the logical CPU 131 of the LPAR 130 will be described.
 1つの論理CPU131に対して1つの物理CPU101が一意に割り当てられている場合、すなわち、「占有モード」の場合、LPAR130は、ハイパバイザ120を介することなく、直接物理CPU101を使用できるように設定する。これによって、論理CPU131におけるMONITOR/MWAIT方式を実現できる。 When one physical CPU 101 is uniquely assigned to one logical CPU 131, that is, in the “occupied mode”, the LPAR 130 is set so that the physical CPU 101 can be used directly without going through the hypervisor 120. Thus, the MONITOR / MWAIT system in the logical CPU 131 can be realized.
 一方、「共有モード」の場合、ハイパバイザ120は、LPAR130の論理CPU131におけるMONITOR/MWAIT方式を実現するために、(1)各論理CPU131のモニタ領域の設定を実現すること、(2)各モニタ領域に対するWRITE命令の発行の監視を実現すること、が必要である。そこで、ハイパバイザ120は、メモリ書込保護部122を用いて上記の2つの課題(1)、(2)を解決する。 On the other hand, in the “shared mode”, the hypervisor 120 realizes the setting of the monitor area of each logical CPU 131 in order to realize the MONITOR / MWAIT method in the logical CPU 131 of the LPAR 130, and (2) each monitor area. It is necessary to implement monitoring of the issuance of WRITE instructions for Therefore, the hypervisor 120 solves the above two problems (1) and (2) using the memory write protector 122.
 具体的には、ゲストOS140からの論理CPU131のモニタ領域の設定を指示するMONITOR命令の発行が検知された場合、メモリ書込保護部122は、指定されたモニタ領域に関連するメモリ領域への書込を禁止する。すなわち、メモリ書込保護部122は、当該メモリ領域に書込保護を設定する。さらに、ハイパバイザ120は、論理CPU131を休止状態に設定するとともに、当該論理CPU131に対する物理CPU101の割り当てを解除する。また、ハイパバイザ120は、物理CPU101を介して書込保護が設定されたメモリ領域に対するWRITE命令の発行を監視する。 Specifically, when the issuance of a MONITOR instruction instructing the setting of the monitor area of the logical CPU 131 from the guest OS 140 is detected, the memory write protection unit 122 writes to the memory area related to the designated monitor area. Ban. That is, the memory write protection unit 122 sets write protection for the memory area. Furthermore, the hypervisor 120 sets the logical CPU 131 to a dormant state and cancels the assignment of the physical CPU 101 to the logical CPU 131. In addition, the hypervisor 120 monitors the issuance of a WRITE instruction to a memory area for which write protection is set via the physical CPU 101.
 ゲストOS140からの書込保護が設定されたメモリ領域に対するWRITE命令の発行が検知された場合、ハイパバイザ120は、状態を遷移させる論理CPU131を特定し、特定された論理CPU131を休止状態から実行状態に遷移させる。さらに、ハイパバイザ120は、スケジュールにしたがって、当該論理CPU131に物理CPU101を割り当てる。このとき、メモリ書込保護部122は、WRITE命令が発行されたメモリ領域の書込保護の設定を解除する。 When it is detected that a WRITE instruction is issued from the guest OS 140 to the memory area for which write protection has been set, the hypervisor 120 identifies the logical CPU 131 whose state is to be changed, and changes the identified logical CPU 131 from the sleep state to the execution state. Transition. Further, the hypervisor 120 assigns the physical CPU 101 to the logical CPU 131 according to the schedule. At this time, the memory write protection unit 122 cancels the write protection setting of the memory area where the WRITE instruction is issued.
 前述のような制御によって、論理CPU131におけるMONITOR/MWAIT方式の制御を実現できる。ただし、メモリ書込保護部122を用いたモニタ領域の設定及び監視を実現するためには以下のような課題が存在する。LPAR130が管理する論理メモリ132の物理アドレス空間(ゲスト物理アドレス空間210)とゲストOS140が管理するカーネル仮想アドレス空間220との対応関係を用いて、当該課題について説明する。 By the control as described above, the MONITOR / MWAIT control in the logical CPU 131 can be realized. However, in order to realize the setting and monitoring of the monitor area using the memory write protector 122, there are the following problems. This problem will be described using the correspondence between the physical address space (guest physical address space 210) of the logical memory 132 managed by the LPAR 130 and the kernel virtual address space 220 managed by the guest OS 140.
 図2は、実施例1のゲスト物理アドレス空間210とカーネル仮想アドレス空間220との対応関係を示す説明図である。 FIG. 2 is an explanatory diagram illustrating a correspondence relationship between the guest physical address space 210 and the kernel virtual address space 220 according to the first embodiment.
 ゲスト物理アドレス空間210はページ単位に管理され、ハイパバイザ120は、ゲストOS140からの要求に応じて、カーネル仮想アドレス空間220のページにゲスト物理アドレス空間210のページを割り当てる。 The guest physical address space 210 is managed in units of pages, and the hypervisor 120 allocates a page of the guest physical address space 210 to a page of the kernel virtual address space 220 in response to a request from the guest OS 140.
 図2に示すように、従来のOS(ゲストOS140)がMONITOR部111に対して指定するモニタ領域のサイズは、キャッシュラインのサイズに相当する64バイトである。一方、メモリ書込保護部122は、ページ単位(4キロバイト)のメモリ領域に対して書込保護を設定する。 As shown in FIG. 2, the size of the monitor area designated by the conventional OS (guest OS 140) for the MONITOR unit 111 is 64 bytes corresponding to the size of the cache line. On the other hand, the memory write protection unit 122 sets write protection for a memory area in units of pages (4 kilobytes).
 したがって、ハイパバイザ120は、LPAR130の論理CPU131におけるMONITOR/MWAIT方式を実現するためには、ゲストOS140が指定するモニタ領域よりも大きなメモリ領域(ページ)に対するWRITE命令の発行を監視する必要がある。 Therefore, in order to realize the MONITOR / MWAIT method in the logical CPU 131 of the LPAR 130, the hypervisor 120 needs to monitor the issuance of a WRITE instruction for a memory area (page) larger than the monitor area specified by the guest OS 140.
 OS等のソフトウェアは、MONITOR命令及びMWAIT命令を使用する場合、MONITOR/MWAIT方式に関係のないデータ変数がモニタ領域に存在しないことを保証する必要がある。そのため、本実施例では、ソフトウェアが保証可能なモニタ領域より大きなメモリ領域(ページ)についても同様の条件を満たす必要がある。 When using the MONITOR instruction and the MWAIT instruction, software such as an OS needs to ensure that no data variable unrelated to the MONITOR / MWAIT system exists in the monitor area. For this reason, in this embodiment, the same condition must be satisfied for a memory area (page) larger than the monitor area that can be guaranteed by software.
 しかし、書き込みが禁止されたページのうちモニタ領域を除くメモリ領域には、MONITOR/MWAIT方式に関係のないデータ変数が含まれる。メモリ書込保護機能をそのまま利用した場合、前述したメモリ領域(ページ)のうち、モニタ領域以外のメモリ領域に対するWRITE命令の発行(ノイズ)が検知された場合、論理CPU131の休止状態が解除される。 However, the memory area excluding the monitor area among the pages for which writing is prohibited includes data variables not related to the MONITOR / MWAIT system. When the memory write protection function is used as it is, when the issuance (noise) of the WRITE instruction to the memory area other than the monitor area is detected among the memory areas (pages) described above, the hibernation state of the logical CPU 131 is released. .
 (3)書込保護の設定はページ単位で行われる。そのため、1つページが書込保護の設定の最小単位である。ページサイズは物理CPU101に依存するが、一般には1ページのサイズは4キロバイトである。したがって、前述したようなノイズの検知を排除することができない。そのため、物理CPU101と同様のMONITOR/MWAIT方式を実現できない。したがって、前述したようなノイズの検知を排除する必要がある。 (3) Write protection is set on a page basis. Therefore, one page is the minimum unit for setting write protection. The page size depends on the physical CPU 101, but generally the size of one page is 4 kilobytes. Therefore, the detection of noise as described above cannot be excluded. Therefore, the MONITOR / MWAIT method similar to that of the physical CPU 101 cannot be realized. Therefore, it is necessary to eliminate the detection of noise as described above.
 (4)また、複数の論理CPU131の各々のモニタ領域が同一のページに登録された場合、メモリ書込保護機能をそのまま利用しても、ハイパバイザ120は、前述と同様の理由によって、どの論理CPU131の休止状態を解除すればよいか判定できない。 (4) When the monitor areas of the plurality of logical CPUs 131 are registered in the same page, the hypervisor 120 can determine which logical CPU 131 for the same reason as described above even if the memory write protection function is used as it is. It cannot be determined whether to cancel the hibernation state.
 上記の課題(3)、(4)の解決方法として以下の2つの方法が考えられる。 The following two methods are conceivable as solutions for the above problems (3) and (4).
 第1の方法は、ハイパバイザ120が、ゲストOS140によって指定されたモニタ領域のゲスト物理アドレスを管理し、モニタ領域を含むメモリ領域へのWRITE命令の発行が検知された場合、WRITE命令に含まれるゲスト物理アドレスに基づいてどの論理CPU131に対して設定されたモニタ領域であるかを特定する。第1の方法では、課題(3)、(4)を解決できる。 In the first method, the hypervisor 120 manages the guest physical address of the monitor area specified by the guest OS 140, and when the issuance of the WRITE instruction to the memory area including the monitor area is detected, the guest included in the WRITE instruction Based on the physical address, the monitor area set for which logical CPU 131 is specified. In the first method, the problems (3) and (4) can be solved.
 第2の方法は、ハイパバイザ120が予めゲストOS140に対してモニタ領域のサイズ(64バイト)をページサイズ(4キロバイト)に設定する。第2の方法では、モニタ領域のサイズと書込保護が設定されるメモリ領域のサイズとが一致するため、課題(3)、(4)の発生を抑止できる。なお、第2の方法では、ゲストOS140上で動作するソフトウェアが、4キロバイトのモニタ領域に無関係のデータ変数が存在しないことを保証する必要がある。 In the second method, the hypervisor 120 previously sets the monitor area size (64 bytes) to the page size (4 kilobytes) for the guest OS 140. In the second method, since the size of the monitor area matches the size of the memory area where the write protection is set, the occurrence of the problems (3) and (4) can be suppressed. In the second method, it is necessary for the software operating on the guest OS 140 to ensure that there is no unrelated data variable in the monitor area of 4 kilobytes.
 実施例1では第1の方法について説明する。第2の方法については、実施例2で説明する。 Example 1 describes the first method. The second method will be described in Example 2.
 図3Aは、実施例1のCPU構成情報126の一例を示す説明図である。 FIG. 3A is an explanatory diagram illustrating an example of the CPU configuration information 126 according to the first embodiment.
 CPU構成情報126は、各LPAR130が有する論理CPU131を管理するための情報を格納する。CPU構成情報126には1つのLPAR130に対して1つのエントリが存在し、また、各エントリは、LPAR番号301、スケジューリングモード302、論理CPU番号303、物理CPU番号304、及び状態305を含む。 The CPU configuration information 126 stores information for managing the logical CPU 131 included in each LPAR 130. The CPU configuration information 126 has one entry for one LPAR 130, and each entry includes an LPAR number 301, a scheduling mode 302, a logical CPU number 303, a physical CPU number 304, and a state 305.
 LPAR番号301は、LPAR130の識別番号を格納する。スケジューリングモード302は、LPAR130が有する論理CPU131における物理CPU101の割当モードに関する情報を格納する。具体的には、スケジューリングモード302には、「共有モード」を示す「共有」、又は「占有モード」を示す「占有」のいずれかが格納される。 The LPAR number 301 stores the identification number of the LPAR 130. The scheduling mode 302 stores information related to the allocation mode of the physical CPU 101 in the logical CPU 131 included in the LPAR 130. Specifically, the scheduling mode 302 stores either “shared” indicating “shared mode” or “occupied” indicating “occupied mode”.
 論理CPU番号303は、LPAR130が有する論理CPU131の識別番号を格納する。1つのLPAR130のエントリには、当該LPAR130が有する論理CPU131の数と同一の数の行が含まれる。 The logical CPU number 303 stores the identification number of the logical CPU 131 that the LPAR 130 has. The entry of one LPAR 130 includes the same number of rows as the number of logical CPUs 131 included in the LPAR 130.
 物理CPU番号304は、論理CPU131に対する物理CPU101の割り当て状態を示す情報を格納する。具体的には、論理CPU131に対して物理CPU101が割り当てられている場合、物理CPU番号304には、割り当てられている物理CPU101の識別番号が格納される。また、論理CPU131に対して物理CPU101が割り当てられていない場合、物理CPU番号304には「割り当てなし」が格納される。 The physical CPU number 304 stores information indicating the allocation state of the physical CPU 101 to the logical CPU 131. Specifically, when the physical CPU 101 is assigned to the logical CPU 131, the physical CPU number 304 stores the identification number of the assigned physical CPU 101. If the physical CPU 101 is not assigned to the logical CPU 131, “no assignment” is stored in the physical CPU number 304.
 状態305は、論理CPU131の状態を示す情報を格納する。具体的には、状態305には、「休止」、「実行中」、又は「割り当て待ち」のいずれかが格納される。「休止」は論理CPU131が休止状態であることを示し、「実行中」は論理CPU131が実行状態であり、かつ、当該論理CPU131に物理CPU101が割り当てられている状態を示す。また、「割り当て待ち」は論理CPU131が実行状態であるが、当該論理CPU131に物理CPU101が割り当てられていない状態を示す。 The state 305 stores information indicating the state of the logical CPU 131. Specifically, the state 305 stores any one of “pause”, “running”, and “waiting for allocation”. “Suspended” indicates that the logical CPU 131 is in a suspended state, and “in execution” indicates that the logical CPU 131 is in an executing state and the physical CPU 101 is assigned to the logical CPU 131. “Waiting for allocation” indicates a state in which the logical CPU 131 is in an execution state but the physical CPU 101 is not allocated to the logical CPU 131.
 図3Bは、実施例1のメモリ構成情報127の一例を示す説明図である。 FIG. 3B is an explanatory diagram illustrating an example of the memory configuration information 127 according to the first embodiment.
 メモリ構成情報127は、LPAR130が有する論理メモリ132に割り当てる物理メモリ102のメモリ領域を管理するための情報を格納する。メモリ構成情報127には物理メモリ102の1つページに対して1つのエントリが存在し、各エントリは、ハイパバイザ物理アドレス311、割当先LPAR番号312、ゲスト物理アドレス313、及び属性314を含む。 The memory configuration information 127 stores information for managing the memory area of the physical memory 102 allocated to the logical memory 132 included in the LPAR 130. The memory configuration information 127 has one entry for one page of the physical memory 102, and each entry includes a hypervisor physical address 311, an allocation destination LPAR number 312, a guest physical address 313, and an attribute 314.
 ハイパバイザ物理アドレス311は、ハイパバイザ物理アドレス空間におけるページの開始アドレスを格納する。割当先LPAR番号312は、物理メモリ102のページを割り当てるLPAR130の識別番号を格納する。割当先LPAR番号312に格納される論理CPU131の識別番号は、LPAR番号301に格納されるものと同一である。ゲスト物理アドレス313は、ゲスト物理アドレス空間210における物理メモリ102のページが割り当てられた論理メモリ132のページの開始アドレスを格納する。 The hypervisor physical address 311 stores the start address of a page in the hypervisor physical address space. The allocation LPAR number 312 stores the identification number of the LPAR 130 to which the page of the physical memory 102 is allocated. The identification number of the logical CPU 131 stored in the allocation destination LPAR number 312 is the same as that stored in the LPAR number 301. The guest physical address 313 stores the start address of the page of the logical memory 132 to which the page of the physical memory 102 in the guest physical address space 210 is allocated.
 属性314は、物理メモリ102のページの属性を示す情報を格納する。本実施例では、属性314には、メモリ書込保護部122によって書込保護が設定されていることを示す情報が格納される。具体的には、属性314に「書込保護」が格納される場合、ページに対して書込保護が設定されていることを示し、属性314が空欄の場合、ページに対して書込保護が設定されていないことを示す。なお、属性314には、書込保護以外の属性情報が格納されてもよい。 The attribute 314 stores information indicating the page attribute of the physical memory 102. In this embodiment, the attribute 314 stores information indicating that the write protection is set by the memory write protection unit 122. Specifically, when “write protection” is stored in the attribute 314, it indicates that the write protection is set for the page. When the attribute 314 is blank, the page is protected for write protection. Indicates that it has not been set. The attribute 314 may store attribute information other than write protection.
 図4は、実施例1のモニタ領域管理情報125の一例を示す説明図である。 FIG. 4 is an explanatory diagram illustrating an example of the monitor area management information 125 according to the first embodiment.
 モニタ領域管理情報125は、各論理CPU131に対して指定されたモニタ領域を監視するための情報を格納する。モニタ領域管理情報125にはモニタ領域が設定された一つの論理CPU131に対して1つのエントリが存在し、各エントリは、論理CPU番号401及びモニタ領域アドレス402を含む。 The monitor area management information 125 stores information for monitoring the monitor area designated for each logical CPU 131. The monitor area management information 125 includes one entry for one logical CPU 131 for which a monitor area is set, and each entry includes a logical CPU number 401 and a monitor area address 402.
 論理CPU番号401は、モニタ領域が設定された論理CPU131の識別番号を格納する。論理CPU番号401に格納される論理CPU131の識別番号は、LPAR番号301に格納されるものと同一である。 The logical CPU number 401 stores the identification number of the logical CPU 131 in which the monitor area is set. The identification number of the logical CPU 131 stored in the logical CPU number 401 is the same as that stored in the LPAR number 301.
 モニタ領域アドレス402は、ゲストOS140が管理するアドレス空間における論理CPU131のモニタ領域のアドレスを格納する。モニタ領域アドレス402は、仮想アドレス403及びゲスト物理アドレス404を含む。 The monitor area address 402 stores the address of the monitor area of the logical CPU 131 in the address space managed by the guest OS 140. The monitor area address 402 includes a virtual address 403 and a guest physical address 404.
 仮想アドレス403は、ゲストOS140によって指定されたモニタ領域のカーネル仮想アドレス空間220における仮想アドレスを格納する。ゲスト物理アドレス404は、モニタ領域のゲスト物理アドレス空間210におけるゲスト物理アドレスを格納する。実施例1では、モニタ領域のサイズは、従来のモニタ領域のサイズと同一である。すなわち、モニタ領域のサイズは64バイトである。 The virtual address 403 stores a virtual address in the kernel virtual address space 220 of the monitor area specified by the guest OS 140. The guest physical address 404 stores a guest physical address in the guest physical address space 210 of the monitor area. In the first embodiment, the size of the monitor area is the same as the size of the conventional monitor area. That is, the size of the monitor area is 64 bytes.
 なお、モニタ領域管理情報125では、「共有モード」の論理CPU131のモニタ領域に関する情報が管理される。一方、「占有モード」の論理CPU131のモニタ領域については、モニタ領域管理情報125を用いて管理されない。「占有モード」の論理CPU131と物理CPU101とは一対一に対応付けられており、物理CPU101をそのまま使用できるためである。 The monitor area management information 125 manages information related to the monitor area of the logical CPU 131 in the “shared mode”. On the other hand, the monitor area of the logical CPU 131 in the “occupied mode” is not managed using the monitor area management information 125. This is because the logical CPU 131 and the physical CPU 101 in the “occupied mode” are associated one-to-one and the physical CPU 101 can be used as it is.
 図5は、実施例1の共有モードの論理CPU131のMONITOR/MWAIT方式における命令のエミュレーション処理の流れを説明するシーケンス図である。 FIG. 5 is a sequence diagram illustrating the flow of instruction emulation processing in the MONITOR / MWAIT system of the shared mode logical CPU 131 according to the first embodiment.
 以下の説明では、共有モードの論理CPU1(131-1)及び論理CPU2(131-2)を有するLPAR1(130-1)を例に説明する。なお、論理CPU1(131-1)には物理CPU1(101-1)が割り当てられ、論理CPU2(131-2)には物理CPU2(101-2)が割り当てられているものとする。 In the following description, the LPAR1 (130-1) having the logical CPU1 (131-1) and the logical CPU2 (131-2) in the shared mode will be described as an example. It is assumed that the physical CPU 1 (101-1) is assigned to the logical CPU 1 (131-1), and the physical CPU 2 (101-2) is assigned to the logical CPU 2 (131-2).
 この場合、CPU構成情報126の論理CPU1(131-1)に対応する行の物理CPU番号304には「pCPU1」が格納され、状態305には「実行中」が格納される。また、論理CPU2(131-2)に対応する行の物理CPU番号304には「pCPU2」が格納され、状態305には「実行中」が格納される。 In this case, “pCPU1” is stored in the physical CPU number 304 of the row corresponding to the logical CPU1 (131-1) in the CPU configuration information 126, and “running” is stored in the state 305. In addition, “pCPU2” is stored in the physical CPU number 304 of the row corresponding to the logical CPU2 (131-2), and “running” is stored in the state 305.
 ゲストOS1(140-1)が、論理CPU1(131-1)に対するMONITOR命令を発行する(ステップS501)。 Guest OS1 (140-1) issues a MONITOR instruction to logical CPU1 (131-1) (step S501).
 論理CPU1(131-1)に割り当てられた物理CPU1(101-1)は、MONITOR命令の発行を検知した場合、仮想化支援機能を用いて、ゲストOS140の処理モードからハイパバイザ120の処理モードに移行させる。なお、仮想化支援機能として、「Intel VT-x」及び「AMD-V」等が知られている。 When the physical CPU 1 (101-1) assigned to the logical CPU 1 (131-1) detects the issuance of the MONITOR instruction, it shifts from the processing mode of the guest OS 140 to the processing mode of the hypervisor 120 using the virtualization support function. Let As virtualization support functions, “Intel VT-x” and “AMD-V” are known.
 ハイパバイザ120は、CPU構成情報126を参照して、モニタ領域を設定する論理CPU1(131-1)が「共有モード」であるか否かを判定する。論理CPU1(131-1)は「共有モード」であるため、ハイパバイザ120の命令トラップ部123は、当該命令をトラップし(ステップS502)、モニタ領域登録処理を実行する(ステップS503)。 The hypervisor 120 refers to the CPU configuration information 126 and determines whether or not the logical CPU 1 (131-1) that sets the monitor area is in the “shared mode”. Since the logical CPU 1 (131-1) is in the “shared mode”, the instruction trap unit 123 of the hypervisor 120 traps the instruction (step S502) and executes the monitor area registration process (step S503).
 これによって、ゲストOS1(140-1)によって指定されたモニタ領域を含むページに書込保護が設定される。モニタ領域登録処理の詳細は、図6を用いて後述する。なお、物理CPU1(101-1)は、モニタ領域登録処理が完了した後、仮想化支援機能を用いて、ハイパバイザ120の処理モードからゲストOS140の処理モードに移行させる。 Thereby, write protection is set to the page including the monitor area designated by the guest OS1 (140-1). Details of the monitor area registration processing will be described later with reference to FIG. Note that the physical CPU 1 (101-1) shifts the processing mode of the hypervisor 120 to the processing mode of the guest OS 140 using the virtualization support function after the monitor area registration processing is completed.
 ゲストOS1(140-1)が、論理CPU1(131-1)のMWAIT命令を発行する(ステップS504)。 The guest OS1 (140-1) issues an MWAIT command for the logical CPU1 (131-1) (step S504).
 このとき、論理CPU1(131-1)に割り当てられた物理CPU1(101-1)は、MWAIT命令の発行を検知した場合、仮想化支援機能を用いて、ゲストOS140の処理モードからハイパバイザ120の処理モードに移行させる。 At this time, when the physical CPU 1 (101-1) assigned to the logical CPU 1 (131-1) detects the issuance of the MWAIT instruction, the processing of the hypervisor 120 from the processing mode of the guest OS 140 is performed using the virtualization support function. Switch to mode.
 ハイパバイザ120は、CPU構成情報126を参照して、モニタ領域を設定する論理CPU1(131-1)が「共有モード」であるか否かを判定する。論理CPU1(131-1)は「共有モード」であるため、ハイパバイザ120の命令トラップ部123は、当該命令をトラップし(ステップS505)、休止状態遷移処理を実行する(ステップS506)。 The hypervisor 120 refers to the CPU configuration information 126 and determines whether or not the logical CPU 1 (131-1) that sets the monitor area is in the “shared mode”. Since the logical CPU 1 (131-1) is in the “shared mode”, the instruction trap unit 123 of the hypervisor 120 traps the instruction (step S505) and executes a dormant state transition process (step S506).
 これによって、論理CPU1(131-1)が実行状態から休止状態に遷移し、また、論理CPU1(131-1)に対する物理CPU1(101-1)の割り当てが解除される。休止状態遷移処理の詳細は、図7を用いて後述する。なお、物理CPU1(101-1)は、休止状態遷移処理が完了した後、仮想化支援機能を用いて、ハイパバイザ120の処理モードからゲストOS140の処理モードに移行させる。 As a result, the logical CPU 1 (131-1) transitions from the execution state to the dormant state, and the assignment of the physical CPU 1 (101-1) to the logical CPU 1 (131-1) is released. Details of the dormant state transition process will be described later with reference to FIG. The physical CPU 1 (101-1) shifts from the processing mode of the hypervisor 120 to the processing mode of the guest OS 140 using the virtualization support function after the hibernation state transition processing is completed.
 ゲストOS1(140-1)が、論理CPU2(131-2)を用いて論理CPU1(131-1)のモニタ領域へのWRITE命令を発行する(ステップS507)。 The guest OS1 (140-1) issues a WRITE command to the monitor area of the logical CPU1 (131-1) using the logical CPU2 (131-2) (step S507).
 論理CPU2(131-2)に割り当てられた物理CPU2(101-2)が、当該WRITE命令を受け付ける。物理CPU2(101-2)は、モニタ領域を含む書込保護が設定されたメモリ領域へのWRITE命令の発行に起因する例外処理を検知した場合、仮想化支援機能を用いて、ゲストOS140の処理モードからハイパバイザ120の処理モードに移行させる。 The physical CPU 2 (101-2) assigned to the logical CPU 2 (131-2) receives the WRITE command. When the physical CPU 2 (101-2) detects an exception process due to the issuance of the WRITE instruction to the memory area where the write protection is set including the monitor area, the process of the guest OS 140 is performed using the virtualization support function. The mode is changed to the processing mode of the hypervisor 120.
 ハイパバイザ120の命令トラップ部123は、モニタ領域へのWRITE命令をトラップし(ステップS508)、実行状態遷移処理を実行する(ステップS509)。 The instruction trap unit 123 of the hypervisor 120 traps the WRITE instruction to the monitor area (step S508) and executes the execution state transition process (step S509).
 これによって、論理CPU1(131-1)が休止状態から実行状態に遷移する。実行状態遷移処理の詳細は、図8を用いて後述する。なお、物理CPU2(101-2)は、実行状態遷移処理が完了した後、仮想化支援機能を用いて、ハイパバイザ120の処理モードからゲストOS140の処理モードに移行させる。 As a result, the logical CPU 1 (131-1) transitions from the sleep state to the execution state. Details of the execution state transition process will be described later with reference to FIG. The physical CPU 2 (101-2) shifts from the processing mode of the hypervisor 120 to the processing mode of the guest OS 140 using the virtualization support function after the execution state transition processing is completed.
 その後、ハイパバイザ120のプロセススケジューラ121は、スケジュールにしたがって、論理CPU1(131-1)に物理CPU1(101-1)を割り当て(ステップS510)、さらに、CPU構成情報126を更新する(ステップS511)。 Thereafter, the process scheduler 121 of the hypervisor 120 assigns the physical CPU 1 (101-1) to the logical CPU 1 (131-1) according to the schedule (step S510), and further updates the CPU configuration information 126 (step S511).
 なお、物理CPU1(101-1)が論理CPU3(131-3)等にすでに割り当てられている可能性がある。この場合、ハイパバイザ120は、論理CPU1(131-1)及び論理CPU3(131-3)の優先度等を比較する。 There is a possibility that the physical CPU 1 (101-1) has already been assigned to the logical CPU 3 (131-3) or the like. In this case, the hypervisor 120 compares the priorities of the logical CPU 1 (131-1) and the logical CPU 3 (131-3).
 論理CPU1(131-1)の優先度が論理CPU3(131-3)の優先度より高い場合、ハイパバイザ120は、論理CPU3(131-3)に対する物理CPU1(101-1)の割り当てを強制的に解除し、論理CPU1(131-1)に物理CPU1(101-1)を割り当てる。論理CPU1(131-1)の優先度が論理CPU3(131-3)の優先度より低い場合、ハイパバイザ120は、論理CPU3(131-3)に対する物理CPU1(101-1)の割り当てが解除されるのを待つ。 When the priority of the logical CPU 1 (131-1) is higher than the priority of the logical CPU 3 (131-3), the hypervisor 120 forcibly assigns the physical CPU 1 (101-1) to the logical CPU 3 (131-3). The physical CPU 1 (101-1) is assigned to the logical CPU 1 (131-1). When the priority of the logical CPU 1 (131-1) is lower than the priority of the logical CPU 3 (131-3), the hypervisor 120 deallocates the physical CPU 1 (101-1) to the logical CPU 3 (131-3). Wait for
 次に、図6から図8を用いてハイパバイザ120が実行する処理の詳細を説明する。 Next, details of processing executed by the hypervisor 120 will be described with reference to FIGS.
 図6は、実施例1のハイパバイザ120が実行するモニタ領域登録処理の一例を説明するフローチャートである。 FIG. 6 is a flowchart for explaining an example of the monitor area registration process executed by the hypervisor 120 according to the first embodiment.
 ここでは、MONITOR命令には、モニタ領域の仮想アドレスとして「Ad_mon10」を含まれるものとする。また、仮想アドレス「Ad_mon10」に対応するゲスト物理アドレスは「L1_Ad_mon10」であるものとする。 Here, it is assumed that the MONITOR instruction includes “Ad_mon10” as a virtual address of the monitor area. The guest physical address corresponding to the virtual address “Ad_mon10” is assumed to be “L1_Ad_mon10”.
 ハイパバイザ120は、論理CPU131の識別番号に基づいてCPU構成情報126を参照し、論理CPU131の割当モードが「共有モード」であるか否かを判定する(ステップS601)。具体的には、以下のような処理が実行される。 The hypervisor 120 refers to the CPU configuration information 126 based on the identification number of the logical CPU 131, and determines whether or not the allocation mode of the logical CPU 131 is “shared mode” (step S601). Specifically, the following processing is executed.
 ハイパバイザ120は、論理CPU番号303がMONITOR命令の対象となる論理CPU131の識別番号と一致する行を検索する。ハイパバイザ120は、検索された行のスケジューリングモード302が「共有」であるか否かを判定する。検索された行のスケジューリングモード302が「共有」である場合、ハイパバイザ120は、論理CPU131の割当モードが「共有モード」であると判定する。 The hypervisor 120 searches for a line in which the logical CPU number 303 matches the identification number of the logical CPU 131 that is the target of the MONITOR instruction. The hypervisor 120 determines whether or not the scheduling mode 302 of the retrieved row is “shared”. When the scheduling mode 302 of the retrieved row is “shared”, the hypervisor 120 determines that the allocation mode of the logical CPU 131 is “shared mode”.
 論理CPU131の割当モードが「共有モード」でないと判定された場合、ハイパバイザ120は、仮想化支援機能を用いて、ハイパバイザ120の処理モードからゲストOS140の処理モードに移行させ、処理を終了する。この場合、論理CPU131の割当モードが「占有モード」であるため、物理CPU101に対して直接MONITOR命令が実行される。すなわち、ハイパバイザ120によるエミュレーションは行われない。 When it is determined that the allocation mode of the logical CPU 131 is not “shared mode”, the hypervisor 120 shifts from the processing mode of the hypervisor 120 to the processing mode of the guest OS 140 using the virtualization support function, and ends the processing. In this case, since the allocation mode of the logical CPU 131 is “occupied mode”, the MONITOR instruction is directly executed on the physical CPU 101. That is, emulation by the hypervisor 120 is not performed.
 論理CPU131の割当モードが「共有モード」であると判定された場合、ハイパバイザ120は、モニタ領域管理情報125を参照し(ステップS602)、モニタ領域管理情報125にMONITOR命令によって指定されたモニタ領域が登録されているか否かを判定する(ステップS603)。 When it is determined that the allocation mode of the logical CPU 131 is the “shared mode”, the hypervisor 120 refers to the monitor area management information 125 (step S602), and the monitor area specified by the MONITOR instruction is specified in the monitor area management information 125. It is determined whether it is registered (step S603).
 具体的には、ハイパバイザ120は、論理CPU番号401がMONITOR命令の対象となる論理CPU131の識別番号に一致するエントリを検索する。当該エントリが存在しない場合、ハイパバイザ120は、モニタ領域管理情報125にMONITOR命令によって指定されたモニタ領域が登録されていないと判定する。 Specifically, the hypervisor 120 searches for an entry in which the logical CPU number 401 matches the identification number of the logical CPU 131 that is the target of the MONITOR instruction. If the entry does not exist, the hypervisor 120 determines that the monitor area specified by the MONITOR instruction is not registered in the monitor area management information 125.
 モニタ領域管理情報125にMONITOR命令によって指定されたモニタ領域が登録されていないと判定された場合、ハイパバイザ120は、モニタ領域管理情報125にモニタ領域を登録する(ステップS606)。その後、ハイパバイザ120は、ステップS607に進む。 When it is determined that the monitor area specified by the MONITOR instruction is not registered in the monitor area management information 125, the hypervisor 120 registers the monitor area in the monitor area management information 125 (step S606). Thereafter, the hypervisor 120 proceeds to step S607.
 具体的には、ハイパバイザ120は、モニタ領域管理情報125に新たなエントリを追加し、論理CPU番号401にMONITOR命令の対象の論理CPU131の識別番号を設定する。また、ハイパバイザ120は、追加されたエントリの仮想アドレス403にモニタ領域の仮想アドレスを設定し、また、ゲスト物理アドレス404にモニタ領域のゲスト物理アドレスを設定する。例えば、仮想アドレス403には「Ad_mon10」が設定され、ゲスト物理アドレス404には「L1_Ad_mon10」が設定される。 Specifically, the hypervisor 120 adds a new entry to the monitor area management information 125 and sets the identification number of the logical CPU 131 that is the target of the MONITOR instruction in the logical CPU number 401. Further, the hypervisor 120 sets the virtual address of the monitor area in the virtual address 403 of the added entry, and sets the guest physical address of the monitor area in the guest physical address 404. For example, “Ad_mon10” is set in the virtual address 403, and “L1_Ad_mon10” is set in the guest physical address 404.
 モニタ領域管理情報125にMONITOR命令によって指定されたモニタ領域が登録されていると判定された場合、ハイパバイザ120は、登録されているモニタ領域がMONITOR命令によって指定されたモニタ領域と一致するか否かを判定する(ステップS604)。 When it is determined that the monitor area specified by the MONITOR instruction is registered in the monitor area management information 125, the hypervisor 120 determines whether or not the registered monitor area matches the monitor area specified by the MONITOR instruction. Is determined (step S604).
 具体的には、ハイパバイザ120は、ステップS603において検索されたエントリの仮想アドレス403と、MONITOR命令に含まれる仮想アドレスとが一致するか否かを判定する。例えば、ハイパバイザ120は、仮想アドレス403に「Ad_mon10」が格納されるエントリを検索する。 Specifically, the hypervisor 120 determines whether or not the virtual address 403 of the entry searched in step S603 matches the virtual address included in the MONITOR instruction. For example, the hypervisor 120 searches for an entry in which “Ad_mon10” is stored in the virtual address 403.
 登録されているモニタ領域がMONITOR命令によって指定されたモニタ領域と一致すると判定された場合、ハイパバイザ120は、処理を終了する。 When it is determined that the registered monitor area matches the monitor area specified by the MONITOR instruction, the hypervisor 120 ends the process.
 登録されているモニタ領域がMONITOR命令によって指定されたモニタ領域と一致しないと判定された場合、ハイパバイザ120は、登録されているモニタ領域を含むメモリ領域の書込保護の設定を解除する(ステップS605)。具体的には、以下のような処理が実行される。 If it is determined that the registered monitor area does not match the monitor area specified by the MONITOR instruction, the hypervisor 120 cancels the write protection setting of the memory area including the registered monitor area (step S605). ). Specifically, the following processing is executed.
 ハイパバイザ120は、メモリ構成情報127を参照して、ゲスト物理アドレス313がステップS603において検索されたエントリのゲスト物理アドレス404と一致するエントリを検索する。例えば、ハイパバイザ120は、ゲスト物理アドレス313が「L1_Ad_mon10」であるエントリを検索する。 The hypervisor 120 refers to the memory configuration information 127 and searches for an entry in which the guest physical address 313 matches the guest physical address 404 of the entry searched in step S603. For example, the hypervisor 120 searches for an entry whose guest physical address 313 is “L1_Ad_mon10”.
 ハイパバイザ120のメモリ書込保護部122は、検索されたエントリのハイパバイザ物理アドレス311に設定されたアドレスに基づいて、モニタ領域を含むメモリ領域の書込保護の設定を解除する。また、ハイパバイザ120は、検索されたエントリの属性314を空欄に書き換える。 The memory write protection unit 122 of the hypervisor 120 cancels the write protection setting of the memory area including the monitor area based on the address set as the hypervisor physical address 311 of the retrieved entry. Further, the hypervisor 120 rewrites the attribute 314 of the searched entry to a blank.
 ハイパバイザ120は、モニタ領域管理情報125にモニタ領域を登録する(ステップS606)。 The hypervisor 120 registers the monitor area in the monitor area management information 125 (step S606).
 具体的には、ハイパバイザ120は、ステップS603において検索されたエントリの仮想アドレス403及びゲスト物理アドレス404の値を、MONITOR命令に含まれるモニタ領域の仮想アドレス及びゲスト物理アドレスに変更する。例えば、仮想アドレス403が「Ad_mon10」に変更され、ゲスト物理アドレス404が「L1_Ad_mon10」に変更される。 Specifically, the hypervisor 120 changes the values of the virtual address 403 and guest physical address 404 of the entry searched in step S603 to the virtual address and guest physical address of the monitor area included in the MONITOR instruction. For example, the virtual address 403 is changed to “Ad_mon10”, and the guest physical address 404 is changed to “L1_Ad_mon10”.
 ハイパバイザ120のメモリ書込保護部122は、モニタ領域を含むページに書込保護を設定し(ステップS607)。また、メモリ構成情報127を更新する(ステップS608)。その後、ハイパバイザ120は処理を終了する。 The memory write protection unit 122 of the hypervisor 120 sets write protection for the page including the monitor area (step S607). Also, the memory configuration information 127 is updated (step S608). Thereafter, the hypervisor 120 ends the process.
 具体的には、ハイパバイザ120は、メモリ構成情報127を参照して、ゲスト物理アドレス313が登録されたモニタ領域に対応するエントリのゲスト物理アドレス404と一致するエントリを検索する。ハイパバイザ120は、検索されたエントリの属性314に「書込保護」を設定する。 Specifically, the hypervisor 120 refers to the memory configuration information 127 and searches for an entry that matches the guest physical address 404 of the entry corresponding to the monitor area in which the guest physical address 313 is registered. The hypervisor 120 sets “write protection” to the attribute 314 of the retrieved entry.
 図7は、実施例1のハイパバイザ120が実行する休止状態遷移処理を説明するフローチャートである。 FIG. 7 is a flowchart for explaining hibernation state transition processing executed by the hypervisor 120 according to the first embodiment.
 ハイパバイザ120は、MWAIT命令に含まれる論理CPU131の識別番号に基づいてCPU構成情報126を参照し、論理CPU131の割当モードが「共有モード」であるか否かを判定する(ステップS701)。ステップS701の処理はステップS601の処理と同一である。 The hypervisor 120 refers to the CPU configuration information 126 based on the identification number of the logical CPU 131 included in the MWAIT instruction, and determines whether or not the allocation mode of the logical CPU 131 is “shared mode” (step S701). The process in step S701 is the same as the process in step S601.
 論理CPU131の割当モードが「共有モード」でないと判定された場合、ハイパバイザ120は、仮想化支援機能を用いて、ハイパバイザ120の処理モードからゲストOS140の処理モードに移行させ、処理を終了する。この場合、論理CPU131の割当モードが「占有モード」であるため、物理CPU101に対して直接MWAIT命令が実行される。すなわち、ハイパバイザ120によるエミュレーションは行われない。 When it is determined that the allocation mode of the logical CPU 131 is not “shared mode”, the hypervisor 120 shifts from the processing mode of the hypervisor 120 to the processing mode of the guest OS 140 using the virtualization support function, and ends the processing. In this case, since the allocation mode of the logical CPU 131 is “occupied mode”, the MWAIT instruction is directly executed to the physical CPU 101. That is, emulation by the hypervisor 120 is not performed.
 論理CPU131の割当モードが「共有モード」であると判定された場合、ハイパバイザ120は、CPU構成情報126を更新する(ステップS702)。 When it is determined that the allocation mode of the logical CPU 131 is the “shared mode”, the hypervisor 120 updates the CPU configuration information 126 (step S702).
 具体的には、ハイパバイザ120は、ステップS701において検索された論理CPU131の行の状態305に「休止」を設定する。 Specifically, the hypervisor 120 sets “pause” in the state 305 of the row of the logical CPU 131 searched in step S701.
 ハイパバイザ120は、MWAIT命令の対象の論理CPU131の状態を休止状態に遷移させ(ステップS703)、また、当該論理CPU131に割り当てられた物理CPU101を解除する(ステップS704)。さらに、ハイパバイザ120は、CPU構成情報126を更新し(ステップS705)、その後、処理を終了する。 The hypervisor 120 changes the state of the logical CPU 131 that is the target of the MWAIT instruction to the sleep state (step S703), and releases the physical CPU 101 assigned to the logical CPU 131 (step S704). Further, the hypervisor 120 updates the CPU configuration information 126 (step S705), and thereafter ends the process.
 具体的には、ハイパバイザ120は、ステップS701において検索された論理CPU131の行の物理CPU番号304に「割り当てなし」を設定する。 Specifically, the hypervisor 120 sets “not assigned” to the physical CPU number 304 in the row of the logical CPU 131 searched in step S701.
 図8は、実施例1のハイパバイザ120が実行する実行状態遷移処理を説明するフローチャートである。 FIG. 8 is a flowchart for explaining execution state transition processing executed by the hypervisor 120 according to the first embodiment.
 物理CPU101は、書込保護が設定されたメモリ領域に対するWRITE命令による例外処理を検知した場合、仮想化支援機能を用いて、ゲストOS140の処理モードからハイパバイザ120の処理モードに移行させる。 When the physical CPU 101 detects an exception process by the WRITE instruction for the memory area where the write protection is set, the physical CPU 101 shifts from the processing mode of the guest OS 140 to the processing mode of the hypervisor 120 using the virtualization support function.
 なお、論理CPU131が「共有モード」の場合にのみメモリ領域に書込保護が設定されるため、論理CPU131が「占有モード」の場合、例外処理は発生しないため、ハイパバイザ120によるエミュレーションは行われない。 Note that since write protection is set in the memory area only when the logical CPU 131 is in the “shared mode”, no exception processing occurs when the logical CPU 131 is in the “occupied mode”, and thus the emulation by the hypervisor 120 is not performed. .
 ハイパバイザ120は、前述した処理モードの遷移によって、書込保護が設定されたメモリ領域に対するWRITE命令であることを検知する(ステップS801)。 The hypervisor 120 detects that it is a WRITE command for the memory area where the write protection is set by the transition of the processing mode described above (step S801).
 ハイパバイザ120は、モニタ領域管理情報125に基づいて、書込保護が設定されたメモリ領域に対するWRITE命令がモニタ領域に対するWRITE命令であるか否かを判定する(ステップS802)。具体的には、以下のような処理が実行される。 The hypervisor 120 determines based on the monitor area management information 125 whether or not the WRITE instruction for the memory area for which write protection is set is a WRITE instruction for the monitor area (step S802). Specifically, the following processing is executed.
 ハイパバイザ120は、仮想アドレス403がWRITE命令に含まれる仮想アドレスと一致するエントリを検索する。仮想アドレス403がWRITE命令に含まれる仮想アドレスと一致するエントリが存在した場合、ハイパバイザ120は、書込保護が設定されたメモリ領域に対するWRITE命令がモニタ領域に対するWRITE命令であると判定する。 The hypervisor 120 searches for an entry in which the virtual address 403 matches the virtual address included in the WRITE instruction. If there is an entry in which the virtual address 403 matches the virtual address included in the WRITE instruction, the hypervisor 120 determines that the WRITE instruction for the memory area for which write protection is set is a WRITE instruction for the monitor area.
 書込保護が設定されたメモリ領域に対するWRITE命令がモニタ領域に対するWRITE命令であると判定された場合、ハイパバイザ120は、当該WRITE命令の対象となる論理CPU131を特定し、特定された論理CPU131の状態を休止状態から実行状態に遷移させる(ステップS803)。 If it is determined that the WRITE instruction for the memory area for which write protection is set is a WRITE instruction for the monitor area, the hypervisor 120 identifies the logical CPU 131 that is the target of the WRITE instruction, and the state of the identified logical CPU 131 Is transitioned from the sleep state to the execution state (step S803).
 ハイパバイザ120は、モニタ領域を含むページに設定された書込保護の設定を解除する(ステップS804)。具体的には、以下のような処理が実行される。 The hypervisor 120 cancels the write protection setting set for the page including the monitor area (step S804). Specifically, the following processing is executed.
 ハイパバイザ120は、ステップS802において検索されたエントリの論理CPU番号401に基づいて、WRITE命令の対象となる論理CPU131を特定する。ハイパバイザ120は、CPU構成情報126を参照して、論理CPU番号303が検索されたエントリの論理CPU番号401と一致する行を検索する。ハイパバイザ120は、検索された行を含むエントリのLPAR番号301からWRITE命令の対象の論理CPU131を有するLPAR130を特定する。 The hypervisor 120 identifies the logical CPU 131 that is the target of the WRITE instruction based on the logical CPU number 401 of the entry searched in step S802. The hypervisor 120 refers to the CPU configuration information 126 and searches for a line in which the logical CPU number 303 matches the logical CPU number 401 of the searched entry. The hypervisor 120 identifies the LPAR 130 having the logical CPU 131 that is the target of the WRITE instruction from the LPAR number 301 of the entry including the retrieved line.
 ハイパバイザ120は、メモリ構成情報127を参照して、割当先LPAR番号312が特定されたLPAR130の識別番号と一致するエントリを検索する。さらに、ハイパバイザ120は、検索されたエントリのゲスト物理アドレス313を参照して、ステップS802において検索されたエントリのゲスト物理アドレス404を含むメモリ領域を特定する。ハイパバイザ120のメモリ書込保護部122は、当該メモリ領域の書込保護の設定を解除する。 The hypervisor 120 refers to the memory configuration information 127 and searches for an entry whose allocation destination LPAR number 312 matches the identification number of the specified LPAR 130. Further, the hypervisor 120 refers to the guest physical address 313 of the searched entry, and specifies a memory area including the guest physical address 404 of the entry searched in step S802. The memory write protection unit 122 of the hypervisor 120 cancels the write protection setting of the memory area.
 ハイパバイザ120は、CPU構成情報126及びメモリ構成情報127を更新し(ステップS805)、その後、処理を終了する。具体的には、以下のような処理が実行される。 The hypervisor 120 updates the CPU configuration information 126 and the memory configuration information 127 (step S805), and thereafter ends the processing. Specifically, the following processing is executed.
 ハイパバイザ120は、CPU構成情報126を参照して、論理CPU番号303が検索されたエントリの論理CPU番号401と一致する行の状態305を「割り当て待ち」に変更する。ハイパバイザ120は、メモリ構成情報127を参照して、ステップS804において特定されたメモリ領域に対応する行の属性314を空欄に変更する。 The hypervisor 120 refers to the CPU configuration information 126 and changes the state 305 of the line where the logical CPU number 303 matches the logical CPU number 401 of the retrieved entry to “waiting for allocation”. The hypervisor 120 refers to the memory configuration information 127 and changes the row attribute 314 corresponding to the memory area specified in step S804 to a blank.
 書込保護が設定されたメモリ領域に対するWRITE命令がモニタ領域に対するWRITE命令でないと判定された場合、書込保護が設定されたメモリ領域に対して、代理のWRITE処理を実行する(ステップS806)。 If it is determined that the WRITE command for the memory area for which write protection is set is not a WRITE command for the monitor area, proxy WRITE processing is executed for the memory area for which write protection is set (step S806).
 すなわち、ハイパバイザ120は、ゲストOS140の代わりに、書込保護が設定されたメモリ領域に対してデータを書き込む。 That is, the hypervisor 120 writes data in a memory area where write protection is set instead of the guest OS 140.
 実施例2について実施例1との差異を中心に説明する。 Example 2 will be described with a focus on differences from Example 1.
 実施例2の物理計算機100、ハイパバイザ120及びLPAR130の構成は実施例1と同一であるため説明を省略する。ただし、実施例2では、ハイパバイザ120はゲストOS140に対してモニタ領域のサイズを通知するインタフェースを有する。 Since the configurations of the physical computer 100, the hypervisor 120, and the LPAR 130 of the second embodiment are the same as those of the first embodiment, description thereof is omitted. However, in the second embodiment, the hypervisor 120 has an interface that notifies the guest OS 140 of the size of the monitor area.
 ハイパバイザ120は、LPAR130上にゲストOS140を稼働させる場合に、当該インタフェースを介して、予め、ゲストOS140にモニタ領域のサイズが「4キロバイト」である旨を通知する。これによって、メモリ書込保護部122が書込保護を設定するメモリ領域のサイズと、モニタ領域のサイズとが一致する。したがって、実施例2では、実施例1のようなノイズが発生しない。 When the guest OS 140 is operated on the LPAR 130, the hypervisor 120 notifies the guest OS 140 that the size of the monitor area is “4 kilobytes” in advance via the interface. As a result, the size of the memory area where the memory write protection unit 122 sets the write protection matches the size of the monitor area. Therefore, in the second embodiment, noise as in the first embodiment does not occur.
 実施例2の共有モードの論理CPU131におけるMONITOR/MWAIT命令のエミュレーション処理の流れは、実施例1と同一であるため説明を省略する。また、実施例2のモニタ領域登録処理及び休止状態遷移処理は、実施例1と同一であるため説明を省略する。 Since the flow of emulation processing of the MONITOR / MWAIT instruction in the logical CPU 131 in the shared mode of the second embodiment is the same as that of the first embodiment, the description thereof is omitted. Further, the monitor area registration process and the dormant state transition process of the second embodiment are the same as those of the first embodiment, and thus the description thereof is omitted.
 実施例2では、実行状態遷移処理の一部が実施例1の実行状態遷移処理と異なる。図9は、実施例2のハイパバイザ120が実行する実行状態遷移処理を説明するフローチャートである。 In the second embodiment, a part of the execution state transition process is different from the execution state transition process of the first embodiment. FIG. 9 is a flowchart for explaining execution state transition processing executed by the hypervisor 120 according to the second embodiment.
 物理CPU101は、書込保護が設定されたメモリ領域に対するWRITE命令による例外処理を検知した場合、仮想化支援機能を用いて、ゲストOS140の処理モードからハイパバイザ120の処理モードに移行させる。 When the physical CPU 101 detects an exception process by the WRITE instruction for the memory area where the write protection is set, the physical CPU 101 shifts from the processing mode of the guest OS 140 to the processing mode of the hypervisor 120 using the virtualization support function.
 ハイパバイザ120は、前述した処理モードの遷移によって、書込保護が設定されたメモリ領域、すなわち、モニタ領域に対するWRITE命令であることを検知する(ステップS901)。 The hypervisor 120 detects that it is a WRITE command for the memory area where the write protection is set, that is, the monitor area, by the transition of the processing mode described above (step S901).
 ハイパバイザ120は、モニタ領域管理情報125に基づいて、当該WRITE命令の対象となる論理CPU131を特定し、特定された論理CPU131の状態を休止状態から実行状態に遷移させる(ステップS902)。ステップS902の処理は、ステップS803の処理と同一である。 The hypervisor 120 identifies the logical CPU 131 that is the target of the WRITE instruction based on the monitor area management information 125, and changes the state of the identified logical CPU 131 from the sleep state to the execution state (step S902). The process in step S902 is the same as the process in step S803.
 ハイパバイザ120は、モニタ領域に設定された書込保護の設定を解除する(ステップS903)。具体的には、以下のような処理が実行される。 The hypervisor 120 cancels the write protection setting set in the monitor area (step S903). Specifically, the following processing is executed.
 ハイパバイザ120は、ステップS902において検索されたエントリの論理CPU番号401に基づいて、WRITE命令の対象となる論理CPU131を特定する。ハイパバイザ120は、CPU構成情報126を参照して、論理CPU番号303が論理CPU番号401と一致する行を検索する。ハイパバイザ120は、検索された行を含むエントリのLPAR番号301からWRITE命令の対象の論理CPU131を備えるLPAR130を特定する。 The hypervisor 120 identifies the logical CPU 131 that is the target of the WRITE instruction based on the logical CPU number 401 of the entry searched in step S902. The hypervisor 120 refers to the CPU configuration information 126 and searches for a line in which the logical CPU number 303 matches the logical CPU number 401. The hypervisor 120 identifies the LPAR 130 including the logical CPU 131 that is the target of the WRITE instruction from the LPAR number 301 of the entry including the retrieved line.
 ハイパバイザ120は、メモリ構成情報127を参照して、割当先LPAR番号312が特定されたLPAR130の識別番号と一致するエントリを検索する。さらに、ハイパバイザ120は、検索されたエントリのゲスト物理アドレス313を参照して、ステップS802において検索されたエントリのゲスト物理アドレス404に対応するメモリ領域を特定する。ハイパバイザ120のメモリ書込保護部122は、当該メモリ領域の書込保護の設定を解除する。 The hypervisor 120 refers to the memory configuration information 127 and searches for an entry whose allocation destination LPAR number 312 matches the identification number of the specified LPAR 130. Further, the hypervisor 120 refers to the guest physical address 313 of the searched entry, and specifies a memory area corresponding to the guest physical address 404 of the entry searched in step S802. The memory write protection unit 122 of the hypervisor 120 cancels the write protection setting of the memory area.
 ハイパバイザ120は、CPU構成情報126及びメモリ構成情報127を更新し(ステップS904)、その後、処理を終了する。ステップS904の処理はステップS806の処理と同一である。 The hypervisor 120 updates the CPU configuration information 126 and the memory configuration information 127 (step S904), and then ends the processing. The process in step S904 is the same as the process in step S806.
 実施例2では、書込保護が設定されるメモリ領域のサイズとモニタ領域のサイズとが一致するため、ステップS802及びステップS806の処理は必要ない。 In the second embodiment, since the size of the memory area in which the write protection is set matches the size of the monitor area, the processes in steps S802 and S806 are not necessary.
 実施例1及び実施例2を用いて説明したように、ハイパバイザ120は、メモリ書込保護部122及びモニタ領域管理情報125を用いて、共有モードの各論理CPU131に対するMONITOR命令、MWAIT命令、及びモニタ領域へのWRITE命令をエミュレーションすることができる。また、ハイパバイザ120は、モニタ領域へのWRITE命令をエミュレーションする場合、書込保護が設定されるメモリ領域のサイズとモニタ領域のサイズとの違いを隠蔽するように制御を行う。 As described in the first and second embodiments, the hypervisor 120 uses the memory write protector 122 and the monitor area management information 125 to monitor the MONITOR instruction, the MWAIT instruction, and the monitor for each logical CPU 131 in the shared mode. A WRITE instruction to the area can be emulated. Further, when emulating a WRITE instruction to the monitor area, the hypervisor 120 performs control so as to hide the difference between the size of the memory area to which the write protection is set and the size of the monitor area.
 したがって、論理CPU131においても物理CPU101と同様のMONITOR/MWAIT方式の制御が実現できる。また、物理CPU101がMONITOR/MWAIT方式に対応していなくても、LPAR130上でMONITOR/MWAIT方式の制御が実現できる。また、休止状態に遷移した論理CPU131に対する物理CPU101の割り当てを解除することによって、他の論理CPU131に割り当てることができる。そのため、計算機資源を有効に活用することができる。 Therefore, the MONITOR / MWAIT system control similar to that of the physical CPU 101 can also be realized in the logical CPU 131. Even if the physical CPU 101 does not support the MONITOR / MWAIT system, the MONITOR / MWAIT system can be controlled on the LPAR 130. Further, by releasing the assignment of the physical CPU 101 to the logical CPU 131 that has transitioned to the hibernation state, it can be assigned to another logical CPU 131. Therefore, computer resources can be used effectively.
 なお、本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。また、例えば、上記した実施例は本発明を分かりやすく説明するために構成を詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、各実施例の構成の一部について、他の構成に追加、削除、置換することが可能である。 In addition, this invention is not limited to the above-mentioned Example, Various modifications are included. Further, for example, the above-described embodiments are described in detail for easy understanding of the present invention, and are not necessarily limited to those provided with all the described configurations. Further, a part of the configuration of each embodiment can be added to, deleted from, or replaced with another configuration.
 また、上記の各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、本発明は、実施例の機能を実現するソフトウェアのプログラムコードによっても実現できる。この場合、プログラムコードを記録した記憶媒体をコンピュータに提供し、そのコンピュータが備えるCPUが記憶媒体に格納されたプログラムコードを読み出す。この場合、記憶媒体から読み出されたプログラムコード自体が前述した実施例の機能を実現することになり、そのプログラムコード自体、及びそれを記憶した記憶媒体は本発明を構成することになる。このようなプログラムコードを供給するための記憶媒体としては、例えば、フレキシブルディスク、CD-ROM、DVD-ROM、ハードディスク、SSD(Solid State Drive)、光ディスク、光磁気ディスク、CD-R、磁気テープ、不揮発性のメモリカード、ROMなどが用いられる。 In addition, each of the above-described configurations, functions, processing units, processing means, and the like may be realized by hardware by designing a part or all of them with, for example, an integrated circuit. The present invention can also be realized by software program codes that implement the functions of the embodiments. In this case, a storage medium in which the program code is recorded is provided to the computer, and a CPU included in the computer reads the program code stored in the storage medium. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiments, and the program code itself and the storage medium storing it constitute the present invention. Examples of storage media for supplying such program codes include flexible disks, CD-ROMs, DVD-ROMs, hard disks, SSDs (Solid State Drives), optical disks, magneto-optical disks, CD-Rs, magnetic tapes, A non-volatile memory card, ROM, or the like is used.
 また、本実施例に記載の機能を実現するプログラムコードは、例えば、アセンブラ、C/C++、perl、Shell、PHP、Java等の広範囲のプログラム又はスクリプト言語で実装できる。 Further, the program code for realizing the functions described in this embodiment can be implemented by a wide range of programs or script languages such as assembler, C / C ++, Perl, Shell, PHP, Java, and the like.
 さらに、実施例の機能を実現するソフトウェアのプログラムコードを、ネットワークを介して配信することによって、それをコンピュータのハードディスクやメモリ等の記憶手段又はCD-RW、CD-R等の記憶媒体に格納し、コンピュータが備えるCPUが当該記憶手段や当該記憶媒体に格納されたプログラムコードを読み出して実行するようにしてもよい。 Furthermore, by distributing the program code of the software that realizes the functions of the embodiments via a network, the program code is stored in a storage means such as a hard disk or memory of a computer or a storage medium such as a CD-RW or CD-R. The CPU included in the computer may read and execute the program code stored in the storage unit or the storage medium.
 上述の実施例において、制御線や情報線は、説明上必要と考えられるものを示しており、製品上必ずしも全ての制御線や情報線を示しているとは限らない。全ての構成が相互に接続されていてもよい。 In the above-described embodiments, the control lines and information lines indicate those that are considered necessary for the explanation, and do not necessarily indicate all the control lines and information lines on the product. All the components may be connected to each other.

Claims (10)

  1.  計算機資源として、複数の物理プロセッサ、及び前記複数の物理プロセッサの各々に接続される物理メモリを備える計算機であって、
     前記物理メモリは、複数の論理区画の各々に論理的に分割された前記計算機資源を割り当てる仮想化部を実現するプログラムを格納し、
     前記複数の論理区画の各々では、複数の論理プロセッサ、及び論理メモリを管理するオペレーティングシステムが稼働し、
     前記仮想化部は、前記複数の論理区画の各々が有する前記複数の論理プロセッサが同一の複数の物理プロセッサを共有するように、前記複数の物理プロセッサの割り当てを管理し、
     前記複数の物理プロセッサは、第1の物理プロセッサ及び第2の物理プロセッサを含み、
     前記オペレーティングシステムは、
     前記オペレーティングシステムが管理するプロセッサを休止状態から実行状態に遷移させるために監視するメモリ領域であるモニタ領域を指定するMONITOR命令と、
     前記オペレーティングシステムが管理するプロセッサを実行状態から休止状態に遷移させるためのMWAIT命令と、を発行し、
     前記複数の論理区画は、第1の論理プロセッサ、第2の論理プロセッサ、及び第1の論理メモリを有し、第1のオペレーティングシステムが稼働する第1の論理区画を含み、
     前記仮想化部は、
     前記MONITOR命令の対象となる論理プロセッサの識別子、及び前記オペレーティングシステムが管理するアドレス空間における前記モニタ領域のアドレスの対応付けを管理するモニタ領域管理情報を保持し、
     前記第1の論理プロセッサに割り当てられる前記第1の物理プロセッサによって、前記第1のオペレーティングシステムから前記第1の論理プロセッサに対するMONITOR命令が検知された場合、前記第1の論理プロセッサの識別子、及び前記第1のオペレーティングシステムが管理するアドレス空間における前記第1の論理プロセッサのモニタ領域のアドレスを対応付けた情報を前記モニタ領域管理情報に登録し、
     前記第1の論理プロセッサに割り当てられる第1の物理プロセッサによって、前記第1のオペレーティングシステムから前記第1の論理プロセッサに対するMWAIT命令が検知された場合、前記第1の論理プロセッサを実行状態から休止状態に遷移させ、前記第1の論理プロセッサに対する前記第1の物理プロセッサの割り当てを解除し、
     前記第2の論理プロセッサに割り当てられる前記第2の物理プロセッサによって、前記第1のオペレーティングシステムから前記第1の論理プロセッサのモニタ領域に対するWRITE命令が検知された場合、前記モニタ領域管理情報を参照して、前記第1の論理プロセッサのモニタ領域に対するWRITE命令であることを特定し、前記第1の論理プロセッサを休止状態から実行状態に遷移させることを特徴とする計算機。
    As a computer resource, a computer comprising a plurality of physical processors and a physical memory connected to each of the plurality of physical processors,
    The physical memory stores a program for realizing a virtualization unit that allocates the computer resources logically divided into a plurality of logical partitions,
    In each of the plurality of logical partitions, an operating system for managing a plurality of logical processors and a logical memory operates,
    The virtualization unit manages allocation of the plurality of physical processors so that the plurality of logical processors included in each of the plurality of logical partitions share the same plurality of physical processors;
    The plurality of physical processors includes a first physical processor and a second physical processor,
    The operating system is
    A MONITOR instruction that designates a monitor area that is a memory area to be monitored in order to transition the processor managed by the operating system from the sleep state to the execution state;
    Issuing a MWAIT instruction for transitioning a processor managed by the operating system from an execution state to a dormant state;
    The plurality of logical partitions includes a first logical partition having a first logical processor, a second logical processor, and a first logical memory, and running a first operating system;
    The virtualization unit
    Holding monitor area management information for managing the association of the address of the monitor area in the address space managed by the operating system, and the identifier of the logical processor that is the target of the MONITOR instruction;
    When a MONITOR instruction for the first logical processor is detected from the first operating system by the first physical processor assigned to the first logical processor, an identifier of the first logical processor; and Registering, in the monitor area management information, information associated with the address of the monitor area of the first logical processor in the address space managed by the first operating system;
    When the MWAIT instruction for the first logical processor is detected from the first operating system by the first physical processor assigned to the first logical processor, the first logical processor is changed from the execution state to the sleep state. To deallocate the first physical processor to the first logical processor,
    When a WRITE instruction for the monitor area of the first logical processor is detected from the first operating system by the second physical processor allocated to the second logical processor, the monitor area management information is referred to. A computer that identifies a WRITE instruction for the monitor area of the first logical processor and causes the first logical processor to transition from a sleep state to an execution state.
  2.  請求項1に記載の計算機であって、
     前記仮想化部は、前記MONITOR命令の発行が検知された場合、前記モニタ領域に関連する前記物理メモリのメモリ領域に対する書き込みを禁止する書込保護を設定するメモリ書込保護部を有し、
     前記第2の論理プロセッサに割り当てられる第2の物理プロセッサは、前記書込保護が設定された前記物理メモリのメモリ領域に対するWRITE命令の例外処理を検知することによって前記仮想化部を呼び出すことを特徴とする計算機。
    The computer according to claim 1,
    The virtualization unit includes a memory write protection unit that sets a write protection that prohibits writing to the memory area of the physical memory related to the monitor area when the issuance of the MONITOR instruction is detected;
    The second physical processor assigned to the second logical processor calls the virtualization unit by detecting exception processing of a WRITE instruction for the memory area of the physical memory to which the write protection is set. Calculator.
  3.  請求項2に記載の計算機であって、
     前記モニタ領域のサイズは、前記メモリ書込保護部が書込保護を設定するメモリ領域のサイズより小さく、
     前記仮想化部は、
     前記第2の論理プロセッサに割り当てられる第2のプロセッサによって呼び出された場合、前記モニタ領域管理情報を参照して、前記WRITE命令の対象となるメモリ領域のアドレスと前記モニタ領域のアドレスとが一致する否かを判定し、
     前記WRITE命令の対象となるメモリ領域のアドレスと前記モニタ領域のアドレスとが一致すると判定された場合、前記第1の論理プロセッサの前記モニタ領域に対するWRITE命令であることを検知することを特徴とする計算機。
    The computer according to claim 2,
    The size of the monitor area is smaller than the size of the memory area where the memory write protection unit sets write protection,
    The virtualization unit
    When called by the second processor assigned to the second logical processor, referring to the monitor area management information, the address of the memory area targeted by the WRITE instruction matches the address of the monitor area. Determine whether or not
    When it is determined that the address of the memory area subject to the WRITE instruction matches the address of the monitor area, it is detected that the address is a WRITE instruction for the monitor area of the first logical processor. calculator.
  4.  請求項3に記載の計算機であって、
     前記仮想化部は、前記WRITE命令の対象となるメモリ領域のアドレスと前記モニタ領域のアドレスとが一致しないと判定された場合、前記書込保護が設定された物理メモリのメモリ領域のうち、前記WRITE命令によって指定されたメモリ領域にデータを書き込むことを特徴とする計算機。
    The computer according to claim 3, wherein
    When the virtualization unit determines that the address of the memory area targeted by the WRITE instruction does not match the address of the monitor area, the virtualization unit includes the memory area of the physical memory in which the write protection is set. A computer which writes data into a memory area designated by a WRITE instruction.
  5.  請求項2に記載の計算機であって、
     前記モニタ領域のサイズは、前記メモリ書込保護部が書込保護を設定するメモリ領域のサイズより小さく、
     前記仮想化部は、前記論理区画上に前記オペレーティングシステムを稼働させる場合に、前記オペレーティングシステムに前記モニタ領域のサイズを、前記メモリ書込保護部が書込保護を設定するメモリ領域のサイズに設定するように通知するインタフェースを有することを特徴とする計算機。
    The computer according to claim 2,
    The size of the monitor area is smaller than the size of the memory area where the memory write protection unit sets write protection,
    When the virtualization unit operates the operating system on the logical partition, the size of the monitor area is set in the operating system, and the size of the memory area in which the memory write protection unit sets write protection. A computer characterized by having an interface for notifying.
  6.  計算機上の論理区画が有する論理プロセッサの制御方法であって、
     前記計算機は、計算機資源として、複数の物理プロセッサ、及び前記複数の物理プロセッサの各々に接続される物理メモリを有し、
     前記物理メモリは、複数の論理区画の各々に論理的に分割された前記計算機資源を割り当てる仮想化部を実現するプログラムを格納し、
     前記複数の論理区画の各々では、複数の論理プロセッサ、及び論理メモリを管理するオペレーティングシステムが稼働し、
     前記仮想化部は、前記複数の論理区画の各々が有する前記複数の論理プロセッサが同一の複数の物理プロセッサを共有するように、前記複数の物理プロセッサの割り当てを管理し、
     前記複数の物理プロセッサは、第1の物理プロセッサ及び第2の物理プロセッサを含み、
     前記オペレーティングシステムは、
     前記オペレーティングシステムが管理するプロセッサを休止状態から実行状態に遷移させるために監視するメモリ領域であるモニタ領域を指定するMONITOR命令と、
     前記オペレーティングシステムが管理するプロセッサを実行状態から休止状態に遷移させるためのMWAIT命令と、を発行し、
     前記複数の論理区画は、第1の論理プロセッサ、第2の論理プロセッサ、及び第1の論理メモリを有し、第1のオペレーティングシステムが稼働する第1の論理区画を含み、
     前記仮想化部は、前記MONITOR命令の対象となる論理プロセッサの識別子、及び前記オペレーティングシステムが管理するアドレス空間における前記モニタ領域のアドレスの対応付けを管理するモニタ領域管理情報を保持し、
     前記論理プロセッサの制御方法は、
     前記仮想化部が、前記第1の論理プロセッサに割り当てられる前記第1の物理プロセッサによって、前記第1のオペレーティングシステムから前記第1の論理プロセッサに対するMONITOR命令が検知された場合、前記第1の論理プロセッサの識別子、及び前記第1のオペレーティングシステムが管理するアドレス空間における前記第1の論理プロセッサのモニタ領域のアドレスを対応付けた情報を前記モニタ領域管理情報に登録する第1のステップと、
     前記仮想化部が、前記第1の論理プロセッサに割り当てられる第1の物理プロセッサによって、前記第1のオペレーティングシステムから前記第1の論理プロセッサに対するMWAIT命令が検知された場合、前記第1の論理プロセッサを実行状態から休止状態に遷移させ、前記第1の論理プロセッサに対する前記第1の物理プロセッサの割り当てを解除する第2のステップと、
     前記仮想化部が、前記第2の論理プロセッサに割り当てられる前記第2の物理プロセッサによって、前記第1のオペレーティングシステムから前記第1の論理プロセッサのモニタ領域に対するWRITE命令が検知された場合、前記モニタ領域管理情報を参照して、前記第1の論理プロセッサのモニタ領域に対するWRITE命令であることを特定し、前記第1の論理プロセッサを休止状態から実行状態に遷移させる第3のステップと、を含むことを特徴とする論理プロセッサの制御方法。
    A method of controlling a logical processor in a logical partition on a computer,
    The computer has, as computer resources, a plurality of physical processors and a physical memory connected to each of the plurality of physical processors,
    The physical memory stores a program for realizing a virtualization unit that allocates the computer resources logically divided into a plurality of logical partitions,
    In each of the plurality of logical partitions, an operating system for managing a plurality of logical processors and a logical memory operates,
    The virtualization unit manages allocation of the plurality of physical processors so that the plurality of logical processors included in each of the plurality of logical partitions share the same plurality of physical processors;
    The plurality of physical processors includes a first physical processor and a second physical processor,
    The operating system is
    A MONITOR instruction that designates a monitor area that is a memory area to be monitored in order to transition the processor managed by the operating system from the sleep state to the execution state;
    Issuing a MWAIT instruction for transitioning a processor managed by the operating system from an execution state to a dormant state;
    The plurality of logical partitions includes a first logical partition having a first logical processor, a second logical processor, and a first logical memory, and running a first operating system;
    The virtualization unit holds monitor area management information for managing an association between an identifier of a logical processor that is a target of the MONITOR instruction and an address of the monitor area in an address space managed by the operating system,
    The logical processor control method includes:
    When the virtualization unit detects a MONITOR instruction for the first logical processor from the first operating system by the first physical processor assigned to the first logical processor, the first logical processor A first step of registering, in the monitor area management information, information associating a processor identifier and an address of the monitor area of the first logical processor in an address space managed by the first operating system;
    When the virtualization unit detects an MWAIT instruction for the first logical processor from the first operating system by a first physical processor assigned to the first logical processor, the first logical processor Transition from an execution state to a dormant state, and deallocating the first physical processor to the first logical processor;
    When the virtualization unit detects a WRITE instruction for the monitor area of the first logical processor from the first operating system by the second physical processor allocated to the second logical processor, the monitor A third step of referring to the area management information to identify a WRITE instruction for the monitor area of the first logical processor and causing the first logical processor to transition from a sleep state to an execution state. A control method for a logical processor.
  7.  請求項6に記載の論理プロセッサの制御方法であって、
     前記仮想化部は、前記MONITOR命令の発行が検知された場合、前記モニタ領域に関連する前記物理メモリのメモリ領域に対する書き込みを禁止する書込保護を設定するメモリ書込保護部を有し、
     前記第3のステップは、前記第2の論理プロセッサに割り当てられる第2の物理プロセッサが、前記書込保護が設定された前記物理メモリのメモリ領域に対するWRITE命令の例外処理を検知することによって前記仮想化部を呼び出すステップを含むことを特徴とする論理プロセッサの制御方法。
    A method of controlling a logical processor according to claim 6,
    The virtualization unit includes a memory write protection unit that sets a write protection that prohibits writing to the memory area of the physical memory related to the monitor area when the issuance of the MONITOR instruction is detected;
    In the third step, the second physical processor assigned to the second logical processor detects the exception processing of the WRITE instruction for the memory area of the physical memory in which the write protection is set, thereby causing the virtual process. A control method for a logical processor, comprising a step of calling an allocating unit.
  8.  請求項7に記載の論理プロセッサの制御方法であって、
     前記モニタ領域のサイズは、前記メモリ書込保護部が書込保護を設定するメモリ領域のサイズより小さく、
     前記第3のステップは、
     前記第2の論理プロセッサに割り当てられる第2のプロセッサによって前記仮想化部が呼び出された場合、前記仮想化部が、前記モニタ領域管理情報を参照して、前記WRITE命令の対象となるメモリ領域のアドレスと前記モニタ領域のアドレスとが一致する否かを判定するステップと、
     前記WRITE命令の対象となるメモリ領域のアドレスと前記モニタ領域のアドレスとが一致すると判定された場合、前記仮想化部が前記第1の論理プロセッサの前記モニタ領域に対するWRITE命令であることを検知するステップと、を含むことを特徴とする論理プロセッサの制御方法。
    A method of controlling a logical processor according to claim 7,
    The size of the monitor area is smaller than the size of the memory area where the memory write protection unit sets write protection,
    The third step includes
    When the virtualization unit is called by the second processor allocated to the second logical processor, the virtualization unit refers to the monitor area management information and stores the memory area that is the target of the WRITE instruction. Determining whether the address matches the address of the monitor area;
    When it is determined that the address of the memory area targeted by the WRITE instruction matches the address of the monitor area, the virtualization unit detects that the address is a WRITE instruction for the monitor area of the first logical processor. And a logical processor control method.
  9.  請求項8に記載の論理プロセッサの制御方法であって、
     前記第3のステップは、前記WRITE命令の対象となるメモリ領域のアドレスと前記モニタ領域のアドレスとが一致しないと判定された場合、前記仮想化部が、前記書込保護が設定された物理メモリのメモリ領域のうち、前記WRITE命令によって指定されたメモリ領域にデータを書き込むことを特徴とする論理プロセッサの制御方法。
    A method of controlling a logical processor according to claim 8,
    In the third step, when it is determined that the address of the memory area targeted by the WRITE instruction does not match the address of the monitor area, the virtualization unit sets the physical memory in which the write protection is set. A method for controlling a logical processor, wherein data is written into a memory area specified by the WRITE instruction in the memory area.
  10.  請求項7に記載の論理プロセッサの制御方法であって、
     前記モニタ領域のサイズは、前記メモリ書込保護部が書込保護を設定するメモリ領域のサイズより小さく、
     前記仮想化部は、前記論理区画上に前記オペレーティングシステムを稼働させる場合に、前記オペレーティングシステムに前記モニタ領域のサイズを、前記メモリ書込保護部が書込保護を設定するメモリ領域のサイズに設定するように通知するインタフェースを有することを特徴とする論理プロセッサの制御方法。
    A method of controlling a logical processor according to claim 7,
    The size of the monitor area is smaller than the size of the memory area where the memory write protection unit sets write protection,
    When the virtualization unit operates the operating system on the logical partition, the size of the monitor area is set in the operating system, and the size of the memory area in which the memory write protection unit sets write protection. A control method for a logical processor, characterized by comprising an interface for notifying.
PCT/JP2014/081967 2014-12-03 2014-12-03 Computer and control method for logical processors WO2016088220A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/081967 WO2016088220A1 (en) 2014-12-03 2014-12-03 Computer and control method for logical processors

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/081967 WO2016088220A1 (en) 2014-12-03 2014-12-03 Computer and control method for logical processors

Publications (1)

Publication Number Publication Date
WO2016088220A1 true WO2016088220A1 (en) 2016-06-09

Family

ID=56091193

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2014/081967 WO2016088220A1 (en) 2014-12-03 2014-12-03 Computer and control method for logical processors

Country Status (1)

Country Link
WO (1) WO2016088220A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007525776A (en) * 2004-03-30 2007-09-06 インテル・コーポレーション Providing support for single step functionality of virtual machines in virtual machine environments
JP2008165834A (en) * 2001-12-31 2008-07-17 Intel Corp Method and apparatus for suspending execution of thread until specified memory access occurs
JP2014219977A (en) * 2013-05-03 2014-11-20 ヴイエムウェア インコーポレイテッドVMware,Inc. Dynamic virtual machine sizing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008165834A (en) * 2001-12-31 2008-07-17 Intel Corp Method and apparatus for suspending execution of thread until specified memory access occurs
JP2007525776A (en) * 2004-03-30 2007-09-06 インテル・コーポレーション Providing support for single step functionality of virtual machines in virtual machine environments
JP2014219977A (en) * 2013-05-03 2014-11-20 ヴイエムウェア インコーポレイテッドVMware,Inc. Dynamic virtual machine sizing

Similar Documents

Publication Publication Date Title
JP5782445B2 (en) How to allocate a portion of physical computing resources to a logical partition
US10289564B2 (en) Computer and memory region management method
CN106133690B (en) Thread context in multi-threaded computer system retains
JP6029550B2 (en) Computer control method and computer
US9176787B2 (en) Preserving, from resource management adjustment, portions of an overcommitted resource managed by a hypervisor
US9864626B2 (en) Coordinating joint operation of multiple hypervisors in a computer system
US20150339491A1 (en) Data allocation among devices with different data rates
WO2008087080A1 (en) Controlling an operational mode for a logical partition on a computing system
US10691481B2 (en) System and method for detection of underprovisioning of memory in virtual machines
JP2016167143A (en) Information processing system and control method of the same
US20220004420A1 (en) Optimizing Host CPU Usage Based on Virtual Machine Guest OS Power and Performance Management
JP6165964B2 (en) calculator
JP2009223842A (en) Virtual machine control program and virtual machine system
US10459747B2 (en) Exitless timer access for virtual machines
US9015418B2 (en) Self-sizing dynamic cache for virtualized environments
WO2014141419A1 (en) Virtual computer system and scheduling method
JP6198858B2 (en) Resource scheduling method by computer and hypervisor
US9158551B2 (en) Activating and deactivating Operating System (OS) function based on application type in manycore system
WO2020008757A1 (en) Method of accessing device in virtualized environment
WO2016088220A1 (en) Computer and control method for logical processors
WO2016203647A1 (en) Computer and process scheduling method
Garrido et al. SmarTmem: Intelligent management of transcendent memory in a virtualized server
JP2013149108A (en) Information processing apparatus, control method therefor, and program
CN113312295B (en) Computer system, machine-readable storage medium, and method of resetting a computer system
JP6035993B2 (en) Information processing apparatus, apparatus management method, and apparatus management program

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: 14907248

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14907248

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP