WO2015145620A1 - Computer, and address conversion method - Google Patents

Computer, and address conversion method Download PDF

Info

Publication number
WO2015145620A1
WO2015145620A1 PCT/JP2014/058566 JP2014058566W WO2015145620A1 WO 2015145620 A1 WO2015145620 A1 WO 2015145620A1 JP 2014058566 W JP2014058566 W JP 2014058566W WO 2015145620 A1 WO2015145620 A1 WO 2015145620A1
Authority
WO
WIPO (PCT)
Prior art keywords
guest
address
hypervisor
virtual
physical
Prior art date
Application number
PCT/JP2014/058566
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/058566 priority Critical patent/WO2015145620A1/en
Publication of WO2015145620A1 publication Critical patent/WO2015145620A1/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/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45545Guest-host, i.e. hypervisor is an application program itself, e.g. VirtualBox

Definitions

  • the present invention relates to a computer and an address conversion method, and is particularly suitable for application to a computer and an address conversion method for converting a virtual memory address used by a program on a virtual computer into a physical memory address.
  • hypervisors responsible for server virtualization functions are widely used as methods for effectively utilizing CPU cores installed in servers.
  • the hypervisor is system software that creates a plurality of virtual machines using resources such as a CPU, a memory, and an IO device mounted on one physical server, and runs an OS and an application program on each virtual machine.
  • Server virtualization technology using hypervisors has improved safety and memory performance as the virtualization support function by the CPU has been strengthened, and it is not limited to servers, but also for integration of multiple functions and multi-tenants for embedded applications such as control devices. Used for containment purposes.
  • the CPU directly executes instructions of an OS running on the virtual machine (hereinafter referred to as a guest OS) or a program running on the guest OS, while executing instructions designated by the hypervisor,
  • a guest OS an OS running on the virtual machine
  • a program running on the guest OS
  • an “intercept” is provided that interrupts the execution of the guest OS or program and calls the hypervisor.
  • the hypervisor uses intercepts to handle (emulate) only events that require hypervisor intervention, such as fault notification, and directly control the CPU to execute other instructions, thereby suppressing memory performance degradation caused by hypervisor operations. Like to do.
  • a virtual physical address starting from 0 (hereinafter referred to as a guest physical address) is assigned to the memory of each virtual machine, and a guest OS designed on the assumption that all the memory starting from address 0 can be used is virtualized. It is running on a computer.
  • the hypervisor creates a guest page table (hereinafter referred to as GPT) for the guest OS to convert a virtual address into a guest physical address, and refers to this GPT to convert the virtual address into a host physical address (actual A shadow page table (hereinafter referred to as SPT) to be converted into (physical address) is created, and this SPT is passed to the CPU.
  • GPT guest page table
  • SPT shadow page table
  • a paging function using SPT (hereinafter referred to as an SPT method) realizes memory address conversion corresponding to two-stage conversion of virtual address to guest physical address and guest physical address to host physical address. be able to.
  • this SPT method needs to maintain consistency with the GPT, and when the guest OS updates the GPT, the hypervisor needs to update the SPT. At this time, the memory performance is degraded.
  • the virtualization support function of AMD and Intel uses a memory address conversion table (NPT or EPT) that converts a guest physical address to a host physical address independently of GPT. (Hereinafter referred to as EPT method).
  • NPT memory address conversion table
  • EPT method converts a guest physical address to a host physical address independently of GPT.
  • the hypervisor does not need to perform table update processing even when the guest OS updates the GPT. Therefore, the problem of memory performance degradation in the SPT method is solved.
  • Patent Document 1 and Non-Patent Document 1 disclose EPT technology
  • Patent Document 2 discloses SPT technology
  • the EPT method is not universal, and the memory performance is degraded by the process of referring to the NPT or EPT at the time of memory address conversion.
  • the CPU is equipped with a high-speed, small-capacity TLB (Translation Lookaside Buffer) that stores part of the contents of the page table, NPT, and EPT.
  • TLB Translation Lookaside Buffer
  • This TLB reduces memory performance degradation.
  • the NPT or EPT is read repeatedly. At this time, the memory performance is degraded.
  • the present invention has been made in consideration of the above points, and proposes a computer and an address conversion method capable of suppressing a decrease in memory performance during address conversion.
  • the physical memory includes one or more virtual machines and a hypervisor that operates a guest OS on each virtual machine.
  • the physical CPU uses two tables to perform address conversion between the virtual memory allocated to the program running on the guest OS, the guest physical memory allocated to the virtual machine, and the physical memory using two tables.
  • the hypervisor has a support function, and the hypervisor corresponds to a program analysis unit that recognizes a program running on the guest OS, a characteristic table that holds characteristics of the program running on the guest OS, and a characteristic of the program that runs on the guest OS.
  • the physical memory operates one or more virtual machines and a guest OS on each virtual machine.
  • the physical CPU performs address conversion between the virtual memory allocated to the program running on the guest OS, the guest physical memory allocated to the virtual machine, and the physical memory using two tables.
  • FIG. 1 shows a hardware configuration of the physical computer 10 in the first embodiment.
  • the physical computer 10 includes one or more physical CPUs 70. These physical CPUs 70 are connected to the ChipSet 81 and the physical memory 90 via an interconnect 83 such as QPI (Quick Path Interconnect) or SMI (Scalable Memory Interconnect).
  • QPI Quadick Path Interconnect
  • SMI Scalable Memory Interconnect
  • the ChipSet 81 is connected to the IO device 80 via a bus 82 such as PCI express.
  • the IO device 80 includes a NIC (Network Interface Card) connected to the LAN 84, a storage device 85 and an HBA (Host Bus Adapter) connected to the SAN (Storage Area Network) 86, a graphic controller connected to the console 95, and the like. Configured.
  • the physical CPU 70 accesses the physical memory 90 via the interconnect 83. Further, the physical CPU 70 accesses the IO device 80 via the ChipSet 81 and performs predetermined processing. Similarly, the IO device 80 accesses the physical memory 90 via the ChipSet 81.
  • the physical memory 90 loads the hypervisor 20 and distributes a part of the physical memory 90 to the virtual machines 30.
  • the virtual machine 30 operates by loading the guest OS 40 and the guest process 60.
  • FIG. 2 shows a software configuration of the physical computer 10 in the first embodiment.
  • the hypervisor 20 that creates the virtual computer 30 operates.
  • a guest OS 40 operates as system software.
  • the guest OS 40 operates the guest process 60.
  • the guest process 60 is an execution unit of a program having an independent memory address on the guest OS 40.
  • the physical computer 10 includes a physical CPU 70 and a physical memory 90.
  • the virtual computer 30 includes a virtual CPU 32 and a guest physical memory 31 allocated by the hypervisor 20.
  • the guest process 60 operates using the virtual memory 61 allocated by the guest OS 40.
  • the guest OS 40 creates a guest page table (GPT) 41 that holds the correspondence between the virtual memory 61 and the guest physical memory 31, and stores the address of the GPT 41 in the virtual PT address register 33 that the virtual CPU 32 has.
  • the guest OS 40 generally creates a plurality of guest processes 60 and creates a GPT 41 for each guest process 60.
  • the guest OS 40 stores the address of the GPT 41 corresponding to the guest process 60 to be executed in the virtual PT address register 33 every time the guest process 60 to be executed using the virtual CPU 32 is switched.
  • the physical CPU 70 includes an EPT enable register 71, an EPT address register 72, a PT address register 73, a performance monitor function 74, an intercept condition register 75, and a TLB 76.
  • the EPT validation register 71 controls the validity or invalidity of the double paging virtualization support function (generic name of the virtualization support function using NPT or EPT).
  • the EPT address register 72 stores the position of the table (EPT 111) referred to by the double paging virtualization support function.
  • the PT address register 73 stores the position of the table (GPT41 or SPT121) referred to by the paging function.
  • the performance monitor function 74 simultaneously measures two types of events such as TLB misses that occur on the physical CPU 70.
  • the intercept condition register 75 holds the condition for generating an intercept that interrupts the execution of the guest OS 40 and the guest process 60 and calls the hypervisor 20.
  • the TLB 76 stores information indicating the correspondence between the address of the virtual memory 61 and the address of the physical memory 90.
  • the performance monitor function 74 measures the number of times the guest OS 40 has executed the TLB purge command and the number of TLB misses.
  • the TLB purge command is a command for notifying the virtual CPU 32 of the change after the guest OS 40 changes the GPT 41. By measuring the number of TLB purge instructions, the number of updates of the GPT 41 can be estimated.
  • the TLB miss means that information indicating the correspondence between the address of the virtual memory 61 and the address of the physical memory 90 is not stored in the TLB. By measuring the number of TLB misses, it is possible to estimate the number of times the physical CPU 70 has referred to the GPT 41, EPT 111, or SPT 121 (table reference number).
  • the performance monitor function 74 includes, for example, two registers for selecting an event type and two registers for holding the number of events.
  • the hypervisor 20 includes a program analysis unit 100, an EPT control unit 110, an SPT control unit 120, a method switching unit 130, and a virtual CPU scheduler 140.
  • the program analysis unit 100 analyzes the characteristics of each program while recognizing program switching, and determines whether the dual paging virtualization support function is valid or invalid.
  • the EPT control unit 110 controls the double paging virtualization support function.
  • the SPT control unit 120 controls the paging function.
  • the method switching unit 130 enables the double paging virtualization support function to use the EPT control unit 110, and disables the double paging virtualization support function to use the SPT control unit 120. Switch.
  • the virtual CPU scheduler 140 operates or stops the virtual CPU 32 using the physical CPU 70.
  • the program analysis unit 100 further includes a performance monitor control unit 101, a GPT switching recognition unit 109, a GPT-specific characteristic table 106, and a mode selection table 104.
  • the performance monitor control unit 101 controls the performance monitor function 74 included in the physical CPU 70.
  • the GPT switching recognition unit 109 recognizes that the value held in the virtual PT address register 33 has changed.
  • the GPT-specific characteristics table 106 holds program characteristics for each GPT 41 whose address is stored in the virtual PT address register 33.
  • the mode selection table 104 holds, for each virtual computer 30, a mode that measures the characteristics of the program or a mode that does not measure.
  • the GPT-specific characteristic table 106 is a kind of characteristic table that holds the characteristics of the program.
  • the characteristic measurement value table 102 that holds the characteristics measured for each GPT 41 and the characteristics given from the administrator or the guest process 60 are shown.
  • a characteristic fixed selection table 103 to be held.
  • the contents of the mode selection table 104 and the characteristic fixed selection table 103 are updated by the console 95.
  • the property fixed selection table 103 may be updated from the guest process 60.
  • the EPT 111 controlled by the EPT control unit 110 is created for each virtual machine 30 and holds the correspondence between the guest physical memory 31 and the physical memory 90.
  • the EPT enable register 71 is set to be effective, the physical CPU 70 stores two tables of the GPT 41 whose address is stored in the PT address register 73 and the EPT 111 whose address is stored in the EPT address register 72. With reference to the address, the address of the virtual memory 61 is converted into the address of the physical memory 90.
  • the SPT 121 controlled by the SPT control unit 120 is created for each guest process 60 and holds the correspondence between the virtual memory 61 and the physical memory 90.
  • the physical CPU 70 refers to the SPT 121 whose address is stored in the PT address register 73 and converts the address of the virtual memory 61 into the address of the physical memory 90 when the EPT enable register 71 is set to invalid.
  • the hypervisor 20 updates the corresponding part of the SPT 121.
  • the method switching unit 130 holds a physical CPU setting management table 131 such as VMCB or VMCS that controls a register of the physical CPU 70.
  • FIG. 3 shows a memory map of the physical memory 90 managed by the hypervisor 20.
  • the hypervisor 20 allocates an area where the hypervisor 20 is arranged on the physical memory 90 and an area used by the virtual machine 30.
  • the hypervisor 20 includes the program analysis unit 100, the EPT control unit 110, the SPT control unit 120, the method switching unit 130, and the virtual CPU scheduler 140 described above in the area allocated to itself.
  • the hypervisor 20 assigns addresses AD0 to AD1 to itself and arranges each module, dynamically assigns addresses AD2 to AD3 to the virtual machine 30, and assigns addresses AD4 to AD5 to another virtual machine 30. Assign dynamically.
  • the guest OS 40 allocates an area where the guest OS 40 is arranged on each virtual machine 30 and an area used by the guest process 60.
  • FIG. 4 shows a logical configuration of the characteristic measurement value table 102 that holds the characteristics measured for each GPT 41.
  • the characteristic measurement value table 102 stores a virtual machine number 401, a GPT address 402, a TLB purge count 404, a TLB miss count 405, and an application method 407.
  • the virtual machine number 401 is an identification number for identifying the virtual machine 30.
  • the GPT address 402 is an address of the GPT 41 stored in the virtual PT address register 33.
  • the TLB purge count 404 is the number of times the guest OS 40 has executed a TLB purge command during the most recent operation.
  • the TLB miss count 405 is the number of TLB misses made by the physical CPU 70 during the most recent operation.
  • the application method 407 is information indicating a method to which one of the SPT method and the EPT method is applied. Note that for the program in which the virtual machine number 401 and the GPT address 402 are not included in the characteristic measurement value table 102, the EPT method is adopted as the application method 407.
  • FIG. 5 shows a logical configuration of the characteristic fixed selection table 103 that holds characteristics given by the administrator or the guest process 60 itself.
  • an application method 407 is stored for each combination of the virtual machine number 401 and the GPT address 402. Note that for a program in which the virtual machine number 401 and the GPT address 402 are included in the characteristic fixed selection table 103, the application method 407 of the characteristic fixed selection table 103 is adopted regardless of the contents of the characteristic measurement value table 102.
  • FIG. 6 shows a logical configuration of the mode selection table 104 that holds, for each virtual machine 30, a mode that measures the characteristics of the program or a mode that does not measure.
  • the mode selection table 104 stores a runtime measurement option 502 that indicates whether or not the program characteristics are measured for the virtual machine number 401.
  • the characteristic measurement value table 102 is referred to or updated only for the virtual machine 30 whose execution time measurement option 502 is “Yes”.
  • An EPT method is adopted as an application method 407 for a program on the virtual machine 30 whose execution time measurement option 502 is “no” and whose characteristic fixed selection table 103 does not include the virtual machine number 401 and the GPT address 402. Is done.
  • FIG. 7 shows a logical configuration of the GPT 41 that associates the address of the virtual memory 61 with the address of the guest physical memory 31.
  • the GPT 41 stores a virtual address 701, a guest physical address 702, a page size 704, a global flag 705, and an access right 706.
  • the virtual address 701 is an address of the virtual memory 61.
  • the guest physical address 702 is an address of the guest physical memory 31.
  • the page size 704 is information indicating an address range.
  • the global flag 705 is information indicating that data common to all the GPTs 41 on the virtual machine 30 is held.
  • the access right 706 is information indicating whether reading / writing / execution is permitted with user authority or kernel authority.
  • Kernel authority is authority when the guest OS 40 operates, and is distinguished from user authority when the guest process 60 operates.
  • the global flag is usually set for a memory area for executing the guest OS 40.
  • FIG. 8 shows a logical configuration of the EPT 111 that associates the address of the guest physical memory 31 with the address of the physical memory 90.
  • the EPT 111 stores a guest physical address 702, a host physical address 703, a page size 704, and an access right 706.
  • the guest physical address 702 is an address of the guest physical memory 31.
  • the host physical address 703 is an address of the physical memory 90.
  • the page size 704 is information indicating an address range.
  • the access right 706 is information indicating whether reading / writing / execution is permitted.
  • the physical CPU 70 When the access prohibited by the access right 706 is detected, the physical CPU 70 generates an EPT exception.
  • the hypervisor 20 prohibits all read / write / execution with the access right 706 for all the guest physical addresses 702 not assigned to the virtual machine 30 and prevents illegal memory access by the guest OS 40 using the EPT exception. be able to.
  • FIG. 9 shows a logical configuration of the SPT 121 that associates the address of the virtual memory 61 with the address of the physical memory 90.
  • the SPT 121 has the same format as the GPT 41 and stores a host physical address 703, a page size 704, a global flag 705, and an access right 706 for each virtual address 701.
  • the physical CPU 70 When the access prohibited by the access right 706 is detected, the physical CPU 70 generates a page exception.
  • the hypervisor 20 finds a guest physical address 702 that is not assigned to the virtual machine 30 in the GPT 41, the hypervisor 20 prohibits all reading / writing / execution with the access right 706 corresponding to the corresponding virtual address 701, and generates a page exception. By using this, unauthorized memory access by the guest OS 40 can be prevented.
  • FIG. 10 shows a logical configuration of the physical CPU setting management table 131 that controls the registers of the physical CPU 70.
  • the physical CPU setting management table 131 stores a physical CPU number 901, an EPT validation flag 902, a PT address register operation intercept flag 903, a page exception intercept flag 904, a PT address 905, and an EPT address 906.
  • the physical CPU number 901 is an identification number for identifying the physical CPU 70.
  • the EPT validation flag 902 is a flag for controlling the EPT validation register 71.
  • the PT address register operation intercept flag 903 and the page exception intercept flag 904 are flags for controlling the intercept condition register 75.
  • the PT address 905 is an address for controlling the PT address register 73.
  • the EPT address 906 is an address for controlling the EPT address register 72.
  • the physical CPU 70 interrupts the execution of the guest OS 40 and calls the hypervisor 20 when the guest OS 40 attempts to change the value of the virtual PT address register 33.
  • the PT address register operation intercept flag 903 is “0”, even if the guest OS 40 updates the virtual PT address register 33, the hypervisor 20 is not called and the update is completed.
  • the physical CPU 70 calls the hypervisor 20 when a page exception occurs during execution of the guest OS 40 or the guest process 60.
  • the physical CPU 70 assigned to the virtual machine 30 that does not measure the program characteristics operates with the setting in which the physical CPU number 901 is stored in the entry “3”. Specifically, the EPT enable flag 902 is set to “1” and the double paging virtualization support function is used, and the PT address register operation intercept flag 903 and the page exception intercept flag 904 are cleared.
  • the physical CPU 70 assigned to the virtual machine 30 that measures the program characteristics has an entry with the physical CPU number 901 of “1” or “2” depending on which of the SPT method and the EPT method is applied. Operates with stored settings.
  • the EPT method When the EPT method is applied, it operates with the setting stored in the entry with the physical CPU number “2”, and intercepts the update of the virtual PT address register 33 while enabling the double paging virtualization support function. To recognize the switching of GPT41.
  • the SPT method When the SPT method is applied, it operates with the setting stored in the entry with the physical CPU number “1”, invalidates the double paging virtualization support function, intercepts the page exception, and is illegal by the guest OS 40 Prevent excessive memory access.
  • FIG. 11 shows a processing flow of overall processing including event processing that is the center of the operation of the hypervisor 20.
  • the hypervisor 20 executes a hypervisor initialization process to initialize itself (S1100).
  • the hypervisor 20 shifts the processing to a loop that waits for the occurrence of an event. In the loop, the hypervisor 20 determines whether an event has occurred (S1110).
  • step S1110 When the hypervisor 20 obtains a negative result in the determination at step S1110, the process proceeds to step S1130. On the other hand, when the hypervisor 20 obtains a positive result in the determination at step S1110, it executes event processing (S1120).
  • the hypervisor 20 determines whether or not there is an operating virtual machine 30 (S1130). If there is no operating virtual machine 30, the process returns to step S1110 to wait for the occurrence of an event, and there is an operating virtual machine 30. If so, the program on the virtual machine 30 is executed (S1140). Thereafter, the hypervisor 20 returns to the loop.
  • FIG. 12 shows a processing flow of the hypervisor initialization process executed in step S1100 of FIG.
  • the hypervisor 20 stores zero or an initial value stored in a file or the like in the characteristic fixed selection table 103, and initializes the characteristic fixed selection table 103 (S2100). Further, the hypervisor 20 stores zero or an initial value stored in a file or the like in the mode selection table 104, and initializes the mode selection table 104 (S2110).
  • the hypervisor 20 changes the setting of the performance monitor function 74. Specifically, the hypervisor 20 selects the number of TLB misses as the first event counted by the performance monitor function 74 (S2120), and selects the number of TLB purges as the second event (S2130). These processes are realized by using event selection means provided by the performance monitor function 74.
  • hypervisor 20 executes other initialization processing (S2140), and ends this hypervisor initialization processing.
  • FIG. 13 shows a process flow of the event process executed in step S1120 of FIG.
  • the hypervisor 20 determines whether or not the generated event is an instruction to start the virtual machine 30 (S1200). If the hypervisor 20 obtains an affirmative result in this determination, it executes a virtual machine activation process (S1205). Note that the activation instruction for the virtual machine 30 may be generated in response to an input from the console 95, or may be automatically generated after the hypervisor initialization process is completed.
  • the hypervisor 20 determines whether the generated event is an execution of a virtual PT address register change instruction by the guest OS 40 (S1210). If the hypervisor 20 obtains a positive result in this determination, it executes virtual PT address register change processing (S1215), and if it obtains a negative result, it proceeds to step S1220.
  • the hypervisor 20 determines whether the event that has occurred is a page exception (S1220). If the hypervisor 20 obtains a positive result in this determination, it executes page exception processing (S1225), and if it obtains a negative result, it proceeds to step S1230.
  • the hypervisor 20 When the hypervisor 20 obtains a negative result in the determination at step S1220, it determines whether the event that has occurred is an EPT exception (S1230). If the hypervisor 20 obtains a positive result in this determination, it executes EPT exception processing (S1235), and if it obtains a negative result, it proceeds to step S1240.
  • the hypervisor 20 When the hypervisor 20 obtains a negative result in the determination at step S1230, it determines whether the event that has occurred is an input of an update instruction from the console 95 (S1240). If the hypervisor obtains a positive result in this determination, it executes console input processing (S1245), and if it obtains a negative result, it proceeds to step S1250.
  • the hypervisor 20 When the hypervisor 20 obtains a negative result in the determination at step S1240, it determines whether the event that has occurred is an execution of a command for self-declaring characteristics to the hypervisor 20 from a program on the virtual machine 30 (S1250). . If the hypervisor 20 obtains a positive result in this determination, it executes self-report reception processing (S1255), and if it obtains a negative result, it proceeds to step S1260.
  • an arbitrary instruction for calling the hypervisor 20 such as a VMMCALL instruction of an AMD CPU or a VMMCALL instruction of an Intel CPU is used.
  • the hypervisor 20 When the hypervisor 20 obtains a negative result in the determination at step S1250, it determines whether or not the event that has occurred is a timer interrupt (S1260). If the hypervisor 20 obtains a positive result in this determination, it executes timer interrupt processing (S1265), and if it obtains a negative result, it executes other processing (S1270).
  • the hypervisor 20 executes a next process on the virtual machine 30 or executes a return process for resuming the process before the event detection (S1280), and ends this event process.
  • FIG. 14 shows a processing flow of the virtual machine activation process executed in step S1205 of FIG.
  • the hypervisor 20 stores zero in the characteristic measurement value table 102 to clear the characteristic measurement value table 102 (S1300), and activates the double paging virtualization support function as the setting of the physical CPU 70 allocated to the virtual machine 30.
  • the page exception intercept is invalidated (S1310).
  • step S1310 the program on the virtual machine 30 starts operating in a state where the EPT method is applied.
  • the hypervisor 20 refers to the mode selection table 104, confirms the runtime measurement option 502 of the virtual machine 30, and determines whether or not the virtual machine 30 is a virtual machine to be measured (S1320).
  • the hypervisor 20 invalidates the intercept when the PT address register 73 is changed (S1330), and if it is a measurement target, the hypervisor 20 enables the intercept when the PT address register is changed. (S1340), the virtual machine activation process is terminated.
  • the initial value set here is transmitted to the physical CPU 70 through the physical CPU setting management table 131.
  • FIG. 15 shows a process flow of the virtual PT address register change process executed in step S1215 of FIG.
  • the hypervisor 20 refers to the mode selection table 104, confirms the runtime measurement option 502 of the virtual machine 30, and determines whether the virtual machine 30 is a virtual machine to be measured (S1400).
  • the hypervisor 20 acquires the characteristic data of the TLB miss count and the TLB purge instruction execution count from the performance monitor function 74 only when the virtual computer 30 is a measurement target, and is registered in the virtual PT address register 33 before the change.
  • the acquired characteristic data is stored in the TLB purge number 404 and the TLB miss number 405 of the characteristic measurement value table 102 in association with the GPT 41, and the characteristic of the guest process 60 is updated (S1405).
  • the hypervisor 20 compares the value obtained by multiplying the TLB miss count 405 and the table reference unit price of the double paging virtualization support function with the value obtained by multiplying the TLB purge count 404 and the GPT update unit price.
  • the SPT method is stored as the application method 407, and if the latter is larger, the EPT method is stored as the application method 407.
  • the table reference unit price and the GPT update unit price of the dual paging virtualization support function are assumed to be held by the hypervisor 20 by a method such as measuring in advance. Further, the hypervisor 20 clears the number of TLB misses and the number of executions of the TLB purge instruction measured by the performance monitoring function 74 to the characteristics of the guest process 60 that operates using the GPT 41 registered in the virtual PT address register 33 after the change. Prepare for measurement (S1410).
  • the hypervisor 20 recognizes the change of the virtual PT address register 33 as program switching and determines a method to be applied. Therefore, the hypervisor 20 refers to the characteristic measurement value table 102 and determines the characteristic of the guest process 60 associated with the GPT 41 whose address is held by the virtual PT address register 33 after the change (S1420).
  • the hypervisor 20 determines whether or not the application method 407 is the SPT method (S1430).
  • the hypervisor 20 changes the setting of the physical CPU 70 for the SPT method in the following procedure.
  • the hypervisor 20 invalidates the double paging virtualization support function of the physical CPU 70 and enables page exception interception (S1435).
  • the hypervisor 20 searches for the SPT 121 corresponding to the GPT 41 registered in the virtual PT address register 33 after the change (S1440).
  • the hypervisor 20 finds the corresponding SPT 121 (S1445: Yes)
  • the hypervisor 20 registers the found SPT 121 in the PT address register 73 of the physical CPU 70 (S1455).
  • the hypervisor 20 refers to the GPT 41 and the EPT 111 and creates the SPT 121 that associates the virtual address 701 with the host physical address 703 (S1450). Stored in association with the address.
  • the hypervisor 20 has access rights to write to the host physical address 703 for all the EPTs 111 and SPTs 121 held by the hypervisor 20. It is prohibited at 706.
  • the hypervisor 20 registers the created address of the SPT 121 in the PT address register 73 of the physical CPU 70 (S1455), and ends this virtual PT address register change process.
  • the hypervisor 20 changes the setting of the physical CPU 70 for the EPT method in the following procedure.
  • the hypervisor 20 enables the double paging virtualization support function of the physical CPU 70 and disables the page exception intercept (S1470).
  • the hypervisor 20 registers the address of the EPT 111 for the virtual computer 30 in the EPT address register 72 of the physical CPU 70, and registers the address of the GPT 41 held in the virtual PT address register 33 after the change in the PT address register 73 of the physical CPU 70.
  • the virtual PT address register changing process is terminated.
  • FIG. 16 shows a processing flow of page exception processing executed in step S1225 of FIG.
  • the hypervisor 20 refers to the GPT 41 in which the virtual PT address register 33 holds the address, and determines whether the page exception detected by the physical CPU 70 is an access prohibited by the GPT 41 (S1500).
  • the hypervisor 20 transmits a page exception to the guest OS 40 (S1550), and ends this page exception processing. On the other hand, if the access is not prohibited by the GPT 41, the hypervisor 20 determines whether this page exception is an update of the GPT 41 (S1510).
  • the hypervisor 20 updates the SPT 121 in accordance with the updated GPT 41 (S1530).
  • the hypervisor emulates the operation when the unallocated memory is operated on the virtual machine 30. (S1540), this page exception processing is terminated.
  • the GPT 41 associated with each of all the SPTs 121 may be examined one by one, or another method may be used.
  • FIG. 17 shows a processing flow of EPT exception processing executed in step S1235 of FIG.
  • the hypervisor 20 determines whether or not the EPT exception (EPT Violation) is an update of the GPT 41 (S1510).
  • the hypervisor 20 updates the SPT 121 in accordance with the updated GPT 41 (S1530).
  • the EPT exception is not an update of the GPT 41, when an unallocated memory is operated on the virtual machine 30 Is emulated (S1540), and this EPT exception process is terminated.
  • FIG. 18 shows a process flow of the timer interrupt process executed in step S1265 of FIG.
  • the hypervisor 20 determines whether or not this timer interrupt is an interrupt that occurs because the time slice used when the physical CPU 70 is allocated to the virtual CPU 32 in a time-sharing manner (S1700).
  • the hypervisor 20 uses up the time slice, the hypervisor 20 selects the virtual CPU 32 to which the next time slice is assigned (S1710), and the program running on the physical CPU 70 is also switched. S1720), the timer interrupt process is terminated. On the other hand, when the time slice is not used up, the hypervisor 20 performs other processing (S1730) and ends the timer interrupt processing.
  • FIG. 19 shows a process flow of the virtual CPU switching process executed in step S1720 of FIG.
  • the hypervisor 20 refers to the mode selection table 104 and determines whether or not the current virtual CPU 32 before switching belongs to the virtual computer 30 to be measured (S1800).
  • the hypervisor 20 acquires the characteristic data of the TLB miss count and the TLB purge instruction execution count from the performance monitor function 74, and the virtual PT address register 33
  • the acquired characteristic data is stored in the TLB purge number 404 and the TLB miss number 405 of the characteristic measurement value table 102 in association with the GPT 41 registered in the table, and the characteristic of the guest process 60 is updated (S1805).
  • the hypervisor 20 compares the value obtained by multiplying the TLB miss count 405 and the table reference unit price of the double paging virtualization support function with the value obtained by multiplying the TLB purge count 404 and the GPT update unit price.
  • the SPT method is stored as the application method 407, and if the latter is larger, the EPT method is stored as the application method 407.
  • the hypervisor 20 refers to the mode selection table 104 and determines whether or not the virtual CPU 32 after switching belongs to the virtual machine 30 to be measured (S1810).
  • the hypervisor 20 clears the TLB miss count and the TLB purge command execution count measured by the performance monitor function 74 to the next measurement. And intercepting PT address register operation (S1815).
  • the hypervisor 20 does not need to monitor the change of the GPT 41, and therefore invalidates the intercept of the PT address register operation (S1820).
  • the hypervisor 20 refers to the characteristic measurement value table 102 and determines the characteristic of the guest process 60 associated with the GPT 41 in which the virtual PT address register 33 of the virtual CPU 32 after switching holds the address (S1830).
  • the hypervisor 20 changes the setting of the physical CPU 70 for the SPT method according to the following procedure.
  • the hypervisor 20 invalidates the double paging virtualization support function of the physical CPU 70 and validates the page exception intercept (S1435).
  • the hypervisor 20 searches the SPT 121 corresponding to the GPT 41 registered in the virtual PT address register 33 of the virtual CPU 32 after switching (S1860).
  • the hypervisor 20 executes the same processing as steps S1445, S1450, and S1455 of FIG. 15 and registers the SPT 121 in the PT address register 73 of the physical CPU 70.
  • the hypervisor 20 executes the same processing as steps S1470 and S1480 in FIG. 15 to change the setting of the physical CPU 70 to the EPT method.
  • FIG. 20 shows a processing flow of console input processing executed in step S1245 of FIG.
  • the hypervisor 20 determines whether the update instruction received from the console 95 is an instruction for the mode selection table 104 or an instruction for the fixed characteristic selection table 103 (S2200).
  • the hypervisor 20 When the hypervisor 20 is an instruction for the mode selection table 104, the hypervisor 20 updates the mode selection table 104 as instructed (S2220). On the other hand, when the instruction is for the characteristic fixed selection table 103, the hypervisor 20 updates the characteristic fixed selection table 103 as instructed (S2210). Although the mode selection table 104 and the characteristic fixed selection table 103 exist on the physical memory 90, the contents of the updated table may be stored in a file.
  • FIG. 21 shows a process flow of the self-report reception process executed in step S1255 of FIG.
  • the hypervisor 20 updates the characteristic fixed selection table 103 in accordance with the contents reported from the guest process 60 (S2210).
  • the characteristic fixed selection table 103 exists on the physical memory 90, but the updated table contents may be stored in a file.
  • FIG. 22 shows a process flow of the characteristic determination process executed in step S1420 in FIG. 15 and step S1830 in FIG.
  • the hypervisor 20 refers to the characteristic fixed selection table 103 and determines whether or not information related to the currently running guest process 60 is stored (S2300).
  • the hypervisor 20 determines that the application method 407 stored in the fixed characteristic selection table 103 is valid, and the SPT method or the EPT method stored as the applicable method 407. Any one of these methods is adopted (S2310).
  • the hypervisor 20 refers to the mode selection table 104 and determines whether or not the virtual computer 30 is a measurement target (S2320). When the virtual computer 30 is not a measurement target, the hypervisor 20 determines that the EPT method is appropriate and adopts the EPT method (S2350).
  • the hypervisor 20 refers to the characteristic measurement value table 102 and determines whether or not information related to the currently running guest process 60 is stored (S2330). If the information is not stored, the hypervisor 20 determines that the EPT method is appropriate and adopts the EPT method (S2350).
  • the hypervisor 20 determines that the application method 407 stored in the characteristic measurement value table 102 is appropriate, and uses the SPT method or the EPT method stored as the application method 407. Either method is adopted (S2340).
  • the guest process 60 operated by the guest OS 40 on the virtual computer 30 is distinguished by the GPT 41, Since the characteristics of the guest process 60 are determined by the number of TLB misses and the number of TLB purges, an SPT method for disabling the double paging virtualization support function is adopted for the guest process 60 having a large number of TLB misses.
  • Second Embodiment for each virtual CPU assigned to a virtual machine when a guest OS operates as system software on the virtual machine and operates a plurality of guest processes.
  • a configuration for determining the characteristics of a program and enabling or disabling the double paging virtualization support function according to the characteristics of the program obtained as a determination result will be described.
  • FIG. 23 shows a software configuration of the physical computer 10 in the second embodiment.
  • a guest OS 40 operates as system software.
  • the guest OS 40 operates one or more guest processes 60 for each virtual CPU 32. Therefore, the guest OS 40 holds a GPT 41 for each virtual CPU 32.
  • the program analysis unit 100 includes a virtual CPU-specific characteristic table 107 that stores program characteristics for each virtual CPU 32.
  • the characteristic table 107 for each virtual CPU is a kind of characteristic table for holding the characteristics of the program.
  • the characteristic measurement value table 112 for holding the characteristics measured for each virtual CPU 32 and the administrator or the guest process 60 itself are given.
  • a characteristic fixed selection table 113 that holds the characteristics.
  • FIG. 24 shows a logical configuration of the characteristic measurement value table 112 that holds the characteristics measured for each virtual CPU 32.
  • the characteristic measurement value table 112 stores a virtual computer number 401, a virtual CPU number 408 for identifying the virtual CPU 32, a TLB purge count 404, a TLB miss count 405, and an application method 407.
  • FIG. 25 shows a logical configuration of the characteristic fixed selection table 113 that holds the characteristics given by the administrator or the guest process 60 itself.
  • an application method 407 is stored for each combination of the virtual machine number 401 and the virtual CPU number 408.
  • the mode selection table 104, GPT41, EPT111, SPT121, and physical CPU setting management table 131 are the mode selection table 104 (FIG. 6), GPT41 (FIG. 7), and EPT111 in the first embodiment. (FIG. 8), SPT 121 (FIG. 9), and physical CPU setting management table 131 (FIG. 10) are the same, and the description thereof is omitted here.
  • FIG. 26 shows a processing flow of the virtual machine activation process executed in step S1205 of FIG.
  • the hypervisor 20 stores zero in the characteristic measurement value table 102 to clear the characteristic measurement value table 102 (S1300), and activates the double paging virtualization support function as the setting of the physical CPU 70 allocated to the virtual machine 30.
  • the page exception intercept is invalidated (S1310).
  • step S1310 the program on the virtual machine 30 starts operating in a state where the EPT method is applied.
  • the hypervisor 20 validates the intercept when the PT address register is changed (S1340), and ends this virtual machine activation process.
  • the initial value set here is transmitted to the physical CPU 70 through the physical CPU setting management table 131.
  • FIG. 27 shows a processing flow of the virtual PT address register changing process executed in step S1215 of FIG.
  • the hypervisor 20 searches for the SPT 121 corresponding to the GPT 41 registered in the virtual PT address register 33 after the change (S1440).
  • the hypervisor 20 When the hypervisor 20 finds the corresponding SPT 121 (S1445: YES), the hypervisor 20 registers the found SPT 121 in the PT address register 73 of the physical CPU 70 (S1455).
  • the hypervisor 20 refers to the GPT 41 and the EPT 111 and creates the SPT 121 that associates the virtual address 701 with the host physical address 703 (S1450). Stored in association with the address.
  • the hypervisor 20 detects the update of the host physical address 703 where the referenced GPT 41 is arranged, and writes the access right 706 to the host physical address 703 for all the EPTs 111 and SPTs 121 held by the hypervisor 20. Is prohibited.
  • the hypervisor 20 registers the created address of the SPT 121 in the PT address register 73 of the physical CPU 70 (S1455), and ends this virtual PT address register change process.
  • page exception processing, EPT exception processing, and timer interrupt processing are the same as those in the first embodiment (FIG. 16), EPT exception processing (FIG. 17), and timer interrupt processing (FIG. 18). ), The description here is omitted.
  • timer interrupt processing in the second embodiment, the guest process 60 running on the physical CPU 70 is switched only when the time slice is used up, and the hypervisor 20 recognizes this and recognizes the EPT method or The application of the SPT method is determined.
  • FIG. 28 shows a process flow of the virtual CPU switching process executed in step S1720 of FIG. Since the processes in steps S1800, S1805, and S1810 are the same as the processes in steps S1800, S1805, and S1810 of the virtual CPU switching process (FIG. 19) in the first embodiment, a description thereof is omitted here.
  • the hypervisor 20 clears the TLB miss count and the TLB purge command execution count measured by the performance monitor function 74 to zero only when the switched virtual CPU 32 belongs to the virtual machine 30 to be measured. (S1825).
  • the hypervisor 20 refers to the characteristic measurement value table 112 and determines the characteristic of the guest process 60 associated with the virtual CPU 32 after switching (S1830).
  • the hypervisor 20 changes the setting of the physical CPU 70 for the SPT method according to the following procedure. Specifically, the hypervisor 20 invalidates the double paging virtualization support function of the physical CPU 70, validates the page exception intercept, and validates the intercept for the operation of the virtual PT address register 33 (S1850).
  • the hypervisor 20 changes the setting of the physical CPU 70 for the EPT method according to the following procedure. Specifically, the hypervisor 20 enables the double paging virtualization support function of the physical CPU 70, invalidates the page exception intercept, and invalidates the intercept for the operation of the virtual PT address register 33 (S1855).
  • steps S1860, S1445, S1450, S1455, and S1480 are the same as the processes of steps S1860, S1445, S1450, S1455, and S1480 of the virtual CPU switching process (FIG. 19) in the first embodiment. Description is omitted.
  • console input process the self-report reception process and the characteristic determination process are the console input process (FIG. 20), the self-report reception process (FIG. 21) and the characteristic determination process in the first embodiment. Since it is the same as (FIG. 22), description here is abbreviate
  • a set of guest processes 60 operated by the guest OS 40 on the virtual computer 30 is represented by the virtual CPU 32. Since the distinction is made and the characteristics of the guest process 60 are determined by the number of TLB misses and the number of TLB purges, the SPT for disabling the double paging virtualization support function for programs on the virtual CPU 32 with a large number of TLB misses The system can be used to prevent the memory performance from degrading due to the table reference. On the other hand, the program on the virtual CPU 32 with a large number of TLB purges adopts the EPT system that enables the double paging virtualization support function. Accordingly, it is possible to prevent a decrease in memory performance due to the process of synchronizing the GPT 41 and the SP 121.
  • a guest OS operates as system software on a virtual machine, and a kernel program that operates with kernel authority is operated in addition to a plurality of guest processes.
  • a configuration for determining the characteristics of a program for each privilege level and enabling or disabling the double paging virtualization support function according to the characteristics of the program obtained as a determination result will be described.
  • FIG. 29 shows a software configuration of the physical computer 10 in the third embodiment.
  • a guest OS 40 operates as system software.
  • the guest OS 40 operates a kernel program 42 that operates with the same authority as the guest OS 40.
  • the kernel program 42 corresponds to a program closely associated with hardware such as control of the IO device 80, for example.
  • the memory used by the kernel program 42 stores address conversion information common to all the GPTs 41 as with the memory used by the guest OS 40.
  • the virtual CPU scheduler 140 includes a privilege level history 141 that stores the last observed privilege level for each virtual CPU 32.
  • the privilege level is a classification of user authority or kernel authority.
  • the program analysis unit 100 includes a privilege level-specific characteristic table 108 that holds the characteristics of a program for each privilege level of the virtual CPU 32.
  • the privilege level-specific characteristic table 108 is a kind of characteristic table that holds the characteristics of a program.
  • a characteristic measurement value table 122 that holds characteristics of a program that operates with kernel authority measured for each virtual machine 30, and an administrator Or it is comprised from the characteristic fixed selection table 123 holding the characteristic given from guest process 60 itself.
  • FIG. 30 shows a logical configuration of the characteristic measurement value table 122 that holds the characteristics of programs operating with kernel authority measured for each virtual machine 30.
  • the characteristic measurement value table 122 stores a virtual computer number 401, a TLB purge count 404, a TLB miss count 405, and an application method 407.
  • FIG. 31 shows a logical configuration of the property fixed selection table 133 that retains properties given by the administrator or the guest process 60 itself.
  • an application method 407 is stored for each virtual machine number 401.
  • the mode selection table 104, GPT41, EPT111, SPT121, and physical CPU setting management table 131 are the mode selection table 104 (FIG. 6), GPT41 (FIG. 7), and EPT111 in the first embodiment. (FIG. 8), SPT 121 (FIG. 9), and physical CPU setting management table 131 (FIG. 10) are the same, and the description thereof is omitted here.
  • the access right 706 of the virtual address 701 in which the global flag 705 of the GPT 41 is 0 is read / written / executed. Impossible is stored.
  • the PT address register operation intercept flag 903 is always 0 in the third embodiment.
  • FIG. 32 shows a processing flow of page exception processing executed in step S1225 of FIG.
  • the hypervisor 20 refers to the GPT 41 in which the virtual PT address register 33 holds the address, and determines whether the page exception detected by the physical CPU 70 is an access prohibited by the GP 41 (S1500).
  • the hypervisor 20 transmits a page exception to the guest OS 40 (S1550), and ends this page exception processing. On the other hand, if the access is not prohibited by the GPT 41, the hypervisor 20 determines whether this page exception is an update of the GPT 41 (S1510).
  • the hypervisor 20 When the hypervisor 20 is updating the GPT 41, the hypervisor 20 updates the SPT 121 in accordance with the updated GPT 41 (S1530), and ends this page exception processing. On the other hand, if the GPT 41 is not updated, the hypervisor 20 compares the contents of the current privilege level of the virtual CPU 32 and the privilege level history 141 to determine whether the kernel authority is changed to the user authority (S1560).
  • the hypervisor 20 ends the page exception process when a change is detected. On the other hand, when no change is detected, the hypervisor 20 emulates an operation when a memory unallocated to the virtual machine 30 is operated (S1540), and ends the page exception processing.
  • the EPT exception processing, timer interrupt processing, and virtual CPU switching processing are the same as the EPT exception processing (FIG. 17), timer interrupt processing (FIG. 18), and virtual CPU switching processing (FIG. 18) in the first embodiment. Since it is the same as FIG. 19), the description here is omitted.
  • step S1815 the TLB miss count and the TLB purge command execution count measured by the performance monitor function 74 are cleared to zero to prepare for the next measurement. This is different from the first embodiment.
  • console input process and the self-report receiving process are the same as the console input process (FIG. 20) and the self-report receiving process (FIG. 21) in the first embodiment. Description is omitted.
  • FIG. 33 shows a processing flow of the return processing executed in step S1280 of FIG.
  • the hypervisor 20 compares the current privilege level of the virtual CPU 32 with the contents of the privilege level history 141 (S1900).
  • the hypervisor 20 recognizes program switching only when the two do not match (S1910), and changes the setting of the physical CPU 70 in accordance with the change in privilege level (S1920). Thereafter, the hypervisor 20 records the current privilege level in the privilege level history 141 (S1930), and ends the return process.
  • FIG. 34 shows a processing flow of setting change processing of the physical CPU corresponding to the privilege level executed in step S1920 of FIG.
  • the hypervisor 20 refers to the mode selection table 104 to determine whether or not the virtual CPU 32 belongs to the measurement target virtual computer 30 (S2000), and only when it belongs to the measurement target virtual computer 30. Then, it is determined whether the current privilege level is kernel authority (S2005).
  • the hypervisor 20 acquires the characteristic data of the TLB miss count and the TLB purge instruction execution count when operating with the kernel authority from the performance monitor function 74. Then, the characteristic is stored in the TLB purge count 404 and the TLB miss count 405 of the characteristic measurement value table 102 in association with the virtual machine number 401 to update the program characteristics (S2010).
  • the hypervisor 20 compares the value obtained by multiplying the TLB miss count 405 and the table reference unit price of the double paging virtualization support function with the value obtained by multiplying the TLB purge count 404 and the GPT update unit price.
  • the SPT method is stored in the application method 407, and if the latter is larger, the EPT method is stored in the application method 407.
  • the hypervisor 20 clears the TLB miss count and the TLB purge command execution count measured by the performance monitor function 74 to the next measurement. Prepare (S2020).
  • the hypervisor 20 refers to the characteristic measurement value table 102 and determines the characteristic of the guest program associated with the current privilege level (S2030).
  • the hypervisor 20 changes the setting of the physical CPU 70 for the SPT method according to the following procedure. Specifically, the hypervisor 20 invalidates the double paging virtualization support function of the physical CPU 70 and validates the page exception intercept (S1435).
  • the hypervisor searches for the SPT 121 for the kernel program 42 (S2060). Since the process after step S1445 is the same as the process after step S1445 of FIG. 15, description here is abbreviate
  • the hypervisor 20 executes processing similar to steps S1470 and S1480 in FIG. 15 to change the setting of the physical CPU 70 for the EPT method.
  • FIG. 35 shows a process flow of the characteristic determination process executed in step S1830 of FIG.
  • the hypervisor 20 refers to the current privilege level and determines whether or not it is operating with kernel authority (S2360). If the hypervisor 20 is not operating with kernel authority, the hypervisor 20 determines that the EPT method is appropriate and adopts the EPT method (S2350). On the other hand, when the hypervisor 20 operates with the kernel authority, the hypervisor 20 executes a process similar to the characteristic determination process (FIG. 22) in the first embodiment.
  • the kernel program 42 that is operated by the guest OS 40 on the virtual computer 30 operates with user authority. Distinguishing from the guest process 60, the characteristic of the kernel program 42 is determined by the number of TLB misses and the number of TLB purges. Therefore, the dual paging virtualization support function is disabled for the kernel program 42 having a large number of TLB misses.
  • an EPT method for enabling the double paging virtualization support function is used. Adopted to prevent degradation of memory performance due to the process of synchronizing GPT41 and SP121 can do.
  • a guest OS having a function of creating an Lv2 virtual machine as system software on the virtual machine operates, and on the Lv2 virtual machine created by the guest OS,
  • program characteristics are determined for each guest process, and double paging is performed according to the program characteristics obtained as a result of the determination.
  • a configuration for enabling or disabling the virtualization support function will be described.
  • FIG. 36 shows the hardware configuration of the physical computer 10 in the fourth embodiment.
  • the physical memory 90 loads the hypervisor 20 and distributes a part of the physical memory 90 to the virtual machines 30.
  • the virtual machine 30 operates by loading the guest OS 40.
  • the guest OS 40 distributes a part of the physical memory 90 to the Lv2 virtual computer 45.
  • the Lv2 virtual computer 45 operates by loading the Lv2 guest OS 40 and the guest process 60.
  • FIG. 37 shows the software configuration of the physical computer 10 in the fourth embodiment.
  • the hypervisor 20 that creates the virtual computer 30 operates.
  • a guest OS 40 operates as system software.
  • the guest OS 40 creates an Lv2 virtual computer 35 and operates the Lv2 guest OS 50 on each Lv2 virtual computer 45.
  • the Lv2 guest OS 50 further operates the guest process 60.
  • the physical computer 10 includes a physical CPU 70 and a physical memory 90.
  • the virtual machine 30 includes a virtual CPU 32 and a guest physical memory 31 allocated by the hypervisor 20.
  • the Lv2 virtual computer 45 includes an Lv2 guest physical memory 46.
  • the guest process 60 operates using the virtual memory 61 allocated by the Lv2 guest OS 50.
  • the Lv2 guest OS 50 creates an Lv2 guest page table (Lv2GPT) 51 that stores the correspondence between the virtual memory 61 and the Lv2 guest physical memory 46.
  • the guest OS 40 creates a GPT 41 that associates the virtual memory 61 with the guest physical memory 31 with reference to the Lv2GPT 51, and stores the address of the GPT 41 in the virtual PT address register 33 in accordance with the operation of the guest process 60.
  • FIG. 38 shows a memory map of the physical memory 90 managed by the hypervisor 20.
  • the hypervisor 20 allocates an area where the hypervisor 20 is arranged on the physical memory 90 and an area used by the virtual machine 30.
  • the hypervisor 20 includes the program analysis unit 100, the EPT control unit 110, the SPT control unit 120, the method switching unit 130, and the virtual CPU scheduler 140 in the area allocated to itself.
  • the hypervisor 20 allocates addresses AD0 to AD1 fixedly and arranges each module, dynamically assigns addresses AD2 to AD3 to the virtual machine 30, and assigns addresses AD4 to AD5 to another virtual machine 30. Assign dynamically.
  • the guest OS 40 allocates an area where the guest OS 40 is arranged on each virtual machine 30 and an area used by the Lv2 guest OS 50 and the guest process 60.
  • the hypervisor 20 can determine the characteristics of the guest process 60 on the Lv2 guest OS 50 by recognizing the switching of the GPT 41 and controlling the performance monitor function 74 by the mechanism in the first embodiment. Similarly, if either the SPT method or the EPT method is selected in accordance with the switching of the GPT 41, each method can be applied according to the operation of the guest process 60.
  • the guest process operated by the Lv2 guest OS 50 operating on the guest OS 40 on the virtual computer 30 60 is differentiated by GPT41, and the characteristics of the guest process 60 are judged by the number of TLB misses and the number of TLB purges, so the double paging virtualization support function is disabled for the guest process 60 with many TLB misses
  • the SPT method it is possible to prevent the memory performance from being lowered due to the table reference.
  • the EPT method for enabling the double paging virtualization support function is used for the guest process 60 having a large number of TLB purges. Adopting it to prevent degradation of memory performance due to the process of synchronizing GPT41 and SP121 wear.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Debugging And Monitoring (AREA)

