CN112817756A - Computer readable storage medium, and virtualization method and device of memory management unit - Google Patents

Computer readable storage medium, and virtualization method and device of memory management unit Download PDF

Info

Publication number
CN112817756A
CN112817756A CN202110094661.5A CN202110094661A CN112817756A CN 112817756 A CN112817756 A CN 112817756A CN 202110094661 A CN202110094661 A CN 202110094661A CN 112817756 A CN112817756 A CN 112817756A
Authority
CN
China
Prior art keywords
page table
request
management unit
memory management
virtual
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110094661.5A
Other languages
Chinese (zh)
Other versions
CN112817756B (en
Inventor
不公告发明人
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Bi Ren Technology Co ltd
Original Assignee
Shanghai Biren Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Biren Intelligent Technology Co Ltd filed Critical Shanghai Biren Intelligent Technology Co Ltd
Priority to CN202110094661.5A priority Critical patent/CN112817756B/en
Publication of CN112817756A publication Critical patent/CN112817756A/en
Application granted granted Critical
Publication of CN112817756B publication Critical patent/CN112817756B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1009Address translation using page tables, e.g. page table structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Landscapes

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

Abstract

The invention relates to a computer readable storage medium, a virtualization method and a virtualization device of a memory management unit. The method comprises the following steps: each of the plurality of page table context blocks in the memory management unit is assigned to one of a plurality of virtual machines or virtual devices at initialization time, so that each virtual machine or each virtual device can only use the one or more page table context blocks to which it belongs for address translation. Each page table context block is associated to a non-overlapping page table entry part in the page table, and is used for mapping the virtual address to a physical page number in the memory. According to the invention, through the fragment virtualization of the memory management unit, the physical resource division is realized, a plurality of virtual machines can be ensured to simultaneously monopolize the physical resources of the memory management unit, the execution of other virtual machines is not required to be waited, and the execution efficiency, the parallelism and the performance of the virtual machines are improved.

Description

Computer readable storage medium, and virtualization method and device of memory management unit
Technical Field
The present invention relates to computer virtualization, and more particularly, to a method and apparatus for virtualizing a computer readable storage medium and a memory management unit.
Background
With the current capability of physical equipment becoming stronger and stronger, cases of virtualization application become more and more common, and rich resource types and infrastructures are provided for current cloud computer platforms. In virtualization technologies, a physical resource (e.g., a central processing unit or other peripheral devices) is typically virtualized into multiple virtual physical components, so as to improve utilization of the physical devices and density of device deployment on the cloud.
In order to efficiently provide Memory for multiple virtual machines, some embodiments allow each virtual device to monopolize MMU resources by time slice in a time-division multiplexing Memory Management Unit (MMU) manner. For example, virtual machine user 1(VM1) starts to occupy the MMU at time T1, and exits the exclusive mode of the MMU after T unit times of execution; the virtual machine user 2(VM2) starts occupying the MMU at a time point T2, and exits the exclusive mode of the MMU after executing T unit times; and so on. By alternating the exclusive MMU, the virtual machine user is made to own a dedicated physical MMU for his own. However, the disadvantage is that multiple virtual instances cannot access the MMU simultaneously, and the MMU can only be used serially, reducing the performance of the system.
In other embodiments, the MMU is controlled by a Virtual Machine Monitor (VMM): the page tables of the user clients all have to be set up and modified by the virtual machine monitor, which requires full host side (host) involvement. However, the disadvantage is that any page table creation and modification of the virtual instance needs to be entered into the host side and managed by the hypervisor, so that each modification needs to be switched from guest mode to host mode and then from host mode back to guest mode after the modification is completed, and the overhead is not small.
In order to solve the above problems, the present invention provides a design solution of fragmented virtualization for MMU, which is used to virtualize a physical memory management unit into multiple virtual memory management units, and then is available to multiple virtual machine users. Therefore, the present invention provides a computer readable storage medium, a virtualization method of a memory management unit and an apparatus thereof.
Disclosure of Invention
The invention relates to a virtualization method of a memory management unit, which is implemented by a processor when loading and executing computer codes, and comprises the following steps: each of the plurality of page table context blocks in the memory management unit is assigned to one of a plurality of virtual machines or virtual devices at initialization time, so that each virtual machine or each virtual device can only use the one or more page table context blocks to which it belongs for address translation.
The invention also relates to a computer readable storage medium for storing computer code executable by a processor and implementing a method of virtualizing a memory management unit as described above when the computer code is executed by the processor.
The invention also relates to a virtualization device of the memory management unit, which comprises: and the processor is coupled with the memory management unit and used for allocating each page table context block in the memory management unit to one of a plurality of virtual machines or a plurality of virtual devices when the processor is initialized, so that each virtual machine or each virtual device can only use the page table context block or blocks to perform address translation.
Wherein each page table context block is associated to a non-overlapping part of the page table for mapping the virtual address to a physical page number in the memory.
One of the advantages of the foregoing embodiments is that, by the above-described fragment virtualization of the memory management unit, physical resource division is achieved, it is ensured that a plurality of virtual machines can monopolize physical resources of the memory management unit at the same time, execution of other virtual machines is not required to be waited for, and execution efficiency, parallelism, and performance of the virtual machines are improved.
Other advantages of the present invention will be explained in more detail in conjunction with the following description and the accompanying drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application.
Fig. 1 is a block diagram of an electronic device according to an embodiment of the invention.
Fig. 2 is a block diagram of implementing slice virtualization of a memory management unit according to an embodiment of the present invention.
FIG. 3 is an exemplary execution of a page table context block fragmentation module according to an embodiment of the present invention.
Fig. 4 is an execution example of a request source unified coding module according to an embodiment of the present invention.
FIG. 5 is an example of an implementation of the page table context block isolation module according to an embodiment of the present invention.
Fig. 6 is an example of information exchange between software and hardware modules according to an embodiment of the present invention.
FIG. 7 is a flowchart illustrating a method for virtualizing a memory management unit according to an embodiment of the present invention.
Wherein the symbols in the drawings are briefly described as follows:
10: an electronic device; 110: a processor; 120: a memory management unit; 121-124: a page table context block; 130: a memory; 132: a memory chip; 134: a memory controller; 140: a direct memory access transmission unit; 150: a video unit; 160: a display unit; 170: a storage unit; 190: a bus architecture; 210. 220, 230, 240: a virtual machine; 212. 222, 232, 242: an operating system; 250: a page table context block partitioning module; 260: a request source uniform coding module; 270: a page table context block isolation module; s710 to S760: the method comprises the following steps.
Detailed Description
Embodiments of the present invention will be described below with reference to the accompanying drawings. In the drawings, the same reference numerals indicate the same or similar components or process flows.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of further features, integers, steps, operations, elements, components, and/or groups thereof.
The use of words such as "first," "second," "third," etc. in this disclosure is intended to modify a component in a claim and is not intended to imply a priority order, precedence relationship, or order between components or steps in a method.
It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may be present. In contrast, when an element is described as being "directly connected" or "directly coupled" to another element, there are no intervening elements present. Other words used to describe the relationship between components may also be interpreted in a similar manner, e.g., "between" versus "directly between," or "adjacent" versus "directly adjacent," etc.
Refer to fig. 1. The electronic device 10 may be implemented in a mainframe, a workstation, a personal computer, a notebook computer (Laptop PC), a tablet computer, a mobile phone, a digital camera, a digital video camera, and other electronic products. The electronic device 10 may include a processor 110, a memory 130, a direct memory access transmission unit 140, a video unit 150, a display unit 160, and a storage unit 170, and are connected to each other through a bus architecture 190, such as a Peripheral Component Interconnect Express (PCI-E), to transfer data, addresses, control signals, and the like. The processor 110 may be a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a General-Purpose Graphics Processing Unit (GPGPU), etc. for loading and executing computer code corresponding to different virtual machines to perform various operations, such as addition and multiplication calculations of integers and floating points, comparison operations, Boolean (Boolean) operations, bit shifts, algebraic functions (e.g., planar interpolation, trigonometric functions, exponential functions, logarithmic functions), etc. During execution, the processor 110 can read data from the memory 130 and write data to the memory 130 for different virtual machines, including variables, data tables, various digital files, and the like. The Memory 130 may be implemented as a Dynamic Random Access Memory (DRAM) including a Memory chip 132 and a Memory controller 134. The memory controller 134 may write data to a particular physical location in the memory chip 132 or read data from a particular physical location in the memory chip 132 based on commands and addresses sent by other components.
The dma transfer unit 140 can transfer data between the memory 130 and other components via the bus structure 190 according to commands, for example, moving video streams (video streams) in the memory 130 to the video unit 150 for decoding, or moving pictures in the memory 130 to the display unit 160 for displaying the pictures on a display screen, etc. Video unit 150 may provide a video encoder and/or a video decoder for encoding an original video sequence (video sequence) into a video string and/or decoding the encoded video string into a series of reconstructed pictures. The Display unit 160 may drive a Display, such as a Thin Film Transistor-Liquid Crystal Display (TFT-LCD Display), an Organic Light-Emitting Diode (OLED Display), and the like, for displaying a picture. The storage unit 170 may provide a large amount of non-volatile storage space, typically hundreds of Gigabytes (GB), or even Terabytes (TB), for storing a large amount of data, such as high resolution pictures, movies, and the like.
The electronic device 10 further includes a Memory Management Unit (MMU) 120, which is a conversion Unit for converting a virtual address of an application program into a physical address on a physical Memory, that is, an address translation control module, which may include a register for storing a page table. The page table contains a plurality of page-table entries (page-table entries) that map virtual addresses to physical page numbers in memory 130. MMU 120 also contains a plurality of page-table context blocks (page-table context banks), each associated with a non-overlapping page table entry portion of the page table. Each page table context block can be allocated to only one virtual machine or one virtual device, and each virtual machine can be allocated to one or more page table context blocks to form a virtual page-table context bank. The functionality of the virtual page table context block may be implemented using hardware, software, or both. For example, each virtual page table context block may be implemented as a register set (register set) for storing non-overlapping local page table entries. For example, when 4 virtual machines are running in the electronic device 10, the MMU 120 includes the virtual page table context blocks 121-124, and each virtual machine can only use the page table entry in the corresponding virtual page table context block for address translation. Although the MMU 120 is shown in FIG. 1 as being located outside of the processor 110, one skilled in the art may alter the design to locate the MMU 120 within the processor 110. Furthermore, although FIG. 1 shows virtual page table context blocks 121-124 located within MMU 120, persons of ordinary skill in the art may change the design to locate virtual page table context blocks 121-124 outside of MMU 120, and the invention is not so limited.
Refer to fig. 2. For example, four virtual machines 210 to 240 are implemented on the electronic device 10. The virtual machine is a computer system simulated by software, has complete hardware functions, and runs in an environment completely isolated from other virtual machines. Different virtual machines can run different operating systems, for example, the operating system 212 of the virtual machine 210 is Linux, the operating system 222 of the virtual machine 220 is Redhat (Redhat), the operating system 232 of the virtual machine 230 is Ubuntu, and the operating system 242 of the virtual machine 240 is Fedora, and the different virtual machines are physically isolated from each other, that is, information such as data, data tables, variables, and execution results in one virtual machine cannot be accessed by any other virtual machine. A virtual machine may provide the functionality of a virtual device corresponding to a variety of physical components, such as data computation, address translation, video processing, audio processing, data movement between components, screen display, data storage, and so forth. For each memory access request, the operating system of a virtual machine can only perform address translation through the associated virtual page table context block, and then read data from the physical page number of the memory 130 or write data to the physical page number of the memory 130. For example, the operating system 212 can only perform address translation through the virtual page table context block 121; the operating system 222 can only address translate through the virtual page table context block 122; and so on. Although the examples of fig. 1 and 2 describe the virtualization of fragments of a page table context block for different virtual machines, persons skilled in the art may also apply the virtualization of fragments of a page table context block to different virtual devices or to different levels of functional modules in different virtual devices, and the invention is not limited thereto.
To achieve the design of fragment virtualization, embodiments of the present invention provide a page table context block partitioning module 250, a request source uniform coding module 260, and a page table context block isolation module 270, which comprise computer code that can be loaded and executed by the processor 110 to perform the functions described below. The technical details are as follows:
when the electronic device is powered on and performs an initialization operation, the page table context block segmentation module 250 may physically divide the page table context blocks in the MMU 120 equally or unequally according to the number of virtual machines or virtual devices, and generate virtual page context blocks of the number of virtual machines. The page table context block segmentation module 250 may allocate one or more dedicated page context blocks to each virtual machine or virtual device, so that the operation performed in the virtual machine can only perform address translation through the configured virtual page context and access the memory 130 accordingly. In some embodiments, the page table context block segmentation module 250 may fairly allocate page context blocks to different virtual machines or virtual devices, such that each virtual machine or virtual device is configured with a same number of page context blocks. In other embodiments, the page table context block segmentation module 250 may dynamically allocate different numbers of page context blocks to different virtual machines or virtual devices according to the needs of the system, so that the virtual page context blocks configured for each virtual machine or virtual device include different numbers of page context blocks, thereby improving the flexibility of resource allocation. Referring to FIG. 3, for example, the page table context block fragmentation module 250 allocates page table context blocks 121, 122, 123, 124 to virtual machines 210, 220, 230, 240, respectively. The page table context block fragmentation module 250 may store allocation information as described above in a specified location in the memory 130 or storage unit 170 for reference by the request source unified encoding module 260 and the page table context block isolation module 270. It should be noted here that after configuration, the virtual machine 210, 220, 230, or 240 can only see the page table entries associated with the page table context blocks to which it belongs, but cannot see the contents of the page table context blocks belonging to other virtual machines. For example, virtual machine 210 can see the page table entries associated with page table context block 121, but page table context blocks 122, 123, and 124 are not visible to virtual machine 210, such that the page table entries associated with page table context blocks 122, 123, and 124 are also not visible to virtual machine 210. It should be noted that although fig. 3 shows that each virtual machine includes one virtual page table context block, this only means that one virtual machine can see the content of the page table context block to which it belongs, and can perform address translation through the page table context block to which it belongs, and is not used to indicate a specific physical setting.
Referring to fig. 4, the program, service or operation executed in each virtual machine requires a request for a physical component (e.g., the processor 110, the dma transfer unit 140, the video unit 150, the display unit 160, the storage unit 170, etc.) to perform a specific task, and the physical component may need to access the memory 130 when operating. The request source uniform coding module 260 performs uniform processing on access requests Req of the MMU 120 sent by different physical units in different virtual machines during operation, and generates a unique coding number according to the request source information. The request source uniform coding module 260 can define the length of the code number and the definition of different bit segments (bit segments) in the code number according to the needs of the system. Taking the length of 15 bits as an example: in some embodiments, since different processes may be executed in each virtual machine to accomplish tasks using various physical components, the code number may include: a 4-bit virtual machine number to indicate a specific virtual machine; an 8-bit process number for indicating a particular process executing in the virtual machine; and a 3-bit physical component number to indicate the physical components needed for execution of the process. In other embodiments, if each virtual machine can be assigned a certain number of physical components for each physical component type, the code number may comprise: a 5-bit virtual machine number to indicate a specific virtual machine; and a 10-bit physical component number to indicate the physical components that are needed for the virtual machine to run. In addition, the request source unified encoding module 260 further obtains one or more corresponding page table context blocks Ctxt _ bank according to the generated unique encoding number, and then transmits the obtained page table context blocks Ctxt _ bank together with the access request Req of the MMU 120 to the page table context block isolation module 270 for subsequent determination. In other embodiments, these physical components may operate to simultaneously send the access request Req of the MMU 120 to the request source unified encoding module 260 and the page table context block isolation module 270 without forwarding the access request Req of the MMU 120 to the page table context block isolation module 270 through the request source unified encoding module 260.
Refer to fig. 5. The page table context block isolation module 270 is used to ensure isolation between the virtual machines when using the page table context block, and ensure that each virtual machine can only access the page table context block to which it belongs. When an access request is received from the MMU 120 by any virtual machine, the page table context block isolation module 270 checks whether the page table context block requesting access belongs to the page table context blocks assigned to that virtual machine. For example, the request may carry a virtual address to be accessed, and the page table context block isolation module 270 checks whether the virtual address in the request is present in or associated with the page table context block received from the request source unified coding module 260. If not, then page table context block isolation module 270 considers this to be an illegal access, thereby denying the virtual machine access to memory 130. If so, then page table context block isolation module 270 considers this to be a legitimate access, allowing the virtual machine to access memory 130.
The information exchange between the software and hardware modules shown in fig. 6 and the virtualization method of the memory management unit shown in fig. 7 are referred to together. The method is implemented when the processor 110 loads and executes the computer code of the modules 250 to 270, and comprises the following steps:
step S710: upon initialization of the electronic device 10, the page table context block fragmentation module 250 assigns each of the plurality of page table context blocks in the MMU 120 to a virtual machine or virtual appliance, each virtual machine or virtual appliance having the right to use one or more page table context blocks to form a virtual page table context block. For example, the page table context block fragmentation module 250 allocates the virtual page table context block 121 to the virtual machine 210 and the virtual page table context block 122 to the virtual machine 220.
After the electronic device 10 is initialized, the method repeatedly executes a loop (steps S720 to S760) when the electronic device 10 is actually running, for processing each request sent from a different virtual machine to access the MMU 120.
Step S720: the request source unified coding module 260 receives a request Req for accessing the MMU 120, which is sent from a virtual machine, a virtual device, or a functional module (such as various engines) in the virtual device, and the request Req may include information of a request type, a virtual address, and the like.
Step S730: the request source unified encoding module 260 generates an encoding number according to information of a request source of a physical component that issues a request Req, acquires one or more corresponding page table context blocks Ctxt _ bank or indexes Ctxt _ bank _ idx thereof, and transmits the acquired page table context blocks Ctxt _ bank or indexes Ctxt _ bank _ idx thereof to the page table context block isolation module 270. The information of the request source includes, for example and without limitation, a user number, a virtual machine number, a process number, and a physical component number, and an encoding number such as, but not limited to, a Unique encoding number (UID).
Step S740: the page table context block isolation module 270 determines whether the request Req is allowed according to the received page table context block Ctxt _ bank or the index Ctxt _ bank _ idx of the page table context block and information carried in the request Req. If so, this represents a legitimate access, and the flow proceeds to the process of step S760. Otherwise, this represents an illegal access, and the flow proceeds to the processing of step S750. In step S740, if the page table context block isolation module 270 receives the index Ctxt _ bank _ idx of the page table context block, the specified page table context block Ctxt _ bank needs to be obtained from the MMU 120 according to the index.
Step S750: the page table context block isolation module 270 denies the request Req.
Step S760: the page table context block isolation module 270 sends the request Req to the MMU 120, thereby causing the MMU 120 to retrieve the physical page number corresponding to the virtual address by searching the page table entry associated with the virtual page table context block to which the virtual machine, the virtual device, or the functional module in the virtual device belongs. The requesting physical component or MMU 120 may then request the memory controller 134 to read data from the physical address of the memory chip 132 or write data to the physical address of the memory chip 132.
One of the advantages of the foregoing embodiments is that, by the fragment virtualization of the MMU 120, physical resource division is achieved, it is ensured that a plurality of virtual machines can monopolize physical resources of the MMU 120 at the same time, and there is no need to wait for execution of other virtual machines, thereby improving execution efficiency, parallelism, and performance of the virtual machines.
Another advantage of the foregoing embodiment is that the virtual machine can directly edit the page table of the memory 130 in the client mode without the involvement of a virtual machine monitor or similar software and hardware components, which reduces the complexity of the overall environment, facilitates the implementation of the system, and reduces the dependence on the host system, thereby improving the performance of the virtual machine user.
Another advantage of the above embodiment is that the host system is less involved, thereby allowing the host system more resources to process other transactions and improving the overall system performance.
All or a portion of the steps of the methods described herein may be implemented by a computer program, such as any combination of an application program, a driver, an operating system, and the like. In addition, other types of programs as shown above may also be implemented. Those skilled in the art can write the method of the embodiments of the present invention as computer code, which will not be described for the sake of brevity. The computer program implemented according to the embodiments of the present invention can be stored in a suitable computer readable storage medium, such as a DVD, a CD-ROM, a usb disk, a hard disk, or can be disposed in a network server accessible via a network (e.g., the internet, or other suitable medium).
Although fig. 1 and 2 include the above-described components, it is not excluded that more additional components may be used to achieve better technical effects without departing from the spirit of the present invention. Further, although the flowchart of fig. 7 is executed in the order specified, a person skilled in the art may modify the order between the steps to achieve the same effect without departing from the spirit of the invention, and therefore, the invention is not limited to use of only the order described above. In addition, a person skilled in the art may also integrate several steps into one step, or perform more steps in sequence or in parallel besides these steps, and the present invention should not be limited thereby.
The above description is only for the preferred embodiment of the present invention, and it is not intended to limit the scope of the present invention, and any person skilled in the art can make further modifications and variations without departing from the spirit and scope of the present invention, therefore, the scope of the present invention should be determined by the claims of the present application.

Claims (13)

1. A memory management unit virtualization method implemented by a processor when loading and executing computer code, comprising:
at initialization, each of a plurality of page table context blocks in a memory management unit is allocated to one of a plurality of virtual machines or a plurality of virtual devices, so that each virtual machine or each virtual device can only use one or more page table context blocks to perform address translation,
wherein each page table context block is associated to a non-overlapping page table entry locality in a page table for mapping virtual addresses to physical page numbers in memory.
2. A method of virtualizing a memory management unit as claimed in claim 1, wherein a plurality of said page table context blocks are physically divided equally or unequally for a plurality of said virtual machines or a plurality of said virtual devices.
3. The method of virtualizing a memory management unit according to claim 1, comprising:
storing allocation information for a plurality of said page table context blocks in a specified location in said memory or storage unit.
4. The method of virtualizing a memory management unit according to claim 1, comprising:
after initialization is completed, receiving a request for accessing the memory management unit, wherein the request comprises information of a virtual address to be accessed;
obtaining one or more corresponding page table context blocks according to the information of the request source sending the request;
judging whether the request is allowed according to the obtained one or more page table context blocks and the information carried in the request;
when the request is allowed, sending the request to the memory management unit, so that the memory management unit searches page table entries associated with the obtained one or more page table context blocks for obtaining the physical page number corresponding to the virtual address; and
rejecting the request when the request is not allowed.
5. The method for virtualizing a memory management unit according to claim 4, wherein the information of the request source includes a virtual machine number, a process number, and a physical component number.
6. The method of virtualizing a memory management unit according to claim 4, comprising:
checking whether the virtual address in the request is present in or associated with the retrieved one or more of the page table context blocks;
if yes, representing that the request is a legal access; and
if not, it represents that the request is an illegal access.
7. A computer readable storage medium storing computer code executable by a processor, the computer code implementing a method of virtualizing a memory management unit according to any one of claims 1 to 6 when executed by the processor.
8. An apparatus for virtualizing a memory management unit, comprising:
a processor, coupled to the memory management unit, for assigning each of a plurality of page table context blocks in the memory management unit to one of a plurality of virtual machines or a plurality of virtual devices at initialization, such that each of the virtual machines or each of the virtual devices can only use the page table context block or blocks to perform address translation,
wherein each page table context block is associated to a non-overlapping page table entry locality in a page table for mapping virtual addresses to physical page numbers in memory.
9. The apparatus for virtualizing a memory management unit according to claim 8, wherein a plurality of said page table context blocks are physically divided equally or unequally for a plurality of said virtual machines or a plurality of said virtual devices.
10. The memory management unit virtualization device of claim 8, wherein the processor stores allocation information of a plurality of the page table context blocks in a specified location in the memory or storage unit.
11. The device for virtualizing a memory management unit according to claim 8, wherein the processor receives a request for accessing the memory management unit after initialization is completed, the request including information of a virtual address to be accessed; obtaining one or more corresponding page table context blocks according to the information of the request source sending the request; judging whether the request is allowed according to the obtained one or more page table context blocks and the information carried in the request; when the request is allowed, sending the request to the memory management unit, so that the memory management unit searches page table entries associated with the obtained one or more page table context blocks for obtaining the physical page number corresponding to the virtual address; and rejecting the request when the request is not allowed.
12. The memory management unit virtualization device according to claim 11, wherein the information of the request source comprises a virtual machine number, a process number, and a physical component number.
13. The memory management unit virtualization device of claim 11, wherein the processor checks whether the virtual address in the request is present in or associated with the retrieved one or more of the page table context blocks; if yes, representing that the request is a legal access; and if not, representing that the request is an illegal access.
CN202110094661.5A 2021-01-25 2021-01-25 Computer readable storage medium, and virtualization method and device of memory management unit Active CN112817756B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110094661.5A CN112817756B (en) 2021-01-25 2021-01-25 Computer readable storage medium, and virtualization method and device of memory management unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110094661.5A CN112817756B (en) 2021-01-25 2021-01-25 Computer readable storage medium, and virtualization method and device of memory management unit

Publications (2)

Publication Number Publication Date
CN112817756A true CN112817756A (en) 2021-05-18
CN112817756B CN112817756B (en) 2022-05-27

Family

ID=75859118

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110094661.5A Active CN112817756B (en) 2021-01-25 2021-01-25 Computer readable storage medium, and virtualization method and device of memory management unit

Country Status (1)

Country Link
CN (1) CN112817756B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023029982A1 (en) * 2021-09-03 2023-03-09 济南外部指针科技有限公司 Method and system for memory allocation

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306126A (en) * 2011-08-24 2012-01-04 华为技术有限公司 Memory management method, device and system
CN104063281A (en) * 2013-03-21 2014-09-24 华为技术有限公司 Method and device for regulating and controlling physical memory of virtual machine
US9153211B1 (en) * 2007-12-03 2015-10-06 Nvidia Corporation Method and system for tracking accesses to virtual addresses in graphics contexts
CN107085535A (en) * 2017-03-30 2017-08-22 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN107193759A (en) * 2017-04-18 2017-09-22 上海交通大学 The virtual method of device memory administrative unit
WO2017185864A1 (en) * 2016-04-25 2017-11-02 中兴通讯股份有限公司 Method, device and terminal for replacing table entry
CN112099903A (en) * 2020-08-18 2020-12-18 海光信息技术股份有限公司 Memory management method and device of virtual machine, CPU chip and server

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9153211B1 (en) * 2007-12-03 2015-10-06 Nvidia Corporation Method and system for tracking accesses to virtual addresses in graphics contexts
CN102306126A (en) * 2011-08-24 2012-01-04 华为技术有限公司 Memory management method, device and system
CN104063281A (en) * 2013-03-21 2014-09-24 华为技术有限公司 Method and device for regulating and controlling physical memory of virtual machine
WO2017185864A1 (en) * 2016-04-25 2017-11-02 中兴通讯股份有限公司 Method, device and terminal for replacing table entry
CN107085535A (en) * 2017-03-30 2017-08-22 联想(北京)有限公司 A kind of information processing method and electronic equipment
CN107193759A (en) * 2017-04-18 2017-09-22 上海交通大学 The virtual method of device memory administrative unit
CN112099903A (en) * 2020-08-18 2020-12-18 海光信息技术股份有限公司 Memory management method and device of virtual machine, CPU chip and server

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023029982A1 (en) * 2021-09-03 2023-03-09 济南外部指针科技有限公司 Method and system for memory allocation

Also Published As

Publication number Publication date
CN112817756B (en) 2022-05-27

Similar Documents

Publication Publication Date Title
US10248468B2 (en) Using hypervisor for PCI device memory mapping
US7757034B1 (en) Expansion of virtualized physical memory of virtual machine
US8667207B2 (en) Dynamic reallocation of physical memory responsive to virtual machine events
JP4143616B2 (en) Method and computer program for supporting memory addresses with holes
US20160162316A1 (en) Offloading and parallelizing translation table operations
US11119942B2 (en) Facilitating access to memory locality domain information
US11132290B2 (en) Locality domain-based memory pools for virtualized computing environment
US10061701B2 (en) Sharing of class data among virtual machine applications running on guests in virtualized environment using memory management facility
US10365825B2 (en) Invalidation of shared memory in a virtual environment
US20060069878A1 (en) System and method for virtualization of processor resources
JP2014235501A (en) Control method of storage device, storage device and information processing device
US10691590B2 (en) Affinity domain-based garbage collection
CN112817756B (en) Computer readable storage medium, and virtualization method and device of memory management unit
US20130073779A1 (en) Dynamic memory reconfiguration to delay performance overhead
US9158554B2 (en) System and method for expediting virtual I/O server (VIOS) boot time in a virtual computing environment
US20220382672A1 (en) Paging in thin-provisioned disaggregated memory
US20190155745A1 (en) Shared memory in a virtual environment
US10228859B2 (en) Efficiency in active memory sharing
US10223284B2 (en) Flexible I/O DMA address allocation in virtualized systems
US11481255B2 (en) Management of memory pages for a set of non-consecutive work elements in work queue designated by a sliding window for execution on a coherent accelerator
US20210326253A1 (en) Computer memory management in computing devices
US9176910B2 (en) Sending a next request to a resource before a completion interrupt for a previous request
CN116755843B (en) Virtual resource creation method and device, electronic equipment, chip and storage medium
US11914527B2 (en) Providing a dynamic random-access memory cache as second type memory per application process

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 201114 room 1302, 13 / F, building 16, 2388 Chenhang Road, Minhang District, Shanghai

Patentee after: Shanghai Bi Ren Technology Co.,Ltd.

Country or region after: China

Address before: 201114 room 1302, 13 / F, building 16, 2388 Chenhang Road, Minhang District, Shanghai

Patentee before: Shanghai Bilin Intelligent Technology Co.,Ltd.

Country or region before: China