Memory management method and device

By setting the operating authority of the identification process in the free bit of the page table entry, the memory isolation problem in the existing technology that requires additional data structures is solved, and the security isolation of the memory and the simplification of authority management are realized.

CN116225974BActive Publication Date: 2024-08-27HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111466580.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-03
Publication Date
2024-08-27
Estimated Expiration
2041-12-03

AI Technical Summary

Technical Problem

Existing technologies require additional data structures when implementing safe memory isolation, resulting in high management costs and time costs.

Method used

By setting a bit in the free bit of the page table entry to identify the operation permission of the process, memory isolation can be achieved by using the existing page table entry without the need for additional data structures.

Benefits of technology

It achieves safe isolation of memory, reduces management costs and time costs, and simplifies the authentication and access control of process permissions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116225974B
    Figure CN116225974B
Patent Text Reader

Abstract

The present application discloses a memory management method and device thereof, which does not require the establishment of an additional data structure and consumes less time for searching permissions. A memory management method, the method comprising: receiving a memory allocation request sent by a process; in response to the memory allocation request, allocating a physical page of memory to the process; setting a free bit of a page table entry corresponding to the physical page; establishing a mapping relationship between the physical page and the virtual address of the process; the page table entry corresponding to the physical page is obtained by the page table entry corresponding to the virtual address determined by the physical page according to the mapping relationship; the free bit is a software reserved bit of the page table entry; the setting of the free bit indicates that the process has the operation permission for the physical page.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a memory management method and device thereof. Background Art

[0002] Memory is one of the important components of a computer, which is used to temporarily store the calculation data in the CPU and the data exchanged with external storage devices such as hard disks. All processes in the computer are performed in the memory. The computer's operating system will allocate memory space for each process. For the security of the operating system, the operating system will control the process's operations on the memory space, such as authenticating the process's operations on the memory space. Specifically, when the operating system receives a memory operation request from a process, the operating system will first check whether the process has the authority to operate on the memory space. If the process has the authority to operate on the memory space, the operating system will receive the process's memory operation request, otherwise the operating system will reject the process's memory operation request. In this way, each process can only operate on its own memory space and will not interfere with the behavior of other processes on the memory space. However, this requires an additional data structure to store the permissions. Summary of the invention

[0003] In view of the above, it is necessary to provide a memory management method and device thereof, which can achieve memory security isolation without the need for additional data structures.

[0004] In the first aspect, an embodiment of the present application provides a memory management method, the method comprising: receiving a memory allocation request sent by a process; allocating a physical page of memory to the process in response to the memory allocation request; setting an idle bit of a page table entry corresponding to the physical page; establishing a mapping relationship between the physical page and the virtual address of the process; the page table entry corresponding to the physical page is obtained by the page table entry corresponding to the virtual address determined by the physical page according to the mapping relationship; the idle bit is a software reserved bit of the page table entry; the setting of the idle bit indicates that the process has operation permission on the physical page.

[0005] In the first aspect of the present application, when a memory allocation request sent by a process is received, a physical page of memory is allocated to the process, and a free bit of a page table entry corresponding to the physical page is set so that the process has operation permissions on the physical page. There is no need to establish an additional data structure, and only an existing page table entry is needed to identify that the process has operation permissions on the physical page. At the same time, the memory is isolated in units of pages, reducing management costs and time costs.

[0006] According to some embodiments of the present application, the method further includes: receiving a memory operation request sent by the process, the memory operation request including the virtual address of the process; in response to the memory operation request, determining whether the idle bit of the page table entry corresponding to the virtual address of the process is set; if the idle bit of the page table entry corresponding to the virtual address of the process is set, allowing the process to operate on the physical page corresponding to the physical address corresponding to the virtual address. The present application can authenticate the operation authority of the process and implement operations on the physical page by determining whether the idle bit of the corresponding page table entry is set when receiving the memory operation request of the process, and allowing the process to operate on the physical page when it is set.

[0007] According to some embodiments of the present application, the method further includes: receiving a memory access request sent by the process, the memory access request including the virtual address of the process; in response to the memory access request, determining whether the idle bit of the page table entry corresponding to the virtual address of the process is set; if the idle bit of the page table entry corresponding to the virtual address of the process is set, allowing the process to access the data in the physical page corresponding to the physical address corresponding to the virtual address. The present application can authenticate the access rights of the process and access the data in the physical page by determining whether the idle bit of the corresponding page table entry is set when receiving the memory access request of the process, and allowing the process to access the data in the physical page when it is set.

[0008] According to some embodiments of the present application, the method further includes: if the idle bit of the page table entry corresponding to the virtual address of the process is not set, prohibiting the process from accessing the data in the physical page corresponding to the physical address corresponding to the virtual address. The present application can authenticate the access rights of the process and prohibit access to the data in the physical page by prohibiting the process from accessing the data in the physical page when the idle bit of the page table entry is not set.

[0009] According to some embodiments of the present application, the method further includes: receiving a request to release memory mapping sent by the process, wherein the request to release memory mapping includes the virtual address of the process; in response to the request to release memory mapping, determining whether the free bit of the page table entry corresponding to the virtual address of the process is set; if the free bit of the page table entry corresponding to the virtual address of the process is set, clearing the free bit of the page table entry corresponding to the physical page. The present application can authenticate the process's unmapping authority and unmap the physical page by determining whether the free bit of the corresponding page table entry is set when receiving a request to release memory mapping from the process, and clearing the free bit of the page table entry corresponding to the physical page when it is set.

[0010] According to some embodiments of the present application, the method further includes: receiving a request to modify memory access rights sent by the process, wherein the request to modify memory access rights includes the virtual address of the process; in response to the request to modify memory access rights, determining whether the free bit of the page table entry corresponding to the virtual address of the process is set; if the free bit of the page table entry corresponding to the virtual address of the process is set, modifying the data access rights bit of the page table entry corresponding to the physical page according to the request to modify memory access rights. The present application can authenticate the permission to modify access rights of the process and modify the permission to access rights by determining whether the free bit of the corresponding page table entry is set when receiving the request to modify memory access rights of the process, and modifying the data access rights bit of the page table entry corresponding to the physical page when it is set.