Abstract

[Problem] To provide a computer and an address conversion method capable of limiting deteriorations in memory performance. [Solution] A computer equipped with a physical memory and a physical CPU is characterized in that: the physical memory is provided with one or more virtual computers, and a hypervisor which operates a guest OS on each virtual computer; the physical CPU is provided with a duplexed paging virtualization support function which uses two tables to perform address conversion between a virtual memory allocated to a program operating on the guest OS, a guest physical memory allocated to the virtual computer, and the physical memory; and the hypervisor is provided with a program analysis unit which recognizes the program operating on the guest OS, a characteristic table which holds characteristics of the program operating on the guest OS, and a scheme switching unit which enables or disables the duplexed paging virtualization support function depending on the characteristics of the program operating on the guest OS.

Description

計算機及びアドレス変換方法Computer and address conversion method
 本発明は、計算機及びアドレス変換方法に関し、特に仮想計算機上のプログラムが使用する仮想メモリのアドレスを物理メモリのアドレスに変換する計算機及びアドレス変換方法に適用して好適なものである。 The present invention relates to a computer and an address conversion method, and is particularly suitable for application to a computer and an address conversion method for converting a virtual memory address used by a program on a virtual computer into a physical memory address.
 近年、x86CPUを搭載したオープン系サーバの性能向上及び機能拡充に伴い、サーバに搭載したCPUコアを有効に活用する方法として、サーバ仮想化の機能を担うハイパバイザが広く用いられている。ハイパバイザは、1台の物理サーバが搭載するCPU、メモリ及びIOデバイスといった資源を用いて複数の仮想計算機を作成し、それぞれの仮想計算機でOSやアプリケーションプログラムを稼働させるシステムソフトウェアである。 In recent years, with the improvement of performance and expansion of functions of open servers equipped with x86 CPUs, hypervisors responsible for server virtualization functions are widely used as methods for effectively utilizing CPU cores installed in servers. The hypervisor is system software that creates a plurality of virtual machines using resources such as a CPU, a memory, and an IO device mounted on one physical server, and runs an OS and an application program on each virtual machine.
 ハイパバイザを用いたサーバ仮想化技術は、CPUによる仮想化支援機能が強化されるにつれて安全性及びメモリ性能が向上しており、サーバに限らず制御装置等の組み込み用途でも複数機能の集約やマルチテナント収容の目的で用いられている。 Server virtualization technology using hypervisors has improved safety and memory performance as the virtualization support function by the CPU has been strengthened, and it is not limited to servers, but also for integration of multiple functions and multi-tenants for embedded applications such as control devices. Used for containment purposes.
 CPUによる仮想化支援機能としては、2005年頃に登場したAMD社のAMD-VやIntel社のVT-x(Virtualization Technology)が知られている。これらの仮想化支援機能においては、AMD-VのVMCB(Virtual Machine Control Block)やIntel社のVMCS(Virtual Machine Control Structure)といった管理データフォーマットが規定されている。 As the virtualization support function by the CPU, AMD-V of AMD and VT-x (Virtualization Technology) of Intel that appeared around 2005 are known. In these virtualization support functions, management data formats such as AMD-V VMCB (Virtual Machine Control Block) and Intel VMCS (Virtual Machine Control Structure) are defined.
 この管理データフォーマットでは、仮想計算機上で動作するOS(以下ゲストOSと呼ぶ)やゲストOS上で稼働するプログラムの命令をCPUが直接実行しつつ、ハイパバイザが指定した命令を実行したり、例外やタイマ割り込み等のイベントが起きたりする場合にはゲストOSやプログラムの実行を中断してハイパバイザを呼び出す「インタセプト」が提供される。 In this management data format, the CPU directly executes instructions of an OS running on the virtual machine (hereinafter referred to as a guest OS) or a program running on the guest OS, while executing instructions designated by the hypervisor, When an event such as a timer interrupt occurs, an “intercept” is provided that interrupts the execution of the guest OS or program and calls the hypervisor.
 ハイパバイザは、インタセプトを用いて、障害通知等のハイパバイザの介入が必要なイベントだけをハンドリング(エミュレーション)し、他の命令をCPUに直接実行させることによりハイパバイザの動作に起因するメモリ性能の低下を抑制するようにしている。 The hypervisor uses intercepts to handle (emulate) only events that require hypervisor intervention, such as fault notification, and directly control the CPU to execute other instructions, thereby suppressing memory performance degradation caused by hypervisor operations. Like to do.
 2007年頃には仮想化支援機能が更に強化され、AMD社のNPT(Nested Page Table)やIntel社のEPT(Extended Page Table)によりメモリ仮想化の性能が改善されている。メモリ仮想化では、各仮想計算機のメモリに0から始まる仮想的な物理アドレス(以下ゲスト物理アドレスと呼ぶ)を付与して、アドレス0から始まる全てのメモリを使える前提で設計されたゲストOSを仮想計算機上で稼働させている。 Around 2007, the virtualization support function was further strengthened, and memory virtualization performance was improved by AMD's NPT (Nested Page Table) and Intel's EPT (Extended Page Table). In memory virtualization, a virtual physical address starting from 0 (hereinafter referred to as a guest physical address) is assigned to the memory of each virtual machine, and a guest OS designed on the assumption that all the memory starting from address 0 can be used is virtualized. It is running on a computer.
 ところでNPTやEPTが登場する以前のCPUにより提供されるメモリアドレス変換機能としては、専らページテーブルを参照して仮想アドレスを物理アドレスに変換するページング機能がある。 By the way, as a memory address conversion function provided by a CPU before NPT and EPT appear, there is a paging function that converts a virtual address into a physical address exclusively by referring to a page table.
 このページング機能においてハイパバイザは、ゲストOSが仮想アドレスをゲスト物理アドレスに変換するためのゲストページテーブル(以下GPTと呼ぶ)を作成し、このGPTを参照して、仮想アドレスをホスト物理アドレス(実際の物理アドレス)に変換するシャドウページテーブル(以下SPTと呼ぶ)を作成し、このSPTをCPUに渡す。 In this paging function, the hypervisor creates a guest page table (hereinafter referred to as GPT) for the guest OS to convert a virtual address into a guest physical address, and refers to this GPT to convert the virtual address into a host physical address (actual A shadow page table (hereinafter referred to as SPT) to be converted into (physical address) is created, and this SPT is passed to the CPU.
 SPTを用いたページング機能(以下SPT方式と呼ぶ)により、仮想アドレスからゲスト物理アドレスへの変換と、ゲスト物理アドレスからホスト物理アドレスへの変換という2段階の変換に相当するメモリアドレス変換を実現することができる。しかしこのSPT方式は、GPTとの一貫性を維持する必要があり、ゲストOSがGPTを更新した場合、ハイパバイザはSPTを更新する必要がある。このときメモリ性能の低下が生じる。 A paging function using SPT (hereinafter referred to as an SPT method) realizes memory address conversion corresponding to two-stage conversion of virtual address to guest physical address and guest physical address to host physical address. be able to. However, this SPT method needs to maintain consistency with the GPT, and when the guest OS updates the GPT, the hypervisor needs to update the SPT. At this time, the memory performance is degraded.
 SPT方式におけるメモリ性能の低下は、ゲストOS上でプログラムの生成及び終了又はメモリのスワップアウト等の状態変化が起きる場合に顕著となる。この問題を解決するために、AMD社及びIntel社の仮想化支援機能においては、GPTとは独立してゲスト物理アドレスをホスト物理アドレスに変換するメモリアドレス変換テーブル(NPT又はEPT)を用いることとしている(以下EPT方式と呼ぶ)。 The decrease in memory performance in the SPT method becomes remarkable when a change in state such as program generation and termination or memory swap-out occurs on the guest OS. In order to solve this problem, the virtualization support function of AMD and Intel uses a memory address conversion table (NPT or EPT) that converts a guest physical address to a host physical address independently of GPT. (Hereinafter referred to as EPT method).
 EPT方式は、GPTとの一貫性を維持する必要がないため、ゲストOSがGPTを更新した場合であってもハイパバイザはテーブルの更新処理を行う必要がない。よってSPT方式におけるメモリ性能の低下の問題は解消される。 Since the EPT method does not need to maintain consistency with the GPT, the hypervisor does not need to perform table update processing even when the guest OS updates the GPT. Therefore, the problem of memory performance degradation in the SPT method is solved.
 特許文献1及び非特許文献1には、EPT方式の技術が開示されており、また特許文献2には、SPT方式の技術が開示されている。 Patent Document 1 and Non-Patent Document 1 disclose EPT technology, and Patent Document 2 discloses SPT technology.
米国特許第7886126号明細書US Patent No. 7886126 米国特許第7734893号明細書US Pat. No. 7,734,893
 しかしEPT方式も万能ではなく、メモリアドレス変換の際にNPT又はEPTを参照する処理によりメモリ性能の低下が生じる。ここでCPUには、ページテーブルやNPT及びEPTの内容の一部を格納する高速かつ小容量のTLB(Translation Lookaside Buffer)が搭載されており、このTLBによりメモリ性能の低下を軽減するようにしているが、TLBの容量に収まらない広範なメモリを操作するプログラムに対しては、NPT又はEPTを何度も繰り返し読むことになる。このときメモリ性能の低下が生じる。 However, the EPT method is not universal, and the memory performance is degraded by the process of referring to the NPT or EPT at the time of memory address conversion. The CPU is equipped with a high-speed, small-capacity TLB (Translation Lookaside Buffer) that stores part of the contents of the page table, NPT, and EPT. This TLB reduces memory performance degradation. However, for a program that operates a wide range of memories that do not fit in the TLB capacity, the NPT or EPT is read repeatedly. At this time, the memory performance is degraded.
 すなわち2つのテーブルを1つに纏めたSPTを用いてアドレス変換を行うSPT方式を採用すると、GPTの更新時にSPTも更新する必要があるためメモリ性能の低下が生じる場合がある。一方でGPTとは独立したアドレス変換テーブルであるNPT又はEPTを用いてアドレス変換を行うEPT方式を採用すると、TLBの容量を超えるメモリを操作するプログラムに対してはメモリ性能の低下が生じる場合がある。 That is, when the SPT method is used in which address conversion is performed using an SPT in which two tables are combined into one, it is necessary to update the SPT when the GPT is updated. On the other hand, if the EPT method that performs address conversion using NPT or EPT which is an address conversion table independent of GPT is adopted, memory performance may be deteriorated for a program that operates a memory exceeding the capacity of the TLB. is there.
 本発明は以上の点を考慮してなされたもので、アドレス変換に際してメモリ性能の低下を抑制し得る計算機及びアドレス変換方法を提案するものである。 The present invention has been made in consideration of the above points, and proposes a computer and an address conversion method capable of suppressing a decrease in memory performance during address conversion.
 かかる課題を解決するために、本発明においては、物理メモリ及び物理CPUを搭載する計算機において、物理メモリは、1つ以上の仮想計算機と、各仮想計算機上のゲストOSを稼働させるハイパバイザとを備え、物理CPUは、ゲストOS上で稼働するプログラムに割り当てられる仮想メモリと、仮想計算機に割り当てられるゲスト物理メモリと、物理メモリとの間におけるアドレス変換を2つのテーブルを用いて行う二重ページング仮想化支援機能を備え、ハイパバイザは、ゲストOS上で稼働するプログラムを認識するプログラム分析部と、ゲストOS上で稼働するプログラムの特性を保持する特性表と、ゲストOS上で稼働するプログラムの特性に応じて、二重ページング仮想化支援機能を有効化又は無効化する方式切替部とを備えることを特徴とする。 In order to solve such a problem, in the present invention, in a computer equipped with a physical memory and a physical CPU, the physical memory includes one or more virtual machines and a hypervisor that operates a guest OS on each virtual machine. The physical CPU uses two tables to perform address conversion between the virtual memory allocated to the program running on the guest OS, the guest physical memory allocated to the virtual machine, and the physical memory using two tables. The hypervisor has a support function, and the hypervisor corresponds to a program analysis unit that recognizes a program running on the guest OS, a characteristic table that holds characteristics of the program running on the guest OS, and a characteristic of the program that runs on the guest OS. A method switching unit for enabling or disabling the double paging virtualization support function. Characterized in that it obtain.
 またかかる課題を解決するために、本発明においては、物理メモリ及び物理CPUを搭載する計算機のアドレス変換方法において、物理メモリは、1つ以上の仮想計算機と、各仮想計算機上のゲストOSを稼働させるハイパバイザとを備え、物理CPUは、ゲストOS上で稼働するプログラムに割り当てられる仮想メモリと、仮想計算機に割り当てられるゲスト物理メモリと、物理メモリとの間におけるアドレス変換を2つのテーブルを用いて行う二重ページング仮想化支援機能を備え、ハイパバイザが、ゲストOS上で稼働するプログラムを認識する第1のステップと、ゲストOS上で稼働するプログラムの特性を保持する第2のステップと、ゲストOS上で稼働するプログラムの特性に応じて、二重ページング仮想化支援機能を有効化又は無効化する第3のステップとを備えることを特徴とする。 In order to solve such a problem, in the present invention, in the address conversion method for a computer equipped with a physical memory and a physical CPU, the physical memory operates one or more virtual machines and a guest OS on each virtual machine. The physical CPU performs address conversion between the virtual memory allocated to the program running on the guest OS, the guest physical memory allocated to the virtual machine, and the physical memory using two tables. A first step having a dual paging virtualization support function, in which the hypervisor recognizes a program running on the guest OS, a second step holding characteristics of the program running on the guest OS, and on the guest OS Enables the paging virtualization support function according to the characteristics of the program running on Characterized in that it comprises a third step of disabled.
 本発明によれば、アドレス変換に際してメモリ性能の低下を抑制することができる。 According to the present invention, it is possible to suppress a decrease in memory performance during address conversion.
第1の実施の形態における物理計算機のハードウェア構成図である。It is a hardware block diagram of the physical computer in 1st Embodiment. 第1の実施の形態における物理計算機のソフトウェア構成図である。It is a software block diagram of the physical computer in 1st Embodiment. メモリマップの概念図である。It is a conceptual diagram of a memory map. 特性計測値表の論理構成図である。It is a logic block diagram of a characteristic measurement value table. 特性固定選択表の論理構成図である。It is a logic block diagram of a characteristic fixed selection table. モード選択表の論理構成図である。It is a logic block diagram of a mode selection table. ゲストページテーブルの論理構成図である。It is a logical block diagram of a guest page table. 拡張ページテーブルの論理構成図である。It is a logical block diagram of an extended page table. シャドウページテーブルの論理構成図である。It is a logical block diagram of a shadow page table. 物理CPU設定管理表の論理構成図である。It is a logical block diagram of a physical CPU setting management table. ハイパバイザによる全体処理を示す処理フロー図である。It is a processing flowchart which shows the whole process by a hypervisor. ハイパバイザによる初期化処理を示す処理フロー図である。It is a processing flowchart which shows the initialization process by a hypervisor. ハイパバイザによるイベント処理を示す処理フロー図である。It is a processing flow figure showing event processing by a hypervisor. 仮想計算機起動処理を示す処理フロー図である。It is a processing flowchart which shows a virtual machine starting process. 仮想PTアドレスレジスタ変更処理を示す処理フロー図である。It is a processing flowchart which shows a virtual PT address register change process. ページ例外処理を示す処理フロー図である。It is a processing flow figure showing page exception processing. EPT例外処理を示す処理フロー図である。It is a processing flowchart which shows EPT exception processing. タイマ割り込み処理を示す処理フロー図である。It is a processing flowchart which shows a timer interruption process. 仮想CPU切り替え処理を示す処理フロー図である。It is a processing flowchart which shows a virtual CPU switching process. コンソール入力処理を示す処理フロー図である。It is a processing flowchart which shows a console input process. 自己申告受信処理を示す処理フロー図である。It is a processing flow figure showing self-report reception processing. 特性判断処理を示す処理フロー図である。It is a processing flowchart which shows a characteristic judgment process. 第2の実施の形態における物理計算機のソフトウェア構成図である。It is a software block diagram of the physical computer in 2nd Embodiment. 第2の実施の形態における特性計測値表の論理構成図である。It is a logic block diagram of the characteristic measurement value table | surface in 2nd Embodiment. 第2の実施の形態における特性固定選択表の論理構成図である。It is a logic block diagram of the characteristic fixed selection table in 2nd Embodiment. 第2の実施の形態における仮想計算機起動処理の処理フロー図である。It is a processing flow figure of virtual machine starting processing in a 2nd embodiment. 第2の実施の形態における仮想PTアドレスレジスタ変更処理の処理フロー図である。It is a processing flowchart of the virtual PT address register change processing in the second embodiment. 第2の実施の形態における仮想CPU切り替えの処理の処理フロー図である。It is a processing flow figure of processing of virtual CPU change in a 2nd embodiment. 第3の実施の形態における物理計算機のソフトウェア構成図である。It is a software block diagram of the physical computer in 3rd Embodiment. 第3の実施の形態における特性計測値表の論理構成図である。It is a logic block diagram of the characteristic measurement value table | surface in 3rd Embodiment. 第3の実施の形態における特性固定選択表の論理構成図である。It is a logic block diagram of the characteristic fixed selection table in 3rd Embodiment. 第3の実施の形態におけるページ例外処理の処理フロー図である。It is a processing flow figure of page exception processing in a 3rd embodiment. 第3の実施の形態における復帰処理の処理フロー図である。It is a processing flow figure of return processing in a 3rd embodiment. 第3の実施の形態における物理CPU設定変更処理の処理フロー図である。It is a processing flow figure of physical CPU setting change processing in a 3rd embodiment. 第3の実施の形態における特性判断処理の処理フロー図である。It is a processing flow figure of the characteristic judgment processing in a 3rd embodiment. 第4の実施の形態における物理計算機のハードウェア構成図である。It is a hardware block diagram of the physical computer in 4th Embodiment. 第4の実施の形態における物理計算機のソフトウェア構成図である。It is a software block diagram of the physical computer in 4th Embodiment. 第4の実施の形態におけるメモリマップの概念図である。It is a conceptual diagram of the memory map in 4th Embodiment.
 以下図面について、本発明の一実施の形態を詳述する。 Hereinafter, an embodiment of the present invention will be described in detail with reference to the drawings.
(1)第1の実施の形態
 第1の実施の形態においては、仮想計算機上のシステムソフトウェアとしてゲストOSが動作し、複数のゲストプロセスを稼働させる場合にゲストプロセス毎にプログラムの特性を判断し、判断結果として得られたプログラムの特性に応じて、二重ページング仮想化支援機能を有効化又は無効化する構成について説明する。
(1-1)ハードウェア構成
 図1は、第1の実施の形態における物理計算機10のハードウェア構成を示す。物理計算機10は、物理CPU70を1つ以上備える。これらの物理CPU70は、QPI(Quick Path Interconnect)やSMI(Scalable Memory Interconnect)等のインターコネクト83を介して、ChipSet81及び物理メモリ90に接続される。
(1) First Embodiment In the first embodiment, when a guest OS operates as system software on a virtual machine and a plurality of guest processes are operated, the characteristics of the program are determined for each guest process. A configuration for enabling or disabling the double paging virtualization support function according to the characteristics of the program obtained as a determination result will be described.
(1-1) Hardware Configuration FIG. 1 shows a hardware configuration of the physical computer 10 in the first embodiment. The physical computer 10 includes one or more physical CPUs 70. These physical CPUs 70 are connected to the ChipSet 81 and the physical memory 90 via an interconnect 83 such as QPI (Quick Path Interconnect) or SMI (Scalable Memory Interconnect).
 ChipSet81は、PCIexpress等のバス82を介してIOデバイス80に接続される。IOデバイス80は、LAN84に接続されるNIC(Network Interface Card)、ストレージ装置85及びSAN(Storage Area Network)86に接続されるHBA(Host Bus Adapter)、コンソール95に接続されるグラフィックコントローラ等を備えて構成される。 The ChipSet 81 is connected to the IO device 80 via a bus 82 such as PCI express. The IO device 80 includes a NIC (Network Interface Card) connected to the LAN 84, a storage device 85 and an HBA (Host Bus Adapter) connected to the SAN (Storage Area Network) 86, a graphic controller connected to the console 95, and the like. Configured.
 物理CPU70は、インターコネクト83を介して物理メモリ90にアクセスする。また物理CPU70は、ChipSet81を介してIOデバイス80にアクセスして所定の処理を行う。同様にIOデバイス80は、ChipSet81を介して物理メモリ90にアクセスする。 The physical CPU 70 accesses the physical memory 90 via the interconnect 83. Further, the physical CPU 70 accesses the IO device 80 via the ChipSet 81 and performs predetermined processing. Similarly, the IO device 80 accesses the physical memory 90 via the ChipSet 81.
 物理メモリ90は、ハイパバイザ20をロードして、物理メモリ90の一部を仮想計算機30に分配する。仮想計算機30は、ゲストOS40及びゲストプロセス60をロードして動作する。 The physical memory 90 loads the hypervisor 20 and distributes a part of the physical memory 90 to the virtual machines 30. The virtual machine 30 operates by loading the guest OS 40 and the guest process 60.
(1-2)ソフトウェア構成
 図2は、第1の実施の形態における物理計算機10のソフトウェア構成を示す。物理計算機10上では、仮想計算機30を作成するハイパバイザ20が稼動する。仮想計算機30上では、システムソフトウェアとしてゲストOS40が稼動する。ゲストOS40は、ゲストプロセス60を稼動させる。ゲストプロセス60は、ゲストOS40上で独立したメモリアドレスを有するプログラムの実行単位である。
(1-2) Software Configuration FIG. 2 shows a software configuration of the physical computer 10 in the first embodiment. On the physical computer 10, the hypervisor 20 that creates the virtual computer 30 operates. On the virtual machine 30, a guest OS 40 operates as system software. The guest OS 40 operates the guest process 60. The guest process 60 is an execution unit of a program having an independent memory address on the guest OS 40.
 物理計算機10は、物理CPU70及び物理メモリ90を搭載する。仮想計算機30は、ハイパバイザ20によって割り当てられた仮想CPU32及びゲスト物理メモリ31を搭載する。またゲストプロセス60は、ゲストOS40によって割り当てられた仮想メモリ61を使用して動作する。 The physical computer 10 includes a physical CPU 70 and a physical memory 90. The virtual computer 30 includes a virtual CPU 32 and a guest physical memory 31 allocated by the hypervisor 20. The guest process 60 operates using the virtual memory 61 allocated by the guest OS 40.
 ゲストOS40は、仮想メモリ61とゲスト物理メモリ31との対応関係を保持するゲストページテーブル(GPT)41を作成して、仮想CPU32が有する仮想PTアドレスレジスタ33にGPT41のアドレスを格納する。ゲストOS40は一般に複数のゲストプロセス60を作成し、ゲストプロセス60毎にGPT41を作成する。 The guest OS 40 creates a guest page table (GPT) 41 that holds the correspondence between the virtual memory 61 and the guest physical memory 31, and stores the address of the GPT 41 in the virtual PT address register 33 that the virtual CPU 32 has. The guest OS 40 generally creates a plurality of guest processes 60 and creates a GPT 41 for each guest process 60.
 またゲストOS40は、仮想CPU32を用いて実行するゲストプロセス60を切り替える毎に、実行するゲストプロセス60に対応するGPT41のアドレスを仮想PTアドレスレジスタ33に格納し直す。 The guest OS 40 stores the address of the GPT 41 corresponding to the guest process 60 to be executed in the virtual PT address register 33 every time the guest process 60 to be executed using the virtual CPU 32 is switched.
 物理CPU70は、EPT有効化レジスタ71、EPTアドレスレジスタ72、PTアドレスレジスタ73、性能モニタ機能74、インタセプト条件レジスタ75及びTLB76を備える。 The physical CPU 70 includes an EPT enable register 71, an EPT address register 72, a PT address register 73, a performance monitor function 74, an intercept condition register 75, and a TLB 76.
 EPT有効化レジスタ71は、二重ページング仮想化支援機能(NPT又はEPTを用いた仮想化支援機能の総称)の有効又は無効を制御する。EPTアドレスレジスタ72は、二重ページング仮想化支援機能で参照するテーブル(EPT111)の位置を格納する。PTアドレスレジスタ73は、ページング機能で参照するテーブル(GPT41又はSPT121)の位置を格納する。 The EPT validation register 71 controls the validity or invalidity of the double paging virtualization support function (generic name of the virtualization support function using NPT or EPT). The EPT address register 72 stores the position of the table (EPT 111) referred to by the double paging virtualization support function. The PT address register 73 stores the position of the table (GPT41 or SPT121) referred to by the paging function.
 また性能モニタ機能74は、物理CPU70上で発生するTLBミス等のイベントの回数を2種類同時に計測する。インタセプト条件レジスタ75は、ゲストOS40及びゲストプロセス60の実行を中断してハイパバイザ20を呼び出すインタセプトの発生条件を保持する。TLB76は、仮想メモリ61のアドレスと物理メモリ90のアドレスとの対応関係を示す情報を格納する。 Also, the performance monitor function 74 simultaneously measures two types of events such as TLB misses that occur on the physical CPU 70. The intercept condition register 75 holds the condition for generating an intercept that interrupts the execution of the guest OS 40 and the guest process 60 and calls the hypervisor 20. The TLB 76 stores information indicating the correspondence between the address of the virtual memory 61 and the address of the physical memory 90.
 ここで性能モニタ機能74は、ゲストOS40がTLBパージ命令を実行した回数及びTLBミス回数を計測する。TLBパージ命令とは、ゲストOS40がGPT41を変更した後に、変更した旨を仮想CPU32に知らせる命令である。TLBパージ命令の回数を計測することにより、GPT41の更新回数を推定することができる。 Here, the performance monitor function 74 measures the number of times the guest OS 40 has executed the TLB purge command and the number of TLB misses. The TLB purge command is a command for notifying the virtual CPU 32 of the change after the guest OS 40 changes the GPT 41. By measuring the number of TLB purge instructions, the number of updates of the GPT 41 can be estimated.
 またTLBミスとは、仮想メモリ61のアドレスと物理メモリ90のアドレスとの対応関係を示す情報がTLBに格納されていないことを意味する。TLBミス回数を計測することにより、物理CPU70がGPT41、EPT111又はSPT121を参照した回数(テーブル参照回数)を推定することができる。なお性能モニタ機能74は、例えばイベント種を選択するレジスタ2つと、イベント数を保持するレジスタ2つとを備える。 The TLB miss means that information indicating the correspondence between the address of the virtual memory 61 and the address of the physical memory 90 is not stored in the TLB. By measuring the number of TLB misses, it is possible to estimate the number of times the physical CPU 70 has referred to the GPT 41, EPT 111, or SPT 121 (table reference number). The performance monitor function 74 includes, for example, two registers for selecting an event type and two registers for holding the number of events.
 ハイパバイザ20は、プログラム分析部100、EPT制御部110、SPT制御部120、方式切替部130及び仮想CPUスケジューラ140を備える。 The hypervisor 20 includes a program analysis unit 100, an EPT control unit 110, an SPT control unit 120, a method switching unit 130, and a virtual CPU scheduler 140.
 プログラム分析部100は、プログラムの切り替えを認識しつつプログラム毎の特性を分析して二重ページング仮想化支援機能の有効又は無効の何れかが適切であるかを判断する。EPT制御部110は、二重ページング仮想化支援機能を制御する。SPT制御部120は、ページング機能を制御する。 The program analysis unit 100 analyzes the characteristics of each program while recognizing program switching, and determines whether the dual paging virtualization support function is valid or invalid. The EPT control unit 110 controls the double paging virtualization support function. The SPT control unit 120 controls the paging function.
 また方式切替部130は、二重ページング仮想化支援機能を有効化してEPT制御部110を使用するEPT方式と、二重ページング仮想化支援機能を無効化してSPT制御部120を使用するSPT方式とを切り替える。仮想CPUスケジューラ140は、物理CPU70を用いて仮想CPU32を動作又は停止させる。 In addition, the method switching unit 130 enables the double paging virtualization support function to use the EPT control unit 110, and disables the double paging virtualization support function to use the SPT control unit 120. Switch. The virtual CPU scheduler 140 operates or stops the virtual CPU 32 using the physical CPU 70.
 プログラム分析部100は更に、性能モニタ制御部101、GPT切替認識部109、GPT別特性表106及びモード選択表104を備える。 The program analysis unit 100 further includes a performance monitor control unit 101, a GPT switching recognition unit 109, a GPT-specific characteristic table 106, and a mode selection table 104.
 性能モニタ制御部101は、物理CPU70に含まれる性能モニタ機能74を制御する。GPT切替認識部109は、仮想PTアドレスレジスタ33の保持値が変わったことを認識する。GPT別特性表106は、仮想PTアドレスレジスタ33にアドレスが格納されたGPT41毎にプログラムの特性を保持する。モード選択表104は、プログラムの特性を計測するモード又は計測しないモードの区分を仮想計算機30毎に保持する。 The performance monitor control unit 101 controls the performance monitor function 74 included in the physical CPU 70. The GPT switching recognition unit 109 recognizes that the value held in the virtual PT address register 33 has changed. The GPT-specific characteristics table 106 holds program characteristics for each GPT 41 whose address is stored in the virtual PT address register 33. The mode selection table 104 holds, for each virtual computer 30, a mode that measures the characteristics of the program or a mode that does not measure.
 GPT別特性表106は、プログラムの特性を保持する特性表の一種であり、ここではGPT41毎に測定した特性を保持する特性計測値表102と、管理者又はゲストプロセス60から与えられた特性を保持する特性固定選択表103とから構成される。モード選択表104及び特性固定選択表103の内容はコンソール95により更新される。なお特性固定選択表103は、ゲストプロセス60から更新されるとしてもよい。 The GPT-specific characteristic table 106 is a kind of characteristic table that holds the characteristics of the program. Here, the characteristic measurement value table 102 that holds the characteristics measured for each GPT 41 and the characteristics given from the administrator or the guest process 60 are shown. And a characteristic fixed selection table 103 to be held. The contents of the mode selection table 104 and the characteristic fixed selection table 103 are updated by the console 95. Note that the property fixed selection table 103 may be updated from the guest process 60.
 EPT制御部110が制御するEPT111は、仮想計算機30毎に作成され、ゲスト物理メモリ31と物理メモリ90との対応関係を保持する。物理CPU70は、EPT有効化レジスタ71が有効に設定されている場合に、PTアドレスレジスタ73にアドレスが格納されたGPT41と、EPTアドレスレジスタ72にアドレスが格納されているEPT111との2つのテーブルを参照して、仮想メモリ61のアドレスを物理メモリ90のアドレスに変換する。 The EPT 111 controlled by the EPT control unit 110 is created for each virtual machine 30 and holds the correspondence between the guest physical memory 31 and the physical memory 90. When the EPT enable register 71 is set to be effective, the physical CPU 70 stores two tables of the GPT 41 whose address is stored in the PT address register 73 and the EPT 111 whose address is stored in the EPT address register 72. With reference to the address, the address of the virtual memory 61 is converted into the address of the physical memory 90.
 SPT制御部120が制御するSPT121は、ゲストプロセス60毎に作成され、仮想メモリ61と物理メモリ90との対応関係を保持する。物理CPU70は、EPT有効化レジスタ71が無効に設定されている場合に、PTアドレスレジスタ73にアドレスが格納されたSPT121を参照して、仮想メモリ61のアドレスを物理メモリ90のアドレスに変換する。なおGPT41の一部又は全部が更新された場合、ハイパバイザ20はSPT121の該当部位を更新する。 The SPT 121 controlled by the SPT control unit 120 is created for each guest process 60 and holds the correspondence between the virtual memory 61 and the physical memory 90. The physical CPU 70 refers to the SPT 121 whose address is stored in the PT address register 73 and converts the address of the virtual memory 61 into the address of the physical memory 90 when the EPT enable register 71 is set to invalid. When part or all of the GPT 41 is updated, the hypervisor 20 updates the corresponding part of the SPT 121.
 方式切替部130は、物理CPU70のレジスタを制御するVMCBやVMCSといった物理CPU設定管理表131を保持する。 The method switching unit 130 holds a physical CPU setting management table 131 such as VMCB or VMCS that controls a register of the physical CPU 70.
(1-3)メモリ構成
 図3は、ハイパバイザ20が管理する物理メモリ90のメモリマップを示す。ハイパバイザ20は、物理メモリ90上に自身を配置する領域と、仮想計算機30が使用する領域とを割り当てる。そしてハイパバイザ20は、上記説明してきたプログラム分析部100、EPT制御部110、SPT制御部120、方式切替部130及び仮想CPUスケジューラ140を自身に割り当てた領域内に含ませる。
(1-3) Memory Configuration FIG. 3 shows a memory map of the physical memory 90 managed by the hypervisor 20. The hypervisor 20 allocates an area where the hypervisor 20 is arranged on the physical memory 90 and an area used by the virtual machine 30. Then, the hypervisor 20 includes the program analysis unit 100, the EPT control unit 110, the SPT control unit 120, the method switching unit 130, and the virtual CPU scheduler 140 described above in the area allocated to itself.
 ここではハイパバイザ20は、自身にアドレスAD0~AD1を固定的に割り当てて各モジュールを配置し、仮想計算機30にアドレスAD2~AD3を動的に割り当て、また別の仮想計算機30にアドレスAD4~AD5を動的に割り当てる。ゲストOS40は、各仮想計算機30上に自身を配置する領域と、ゲストプロセス60が使用する領域とを割り当てる。 Here, the hypervisor 20 assigns addresses AD0 to AD1 to itself and arranges each module, dynamically assigns addresses AD2 to AD3 to the virtual machine 30, and assigns addresses AD4 to AD5 to another virtual machine 30. Assign dynamically. The guest OS 40 allocates an area where the guest OS 40 is arranged on each virtual machine 30 and an area used by the guest process 60.
(1-4)テーブル構成
 図4は、GPT41毎に測定した特性を保持する特性計測値表102の論理構成を示す。特性計測値表102には、仮想計算機番号401、GPTアドレス402、TLBパージ回数404、TLBミス回数405及び適用方式407が格納される。
(1-4) Table Configuration FIG. 4 shows a logical configuration of the characteristic measurement value table 102 that holds the characteristics measured for each GPT 41. The characteristic measurement value table 102 stores a virtual machine number 401, a GPT address 402, a TLB purge count 404, a TLB miss count 405, and an application method 407.
 仮想計算機番号401は、仮想計算機30を識別する識別番号である。GPTアドレス402は、仮想PTアドレスレジスタ33に格納されたGPT41のアドレスである。TLBパージ回数404は、直近の動作中にゲストOS40がTLBパージ命令を実行した回数である。 The virtual machine number 401 is an identification number for identifying the virtual machine 30. The GPT address 402 is an address of the GPT 41 stored in the virtual PT address register 33. The TLB purge count 404 is the number of times the guest OS 40 has executed a TLB purge command during the most recent operation.
 またTLBミス回数405は、直近の動作中に物理CPU70がTLBミスした回数である。適用方式407は、SPT方式又はEPT方式のうちの何れか適用した方式を示す情報である。なおこの特性計測値表102に仮想計算機番号401及びGPTアドレス402が含まれないプログラムについては、適用方式407にEPT方式が採用される。 The TLB miss count 405 is the number of TLB misses made by the physical CPU 70 during the most recent operation. The application method 407 is information indicating a method to which one of the SPT method and the EPT method is applied. Note that for the program in which the virtual machine number 401 and the GPT address 402 are not included in the characteristic measurement value table 102, the EPT method is adopted as the application method 407.
 図5は、管理者又はゲストプロセス60自身から与えられた特性を保持する特性固定選択表103の論理構成を示す。特性固定選択表103には、仮想計算機番号401とGPTアドレス402との組み合わせ毎に、適用方式407が格納される。なおこの特性固定選択表103に仮想計算機番号401及びGPTアドレス402が含まれるプログラムについては、特性計測値表102の内容に関わらず、特性固定選択表103の適用方式407が採用される。 FIG. 5 shows a logical configuration of the characteristic fixed selection table 103 that holds characteristics given by the administrator or the guest process 60 itself. In the characteristic fixed selection table 103, an application method 407 is stored for each combination of the virtual machine number 401 and the GPT address 402. Note that for a program in which the virtual machine number 401 and the GPT address 402 are included in the characteristic fixed selection table 103, the application method 407 of the characteristic fixed selection table 103 is adopted regardless of the contents of the characteristic measurement value table 102.
 図6は、プログラムの特性を計測するモード又は計測しないモードの区分を仮想計算機30毎に保持するモード選択表104の論理構成を示す。モード選択表104には、仮想計算機番号401に対して、プログラムの特性を計測するか否かを示す実行時計測オプション502が格納される。 FIG. 6 shows a logical configuration of the mode selection table 104 that holds, for each virtual machine 30, a mode that measures the characteristics of the program or a mode that does not measure. The mode selection table 104 stores a runtime measurement option 502 that indicates whether or not the program characteristics are measured for the virtual machine number 401.
 なお実行時計測オプション502が「する」の仮想計算機30のみ、特性計測値表102を参照又は更新する。実行時計測オプション502が「しない」の仮想計算機30上のプログラムであって、かつ、特性固定選択表103に仮想計算機番号401及びGPTアドレス402が含まれないプログラムは適用方式407にEPT方式が採用される。 Note that the characteristic measurement value table 102 is referred to or updated only for the virtual machine 30 whose execution time measurement option 502 is “Yes”. An EPT method is adopted as an application method 407 for a program on the virtual machine 30 whose execution time measurement option 502 is “no” and whose characteristic fixed selection table 103 does not include the virtual machine number 401 and the GPT address 402. Is done.
 図7は、仮想メモリ61のアドレスとゲスト物理メモリ31のアドレスとを対応付けるGPT41の論理構成を示す。GPT41には、仮想アドレス701、ゲスト物理アドレス702、ページサイズ704、グローバルフラグ705及びアクセス権706が格納される。 FIG. 7 shows a logical configuration of the GPT 41 that associates the address of the virtual memory 61 with the address of the guest physical memory 31. The GPT 41 stores a virtual address 701, a guest physical address 702, a page size 704, a global flag 705, and an access right 706.
 仮想アドレス701は、仮想メモリ61のアドレスである。ゲスト物理アドレス702は、ゲスト物理メモリ31のアドレスである。ページサイズ704は、アドレスの範囲を示す情報である。グローバルフラグ705は、仮想計算機30上の全てのGPT41で共通のデータを保持する旨を示す情報である。アクセス権706は、ユーザ権限又はカーネル権限で、読み/書き/実行を許すか否かを示す情報である。 The virtual address 701 is an address of the virtual memory 61. The guest physical address 702 is an address of the guest physical memory 31. The page size 704 is information indicating an address range. The global flag 705 is information indicating that data common to all the GPTs 41 on the virtual machine 30 is held. The access right 706 is information indicating whether reading / writing / execution is permitted with user authority or kernel authority.
 カーネル権限は、ゲストOS40が動作する際の権限であり、ゲストプロセス60が動作する際のユーザ権限とは区別される。またグローバルフラグは通常、ゲストOS40を実行するためのメモリ領域に対してセットされる。アクセス権706で禁止されたアクセスを検出すると、物理CPU70はページ例外を発生させる。 Kernel authority is authority when the guest OS 40 operates, and is distinguished from user authority when the guest process 60 operates. In addition, the global flag is usually set for a memory area for executing the guest OS 40. When an access prohibited by the access right 706 is detected, the physical CPU 70 generates a page exception.
 図8は、ゲスト物理メモリ31のアドレスと物理メモリ90のアドレスとを対応付けるEPT111の論理構成を示す。EPT111には、ゲスト物理アドレス702、ホスト物理アドレス703、ページサイズ704及びアクセス権706が格納される。 FIG. 8 shows a logical configuration of the EPT 111 that associates the address of the guest physical memory 31 with the address of the physical memory 90. The EPT 111 stores a guest physical address 702, a host physical address 703, a page size 704, and an access right 706.
 ゲスト物理アドレス702は、ゲスト物理メモリ31のアドレスである。ホスト物理アドレス703は、物理メモリ90のアドレスである。ページサイズ704は、アドレスの範囲を示す情報である。アクセス権706は、読み/書き/実行を許すか否かを示す情報である。 The guest physical address 702 is an address of the guest physical memory 31. The host physical address 703 is an address of the physical memory 90. The page size 704 is information indicating an address range. The access right 706 is information indicating whether reading / writing / execution is permitted.
 アクセス権706で禁止されたアクセスを検出すると、物理CPU70はEPT例外を発生させる。ハイパバイザ20は、仮想計算機30に割り当てていない全てのゲスト物理アドレス702に対して、アクセス権706で読み/書き/実行の全てを禁止し、EPT例外を用いてゲストOS40による不正なメモリアクセスを防ぐことができる。 When the access prohibited by the access right 706 is detected, the physical CPU 70 generates an EPT exception. The hypervisor 20 prohibits all read / write / execution with the access right 706 for all the guest physical addresses 702 not assigned to the virtual machine 30 and prevents illegal memory access by the guest OS 40 using the EPT exception. be able to.
 図9は、仮想メモリ61のアドレスと物理メモリ90のアドレスとを対応付けるSPT121の論理構成を示す。SPT121には、GPT41と同一のフォーマットであり、仮想アドレス701毎に、ホスト物理アドレス703、ページサイズ704、グローバルフラグ705及びアクセス権706が格納される。 FIG. 9 shows a logical configuration of the SPT 121 that associates the address of the virtual memory 61 with the address of the physical memory 90. The SPT 121 has the same format as the GPT 41 and stores a host physical address 703, a page size 704, a global flag 705, and an access right 706 for each virtual address 701.
 アクセス権706で禁止されたアクセスを検出すると、物理CPU70はページ例外を発生させる。ハイパバイザ20は、GPT41内に、仮想計算機30に割り当てていないゲスト物理アドレス702を発見した場合、該当する仮想アドレス701に対応するアクセス権706で読み/書き/実行の全てを禁止し、ページ例外を用いてゲストOS40による不正なメモリアクセスを防ぐことができる。 When the access prohibited by the access right 706 is detected, the physical CPU 70 generates a page exception. When the hypervisor 20 finds a guest physical address 702 that is not assigned to the virtual machine 30 in the GPT 41, the hypervisor 20 prohibits all reading / writing / execution with the access right 706 corresponding to the corresponding virtual address 701, and generates a page exception. By using this, unauthorized memory access by the guest OS 40 can be prevented.
 図10は、物理CPU70のレジスタを制御する物理CPU設定管理表131の論理構成を示す。物理CPU設定管理表131には、物理CPU番号901、EPT有効化フラグ902、PTアドレスレジスタ操作インタセプトフラグ903、ページ例外インタセプトフラグ904、PTアドレス905及びEPTアドレス906が格納される。 FIG. 10 shows a logical configuration of the physical CPU setting management table 131 that controls the registers of the physical CPU 70. The physical CPU setting management table 131 stores a physical CPU number 901, an EPT validation flag 902, a PT address register operation intercept flag 903, a page exception intercept flag 904, a PT address 905, and an EPT address 906.
 物理CPU番号901は、物理CPU70を識別する識別番号である。EPT有効化フラグ902は、EPT有効化レジスタ71を制御するためのフラグである。PTアドレスレジスタ操作インタセプトフラグ903及びページ例外インタセプトフラグ904は、インタセプト条件レジスタ75を制御するためのフラグである。PTアドレス905は、PTアドレスレジスタ73を制御するためのアドレスである。EPTアドレス906は、EPTアドレスレジスタ72を制御するためのアドレスである。 The physical CPU number 901 is an identification number for identifying the physical CPU 70. The EPT validation flag 902 is a flag for controlling the EPT validation register 71. The PT address register operation intercept flag 903 and the page exception intercept flag 904 are flags for controlling the intercept condition register 75. The PT address 905 is an address for controlling the PT address register 73. The EPT address 906 is an address for controlling the EPT address register 72.
 PTアドレスレジスタ操作インタセプトフラグ903が「1」の場合、物理CPU70は、ゲストOS40が仮想PTアドレスレジスタ33の値を変更しようとする際、ゲストOS40の実行を中断してハイパバイザ20を呼び出す。一方でPTアドレスレジスタ操作インタセプトフラグ903が「0」の場合、ゲストOS40が仮想PTアドレスレジスタ33を更新してもハイパバイザ20は呼び出されずに更新が完了する。 When the PT address register operation intercept flag 903 is “1”, the physical CPU 70 interrupts the execution of the guest OS 40 and calls the hypervisor 20 when the guest OS 40 attempts to change the value of the virtual PT address register 33. On the other hand, when the PT address register operation intercept flag 903 is “0”, even if the guest OS 40 updates the virtual PT address register 33, the hypervisor 20 is not called and the update is completed.
 同様にページ例外インタセプトフラグ904が「1」の場合、ゲストOS40又はゲストプロセス60の実行中にページ例外が起きると、物理CPU70はハイパバイザ20を呼び出す。 Similarly, when the page exception intercept flag 904 is “1”, the physical CPU 70 calls the hypervisor 20 when a page exception occurs during execution of the guest OS 40 or the guest process 60.
 ここではプログラムの特性を計測しない仮想計算機30に割り当てられた物理CPU70は、物理CPU番号901が「3」のエントリに格納されている設定で動作する。具体的にはEPT有効化フラグ902を「1」にセットして二重ページング仮想化支援機能を使用し、PTアドレスレジスタ操作インタセプトフラグ903及びページ例外インタセプトフラグ904はクリアする。 Here, the physical CPU 70 assigned to the virtual machine 30 that does not measure the program characteristics operates with the setting in which the physical CPU number 901 is stored in the entry “3”. Specifically, the EPT enable flag 902 is set to “1” and the double paging virtualization support function is used, and the PT address register operation intercept flag 903 and the page exception intercept flag 904 are cleared.
 一方でプログラムの特性を計測する仮想計算機30に割り当てられた物理CPU70は、SPT方式又はEPT方式のうちの何れが適用されているかに従って、物理CPU番号901が「1」又は「2」のエントリに格納されている設定で動作する。 On the other hand, the physical CPU 70 assigned to the virtual machine 30 that measures the program characteristics has an entry with the physical CPU number 901 of “1” or “2” depending on which of the SPT method and the EPT method is applied. Operates with stored settings.
 EPT方式が適用されている場合は物理CPU番号が「2」のエントリに格納されている設定で動作し、二重ページング仮想化支援機能を有効にしつつ、仮想PTアドレスレジスタ33の更新をインタセプトしてGPT41の切り替えを認識する。SPT方式が適用されている場合は物理CPU番号が「1」のエントリに格納されている設定で動作し、二重ページング仮想化支援機能を無効化しつつ、ページ例外をインタセプトしてゲストOS40による不正なメモリアクセスを防ぐ。 When the EPT method is applied, it operates with the setting stored in the entry with the physical CPU number “2”, and intercepts the update of the virtual PT address register 33 while enabling the double paging virtualization support function. To recognize the switching of GPT41. When the SPT method is applied, it operates with the setting stored in the entry with the physical CPU number “1”, invalidates the double paging virtualization support function, intercepts the page exception, and is illegal by the guest OS 40 Prevent excessive memory access.
(1-5)フローチャート
 以下ハイパバイザ20が実行する処理について、フローチャートを参照して説明する。
(1-5) Flowchart Hereinafter, processing executed by the hypervisor 20 will be described with reference to a flowchart.
 図11は、ハイパバイザ20の動作の中心となるイベント処理を含む全体処理の処理フローを示す。ハイパバイザ20は、物理計算機10に電源が投入されると、自身を初期化するためハイパバイザ初期化処理を実行する(S1100)。次いでハイパバイザ20は、イベント発生を待ち受けるループに処理を移行する。ループ内においてハイパバイザ20は、イベントが発生したかを判断する(S1110)。 FIG. 11 shows a processing flow of overall processing including event processing that is the center of the operation of the hypervisor 20. When the physical computer 10 is powered on, the hypervisor 20 executes a hypervisor initialization process to initialize itself (S1100). Next, the hypervisor 20 shifts the processing to a loop that waits for the occurrence of an event. In the loop, the hypervisor 20 determines whether an event has occurred (S1110).
 ハイパバイザ20は、ステップS1110の判断で否定結果を得ると、ステップS1130に移行する。これに対し、ハイパバイザ20はステップS1110の判断で肯定結果を得ると、イベント処理を実行する(S1120)。 When the hypervisor 20 obtains a negative result in the determination at step S1110, the process proceeds to step S1130. On the other hand, when the hypervisor 20 obtains a positive result in the determination at step S1110, it executes event processing (S1120).
 次いでハイパバイザ20は、動作中の仮想計算機30があるか否かを判断し(S1130)、動作中の仮想計算機30がない場合、ステップS1110に戻りイベント発生を待ち受け、動作中の仮想計算機30がある場合、仮想計算機30上のプログラムを実行する(S1140)。その後、ハイパバイザ20は、ループに戻る。 Next, the hypervisor 20 determines whether or not there is an operating virtual machine 30 (S1130). If there is no operating virtual machine 30, the process returns to step S1110 to wait for the occurrence of an event, and there is an operating virtual machine 30. If so, the program on the virtual machine 30 is executed (S1140). Thereafter, the hypervisor 20 returns to the loop.
 図12は、図11のステップS1100において実行されるハイパバイザ初期化処理の処理フローを示す。ハイパバイザ20は、特性固定選択表103にゼロ又はファイル等に格納された初期値を格納して、特性固定選択表103を初期化する(S2100)。またハイパバイザ20は、モード選択表104にゼロ又はファイル等に格納された初期値を格納して、モード選択表104を初期化する(S2110)。 FIG. 12 shows a processing flow of the hypervisor initialization process executed in step S1100 of FIG. The hypervisor 20 stores zero or an initial value stored in a file or the like in the characteristic fixed selection table 103, and initializes the characteristic fixed selection table 103 (S2100). Further, the hypervisor 20 stores zero or an initial value stored in a file or the like in the mode selection table 104, and initializes the mode selection table 104 (S2110).
 次いでハイパバイザ20は、性能モニタ機能74の設定を変更する。具体的にハイパバイザ20は、性能モニタ機能74によりカウントする1つ目のイベントとしてTLBミス回数を選択し(S2120)、2つ目のイベントとしてTLBパージ回数を選択する(S2130)。なおこれらの処理は、性能モニタ機能74が提供するイベント選択手段を使用することにより実現される。 Next, the hypervisor 20 changes the setting of the performance monitor function 74. Specifically, the hypervisor 20 selects the number of TLB misses as the first event counted by the performance monitor function 74 (S2120), and selects the number of TLB purges as the second event (S2130). These processes are realized by using event selection means provided by the performance monitor function 74.
 最後にハイパバイザ20は、その他の初期化処理を実行して(S2140)、このハイパバイザ初期化処理を終了する。 Finally, the hypervisor 20 executes other initialization processing (S2140), and ends this hypervisor initialization processing.
 図13は、図11のステップS1120において実行されるイベント処理の処理フローを示す。ハイパバイザ20は、発生したイベントが仮想計算機30の起動指示であるか否かを判断する(S1200)。ハイパバイザ20は、この判断で肯定結果を得ると、仮想計算機起動処理を実行する(S1205)。なお仮想計算機30の起動指示は、コンソール95の入力に応じて発生するとしてもよいし、ハイパバイザ初期化処理の完了後に自動的に発生するとしてもよい。 FIG. 13 shows a process flow of the event process executed in step S1120 of FIG. The hypervisor 20 determines whether or not the generated event is an instruction to start the virtual machine 30 (S1200). If the hypervisor 20 obtains an affirmative result in this determination, it executes a virtual machine activation process (S1205). Note that the activation instruction for the virtual machine 30 may be generated in response to an input from the console 95, or may be automatically generated after the hypervisor initialization process is completed.
 ハイパバイザ20は、ステップS1200の判断で否定結果を得ると、発生したイベントがゲストOS40による仮想PTアドレスレジスタ変更命令の実行であるか否かを判断する(S1210)。ハイパバイザ20は、この判断で肯定結果を得ると、仮想PTアドレスレジスタ変更処理を実行し(S1215)、否定結果を得るとステップS1220に移行する。 When the hypervisor 20 obtains a negative result in the determination at step S1200, the hypervisor 20 determines whether the generated event is an execution of a virtual PT address register change instruction by the guest OS 40 (S1210). If the hypervisor 20 obtains a positive result in this determination, it executes virtual PT address register change processing (S1215), and if it obtains a negative result, it proceeds to step S1220.
 ハイパバイザ20は、ステップS1210の判断で否定結果を得ると、発生したイベントがページ例外であるか否かを判断する(S1220)。ハイパバイザ20は、この判断で肯定結果を得ると、ページ例外処理を実行し(S1225)、否定結果を得るとステップS1230に移行する。 When the hypervisor 20 obtains a negative result in the determination at step S1210, it determines whether the event that has occurred is a page exception (S1220). If the hypervisor 20 obtains a positive result in this determination, it executes page exception processing (S1225), and if it obtains a negative result, it proceeds to step S1230.
 ハイパバイザ20は、ステップS1220の判断で否定結果を得ると、発生したイベントがEPT例外であるか否かを判断する(S1230)。ハイパバイザ20は、この判断で肯定結果を得ると、EPT例外処理を実行し(S1235)、否定結果を得るとステップS1240に移行する。 When the hypervisor 20 obtains a negative result in the determination at step S1220, it determines whether the event that has occurred is an EPT exception (S1230). If the hypervisor 20 obtains a positive result in this determination, it executes EPT exception processing (S1235), and if it obtains a negative result, it proceeds to step S1240.
 ハイパバイザ20は、ステップS1230の判断で否定結果を得ると、発生したイベントがコンソール95からの更新指示の入力であるか否かを判断する(S1240)。ハイパバイザは、この判断で肯定結果を得ると、コンソール入力処理を実行し(S1245)、否定結果を得るとステップS1250に移行する。 When the hypervisor 20 obtains a negative result in the determination at step S1230, it determines whether the event that has occurred is an input of an update instruction from the console 95 (S1240). If the hypervisor obtains a positive result in this determination, it executes console input processing (S1245), and if it obtains a negative result, it proceeds to step S1250.
 ハイパバイザ20は、ステップS1240の判断で否定結果を得ると、発生したイベントが仮想計算機30上のプログラムからハイパバイザ20に対して特性を自己申告する命令の実行であるか否かを判断する(S1250)。ハイパバイザ20は、この判断で肯定結果を得ると、自己申告受信処理を実行し(S1255)、否定結果を得るとステップS1260に移行する。 When the hypervisor 20 obtains a negative result in the determination at step S1240, it determines whether the event that has occurred is an execution of a command for self-declaring characteristics to the hypervisor 20 from a program on the virtual machine 30 (S1250). . If the hypervisor 20 obtains a positive result in this determination, it executes self-report reception processing (S1255), and if it obtains a negative result, it proceeds to step S1260.
 なお特性の自己申告には、AMD社製CPUのVMMCALL命令又はIntel社製CPUのVMCALL命令等のハイパバイザ20を呼び出す任意の命令が使用される。 For the self-declaration of characteristics, an arbitrary instruction for calling the hypervisor 20 such as a VMMCALL instruction of an AMD CPU or a VMMCALL instruction of an Intel CPU is used.
 ハイパバイザ20は、ステップS1250の判断で否定結果を得ると、発生したイベントがタイマ割り込みであるか否かを判断する(S1260)。ハイパバイザ20は、この判断で肯定結果を得ると、タイマ割り込み処理を実行し(S1265)、否定結果を得るとその他の処理を実行する(S1270)。 When the hypervisor 20 obtains a negative result in the determination at step S1250, it determines whether or not the event that has occurred is a timer interrupt (S1260). If the hypervisor 20 obtains a positive result in this determination, it executes timer interrupt processing (S1265), and if it obtains a negative result, it executes other processing (S1270).
 最後にハイパバイザ20は、仮想計算機30上の次の命令を実行したり、イベント検出前の処理を再開したりする復帰処理を実行して(S1280)、このイベント処理を終了する。 Finally, the hypervisor 20 executes a next process on the virtual machine 30 or executes a return process for resuming the process before the event detection (S1280), and ends this event process.
 図14は、図13のステップS1205において実行される仮想計算機起動処理の処理フローを示す。ハイパバイザ20は、特性計測値表102にゼロを格納して特性計測値表102をクリアし(S1300)、仮想計算機30に割り当てた物理CPU70の設定として、二重ページング仮想化支援機能を有効化し、ページ例外インタセプトを無効化する(S1310)。 FIG. 14 shows a processing flow of the virtual machine activation process executed in step S1205 of FIG. The hypervisor 20 stores zero in the characteristic measurement value table 102 to clear the characteristic measurement value table 102 (S1300), and activates the double paging virtualization support function as the setting of the physical CPU 70 allocated to the virtual machine 30. The page exception intercept is invalidated (S1310).
 このステップS1310における設定により、仮想計算機30上のプログラムは、EPT方式が適用された状態で動作を開始する。次いでハイパバイザ20は、モード選択表104を参照して、仮想計算機30の実行時計測オプション502を確認し、仮想計算機30が計測対象の仮想計算機であるか否かを判断する(S1320)。 According to the setting in step S1310, the program on the virtual machine 30 starts operating in a state where the EPT method is applied. Next, the hypervisor 20 refers to the mode selection table 104, confirms the runtime measurement option 502 of the virtual machine 30, and determines whether or not the virtual machine 30 is a virtual machine to be measured (S1320).
 ハイパバイザ20は、仮想計算機30が計測対象でない場合、PTアドレスレジスタ73が変更された場合のインタセプトを無効化し(S1330)、計測対象である場合、PTアドレスレジスタが変更された場合のインタセプトを有効化して(S1340)、この仮想計算機起動処理を終了する。なおここで設定した初期値は、物理CPU設定管理表131を通じて物理CPU70に伝えられる。 If the virtual machine 30 is not a measurement target, the hypervisor 20 invalidates the intercept when the PT address register 73 is changed (S1330), and if it is a measurement target, the hypervisor 20 enables the intercept when the PT address register is changed. (S1340), the virtual machine activation process is terminated. The initial value set here is transmitted to the physical CPU 70 through the physical CPU setting management table 131.
 図15は、図13のステップS1215において実行される仮想PTアドレスレジスタ変更処理の処理フローを示す。ハイパバイザ20は、モード選択表104を参照して、仮想計算機30の実行時計測オプション502を確認し、仮想計算機30が計測対象の仮想計算機であるか否かを判断する(S1400)。 FIG. 15 shows a process flow of the virtual PT address register change process executed in step S1215 of FIG. The hypervisor 20 refers to the mode selection table 104, confirms the runtime measurement option 502 of the virtual machine 30, and determines whether the virtual machine 30 is a virtual machine to be measured (S1400).
 ハイパバイザ20は、仮想計算機30が計測対象である場合に限って、性能モニタ機能74からTLBミス回数とTLBパージ命令の実行回数の特性データを取得し、変更前の仮想PTアドレスレジスタ33に登録されているGPT41と関連付けて、取得した特性データを特性計測値表102のTLBパージ回数404及びTLBミス回数405に格納してゲストプロセス60の特性を更新する(S1405)。 The hypervisor 20 acquires the characteristic data of the TLB miss count and the TLB purge instruction execution count from the performance monitor function 74 only when the virtual computer 30 is a measurement target, and is registered in the virtual PT address register 33 before the change. The acquired characteristic data is stored in the TLB purge number 404 and the TLB miss number 405 of the characteristic measurement value table 102 in association with the GPT 41, and the characteristic of the guest process 60 is updated (S1405).
 次いでハイパバイザ20は、TLBミス回数405と二重ページング仮想化支援機能のテーブル参照単価とを掛けた値と、TLBパージ回数404とGPT更新単価とを掛けた値とを比較し、前者が大きければSPT方式を適用方式407として格納し、後者が大きければEPT方式を適用方式407として格納する。 Next, the hypervisor 20 compares the value obtained by multiplying the TLB miss count 405 and the table reference unit price of the double paging virtualization support function with the value obtained by multiplying the TLB purge count 404 and the GPT update unit price. The SPT method is stored as the application method 407, and if the latter is larger, the EPT method is stored as the application method 407.
 なお二重ページング仮想化支援機能のテーブル参照単価及びGPT更新単価については、予め測定しておく等の方法でハイパバイザ20が定数値を保持しているものとする。またハイパバイザ20は、性能モニタ機能74が計測しているTLBミス回数及びTLBパージ命令の実行回数をゼロクリアし、変更後の仮想PTアドレスレジスタ33に登録されたGPT41を使って動くゲストプロセス60の特性計測に備える(S1410)。 Note that the table reference unit price and the GPT update unit price of the dual paging virtualization support function are assumed to be held by the hypervisor 20 by a method such as measuring in advance. Further, the hypervisor 20 clears the number of TLB misses and the number of executions of the TLB purge instruction measured by the performance monitoring function 74 to the characteristics of the guest process 60 that operates using the GPT 41 registered in the virtual PT address register 33 after the change. Prepare for measurement (S1410).
 ハイパバイザ20は、仮想PTアドレスレジスタ33の変更をプログラムの切り替えと認識して適用すべき方式を判断する。そのためハイパバイザ20は、特性計測値表102を参照して、変更後の仮想PTアドレスレジスタ33によりアドレスが保持されるGPT41と関連付けられたゲストプロセス60の特性を判断する(S1420)。 The hypervisor 20 recognizes the change of the virtual PT address register 33 as program switching and determines a method to be applied. Therefore, the hypervisor 20 refers to the characteristic measurement value table 102 and determines the characteristic of the guest process 60 associated with the GPT 41 whose address is held by the virtual PT address register 33 after the change (S1420).
 次いでハイパバイザ20は、適用方式407がSPT方式であるか否かを判断する(S1430)。適用方式407がSPT方式である場合、ハイパバイザ20は、以下の手順で物理CPU70の設定をSPT方式用に変更する。 Next, the hypervisor 20 determines whether or not the application method 407 is the SPT method (S1430). When the application method 407 is the SPT method, the hypervisor 20 changes the setting of the physical CPU 70 for the SPT method in the following procedure.
 ハイパバイザ20は、物理CPU70の二重ページング仮想化支援機能を無効化してページ例外インタセプトを有効化する(S1435)。次いでハイパバイザ20は、変更後の仮想PTアドレスレジスタ33に登録されたGPT41に対応するSPT121を検索する(S1440)。 The hypervisor 20 invalidates the double paging virtualization support function of the physical CPU 70 and enables page exception interception (S1435). Next, the hypervisor 20 searches for the SPT 121 corresponding to the GPT 41 registered in the virtual PT address register 33 after the change (S1440).
 ハイパバイザ20は、該当するSPT121を発見した場合(S1445:Yes)、発見したSPT121を物理CPU70のPTアドレスレジスタ73に登録する(S1455)。これに対しハイパバイザ20は、該当するSPT121が見つからなかった場合(S1445:No)、GPT41とEPT111を参照して、仮想アドレス701とホスト物理アドレス703とを対応付けるSPT121を作成し(S1450)、GPT41のアドレスと対応付けて保持する。 When the hypervisor 20 finds the corresponding SPT 121 (S1445: Yes), the hypervisor 20 registers the found SPT 121 in the PT address register 73 of the physical CPU 70 (S1455). On the other hand, when the corresponding SPT 121 is not found (S1445: No), the hypervisor 20 refers to the GPT 41 and the EPT 111 and creates the SPT 121 that associates the virtual address 701 with the host physical address 703 (S1450). Stored in association with the address.
 この際、ハイパバイザ20は、参照したGPT41が配置されているホスト物理アドレス703の更新を検出するために、ハイパバイザ20が保持する全てのEPT111及びSPT121について、当該ホスト物理アドレス703への書き込みをアクセス権706で禁止する。そしてハイパバイザ20は、作成したSPT121のアドレスを物理CPU70のPTアドレスレジスタ73に登録して(S1455)、この仮想PTアドレスレジスタ変更処理を終了する。 At this time, in order to detect the update of the host physical address 703 where the referenced GPT 41 is arranged, the hypervisor 20 has access rights to write to the host physical address 703 for all the EPTs 111 and SPTs 121 held by the hypervisor 20. It is prohibited at 706. The hypervisor 20 registers the created address of the SPT 121 in the PT address register 73 of the physical CPU 70 (S1455), and ends this virtual PT address register change process.
 ステップS1430に戻り、適用方式407がEPT方式である場合、ハイパバイザ20は、以下の手順で物理CPU70の設定をEPT方式用に変更する。 Returning to step S1430, when the application method 407 is the EPT method, the hypervisor 20 changes the setting of the physical CPU 70 for the EPT method in the following procedure.
 ハイパバイザ20は、物理CPU70の二重ページング仮想化支援機能を有効化してページ例外インタセプトを無効化する(S1470)。次いでハイパバイザ20は、仮想計算機30用のEPT111のアドレスを物理CPU70のEPTアドレスレジスタ72に登録し、また変更後の仮想PTアドレスレジスタ33が保持するGPT41のアドレスを物理CPU70のPTアドレスレジスタ73に登録して(S1480)、この仮想PTアドレスレジスタ変更処理を終了する。 The hypervisor 20 enables the double paging virtualization support function of the physical CPU 70 and disables the page exception intercept (S1470). Next, the hypervisor 20 registers the address of the EPT 111 for the virtual computer 30 in the EPT address register 72 of the physical CPU 70, and registers the address of the GPT 41 held in the virtual PT address register 33 after the change in the PT address register 73 of the physical CPU 70. In step S1480, the virtual PT address register changing process is terminated.
 図16は、図13のステップS1225において実行されるページ例外処理の処理フローを示す。ハイパバイザ20は、仮想PTアドレスレジスタ33がアドレスを保持しているGPT41を参照し、物理CPU70の検出したページ例外がGPT41で禁止されたアクセスであるか否かを判断する(S1500)。 FIG. 16 shows a processing flow of page exception processing executed in step S1225 of FIG. The hypervisor 20 refers to the GPT 41 in which the virtual PT address register 33 holds the address, and determines whether the page exception detected by the physical CPU 70 is an access prohibited by the GPT 41 (S1500).
 ハイパバイザ20は、GPT41で禁止されたアクセスである場合、ゲストOS40にページ例外を伝達して(S1550)、このページ例外処理を終了する。これに対しハイパバイザ20は、GPT41で禁止されたアクセスでない場合、このページ例外がGPT41の更新であるか否かを判断する(S1510)。 When the access is prohibited by the GPT 41, the hypervisor 20 transmits a page exception to the guest OS 40 (S1550), and ends this page exception processing. On the other hand, if the access is not prohibited by the GPT 41, the hypervisor 20 determines whether this page exception is an update of the GPT 41 (S1510).
 ハイパバイザ20は、GPT41の更新である場合、更新後のGPT41にあわせてSPT121を更新し(S1530)、GPT41の更新でない場合、仮想計算機30に未割り当てのメモリを操作した場合の動作をエミュレーションして(S1540)、このページ例外処理を終了する。なおページ例外がGPT41の更新であるか否かの判断方法として、全てのSPT121に対してそれぞれに対応付けられたGPT41を1つずつ調べてもよいし、他の方法でもよい。 When updating the GPT 41, the hypervisor 20 updates the SPT 121 in accordance with the updated GPT 41 (S1530). When not updating the GPT 41, the hypervisor emulates the operation when the unallocated memory is operated on the virtual machine 30. (S1540), this page exception processing is terminated. As a method for determining whether or not the page exception is an update of the GPT 41, the GPT 41 associated with each of all the SPTs 121 may be examined one by one, or another method may be used.
 図17は、図13のステップS1235において実行されるEPT例外処理の処理フローを示す。ハイパバイザ20は、このEPT例外(EPT Violation)がGPT41の更新であるか否かを判断する(S1510)。 FIG. 17 shows a processing flow of EPT exception processing executed in step S1235 of FIG. The hypervisor 20 determines whether or not the EPT exception (EPT Violation) is an update of the GPT 41 (S1510).
 ハイパバイザ20は、EPT例外がGPT41の更新である場合、更新後のGPT41にあわせてSPT121を更新し(S1530)、EPT例外がGPT41の更新でない場合、仮想計算機30に未割り当てのメモリを操作した場合の動作をエミュレーションして(S1540)、このEPT例外処理を終了する。 When the EPT exception is an update of the GPT 41, the hypervisor 20 updates the SPT 121 in accordance with the updated GPT 41 (S1530). When the EPT exception is not an update of the GPT 41, when an unallocated memory is operated on the virtual machine 30 Is emulated (S1540), and this EPT exception process is terminated.
 図18は、図13のステップS1265において実行されるタイマ割り込み処理の処理フローを示す。ハイパバイザ20は、このタイマ割り込みが仮想CPU32に物理CPU70を時分割で割り当てる際のタイムスライスを使い切ったために生じた割り込みであるか否かを判断する(S1700)。 FIG. 18 shows a process flow of the timer interrupt process executed in step S1265 of FIG. The hypervisor 20 determines whether or not this timer interrupt is an interrupt that occurs because the time slice used when the physical CPU 70 is allocated to the virtual CPU 32 in a time-sharing manner (S1700).
 ハイパバイザ20は、タイムスライスを使い切った場合、次にタイムスライスを割り当てる仮想CPU32を選択し(S1710)、物理CPU70上で稼動するプログラムの切り替えも生じるためこれを認識して仮想CPU切り替え処理を行い(S1720)、タイマ割り込み処理を終了する。これに対しハイパバイザ20は、タイムスライスを使い切っていない場合、その他の処理を行い(S1730)、タイマ割り込み処理を終了する。 When the hypervisor 20 uses up the time slice, the hypervisor 20 selects the virtual CPU 32 to which the next time slice is assigned (S1710), and the program running on the physical CPU 70 is also switched. S1720), the timer interrupt process is terminated. On the other hand, when the time slice is not used up, the hypervisor 20 performs other processing (S1730) and ends the timer interrupt processing.
 図19は、図18のステップS1720において実行される仮想CPU切り替え処理の処理フローを示す。ハイパバイザ20は、モード選択表104を参照して、切り替え前の現在の仮想CPU32が計測対象の仮想計算機30に所属しているかどうかを判断する(S1800)。 FIG. 19 shows a process flow of the virtual CPU switching process executed in step S1720 of FIG. The hypervisor 20 refers to the mode selection table 104 and determines whether or not the current virtual CPU 32 before switching belongs to the virtual computer 30 to be measured (S1800).
 ハイパバイザ20は、切り替え前の仮想CPU32が計測対象の仮想計算機30に所属している場合、性能モニタ機能74からTLBミス回数及びTLBパージ命令の実行回数の特性データを取得し、仮想PTアドレスレジスタ33に登録されていたGPT41と関連付けて、取得した特性データを特性計測値表102のTLBパージ回数404及びTLBミス回数405に格納してゲストプロセス60の特性を更新する(S1805)。 When the virtual CPU 32 before switching belongs to the virtual machine 30 to be measured, the hypervisor 20 acquires the characteristic data of the TLB miss count and the TLB purge instruction execution count from the performance monitor function 74, and the virtual PT address register 33 The acquired characteristic data is stored in the TLB purge number 404 and the TLB miss number 405 of the characteristic measurement value table 102 in association with the GPT 41 registered in the table, and the characteristic of the guest process 60 is updated (S1805).
 次いでハイパバイザ20は、TLBミス回数405と二重ページング仮想化支援機能のテーブル参照単価とを掛けた値と、TLBパージ回数404とGPT更新単価とを掛けた値とを比較し、前者が大きければSPT方式を適用方式407として格納し、後者が大きければEPT方式を適用方式407として格納する。 Next, the hypervisor 20 compares the value obtained by multiplying the TLB miss count 405 and the table reference unit price of the double paging virtualization support function with the value obtained by multiplying the TLB purge count 404 and the GPT update unit price. The SPT method is stored as the application method 407, and if the latter is larger, the EPT method is stored as the application method 407.
 次にハイパバイザ20は、モード選択表104を参照して、切り替え後の仮想CPU32が計測対象の仮想計算機30に所属しているかどうかを判断する(S1810)。ハイパバイザ20は、切り替え後の仮想CPU32が計測対象の仮想計算機30に所属している場合、性能モニタ機能74が計測しているTLBミス回数及びTLBパージ命令の実行回数をゼロクリアして次回の計測に備え、PTアドレスレジスタ操作のインタセプトを有効化する(S1815)。 Next, the hypervisor 20 refers to the mode selection table 104 and determines whether or not the virtual CPU 32 after switching belongs to the virtual machine 30 to be measured (S1810). When the virtual CPU 32 after switching belongs to the virtual machine 30 to be measured, the hypervisor 20 clears the TLB miss count and the TLB purge command execution count measured by the performance monitor function 74 to the next measurement. And intercepting PT address register operation (S1815).
 一方でハイパバイザ20は、切り替え後の仮想CPU32が計測対象でない仮想計算機30に所属している場合、GPT41の変化を監視する必要がないため、PTアドレスレジスタ操作のインタセプトを無効化する(S1820)。 On the other hand, when the virtual CPU 32 after switching belongs to the virtual computer 30 that is not the measurement target, the hypervisor 20 does not need to monitor the change of the GPT 41, and therefore invalidates the intercept of the PT address register operation (S1820).
 次いでハイパバイザ20は、特性計測値表102を参照して、切り替え後の仮想CPU32の仮想PTアドレスレジスタ33がアドレスを保持するGPT41と関連付けられたゲストプロセス60の特性を判断する(S1830)。 Next, the hypervisor 20 refers to the characteristic measurement value table 102 and determines the characteristic of the guest process 60 associated with the GPT 41 in which the virtual PT address register 33 of the virtual CPU 32 after switching holds the address (S1830).
 ハイパバイザ20は、適用方式407がSPT方式であった場合、以下の手順で物理CPU70の設定をSPT方式用に変更する。ハイパバイザ20は、物理CPU70の二重ページング仮想化支援機能を無効化してページ例外インタセプトを有効化する(S1435)。次いでハイパバイザ20は、切り替え後の仮想CPU32の仮想PTアドレスレジスタ33に登録されたGPT41に対応するSPT121を検索する(S1860)。 When the application method 407 is the SPT method, the hypervisor 20 changes the setting of the physical CPU 70 for the SPT method according to the following procedure. The hypervisor 20 invalidates the double paging virtualization support function of the physical CPU 70 and validates the page exception intercept (S1435). Next, the hypervisor 20 searches the SPT 121 corresponding to the GPT 41 registered in the virtual PT address register 33 of the virtual CPU 32 after switching (S1860).
 これ以降ハイパバイザ20は、図15のステップS1445、S1450及びS1455と同一の処理を実行して、SPT121を物理CPU70のPTアドレスレジスタ73に登録する。また適用方式407がEPT方式であった場合、ハイパバイザ20は、図15のステップS1470及びS1480と同一の処理を実行して、物理CPU70の設定をEPT方式用に変更する。 Thereafter, the hypervisor 20 executes the same processing as steps S1445, S1450, and S1455 of FIG. 15 and registers the SPT 121 in the PT address register 73 of the physical CPU 70. When the application method 407 is the EPT method, the hypervisor 20 executes the same processing as steps S1470 and S1480 in FIG. 15 to change the setting of the physical CPU 70 to the EPT method.
 図20は、図13のステップS1245において実行されるコンソール入力処理の処理フローを示す。ハイパバイザ20は、コンソール95から受けた更新指示がモード選択表104に対する指示であるか、或いは、特性固定選択表103に対する指示であるかを判断する(S2200)。 FIG. 20 shows a processing flow of console input processing executed in step S1245 of FIG. The hypervisor 20 determines whether the update instruction received from the console 95 is an instruction for the mode selection table 104 or an instruction for the fixed characteristic selection table 103 (S2200).
 ハイパバイザ20は、モード選択表104に対する指示である場合、指示通りにモード選択表104を更新する(S2220)。一方ハイパバイザ20は、特性固定選択表103に対する指示である場合、指示通りに特性固定選択表103を更新する(S2210)。なおモード選択表104及び特性固定選択表103は物理メモリ90上に存在するが、更新された表の内容はファイルに保存しても構わない。 When the hypervisor 20 is an instruction for the mode selection table 104, the hypervisor 20 updates the mode selection table 104 as instructed (S2220). On the other hand, when the instruction is for the characteristic fixed selection table 103, the hypervisor 20 updates the characteristic fixed selection table 103 as instructed (S2210). Although the mode selection table 104 and the characteristic fixed selection table 103 exist on the physical memory 90, the contents of the updated table may be stored in a file.
 図21は、図13のステップS1255において実行される自己申告受信処理の処理フローを示す。ハイパバイザ20は、ゲストプロセス60から申告された内容に沿って、特性固定選択表103を更新する(S2210)。なお特性固定選択表103は物理メモリ90上に存在するが、更新された表の内容はファイルに保存しても構わない。 FIG. 21 shows a process flow of the self-report reception process executed in step S1255 of FIG. The hypervisor 20 updates the characteristic fixed selection table 103 in accordance with the contents reported from the guest process 60 (S2210). The characteristic fixed selection table 103 exists on the physical memory 90, but the updated table contents may be stored in a file.
 図22は、図15のステップS1420及び図19のステップS1830において実行される特性判断処理の処理フローを示す。ハイパバイザ20は、特性固定選択表103を参照して、現在走行中のゲストプロセス60に関する情報が格納されているか否かを判断する(S2300)。 FIG. 22 shows a process flow of the characteristic determination process executed in step S1420 in FIG. 15 and step S1830 in FIG. The hypervisor 20 refers to the characteristic fixed selection table 103 and determines whether or not information related to the currently running guest process 60 is stored (S2300).
 ハイパバイザ20は、特性固定選択表103に情報が格納されている場合、特性固定選択表103に格納された適用方式407が妥当と判断して、適用方式407として格納されているSPT方式又はEPT方式の何れかの方式を採用する(S2310)。 When information is stored in the fixed characteristic selection table 103, the hypervisor 20 determines that the application method 407 stored in the fixed characteristic selection table 103 is valid, and the SPT method or the EPT method stored as the applicable method 407. Any one of these methods is adopted (S2310).
 これに対しハイパバイザ20は、特性固定選択表103に情報が格納されていない場合、モード選択表104を参照して、計測対象の仮想計算機30であるか否かを判断する(S2320)。計測対象でない仮想計算機30である場合、ハイパバイザ20はEPT方式が妥当であると判断して、EPT方式を採用する(S2350)。 On the other hand, when information is not stored in the characteristic fixed selection table 103, the hypervisor 20 refers to the mode selection table 104 and determines whether or not the virtual computer 30 is a measurement target (S2320). When the virtual computer 30 is not a measurement target, the hypervisor 20 determines that the EPT method is appropriate and adopts the EPT method (S2350).
 一方で計測対象の仮想計算機30である場合、ハイパバイザ20は特性計測値表102を参照して、現在走行中のゲストプロセス60に関する情報が格納されているか否かを判断する(S2330)。情報が格納されていない場合、ハイパバイザ20はEPT方式が妥当と判断して、EPT方式を採用する(S2350)。 On the other hand, if the virtual computer 30 is a measurement target, the hypervisor 20 refers to the characteristic measurement value table 102 and determines whether or not information related to the currently running guest process 60 is stored (S2330). If the information is not stored, the hypervisor 20 determines that the EPT method is appropriate and adopts the EPT method (S2350).
 これに対しハイパバイザ20は、情報が格納されている場合、特性計測値表102に格納された適用方式407が妥当であると判断して、適用方式407として格納されているSPT方式又はEPT方式の何れかの方式を採用する(S2340)。 On the other hand, when information is stored, the hypervisor 20 determines that the application method 407 stored in the characteristic measurement value table 102 is appropriate, and uses the SPT method or the EPT method stored as the application method 407. Either method is adopted (S2340).
