DYNAMIC ADDRESS TRANSLATION FOR A VIRTUAL MACHINE

The dynamic shadow address translation table managed by an assistant control unit addresses CPU interruptions in virtual machines, improving performance and resource management by automating translations without CPU intervention.

DE112018006068B4Active Publication Date: 2024-11-14CAPROCK INTEGRATED TECHNOLOGIES POLAND SP ZOO
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
DE112018006068
Authority / Receiving Office
DE · DE
Patent Type
Patents
Current Assignee / Owner
Priority Date
2017-11-28
Filing Date
2018-11-21
Publication Date
2024-11-14
Estimated Expiration
2038-11-21

AI Technical Summary

Technical Problem

Existing virtual machine technologies experience performance bottlenecks due to frequent CPU interruptions for dynamic address translation, particularly during I/O operations, leading to increased load and inefficiency.

Method used

Implement a dynamic shadow address translation table managed by an assistant control unit, allowing memory access without CPU intervention, using a chain of pre-allocated memory frames and minimizing state transitions.

Benefits of technology

Reduces CPU load by automating dynamic address translation, enhancing performance and resource management in virtual machines, especially during bulk data exchanges.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

Computer-implemented procedure, comprising: Erlangen, in response to a request to construct a dynamic shadow address translation table, of a memory section coming from a memory space, wherein the memory space is allocated to at least one guest operating system, and wherein the dynamic shadow address translation table has a mapping between at least one logical guest memory address and at least one physical host memory address; Building the dynamic shadow address translation table; wherein building the dynamic shadow address translation table exhibits: Obtaining a logical guest memory address to be translated from the request to build the dynamic shadow address translation table; Obtaining a dynamic guest address translation table including one or more mappings between one or more logical guest memory addresses and one or more physical guest memory addresses from a guest operating system; Searching the dynamic guest address translation table using the logical guest memory address to obtain a physical guest memory address; Obtaining a logical host memory address based on the physical guest memory address; Obtaining a dynamic host address translation table including one or more mappings between one or more logical host memory addresses and one or more physical host memory addresses from a host operating system; Searching the dynamic host address translation table using the logical host memory address to obtain a physical host memory address; and Storing a mapping between the logical guest memory address and the physical host memory address in the dynamic shadow address translation table, and storing the dynamic shadow address translation table in the memory section.
Need to check novelty before this filing date? Find Prior Art

Description

BACKGROUND

[0001] Embodiments of the present disclosure relate generally to computer technologies, and more particularly to dynamic address translation for a virtual machine.

[0002] Virtual machine technology is widely used in computer systems, especially enterprise-class servers. In such a system, multiple virtual machines (i.e., guest operating systems) can run independently and concurrently on the same hardware structure under the management of a hypervisor, which can be an application within a host operating system or the host operating system itself. When an application within a virtual machine requests access to a section of system memory, dynamic address translation from a logical guest memory address to a physical host memory address will be required.

[0003] A published document already exists in this context. The document US 2008 / 0 005 447 A1 describes dynamic mapping of a guest address in a virtual machine monitor (VMM, hypervisor). The virtualization system comprises a guest machine, a host machine, and a VMM. The host machine further comprises a processor containing hardware support for virtualization, wherein the hardware support for virtualization serves, at least in part, to control the operation of the guest machine. The VMM dynamically installs a mapping for a guest machine, which the VMM is to access, in a page table of the VMM before the VMM accesses the physical guest address. Despite this improvement already made, further improvements and thus speed improvements in the operation of virtual machines are possible. This is understood to be the task for the concept presented here. SUMMARY

[0004] The stated object is solved by the subject matter of the independent claims. Further embodiments are described by the dependent claims. A first aspect of embodiments of the present disclosure provides a method for dynamic address translation. The method comprises obtaining a memory section from a memory space in response to a request to build a dynamic shadow address translation table, wherein the memory space is allocated for at least one guest operating system, and wherein the dynamic shadow address translation table comprises a mapping between at least one logical guest memory address and at least one physical host memory address. The method further comprises building the dynamic shadow address translation table and storing the dynamic shadow address translation table in the memory section.