[0011] According to some embodiments of the present application, the method further includes: receiving an authorization permission request sent by the process, the authorization permission request including the virtual address of the process and the virtual address of the process to be authorized; in response to the authorization permission request, determining whether the free bit of the page table entry corresponding to the virtual address of the process is set; if the free bit of the page table entry corresponding to the virtual address of the process is set, setting the free bit of the page table entry corresponding to the virtual address of the process to be authorized in the authorization permission request. The present application can realize the authentication of authorization permissions and the authorization of permissions of other processes by determining whether the free bit of the corresponding page table entry is set when receiving the authorization permission request of the process, and if it is set, setting the free bit of the page table entry corresponding to the virtual address of the process to be authorized.

[0012] According to some embodiments of the present application, the method further includes: if the idle bit of the page table entry corresponding to the virtual address of the process is set, clearing the idle bit of the page table entry corresponding to the virtual address of the process in the authorization permission request. By clearing the idle bit of the page table entry corresponding to the virtual address of the process, the present application can realize that the permission of the physical page is owned by only one process, and realizes the isolation of memory in units of pages.

[0013] In a second aspect, an embodiment of the present application further provides a computer device, comprising at least one processor, a memory and a communication module; the at least one processor is coupled to the memory and the communication module; the memory is used to store instructions, the processor is used to execute the instructions, and the communication interface is used to communicate with other devices under the control of the at least one processor; when the instructions are executed by the at least one processor, the at least one processor executes the memory management method as described in any possible embodiment of the first aspect above.

[0014] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program, wherein the program enables a computer device to execute the memory management method as described in any possible embodiment of the first aspect above.

[0015] In a fourth aspect, an embodiment of the present application further provides a computer program product, the computer program product comprising computer execution instructions, the computer execution instructions being stored in a computer-readable storage medium; at least one processor of an electronic device can read the computer execution instructions from the computer-readable storage medium, and the at least one processor executes the computer execution instructions so that the electronic device executes the memory management method as described in any possible embodiment of the first aspect above. The beneficial effects of the second to fourth aspects of the present application and their various implementations can refer to the first aspect and its various implementations, as well as the analysis of the beneficial effects in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 A schematic diagram of memory partitioning for a Linux kernel in the prior art.

[0017] Figure 2 A schematic diagram of obtaining the address of a physical page according to a three-level page table provided in an embodiment of the present application.

[0018] Figure 3 A schematic diagram of the AArch64 page table entries provided in accordance with an embodiment of the present application.

[0019] Figure 4 A schematic diagram of the Upper attributes domain provided in an embodiment of the present application.

[0020] Figure 5 A schematic diagram of the Lower attributes domain provided in an embodiment of the present application.

[0021] Figure 6 A schematic diagram of data access permissions provided in an embodiment of the present application.

[0022] Figure 7 A flowchart of a memory management method provided in an embodiment of the present application.

[0023] Figure 8 A schematic diagram of a page table entry when a process provided in an embodiment of the present application has operation permissions on a physical address.

[0024] Fig. 9 A schematic diagram of isolating memory provided in an embodiment of the present application.

[0025] Fig.10A schematic diagram of a memory operation method in a memory management method provided in an embodiment of the present application.

[0026] Fig.11 A schematic diagram of a memory access method in a memory management method provided in an embodiment of the present application.

[0027] Fig.12 A schematic diagram of a memory unmapping method in a memory management method provided in an embodiment of the present application.

[0028] Fig.13 A schematic diagram of a method for modifying memory access permissions in a memory management method provided in an embodiment of the present application.

[0029] Fig.14 A schematic diagram of the authorization permission method in the memory management method provided in an embodiment of the present application.

[0030] Fig.15 A logical schematic diagram of a memory management device provided in an embodiment of the present application.

[0031] Fig.16 A schematic diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In the description of the embodiments of the present application, the words "for example" and the like are used to indicate examples, illustrations or explanations. Any embodiment or design described as "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the words "for example" and the like is intended to present the related concepts in a specific way.

