Semiconductor Device
By controlling cache specifically at the last stage of address translation, the imbalance in cache usage due to multi-stage address translation is addressed, enhancing cache efficiency and reducing Stage 2 cache overflow.
Patent Information
- Application Number
- JP2020103134
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2020-06-15
- Publication Date
- 2024-08-21
- Estimated Expiration
- 2040-06-15
AI Technical Summary
The bias in the number of address translations across stages leads to imbalanced cache configurations, reducing cache utilization efficiency in multi-stage address translation processes.
Implement cache control specifically on the information in the last stage of address translation, avoiding cache control for other stages, particularly focusing on the Stage 2 Table or Stage 2 Table/Page for address translation of Context Descriptor or Stage 1 Table/Page.
This approach prevents a decrease in cache utilization efficiency by balancing cache ratios between stages, optimizing cache usage by caching only necessary information at the last stage, thereby improving overall performance.
Smart Images

Figure 0007537135000006 
Figure 0007537135000005 
Figure 0007537135000004
Abstract
Description
[Technical field]
[0001] The present invention relates to a semiconductor device. [Background technology]
[0002] When translating a virtual address into a physical address, the address translation may be performed in multiple stages.
[0003] FIG. 1 is a diagram illustrating an example of address translation in multiple stages.
[0004] In the example shown in Figure 1, in order to run a Guest OS on a Hypervisor, in Stage 1 the Guest OS converts a virtual address (VA) to an intermediate physical address (IPA), and in Stage 2 the Hypervisor converts the intermediate physical address to a physical address (PA).
[0005] In each stage of translation, the address translation table may be configured with multiple levels.
[0006] FIG. 2 is a diagram illustrating a multi-level address translation table.
[0007] 2 shows an example of a 3-level conversion table configuration. A Level 1 Table entry 601 (Table 1) and a Level 2 Table entry 602 (Table 2) store the base address of the conversion table of the next level. The value obtained by adding the offset of the virtual address or intermediate physical address to be converted to this base address by an adder 604 is the address of the entry used for conversion at each level. The intermediate physical address or physical address of the conversion result is the value obtained by adding the address and offset stored in a Level 3 Page 1 entry 603 by an adder 604.
[0008] The address translation device obtains Table / Page entries 601-603 of each level from the main storage device and performs translation. The address translation device calculates the address of the first level entry 601 from the VA and IPA to be translated and the base address, and obtains it from the main storage device. If the obtained entry is a Table, the address translation device calculates the address of the next level and obtains it from the main storage device. If the obtained entry is a Page, the address translation device returns the translated address. Whether an entry is a Table or a Page may be distinguished by a flag stored in the entry.
[0009] Generally, an address translation device caches tables and pages internally to perform translation processing at high speed. In particular, in multi-level address translation, tables (Tables 1 and 2) are cached. For example, even if Page 1 is not cached in the Translation Look-aside Buffer (TLB), if Table 2 is cached, Page 1 can be obtained with one main memory fetch based on Table 2. [Prior art documents] [Patent documents]
[0010] [Patent Document 1] JP 2019-212167 A [Patent Document 2] JP 2007-233615 A Summary of the Invention [Problem to be solved by the invention]
[0011] However, in address translation in multiple stages, the number of address translations is biased in each stage, so there is a possibility that the cache will also be biased. In the example shown in Figure 2, the bias occurs because Stage 2 translation is performed to obtain the Table and Page of Stage 1 itself. For example, in the example shown in Figure 2, in the case of Stage 1, it is the Guest OS that sets the base address of the translation table and the next level address stored in the Table and Page entries of each level, and the address to be set is an intermediate address. Therefore, in order to actually obtain these entries from the main memory, Stage 2 translation from the intermediate physical address to the physical address is performed.
[0012] FIG. 3 is a diagram illustrating the Stage2 transformation of the Stage1 Level1 table.
[0013] To obtain each level of Stage 1 from the main storage device, Stage 2 conversion is executed. When caching the tables and pages used in each stage and each level, entries 601 to 603 are prepared in Stage 2 for the number of conversion levels (three in the example shown in FIG. 3) for one entry 605 in Stage 1. This may cause a bias in the cache configuration, lowering the cache utilization efficiency. For example, if Stage 1 and 2 share the same cache Random Access Memory (RAM), it is expected that the RAM will be filled with the cache of Stage 2, causing frequent cache misses in Stage 1.
[0014] Such bias in cache configuration is more pronounced when each stage is composed of multiple levels of address translation tables, but can also occur in a one-level configuration.
[0015] In one aspect, an object of the present invention is to prevent a decrease in cache utilization efficiency when address translation is performed using a plurality of address translation tables. [Means for solving the problem]
[0016] In one aspect, the semiconductor device performs address conversion using a plurality of address conversion tables, and performs cache control on information of the address conversion table used in the final stage of the address conversion, and does not perform cache control on information of other address conversion tables. figure , The information of the other address conversion table or the information of the address conversion table used in the last stage is used for obtaining setting information when it is a Stage 2 Table for performing address conversion of a Context Descriptor or a Stage 2 Table for performing address conversion of a Stage 1 Table / Page. . Effect of the Invention
[0017] According to one aspect, when address translation is performed using a plurality of address translation tables, it is possible to prevent a decrease in the efficiency of cache usage. [Brief description of the drawings]
[0018] [Figure 1] FIG. 1 is a diagram illustrating an example of address translation in multiple stages. [Diagram 2] FIG. 13 is a diagram illustrating a multi-level address translation table. [Diagram 3] FIG. 13 is a diagram illustrating Stage2 conversion of the Stage1 Level1 table. [Figure 4] FIG. 10 is a diagram illustrating an address conversion process according to an embodiment. [Diagram 5] FIG. 1 is a block diagram illustrating an example of the configuration of an address conversion system according to an embodiment. [Figure 6] 1 is a flowchart illustrating an address conversion process according to an embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0019] [A] Embodiment An embodiment will be described below with reference to the drawings. However, the embodiment described below is merely an example, and there is no intention to exclude the application of various modified examples and techniques not specified in the embodiment. In other words, the present embodiment can be implemented with various modifications within the scope of the gist of the embodiment. In addition, each figure does not intend to include only the components shown in the figure, but can include other functions, etc.
[0020] In the following drawings, the same reference numerals denote similar parts, and therefore the description thereof will be omitted.
[0021] FIG. 4 is a diagram illustrating an address conversion process according to an embodiment.
[0022] In the address conversion process shown in FIG. 4, the base address of the conversion table and offset #1 of the IPA are added in an adder 104, and the Level 1 Table address is output as the PA.
[0023] In Stage 2 conversion, the offset of PA and the base address of the conversion table are input to entries 101 to 103 of each Level Table. The base address of the conversion table and offset #1 of PA are input to Level 1 table entry 101 (Table 1), and the base address of Level 2 is output. The base address of Level 2 and offset #2 of PA are input to Level 2 table entry 102 (Table 2), and the base address of Level 3 is output. The base address of Level 3 and offset #3 of PA are input to Level 3 table entry 103 (Page 1), and the conversion result in Stage 2 is output.
[0024] The output of Level 3 Table entry 103 and PA offset #4 are added in adder 104, and the Level 1 Table address is output as the PA.
[0025] In Stage 1 conversion, a Level 1 table address is input as a PA to a Level 1 table entry 105 (Table 1).
[0026] In the Stage 2 conversion illustrated in Fig. 4, Table 1 and Table 2 are not cached, and only Page 1 is cached, as indicated by reference symbol A1. Also, as indicated by reference symbol A2, Table 1 is cached because the data size in Stage 1 conversion is small. Then, in the address conversion of Table entry 105 near Stage 1 Table 1 on the IPA, a hit to Stage 2 Page 1 can be expected.
[0027] When the address type converted in Stage 2 is configuration information, the method of limiting the entries to be cached is not limited to the above example. For example, when the address type is data, nearby tables and pages on the address may be pre-cached together, but when the address type is configuration information, pre-caching may not be performed.
[0028] FIG. 5 is a block diagram illustrating a schematic configuration example of an address conversion system 1 according to an embodiment.
[0029] The address translation system 1 includes a Central Processing Unit (CPU) 11, a memory unit 12, and an address translation device 13.
[0030] The CPU 11 is a processing device that performs various controls and calculations, and realizes various functions by executing an OS and programs stored in the memory unit 12. The CPU 11 may be called a CPU Core / IO device.
[0031] The device for controlling the operation of the entire address translation system 1 is not limited to the CPU 11, and may be, for example, any one of an MPU, DSP, ASIC, PLD, and FPGA. The device for controlling the operation of the entire address translation system 1 may be a combination of two or more of the CPU, MPU, DSP, ASIC, PLD, and FPGA. Note that MPU is an abbreviation for Micro Processing Unit, DSP is an abbreviation for Digital Signal Processor, and ASIC is an abbreviation for Application Specific Integrated Circuit. Furthermore, PLD is an abbreviation for Programmable Logic Device, and FPGA is an abbreviation for Field Programmable Gate Array.
[0032] The memory unit 12 is an example of a main storage device, and is illustratively a Read Only Memory (ROM) and a Random Access Memory (RAM). The RAM may be, for example, a Dynamic RAM (DRAM). Programs such as a Basic Input / Output System (BIOS) may be written in the ROM of the memory unit 12. The software programs in the memory unit 12 may be appropriately read and executed by the CPU 11. The RAM of the memory unit 12 may be used as a temporary recording memory or a working memory.
[0033] The address translation device 13 is an example of a semiconductor device, and functions as a control unit 131 and a cache holding unit 132 .
[0034] The control unit 131 receives an address translation request from the CPU 11 and returns an address translation response to the CPU 11.
[0035] The control unit 131 issues a Page / Table acquisition request and a setting information acquisition request to the memory unit 12, and receives a Page / Table acquisition response and a setting information response from the memory unit 12.
[0036] In response to a cache search from the control unit 131, the cache holding unit 132 returns a search response to the control unit 131. In addition, the cache holding unit 132 accepts cache registration from the control unit 131. The control unit 131 selects whether or not to register a cache in the cache holding unit 132 depending on the type of address to be converted.
[0037] In the procedure defined by the ARM architecture, Stage 2 Table / Page acquisition is performed in addition to the Page / Table for Stage 1, 2 conversion of the address requested for conversion. For example, when performing address conversion, setting information is acquired, and when acquiring part of setting information (e.g., Context Descriptor), Stage 2 address conversion is performed. Also, as described above with reference to FIG. 4, Stage 2 address conversion is performed even when Stage 1 Table / Page is acquired. For this reason, the control unit 131 calculates the address of the Stage 2 Table / Page for acquiring setting information and performs a cache search.
[0038] The control unit 131 performs cache control on the information of the address conversion table used in the final stage of the address conversion (in other words, entries 103 and 105 in FIG. 4), but does not perform cache control on the information of other address conversion tables (in other words, entries 101 and 102 in FIG. 4).
[0039] The information of the other address conversion tables may be a table to be acquired from the memory unit 12, and may be used to acquire setting information. The information of the address conversion table used in the last stage may be a page to be acquired from the memory unit 12, and may be used to acquire setting information. Also, the information of the address conversion table used in the last stage may be a table to be acquired from the memory unit 12, and may not be used to acquire setting information.
[0040] In addition, when the purpose is to obtain setting information, for example, the Stage2 Table for performing address conversion of the Context Descriptor, or the Stage2 Table for performing address conversion of the Stage1 Table / Page, the distinction of whether the target of the cache search is a Table or a Page may be made based on the flag of the obtained entry.
[0041] [A-2] Operation The address conversion process according to an embodiment will be described with reference to the flowchart (steps S1 to S12) shown in FIG.
[0042] The control unit 131 receives an address conversion request from the CPU 11 (step S1).
[0043] The control unit 131 calculates the address of the Stage 1, 2 Table / Page to be acquired and performs a cache search based on a procedure defined by, for example, the ARM architecture (step S2).
[0044] The control unit 131 determines whether the table / page whose address has been calculated has been hit in the cache (step S3).
[0045] If the table / page hits the cache (see the YES route from step S3), the process proceeds to step S11.
[0046] On the other hand, if the Table / Page does not hit the cache (see the NO route from step S3), the control unit 131 makes a Page / Table acquisition request to the memory unit 12 (step S4).
[0047] The control unit 131 receives the Page / Table response from the memory unit 12 (step S5).
[0048] The control unit 131 determines whether the target of the cache search is a table and whether the purpose is to obtain setting information (step S6).
[0049] If the target of the cache search is a table and the purpose is to obtain setting information (see the YES route in step S6), the control unit 131 temporarily holds the contents of the Page / Table response without performing cache registration (step S7). Then, the process proceeds to step S11.
[0050] On the other hand, if the target of the cache search is not a Table or the purpose is not to obtain setting information (see the NO route in step S6), the control unit 131 determines whether the target of the cache search is a Page and the purpose is to obtain setting information (step S8).
[0051] If the cache search target is a Page and the purpose is to obtain setting information (see the YES route in step S8), the control unit 131 caches the contents of the Page / Table response in the cache holding unit 132 and obtains setting information from the memory unit 12 based on the address conversion result (step S9). Then, the process proceeds to step S11.
[0052] If the cache search target is not a Page or the purpose is not to obtain setting information (see the NO route in step S8), the control unit 131 caches and registers the contents of the Page / Table response in the cache holding unit 132 (step S10). Then, the process proceeds to step S11.
[0053] The control unit 131 determines whether all pages / tables necessary for conversion have been acquired (step S11).
[0054] If there is a page / table that has not been acquired among the pages / tables required for conversion (see the NO route from step S11), the process returns to step S2.
[0055] On the other hand, if all pages / tables necessary for conversion have been acquired (see the YES route from step S11), the control unit 131 transmits an address conversion response to the CPU 11 (step S12), and the address conversion process ends.
[0056] [A-3] Effect According to the address translation device 13 in the example of the above-described embodiment, for example, the following advantageous effects can be achieved.
[0057] The control unit 131 performs cache control on the information of the address conversion table used in the final stage of the address conversion, and does not perform cache control on the information of the other address conversion tables.
[0058] This makes it possible to prevent a decrease in the efficiency of cache usage when address conversion is performed using multiple address conversion tables. Specifically, it is possible to prevent a bias in the cache ratio between stages. For example, assume that, when 3-level Stage 2 conversion is performed for address conversion of Stage 1 Page / Table as shown in FIG. 4, cache control is performed for all address conversion table information. In this case, three Stage 2 Pages / Tables are cached every time one Stage 1 Page / Table is acquired. On the other hand, as in the example of the above-mentioned embodiment, if cache control is performed only for the information of the last address conversion table in the stage, only one Stage 2 Page needs to be cached. Since the data size of the Stage 1 Page / Table is small, the Stage 1 Page / Table with a close address hits the Stage 2 Page. Since it is expected that the Stage 2 Table will not be used even if it is cached, it is possible to improve the efficiency of cache usage by caching only the Stage 2 Page and not caching unnecessary Stage 2 Tables.
[0059] As for the information of other address conversion tables, the information to be acquired from the memory unit 12 is a table, and the purpose is to acquire setting information. This makes it possible to suppress cache control for such information of address conversion tables.
[0060] The address conversion table information used in the last stage is obtained when the information to be obtained from the memory unit 12 is a page and is intended to be used for obtaining setting information. Also, the address conversion table information used in the last stage is obtained when the information to be obtained from the memory unit 12 is a table and is not intended to be used for obtaining setting information. This allows cache control of such address conversion table information to be appropriately performed.
[0061] [B] Other The disclosed technology is not limited to the above-described embodiment, and various modifications can be made without departing from the spirit of the present embodiment. Each configuration and each process of the present embodiment can be selected as necessary, or can be combined as appropriate. [Explanation of symbols]
[0062] 1: Address translation system 11: CPU 12: Memory section 13: Address translation device 131: Control unit 132: Cache holder 101~103,105,601~603,605: Entry 104,604: Adder
Claims
1. A semiconductor device that performs address conversion using a plurality of address conversion tables, performing cache control on the information of the address translation table used in the final stage of the address translation stage, and not performing cache control on the information of other address translation tables; When the information of the other address conversion table or the information of the address conversion table used in the last stage is a Stage 2 Table for performing address conversion of a Context Descriptor or a Stage 2 Table for performing address conversion of a Stage 1 Table / Page, its purpose is to obtain setting information. Semiconductor device.
2. The information of the other address conversion table is a table, and the information to be acquired from the main storage device is a table. The semiconductor device according to claim 1 .
3. The information of the address conversion table used in the last stage is that the information to be acquired from the main memory is a page. The semiconductor device according to claim 1 .
Citation Information
Patent Citations
Memory managing device
JP1993241965A
Address conversion device
JP2007233615A
Input / Output Memory Management Unit (IOMMU) Two-Layer Addressing
JP2013546104A
Arithmetic processing unit, information processing unit, and method of controlling arithmetic processing unit
JP2019212167A
Measuring address translation latency
JP2019506670A