[0005] A second aspect of embodiments of the present disclosure provides a computer system for dynamic address translation. The computer system comprises: at least one processor, an assistant controller for dynamic address translation, and a memory connected to the at least one processor and the assistant controller. A set of computer program instructions is stored in the memory and executed by the at least one processor and the assistant controller to perform a method.The method comprises obtaining, by the at least one processor in response to a request to build a dynamic shadow address translation table, a memory section from a memory space, wherein the memory space is allocated for at least one guest operating system, and wherein the dynamic shadow address translation table comprises a mapping between at least one logical guest memory address and at least one physical host memory address. The method further comprises, by the assistant controller, building the dynamic shadow address translation table and, by the assistant controller, storing the dynamic shadow address translation table in the memory section.

[0006] A third aspect of embodiments of the present disclosure provides a computer program product for dynamic address translation. The computer program product comprises a computer-readable data storage medium having program instructions embodied thereon. The computer-readable data storage medium is not a transient signal per se. The program instructions are executable by an assistant controller to perform a method. The method comprises obtaining a memory portion from a memory space in response to a request to build a dynamic shadow address translation table, wherein the memory space is allocated for at least one guest operating system, and wherein the dynamic shadow address translation table comprises a mapping between at least one logical guest memory address and at least one physical host memory address.The method further comprises constructing the dynamic shadow address translation table and storing the dynamic shadow address translation table in the storage section. BRIEF DESCRIPTION OF THE MULTIPLE DRAWING VIEWS

[0007] The above and other objects, features, and advantages of the present disclosure will become more apparent by describing some embodiments of the present disclosure in more detail in the accompanying drawings, wherein the same reference generally refers to the same components in the embodiments of the present disclosure. Fig. 1 is a block diagram illustrating an exemplary computer system applicable to practicing embodiments of the present invention. Fig. 2 is a block diagram showing a basic structure of a virtual machine system implemented in the computer system as shown in FIG. 1 according to an embodiment of the present disclosure. Fig. 1 is executable. Fig. 3 is an exemplary diagram illustrating how an application in a virtual machine accesses physical memory in the hardware platform, according to one embodiment of the present disclosure. Fig. 4 is a flowchart illustrating a method for dynamic address translation for a virtual machine according to one embodiment of the present disclosure. Fig. 5 is a diagram illustrating a chain of a plurality of memory frames generated in step S401 in accordance with an embodiment of the present disclosure. Fig. 4 can be assigned. Fig. 6 is a diagram illustrating acquiring a free memory frame from the chain, according to one embodiment of the present disclosure. Fig. 7 is a flowchart of the process of building the dynamic shadow address translation table according to an embodiment of the present disclosure. Fig. 8 is a diagram illustrating data transfer when constructing the dynamic shadow address translation table, according to one embodiment of the present disclosure. Fig. 9 is a block diagram illustrating another example computer system applicable to implementing some embodiments of the present disclosure, in accordance with an embodiment of the present disclosure. Fig. 10 is a diagram illustrating cooperation between a CPU and an assistance control unit according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0008] Some preferred embodiments will be described in more detail with reference to the accompanying drawings, which illustrate the preferred embodiments of the present disclosure. However, the present disclosure may be implemented in a variety of ways and should therefore not be considered limited to the embodiments disclosed herein.

[0009] Referring to Fig. 1, in which an exemplary computer system / server 12 applicable to practicing the embodiments of the present disclosure is shown. Fig. 1 is also suitable for illustrating an illustrative example of a portable electronic device, such as a data transmission device, applicable to implementing the embodiments of the present disclosure. Computer system / server 12 is merely illustrative and is not intended to imply any limitation on the scope of use or functionality of embodiments of the disclosure described herein.

[0010] As in Fig. 1, the computer system / server 12 is shown in the form of a general-purpose data processing unit. The components of the computer system / server 12 may include, but are not limited to, one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components, including the system memory 28, to the processor 16.

[0011] Bus 18 represents one or more of any of various types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example and without limitation, such architectures may include an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0012] The computer system / server 12 typically includes a variety of computer-readable media. Such media may be any available media accessible by the computer system / server 12 and includes both volatile and non-volatile, removable and non-removable media.