[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art in the present application. The terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. It should be understood that in the present application, unless otherwise specified, "plurality" refers to two or more than two.

[0034] Existing Linux and other macro kernel architectures can divide the memory into several continuous areas, each area is called a partition. The size of each partition can be the same or different. Each partition can only contain one process, that is, each partition is bound to a process. Figure 1As shown, Linux divides the memory into three partitions, namely partition A, partition B and partition C. Partition A is bound to process A, partition B is bound to process B, and partition C is bound to process C. The operating system can authenticate by judging whether the address of the operation requested by the process is in the address interval of its corresponding partition. For example, if the address a of the operation requested by process A is in the address interval of its corresponding partition A, the operating system will receive the memory operation request of process A, otherwise the operating system will reject the memory operation request of process A. In the prior art, the memory is divided according to the address interval, and the physical address interval that the process can use is fixed, which will result in a relatively coarse control granularity. However, if the memory is divided into multiple physical pages according to pages, the operating system needs to store the processes corresponding to the physical pages in addition, which requires additional management costs, and the operating system will consume more time in the process of searching for the physical page address corresponding to the process.

[0035] Existing Linux and other macro kernel architectures will also create a data structure (struct page) for each physical page in the memory and add process information to the struct page. The operating system can perform authentication by comparing the process requesting to operate on the physical page with the process information recorded in the struct page corresponding to the physical page. If the process requesting to operate on the physical page and the process information recorded in the struct page corresponding to the physical page are the same, the operating system will accept the process's memory operation request, otherwise the operating system will reject the process's memory operation request. However, recording manager information for each physical page requires an additional struct page, which will take up a lot of memory.

[0036] The existing microkernel architecture can use a capability-based security mechanism for authentication, thereby controlling the user-mode process's operation on the memory. Specifically, the capability of each user-mode process is placed in a data structure, which is called a capability node (CNode). The user-mode process can request access to the memory space from the operating system through a system call. The operating system will first check in the data structure whether the user-mode process has obtained the ability to operate the memory space. If the user-mode process has obtained the ability to operate the memory space, the user-mode process can operate the memory space according to the permissions recorded in the capability, otherwise, the user-mode process cannot operate the memory space. Although this method provides the ability of memory security isolation, this management method requires additional data structures to store capabilities, resulting in relatively high memory overhead. At the same time, during the authentication process, the search process is relatively complicated to find out whether the process has the ability to operate the memory level by level.

[0037] In order to better understand the present application, some terms and concepts involved in the present application are first introduced below.

[0038] Operating System: System software that manages computer hardware and software resources and is the cornerstone of a computer system. An operating system handles basic tasks such as managing and configuring memory, determining the priorities of system resource supply and demand, controlling input and output devices, operating networks, and managing file systems. An operating system also provides an interface for users to interact with the system.

[0039] Kernel: A program used to manage data input and output requests from software, translating these requests into data processing instructions and handing them over to the central processing unit (CPU) and other electronic components in the computer for processing. It is the most basic part of a modern operating system.

[0040] Macro kernel: An operating system kernel architecture characterized by the entire kernel program running in kernel space. Compared with other types of operating system architectures, such as microkernel architecture or hybrid kernel architecture, the macro kernel provides a unified high-level virtual interface for computer hardware. It provides a series of system calls to implement various operating system services, such as process management, program concurrency, memory management, various drivers, etc.

[0041] Microkernel: Another operating system kernel architecture, this architecture is characterized by running as few functions as possible in kernel space and providing necessary mechanisms to implement the operating system. These mechanisms include address space management, thread management, inter-process communication, etc. Compared with macro kernels, microkernels run many components, such as file systems and network protocol stacks, in user mode, and reduce their actual kernel functions to very few.

[0042] Process: The running entity of a program. A program is a description of instructions, data and their organizational form, and a process is the running entity of a program. A process can have multiple threads running concurrently, and each thread executes different tasks in parallel. A thread can be the actual operating unit of a process, but the embodiments of this application do not make a clear distinction between threads and processes, and process is used instead in the description process.

[0043] Page table: is a special data structure placed in memory, storing the correspondence between logical pages and physical page frames. Each process has its own page table. The page table can be a primary page table, a secondary page table, a tertiary page table, or a quaternary page table.

[0044] Page table entry: Each page table can store multiple page table entries. The page table entry records the address of the physical page corresponding to the virtual address. Each page table entry also includes some flags that can control the read and write access rights of the physical address.

[0045] Please refer to Figure 2 , a schematic diagram of obtaining the address of a physical page according to a three-level page table provided by an embodiment of the present application. The present application will be described in detail below using the ARM AArch64 architecture as an example. In the ARM AArch64 architecture, the virtual address of a process can be 64 bits, of which 39 bits of the 64-bit virtual address are valid bits. Among them, [38:30] of the virtual address can be used to place a page global directory (pgd) index. [29:21] of the virtual address can be used to place a page middle directory (pmd) index. [20:12] of the virtual address can be used to place a page table entry (pte) index. When obtaining the physical page base address according to the virtual address, the following steps need to be performed: the first step is to determine the first address of the process's pgd, and then use the pgd index placed in [38:30] of the virtual address as the offset of the pgd, add the first address of the pgd to the offset of the pgd to obtain an item in the pgd, and determine the pmd pointed to by the item in the pgd. The second step is to use the pmd index placed in [29:21] of the virtual address as the offset of pmd, add the first address of pmd determined in the first step to the offset of pmd to obtain an item in pmd, and determine the pte pointed to by the item in pmd. The third step is to use the pte index placed in [20:12] of the virtual address as the offset of pte, add the first address of pte determined in the second step to the offset of pte to obtain an item in pte, determine the page table item corresponding to the item in pte, and determine the address of the physical page corresponding to the virtual address according to the page table item, for example Figure 2 0x1000, 0x2000, 0x3000, 0x4000, 0x5000, or 0x6000 shown in . It is understandable that the structure of the page table can also be other structures, the page table can be a page table of other levels, the architecture can also be other types of architectures, and the number of bits of the virtual address can be other bits, and the present application does not limit this. It is understandable that after determining the address of the physical page, the offset of the physical address placed in [11:0] of the virtual address can be added to the address of the physical page to obtain the physical address, and the present application does not limit this. It is understandable that the present application can also query the page table entry corresponding to the virtual address through hardware instructions such as Arm AT (address translation) instructions, and the present application does not limit this.

[0046] Please refer to Figure 3, is a schematic diagram of a page table entry of a three-level page table in the ARM AArch64 architecture provided in an embodiment of the present application. The page table entry of AArch64 is a 64-bit storage unit. The lower 1 bit of the page table entry indicates whether the descriptor is valid. Among them, the flag bit is 1 to indicate valid, and the flag bit is 0 to indicate invalid. The lower 2 bits of the page table entry indicate that the entry is used to provide the address and attributes of a 4KB, 16KB or 64KB physical page. The page table entry also includes an upper attributes domain, an outputaddress domain, and a lower attributes domain. The upper attributes domain is the [63:51] bits of the page table entry. The output address domain is the [47:12] bits of the page table entry. The lower attributes domain is the [11:2] bits of the page table entry. Among them, the Output address domain is the address of the next level page table or the address of the physical page.

[0047] The upper attributes domain definition format is as follows Figure 4 As shown. Bit 63 of the upper attributes domain is an IGNORED bit, bits [62:59] are PBHA bits, bits [58:55] are IGNORED bits, bits 54 are UXN or XN bits, bits 53 are PXN bits, bits 52 are Contiguous bits, and bits 51 are DBM bits. The PBHA bit represents Page-based Hardware Attributes, which is a page-based hardware attribute bit. The IGNORED bits [58:55] are free bits, which are software reserved bits (Reserved for software use) of page table entries and can be used to place operating system customized messages. The UXN or XN bit represents Unprivileged execute-never or Execute-never, which is used to indicate the execution permission of the memory. The UXN or XN bit is 1, which means there is no execution permission. The PXN bit represents Privileged execute-never, which is an unprivileged execution bit. The Contiguous bit indicates whether the table entry is one of the continuous table entries. The Contiguous bit is 1, which means that the table entry is not one of the continuous table entries. The DBM bit stands for Dirty Bit Modifier, which is used to indicate whether a page or memory block has been modified. A DBM bit of 1 indicates that the page or memory block has been modified.

[0048] The lower attributes domain definition format is as follows Figure 5As shown. The 16 bits of the lower attributes field are nT bits, [15:12] bits are OA bits, 11 bits are nG bits, 10 bits are AF bits, [9:8] bits are SH bits, [7:6] bits are AP[2:1] bits, 5 bits are NS bits, and [4:2] bits are Attrlndx[2:0] bits. The nT bit indicates whether the item is a block item. The nT position is 1, indicating that the item is a block item. The nG bit stands for not global, which is used to indicate whether the translation table buffer (Translation LookasideBuffer, TLB) is globally valid or only valid for the current process. The nG position is 1, indicating that it is not global and is process-private. The AF bit stands for Access flag, indicating whether this page has been accessed. The AF position is 1, indicating that this page has been accessed. The SH bit stands for Shareability field, which is used to indicate whether the memory location is shareable. If the SH bit is 00, it means that the memory location is not shareable; if the SH bit is 01, it indicates a reserved value; if the SH bit is 10, it indicates that the memory location is externally shared; if the SH bit is 11, it indicates that the memory location is internally shared.

[0049] The AP[2:1] bit is the Access flag[2:1] bit, which is the data access permission bit. The AP[2:1] bit definition format is as follows: Figure 6 As shown. AP[2] is used to select between read-only and read / write access. AP[1] is used to select between application level (EL0) access and system level (EL1) access. If the AP[2:1] bits are 00, it means that the system level (EL1) access is read / write; if the AP[2:1] bits are 01, it means that all levels are read / write; if the AP[2:1] bits are 10, it means that the system level (EL1) access is read-only; if the AP[2:1] bits are 11, it means that all levels are read-only. The NS bit is Non-secure, which is used to specify whether the output physical address is in the secure address mapping or in the non-secure address mapping for accessing memory from the secure state. The NS position is 1, indicating that the output physical address is in the non-secure address mapping. The Attrlndx[2:0] bits are Stage 1 memory attributes index, which is used to specify the index of the memory attribute field in register MAIR-ELx.

[0050] It is understandable that the number of bits of the page table entry can be other numbers, such as 32 bits, the number of free bits can be other numbers, such as 3 bits, the number of AF bits can be 1 bit, etc., and this application does not impose any restrictions on this.

[0051] In this embodiment, the page table entry is taken as an example of a page table entry of a three-level page table in the ARM AArch64 architecture. It can be understood that the embodiment of the present application can also be other page table entries.

[0052] Please refer to Figure 7 , is a flow chart of a memory management method provided in an embodiment of the present application. The memory management method comprises:

[0053] Step S701: Receive a memory allocation request sent by a process.

[0054] In some embodiments, the process may send a memory allocation request during the kernel startup phase. In some embodiments, the process may be the running of a new program in the operating system, and the process will send the memory allocation request. In some embodiments, the process may send a memory allocation request when the memory space allocated by the operating system does not meet its running. In some embodiments, the memory allocation request is used to request the allocation of a certain size of memory space for the running of the process.

[0055] In some embodiments, the memory allocation request includes the size of the memory requested to be allocated.

[0056] Step S702: In response to the memory allocation request, allocate physical pages of memory to the process.

[0057] In some embodiments, a physical page of memory is allocated to the process according to the memory size requested to be allocated in the memory allocation request. The size of the physical page may be 4KB, 8KB, or 16KB, etc.

[0058] In some embodiments, after allocating physical pages of memory to the process, a mapping relationship between the physical pages and the virtual addresses of the process is established according to the allocated physical pages and the virtual addresses of the process.

[0059] In some embodiments, if the process sends a memory allocation request during the kernel startup phase or if the process is a new program running in the operating system, after allocating physical pages of memory to the process, it is also necessary to create a page table for the process. The page table includes page table entries. The page table entries record the address of the physical page corresponding to the virtual address of the process.

[0060] In some embodiments, if the process sends a memory allocation request when the memory space allocated to it by the operating system does not meet its runtime needs, then after allocating physical pages of memory to the process, the page table of the process needs to be modified so that the page table entry of the page table records the address of the physical page corresponding to the virtual address of the process.

[0061] In some embodiments, after a physical page of memory is allocated to the process, the process can operate on the physical page, while other processes whose virtual addresses correspond to the physical page can store data in the physical page but cannot perform other operations. That is, one physical page belongs to only one process.

[0062] Step S703: setting a free bit of the page table entry corresponding to the physical page; establishing a mapping relationship between the physical page and the virtual address of the process; the page table entry corresponding to the physical page is obtained by obtaining the page table entry corresponding to the virtual address determined by the physical page according to the mapping relationship; the free bit is a software reserved bit of the page table entry; the setting of the free bit indicates that the process has operation permission on the physical page.

[0063] In some embodiments, a page table entry corresponding to the virtual address is searched in a local translation look-aside buffer (TLB). If there is no page table entry corresponding to the virtual address in the TLB, a page table entry corresponding to the virtual address is searched in a memory.

[0064] In some embodiments, continuing with the above Figure 4 Taking the upper attributes shown in as an example, setting an idle bit of the page table entry corresponding to the physical page is to set any bit in the [58:55] bits of the page table entry corresponding to the physical page to 1, for example Figure 8 The page table entry shown has bit 55 set to 1. As can be understood, Figure 8 Only bit 55 of the page table entry is shown as being set to 1, but bit 56, bit 57 or bit 58 of the page table entry may also be set to 1, and this application does not limit this. It is understandable that if all the free bits of the page table entry are 0 or empty, the process does not have the operation permission for the physical page.

[0065] In some embodiments, by setting an idle bit of a page table entry corresponding to the physical page, the memory is isolated in units of pages, such as Fig. 9 As shown. There is no need to establish an additional data structure, the memory management cost is low, and the permission can be directly searched through the page table entry, so the time consumed in searching the permission is less. At the same time, in the process of searching the address of the physical page through the page table entry, the permission of the process can also be searched at the same time, so the time consumed when operating the physical page will be less.

[0066] In some embodiments, the operation permissions include access permissions, permissions to unmap, and permissions to modify access permissions. The access permissions include permissions to read and write. The permissions to modify access permissions include permissions to modify between system level (EL1) access as read / write, all levels as read / write, system level (EL1) access as read-only, and all levels as read-only.

[0067] Please refer to Fig.10, is a schematic diagram of a memory operation method in a memory management method provided in an embodiment of the present application. The memory operation method includes:

[0068] Step S1001: receiving a memory operation request sent by a process, wherein the memory operation request includes a virtual address of the process.

[0069] In the operating system, a process enters the kernel state through a system call, and then the kernel executes the program and returns to the process after execution is completed.

[0070] In some embodiments, the operation of the process on the memory is indirect, and the process can request a service from the kernel through a system call. The memory operation request is initiated by the process calling a system call.

[0071] Step S1002: In response to the memory operation request, determine whether the idle bit of the page table entry corresponding to the virtual address is set. If the idle bit of the page table entry corresponding to the virtual address is set, execute step S1003. If the idle bit of the page table entry corresponding to the virtual address is not set, execute step S1004.

[0072] The process of determining the page table entry corresponding to the virtual address is the same as above. Figure 2 The process of determining the page table entry according to the virtual address in is the same, and will not be repeated here. It can be understood that the present application can also query the page table entry corresponding to the virtual address through hardware instructions such as Arm AT (address translation) instructions, and the present application does not limit this.

[0073] In some embodiments, whether the idle bit is set is whether the idle bit is set to 1. Whether the idle bit is set indicates whether the process has the operation permission for the physical page. If the idle bit is set, it indicates that the process has the operation permission for the physical page; if the idle bit is not set, it indicates that the process does not have the operation permission for the physical page.

[0074] Understandably, according to Figure 7 The different idle bits set in the , determine whether to set the idle bits are also different, for example, if Figure 7 In the example, bit 55 of the page table entry is set, and bit 55 of the page table entry corresponding to the virtual address is determined. This application does not impose any restrictions on this.

[0075] Step S1003: allowing the process to operate on the physical page corresponding to the physical address corresponding to the virtual address.

[0076] In some embodiments, the process operates on the physical page indirectly, that is, the process calls the interface and enters the kernel. After the kernel determines that the process operation is allowed, the kernel directly performs the operation and returns to the process after the operation. Fig.10In the process, the kernel returns a successful operation to the process.

[0077] Step S1004: prohibiting the process from operating the physical page corresponding to the physical address corresponding to the virtual address.

[0078] In some embodiments, after the kernel prohibits the process from operating the physical page corresponding to the physical address corresponding to the virtual address, Fig.10 As shown in , returns the operation failure to the process.

[0079] The memory operation request includes a memory access request, a memory mapping release request, or a memory access permission modification request. The following will describe when the memory operation request is a memory access request, a memory mapping release request, or a memory access permission modification request.

[0080] Please refer to Fig.11 , is a schematic diagram of a memory access method in a memory management method provided in an embodiment of the present application. The memory access method includes:

[0081] Step S1101: receiving a memory access request sent by a process, wherein the memory access request includes a virtual address of the process.

[0082] In some embodiments, the process's access to the memory is indirect, and the process can request a service from the kernel through a system call. The memory access request is initiated by the process calling a system call.

[0083] Step S1102: In response to the memory access request, determine whether the idle bit of the page table entry corresponding to the virtual address is set. If the idle bit of the page table entry corresponding to the virtual address is set, execute step S1103. If the idle bit of the page table entry corresponding to the virtual address is not set, execute step S1104.

[0084] Step S1102 in the memory access method and Fig.10 Similar to step S1002 in the memory operation method, step S1102 in the memory access method can refer to step S1002 in the memory operation method, which will not be repeated here.

[0085] Step S1103: allowing the process to access data in the physical page corresponding to the physical address corresponding to the virtual address.

[0086] In some embodiments, the process's access to data in memory is indirect. After the process calls the interface, it enters the kernel. After the kernel determines that the process has access rights, the kernel directly performs the access and returns to the process after the access. Fig.11 In the process, the kernel returns access success to the process.

[0087] Step S1104: prohibiting the process from accessing the data in the physical page corresponding to the physical address corresponding to the virtual address.

[0088] In some embodiments, after the kernel prohibits the process from accessing the data in the physical page corresponding to the physical address corresponding to the virtual address, Fig.11 As shown in , the kernel returns an access failure to the process.

[0089] Please refer to Fig.12 , is a schematic diagram of a method for removing memory mapping in a memory management method provided in an embodiment of the present application. The method for removing memory mapping includes:

[0090] Step S1201: receiving a memory mapping release request sent by a process, wherein the memory mapping release request includes a virtual address of the process.

[0091] In some embodiments, the process may indirectly unmap the memory, and the process may request a service from the kernel through a system call. The memory unmapping request is initiated by the process calling a system call.

[0092] Step S1202: In response to the request to release memory mapping, determine whether the idle bit of the page table entry corresponding to the virtual address is set. If the idle bit of the page table entry corresponding to the virtual address is set, execute step S1203. If the idle bit of the page table entry corresponding to the virtual address is not set, execute step S1204.

[0093] Step S1202 in the method for releasing memory mapping and Fig.10 Similar to step S1002 in the memory operation method, step S1202 in the memory mapping release method can refer to step S1002 in the memory operation method, which will not be repeated here.

[0094] Step S1203: clearing the free bit of the page table entry corresponding to the physical page.

[0095] In some embodiments, if the idle bit is cleared, the idle bit will not be set, the process will no longer have the operation permission for the physical page, and the mapping relationship between the virtual address of the process and the physical address of the memory corresponding to the physical page will be unmapped. Subsequent processes will not be able to operate on the physical page.

[0096] Understandably, according to Figure 7 Different idle bits are set in the , and different idle bits are cleared. For example, if Figure 7 In the example, bit 55 of the page table entry is set, and the cleared free bit of the page table entry is also bit 55 of the page table entry. This application does not impose any limitation on this.

[0097] In some embodiments, the process releases the memory mapping indirectly. After the process calls the interface and enters the kernel, the kernel determines that the process has the permission to release the mapping relationship, and then directly clears the free bit of the page table entry to zero, and then returns to the process. Fig.12 In the process, the kernel returns the successful release to the process.

[0098] Step S1204: reject the request to release the memory mapping.

[0099] In some embodiments, after the kernel rejects the request to release the memory mapping, Fig.12 As shown in , the kernel returns the unwind failure to the process.

[0100] Please refer to Fig.13 , is a schematic diagram of a method for modifying memory access permissions in a memory management method provided in an embodiment of the present application. The method for modifying memory access permissions includes:

[0101] Step S1301: receiving a request for modifying memory access rights sent by a process, wherein the request for modifying memory access rights includes a virtual address of the process.

[0102] In some embodiments, the process's modification access right to the memory is indirect, and the process can request a service from the kernel through a system call. The modification memory access right request is initiated by the process calling a system call.

[0103] Step S1302: In response to the request to modify the memory access permission, determine whether the idle bit of the page table entry corresponding to the virtual address is set. If the idle bit of the page table entry corresponding to the virtual address is set, execute step S1303. If the idle bit of the page table entry corresponding to the virtual address is not set, execute step S1304.

[0104] Step S1302 in the method for modifying memory access permissions is the same as Fig.10 Similar to step S1002 in the memory operation method, step S1302 in the method for modifying memory access permissions can refer to step S1002 in the memory operation method, which will not be repeated here.

[0105] Step S1303: modifying the data access permission bit of the page table entry corresponding to the physical page according to the memory access permission modification request.

[0106] In some embodiments, the request to modify the memory access permission may also include the access permission requested to be modified, and the data access permission bit of the page table item corresponding to the physical page is modified according to the modified access permission in the request to modify the memory access permission. For example, if the data access permission bit of the page table item corresponding to the physical page is 01, and the access permission requested to be modified is read-only for all levels, the data access permission bit of the page table item is modified to 11 according to the modified access permission in the request to modify the memory access permission. Subsequent processes will be able to read the physical page, but will not be able to write to the physical page.

[0107] In some embodiments, the process modifies the memory access permission indirectly. After the process calls the interface and enters the kernel, the kernel determines that the process has the permission to modify the access permission. Then, the kernel directly modifies the data access permission bit of the page table entry corresponding to the physical page, and returns to the process after the modification. Fig.13 In the process, the kernel returns a successful modification to the process.

[0108] Step S1304: reject the request to modify the memory access permission.

[0109] In some embodiments, after the kernel denies the request to modify the memory access permission, Fig.13 As shown in , the kernel returns the modification failure to the process.

[0110] Please refer to Fig.14 , is a schematic diagram of an authorization permission method in a memory management method provided in an embodiment of the present application. The authorization permission method includes:

[0111] Step S1401: receiving an authorization permission request sent by a process, wherein the authorization permission request includes a virtual address of the process and a virtual address of a process to be authorized.

[0112] In some embodiments, the authorization authority of a process to other processes is indirect, and the process can request services from the kernel through a system call. The authorization authority request is initiated by the process calling a system call.

[0113] Step S1402: In response to the authorization permission request, determine whether the idle bit of the page table entry corresponding to the virtual address of the process is set. If the idle bit of the page table entry corresponding to the virtual address of the process is set, execute step S1403. If the idle bit of the page table entry corresponding to the virtual address of the process is not set, execute step S1404.

[0114] Step S1402 in the authorization method and Fig.10 Similar to step S1002 in the memory operation method, step S1402 in the authorization permission method can refer to step S1002 in the memory operation method, which will not be repeated here.

[0115] Step S1403: setting the free bit of the page table entry corresponding to the virtual address of the process to be authorized in the authorization permission request.

[0116] In some embodiments, the page table entry corresponding to the virtual address of the process to be authorized may include the address of the physical page, and the idle bit of the page table entry corresponding to the virtual address of the process to be authorized may be set so that the process to be authorized has operation permissions on the physical page.

[0117] In some embodiments, the page table entry corresponding to the virtual address of the process to be authorized may not include the address of the physical page. In this case, not only is it necessary to set the free bit of the page table entry corresponding to the virtual address of the process to be authorized, but it is also necessary to add the address of the physical page to the page table entry so that the process to be authorized has operation permissions on the physical page.

[0118] In some embodiments, the authorization of the process to the permission is indirect, that is, the process calls the interface and enters the kernel. After the kernel determines that the process has the authorized permission, the kernel directly sets the idle bit of the page table entry corresponding to the virtual address of the process to be authorized, and then returns to the process after setting it. Fig.14 In the process, the kernel returns authorization success to the process.

[0119] Step S1404: reject the authorization permission request.

[0120] In some embodiments, after the kernel rejects the authorization permission request, Fig.14 As shown in , the kernel returns an authorization failure to the process.

[0121] It can be understood that in step S1403, the kernel not only sets the free bit of the page table entry corresponding to the virtual address of the process to be authorized in the authorization permission request, but also clears the free bit of the page table entry corresponding to the virtual address of the process in the authorization permission request, so that the process no longer has operation permissions on the physical page. This application does not impose any restrictions on this.

[0122] It can be understood that the above-mentioned memory management method, memory operation method, memory access method, memory mapping release method, memory access right modification method, and authorization permission method can be used not only for microkernels, but also for macrokernels, and this application does not impose any restrictions on this.

[0123] Please refer to Fig.15, is a logical diagram of a memory management device provided in an embodiment of the present application. The memory management device 150 is set in the kernel of the operating system, and the process can use the method provided by the memory management device 150 through system calls. The memory management device 150 includes an allocation module 1501, an operation module 1502 and an authorization module 1503. The operation module 1502 includes an access module 1504, a demapping module 1505 and a modification access permission module 1506.

[0124] The allocation module 1501 is used to receive a memory allocation request sent by a process; in response to the memory allocation request, allocate a physical page of memory to the process; set a free bit of a page table entry corresponding to the physical page; establish a mapping relationship between the physical page and the virtual address of the process; the page table entry corresponding to the physical page is obtained by the page table entry corresponding to the virtual address determined by the physical page according to the mapping relationship; the free bit is a software reserved bit of the page table entry; the setting of the free bit indicates that the process has operation authority over the physical page.

[0125] The operation module 1502 is used to receive a memory operation request sent by a process, wherein the memory operation request includes a virtual address of the process; in response to the memory operation request, determine whether the idle bit of the page table entry corresponding to the virtual address is set; if the idle bit of the page table entry corresponding to the virtual address is set, the process is allowed to operate on the physical page corresponding to the physical address corresponding to the virtual address. The operation module 1502 is also used to prohibit the process from operating on the physical page corresponding to the physical address corresponding to the virtual address if the idle bit of the page table entry corresponding to the virtual address is not set.

[0126] The authorization module 1503 is used to receive an authorization permission request sent by a process, wherein the authorization permission request includes the virtual address of the process and the virtual address of the process to be authorized; in response to the authorization permission request, determine whether the free bit of the page table item corresponding to the virtual address of the process is set; if the free bit of the page table item corresponding to the virtual address of the process is set, then the free bit of the page table item corresponding to the virtual address of the process to be authorized in the authorization permission request is set. The authorization module 1503 is also used to clear the free bit of the page table item corresponding to the virtual address of the process in the authorization permission request if the free bit of the page table item corresponding to the virtual address of the process is set. The authorization module 1503 is also used to reject the authorization permission request if the free bit of the page table item corresponding to the virtual address of the process is not set.

[0127] The access module 1504 is used to receive a memory access request sent by a process, wherein the memory access request includes a virtual address of the process; in response to the memory access request, determine whether the idle bit of the page table entry corresponding to the virtual address is set; if the idle bit of the page table entry corresponding to the virtual address is set, the process is allowed to access the data in the physical page corresponding to the physical address corresponding to the virtual address. The access module 1504 is also used to prohibit the process from accessing the data in the physical page corresponding to the physical address corresponding to the virtual address if the idle bit of the page table entry corresponding to the virtual address is not set.

[0128] The de-mapping module 1505 is used to receive a de-memory mapping request sent by a process, wherein the de-memory mapping request includes the virtual address of the process; in response to the de-memory mapping request, determine whether the free bit of the page table entry corresponding to the virtual address is set; if the free bit of the page table entry corresponding to the virtual address is set, clear the free bit of the page table entry corresponding to the physical page. The de-mapping module 1505 is also used to reject the de-memory mapping request if the free bit of the page table entry corresponding to the virtual address is not set.

[0129] The access permission modification module 1506 is used to receive a request for modifying memory access permission sent by a process, wherein the request for modifying memory access permission includes the virtual address of the process; in response to the request for modifying memory access permission, determine whether the free bit of the page table entry corresponding to the virtual address is set; if the free bit of the page table entry corresponding to the virtual address is set, modify the data access permission bit of the page table entry corresponding to the physical page according to the request for modifying memory access permission. The access permission modification module 1506 is also used to reject the request for modifying memory access permission if the free bit of the page table entry corresponding to the virtual address is not set.

[0130] Please refer to Fig.16 , which is a schematic diagram of the structure of a computer device provided in this embodiment. The computer device 160 may be a smart phone, a smart home device (such as a large-screen TV, a smart TV, a smart voice device, etc.), an auxiliary automatic driving device, or an unmanned driving device, etc. The computer device 160 may include a communication module 1610, a sensor 1620, a user input unit 1630, an output unit 1640, a processor 1650, an audio and video input unit 1660, a memory 1670, and a power supply 1680.

[0131] The communication module 1610 may include at least one module that enables the computer device to communicate with a communication system or other computer devices. For example, the communication module 1610 may include one or more of a wired network interface, a broadcast receiving module, a mobile communication module, a wireless Internet module, a local area communication module, and a location (or positioning) information module.

[0132] The sensor 1620 may sense the current state of the system, such as an open / closed state, a position, whether there is contact with a user, a direction, and acceleration / deceleration, and the sensor 1620 may generate a sensing signal for controlling the operation of the system.

[0133] The user input unit 1630 is used to receive input digital information, character information or contact touch operation / contactless gesture, and receive signal input related to user settings and function control of the system, etc. The user input unit 1630 includes a touch panel and / or other input devices.

[0134] The output unit 1640 includes a display panel for displaying information input by the user, information provided to the user, or various menu interfaces of the system. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED). In some other embodiments, the touch panel can cover the display panel to form a touch display screen. In addition, the output unit 1640 can also include an audio output unit, an alarm, a tactile module, etc.