(1-6)第1の実施の形態による効果
 以上のように第1の実施の形態における物理計算機10によれば、仮想計算機30上のゲストOS40が動作させるゲストプロセス60をGPT41で区別し、ゲストプロセス60の特性をTLBミス回数及びTLBパージ回数で判断するようにしたので、TLBミス回数の多いゲストプロセス60に対しては二重ページング仮想化支援機能を無効化するSPT方式を採用してテーブル参照にともなうメモリ性能の低下を防止することができ、一方でTLBパージ回数が多いゲストプロセス60に対しては二重ページング仮想化支援機能を有効化するEPT方式を採用してGPT41とSPT121とを同期させる処理にともなうメモリ性能の低下を防止することができる。
(1-6) Effects According to First Embodiment As described above, according to the physical computer 10 in the first embodiment, the guest process 60 operated by the guest OS 40 on the virtual computer 30 is distinguished by the GPT 41, Since the characteristics of the guest process 60 are determined by the number of TLB misses and the number of TLB purges, an SPT method for disabling the double paging virtualization support function is adopted for the guest process 60 having a large number of TLB misses. It is possible to prevent a decrease in memory performance due to a table reference, while adopting an EPT method that enables the double paging virtualization support function for the guest process 60 having a large number of TLB purges, the GPT 41 and the SPT 121 It is possible to prevent the memory performance from being lowered due to the process of synchronizing the.
(2)第2の実施の形態
 第2の実施の形態においては、仮想計算機上のシステムソフトウェアとしてゲストOSが動作し、複数のゲストプロセスを稼働させる場合に仮想計算機に割り当てられた仮想CPU毎にプログラムの特性を判断し、判断結果として得られたプログラムの特性に応じて、二重ページング仮想化支援機能を有効化又は無効化する構成について説明する。