[0013] System memory 28 may include computer system-readable media in the form of volatile memory, such as random access memory (RAM) 30, and / or cache memory 32. Computer system / server 12 may further include other removable / non-removable, volatile / non-volatile computer system data storage media. For example only, a data storage system 34 may be provided for reading from and writing to a non-volatile, non-removable magnetic medium (not shown and commonly referred to as a "hard disk drive"). Although not shown, a magnetic disk drive for reading from and writing to a non-volatile, removable magnetic disk (e.g., a "floppy disk") or an optical disk drive for reading from or writing to a non-volatile, removable optical disk, such as a CD-ROM, DVD-ROM, or other optical medium, may also be provided.In such examples, each may be connected to bus 18 through one or more data media interfaces. As further illustrated and described below, memory 28 may include at least one program product containing a set (e.g., at least one) of program modules configured to perform the functions of embodiments of the disclosure.

[0014] A program / utility 40 having a set (at least one) of program modules 42 may be stored in memory 28, by way of example and without limitation, as an operating system, one or more application programs, other program modules, and program data. Each of the operating system, the one or more application programs, the other program modules, and the program data, or any combination thereof, may comprise an implementation of a network environment. The program modules 42 generally perform the functions and / or procedures of embodiments of the disclosure described herein.

[0015] The computer system / server 12 may also communicate with one or more external devices 14, such as a keyboard, a pointing device, a display 24, etc.; one or more devices that enable a user to interact with the computer system / server 12; and / or any devices (e.g., network card, modem, etc.) that enable the computer system / server 12 to communicate with one or more other computing devices. Such communication may occur via input / output (I / O) interfaces 22. Furthermore, the computer system / server 12 may communicate with one or more networks, such as a local area network (LAN), a general purpose wide area network (WAN), and / or a public network (e.g., the Internet), via a network adapter 20.As illustrated, network adapter 20 communicates with the other components of computer system / server 12 via bus 18. It should be understood that other hardware and / or software components may be used in conjunction with computer system / server 12, even if not shown. Examples include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archiving data storage systems, etc.

[0016] Fig. 2 is a block diagram showing a basic structure of a virtual machine system implemented in a computer system as in FIG. 1 according to an embodiment of the present disclosure. Fig. 1 is executable. As in Fig. 2, a plurality of virtual machines 202, 203, 204 run independently and simultaneously on the same hardware platform of the computer system / server 12 under the management of a hypervisor 201.

[0017] Hardware resources, such as processors, memory, or data storage disks in the computer system / server 12, can be dynamically or statically allocated to different virtual machines. Typically, at least during a certain operating period, the hardware resources allocated to a virtual machine, such as virtual machine 202, are independent, and access to these allocated hardware resources is not affected by another virtual machine, such as virtual machine 203. In particular, the user of virtual machine 202 is not affected by the user of virtual machine 203. The utilization of hardware resources in the computer system, particularly in a large computer system, such as an enterprise-class server, can be greatly improved.User security management can also be precisely implemented by assigning different permissions to each virtual machine.

[0018] Fig. 3 is an exemplary diagram illustrating how an application in a virtual machine accesses physical memory in the hardware platform, according to one embodiment of the present disclosure. As shown in Fig. 3, a user application 301 requests access to memory having a logical guest memory address 304. In response to this request, the guest operating system 302 translates the logical guest memory address 304 into a physical guest memory address 305. The translation may be implemented by searching a dynamic guest address translation table, which includes a mapping between a logical guest memory address and a physical guest memory address. The physical guest memory address 305 is transmitted to the hypervisor 201. For example, the hypervisor 201 may be a management application running under a host operating system or may be the host operating system itself. The hypervisor 201 obtains a logical host memory address 306 based on the physical guest memory address 305. For example, the physical guest memory address 305 may be the logical host memory address 306 itself.Specifically, a physical guest memory address 305 can be directly used as a logical host memory address 306 per se. The hypervisor 201 searches a dynamic address translation table, which includes a mapping between a logical host memory address 306 and a physical host memory address 307, to translate the logical host memory address 306 into a physical host memory address 307. The physical host memory address 307 can be used to access the physical host memory 303 in the memory 28 of the computer system / server 12. Then, feedback messages such as 308, 309, and 310, including data or access results, are received by the hypervisor 201 and then output to the guest operating system 302 and the user application 301 in sequence.

