CN116680210A - Storage space access method, device, equipment and storage medium - Google Patents

Storage space access method, device, equipment and storage medium Download PDF

Info

Publication number
CN116680210A
CN116680210A CN202310558047.9A CN202310558047A CN116680210A CN 116680210 A CN116680210 A CN 116680210A CN 202310558047 A CN202310558047 A CN 202310558047A CN 116680210 A CN116680210 A CN 116680210A
Authority
CN
China
Prior art keywords
target
address
virtual address
physical address
table entry
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.)
Pending
Application number
CN202310558047.9A
Other languages
Chinese (zh)
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.)
Longxin Zhongke Liaoning Technology Co ltd
Original Assignee
Longxin Zhongke Liaoning 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 Longxin Zhongke Liaoning Technology Co ltd filed Critical Longxin Zhongke Liaoning Technology Co ltd
Priority to CN202310558047.9A priority Critical patent/CN116680210A/en
Publication of CN116680210A publication Critical patent/CN116680210A/en
Pending legal-status Critical Current

Links

Classifications

    • 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/1027Address translation using associative or pseudo-associative address translation means, e.g. translation look-aside buffer [TLB]
    • 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
    • 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/109Address translation for multiple virtual address spaces, e.g. segmentation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application discloses a storage space access method, a device, equipment and a storage medium, which relate to the technical field of computer firmware development and comprise the following steps: under the condition of BIOS starting and running, acquiring a table entry set, wherein each table entry in the table entry set is used for recording the mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types; responding to the access request, and acquiring a target virtual address in the access request; under the condition that the target virtual address is of a first bit number type, acquiring a target physical address of a second bit number type from a target table entry of the first bit number type; according to the target physical address, the corresponding storage space is accessed, so that an access request is completed, access to the storage space based on the BIOS is realized, the mapping relation between virtual addresses and physical addresses of various bit numbers is supported, and the problem that the access mode of the storage space in the prior art is limited is solved.

Description