(2) Second Embodiment In the second embodiment, for each virtual CPU assigned to a virtual machine when a guest OS operates as system software on the virtual machine and operates a plurality of guest processes. A configuration for determining the characteristics of a program and enabling or disabling the double paging virtualization support function according to the characteristics of the program obtained as a determination result will be described.
 なお第1の実施の形態と同様の構成については同一の符号を付してその説明を省略し、異なる構成について説明する。 In addition, about the structure similar to 1st Embodiment, the same code | symbol is attached | subjected, the description is abbreviate | omitted, and a different structure is demonstrated.
(2-1)ソフトウェア構成
 図23は、第2の実施の形態における物理計算機10のソフトウェア構成を示す。仮想計算機30上では、システムソフトウェアとしてゲストOS40が稼動する。ゲストOS40は、仮想CPU32毎に1つ以上のゲストプロセス60を稼働させる。そのためゲストOS40は、仮想CPU32毎にGPT41を保持する。
(2-1) Software Configuration FIG. 23 shows a software configuration of the physical computer 10 in the second embodiment. On the virtual machine 30, a guest OS 40 operates as system software. The guest OS 40 operates one or more guest processes 60 for each virtual CPU 32. Therefore, the guest OS 40 holds a GPT 41 for each virtual CPU 32.
 プログラム分析部100は、仮想CPU32毎にプログラムの特性を保持する仮想CPU別特性表107を備える。仮想CPU別特性表107は、プログラムの特性を保持する特性表の一種であり、ここでは仮想CPU32毎に測定した特性を保持する特性計測値表112と、管理者又はゲストプロセス60自身から与えられた特性を保持する特性固定選択表113とから構成される。 The program analysis unit 100 includes a virtual CPU-specific characteristic table 107 that stores program characteristics for each virtual CPU 32. The characteristic table 107 for each virtual CPU is a kind of characteristic table for holding the characteristics of the program. Here, the characteristic measurement value table 112 for holding the characteristics measured for each virtual CPU 32 and the administrator or the guest process 60 itself are given. And a characteristic fixed selection table 113 that holds the characteristics.