[0019] During these memory address translations, the CPU must be interrupted and switches between a guest state for running the guest operating system and a host / kernel state for running the host. This CPU interruption is very time-consuming. Furthermore, since applications typically serve multiple requests in a short period of time, the aforementioned process is repeated repeatedly, increasing the load on the CPU.

[0020] During a massive data exchange I / O operation, the user application may request an I / O buffer for direct memory access (DMA). A dynamic shadow address translation table, including a mapping between the I / O buffer's logical guest memory addresses 304 and the corresponding physical host memory addresses 307, may be constructed and sent to a DMA controller. The DMA controller may directly access the physical host memory using the dynamic shadow address translation table to free the central processing unit (CPU), which may be a processor in the processing unit.

[0021] With this solution, the user application 301 can request the CPU to build the dynamic shadow address translation table before the I / O operation. Furthermore, a section of the system memory to be accessed can be pinned to avoid switching from memory to disk. Then, the DMA controller can access the physical host memory during the I / O operation. After the I / O operation is complete, the user application 301 can request the CPU to clear / unregister the dynamic shadow address translation table. Translations from a plurality of logical guest memory addresses to a plurality of physical host memory addresses are completed by the CPU concurrently. Thus, the CPU does not need to be interrupted during the I / O operation.

[0022] However, each time the user application requests the creation / registration, deletion / unregistration of a dynamic shadow address translation table, the CPU is interrupted to transition from the guest state to the host / kernel state. These state changes and their associated context still require many CPU cycles, especially if a user application in a guest operating system frequently requests the dynamic shadow address translation table to be updated after each I / O operation.

[0023] Fig. 4 is a flowchart illustrating a method for dynamic address translation for a virtual machine according to one embodiment of the present disclosure. As shown in Fig. 4, in step S401, a memory space is allocated for at least one guest operating system. In step S402, in response to a request to build a dynamic shadow address translation table, a memory slice is obtained from the memory space. This can be done without transitioning to a host state. The dynamic shadow address translation table includes a mapping between at least one logical guest memory address and at least one physical host memory address. In step S403, the dynamic shadow address translation table is built. In step S404, the dynamic shadow address translation table is stored in the memory slice.The allocated memory space can be accessed by any processor or control unit other than the CPU, such as an assistant control unit, for the purpose of building or accessing the dynamic shadow address translation table without entering a host state. Thus, the CPU does not need to be interrupted to build or access the dynamic shadow address translation table, and the load on the CPU can be further reduced.

[0024] The method for dynamic address translation for a virtual machine may further include step S405. In step S405, in response to a request to clear the dynamic shadow address translation table, the memory portion occupied by the dynamic shadow address translation table is returned to the memory space. Returning the occupied portion of the memory space will improve the utilization efficiency of the memory space.

[0025] In an exemplary computer system, the physical host memory 303 is divided into multiple fixed-size memory frames for ease of management. Accordingly, in embodiments of the present disclosure, the memory space may comprise a chain of a plurality of memory frames. When a memory section is acquired from the memory space in step S402, at least one memory frame is acquired from the chain. The chain of the plurality of memory frames may improve the ease of access by a processor or control unit other than the CPU.

[0026] Fig. 5 is a diagram illustrating a chain of a plurality of memory frames generated in step S401 in accordance with an embodiment of the present disclosure. Fig. 4. As in Fig. As shown in Figure 5, in step S401, a CPU may allocate a plurality of memory frames to construct a chain 50. The initialization size of the chain may be preset.

[0027] In embodiments of the present disclosure, a chain pointer 601 pointing to a head 501 of chain 50 may be stored in a prearranged location in host physical memory 303, such as in a CPU prefix page, to facilitate access. In two adjacent memory frames in the chain, one memory frame has a pointer pointing to the other memory frame. Specifically, each memory frame in chain 50, except for a tail 504, includes a pointer to the next memory frame in chain 50, such as a pointer 5011 in the head 501, a pointer 5021 in the middle 502, and a pointer 5031 in the middle 503. A pointer to or in the chain may be architecture-dependent to further facilitate the access speed of the chain.

[0028] Furthermore, the CPU may also mark the plurality of memory frames in the chain 50 in the memory frame table 61 to reserve these memory frames so that they are not used for any other purpose.

