A system for restricted access of GPU registers
By employing a multi-level security access control mechanism, the security and flexibility issues of register access in multi-user shared GPU chips are resolved, enabling restricted access for legitimate users and efficient permission assessment.
Patent Information
- Application Number
- CN202510309657.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-03-17
AI Technical Summary
In scenarios where multiple users share a GPU chip, existing technologies struggle to simultaneously guarantee the security and flexibility of register access, potentially leading to unauthorized access to user configuration information or the inability to share it.
A multi-level security access control mechanism is adopted, which implements multi-stage access permission judgment through security level checks of user identity, configuration registers and sub-register groups, ensuring that only legitimate users can access the corresponding register groups at the allowed security level.
It improves the security and flexibility of register access, ensuring that users can only access the sub-register groups that are allowed to be shared, avoiding unauthorized access, and improving access efficiency.
Smart Images

Figure CN120124030B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of chip architecture technology, and in particular to a restricted access system for GPU registers. Background Technology
[0002] Registers in a GPU chip are small storage units inside the chip that store and quickly access data, enabling rapid recording and retrieval of information. These registers play a crucial role in various tasks performed by the GPU chip, such as rendering graphics, model inference, and computation. The configuration register in a GPU chip is a special type of register primarily used to store and control various parameters and operating modes of the GPU chip.
[0003] In GPU chip application scenarios where multiple users share the same GPU chip, users need to configure the corresponding configuration registers in the GPU chip when using the GPU chip to process their own applications. However, the configuration registers configured by the user can be accessed by other users, resulting in poor register access security.
[0004] In existing technologies, different security levels are typically set for different users, preventing users with lower security levels from accessing the configuration information of users with higher priority, while users with higher security levels, such as administrators, can access the configuration information of users with lower priority, thereby improving the security of register access to some extent.
[0005] However, in scenarios where some user configuration information can be shared, the above method may result in all user configuration information being accessible or inaccessible, leading to poor flexibility in register access.
[0006] Therefore, improving the security and flexibility of register access has become an urgent problem to be solved. Summary of the Invention
[0007] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows:
[0008] A restricted access system for GPU registers, the system comprising: a GPU chip, a processor, and a memory storing a computer program, wherein the GPU chip includes G configuration registers {h1, h2, ..., h...} corresponding to each user. g , ..., h G}, h g This is the configuration register corresponding to the g-th user, where g is an integer in the range [1, G], and h... g Contains K(g) sub-register groups {l g 1, l g 2, ..., l gk(g) , ..., l g K(g)}, l g k(g) This refers to the k(g)th sub-register group in the configuration register corresponding to the g-th user, where k(g) is an integer in the range [1, K(g)]. The g-th user corresponds to the first security level r. g h g Corresponding to the second security level s g , l g k(g) Corresponding to the third security level t g k(g) When the computer program is executed by the processor, the following steps are performed:
[0009] S201, Obtain a second access request, the second access request including a user identifier and an access address.
[0010] S202, based on the preset checklist and the user identifier, the first check result is obtained.
[0011] S203, if the first check result meets the first preset condition, then obtain the first security level corresponding to the user identifier; otherwise, reject the second access request.
[0012] S204, determine the second security level of the configuration register corresponding to the access address.
[0013] S205, based on the second security level of the configuration register corresponding to the access address and the first security level corresponding to the user identifier, a second check result is obtained.
[0014] S206, if the second check result meets the second preset condition, then obtain the third security level of the sub-register group corresponding to the access address; otherwise, reject the second access request.
[0015] S207, based on the third security level of the sub-register group corresponding to the access address and the first security level corresponding to the user identifier, a third check result is obtained.
[0016] S208, if the third check result meets the third preset condition, then the second access request is allowed to access the sub-register group corresponding to the access address; otherwise, the second access request is rejected.
[0017] Compared with the prior art, the present invention has significant advantages. Through the above technical solution, the restricted access system for GPU registers provided by the present invention achieves considerable technical progress and practicality, and has broad industrial application value. It has at least the following advantages:
[0018] This invention provides a restricted access system for GPU registers, the system comprising: a GPU chip, a processor, and a memory storing a computer program, wherein the GPU chip includes G configuration registers {h1, h2, ..., h...} corresponding to each user. g , ..., h G}, h g This is the configuration register corresponding to the g-th user, where g is an integer in the range [1, G], and h... g Contains K(g) sub-register groups {l g 1, l g 2, ..., l g k(g) , ..., l g K(g)}, l g k(g) This refers to the k(g)th sub-register group in the configuration register corresponding to the g-th user, where k(g) is an integer in the range [1, K(g)]. The g-th user corresponds to the first security level r. g h g Corresponding to the second security level s g , l g k(g) Corresponding to the third security level t g k(g) When the computer program is executed by the processor, the following steps are implemented: S201, obtaining a second access request, the second access request including a user identifier and an access address; S202, obtaining a first check result according to a preset check table and the user identifier; S203, if the first check result meets a first preset condition, obtaining a first security level corresponding to the user identifier; otherwise, rejecting the second access request; S204, determining a second security level of the configuration register corresponding to the access address; S205, obtaining a second check result according to the second security level of the configuration register corresponding to the access address and the first security level corresponding to the user identifier; S206, if the second check result meets a second preset condition, obtaining a third security level of the sub-register group corresponding to the access address; otherwise, rejecting the second access request; S207, obtaining a third check result according to the third security level of the sub-register group corresponding to the access address and the first security level corresponding to the user identifier; S208, if the third check result meets a third preset condition, allowing the second access request to access the sub-register group corresponding to the access address; otherwise, rejecting the second access request.
[0019] It can be seen that, based on the user identifier in the second access request and its corresponding first security level, the second security level of the configuration register corresponding to the access address, and the third security level of the sub-register group corresponding to the access address, a multi-stage judgment is made on whether the second access request can access the sub-register group, which improves the security of register access. Furthermore, through the second and third security levels, the second access request can only access the sub-register group that the user is allowed to share, which improves the flexibility of register access in restricted access scenarios. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating the process of a computer program being executed by a processor in a GPU register chain access system provided in Embodiment 1 of the present invention.
[0022] Figure 2 This is a flowchart illustrating the execution of a computer program by a processor in a restricted access system for GPU registers, as provided in Embodiment 2 of the present invention.
[0023] Figure 3 This is a flowchart illustrating the process of a computer program being executed by a processor in a GPU register copy access system provided in Embodiment 3 of the present invention. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] This first embodiment provides a chain-structured access system for GPU registers. See [link to documentation]. Figure 1 This is a flowchart illustrating the execution of a computer program by a processor in a GPU register chain access system according to Embodiment 1 of the present invention. The system includes: a GPU chip, a processor, and a memory storing the computer program. The GPU chip comprises M module sets {a1, a2, ..., a...} m , ..., a M}, a mLet a be the set of the m-th module, where m is an integer in the range [1, M]. m ={b m 1, b m 2, ..., b m n(m) , ..., b m N(m)}, b m n(m) Let b be the n(m)th module in the m-th module set, where n(m) is an integer in the range [1, N(m)], and N(m) is the number of modules in the m-th module set. m n(m) Corresponding to register c m n(m) When the computer program is executed by the processor, the following steps are performed:
[0026] S101, by a m The included b m 1, b m 2, ..., b m n(m) , ..., b m N(m) Forming the register access chain D m ;
[0027] S102, for D m Module b in m n(m) Assign the corresponding reference marker E m n(m) ;
[0028] S103, when a first access request is obtained, according to the access type corresponding to the first access request, a number of register access chains matching the access type are determined, and all register access chains matching the access type are respectively used as target access chains. The first access request includes an access type and an access flag.
[0029] S104, targeting access chain D i Send the first access request to D i Module b in i j , i is an integer in the range [1, M], and j is initially 1;
[0030] S105, based on the access marker and b i j Corresponding reference mark E i j Determine b i j The first determination result regarding whether to accept the first access request;
[0031] S106, Based on the first access request and the first judgment result, determine b i j Should the first access request be sent to b? i j+1 ;
[0032] S107, if b is determined i j Do not send the first access request to b i j+1 Stop the transmission of the first access request;
[0033] S108, if b is determined i j The first access request is sent to b i j+1 If so, update j = j + 1, return to step S105, and continue until step S107 is executed or j = N(i) to complete the transmission of the first access request.
[0034] In this context, a module in a GP chip refers to a combination of independent or relatively independent hardware units with specific functions. Typically, a GPU chip requires multiple modules to work together to implement a specific function. In this embodiment, the modules corresponding to specific functions form a module set. The specific function can be referred to as the module type of the corresponding module set. Module types can include types such as arithmetic unit, graphing calculator, and resource manager.
[0035] It should be noted that a module typically contains multiple registers, but the distinction between registers within the same module does not affect the description of this embodiment. Therefore, for the sake of brevity, this embodiment describes one module corresponding to one register.
[0036] Register access chains can be used to access the registers of each module in a chain. A register access chain can correspond to a set of modules.
[0037] Reference markers can be used to identify the corresponding module in the register access chain. The first access request can refer to an access request to a register. The access type can be used to characterize the specific function corresponding to the module to which the register to be accessed belongs. Access markers can be used to identify the register to be accessed.
[0038] In one specific implementation, step S101 includes the following steps:
[0039] By a m The included b m 1, b m 2, ..., bm n(m) , ..., b m N(m) Register access chain D is formed according to a preset order. m The preset order is b. m n(m) Located at b m n(m)-1 after.
[0040] In this example, the register access chain is used for chained access, and chained access has a specific order. Therefore, in this embodiment, by a... m The included b m 1, b m 2, ..., b m n(m) , ..., b m N(m) Register access chain D is formed according to a preset order. m The preset order is determined based on the position of the module in the module set.
[0041] In one implementation, the implementer can also adjust the preset order based on factors such as the dependencies between modules and the data synchronization requirements.
[0042] In one specific implementation, the first access request corresponds to an access attribute, which includes shared register access, type register access, and module register access.
[0043] In this context, shared register access can refer to accessing all modules in each module set, type register access can refer to accessing all modules in a single module set, and module register access can refer to accessing a single module in a single module set.
[0044] In one specific implementation, the register access chain D m Corresponding to type value F m When the access attribute corresponding to the first access request belongs to shared register access, the access type corresponding to the first access request is the first preset value.
[0045] The step of determining a plurality of register access chains matching the access type corresponding to the first access request includes:
[0046] When the access type corresponding to the first access request is a first preset value, it is determined that all register access chains match the access type.
[0047] Otherwise, determine the register access chain corresponding to the type value with the same access type as the access type and match the access type.
[0048] The first preset value can represent that the first access request needs to access all modules in each module set, and the type value can represent the specific function corresponding to the corresponding register access chain.
[0049] Specifically, the type value and access type can be represented in an encoded form. When the access type corresponding to the first access request is the first preset value, it means that all modules in all register access chains need to receive the first access request. Therefore, it is determined that all register access chains match the access type. Otherwise, it means that the access attribute of the first access request is type register access or module register access. Both type register access and module register access only require a single register access chain to receive the first access request. Therefore, the register access chain corresponding to the type value with the same access type can be directly matched with the access type.
[0050] In one specific implementation, when the access attribute corresponding to the first access request belongs to shared register access or type register access, the access flag corresponding to the first access request is a second preset value.
[0051] The second preset value can be used to characterize all modules in a matching register access chain that the first access request needs to access.
[0052] In one specific implementation, the first determination result includes accepting and not accepting;
[0053] The access token and b i j Corresponding reference mark E i j Determine b i j The first determination result regarding whether to accept the first access request includes:
[0054] When the access flag corresponding to the first access request is a second preset value, the first judgment result is determined to be received;
[0055] Otherwise, compare the access token and E. i j Are they the same?
[0056] If the access token and E i j If they are the same, then the first judgment result is determined to be received;
[0057] If the access token and E i j If they are different, then the first judgment result is determined to be non-acceptance.
[0058] Specifically, when the access flag corresponding to the first access request is the second preset value, it means that all modules in the matched register access chain need to receive the first access request. Therefore, the first judgment result is determined to be received. Otherwise, it means that only one module needs to receive the first access request. Therefore, the access flag and the reference flag corresponding to the module are compared. If the comparison is consistent, the first judgment result is determined to be received. Otherwise, it is determined to be not received.
[0059] In one specific implementation, the step of determining b based on the first access request and the first determination result is... i j Should the first access request be sent to b? i j+1 ,include:
[0060] When the access attribute corresponding to the first access request belongs to shared register access or type register access, determine b. i j The first access request is sent to b i j+1 ;
[0061] When the access attribute corresponding to the first access request belongs to module register access, and the first determination result is not to accept, determine b. i j The first access request is sent to b i j+1 ;
[0062] When the access attribute corresponding to the first access request belongs to module register access, and the first determination result is received, determine b. i j Do not send the first access request to b i j+1 .
[0063] Specifically, when the access attribute corresponding to the first access request belongs to shared register access or type register access, the first access request needs to be sent to all modules in the matching register access chain. Therefore, by default, the current module needs to send the first access request to the next module, which means that b is determined. i j Send the first access request to b i j+1 .
[0064] When the access attribute corresponding to the first access request belongs to module register access, and the first judgment result is not to accept, determine b. i j The first access request is sent to b i j+1The first access request needs to be sent to a single module in the matching register access chain. However, the first judgment result is not to receive it, which means that the first access request has not yet been sent to the corresponding module through the chain structure. Therefore, the current module needs to send the first access request to the next module.
[0065] When the access attribute corresponding to the first access request belongs to module register access and the first judgment result is received, the first access request needs to be sent to a single module in the matching register access chain. The first judgment result is received, which means that the first access request has been sent to the corresponding module through the chain structure. Therefore, the current module does not need to send the first access request to the next module.
[0066] In one specific implementation, in b i j When the first access request is received, register c i j Respond to the first access request.
[0067] Since the first access request is for accessing a register, when the corresponding module receives the first access request, its internal registers respond to the first access request.
[0068] Specifically, the first access request may also include a register address, and the register corresponding to the register address in the module responds to the first access request.
[0069] As can be seen, in this embodiment, the register access chain is formed by the modules in the same module set. When faced with different types of first access requests, the module to receive the first access request is determined by the chain structure, as well as the transmission of the first access request along the chain structure. Thus, register access to multiple modules can be achieved by sending only one first access request, and it is also compatible with the need to access the registers of only a single module. Without affecting the access function, the number of access requests is effectively reduced, thereby avoiding hardware resource contention and effectively improving the efficiency of register access.
[0070] This second embodiment provides a restricted access system for GPU registers, see [link to documentation]. Figure 2 This is a flowchart illustrating the execution of a computer program by a processor in a restricted access system for GPU registers according to Embodiment 2 of the present invention. The system includes: a GPU chip, a processor, and a memory storing the computer program. The GPU chip includes G configuration registers {h1, h2, ..., h...} corresponding to each user. g , ..., h G}, h g This is the configuration register corresponding to the g-th user, where g is an integer in the range [1, G], and h...g Contains K(g) sub-register groups {l g 1, l g 2, ..., l g k(g) , ..., l g K(g)}, l g k(g) This refers to the k(g)th sub-register group in the configuration register corresponding to the g-th user, where k(g) is an integer in the range [1, K(g)]. The g-th user corresponds to the first security level r. g h g Corresponding to the second security level s g , l g k(g) Corresponding to the third security level t g k(g) When the computer program is executed by the processor, the following steps are performed:
[0071] S201, Obtain a second access request, the second access request including a user identifier and an access address;
[0072] S202, Based on the preset checklist and the user identifier, obtain the first check result;
[0073] S203, if the first check result meets the first preset condition, then obtain the first security level corresponding to the user identifier; otherwise, reject the second access request.
[0074] S204, determine the second security level of the configuration register corresponding to the access address;
[0075] S205, based on the second security level of the configuration register corresponding to the access address and the first security level corresponding to the user identifier, a second check result is obtained;
[0076] S206, if the second check result meets the second preset condition, then obtain the third security level of the sub-register group corresponding to the access address; otherwise, reject the second access request.
[0077] S207, based on the third security level of the sub-register group corresponding to the access address and the first security level corresponding to the user identifier, a third check result is obtained;
[0078] S208, if the third check result meets the third preset condition, then the second access request is allowed to access the sub-register group corresponding to the access address; otherwise, the second access request is rejected.
[0079] The configuration register can be used to store user configuration information. The configuration register may include several sub-register groups, and each sub-register group may include several sub-registers. It should be noted that in this embodiment, the sub-register group is the smallest granularity of user configuration. The distinction between each sub-register in the same sub-register group does not affect the description of this embodiment. Therefore, for the sake of simplicity, this embodiment is described using sub-registers as the object.
[0080] The first, second, and third security levels can be used to determine a user's access permissions to configuration registers or sub-register groups.
[0081] The second access request may refer to an access request to several sub-register groups related to user configuration. The user identifier can be used to identify the legitimacy of the user, and the access address may refer to the address corresponding to the sub-register group.
[0082] The first check result can be used to characterize the user's legitimacy, the first preset condition can be used to determine the user's legitimacy, the second check result can be used to characterize the comparison result between the user's first security level and the second security level of the configuration register, the second preset condition can be used to determine whether the user has permission to access the configuration register, the third check result can be used to characterize the comparison result between the user's first security level and the third security level of the sub-register group, the third preset condition can be used to determine whether the user has permission to access the sub-register.
[0083] In one specific implementation, h g The corresponding second security level s g The method for determining it is as follows:
[0084] h g The minimum value in the third security level corresponding to all sub-register groups is used as h. g The corresponding second security level s g .
[0085] In this embodiment, for any configuration register, the minimum value of the third security level corresponding to each sub-register group in the configuration register is used as the second security level of the configuration register. This allows users to set the third security level of the shareable sub-register groups to a lower value and the third security level of the non-shared sub-register groups to a higher value when there are shareable sub-register groups. Combined with the second security level, this allows other users to access the configuration register and access the shareable sub-register groups from the configuration register, but not to access the non-shared sub-register groups.
[0086] In one specific implementation, the preset checklist includes the legal identifiers corresponding to the G users respectively;
[0087] The step of obtaining the first check result based on the preset checklist and the user identifier includes:
[0088] The user identifier is compared with each of the legal identifiers in the preset checklist. If any legal identifier matches the user identifier, the first check result is determined to be a pass; otherwise, the first check result is determined to be a fail.
[0089] Among them, the legitimate identifier can be used to identify legitimate users. When there is a legitimate identifier in the preset check table that matches the user identifier, the first check result can be determined as a pass.
[0090] In one specific implementation, the first preset condition is: the first check result is that the check is passed.
[0091] Specifically, if the first check result is a pass, the first security level corresponding to the user identifier is obtained; otherwise, the second access request is rejected.
[0092] In one specific implementation, obtaining the second check result based on the second security level of the configuration register corresponding to the access address and the first security level corresponding to the user identifier includes:
[0093] The second security level of the configuration register corresponding to the access address is compared with the first security level corresponding to the user identifier. If the second security level of the configuration register corresponding to the access address is less than or equal to the first security level corresponding to the user identifier, the second check result is determined to be a pass; otherwise, the second check result is determined to be a fail.
[0094] In this embodiment, the higher the security level, the higher the access permission or the access required permission. Therefore, when the second security level of the configuration register corresponding to the access address is less than or equal to the first security level corresponding to the user identifier, it means that the access permission of the first security level corresponding to the user identifier is higher than the access required permission of the second security level of the configuration register corresponding to the access address, and the second check result is determined to be a pass.
[0095] In one specific implementation, the second preset condition is: the second check result is that the check passes.
[0096] Specifically, if the second check passes, the third security level of the sub-register group corresponding to the access address is obtained; otherwise, the second access request is rejected.
[0097] In one specific implementation, obtaining the third check result based on the third security level of the sub-register group corresponding to the access address and the first security level corresponding to the user identifier includes:
[0098] The third security level of the sub-register group corresponding to the access address is compared with the first security level corresponding to the user identifier. If the third security level of the sub-register group corresponding to the access address is less than or equal to the first security level corresponding to the user identifier, the third check result is determined to be a pass; otherwise, the third check result is determined to be a fail.
[0099] Specifically, when the third security level of the sub-register group corresponding to the access address is less than or equal to the first security level corresponding to the user identifier, it indicates that the access permission of the first security level corresponding to the user identifier is higher than the access permission required for the third security level of the sub-register group corresponding to the access address, and the third check result is determined to be a pass.
[0100] In one specific implementation, the third preset condition is: the third check result is that the check passes.
[0101] Specifically, if the third check passes, the second access request is allowed to access the sub-register group corresponding to the access address; otherwise, the second access request is rejected.
[0102] It should be noted that the restricted access system for GPU registers provided in this embodiment can be coupled with the chained access system for GPU registers provided in Embodiment 1. Accordingly, the second access request can be included in the first access request. The first access request is sent to the corresponding register through chained access. This register can be a configuration register. Based on the user identifier and access address contained in the second access request, the first security level corresponding to the user identifier in the second access request, the second security level of the configuration register corresponding to the access address, and the third security level of the sub-register group corresponding to the access address can be determined. This allows it to determine whether the first access request can access the configuration register and the sub-register group that can be accessed in the configuration register. This ensures high register access efficiency while preventing user configuration information from being read by other users without the necessary permissions, thus improving the security of register access.
[0103] As can be seen, this embodiment performs multi-stage judgment on whether the second access request can access the sub-register group based on the user identifier in the second access request and its corresponding first security level, the second security level of the configuration register corresponding to the access address, and the third security level of the sub-register group corresponding to the access address. This improves the security of register access. Furthermore, through the second and third security levels, the second access request can only access the sub-register group that the user is allowed to share, thus improving the flexibility of register access in restricted access scenarios.
[0104] This third embodiment provides a system for copying and accessing GPU registers. See [link to documentation]. Figure 3 This is a flowchart illustrating the execution of a computer program by a processor in a GPU register copy access system according to Embodiment 3 of the present invention. The system includes a GPU chip, a processor, and a memory storing the computer program. The GPU chip contains U modules, and each module contains W(U) registers, where U and W(U) are both positive integers. When the computer program is executed by the processor, the following steps are implemented:
[0105] S301, Obtain V user configuration information, wherein the user configuration information includes several configuration items and configuration values corresponding to each configuration item, where V is a positive integer;
[0106] S302, Initial configuration information is extracted from the V user configuration information;
[0107] S303, determine the register corresponding to the initial configuration information as the initial register;
[0108] S304, Configure the module to which each initial register belongs according to the initial configuration information;
[0109] S305, when the target application is obtained, a copy command is sent to the module corresponding to the target application. One target application corresponds to one user configuration information.
[0110] S306, the user configuration information corresponding to the target application is used as the target configuration information;
[0111] S307, after receiving the copy command, the module corresponding to the target application copies the initial configuration information from the module to which any initial register belongs to the register corresponding to the target configuration information;
[0112] S308, Determine the differential configuration information based on the target configuration information and the initial configuration information;
[0113] S309, Configure the module corresponding to the target application according to the difference configuration information.
[0114] Among them, V user configuration information can refer to V user configuration information that have some configuration items and corresponding configuration values that are the same. Configuration items can be initialization status, instruction access permissions, register identifier, register size and bit width, etc.
[0115] The initial configuration information can serve as a base configuration, allowing subsequent configurations to be made by copying this initial configuration information. The initial register can refer to the register that needs to be configured according to the initial configuration information.
[0116] In one specific implementation, the step of extracting initial configuration information from the V user configuration information includes:
[0117] The configuration items included in all V user configuration information are used as temporary items;
[0118] If the configuration value corresponding to the temporary item is the same in all V user configurations, then the temporary item is determined to be the initial configuration item;
[0119] The initial configuration information is formed by all the initial configuration items and the configuration values corresponding to each initial configuration item.
[0120] Temporary items can refer to configuration items that exist in the configuration information of V users. However, since the configuration values corresponding to temporary items in the configuration information of V users may be different, a temporary item is determined to be an initial configuration item only when the configuration value corresponding to the temporary item is the same in the configuration information of V users.
[0121] The initial configuration information may include several initial configuration items and their corresponding configuration values.
[0122] In one specific implementation, the initial configuration information corresponds to several registers;
[0123] Accordingly, determining the register corresponding to the initial configuration information as the initial register includes:
[0124] Each register corresponding to the initial configuration information is designated as an initial register.
[0125] In the GPU chip register configuration scenario, the initial configuration information can correspond to multiple registers. Therefore, each register corresponding to the initial configuration information is used as the initial register.
[0126] In one specific implementation, configuring the module to which each initial register belongs based on the initial configuration information includes:
[0127] For any module to which an initial register belongs, configure the initial register in that module according to the initial configuration information.
[0128] In this context, configuring the initial register in the module according to the initial configuration information can refer to writing the initial configuration information into the initial register of the module.
[0129] In one specific implementation, the target application corresponds to several modules;
[0130] Accordingly, sending the copy command to the module corresponding to the target application includes:
[0131] The copy command is sent to each module corresponding to the target application.
[0132] The target application can correspond to multiple modules. Therefore, when it is necessary to configure the registers corresponding to the target application, a copy command needs to be sent to each module corresponding to the target application.
[0133] In one specific implementation, copying the initial configuration information from the module to which any initial register belongs to the register corresponding to the target configuration information includes:
[0134] The initial configuration information is extracted from the module to which any initial register belongs;
[0135] The initial configuration information is copied to the register corresponding to the target configuration information.
[0136] Copying the initial configuration information to the register corresponding to the target configuration information can mean writing the extracted initial configuration information into the register corresponding to the target configuration information.
[0137] In one specific implementation, the target configuration information corresponds to several registers;
[0138] Accordingly, copying the initial configuration information to the register corresponding to the target configuration information includes:
[0139] The initial configuration information is copied to each register corresponding to the target configuration information.
[0140] The target configuration information can correspond to multiple registers. Therefore, the initial configuration information needs to be copied to each register corresponding to the target configuration information.
[0141] In one specific implementation, determining the differential configuration information based on the target configuration information and the initial configuration information includes:
[0142] For any configuration item in the target configuration information, if the configuration item is not included in the initial configuration information, then the configuration item is determined to be a difference item;
[0143] If the configuration item is included in the initial configuration information, and the configuration value corresponding to the configuration item in the target configuration information is different from the configuration value corresponding to the configuration item in the initial configuration information, then the configuration item is determined to be a difference item.
[0144] The difference configuration information is formed by all the differences and their corresponding configuration values in the target configuration information.
[0145] Among them, differential configuration information can refer to information that is not included in the initial configuration information but is included in the target configuration information.
[0146] It should be noted that the GPU register copy access system provided in this embodiment can be coupled with the GPU register chain access system provided in Embodiment 1 and / or the GPU register restricted access system provided in Embodiment 2. For example, in this embodiment, user configuration information can be regarded as the first access request to the corresponding register. Therefore, user configuration information can be sent to the register in a chain structure. The register corresponding to the user configuration information is usually the configuration register. When a copy operation is required in this embodiment, the copy operation can be regarded as the second access request to the corresponding configuration register.
[0147] As can be seen, this embodiment analyzes the configuration information of V users to obtain the initial configuration information, and configures the initial configuration information to the module to which each initial register belongs. When the target application needs to be executed, the initial configuration information is copied from the module to which the initial register belongs to the register corresponding to the target configuration information. There is no need to configure each register completely. Only the difference configuration information needs to be configured to quickly configure the target configuration information of the target application to the register corresponding to the target configuration information, which effectively improves the efficiency of register configuration.
[0148] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the above examples are for illustrative purposes only and are not intended to limit the scope of the invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.
Claims
1. A restricted access system for GPU registers, characterized in that, The system includes: a GPU chip, a processor, and a memory storing computer programs, wherein the GPU chip includes G configuration registers {h1, h2, ..., h...} corresponding to each user. g , ..., h G }, h g This is the configuration register corresponding to the g-th user, where g is an integer in the range [1, G], and h... g Contains K(g) sub-register groups {l g 1, l g 2, ..., l g k(g) , ..., l g K(g) }, l g k(g) This refers to the k(g)th sub-register group in the configuration register corresponding to the g-th user, where k(g) is an integer in the range [1, K(g)]. The g-th user corresponds to the first security level r. g h g Corresponding to the second security level s g , l g k(g) Corresponding to the third security level t g k(g) When the computer program is executed by the processor, the following steps are performed: S201, Obtain a second access request, the second access request including a user identifier and an access address; S202, Based on the preset checklist and the user identifier, obtain the first check result; S203, if the first check result meets the first preset condition, then obtain the first security level corresponding to the user identifier; otherwise, reject the second access request. S204, determine the second security level of the configuration register corresponding to the access address; S205, based on the second security level of the configuration register corresponding to the access address and the first security level corresponding to the user identifier, a second check result is obtained; S206, if the second check result meets the second preset condition, then obtain the third security level of the sub-register group corresponding to the access address; otherwise, reject the second access request. S207, based on the third security level of the sub-register group corresponding to the access address and the first security level corresponding to the user identifier, a third check result is obtained; S208, if the third check result meets the third preset condition, then the second access request is allowed to access the sub-register group corresponding to the access address; otherwise, the second access request is rejected.
2. The restricted access system according to claim 1, characterized in that, h g The corresponding second security level s g The method for determining it is as follows: h g The minimum value in the third security level corresponding to all sub-register groups is used as h. g The corresponding second security level s g .
3. The restricted access system according to claim 1, characterized in that, The preset checklist includes the valid identifiers corresponding to the G users respectively; The step of obtaining the first check result based on the preset checklist and the user identifier includes: The user identifier is compared with each of the legal identifiers in the preset checklist. If any legal identifier matches the user identifier, the first check result is determined to be a pass; otherwise, the first check result is determined to be a fail.
4. The restricted access system according to claim 3, characterized in that, The first preset condition is: the first check result is that the check is passed.
5. The restricted access system according to claim 1, characterized in that, The step of obtaining the second check result based on the second security level of the configuration register corresponding to the access address and the first security level corresponding to the user identifier includes: The second security level of the configuration register corresponding to the access address is compared with the first security level corresponding to the user identifier. If the second security level of the configuration register corresponding to the access address is less than or equal to the first security level corresponding to the user identifier, the second check result is determined to be a pass; otherwise, the second check result is determined to be a fail.
6. The restricted access system according to claim 5, characterized in that, The second preset condition is: the second check result is that the check passes.
7. The restricted access system according to claim 1, characterized in that, The process of obtaining the third check result based on the third security level of the sub-register group corresponding to the access address and the first security level corresponding to the user identifier includes: The third security level of the sub-register group corresponding to the access address is compared with the first security level corresponding to the user identifier. If the third security level of the sub-register group corresponding to the access address is less than or equal to the first security level corresponding to the user identifier, the third check result is determined to be a pass; otherwise, the third check result is determined to be a fail.
8. The restricted access system according to claim 7, characterized in that, The third preset condition is: the third check result is that the check is passed.
Citation Information
Patent Citations
Device and method for realizing multi-stage on-chip interconnection
CN107707491A
Data processing apparatus and access control method therefor
US20090271861A1