Storage space access method, device, equipment and storage medium
Technical Field
The application belongs to the technical field of computer firmware development, and particularly relates to a storage space access method, a storage space access device, storage space access equipment and a storage medium.
Background
In the prior art, during the starting and running process of the BIOS, a mapping relationship between a virtual address and a physical address of a fixed bit number type (64 bits) is often adopted to access a storage space corresponding to the physical address.
In carrying out the present application, the inventors have found that at least the following problems exist in the prior art: because the number of bits of the virtual address in the mapping relationship is fixed, the access mode to the memory space is limited, and chips with multiple number of bits cannot be supported.
Disclosure of Invention
The application aims to provide a storage space access method, a device, equipment and a storage medium, which at least solve the problem that the access mode of the storage space is limited due to the fixed bit number type of a virtual address in a mapping relation in the prior art.
In order to solve the technical problems, the application is realized as follows:
in a first aspect, an embodiment of the present application provides a storage space access method, where the method includes:
under the condition of BIOS starting and running, acquiring a table entry set, wherein each table entry in the table entry set is used for recording the mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types;
Responding to an access request of a central processing unit, and acquiring a target virtual address in the access request;
acquiring a target physical address of a second bit type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address under the condition that the target virtual address is of the first bit type;
and accessing the corresponding storage space according to the target physical address, thereby completing the access request.
In a second aspect, an embodiment of the present application further provides a storage space access apparatus, where the apparatus includes:
the first acquisition module is used for acquiring a table entry set under the condition of BIOS starting and running, wherein each table entry in the table entry set is used for recording the mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types;
the second acquisition module is used for responding to an access request of the central processing unit and acquiring a target virtual address in the access request;
the third obtaining module is used for obtaining a target physical address of a second bit number type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address under the condition that the target virtual address is of the first bit number type;
And the access module is used for accessing the corresponding storage space according to the target physical address so as to finish the access request.
In a third aspect, an embodiment of the present application further provides an electronic device, including a processor, a memory, and a program or instructions stored on the memory and executable on the processor, the program or instructions implementing the steps of the method according to the first aspect when executed by the processor.
In a fourth aspect, embodiments of the present application also provide a readable storage medium having stored thereon a program or instructions which when executed by a processor implement the steps of the method according to the first aspect.
In the embodiment of the application, under the condition of BIOS starting and running, a table item set is obtained, each table item in the table item set is used for recording the mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types; responding to an access request of a central processing unit, and acquiring a target virtual address in the access request; under the condition that the target virtual address is of a first bit number type, acquiring a target physical address of a second bit number type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address; according to the target physical address, the corresponding storage space is accessed, so that an access request is completed, access to the storage space based on the BIOS is realized, and as the bit number type of the virtual address comprises a plurality of first bit number types, the mapping relation between the virtual address and the physical address of a plurality of bit number types can be supported, the diversity of the mode of accessing the storage space is improved, and the problem that the mode of accessing the storage space is limited due to the fact that the bit number type of the virtual address in the mapping relation is fixed in the prior art is solved.
Drawings
FIG. 1 is a flowchart illustrating steps of a method for accessing a storage space according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating steps of a method for accessing a storage space according to an embodiment of the present application;
FIG. 3 is a schematic diagram of an entry with a dynamic entry type according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a memory space access flow according to an embodiment of the present application;
FIG. 5 is a block diagram of a memory space accessing apparatus according to an embodiment of the present application;
fig. 6 is a schematic hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The storage space access method provided by the embodiment of the application is described in detail below through specific embodiments and application scenes thereof with reference to the accompanying drawings.
Fig. 1 is a flowchart of steps of a method for accessing a storage space according to an embodiment of the present application, where, as shown in fig. 1, the method may include:
step 101, under the condition of starting and running the BIOS, acquiring an item set.
Each table entry in the table entry set is used for recording a mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types.
It should be noted that the BIOS, i.e. the basic input/output system, is a set of programs solidified on a ROM (Read-Only Memory) chip on a motherboard in a computer, and stores the most important basic input/output program, the self-checking program after starting up and the system self-starting program of the computer, and can Read and write specific information of system settings from CMOS (a chip for storing basic starting information of the computer), and its main function is to provide the bottommost and most direct hardware settings and control for the computer. In addition, the BIOS provides some system parameters to the operating system.
The BIOS needs to execute the program at the start-up and running time, which needs to access the storage space corresponding to the program, and accessing the storage space needs to be a storage space access method of mapping the virtual address to the physical address. Therefore, when the BIOS starts, the table entry set needs to be created first, so that the BIOS starts and obtains the created table entry set during running, and then accesses the storage space corresponding to the running program according to the mapping relationship between the virtual address and the physical address recorded in the table entry set.
In order to facilitate the compiler and the operating system to arrange the address distribution of the program, i.e. the program can use a series of adjacent virtual addresses to access non-adjacent large memory buffers in the physical memory, and also to facilitate the isolation between processes, i.e. the virtual addresses used by different processes are isolated from each other, the code in one process cannot change the physical memory being used by another process, so that the mapping between the virtual addresses and the physical addresses needs to be accomplished by MMU (Memory Management Unit ) using the mapping relationship of the virtual addresses and the physical addresses.
The storage space corresponding to the physical address is an entity actually existing in the computers, and the unique independence, namely the physical memory, is maintained in each computer; as on a 32-bit machine, the size of the physical space can theoretically reach 32 bytes (4 GB) of 2. The virtual address does not actually exist in the computer. Each process is allocated its own virtual space and can only access the space it is allocated to use. In theory, the storage space corresponding to the virtual address is limited by the physical memory size, and if a 4GB memory is set for the storage space corresponding to the virtual address, the address range of the storage space corresponding to the virtual address should be 0x 00000000-0 xFFFFFFFF.
The page table is a special data structure, records the mapping relation between virtual addresses and physical addresses, each process has a corresponding page table, and the page table comprises a plurality of table entries (i.e. page table entries), and each table entry records the mapping relation between a virtual address and a physical address.
The TLB (Translation Lookaside Buffer, a translation look-aside buffer, simply referred to as a "fast table") is a cache of page tables, which stores copies of entries, i.e., partial entries, that are most likely to be accessed currently. Under the condition that the TLB cannot complete the address translation task, namely under the condition that the target table entry corresponding to the target virtual address cannot be found in the TLB, the target table entry corresponding to the target virtual address is found in the memory.
The set of entries may be page tables or partial entries in page tables.
The number of bits of the virtual address, i.e. the number of bits of the binary representation used by the virtual address, is for example 16 bits, i.e. the number of bits of the virtual address is represented by a 16-bit binary representation (the range of the hexadecimal form is 0x0000-0 xFFFF), which takes up 2 bytes. The bit number type of the virtual address comprises a plurality of first bit number types, namely the bit number type of the virtual address is various, for example, the bit number type of the virtual address can be 16 bits, 32 bits, 64 bits and the like; similarly, the description of the type of bits of the physical address is similar and will not be repeated here.
In the embodiment of the application, under the condition of starting and running the BIOS, in order to access the storage space corresponding to the physical address, the mapping relation between the virtual address and the physical address needs to be acquired first, and the mapping relation between the virtual address and the physical address is recorded in the table entry, so that the table entry set needs to be acquired first, and then the storage space is accessed. In addition, as the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types, for one physical address, a mapping relation between the virtual address with a plurality of bit number types and the physical address can be established, and for one physical address with a plurality of bit number types, the physical address with a plurality of bit number types, namely, the bit number type of the physical address with a mapping relation with the virtual address can be adapted, so that the mapping relation between the virtual address with a plurality of bit number types and the physical address can be realized, a plurality of modes of accessing the storage space can be realized, the mapping between the virtual address and the physical address with a plurality of bit number types can be supported, and external devices using physical addresses with different bit number types can be further supported, and the diversity and compatibility of support for external devices can be increased.
For example, for a physical address 0x1000, the number of bits of the physical address is 16 bits, and a mapping relationship can be established between a virtual address with multiple number of bits and the physical address, for example, a mapping relationship between a virtual address 0x1000 with the number of bits of 16 bits and a physical address 0x1000 is created, or a mapping relationship between a virtual address 0x10000000 with the number of bits of 32 bits and a physical address 0x1000 is created, or a mapping relationship between a virtual address 0x1000000000000000 with the number of bits of 64 bits and a physical address 0x1000 is created.
For a virtual address 0x1000, the number of bits of the virtual address is 16 bits, and a mapping relationship can be established between a plurality of physical addresses with the number of bits and the virtual address, for example, a mapping relationship between a physical address 0x1000 with the number of bits being 16 bits and the virtual address 0x1000, a mapping relationship between a physical address 0x10000000 with the number of bits being 32 bits and the virtual address 0x1000, or a mapping relationship between a physical address 0x1000000000000000 with the number of bits being 64 bits and the virtual address 0x1000 can be established.
Step 102, responding to an access request of a central processing unit, and acquiring a target virtual address in the access request.
In the embodiment of the present application, when a central processing unit (Central Processing Unit, i.e., a CPU) needs to access a storage space, the central processing unit may issue an access request, where the access request includes a target virtual address to be accessed, the target virtual address may be obtained, so that according to the target virtual address, a target physical address may be found through a mapping relationship between the target virtual address and a corresponding target physical address, and the corresponding storage space is accessed according to the target physical address, thereby completing the access request.
Step 103, when the target virtual address is of the first bit number type, obtaining a target physical address of a second bit number type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address.
In the embodiment of the application, under the condition that the target virtual address is of a first bit number type, the target table entry corresponding to the target virtual address is required to be found from all the table entries of the first bit number type, then the content in the target table entry of the first bit number type corresponding to the target virtual address is read, and as the mapping relation between the virtual address and the physical address is recorded in the table entry, the target physical address of a second bit number type corresponding to the target virtual address can be obtained according to the target virtual address so as to access the corresponding storage space according to the target physical address, thereby completing the access request.
It should be noted that, the mapping relationship between the virtual address of the first bit number type and the physical address of the second bit number type is recorded in the target table entry of the first bit number type.
For example, when the number of bits of the target virtual address (0 x 1000) is 16 bits, the 32-bit target physical address 0x10000000 corresponding to the target virtual address is acquired from the 16-bit target entry (the mapping relationship between the virtual address 0x1000 and the physical address 0x10000000 is recorded) corresponding to the target virtual address.
Step 104, accessing the corresponding storage space according to the target physical address, thereby completing the access request.
In the embodiment of the application, after the target physical address is acquired, the storage space corresponding to the target physical address can be accessed according to the target physical address so as to realize access of the storage space based on the BIOS.
For example, if the target physical address corresponding to the target virtual address is 0x10000000, the memory space corresponding to the target physical address 0x10000000 is accessed.
The embodiment of the application can be realized, under the condition of BIOS starting and running, a table item set is obtained, each table item in the table item set is used for recording the mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types; responding to an access request of a central processing unit, and acquiring a target virtual address in the access request; under the condition that the target virtual address is of a first bit number type, acquiring a target physical address of a second bit number type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address; according to the target physical address, the corresponding storage space is accessed, so that an access request is completed, access to the storage space based on the BIOS is realized, and as the bit number type of the virtual address comprises a plurality of first bit number types, the mapping relation between the virtual address and the physical address of a plurality of bit number types can be supported, the diversity of the mode of accessing the storage space is improved, and the problem that the mode of accessing the storage space is limited due to the fact that the bit number type of the virtual address in the mapping relation is fixed in the prior art is solved.
Fig. 2 is a flowchart of specific steps of a method for accessing a storage space according to an embodiment of the present application, as shown in fig. 2, the method may include:
step 201, under the condition of starting and running the BIOS, acquiring an entry set.
Each table entry in the table entry set is used for recording a mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types.
The implementation of this step is similar to the implementation of step 101, and will not be described here again.
Optionally, in some embodiments, the step of obtaining the set of entries in the event of the BIOS startup includes the following sub-steps (sub-step 2011, sub-step 2012
In the sub-step 2011, under the condition that the BIOS is started, according to each virtual address and a corresponding physical address, creating a table entry corresponding to each virtual address, and storing each table entry in the database.
In the embodiment of the application, under the condition of BIOS startup, all the table entries are required to be created, namely, the table entry corresponding to each virtual address is created according to each virtual address and a corresponding physical address, and all the table entries are stored in a database, so that when the storage space needs to be accessed, a table entry set is acquired from the database, further, a target table entry corresponding to a target virtual address is acquired, and the corresponding storage space is accessed according to the target physical address corresponding to the target virtual address in the target table entry.
For example, if the server shares n storage spaces corresponding to physical addresses, under the condition that the BIOS is started, creating an entry 1 corresponding to the virtual address 1, where the mapping relationship between the virtual address 1 and the physical address 1 is recorded in the entry 1; creating a table entry 2 corresponding to the virtual address 2, wherein the table entry 2 records the mapping relation between the virtual address 2 and the physical address 2; creating a table entry 3 corresponding to the virtual address 3, recording a mapping relation between the virtual address 3 and the physical address 3 in the table entry 3, and thus pushing … …, creating a table entry n corresponding to the virtual address n, recording a mapping relation between the virtual address n and the physical address n in the table entry n, creating n table entries (including the table entry 1, the table entry 2, the table entry 3, … … and the table entry n) altogether, and storing the n table entries in a database.
Substep 2012, constructing and obtaining the table entry set according to all the table entries in the database.
In the embodiment of the application, before the table item set is acquired, the table item set is constructed and acquired according to all table items in a database, then the target table item corresponding to the target virtual address is acquired from the table item set, and the corresponding storage space is accessed according to the target physical address corresponding to the target virtual address in the target table item.
By executing sub-steps 2011 to 2012, in the case of BIOS startup, all the entries are created and stored in the database, so that in the process of BIOS startup and operation, all the entries are obtained from the database, a set of entries is constructed, then a target entry corresponding to the target virtual address is obtained from the set of entries, and further, according to the target physical address corresponding to the target virtual address in the target entry, the corresponding storage space is accessed, so as to complete the access process of the storage space.
Step 202, responding to an access request of a central processing unit, and acquiring a target virtual address in the access request.
The implementation of this step is similar to the implementation of step 102 described above, and will not be described here again.
Step 203, when the target virtual address is of the first bit number type, obtaining a target physical address of a second bit number type mapped corresponding to the target virtual address from a target entry corresponding to the target virtual address.
The implementation of this step is similar to the implementation of step 103, and will not be described here again.
Optionally, in some embodiments, the virtual addresses in the entries have corresponding virtual address ranges; step 203 comprises the following sub-steps (sub-step 2031, sub-step 2032):
In the sub-step 2031, if the target virtual address is of the first bit number type, the target virtual address is matched with a virtual address range in the target table entry, and a matching result is obtained.
In the embodiment of the application, in order to find the target table entry of the first bit number type corresponding to the target virtual address, the target virtual address is required to be matched with the virtual address range in the target table entry of the first bit number type, namely whether the target virtual address falls into the virtual address range in the target table entry is judged, so as to obtain a matching result, and further, under the condition that the matching result is that the target virtual address falls into the virtual address range in the target table entry, the target physical address is obtained from the target table entry corresponding to the target virtual address.
The virtual address range in the table entry can comprise a plurality of virtual addresses, so that when the mapping relation between the virtual addresses and the physical addresses in the table entry is created, the virtual addresses in the mapping relation can be selected in a plurality of ways, namely any one of the virtual addresses in the virtual address range in the table entry can be selected, and the degree of freedom of selecting the mapping relation between the virtual addresses and the physical addresses in the table entry is improved.
For example, the virtual address range in the table entry is 0x10000000 to 0x14000000, and then the virtual address in the mapping relationship between the virtual address and the physical address of the table entry may be selectively set to any one address from 0x10000000 to 0x14000000, for example, the virtual address may be set to 0x10000000, and for example, the virtual address may be set to 0x11000000.
Sub-step 2032, obtaining the target physical address of the second number of digits type of the matching result association mapping from the target table entry.
In the embodiment of the application, the matching result is that the target virtual address falls into the virtual address range in the target table entry, namely, the target table entry of the first bit number type is the table entry corresponding to the target virtual address, and the physical address in the target table entry is the target physical address, and the target physical address is obtained by reading the content of the target table entry so as to access the storage space corresponding to the target physical address according to the target physical address.
For example, for sub-steps 2031 to 2032, for example, the target virtual address of the first bit type is 0x10000000, the first bit type of the target virtual address is 32 bits, the virtual address range in the target table entry of the first bit type is 0x10000000 to 0x14000000, the matching result is that the target virtual address falls into the virtual address range in the target table entry, and the physical address of the second bit type in the target table entry is 0x10000000, and then 0x10000000 is taken as the target physical address, and the memory space corresponding to the target physical address 0x10000000 is accessed.
According to the embodiment of the application, the target table entry of the first bit number type corresponding to the target virtual address is determined according to the target virtual address of the first bit number type, the target table entry can be judged to be the table entry corresponding to the target virtual address under the condition that the target virtual address falls into the virtual address range of the target table entry, and then the target physical address of the second bit number type corresponding to the target virtual address is obtained from the target table entry so as to access the corresponding storage space according to the target physical address, thereby completing the access request and realizing the access process to the storage space.
It should be noted that the first bit number type and the second bit number type may be the same bit number type, and the first bit number type and the second bit number type may also be different bit number types, and there is no association between the two types, so that a mapping relationship between a virtual address of the first bit number type and a physical address of the second bit number type may be freely selected, thereby improving the diversity of modes of accessing the storage space by the central processing unit.
Optionally, in some embodiments, in a case where the entry is a dynamic entry, the entry includes a dynamically set virtual page number and page size, the method further includes:
Step 205, determining the virtual address range according to the virtual page number and the page size in the table entry.
In the embodiment of the application, the table entry is provided with the virtual page number and the page size, and the corresponding virtual address range in the table entry can be determined according to the virtual page number and the page size, namely, the virtual address range in the table entry is determined by the virtual page number and the page size in the table entry, and after the virtual address range is determined, whether the target virtual address falls into the virtual address range of the target table entry can be judged.
Specifically, in some embodiments, the dynamic table entry is an MTLB (Multiple-Page-Size Tra nslation Lookaside Buffer, multiple-Page-sized translation look-aside buffer), where in the case that the table entry is a dynamic table entry, the table entry includes a virtual Page number (i.e., virtual Page Number) and a Page Size (i.e., page Size), the virtual Page number and the Page Size support settings, the virtual address range in the table entry is from the virtual Page number to the Page number obtained by adding the virtual Page number to the Page Size, and the virtual address range includes the Page numbers of the two endpoints (i.e., the virtual Page number, the Page number obtained by adding the virtual Page number to the Page Size), for example, the virtual Page number in the table entry is 0x10000000 and the Page Size is 0x4000000, and the corresponding virtual address range in the determined table entry is 0x10000000 to 0x14000000 (0 x10000000 plus 0x 4000000), and the virtual address range includes 0x10000000 and 0x14000000.
Optionally, in some embodiments, in a case where the target entry is a static entry, the entry includes a dynamically set virtual page number, and the method further includes:
step 206, determining a corresponding virtual address range in the table entry according to the preset fixed page size and the virtual page number in the table entry.
In the embodiment of the application, the page size of the table item with all the table item types being static table items is a preset fixed page size, virtual page numbers are arranged in the table items, and according to the virtual page numbers and the fixed page size, the corresponding virtual address range in the table item can be determined, namely, the virtual address range in the table item is determined by the fixed page size and the virtual page numbers in the table item, and after the virtual address range is determined, whether the target virtual address falls into the virtual address range of the target table item can be judged.
Specifically, in some embodiments, in the case of a static table entry, i.e., MTLB (single-Page-Size Translation Lookaside Buffer, single-Page size translation look-aside buffer), by presetting a fixed Page size, a table entry includes a virtual Page number (i.e., virtual Page Number), a virtual Page number support setting, a virtual address range in the table entry is a virtual Page number to a Page number obtained by adding the virtual Page number to the fixed Page size, the virtual address range includes Page numbers of two endpoints (i.e., a virtual Page number, a Page number obtained by adding the virtual Page number to the fixed Page size), for example, a virtual Page number in the table entry is 0x10000000, and a fixed Page size is 0x4000000, and then the corresponding virtual address range in the determined table entry is 0x10000000 to 0x14000000 (0 x10000000 plus 0x 4000000), and the virtual address range includes 0x10000000 and 0x14000000.
And 204, accessing the corresponding storage space according to the target physical address, thereby completing the access request.
The implementation of this step is similar to the implementation of step 104 described above, and will not be described here again.
Optionally, in some embodiments, step 204 includes the following sub-steps (sub-step 2041, sub-step 2042, sub-step 2043):
in step 2041, the address type of the target physical address is obtained.
In the embodiment of the application, in order to access the storage space corresponding to the target physical address, the line is required to acquire the address type of the target physical address so as to access the corresponding storage space according to the address type of the target physical address.
Specifically, in some embodiments, the entry includes a type of physical address, and the address type of the target physical address in the target entry is obtained by reading the contents of the target entry. The address types of the target physical address may include a cached address (cached address) and a non-cached address (uncached address).
In the substep 2042, if the address type of the target physical address is a cache address, accessing an internal storage space of a server corresponding to the target physical address according to the target physical address.
In the embodiment of the application, under the condition that the address type of the target physical address is a cache address, the internal storage space of the server corresponding to the target physical address is required to be accessed according to the target physical address so as to complete the access process of the storage space.
In the substep 2043, if the address type of the target physical address is a non-cache address, accessing, according to the target physical address, a storage space of an external device of the server corresponding to the target physical address.
In the embodiment of the application, under the condition that the address type of the target physical address is a non-cache address, the storage space of the external device of the server corresponding to the target physical address is required to be accessed according to the target physical address, so as to complete the access process of the storage space.
It should be noted that, the external device of the server may include a hard disk (such as a PCI interface hard disk), a USB (Universal Serial Bus ) device, a network card, and the like.
By executing the sub-steps 2041 to 2043, it is possible to access the storage space corresponding to the target physical address according to the address type of the target physical address, that is, in the case that the address type of the target physical address is the cache address, it is necessary to access the internal storage space of the server corresponding to the target physical address according to the target physical address, and in the case that the address type of the target physical address is the non-cache address, it is necessary to access the storage space of the external device of the server corresponding to the target physical address according to the target physical address.
It should be noted that, the storage space corresponding to the physical address with the address type being the cache address is the internal storage space of the server, that is, the memory of the server, and the storage space corresponding to the physical address with the address type being the non-cache address is the storage space of the external device of the server.
Optionally, in some embodiments, the internal storage space of the server may also be accessed according to a physical address whose address type is a non-cached address.
Optionally, in some embodiments, the virtual addresses in the entries have corresponding virtual address ranges; the method further comprises the steps of:
step 207, obtaining a new physical address corresponding to the target virtual address if the target virtual address is not successfully matched with the virtual address range of any entry in the entry set.
In the embodiment of the application, after the target virtual address is acquired, the table item corresponding to the target virtual address needs to be searched from the database, and when the virtual address range of the target virtual address and any table item in the table item set is not successfully matched, that is, when the target virtual address is not in the virtual address range of any table item in the database, it can be judged that no table item corresponding to the target virtual address exists in the database, and then the TLB (TLB refill) is needed, and the newly added physical address corresponding to the target virtual address needs to be acquired first.
It should be noted that the new physical address may be a plurality of types of addresses with a number of bits, for example, the new physical address is a 48-bit physical address.
And step 208, creating a new entry corresponding to the target virtual address according to the target virtual address and the new physical address, and storing the new entry in the database.
In the embodiment of the application, after the newly-added physical address corresponding to the target virtual address is obtained, a newly-added table entry corresponding to the target virtual address can be created according to the target virtual address and the newly-added physical address, and then the newly-added table entry is stored in a database so as to obtain the target physical address according to the newly-added table entry.
Step 209, taking the newly added physical address in the newly added entry as the target physical address, and accessing the corresponding storage space according to the target physical address.
In the embodiment of the application, after the new entry is created, the new entry is acquired from the database, the content of the new entry is read to obtain the new physical address of the new entry, the new physical address is taken as the target physical address, and then the storage space corresponding to the target physical address is accessed to realize the access process of the storage space.
For example, in steps 207 to 209, if the target virtual address 0x10000000 is not in the virtual address range of any table entry in the database, that is, the target virtual address is not successfully matched with the virtual address range of any table entry in the table entry set, then the TLB refill is performed, the newly added physical address 0x10000000 corresponding to the target virtual address 0x10000000 needs to be obtained first, then, according to the target virtual address 0x10000000 and the newly added physical address 0x10000000, the newly added table entry is created, and in the case that the newly added table entry is a dynamic table entry, the virtual page number in the newly added table entry is set to 0x10000000 (that is, the virtual address range includes 0x 10000000), the page size may be set to 0x4000000, and the newly added physical address in the table entry is set to 0x10000000, and then, the newly added physical address 0x10000000 is used as the target physical address, and the storage space corresponding to the target physical address 0x10000000 is accessed.
According to the embodiment of the application, when the matching of the target virtual address and the virtual address range of any one table item in the table item set is unsuccessful, the TLB is required to be refilled to acquire the target physical address, and the corresponding storage space is accessed according to the target physical address, so that the access request is completed.
Optionally, in some embodiments, the first digit type is any one of 64 bits and a number of bits below 64 bits; the second bit number type is any one of a 48 bit and a bit number of 48 bits or less.
In the embodiment of the present application, the first bit number type may be any one of 64 bits and bits below 64 bits, for example, 64 bits, 32 bits, 16 bits, etc.; the second bit number type can be any one of the bit numbers of 48 bits and below, such as 48 bits, 32 bits, 16 bits and the like, so as to form the mapping relation between the virtual address and the physical address of multiple bit number types, thereby improving the diversity of modes for accessing the storage space.
Optionally, in some embodiments, the table entries may include a first sub-entry and a second sub-entry, a third sub-entry; referring to fig. 3, in case the table entry is a dynamic table entry, the first sub-entry may include a virtual page number (VPPN), a Page Size (PS), a global flag bit (G), a presence bit (ASID), an address space identification (E), etc., the second sub-entry may include a first physical page number (PPN 0), a first restricted privilege level enable (RPLV 0), a first privilege level (PLV 0), a type of a first physical address (MAT 0), a first unreadable bit (NX 0), a first unreadable bit (NR 0), a first dirty bit (D0), a first valid bit (V0), etc., and the third sub-entry may include a second physical page number (PPN 1), a second restricted privilege level enable (RPLV 1), a second privilege level (PLV 1), a type of a second physical address (MAT 1), a second unreadable bit (NX 1), a second unreadable bit (NR 1), a second dirty bit (D1), a second valid bit (V1), etc.; in the case that the table entry is a static table entry, the first sub-entry may include a virtual page number (VPPN), a global flag bit (G), a presence bit (ASID), an address space identification (E), etc., the second sub-entry may include a first physical page number (PPN 0), a first restricted privilege level enable (RPLV 0), a first privilege level (PLV 0), a type of first physical address (MAT 0), a first non-executable bit (NX 0), a first unreadable bit (NR 0), a first dirty bit (D0), a first valid bit (V0), etc., and the third sub-entry may include a second physical page number (PPN 1), a second restricted privilege level enable (RPLV 1), a second privilege level (PLV 1), a type of second physical address (MAT 1), a second non-executable bit (NX 1), a second non-readable bit (NR 1), a second dirty bit (D1), a second valid bit (V1), etc.
Wherein, in the case that the table entry is a dynamic table entry, the virtual page number and the page size are used to determine the virtual address range of the table entry; under the condition that the table item is a static table item, the virtual page number and a preset fixed page scale are used for determining the virtual address range of the table item; in the table entry with the table entry type being a dynamic table entry or a static table entry, the first physical page number is taken as a target physical address.
Specifically, in some embodiments, in an entry whose entry type is a dynamic entry, the size of the existing bit is 1 bit, which indicates that the existing TLB entry is not empty, and may participate in matching with the target virtual address; the size of the address space identifier is 10 bits, the address space identifier is used for distinguishing the same virtual address in different processes, if the address space identifier is not set, the same virtual address in different processes cannot be distinguished, for example, for a process A and a process B with the same virtual address, the process A and the process B have different physical addresses, when switching from the process A to the process B, TLB corresponding to the process A needs to be emptied, so that the occurrence of an error condition that when the process B is operated, the process A and the process B have the same virtual address, and the TLB table of the process A is used for mapping the physical address of the process A according to the virtual address is avoided; and the TLB of the process A needs to be re-established when the process A is operated next time, so that the address space identification is set, and the resource loss caused by clearing the TLB of the switched process when the process is switched and the operation efficiency reduction caused by re-establishing the TLB of the switched process when the switched process is operated again can be avoided.
The operating system of the server distributes unique address space identification for each process, when the target virtual address is matched with the virtual address range in the target table item, the address space identification corresponding to the target virtual address is matched with the address space identification in the target table item, and when the target virtual address falls into the virtual address range in the target table item, and the address space identification corresponding to the target virtual address is the same as the address space identification in the target table item, the corresponding storage space is accessed according to the target physical address in the target table item; the remainder of the description is shown in the following table (table 1):
TABLE 1
In the table entry whose table entry type is a static table entry, descriptions of each part are similar, and will not be repeated here.
Optionally, referring to fig. 4, in some embodiments, the memory space access procedure includes:
x1, BIOS starts;
x2, creating table entries, namely creating the table entries corresponding to each virtual address according to each virtual address and a corresponding physical address, and storing each table entry in a database;
x3, obtaining a target virtual address, namely responding to an access request of the central processing unit, and obtaining the target virtual address in the access request;
X4, judging whether the conversion backup buffer area hits or not;
x5, under the condition that the translation look-aside buffer is not hit, entering into abnormal entry processing, namely, entering into abnormal processing function processing under the condition that the target virtual address is not in the virtual address range of any one table item in the database, and performing TLB refill exception;
x6, creating a new table entry corresponding to the target virtual address and storing the new table entry into a database;
x7, under the condition of hit of the conversion backup buffer, judging whether the address type of the target physical address is a cache address or a non-cache address;
x8, accessing the storage space of the external equipment of the server under the condition that the address type of the target physical address is a non-cache address;
and X9, accessing the internal storage space of the server under the condition that the address type of the target physical address is a cache address.
In summary, in the embodiment of the present application, under the condition of starting and running the BIOS, the table entry set is obtained, where each table entry in the table entry set is used to record the mapping relationship between the virtual address and the physical address, the bit number type of the virtual address includes multiple first bit number types, and the bit number type of the physical address includes multiple second bit number types; responding to an access request of a central processing unit, and acquiring a target virtual address in the access request; under the condition that the target virtual address is of a first bit number type, acquiring a target physical address of a second bit number type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address; according to the target physical address, the corresponding storage space is accessed, so that an access request is completed, access to the storage space based on the BIOS is realized, and as the bit number type of the virtual address comprises a plurality of first bit number types, the mapping relation between the virtual address and the physical address of a plurality of bit number types can be supported, the diversity of the mode of accessing the storage space is improved, and the problem that the mode of accessing the storage space is limited due to the fact that the bit number type of the virtual address in the mapping relation is fixed in the prior art is solved.
Fig. 5 is a block diagram of a storage space accessing apparatus according to an embodiment of the present application, and as shown in fig. 5, the apparatus 300 includes:
the first obtaining module 301 is configured to obtain, under a condition that the BIOS is started and operated, a set of entries, where each entry in the set of entries is used to record a mapping relationship between a virtual address and a physical address, a bit number type of the virtual address includes multiple first bit number types, and a bit number type of the physical address includes multiple second bit number types;
a second obtaining module 302, configured to obtain, in response to an access request of a central processing unit, a target virtual address in the access request;
a third obtaining module 303, configured to obtain, when the target virtual address is of the first number of bits type, a target physical address of a second number of bits type mapped corresponding to the target virtual address from a target entry corresponding to the target virtual address;
and the access module 304 is configured to access the corresponding storage space according to the target physical address, thereby completing the access request.
Optionally, the virtual address in the table entry has a corresponding virtual address range;
the third obtaining module 303 specifically includes:
The first obtaining sub-module is used for matching the target virtual address with the virtual address range in the target table entry under the condition that the target virtual address is of the first bit number type, and obtaining a matching result;
and the second acquisition sub-module is used for acquiring the target physical address of the second bit type of the matching result association mapping from the target table entry.
Optionally, in the case that the table entry is a dynamic table entry, the table entry includes a dynamically set virtual page number and a page size, and the apparatus 300 further includes:
and the first virtual address range module is used for determining the virtual address range according to the virtual page number and the page size in the table entry.
Optionally, in the case that the target table entry is a static table entry, the table entry includes a dynamically set virtual page number, and the apparatus 300 further includes:
the second virtual address range module is used for determining a corresponding virtual address range in the table entry according to a preset fixed page size and a virtual page number in the table entry.
Optionally, the apparatus 300 further comprises:
a fourth obtaining module, configured to obtain, when the matching between the target virtual address and the virtual address range of any one of the entries in the entry set is unsuccessful, a new physical address corresponding to the target virtual address when the matching between the target virtual address and the virtual address range of any one of the entries in the entry set is unsuccessful;
The first creation module is used for creating a new table entry corresponding to the target virtual address according to the target virtual address and the new physical address and storing the new table entry into the database;
and the newly-added physical address access module is used for taking the newly-added physical address in the newly-added table entry as the target physical address and accessing the corresponding storage space according to the target physical address.
Optionally, the access module 304 specifically includes:
a third obtaining sub-module, configured to obtain an address type of the target physical address;
the first access sub-module is used for accessing the internal storage space of the server corresponding to the target physical address according to the target physical address under the condition that the address type of the target physical address is a cache address;
and the second access sub-module is used for accessing the storage space of the external equipment of the server corresponding to the target physical address according to the target physical address under the condition that the address type of the target physical address is a non-cache address.
Optionally, the apparatus 300 further comprises:
the second creating module is used for creating a table entry corresponding to each virtual address according to each virtual address and a corresponding physical address under the condition that the BIOS is started, and storing each table entry in the database;
And the construction module is used for constructing and obtaining the table item set according to all the table items in the database.
Optionally, the first bit number type is any one of 64 bits and a number of bits below 64 bits; the second bit number type is any one of a 48 bit and a bit number of 48 bits or less.
The memory space access device in the embodiment of the application can be a device, and can also be a component, an integrated circuit or a chip in a terminal. The device may be a mobile electronic device or a non-mobile electronic device. By way of example, the mobile electronic device may be a cell phone, tablet computer, notebook computer, palm computer, vehicle mounted electronic device, wearable device, ultra-mobile personal computer (ultra-mobile personal computer, UMPC), netbook or personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device may be a server, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (TV), teller machine or self-service machine, etc., and embodiments of the present application are not limited in particular.
The storage space access device in the embodiment of the application can be a device with an operating system. The operating system may be an Android operating system, an ios operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
The storage space access device provided in the embodiment of the present application can implement each process implemented by the storage space access device in the method embodiment of fig. 1, and in order to avoid repetition, a description is omitted here.
According to the embodiment of the application, the access of the memory space based on the BIOS can be realized, and as the bit number type of the virtual address comprises a plurality of first bit number types, the mapping relation between the virtual address and the physical address of a plurality of bit number types can be supported, the diversity of the mode of accessing the memory space is improved, and the problem that the mode of accessing the memory space is limited because the bit number type of the virtual address in the mapping relation is fixed in the prior art is solved.
Optionally, the embodiment of the present application further provides an electronic device, including a processor, a memory, and a program or an instruction stored in the memory and capable of running on the processor, where the program or the instruction realizes each process of the embodiment of the storage space access method when executed by the processor, and the process can achieve the same technical effect, and in order to avoid repetition, a description is omitted herein.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
Fig. 6 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
The electronic device 400 includes, but is not limited to: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, and processor 410.
Those skilled in the art will appreciate that the electronic device 400 may also include a power source (e.g., a battery) for powering the various components, which may be logically connected to the processor 410 by a power management system to perform functions such as managing charge, discharge, and power consumption by the power management system. The electronic device structure shown in fig. 6 does not constitute a limitation of the electronic device, and the electronic device may include more or less components than shown, or may combine certain components, or may be arranged in different components, which are not described in detail herein.
The processor 410 is configured to obtain a table entry set under the condition that the BIOS is started and operated, where each table entry in the table entry set is configured to record a mapping relationship between a virtual address and a physical address, a bit number type of the virtual address includes multiple first bit number types, and a bit number type of the physical address includes multiple second bit number types;
Responding to an access request of a central processing unit, and acquiring a target virtual address in the access request;
acquiring a target physical address of a second bit type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address under the condition that the target virtual address is of the first bit type;
and accessing the corresponding storage space according to the target physical address, thereby completing the access request.
In the embodiment of the application, under the condition of BIOS starting and running, a table item set is obtained, each table item in the table item set is used for recording the mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types; responding to an access request of a central processing unit, and acquiring a target virtual address in the access request; under the condition that the target virtual address is of a first bit number type, acquiring a target physical address of a second bit number type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address; according to the target physical address, the corresponding storage space is accessed, so that an access request is completed, access to the storage space based on the BIOS is realized, and as the bit number type of the virtual address comprises a plurality of first bit number types, the mapping relation between the virtual address and the physical address of a plurality of bit number types can be supported, the diversity of the mode of accessing the storage space is improved, and the problem that the mode of accessing the storage space is limited due to the fact that the bit number type of the virtual address in the mapping relation is fixed in the prior art is solved.
Optionally, the virtual address in the table entry has a corresponding virtual address range; the processor 410 is further configured to match the target virtual address with a virtual address range in the target table entry, and obtain a matching result when the target virtual address is of the first bit number type; and acquiring the target physical address of the second bit type of the matching result association mapping from the target table entry.
Optionally, in the case that the table entry is a dynamic table entry, the table entry includes a dynamically set virtual page number and page size, and the processor 410 is further configured to determine the virtual address range according to the virtual page number and page size in the table entry.
Optionally, in the case that the target table entry is a static table entry, the table entry includes a dynamically set virtual page number, and the processor 410 is further configured to determine a corresponding virtual address range in the table entry according to a preset fixed page size and the virtual page number in the table entry.
Optionally, the virtual address in the table entry has a corresponding virtual address range; the processor 410 is further configured to obtain a new physical address corresponding to the target virtual address if the target virtual address is not successfully matched with the virtual address range of any one of the entries in the set of entries, and if the target virtual address is not successfully matched with the virtual address range of any one of the entries in the set of entries; creating a new added table entry corresponding to the target virtual address according to the target virtual address and the new added physical address, and storing the new added table entry into the database; and taking the newly added physical address in the newly added table entry as the target physical address, and accessing the corresponding storage space according to the target physical address.
Optionally, the processor 410 is further configured to obtain an address type of the target physical address; accessing an internal storage space of a server corresponding to the target physical address according to the target physical address under the condition that the address type of the target physical address is a cache address; and accessing the storage space of the external equipment of the server corresponding to the target physical address according to the target physical address under the condition that the address type of the target physical address is a non-cache address.
Optionally, the processor 410 is further configured to, in the case of the BIOS startup, create an entry corresponding to each virtual address according to each virtual address and a corresponding one of the physical addresses, and store each entry in the database; and constructing and obtaining the table item set according to all the table items in the database.
Optionally, the first bit number type is any one of 64 bits and a number of bits below 64 bits; the second bit number type is any one of a 48 bit and a bit number of 48 bits or less.
In the embodiment of the application, under the condition of BIOS starting and running, a table item set is obtained, each table item in the table item set is used for recording the mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types; responding to an access request of a central processing unit, and acquiring a target virtual address in the access request; under the condition that the target virtual address is of a first bit number type, acquiring a target physical address of a second bit number type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address; according to the target physical address, the corresponding storage space is accessed, so that an access request is completed, access to the storage space based on the BIOS is realized, and as the bit number type of the virtual address comprises a plurality of first bit number types, the mapping relation between the virtual address and the physical address of a plurality of bit number types can be supported, the diversity of the mode of accessing the storage space is improved, and the problem that the mode of accessing the storage space is limited due to the fact that the bit number type of the virtual address in the mapping relation is fixed in the prior art is solved.
It should be appreciated that in embodiments of the present application, the input unit 404 may include a graphics processor (Graphics Processing Unit, GPU) 4041 and a microphone 4042, the graphics processor 4041 processing image data of still pictures or video obtained by an image capture device (e.g., a camera) in a video capture mode or an image capture mode. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 407 includes at least one of a touch panel 4071 and other input devices 4072. The touch panel 4071 is also referred to as a touch screen. The touch panel 4071 may include two parts, a touch detection device and a touch controller. Other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and so forth, which are not described in detail herein.
Memory 409 may be used to store software programs as well as various data. The memory 409 may mainly include a first memory area storing programs or instructions and a second memory area storing data, wherein the first memory area may store an operating system, application programs or instructions (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like. Further, the memory 409 may include volatile memory or nonvolatile memory, or the memory 409 may include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (ddr SDRAM), enhanced SDRAM (Enhanced SDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). Memory 409 in embodiments of the application includes, but is not limited to, these and any other suitable types of memory.
Processor 410 may include one or more processing units; optionally, the processor 410 integrates an application processor that primarily processes operations involving an operating system, user interface, application programs, etc., and a modem processor that primarily processes wireless communication signals, such as a baseband processor. It will be appreciated that the modem processor described above may not be integrated into the processor 410.
The embodiment of the application also provides a readable storage medium, on which a program or an instruction is stored, which when executed by a processor, implements each process of the above storage space access method embodiment, and can achieve the same technical effects, so that repetition is avoided, and no further description is given here.
Wherein the processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium such as a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
The embodiment of the application further provides a chip, which comprises a processor and a communication interface, wherein the communication interface is coupled with the processor, and the processor is used for running programs or instructions to realize the processes of the memory space access method embodiment, and the same technical effects can be achieved, so that repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.

Claims (10)

1. A method of memory space access, the method comprising:
under the condition of BIOS starting and running, acquiring an item set; each table item in the table item set is used for recording the mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types;
responding to an access request of a central processing unit, and acquiring a target virtual address in the access request;
acquiring a target physical address of a second bit type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address under the condition that the target virtual address is of the first bit type;
and accessing the corresponding storage space according to the target physical address, thereby completing the access request.
2. The method of claim 1, wherein the virtual addresses in the entries have corresponding virtual address ranges;
and when the target virtual address is of the first bit number type, acquiring a target physical address of a second bit number type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address, including:
Under the condition that the target virtual address is of the first bit number type, matching the target virtual address with a virtual address range in the target table entry to obtain a matching result;
and acquiring the target physical address of the second bit type of the matching result association mapping from the target table entry.
3. The method of claim 2, wherein in the event that the entry is a dynamic entry, the entry includes a dynamically set virtual page number and page size, the method further comprising:
and determining the virtual address range according to the virtual page number and the page size in the table entry.
4. The method of claim 2, wherein in the event that the target entry is a static entry, the entry includes a dynamically set virtual page number, the method further comprising:
and determining the virtual address range according to a preset fixed page size and a virtual page number in the table entry.
5. The method of claim 1, wherein the step of obtaining the set of entries in the event of a start-up of the BIOS comprises:
under the condition that the BIOS is started, creating a table entry corresponding to each virtual address according to each virtual address and a corresponding physical address, and storing each table entry in a given database;
And constructing and obtaining the table item set according to all the table items in the database.
6. The method of claim 5, wherein the virtual addresses in the entries have corresponding virtual address ranges; the method further comprises the steps of:
acquiring a new physical address corresponding to the target virtual address under the condition that the target virtual address is not successfully matched with the virtual address range of any one table item in the table item set;
creating a new added table entry corresponding to the target virtual address according to the target virtual address and the new added physical address, and storing the new added table entry into the database;
and taking the newly added physical address in the newly added table entry as the target physical address, and accessing the corresponding storage space according to the target physical address, thereby completing the access request.
7. The method of claim 1, wherein accessing the corresponding memory space according to the target physical address, thereby completing the access request, comprises:
acquiring the address type of the target physical address;
accessing an internal storage space of a server corresponding to the target physical address according to the target physical address under the condition that the address type of the target physical address is a cache address;
And accessing the storage space of the external equipment of the server corresponding to the target physical address according to the target physical address under the condition that the address type of the target physical address is a non-cache address.
8. A memory space access device, the device comprising:
the first acquisition module is used for acquiring a table entry set under the condition of BIOS starting and running, wherein each table entry in the table entry set is used for recording the mapping relation between a virtual address and a physical address, the bit number type of the virtual address comprises a plurality of first bit number types, and the bit number type of the physical address comprises a plurality of second bit number types;
the second acquisition module is used for responding to an access request of the central processing unit and acquiring a target virtual address in the access request;
the third obtaining module is used for obtaining a target physical address of a second bit number type mapped corresponding to the target virtual address from a target table entry corresponding to the target virtual address under the condition that the target virtual address is of the first bit number type;
and the access module is used for accessing the corresponding storage space according to the target physical address so as to finish the access request.
9. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which when executed by the processor, implements the steps of the memory space access method of any one of claims 1 to 7.
10. A readable storage medium, characterized in that the readable storage medium has stored thereon a program or instructions which, when executed by a processor, implement the steps of the storage space access method of any of claims 1 to 7.
CN202310558047.9A 2023-05-17 2023-05-17 Storage space access method, device, equipment and storage medium Pending CN116680210A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310558047.9A CN116680210A (en) 2023-05-17 2023-05-17 Storage space access method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310558047.9A CN116680210A (en) 2023-05-17 2023-05-17 Storage space access method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116680210A true CN116680210A (en) 2023-09-01

Family

ID=87780043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310558047.9A Pending CN116680210A (en) 2023-05-17 2023-05-17 Storage space access method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116680210A (en)

Similar Documents

Publication Publication Date Title
TWI621945B (en) System-on-chip
CN103221995B (en) Stream translation in display tube
US8451281B2 (en) Shared virtual memory between a host and discrete graphics device in a computing system
US9218286B2 (en) System cache with partial write valid states
US9348764B2 (en) System on chip including memory management unit and memory address translation method thereof
US9146879B1 (en) Virtual memory management for real-time embedded devices
US8601229B2 (en) Secure memory access system and method
US20080250212A1 (en) Method and apparatus for accessing memory using programmable memory accessing interleaving ratio information
JP2005115910A (en) Priority-based flash memory control apparatus for xip in serial flash memory, memory management method using the same, and flash memory chip based on the same
JPH08320829A (en) Data processor
US8898429B2 (en) Application processor and a computing system having the same
EP3163451B1 (en) Memory management method and device, and memory controller
CN104885063A (en) Overlap checking for a translation lookaside buffer (TLB)
CN115481054A (en) Data processing method, device and system, system-level SOC chip and computer equipment
WO2016206421A1 (en) Memory access processing method and device, and storage medium
CN116680210A (en) Storage space access method, device, equipment and storage medium
US20200192818A1 (en) Translation lookaside buffer cache marker scheme for emulating single-cycle page table entry invalidation
US8700865B1 (en) Compressed data access system and method
CN114063934A (en) Data updating device and method and electronic equipment
CN1916853B (en) Method and device of protecting code segment in use for MIPS system
CN117472806B (en) Address translation method and device and computer storage medium
JP2017068806A (en) Information processing apparatus and information processing method
CN117271387A (en) Address mapping table item updating method and device, electronic equipment and storage medium
CN116627876A (en) Address remapping method, device, equipment and storage medium
CN113515405A (en) Address management method and device

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