[0029] Fig. 6 is a diagram illustrating obtaining a free memory frame from the chain according to an embodiment of the present disclosure. In step S402 in Fig. 4 or Fig. 5, an assistant controller may obtain a memory frame from the chain in response to a request to build a dynamic shadow address translation table. For example, the request may originate from a user application requiring a bulk I / O operation. As shown in Fig. As shown in Figure 6, a memory frame 502 is popped out between memory frames 501 and 503 in the chain. The value of pointer 5021 can be copied to the memory frame 501 that precedes memory frame 502. Then, pointer 5011 in memory frame 501 will point to the memory frame 503 that next follows memory frame 502. It should be understood that any memory frame in the chain, including header and tail, can be popped out.

[0030] According to a particular embodiment of the present disclosure, more memory space may be allocated if a predetermined criterion is met. In some cases, the chain may be empty. In response to this situation, a CPU may allocate more memory space, i.e., allocate and add a new memory frame to chain 50. This process may be repeated until the number of memory frames in chain 50 reaches a preset value or just equals the size of the dynamic shadow address translation table being built.

[0031] If an assistant controller executes step S405 to obtain a memory frame from chain 50 and finds that chain 50 is empty, the assistant controller may request the CPU to allocate and add a new memory frame to chain 50. The CPU may be interrupted to process the request in a timely manner. Alternatively or additionally, the CPU may also periodically actively check whether chain 50 is empty during an idle operating cycle to reduce the number of interrupts.

[0032] Fig. 7 is a flowchart of the process of building the dynamic shadow address translation table according to an embodiment of the present disclosure. Step S403 in Fig. 4 can also be performed by the assistance control unit. As in Fig. 7, step S403 may include steps S701 to S707. In step S701, a guest logical memory address to be translated is obtained from the request to build a dynamic shadow address translation table. In step S702, a guest dynamic address translation table including mappings between guest logical memory addresses and guest physical memory addresses from a guest operating system is obtained. In step S703, the guest dynamic address translation table is searched with the guest logical memory address to obtain a guest physical memory address. In step S704, a host logical memory address is obtained based on the guest physical memory address. In step S705, a host dynamic address translation table including mappings between host logical memory addresses and host physical memory addresses from a host operating system is obtained.In step S706, the dynamic host address translation table is searched with the logical host memory address to obtain a physical host memory address. In step S707, a mapping between the logical guest memory address and the physical host memory address is stored in the dynamic shadow address translation table. For example, the logical guest memory address and the physical host memory address are both stored in corresponding positions in the dynamic shadow address translation table.

[0033] Fig. Figure 8 is a diagram illustrating data transfer when constructing the dynamic shadow address translation table, according to one embodiment of the present disclosure. As shown in Fig. As shown in Figure 8, a request to build a dynamic shadow address translation table from a user application is accompanied by a list of logical guest memory addresses 801 assigned to that request.

[0034] In step S701, for example, a logical guest memory address A1 to be translated is obtained by the assistance control unit from the list of logical guest memory addresses 801. The list 801 in Fig. Figure 8 is used to better clarify the process. In another exemplary embodiment of the present disclosure, list 801 may be omitted. The assistant control unit obtains the logical guest memory address directly from the dynamic guest address translation table 802, since all required logical guest memory addresses are already stored in the dynamic guest address translation table 802.

[0035] In step S702, the assistive control unit acquires the dynamic guest address translation table 802. For example, to facilitate acquisition by the assistive control unit, the guest operating system may again store the dynamic guest address translation table 802 in a memory where the assistive control unit can access it, or may only send to the assistive control unit a corresponding pointer / address of a memory where the dynamic guest address translation table 802 is stored.

[0036] In step S703, the assistance control unit searches the dynamic guest address translation table 802, specifically in a column of logical guest memory addresses 8021, to obtain a corresponding physical guest memory address B2 from a column of physical guest memory addresses 8022. The dynamic guest address translation table 802 in Fig. 8 also shows a general situation where the logical guest memory addresses 8021 are continuous, while the physical guest memory addresses 8022 are dynamically and non-continuously assigned. The mapping relationship shown in the dynamic guest address translation table 802 is also exemplary, as it is typically dynamic and unpredictable.