(2-2)テーブル構成
 図24は、仮想CPU32毎に測定した特性を保持する特性計測値表112の論理構成を示す。特性計測値表112には、仮想計算機番号401、仮想CPU32を識別する仮想CPU番号408、TLBパージ回数404、TLBミス回数405及び適用方式407が格納される。
(2-2) Table Configuration FIG. 24 shows a logical configuration of the characteristic measurement value table 112 that holds the characteristics measured for each virtual CPU 32. The characteristic measurement value table 112 stores a virtual computer number 401, a virtual CPU number 408 for identifying the virtual CPU 32, a TLB purge count 404, a TLB miss count 405, and an application method 407.
 図25は、管理者やゲストプロセス60自身から与えられた特性を保持する特性固定選択表113の論理構成を示す。特性固定選択表113には、仮想計算機番号401と仮想CPU番号408との組み合わせ毎に、適用方式407が格納される。 FIG. 25 shows a logical configuration of the characteristic fixed selection table 113 that holds the characteristics given by the administrator or the guest process 60 itself. In the characteristic fixed selection table 113, an application method 407 is stored for each combination of the virtual machine number 401 and the virtual CPU number 408.
 第2の実施の形態において、モード選択表104、GPT41、EPT111、SPT121及び物理CPU設定管理表131は、第1の実施の形態におけるモード選択表104(図6)、GPT41(図7)、EPT111(図8)、SPT121(図9)及び物理CPU設定管理表131(図10)と同様であるためここでの説明は省略する。 In the second embodiment, the mode selection table 104, GPT41, EPT111, SPT121, and physical CPU setting management table 131 are the mode selection table 104 (FIG. 6), GPT41 (FIG. 7), and EPT111 in the first embodiment. (FIG. 8), SPT 121 (FIG. 9), and physical CPU setting management table 131 (FIG. 10) are the same, and the description thereof is omitted here.