[0135] The audio and video input unit 1660 is used to input audio signals or video signals. The audio and video input unit 1660 may include a camera 1660A and a microphone 1660B.

[0136] The power supply 1680 may receive external power and internal power under the control of the processor 1650 and provide power required for the operation of various components of the system.

[0137] Processor 1650 may indicate one or more processors. For example, processor 1650 may include one or more central processing units, or include a central processing unit and a graphics processor, or include an application processor and a coprocessor (such as a microcontroller unit or a neural network processor). When processor 1650 includes multiple processors, these multiple processors may be integrated on the same chip or may be independent chips. A processor may include one or more physical cores, where a physical core is the smallest processing unit.

[0138] The memory 1670 stores computer programs, including application programs 1671 and operating system programs 1672. Typical operating systems include microkernel operating systems such as seL4, L4, Hongmeng system, or Fuchsia provided by Google; systems for desktops or notebooks such as Windows from Microsoft and MacOS from Apple; and systems for mobile terminals such as Android developed by Google.

[0139] The memory 1670 may be one or more of the following types: flash memory, hard disk type memory, micro multimedia card type memory, card memory (such as SD or XD memory), random access memory (RAM), static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable ROM (PROM), magnetic memory, magnetic disk or optical disk. In some other embodiments, the memory 1670 may also be a network storage device on the Internet, and the system may perform operations such as updating or reading the memory 1670 on the Internet.