[0037] In step S704, the assistance control unit obtains a logical host memory address B2, which is the physical guest memory address B2 itself. Fig. 8, an exemplary list 803 of the logical host memory addresses may be stored, where the physical guest memory addresses 8031 ​​are the same in value as the logical host memory addresses 8032.

[0038] In step S705, the assistant control unit obtains the dynamic host address translation table 804. The structure of the dynamic host address translation table 804, which is managed by the host operating system, is similar to the structure of the dynamic guest address translation table 802, which is managed by the guest operating system. The logical host memory addresses 8041 are assigned continuously, while the physical host memory addresses 8042 are assigned discontinuously.

[0039] Similarly, the host operating system could re-store the dynamic host address translation table 804 in a memory where the assistant controller can access it, or simply send to the assistant controller a corresponding pointer / address of a memory where the dynamic host address translation table 804 is stored. The re-storage of the transmission can be terminated beforehand by the host operating system, thus allowing the dynamic host address translation table 804 to be easily obtained by the assistant controller without entering the host state.

[0040] In step S706, the assistant control unit searches the dynamic host address translation table 804 with the logical host memory address B2 to obtain a physical host memory address C5.

[0041] In step S707, the assistant control unit stores the guest logical memory address A1 and the host physical memory address C5 in the dynamic shadow address translation table 805.

[0042] Finally, the logical guest memory addresses 8051 and the physical host memory addresses 8052 may be included in the dynamic shadow address translation table 805.

[0043] Furthermore, a mapping between the logical guest memory address and the physical guest memory address is stored in the dynamic shadow address translation table 805. For example, the physical guest memory address B2 may also be stored in the dynamic shadow address translation table 805. As a result, corresponding physical guest memory addresses 8053 may also be included in the dynamic shadow address translation table 805. Therefore, changes made by the guest operating system to the mapping between the logical guest memory addresses and the physical guest memory addresses can be tracked and reflected in a timely manner by the dynamic shadow address translation table 805 when necessary.

[0044] The dynamic shadow address translation table 805 may be stored in one or more memory frames, such as the one shown in Fig. 7. Any authorized device or application, such as a DMA controller, can access it. At the same time, the portions in the physical host memory corresponding to the physical host memory addresses 8052 can be marked as pinned to prevent them from operating unexpectedly, specifically to prevent them from switching from memory to disk during a switch process.

[0045] In some cases, if the physical host memory address C5 is invalid, an error occurs and the process may pause. The assistant controller may generate an interrupt, which is handled by the CPU.

[0046] Fig. 8 is merely an illustrative diagram, in which all numbers, such as A1, B2, and C5, are merely examples to better clarify the embodiment and not to limit the embodiment. For example, since the logical guest memory addresses are not changed during transmission, their values ​​may not be transmitted to and stored in the dynamic shadow address translation table 805 as long as the sequential order of their entry numbers, such as 0, 1, ... n, is maintained. Furthermore, considering security and / or the principle of memory management, the numbers, such as C5, may also be entry numbers that still need to be translated for direct access to the hardware. In this situation, if C5 is a legal entry number but the translated address is invalid, an error may also occur and the process may pause.

[0047] Further, in step S405, in response to a request to clear the dynamic shadow address translation table 805, which typically occurs after using the dynamic shadow address translation table 805, the assistance control unit outputs the memory frame 502 occupied by the dynamic shadow address translation table to the chain 50. The memory frame 502 can be added to any position of the chain 50, such as the ending.

[0048] In embodiments of the present disclosure, a chain 50 comprising a plurality of memory frames is pre-allocated to store dynamic shadow address translation tables containing the addresses of the currently pinned physical host memories. Thus, these pinned physical host memories, including those used as I / O buffers for DMA, can be managed uniformly to facilitate hardware resource management, such as statistical memory analysis. Furthermore, the hypervisor 201 can adapt a resource allocation strategy to the virtual machines based on the statistical analysis.