(2-3)フローチャート
 以下ハイパバイザ20が実行する処理について、フローチャートを参照して説明する。第2の実施の形態において、全体処理、初期化処理及びイベント処理は、第1の実施の形態における全体処理(図11)、初期化処理(図12)及びイベント処理(図13)と同様であるためここでの説明は省略する。
(2-3) Flowchart Hereinafter, processing executed by the hypervisor 20 will be described with reference to a flowchart. In the second embodiment, the overall process, initialization process, and event process are the same as the overall process (FIG. 11), initialization process (FIG. 12), and event process (FIG. 13) in the first embodiment. Since it exists, description here is abbreviate | omitted.
 図26は、図13のステップS1205において実行される仮想計算機起動処理の処理フローを示す。ハイパバイザ20は、特性計測値表102にゼロを格納して特性計測値表102をクリアし(S1300)、仮想計算機30に割り当てた物理CPU70の設定として、二重ページング仮想化支援機能を有効化し、ページ例外インタセプトを無効化する(S1310)。 FIG. 26 shows a processing flow of the virtual machine activation process executed in step S1205 of FIG. The hypervisor 20 stores zero in the characteristic measurement value table 102 to clear the characteristic measurement value table 102 (S1300), and activates the double paging virtualization support function as the setting of the physical CPU 70 allocated to the virtual machine 30. The page exception intercept is invalidated (S1310).
 このステップS1310における設定により、仮想計算機30上のプログラムは、EPT方式が適用された状態で動作を開始する。次いでハイパバイザ20は、PTアドレスレジスタが変更された場合のインタセプトを有効化して(S1340)、この仮想計算機起動処理を終了する。なおここで設定した初期値は、物理CPU設定管理表131を通じて物理CPU70に伝えられる。 According to the setting in step S1310, the program on the virtual machine 30 starts operating in a state where the EPT method is applied. Next, the hypervisor 20 validates the intercept when the PT address register is changed (S1340), and ends this virtual machine activation process. The initial value set here is transmitted to the physical CPU 70 through the physical CPU setting management table 131.
 図27は、図13のステップS1215において実行される仮想PTアドレスレジスタ変更処理の処理フローを示す。ハイパバイザ20は、変更後の仮想PTアドレスレジスタ33に登録されたGPT41に対応するSPT121を検索する(S1440)。 FIG. 27 shows a processing flow of the virtual PT address register changing process executed in step S1215 of FIG. The hypervisor 20 searches for the SPT 121 corresponding to the GPT 41 registered in the virtual PT address register 33 after the change (S1440).
 ハイパバイザ20は、該当するSPT121を発見した場合(S1445:YES)、発見したSPT121を物理CPU70のPTアドレスレジスタ73に登録する(S1455)。 When the hypervisor 20 finds the corresponding SPT 121 (S1445: YES), the hypervisor 20 registers the found SPT 121 in the PT address register 73 of the physical CPU 70 (S1455).
 これに対しハイパバイザ20は、該当するSPT121が見つからなかった場合(S1445:No)、GPT41及びEPT111を参照して、仮想アドレス701とホスト物理アドレス703とを対応付けるSPT121を作成し(S1450)、GPT41のアドレスと対応付けて保持する。 On the other hand, when the corresponding SPT 121 is not found (S1445: No), the hypervisor 20 refers to the GPT 41 and the EPT 111 and creates the SPT 121 that associates the virtual address 701 with the host physical address 703 (S1450). Stored in association with the address.
 なおこのときハイパバイザ20は、参照したGPT41が配置されているホスト物理アドレス703の更新を検出するために、ハイパバイザ20が保持する全てのEPT111及びSPT121について、ホスト物理アドレス703への書き込みをアクセス権706で禁止する。 At this time, the hypervisor 20 detects the update of the host physical address 703 where the referenced GPT 41 is arranged, and writes the access right 706 to the host physical address 703 for all the EPTs 111 and SPTs 121 held by the hypervisor 20. Is prohibited.
 最後にハイパバイザ20は、作成したSPT121のアドレスを物理CPU70のPTアドレスレジスタ73に登録して(S1455)、この仮想PTアドレスレジスタ変更処理を終了する。 Finally, the hypervisor 20 registers the created address of the SPT 121 in the PT address register 73 of the physical CPU 70 (S1455), and ends this virtual PT address register change process.
 第2の実施の形態において、ページ例外処理、EPT例外処理及びタイマ割り込み処理は、第1の実施の形態におけるページ例外処理(図16)、EPT例外処理(図17)及びタイマ割り込み処理(図18)と同様であるためここでの説明は省略する。なおタイマ割り込み処理(図18)について第2の実施の形態では、タイムスライスを使い切った場合にのみ物理CPU70上で稼動するゲストプロセス60の切り替えが生じ、ハイパバイザ20はこれを認識してEPT方式又はSPT方式の適用を判断する。 In the second embodiment, page exception processing, EPT exception processing, and timer interrupt processing are the same as those in the first embodiment (FIG. 16), EPT exception processing (FIG. 17), and timer interrupt processing (FIG. 18). ), The description here is omitted. As for timer interrupt processing (FIG. 18), in the second embodiment, the guest process 60 running on the physical CPU 70 is switched only when the time slice is used up, and the hypervisor 20 recognizes this and recognizes the EPT method or The application of the SPT method is determined.
 図28は、図18のステップS1720において実行される仮想CPU切り替え処理の処理フローを示す。ステップS1800、S1805及びS1810の処理は、第1の実施の形態における仮想CPU切り替え処理(図19)のステップS1800、S1805及びS1810の処理と同様であるためここでの説明は省略する。 FIG. 28 shows a process flow of the virtual CPU switching process executed in step S1720 of FIG. Since the processes in steps S1800, S1805, and S1810 are the same as the processes in steps S1800, S1805, and S1810 of the virtual CPU switching process (FIG. 19) in the first embodiment, a description thereof is omitted here.
 ハイパバイザ20は、切り替え後の仮想CPU32が計測対象の仮想計算機30に所属している場合に限って、性能モニタ機能74が計測しているTLBミス回数及びTLBパージ命令の実行回数をゼロクリアし、次回の計測に備える(S1825)。 The hypervisor 20 clears the TLB miss count and the TLB purge command execution count measured by the performance monitor function 74 to zero only when the switched virtual CPU 32 belongs to the virtual machine 30 to be measured. (S1825).
 次いでハイパバイザ20は、特性計測値表112を参照して、切り替え後の仮想CPU32と関連付けられたゲストプロセス60の特性を判断する(S1830)。 Next, the hypervisor 20 refers to the characteristic measurement value table 112 and determines the characteristic of the guest process 60 associated with the virtual CPU 32 after switching (S1830).
 ハイパバイザ20は、適用方式407がSPT方式であった場合、以下の手順で物理CPU70の設定をSPT方式用に変更する。具体的にハイパバイザ20は、物理CPU70の二重ページング仮想化支援機能を無効化し、ページ例外インタセプトを有効化し、仮想PTアドレスレジスタ33の操作に対するインタセプトを有効化する(S1850)。 When the application method 407 is the SPT method, the hypervisor 20 changes the setting of the physical CPU 70 for the SPT method according to the following procedure. Specifically, the hypervisor 20 invalidates the double paging virtualization support function of the physical CPU 70, validates the page exception intercept, and validates the intercept for the operation of the virtual PT address register 33 (S1850).
 これに対しハイパバイザ20は、適用方式407がEPT方式であった場合、以下の手順で物理CPU70の設定をEPT方式用に変更する。具体的にハイパバイザ20は、物理CPU70の二重ページング仮想化支援機能を有効化し、ページ例外インタセプトを無効化し、仮想PTアドレスレジスタ33の操作に対するインタセプトを無効化する(S1855)。 On the other hand, when the application method 407 is the EPT method, the hypervisor 20 changes the setting of the physical CPU 70 for the EPT method according to the following procedure. Specifically, the hypervisor 20 enables the double paging virtualization support function of the physical CPU 70, invalidates the page exception intercept, and invalidates the intercept for the operation of the virtual PT address register 33 (S1855).
 ステップS1860、S1445、S1450、S1455及びS1480の処理は、第1の実施の形態における仮想CPU切り替え処理(図19)のステップS1860、S1445、S1450、S1455及びS1480の処理と同様であるためここでの説明は省略する。 The processes of steps S1860, S1445, S1450, S1455, and S1480 are the same as the processes of steps S1860, S1445, S1450, S1455, and S1480 of the virtual CPU switching process (FIG. 19) in the first embodiment. Description is omitted.
 また第2の実施の形態において、コンソール入力処理、自己申告受信処理及び特性判断処理は、第1の実施の形態におけるコンソール入力処理(図20)、自己申告受信処理(図21)及び特性判断処理(図22)と同様であるためここでの説明は省略する。 In the second embodiment, the console input process, the self-report reception process and the characteristic determination process are the console input process (FIG. 20), the self-report reception process (FIG. 21) and the characteristic determination process in the first embodiment. Since it is the same as (FIG. 22), description here is abbreviate | omitted.