[0140] The processor 1650 is used to read the computer program in the memory 1670, and then execute the method defined by the computer program, for example, the processor 1650 reads the operating system program 1672 to run the operating system on the system and implement various functions of the operating system, or reads one or more application programs 1671 to run applications on the system. If the solution provided by the present application is implemented in the form of software, it can be stored in the memory 1670 in the form of a computer program, specifically, in the form of all or part of the operating system program 1672, and read and executed by the processor 1650. The processor 1650 is the control center of the computer device 160, and uses various interfaces and lines to connect various parts of the entire computer device 160.

[0141] The memory 1670 also stores other data 1673 besides the computer program, such as the page table involved in this application.

[0142] Those skilled in the art will understand that Fig.16 The structure shown in the figure does not constitute a limitation on the computer device 160. The computer device 160 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently.

[0143] In addition to the above method and device, the embodiment of the present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program, wherein the program enables the computer device to execute Figure 7 The memory management method shown, Fig.10 The memory operation method shown, Fig.11 The memory access method shown, Fig.12The method of unmapping memory shown, Fig.13 The method for modifying memory access permissions shown, and Fig.14 The authorization permission method shown.

[0144] A computer program product, the computer program product comprising computer executable instructions, the computer executable instructions being stored in a computer readable storage medium; at least one processor of a device can read the computer executable instructions from the computer readable storage medium, and the at least one processor executes the computer executable instructions so that the device implements Figure 7 The memory management method shown, Fig.10 The memory operation method shown, Fig.11 The memory access method shown, Fig.12 The method of unmapping memory shown, Fig.13 The method for modifying memory access permissions shown, and Fig.14 The authorization permission method shown.