[0049] Fig. 9 is a block diagram illustrating another exemplary computer system applicable to implementing some embodiments of the present disclosure. As in Fig. As shown in Figure 10, the computer system / server 12 further includes an assistant control unit 161. A set of computer program instructions corresponding to the program modules 42 included in the program / utility 40 is stored in the memory 28 and executed by at least one of the processors, such as the CPU 160 in the processing unit 16 and the assistant control unit 161, to perform actions. In the actions, a memory space is allocated by the at least one of the processors. In response to a request to build a dynamic shadow address translation table, a memory portion coming from the memory space is obtained by the assistant control unit. The dynamic shadow address translation table includes a mapping between at least one logical guest memory address and at least one physical host memory address.The dynamic shadow address translation table is constructed by the assistant control unit. The dynamic shadow address translation table is stored in memory by the assistant control unit. In response to a request to clear the dynamic shadow address translation table, the memory portion occupied by the dynamic shadow address translation table is returned to the memory space by the assistant control unit. Briefly, at least one of the processors may be high-privilege CPU 160 and executes most of the program instructions. CPU 160 executes the host operating system and guest operating system in the computer system / server 12. The assistant control unit 161, which may be a processor in the processing unit 16, operates to automatically build, update, and clear a dynamic shadow address translation table.New hardware may be used for the assistance control unit, or existing hardware may be assigned and reprogrammed to function as the assistance control unit 161.

[0050] Fig. 10 is a diagram illustrating the cooperation between a CPU and an assistance control unit according to an embodiment of the present disclosure. As shown in Fig.As shown in Figure 10, without the assistant control unit 161, the CPU 1001 must frequently switch between the host / kernel state 1021 to execute the host operating system and the guest state 1022 to execute the guest operating system. For example, whenever a request to build or update a dynamic shadow address translation table is received during S4010, in which the CPU 1001 is executing the guest operating system, the CPU 1001 is interrupted. S402 is executed, and the CPU 1001 enters the host / kernel state 1021 to build or update the dynamic shadow address translation table. Whenever a request to clear a dynamic shadow address translation table is received during S4030, wherein the CPU 1001 is executing the guest operating system, the CPU 1001 is interrupted to return to the host / kernel state 1021.The state change and its associated context switch are time-consuming, especially when a guest operating system frequently updates the dynamic shadow address translation table after each I / O operation and the CPU 1001 is repeatedly interrupted.

[0051] With the assistance control unit 161, the CPU 160 can continue tasks through S402, S403, and S404 without being interrupted. Only in a few cases can the CPU 160 handle the empty chain interrupt 1013 during S402 or the invalid address interrupt 1014 during S704 in response to the request from the assistance control unit 161. The operation period 1023 of the assistance control unit 161 covers S402, S403, and S404. Specifically, the assistance control unit 161 can automatically build, update, and delete the dynamic shadow address translation table to reduce the time required for the CPU to handle the interrupt, thus improving the overall performance of the computer system / server.

[0052] The present disclosure may be a system, a method, and / or a computer program product at any possible level of technical detail of integration. The computer program product may include computer-readable storage medium(s) having computer-readable program instructions stored thereon for causing a processor to perform aspects of the present disclosure.

[0053] The computer-readable storage medium may be any physical device that can retain and store instructions for use by an instruction-executing system. The computer-readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. A non-exhaustive list of more specific examples of the computer-readable storage medium includes the following: a portable computer diskette, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM).Flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital versatile disc (DVD), memory stick, floppy disk, mechanically encoded device such as punched cards or raised structures in a groove on which instructions are stored, and any suitable combination thereof. A computer-readable storage medium, as used herein, shall not be construed as containing transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., pulses of light carried through a fiber optic cable), or electrical signals carried through a wire.

[0054] Computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to respective computing / processing units or to an external computer or storage unit via a network such as the Internet, a local area network, a wide area network, and / or a wireless network. The network may include copper transmission cables, fiber optic transmission lines, wireless transmission, routers, firewalls, switching units, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing unit receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium within the respective computing / processing unit.

[0055] Computer-readable program instructions for performing operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Smalltalk, C++, or the like, as well as traditional procedural programming languages ​​such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server.In the latter case, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, over the Internet using an Internet service provider). In some embodiments, electronic circuits, including, for example, programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), may execute the computer-readable program instructions by utilizing state information of the computer-readable program instructions to personalize the electronic circuits to perform aspects of the present disclosure.