(2-4)第2の実施の形態による効果
 以上のように第2の実施の形態における物理計算機10によれば、仮想計算機30上のゲストOS40が動作させるゲストプロセス60の集合を仮想CPU32で区別し、ゲストプロセス60の特性をTLBミス回数及びTLBパージ回数で判断するようにしたので、TLBミス回数の多い仮想CPU32上のプログラムに対しては二重ページング仮想化支援機能を無効化するSPT方式を採用してテーブル参照にともなうメモリ性能の低下を防止することができ、一方でTLBパージ回数が多い仮想CPU32上のプログラムには二重ページング仮想化支援機能を有効化するEPT方式を採用してGPT41とSP121とを同期させる処理にともなうメモリ性能の低下を防止することができる。
(2-4) Effects According to Second Embodiment As described above, according to the physical computer 10 in the second embodiment, a set of guest processes 60 operated by the guest OS 40 on the virtual computer 30 is represented by the virtual CPU 32. Since the distinction is made and the characteristics of the guest process 60 are determined by the number of TLB misses and the number of TLB purges, the SPT for disabling the double paging virtualization support function for programs on the virtual CPU 32 with a large number of TLB misses The system can be used to prevent the memory performance from degrading due to the table reference. On the other hand, the program on the virtual CPU 32 with a large number of TLB purges adopts the EPT system that enables the double paging virtualization support function. Accordingly, it is possible to prevent a decrease in memory performance due to the process of synchronizing the GPT 41 and the SP 121.
(3)第3の実施の形態
 第3の実施の形態においては、仮想計算機上のシステムソフトウェアとしてゲストOSが動作し、複数のゲストプロセスに加えてカーネル権限で動作するカーネルプログラムを稼働させる場合に特権レベル毎にプログラムの特性を判断し、判断結果として得られたプログラムの特性に応じて、二重ページング仮想化支援機能を有効化又は無効化する構成について説明する。
(3) Third Embodiment In the third embodiment, a guest OS operates as system software on a virtual machine, and a kernel program that operates with kernel authority is operated in addition to a plurality of guest processes. A configuration for determining the characteristics of a program for each privilege level and enabling or disabling the double paging virtualization support function according to the characteristics of the program obtained as a determination result will be described.
 なお第1の実施の形態と同様の構成については同一の符号を付してその説明を省略し、異なる構成について説明する。 In addition, about the structure similar to 1st Embodiment, the same code | symbol is attached | subjected, the description is abbreviate | omitted, and a different structure is demonstrated.
(3-1)ソフトウェア構成
 図29は、第3の実施の形態における物理計算機10のソフトウェア構成を示す。仮想計算機30上では、システムソフトウェアとしてゲストOS40が稼動する。ゲストOS40は、ゲストプロセス60に加えて、ゲストOS40と同じ権限で動くカーネルプログラム42を稼働させる。
(3-1) Software Configuration FIG. 29 shows a software configuration of the physical computer 10 in the third embodiment. On the virtual machine 30, a guest OS 40 operates as system software. In addition to the guest process 60, the guest OS 40 operates a kernel program 42 that operates with the same authority as the guest OS 40.
 カーネルプログラム42は、例えばIOデバイス80の制御といったハードウェアと密接に結びついたプログラム等が該当する。カーネルプログラム42が使用するメモリは、ゲストOS40が使用するメモリと同様に全てのGPT41に共通のアドレス変換情報を格納する。 The kernel program 42 corresponds to a program closely associated with hardware such as control of the IO device 80, for example. The memory used by the kernel program 42 stores address conversion information common to all the GPTs 41 as with the memory used by the guest OS 40.
 仮想CPUスケジューラ140は、仮想CPU32毎に、最後に観測した特権レベルを格納する特権レベル履歴141を備える。特権レベルとは、ユーザ権限又はカーネル権限の区分である。 The virtual CPU scheduler 140 includes a privilege level history 141 that stores the last observed privilege level for each virtual CPU 32. The privilege level is a classification of user authority or kernel authority.
 プログラム分析部100は、仮想CPU32の特権レベル毎にプログラムの特性を保持する特権レベル別特性表108を備える。特権レベル別特性表108は、プログラムの特性を保持する特性表の一種であり、ここでは仮想計算機30毎に測定したカーネル権限で動作するプログラムの特性を保持する特性計測値表122と、管理者又はゲストプロセス60自身から与えられた特性を保持する特性固定選択表123とから構成される。 The program analysis unit 100 includes a privilege level-specific characteristic table 108 that holds the characteristics of a program for each privilege level of the virtual CPU 32. The privilege level-specific characteristic table 108 is a kind of characteristic table that holds the characteristics of a program. Here, a characteristic measurement value table 122 that holds characteristics of a program that operates with kernel authority measured for each virtual machine 30, and an administrator Or it is comprised from the characteristic fixed selection table 123 holding the characteristic given from guest process 60 itself.
(3-2)テーブル構成
 図30は、仮想計算機30毎に測定したカーネル権限で動作するプログラムの特性を保持する特性計測値表122の論理構成を示す。特性計測値表122には、仮想計算機番号401、TLBパージ回数404、TLBミス回数405及び適用方式407が格納される。
(3-2) Table Configuration FIG. 30 shows a logical configuration of the characteristic measurement value table 122 that holds the characteristics of programs operating with kernel authority measured for each virtual machine 30. The characteristic measurement value table 122 stores a virtual computer number 401, a TLB purge count 404, a TLB miss count 405, and an application method 407.
 図31は、管理者又はゲストプロセス60自身から与えられた特性を保持する特性固定選択表133の論理構成を示す。特性固定選択表133には、仮想計算機番号401毎に、適用方式407が格納される。 FIG. 31 shows a logical configuration of the property fixed selection table 133 that retains properties given by the administrator or the guest process 60 itself. In the characteristic fixed selection table 133, an application method 407 is stored for each virtual machine number 401.
 第3の実施の形態において、モード選択表104、GPT41、EPT111、SPT121及び物理CPU設定管理表131は、第1の実施の形態におけるモード選択表104(図6)、GPT41(図7)、EPT111(図8)、SPT121(図9)及び物理CPU設定管理表131(図10)と同様であるためここでの説明は省略する。 In the third embodiment, the mode selection table 104, GPT41, EPT111, SPT121, and physical CPU setting management table 131 are the mode selection table 104 (FIG. 6), GPT41 (FIG. 7), and EPT111 in the first embodiment. (FIG. 8), SPT 121 (FIG. 9), and physical CPU setting management table 131 (FIG. 10) are the same, and the description thereof is omitted here.
 なおSPT121について、第3の実施の形態ではカーネル権限で動作するプログラムのみにSPT方式を適用するため、GPT41のグローバルフラグ705が0である仮想アドレス701のアクセス権706には、読み/書き/実行不可が格納される。また物理CPU設定管理表131について、第3の実施の形態ではPTアドレスレジスタ操作インタセプトフラグ903は常時0となる。 As for the SPT 121, in the third embodiment, since the SPT method is applied only to programs operating with kernel authority, the access right 706 of the virtual address 701 in which the global flag 705 of the GPT 41 is 0 is read / written / executed. Impossible is stored. As for the physical CPU setting management table 131, the PT address register operation intercept flag 903 is always 0 in the third embodiment.
(3-3)フローチャート
 以下ハイパバイザ20が実行する処理について、フローチャートを参照して説明する。第3の実施の形態において、全体処理、初期化処理及びイベント処理は、第1の実施の形態における全体処理(図11)、初期化処理(図12)及びイベント処理(図13)と同様であるためここでの説明は省略する。また仮想計算機起動処理は、第2の実施の形態における仮想計算機起動処理(図26)と同様であるためここでの説明は省略する。なお第3の実施の形態においてPTアドレスレジスタ操作インタセプトフラグ903は常時0であるため、仮想PTアドレスレジスタ変更処理(図15)は実行されない。
(3-3) Flowchart Hereinafter, processing executed by the hypervisor 20 will be described with reference to a flowchart. In the third embodiment, the overall processing, initialization processing, and event processing are the same as the overall processing (FIG. 11), initialization processing (FIG. 12), and event processing (FIG. 13) in the first embodiment. Since it exists, description here is abbreviate | omitted. The virtual machine startup process is the same as the virtual machine startup process (FIG. 26) in the second embodiment, and a description thereof will be omitted here. In the third embodiment, since the PT address register operation intercept flag 903 is always 0, the virtual PT address register change process (FIG. 15) is not executed.
 図32は、図13のステップS1225において実行されるページ例外処理の処理フローを示す。ハイパバイザ20は、仮想PTアドレスレジスタ33がアドレスを保持しているGPT41を参照し、物理CPU70の検出したページ例外がGP41で禁止されたアクセスか否かを判断する(S1500)。 FIG. 32 shows a processing flow of page exception processing executed in step S1225 of FIG. The hypervisor 20 refers to the GPT 41 in which the virtual PT address register 33 holds the address, and determines whether the page exception detected by the physical CPU 70 is an access prohibited by the GP 41 (S1500).
 ハイパバイザ20は、GPT41で禁止されたアクセスである場合、ゲストOS40にページ例外を伝達して(S1550)、このページ例外処理を終了する。これに対しハイパバイザ20は、GPT41で禁止されたアクセスでない場合、このページ例外がGPT41の更新であるかを判断する(S1510)。 When the access is prohibited by the GPT 41, the hypervisor 20 transmits a page exception to the guest OS 40 (S1550), and ends this page exception processing. On the other hand, if the access is not prohibited by the GPT 41, the hypervisor 20 determines whether this page exception is an update of the GPT 41 (S1510).
 ハイパバイザ20は、GPT41の更新である場合、更新後のGPT41に合わせてSPT121を更新して(S1530)、このページ例外処理を終了する。これに対しハイパバイザ20は、GPT41の更新でない場合、仮想CPU32の現在の特権レベルと特権レベル履歴141との内容を比較して、カーネル権限からユーザ権限に変化したかを判断する(S1560)。 When the hypervisor 20 is updating the GPT 41, the hypervisor 20 updates the SPT 121 in accordance with the updated GPT 41 (S1530), and ends this page exception processing. On the other hand, if the GPT 41 is not updated, the hypervisor 20 compares the contents of the current privilege level of the virtual CPU 32 and the privilege level history 141 to determine whether the kernel authority is changed to the user authority (S1560).
 ハイパバイザ20は、変化が検出された場合、ページ例外処理を終了する。これに対しハイパバイザ20は、変化が検出されない場合、仮想計算機30に未割り当てのメモリを操作した場合の動作をエミュレーションして(S1540)、ページ例外処理を終了する。 The hypervisor 20 ends the page exception process when a change is detected. On the other hand, when no change is detected, the hypervisor 20 emulates an operation when a memory unallocated to the virtual machine 30 is operated (S1540), and ends the page exception processing.
 第3の実施の形態において、EPT例外処理、タイマ割り込み処理及び仮想CPU切り替え処理は、第1の実施の形態におけるEPT例外処理(図17)、タイマ割り込み処理(図18)及び仮想CPU切り替え処理(図19)と同様であるためここでの説明は省略する。 In the third embodiment, the EPT exception processing, timer interrupt processing, and virtual CPU switching processing are the same as the EPT exception processing (FIG. 17), timer interrupt processing (FIG. 18), and virtual CPU switching processing (FIG. 18) in the first embodiment. Since it is the same as FIG. 19), the description here is omitted.
 なお第3の実施の形態における仮想CPU切り替え処理では、ステップS1815の処理において、性能モニタ機能74が計測しているTLBミス回数及びTLBパージ命令の実行回数をゼロクリアして次回の計測に備える点で、第1の実施の形態と異なる。 In the virtual CPU switching process according to the third embodiment, in the process of step S1815, the TLB miss count and the TLB purge command execution count measured by the performance monitor function 74 are cleared to zero to prepare for the next measurement. This is different from the first embodiment.
 また第3の実施の形態において、コンソール入力処理及び自己申告受信処理は、第1の実施の形態におけるコンソール入力処理(図20)及び自己申告受信処理(図21)と同様であるためここでの説明は省略する。 In the third embodiment, the console input process and the self-report receiving process are the same as the console input process (FIG. 20) and the self-report receiving process (FIG. 21) in the first embodiment. Description is omitted.
 図33は、図13のステップS1280において実行される復帰処理の処理フローを示す。ハイパバイザ20は、仮想CPU32の現在の特権レベルと、特権レベル履歴141との内容を比較する(S1900)。 FIG. 33 shows a processing flow of the return processing executed in step S1280 of FIG. The hypervisor 20 compares the current privilege level of the virtual CPU 32 with the contents of the privilege level history 141 (S1900).
 ハイパバイザ20は、両者が不一致の場合に限って、プログラムの切り替えを認識し(S1910)、特権レベルの変化に応じて物理CPU70の設定を変更する(S1920)。その後ハイパバイザ20は、現在の特権レベルを特権レベル履歴141に記録して(S1930)、復帰処理を終了する。 The hypervisor 20 recognizes program switching only when the two do not match (S1910), and changes the setting of the physical CPU 70 in accordance with the change in privilege level (S1920). Thereafter, the hypervisor 20 records the current privilege level in the privilege level history 141 (S1930), and ends the return process.
 図34は、図33のステップS1920において実行される特権レベルに応じた物理CPUの設定変更処理の処理フローを示す。ハイパバイザ20は、モード選択表104を参照して、仮想CPU32が計測対象の仮想計算機30に所属しているかどうかを判断し(S2000)、計測対象の仮想計算機30に所属している場合に限って、現在の特権レベルがカーネル権限であるかを判断する(S2005)。 FIG. 34 shows a processing flow of setting change processing of the physical CPU corresponding to the privilege level executed in step S1920 of FIG. The hypervisor 20 refers to the mode selection table 104 to determine whether or not the virtual CPU 32 belongs to the measurement target virtual computer 30 (S2000), and only when it belongs to the measurement target virtual computer 30. Then, it is determined whether the current privilege level is kernel authority (S2005).
 ハイパバイザ20は、現在の特権レベルがカーネル権限でなければ(S2005:NO)、性能モニタ機能74からカーネル権限で動作していたときのTLBミス回数及びTLBパージ命令の実行回数の特性データを取得し、仮想計算機番号401と関連付けて特性を特性計測値表102のTLBパージ回数404及びTLBミス回数405に格納してプログラムの特性を更新する(S2010)。 If the current privilege level is not the kernel authority (S2005: NO), the hypervisor 20 acquires the characteristic data of the TLB miss count and the TLB purge instruction execution count when operating with the kernel authority from the performance monitor function 74. Then, the characteristic is stored in the TLB purge count 404 and the TLB miss count 405 of the characteristic measurement value table 102 in association with the virtual machine number 401 to update the program characteristics (S2010).
 更にハイパバイザ20は、TLBミス回数405と二重ページング仮想化支援機能のテーブル参照単価とを掛けた値と、TLBパージ回数404とGPT更新単価とを掛けた値とを比較し、前者が大きければSPT方式を適用方式407に格納し、後者が大きければEPT方式を適用方式407に格納する。 Further, the hypervisor 20 compares the value obtained by multiplying the TLB miss count 405 and the table reference unit price of the double paging virtualization support function with the value obtained by multiplying the TLB purge count 404 and the GPT update unit price. The SPT method is stored in the application method 407, and if the latter is larger, the EPT method is stored in the application method 407.
 これに対しハイパバイザ20は、現在の特権レベルがカーネル権限であれば(S2005:YES)、性能モニタ機能74が計測しているTLBミス回数及びTLBパージ命令の実行回数をゼロクリアして次回の計測に備える(S2020)。 On the other hand, if the current privilege level is the kernel authority (S2005: YES), the hypervisor 20 clears the TLB miss count and the TLB purge command execution count measured by the performance monitor function 74 to the next measurement. Prepare (S2020).
 次いでハイパバイザ20は、特性計測値表102を参照し、現在の特権レベルと関連付けられたゲストプログラムの特性を判断する(S2030)。 Next, the hypervisor 20 refers to the characteristic measurement value table 102 and determines the characteristic of the guest program associated with the current privilege level (S2030).
 ハイパバイザ20は、適用方式407がSPT方式である場合、以下の手順で物理CPU70の設定をSPT方式用に変更する。具体的にハイパバイザ20は、物理CPU70の二重ページング仮想化支援機能を無効化してページ例外インタセプトを有効化する(S1435)。ここではカーネルプログラム42にだけSPT方式を適用するため、ハイパバイザはカーネルプログラム42用のSPT121を検索する(S2060)。ステップS1445以降の処理は、図15のステップS1445以降の処理と同様であるためここでの説明は省略する。 When the application method 407 is the SPT method, the hypervisor 20 changes the setting of the physical CPU 70 for the SPT method according to the following procedure. Specifically, the hypervisor 20 invalidates the double paging virtualization support function of the physical CPU 70 and validates the page exception intercept (S1435). Here, since the SPT method is applied only to the kernel program 42, the hypervisor searches for the SPT 121 for the kernel program 42 (S2060). Since the process after step S1445 is the same as the process after step S1445 of FIG. 15, description here is abbreviate | omitted.
 これに対しハイパバイザ20は、適用方式407がEPT方式である場合、図15のステップS1470及びS1480と同様の処理を実行して、物理CPU70の設定をEPT方式用に変更する。 On the other hand, when the application method 407 is the EPT method, the hypervisor 20 executes processing similar to steps S1470 and S1480 in FIG. 15 to change the setting of the physical CPU 70 for the EPT method.
 図35は、図19のステップS1830において実行される特性判断処理の処理フローを示す。ハイパバイザ20は、現在の特権レベルを参照し、カーネル権限で動作しているか否かを判断する(S2360)。ハイパバイザ20は、カーネル権限で動作していない場合、EPT方式が妥当と判断して、EPT方式を採用する(S2350)。これに対しハイパバイザ20は、カーネル権限で動作している場合、第1の実施の形態における特性判断処理(図22)と同様の処理を実行する。 FIG. 35 shows a process flow of the characteristic determination process executed in step S1830 of FIG. The hypervisor 20 refers to the current privilege level and determines whether or not it is operating with kernel authority (S2360). If the hypervisor 20 is not operating with kernel authority, the hypervisor 20 determines that the EPT method is appropriate and adopts the EPT method (S2350). On the other hand, when the hypervisor 20 operates with the kernel authority, the hypervisor 20 executes a process similar to the characteristic determination process (FIG. 22) in the first embodiment.
(3-4)第3の実施の形態による効果
 以上のように第3の実施の形態における物理計算機10によれば、仮想計算機30上のゲストOS40が動作させるカーネルプログラム42をユーザ権限で動作するゲストプロセス60と区別し、カーネルプログラム42の特性をTLBミス回数及びTLBパージ回数で判断するようにしたので、TLBミス回数の多いカーネルプログラム42に対しては二重ページング仮想化支援機能を無効化するSPT方式を採用してテーブル参照にともなうメモリ性能の低下を防止することができ、一方でTLBパージ回数が多いカーネルプログラム42に対しては二重ページング仮想化支援機能を有効化するEPT方式を採用してGPT41とSP121とを同期させる処理にともなうメモリ性能の低下を防止することができる。
(3-4) Effects of the Third Embodiment As described above, according to the physical computer 10 of the third embodiment, the kernel program 42 that is operated by the guest OS 40 on the virtual computer 30 operates with user authority. Distinguishing from the guest process 60, the characteristic of the kernel program 42 is determined by the number of TLB misses and the number of TLB purges. Therefore, the dual paging virtualization support function is disabled for the kernel program 42 having a large number of TLB misses. By adopting the SPT method, it is possible to prevent a decrease in memory performance due to table reference, while for the kernel program 42 having a large number of TLB purges, an EPT method for enabling the double paging virtualization support function is used. Adopted to prevent degradation of memory performance due to the process of synchronizing GPT41 and SP121 can do.
(4)第4の実施の形態
 第4の実施の形態においては、仮想計算機上のシステムソフトウェアとしてLv2仮想計算機を作成する機能を有するゲストOSが動作し、ゲストOSが作成したLv2仮想計算機上ではLv2仮想計算機を制御するLv2ゲストOSが動作し、更に複数のゲストプロセスが稼働する場合にゲストプロセス毎にプログラムの特性を判断し、判断結果として得られたプログラムの特性に応じて、二重ページング仮想化支援機能を有効化又は無効化する構成について説明する。
(4) Fourth Embodiment In the fourth embodiment, a guest OS having a function of creating an Lv2 virtual machine as system software on the virtual machine operates, and on the Lv2 virtual machine created by the guest OS, When the Lv2 guest OS that controls the Lv2 virtual machine is running and multiple guest processes are running, program characteristics are determined for each guest process, and double paging is performed according to the program characteristics obtained as a result of the determination. A configuration for enabling or disabling the virtualization support function will be described.
 なお第1の実施の形態と同様の構成については同一の符号を付してその説明を省略し、異なる構成について説明する。 In addition, about the structure similar to 1st Embodiment, the same code | symbol is attached | subjected, the description is abbreviate | omitted, and a different structure is demonstrated.
(4-1)ハードウェア構成
 図36は、第4の実施の形態における物理計算機10のハードウェア構成を示す。
 物理メモリ90は、ハイパバイザ20をロードして、物理メモリ90の一部を仮想計算機30に分配する。仮想計算機30は、ゲストOS40をロードして動作する。ゲストOS40は、物理メモリ90の一部をLv2仮想計算機45に分配する。Lv2仮想計算機45は、Lv2ゲストOS40及びゲストプロセス60をロードして動作する。
(4-1) Hardware Configuration FIG. 36 shows the hardware configuration of the physical computer 10 in the fourth embodiment.
The physical memory 90 loads the hypervisor 20 and distributes a part of the physical memory 90 to the virtual machines 30. The virtual machine 30 operates by loading the guest OS 40. The guest OS 40 distributes a part of the physical memory 90 to the Lv2 virtual computer 45. The Lv2 virtual computer 45 operates by loading the Lv2 guest OS 40 and the guest process 60.
(4-2)ソフトウェア構成
 図37は、第4の実施の形態における物理計算機10のソフトウェア構成を示す。物理計算機10上では、仮想計算機30を作成するハイパバイザ20が稼動する。仮想計算機30上では、システムソフトウェアとしてゲストOS40が稼動する。ゲストOS40は、Lv2仮想計算機35を作成して、各Lv2仮想計算機45上でLv2ゲストOS50を稼動させる。Lv2ゲストOS50は、更にゲストプロセス60を稼動させる。