[0145] The present application allocates a physical page of memory to a process upon receiving a memory allocation request sent by the process, and also sets a free bit of a page table entry corresponding to the physical page, so that the process has operation permissions on the physical page. Only a page table entry is needed to identify whether the process has operation permissions on the physical page, so there is no need to establish an additional data structure. At the same time, the memory is isolated in units of pages, reducing management costs and time costs.

[0146] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0147] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0148] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.

Claims

1. A memory management method, characterized in that: The method comprises: Receive memory allocation requests sent by the process; In response to the memory allocation request, allocating physical pages of memory to the process; A free bit of the page table entry corresponding to the physical page is set; a mapping relationship is established between the physical page and the virtual address of the process; the page table entry corresponding to the physical page is obtained by the page table entry corresponding to the virtual address determined by the physical page according to the mapping relationship; the free bit is a software reserved bit of the page table entry; the setting of the free bit indicates that the process has operation permission on the physical page.

2. The method according to claim 1, characterized in that The method further comprises: receiving a memory operation request sent by the process, wherein the memory operation request includes a virtual address of the process; In response to the memory operation request, determining whether the free bit of the page table entry corresponding to the virtual address of the process is set; If the idle bit of the page table entry corresponding to the virtual address of the process is in the position, the process is allowed to operate on the physical page corresponding to the physical address corresponding to the virtual address.

3. The method according to claim 1, characterized in that The method further comprises: receiving a memory access request sent by the process, wherein the memory access request includes a virtual address of the process; In response to the memory access request, determining whether the free bit of the page table entry corresponding to the virtual address of the process is set; If the idle bit of the page table entry corresponding to the virtual address of the process is set to the position, the process is allowed to access data in the physical page corresponding to the physical address corresponding to the virtual address.

4. The method according to claim 3, characterized in that The method further comprises: If the idle bit of the page table entry corresponding to the virtual address of the process is not set, the process is prohibited from accessing data in the physical page corresponding to the physical address corresponding to the virtual address.

5. The method according to claim 1, characterized in that The method further comprises: Receiving a memory mapping release request sent by the process, wherein the memory mapping release request includes a virtual address of the process; In response to the memory de-mapping request, determining whether the free bit of the page table entry corresponding to the virtual address of the process is set; If the idle bit of the page table entry corresponding to the virtual address of the process is set to zero, the idle bit of the page table entry corresponding to the physical page is cleared to zero.

6. The method according to claim 1, characterized in that The method further comprises: receiving a request for modifying memory access permission sent by the process, wherein the request for modifying memory access permission includes a virtual address of the process; In response to the request to modify the memory access permission, determining whether the free bit of the page table entry corresponding to the virtual address of the process is set; If the free bit of the page table entry corresponding to the virtual address of the process is set to a zero, the data access permission bit of the page table entry corresponding to the physical page is modified according to the request to modify the memory access permission.

7. The method according to claim 1, characterized in that The method further comprises: Receiving an authorization permission request sent by the process, wherein the authorization permission request includes a virtual address of the process and a virtual address of a process to be authorized; In response to the authorization permission request, determining whether the free bit of the page table entry corresponding to the virtual address of the process is set; If the idle bit of the page table entry corresponding to the virtual address of the process is set to a position, the idle bit of the page table entry corresponding to the virtual address of the process to be authorized in the authorization permission request is set to a position.

8. The method according to claim 7, characterized in that The method further comprises: If the idle bit of the page table entry corresponding to the virtual address of the process is in a position, the idle bit of the page table entry corresponding to the virtual address of the process in the authorization permission request is cleared.

9. A computer device, characterized in that: The computer device includes at least one processor, a memory and a communication module; The at least one processor is coupled to the memory and the communication module; The memory is used to store instructions, the processor is used to execute the instructions, and the communication module is used to communicate with other devices under the control of the at least one processor; When the instruction is executed by the at least one processor, the at least one processor executes the memory management method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program, and the program enables a computer device to execute the memory management method according to any one of claims 1 to 8.

11. A computer program product, characterized in that The computer program product includes computer execution instructions, which are stored in a computer-readable storage medium; at least one processor of an electronic device can read the computer execution instructions from the computer-readable storage medium, and the at least one processor executes the computer execution instructions so that the electronic device executes the memory management method as described in any one of claims 1 to 8.