[0056] Aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the disclosure. It should be understood that each block of the flowcharts and / or block diagrams, as well as combinations of blocks in the flowcharts and / or block diagrams, may be implemented by computer-readable program instructions.

[0057] These computer-readable program instructions may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that the instructions, executed by the processor of the computer or other programmable data processing apparatus, produce a means for implementing the functions / steps defined in the flowchart block(s) and / or block diagrams.These computer-readable program instructions may also be stored on a computer-readable storage medium that can direct a computer, a programmable data processing apparatus, and / or other devices to function in a particular manner, such that the computer-readable storage medium having instructions stored thereon comprises an article of manufacture, including instructions that implement aspects of the function / step specified in the flowchart block(s) and / or block diagrams.

[0058] The computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of process steps to be performed on the computer, other programmable apparatus, or other device to produce a computer-executable process such that the instructions executing on the computer, other programmable apparatus, or other device implement the functions / steps defined in the block(s) of flowcharts and / or block diagrams.

[0059] The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowcharts or block diagrams may represent a module, segment, or portion of instructions comprising one or more executable instructions for performing the particular logical function(s). In some alternative implementations, the functions indicated in the block may occur in a different order than shown in the figures. For example, two blocks shown in succession may actually execute substantially concurrently, or the blocks may sometimes execute in reverse order depending on the corresponding functionality.It is further understood that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by special purpose hardware-based systems that perform the specified functions or steps, or by combinations of special purpose hardware and computer instructions.

[0060] The descriptions of the various embodiments of the present disclosure have been presented for purposes of illustration, but are not intended to be exhaustive or limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein has been chosen to best explain the principles of the embodiments, practical application, or technical improvements over technologies found in the marketplace, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

[1] A computer-implemented method comprising: Obtaining, in response to a request to build a dynamic shadow address translation table, a memory section from a memory space, wherein the memory space is allocated for at least one guest operating system and wherein the dynamic shadow address translation table comprises a mapping between at least one logical guest memory address and at least one physical host memory address; Building the dynamic shadow address translation table; wherein building the dynamic shadow address translation table comprises: Obtaining a logical guest memory address to be translated from the request to build the dynamic shadow address translation table; Obtaining a dynamic guest address translation table including one or more mappings between one or more logical guest memory addresses and one or more physical guest memory addresses from a guest operating system; Searching the dynamic guest address translation table with the logical guest memory address to obtain a physical guest memory address; Obtaining a logical host memory address based on the physical guest memory address; Obtaining a dynamic host address translation table including one or more mappings between one or more logical host memory addresses and one or more physical host memory addresses from a host operating system; Searching the dynamic host address translation table with the logical host memory address to obtain a physical host memory address; and Storing a mapping between the logical guest memory address and the physical host memory address in the dynamic shadow address translation table, and storing the dynamic shadow address translation table in the storage section. [2] The computer-implemented method of claim 1, further comprising: Return, in response to a request to clear the dynamic shadow address translation table, the memory section occupied by the dynamic shadow address translation table to the memory space. [3] Computer-implemented method according to claim 1, wherein the memory space comprises a chain of a plurality of memory frames; where in two adjacent memory frames in the chain, a particular memory frame has a pointer that points to an adjacent memory frame; and wherein obtaining the memory section from the memory space comprises obtaining at least one memory frame from the chain of the plurality of memory frames. [4] The computer-implemented method of claim 3, further comprising: Storing the pointer in a header of the chain of the plurality of memory frames. [5] The computer-implemented method of claim 1, further comprising: a pinning of a portion of the host physical memory pointed to by the host physical memory address. [6] The computer-implemented method of claim 1, wherein constructing the dynamic shadow address translation table further comprises: Storing a mapping between the logical guest memory address and the physical guest memory address in the dynamic shadow address translation table. [7] A computer-implemented method according to claim 1, wherein additional memory space is allocated when a predetermined criterion is met. [8] System comprising means suitable for carrying out all the steps of the method according to any one of the preceding method claims. [9] A computer program comprising instructions for carrying out all the steps of the method according to any one of the preceding method claims when the computer program is executed on a computer system.

Citation Information

Patent Citations

  • Dynamic mapping of guest addresses by a virtual machine monitor

    US20080005447A1