(4-2) Software Configuration FIG. 37 shows the software configuration of the physical computer 10 in the fourth embodiment. On the physical computer 10, the hypervisor 20 that creates the virtual computer 30 operates. On the virtual machine 30, a guest OS 40 operates as system software. The guest OS 40 creates an Lv2 virtual computer 35 and operates the Lv2 guest OS 50 on each Lv2 virtual computer 45. The Lv2 guest OS 50 further operates the guest process 60.
 物理計算機10は、物理CPU70及び物理メモリ90を搭載する。同様に仮想計算機30は、ハイパバイザ20によって割り当てられた仮想CPU32及びゲスト物理メモリ31を搭載する。同様にLv2仮想計算機45は、Lv2ゲスト物理メモリ46を搭載する。またゲストプロセス60は、Lv2ゲストOS50によって割り当てられた仮想メモリ61を使用して動作する。 The physical computer 10 includes a physical CPU 70 and a physical memory 90. Similarly, the virtual machine 30 includes a virtual CPU 32 and a guest physical memory 31 allocated by the hypervisor 20. Similarly, the Lv2 virtual computer 45 includes an Lv2 guest physical memory 46. The guest process 60 operates using the virtual memory 61 allocated by the Lv2 guest OS 50.
 Lv2ゲストOS50は、仮想メモリ61とLv2ゲスト物理メモリ46との対応関係を格納するLv2ゲストページテーブル(Lv2GPT)51を作成する。またゲストOS40は、Lv2GPT51を参照して、仮想メモリ61とゲスト物理メモリ31とを対応付けるGPT41を作成し、ゲストプロセス60の動作に合わせて仮想PTアドレスレジスタ33にGPT41のアドレスを格納する。 The Lv2 guest OS 50 creates an Lv2 guest page table (Lv2GPT) 51 that stores the correspondence between the virtual memory 61 and the Lv2 guest physical memory 46. The guest OS 40 creates a GPT 41 that associates the virtual memory 61 with the guest physical memory 31 with reference to the Lv2GPT 51, and stores the address of the GPT 41 in the virtual PT address register 33 in accordance with the operation of the guest process 60.
(4-3)メモリ構成
 図38は、ハイパバイザ20が管理する物理メモリ90のメモリマップを示す。ハイパバイザ20は、物理メモリ90上に自身を配置する領域と、仮想計算機30が使用する領域とを割り当てる。そしてハイパバイザ20は、プログラム分析部100、EPT制御部110、SPT制御部120、方式切替部130及び仮想CPUスケジューラ140を自身に割り当てた領域内に含ませる。
(4-3) Memory Configuration FIG. 38 shows a memory map of the physical memory 90 managed by the hypervisor 20. The hypervisor 20 allocates an area where the hypervisor 20 is arranged on the physical memory 90 and an area used by the virtual machine 30. The hypervisor 20 includes the program analysis unit 100, the EPT control unit 110, the SPT control unit 120, the method switching unit 130, and the virtual CPU scheduler 140 in the area allocated to itself.
 ここでハイパバイザ20は、自身にアドレスAD0~AD1を固定的に割り当てて各モジュールを配置し、仮想計算機30にアドレスAD2~AD3を動的に割り当て、また別の仮想計算機30にアドレスAD4~AD5を動的に割り当てる。ゲストOS40は、各仮想計算機30上に自身を配置する領域と、Lv2ゲストOS50及びゲストプロセス60が使用する領域とを割り当てる。 Here, the hypervisor 20 allocates addresses AD0 to AD1 fixedly and arranges each module, dynamically assigns addresses AD2 to AD3 to the virtual machine 30, and assigns addresses AD4 to AD5 to another virtual machine 30. Assign dynamically. The guest OS 40 allocates an area where the guest OS 40 is arranged on each virtual machine 30 and an area used by the Lv2 guest OS 50 and the guest process 60.
 各テーブル構成及びハイパバイザ20が実行する処理については、第1の実施の形態と同様であるためここでの説明は省略する。なお第4の実施の形態においては、ゲストOS40がゲストプロセス60の動作に合わせてGPT41を切り替える。そのためハイパバイザ20は、第1の実施の形態における仕組みでGPT41の切り替えを認識して性能モニタ機能74を制御することにより、Lv2ゲストOS50上のゲストプロセス60の特性を判断することができる。同様にGPT41の切り替えに合わせてSPT方式又はEPT方式の何れかを選択すれば、ゲストプロセス60の動作に応じて各方式を適用することができる。 Since each table configuration and processing executed by the hypervisor 20 are the same as those in the first embodiment, description thereof is omitted here. In the fourth embodiment, the guest OS 40 switches the GPT 41 in accordance with the operation of the guest process 60. Therefore, the hypervisor 20 can determine the characteristics of the guest process 60 on the Lv2 guest OS 50 by recognizing the switching of the GPT 41 and controlling the performance monitor function 74 by the mechanism in the first embodiment. Similarly, if either the SPT method or the EPT method is selected in accordance with the switching of the GPT 41, each method can be applied according to the operation of the guest process 60.
(4-4)第4の実施の形態による効果
 以上のように第4の実施の形態における物理計算機10によれば、仮想計算機30上のゲストOS40上で動作するLv2ゲストOS50が動作させるゲストプロセス60をGPT41で区別し、ゲストプロセス60の特性をTLBミス回数及びTLBパージ回数で判断するようにしたので、TLBミス回数の多いゲストプロセス60に対しては二重ページング仮想化支援機能を無効化するSPT方式を採用してテーブル参照にともなうメモリ性能の低下を防止することができ、一方でTLBパージ回数が多いゲストプロセス60に対しては二重ページング仮想化支援機能を有効化するEPT方式を採用してGPT41とSP121とを同期させる処理にともなうメモリ性能の低下を防止することができる。
(4-4) Effects of the Fourth Embodiment As described above, according to the physical computer 10 of the fourth embodiment, the guest process operated by the Lv2 guest OS 50 operating on the guest OS 40 on the virtual computer 30 60 is differentiated by GPT41, and the characteristics of the guest process 60 are judged by the number of TLB misses and the number of TLB purges, so the double paging virtualization support function is disabled for the guest process 60 with many TLB misses By adopting the SPT method, it is possible to prevent the memory performance from being lowered due to the table reference. On the other hand, for the guest process 60 having a large number of TLB purges, the EPT method for enabling the double paging virtualization support function is used. Adopting it to prevent degradation of memory performance due to the process of synchronizing GPT41 and SP121 wear.
10  物理計算機
20  ハイパバイザ
30  仮想計算機
40  ゲストOS
41  GPT(ゲストページテーブル)
45  Lv2仮想計算機
50  Lv2ゲストOS
51  Lv2GPT
60  ゲストプロセス
70  物理CPU
80  IOデバイス
90  物理メモリ
95  コンソール
100 プログラム分析部
110 EPT制御部
111 EPT(Extended Page Table)
120 SPT制御部
121 SPT(シャドウページテーブル)
130 方式切替部
10 Physical computer 20 Hypervisor 30 Virtual computer 40 Guest OS
41 GPT (Guest Page Table)
45 Lv2 virtual machine 50 Lv2 guest OS
51 Lv2GPT
60 guest process 70 physical CPU
80 IO device 90 Physical memory 95 Console 100 Program analysis unit 110 EPT control unit 111 EPT (Extended Page Table)
120 SPT controller 121 SPT (shadow page table)
130 Method switching part

Claims (14)

  1.  物理メモリ及び物理CPUを搭載する計算機において、
     前記物理メモリは、1つ以上の仮想計算機と、各仮想計算機上のゲストOSを稼働させるハイパバイザとを備え、
     前記物理CPUは、前記ゲストOS上で稼働するプログラムに割り当てられる仮想メモリと、前記仮想計算機に割り当てられるゲスト物理メモリと、前記物理メモリとの間におけるアドレス変換を2つのテーブルを用いて行う二重ページング仮想化支援機能を備え、
     前記ハイパバイザは、
     前記ゲストOS上で稼働するプログラムを認識するプログラム分析部と、
     前記ゲストOS上で稼働するプログラムの特性を保持する特性表と、
     前記ゲストOS上で稼働するプログラムの特性に応じて、前記二重ページング仮想化支援機能を有効化又は無効化する方式切替部とを備える
     ことを特徴とする計算機。
    In computers equipped with physical memory and physical CPU,
    The physical memory includes one or more virtual machines and a hypervisor that runs a guest OS on each virtual machine,
    The physical CPU uses two tables to perform address conversion between a virtual memory allocated to a program running on the guest OS, a guest physical memory allocated to the virtual machine, and the physical memory. It has a paging virtualization support function,
    The hypervisor is
    A program analysis unit for recognizing a program running on the guest OS;
    A characteristic table that holds characteristics of a program running on the guest OS;
    A computer comprising: a method switching unit that enables or disables the double paging virtualization support function according to characteristics of a program running on the guest OS.
  2.  前記仮想メモリには第1のアドレスが付与されており、
     前記ゲスト物理メモリには第2のアドレスが付与されており、
     前記物理メモリには第3のアドレスが付与されており、
     前記ハイパバイザは、
     前記第1のアドレス及び前記第2のアドレスを対応付ける第1のテーブルと、前記第2のアドレス及び前記第3のアドレスを対応付ける第2のテーブルとを1つにまとめて、前記第1のアドレス及び前記第3のアドレスを対応付ける第3のテーブルを作成するSPT制御部を備え、
     前記方式切替部は、
     前記ゲストOS上で稼働するプログラムの特性に応じて、前記物理CPUに前記第1のテーブル及び前記第2のテーブルを登録し、前記第1のテーブル及び前記第2のテーブルの両方を参照してアドレス変換を行うことで前記二重ページング仮想化支援機能を有効化するか、或いは、前記物理CPUに前記第3のテーブルを登録し、前記第3のテーブルを参照してアドレス変換を行うことで前記二重ページング仮想化支援機能を無効化するかの何れか一方を選択して、前記二重ページング仮想化支援機能を有効化又は無効化する
     ことを特徴とする請求項1に記載の計算機。
    The virtual memory is given a first address,
    The guest physical memory is given a second address,
    The physical memory is given a third address,
    The hypervisor is
    The first table associating the first address and the second address and the second table associating the second address and the third address are combined into one, and the first address and An SPT control unit for creating a third table for associating the third address;
    The method switching unit is
    According to the characteristics of the program running on the guest OS, register the first table and the second table in the physical CPU, and refer to both the first table and the second table. By enabling the double paging virtualization support function by performing address conversion, or by registering the third table in the physical CPU and performing address conversion by referring to the third table The computer according to claim 1, wherein either one of the double paging virtualization support functions is disabled and the double paging virtualization support function is enabled or disabled.
  3.  前記特性表は、
     前記第1のテーブルのアドレス毎に、前記ゲストOS上で稼働するプログラムの特性を保持するGPT別特性表である
     ことを特徴とする請求項2に記載の計算機。
    The characteristic table is
    The computer according to claim 2, wherein the computer is a GPT-specific characteristic table that holds characteristics of a program running on the guest OS for each address of the first table.
  4.  前記特性表は、
     前記仮想計算機が備える複数の仮想CPU毎に、前記ゲストOS上で稼働するプログラムの特性を保持する仮想CPU別特性表である
     ことを特徴とする請求項1に記載の計算機。
    The characteristic table is
    2. The computer according to claim 1, wherein each of the plurality of virtual CPUs included in the virtual computer is a virtual CPU-specific characteristic table that holds characteristics of a program running on the guest OS.
  5.  前記特性表は、
     前記仮想計算機に割り当てられた仮想CPUの特権レベルに対して、前記ゲストOS上で稼働するプログラムの特性を保持する特権レベル別特性表である
     ことを特徴とする請求項1に記載の計算機。
    The characteristic table is
    2. The computer according to claim 1, wherein the computer is a privilege level-specific characteristic table that retains characteristics of a program running on the guest OS with respect to a privilege level of a virtual CPU assigned to the virtual machine.
  6.  前記特性表は、
     前記プログラムから申告されたプログラムの特性又は外部端末から入力された前記プログラムの特性を保持する特性固定選択表である
     ことを特徴とする請求項1に記載の計算機。
    The characteristic table is
    The computer according to claim 1, wherein the computer is a characteristic fixed selection table that holds the characteristics of the program declared from the program or the characteristics of the program input from an external terminal.
  7.  前記プログラムの特性は、
     前記第1及び前記第2のテーブルの参照回数と、前記第1のテーブルの更新を通知する命令の実行回数とを含む
     ことを特徴とする請求項2に記載の計算機。
    The characteristics of the program are:
    The computer according to claim 2, comprising: a reference count of the first and second tables; and an execution count of an instruction for notifying update of the first table.
  8.  物理メモリ及び物理CPUを搭載する計算機のアドレス変換方法において、
     前記物理メモリは、1つ以上の仮想計算機と、各仮想計算機上のゲストOSを稼働させるハイパバイザとを備え、
     前記物理CPUは、前記ゲストOS上で稼働するプログラムに割り当てられる仮想メモリと、前記仮想計算機に割り当てられるゲスト物理メモリと、前記物理メモリとの間におけるアドレス変換を2つのテーブルを用いて行う二重ページング仮想化支援機能を備え、
     前記ハイパバイザが、
     前記ゲストOS上で稼働するプログラムを認識する第1のステップと、
     前記ゲストOS上で稼働するプログラムの特性を保持する第2のステップと、
     前記ゲストOS上で稼働するプログラムの特性に応じて、前記二重ページング仮想化支援機能を有効化又は無効化する第3のステップとを備える
     ことを特徴とするアドレス変換方法。
    In an address conversion method for a computer equipped with a physical memory and a physical CPU,
    The physical memory includes one or more virtual machines and a hypervisor that runs a guest OS on each virtual machine,
    The physical CPU uses two tables to perform address conversion between a virtual memory allocated to a program running on the guest OS, a guest physical memory allocated to the virtual machine, and the physical memory. It has a paging virtualization support function,
    The hypervisor is
    A first step of recognizing a program running on the guest OS;
    A second step of retaining the characteristics of a program running on the guest OS;
    An address conversion method comprising: a third step of enabling or disabling the double paging virtualization support function according to the characteristics of a program running on the guest OS.
  9.  前記仮想メモリには第1のアドレスが付与されており、
     前記ゲスト物理メモリには第2のアドレスが付与されており、
     前記物理メモリには第3のアドレスが付与されており、
     前記ハイパバイザが、
     前記第1のアドレス及び前記第2のアドレスを対応付ける第1のテーブルと、前記第2のアドレス及び前記第3のアドレスを対応付ける第2のテーブルとを1つにまとめて、前記第1のアドレス及び前記第3のアドレスを対応付ける第3のテーブルを作成する第4のステップを備え、
     前記第3のステップにおいて、
     前記ハイパバイザは、前記ゲストOS上で稼働するプログラムの特性に応じて、前記物理CPUに前記第1のテーブル及び前記第2のテーブルを登録し、前記第1のテーブル及び前記第2のテーブルの両方を参照してアドレス変換を行うことで前記二重ページング仮想化支援機能を有効化するか、或いは、前記物理CPUに前記第3のテーブルを登録し、前記第3のテーブルを参照してアドレス変換を行うことで前記二重ページング仮想化支援機能を無効化するかの何れか一方を選択して、前記二重ページング仮想化支援機能を有効化又は無効化する
     ことを特徴とする請求項8に記載のアドレス変換方法。
    The virtual memory is given a first address,
    The guest physical memory is given a second address,
    The physical memory is given a third address,
    The hypervisor is
    The first table associating the first address and the second address and the second table associating the second address and the third address are combined into one, and the first address and A fourth step of creating a third table for associating the third address;
    In the third step,
    The hypervisor registers the first table and the second table in the physical CPU according to the characteristics of the program running on the guest OS, and both the first table and the second table are registered. The double paging virtualization support function is validated by referring to the address, or the third table is registered in the physical CPU, and the address conversion is performed by referring to the third table. 9. The method of enabling or disabling the double paging virtualization support function by selecting any one of disabling the double paging virtualization support function by performing The address conversion method described.
  10.  前記第2のステップにおいて、
     前記ハイパバイザは、前記第1のテーブルのアドレス毎に、前記ゲストOS上で稼働するプログラムの特性を保持する
     ことを特徴とする請求項9に記載のアドレス変換方法。
    In the second step,
    The address conversion method according to claim 9, wherein the hypervisor retains characteristics of a program running on the guest OS for each address of the first table.
  11.  前記第2のステップにおいて、
     前記ハイパバイザは、前記仮想計算機が備える複数の仮想CPU毎に、前記ゲストOS上で稼働するプログラムの特性を保持する
     ことを特徴とする請求項8に記載のアドレス変換方法。
    In the second step,
    The address conversion method according to claim 8, wherein the hypervisor holds characteristics of a program running on the guest OS for each of a plurality of virtual CPUs included in the virtual machine.
  12.  前記第2のステップにおいて、
     前記ハイパバイザは、前記仮想計算機に割り当てられた仮想CPUの特権レベルに対して、前記ゲストOS上で稼働するプログラムの特性を保持する
     ことを特徴とする請求項8に記載のアドレス変換方法。
    In the second step,
    The address conversion method according to claim 8, wherein the hypervisor retains characteristics of a program running on the guest OS with respect to a privilege level of a virtual CPU assigned to the virtual machine.
  13.  前記第2のステップにおいて、
     前記ハイパバイザは、前記プログラムから申告されたプログラムの特性又は外部端末から入力された前記プログラムの特性を保持する
     ことを特徴とする請求項8に記載のアドレス変換方法。
    In the second step,
    The address conversion method according to claim 8, wherein the hypervisor retains the characteristics of a program declared from the program or the characteristics of the program input from an external terminal.
  14.  前記プログラムの特性は、
     前記第1及び前記第2のテーブルの参照回数と、前記第1のテーブルの更新を通知する命令の実行回数とを含む
     ことを特徴とする請求項9に記載のアドレス変換方法。
    The characteristics of the program are:
    The address conversion method according to claim 9, further comprising: a reference count of the first table and the second table; and an execution count of an instruction for notifying update of the first table.
PCT/JP2014/058566 2014-03-26 2014-03-26 Computer, and address conversion method WO2015145620A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/058566 WO2015145620A1 (en) 2014-03-26 2014-03-26 Computer, and address conversion method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2014/058566 WO2015145620A1 (en) 2014-03-26 2014-03-26 Computer, and address conversion method

Publications (1)

Publication Number Publication Date
WO2015145620A1 true WO2015145620A1 (en) 2015-10-01

Family

ID=54194218

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2014/058566 WO2015145620A1 (en) 2014-03-26 2014-03-26 Computer, and address conversion method

Country Status (1)

Country Link
WO (1) WO2015145620A1 (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10162764B2 (en) 2016-07-18 2018-12-25 International Business Machines Corporation Marking page table/page status table entries to indicate memory used to back address translation structures
US10169243B2 (en) 2016-07-18 2019-01-01 International Business Machines Corporation Reducing over-purging of structures associated with address translation
US10168902B2 (en) 2016-07-18 2019-01-01 International Business Machines Corporation Reducing purging of structures associated with address translation
US10176111B2 (en) 2016-07-18 2019-01-08 International Business Machines Corporation Host page management using active guest page table indicators
US10176110B2 (en) 2016-07-18 2019-01-08 International Business Machines Corporation Marking storage keys to indicate memory used to back address translation structures
US10176006B2 (en) 2016-07-18 2019-01-08 International Business Machines Corporation Delaying purging of structures associated with address translation
US10180910B2 (en) 2016-07-18 2019-01-15 International Business Machines Corporation Host-based resetting of active use of guest page table indicators
US10223281B2 (en) 2016-07-18 2019-03-05 International Business Machines Corporation Increasing the scope of local purges of structures associated with address translation
US10241924B2 (en) 2016-07-18 2019-03-26 International Business Machines Corporation Reducing over-purging of structures associated with address translation using an array of tags
US10248573B2 (en) 2016-07-18 2019-04-02 International Business Machines Corporation Managing memory used to back address translation structures
US10282305B2 (en) 2016-07-18 2019-05-07 International Business Machines Corporation Selective purging of entries of structures associated with address translation in a virtualized environment
US10802986B2 (en) 2016-07-18 2020-10-13 International Business Machines Corporation Marking to indicate memory used to back address translation structures

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006196005A (en) * 2005-01-14 2006-07-27 Intel Corp Virtualization of physical memory in virtual machine system
US20070005870A1 (en) * 2005-06-29 2007-01-04 Gilbert Neiger Virtualizing memory type
JP2007188121A (en) * 2006-01-11 2007-07-26 Hitachi Ltd Method for speeding up change in page table address on virtual machine

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006196005A (en) * 2005-01-14 2006-07-27 Intel Corp Virtualization of physical memory in virtual machine system
US20070005870A1 (en) * 2005-06-29 2007-01-04 Gilbert Neiger Virtualizing memory type
JP2007188121A (en) * 2006-01-11 2007-07-26 Hitachi Ltd Method for speeding up change in page table address on virtual machine

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10162764B2 (en) 2016-07-18 2018-12-25 International Business Machines Corporation Marking page table/page status table entries to indicate memory used to back address translation structures
US10169243B2 (en) 2016-07-18 2019-01-01 International Business Machines Corporation Reducing over-purging of structures associated with address translation
US10168902B2 (en) 2016-07-18 2019-01-01 International Business Machines Corporation Reducing purging of structures associated with address translation
US10176111B2 (en) 2016-07-18 2019-01-08 International Business Machines Corporation Host page management using active guest page table indicators
US10176110B2 (en) 2016-07-18 2019-01-08 International Business Machines Corporation Marking storage keys to indicate memory used to back address translation structures
US10176006B2 (en) 2016-07-18 2019-01-08 International Business Machines Corporation Delaying purging of structures associated with address translation
US10180910B2 (en) 2016-07-18 2019-01-15 International Business Machines Corporation Host-based resetting of active use of guest page table indicators
US10180909B2 (en) 2016-07-18 2019-01-15 International Business Machines Corporation Host-based resetting of active use of guest page table indicators
US10223281B2 (en) 2016-07-18 2019-03-05 International Business Machines Corporation Increasing the scope of local purges of structures associated with address translation
US10241924B2 (en) 2016-07-18 2019-03-26 International Business Machines Corporation Reducing over-purging of structures associated with address translation using an array of tags
US10248573B2 (en) 2016-07-18 2019-04-02 International Business Machines Corporation Managing memory used to back address translation structures
US10282305B2 (en) 2016-07-18 2019-05-07 International Business Machines Corporation Selective purging of entries of structures associated with address translation in a virtualized environment
US10445248B2 (en) 2016-07-18 2019-10-15 International Business Machines Corporation Host page management using active guest page table indicators
US10515020B2 (en) 2016-07-18 2019-12-24 International Business Machines Corporation Marking storage keys to indicate memory used to back address translation structures
US10572392B2 (en) 2016-07-18 2020-02-25 International Business Machines Corporation Increasing the scope of local purges of structures associated with address translation
US10802986B2 (en) 2016-07-18 2020-10-13 International Business Machines Corporation Marking to indicate memory used to back address translation structures
US11016907B2 (en) 2016-07-18 2021-05-25 International Business Machines Corporation Increasing the scope of local purges of structures associated with address translation

Similar Documents

Publication Publication Date Title
WO2015145620A1 (en) Computer, and address conversion method
JP5493125B2 (en) Virtualization method and computer
US8793428B2 (en) System and method to reduce trace faults in software MMU virtualization
JP6110946B2 (en) Virtual I / O memory management unit in the guest virtual machine
US8380939B2 (en) System and method for maintaining memory page sharing in a virtual environment
WO2017092219A1 (en) Method and device for generating virtual machine snapshot
US8086823B2 (en) Method for speeding up page table address update on virtual machine
JP5541036B2 (en) Memory access control program, memory access control method, and information processing apparatus
RU2723668C1 (en) Event filtering for security applications of virtual machines
JP5574230B2 (en) Fault handling method and computer
US20170357592A1 (en) Enhanced-security page sharing in a virtualized computer system
US20090187726A1 (en) Alternate Address Space to Permit Virtual Machine Monitor Access to Guest Virtual Address Space
Pan et al. CompSC: Live migration with pass-through devices
JP5951879B2 (en) Report malicious activity on the operating system
EP2962240A1 (en) Performing security operations using binary translation
JP6530723B2 (en) System and method for facilitating joint operation of multiple hypervisors in a computer system
JP6273034B2 (en) Virtualization computing apparatus and method
US10445247B2 (en) Switching between single-level and two-level page table translations
JP2008305106A (en) Control program for virtual computer and virtual computer system
Omote et al. Improving agility and elasticity in bare-metal clouds
JP2011008559A (en) Virtual machine system and control method thereof
TW201523250A (en) Solid state drives that cache boot data
Kourai et al. Efficient VM introspection in KVM and performance comparison with Xen
US10990436B2 (en) System and method to handle I/O page faults in an I/O memory management unit
KR20110019750A (en) Device emulation support within a host data processing apparatus

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

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP