A multi-core heterogeneous SOC and its memory and resource monitoring method and device
By configured multiple hardware domains and firewalls in multi -nuclear and heterogeneous SOCs, monitoring and avoiding the abnormal stamping of cross -domain memory or resources, the problem of low monitoring efficiency in existing technology has been solved, and efficient and reliable memory and resource monitoring have been achieved.
Patent Information
- Application Number
- CN202411480719.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-10-23
AI Technical Summary
The prior art is difficult to effectively monitor and avoid cross-domain memory or resource stampedes in multi-core heterogeneous SOCs, resulting in inefficient monitoring and unreasonable resource allocation.
By configured at least two hardware domains and firewalls in the multi -nuclear and heterogeneous SOC, determine the monitoring unit and set the preset access permissions. Each hardware domain determines the actual access permissions respectively. Cross -domain stomping monitoring through the firewall, feedback reminders' information.
Effectively avoid stomping abnormalities, improve the reliability of monitoring and the standardization of memory resources, and achieve the rationality of cross -domain visits, save time and effort, high efficiency, and easily adjust system memory or resource use in time.
Smart Images

Figure CN119003287B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of multi-core heterogeneous SOC communication monitoring, and in particular to a multi-core heterogeneous SOC and a memory and resource monitoring method and device thereof. Background Art
[0002] In modern embedded systems, MPU (Memory Protection Unit) and Firewall are two key components. MPU is a hardware mechanism for monitoring memory and peripheral resources in a single domain. It is responsible for only allowing certain resource codes to access the corresponding memory and peripherals, thereby limiting the access of some applications to memory and peripherals to improve product security. Firewall is a mechanism to prevent network attacks, protecting the system from external network attacks. In addition, memory and resource monitoring technology also plays an important role in embedded systems. It can monitor the usage of memory and resources of embedded systems so as to promptly discover and solve memory and resource related problems.
[0003] Multi-core heterogeneous SOC (System On Chip) is a key technology in modern embedded systems and automotive electronics. It meets the diverse needs of complex applications through multiple hardware domains. In related technologies, a single MPU is usually used to monitor a single memory or resource. The MPU notifies the MPU hardware by setting the information of accessing memory or resources, so that the MPU hardware monitors the usage of single-domain memory or resources, but the MPU hardware cannot monitor across domains. Firewall protects the system more by preventing network attacks. The two are used one or independently, which may cause irregular memory usage and unreasonable resource allocation when accessing memory or resources within a single domain and across domains, and the problem is prominent. When dealing with the problem of unknown trampled memory addresses, the existing technology often only targets a certain domain, which is time-consuming, labor-intensive and inefficient. Summary of the invention
[0004] In order to solve at least one problem existing in the prior art, the purpose of the present application is to provide a multi-core heterogeneous SOC and its memory and resource monitoring method and device, which can effectively avoid trampling and improve the reliability of monitoring, the standardization of memory usage and the rationality of resource allocation for access monitoring within a single domain and across domains of a multi-core heterogeneous SOC, and save time and effort, and be highly efficient, so that developers or system users can adjust the use of system memory or resources in a timely manner.
[0005] To achieve the above-mentioned purpose, the present application provides a memory and resource monitoring method based on a multi-core heterogeneous SOC, wherein the multi-core heterogeneous SOC is configured with at least two hardware domains and a firewall; the at least two hardware domains include a first security domain; the method includes,
[0006] The first security domain determines a monitored unit, and determines preset access rights of each hardware domain to the monitored unit; wherein the monitored unit is a memory or a resource in the multi-core heterogeneous SOC;
[0007] Each hardware domain determines the actual access rights to the monitored unit respectively;
[0008] Based on the consistency between the actual access rights and the preset access rights, the corresponding hardware domain monitors the monitored unit for single-domain trampling anomalies and cross-domain trampling anomalies;
[0009] Starting the firewall to perform cross-domain trampling anomaly monitoring on the monitored unit;
[0010] In response to the presence of abnormal stepping, abnormal reminder information is fed back.
[0011] Furthermore, after the step of determining the preset access rights of each hardware domain to the monitored unit, the method further includes:
[0012] The first memory protection unit corresponding to the first security domain configures the access attribute of the first security domain to the monitored unit as read-only;
[0013] In response to the preset access right of the first security domain to the monitored unit being granted access right, the first memory protection unit determines whether there is a single-domain trampling abnormality of the first security domain to the monitored unit;
[0014] In response to the single-domain trampling anomaly of the monitored unit by the first security domain, feeding back first security domain single-domain access anomaly reminder information;
[0015] In response to the single-domain trampling anomaly not existing in the first security domain to the monitored unit, it is determined that the single-domain access of the first security domain to the monitored unit is normal.
[0016] Furthermore, the method further comprises,
[0017] In response to the preset access right of the first security domain to the monitored unit being no access right, the first memory protection unit and the firewall respectively determine whether there is a cross-domain trampling anomaly of the first security domain to the monitored unit;
[0018] In response to the first memory protection unit and / or the firewall determining that the first security domain has the cross-domain trampling anomaly on the monitored unit, feeding back first security domain cross-domain access anomaly reminder information;
[0019] In response to the first memory protection unit and the firewall determining that the cross-domain trampling anomaly does not exist in the first security domain to the monitored unit, it is determined that the cross-domain access of the first security domain to the monitored unit is normal.
[0020] Further, the at least two hardware domains include at least one second security domain; after the step of determining the preset access rights of each hardware domain to the monitored unit, the method further includes:
[0021] In response to the preset access right of the second security domain to the monitored unit being allowed, the second security domain configures the access attribute of the monitored unit as second security domain read-only through the corresponding second memory protection unit, and determines whether the second security domain has a single-domain trampling anomaly to the monitored unit;
[0022] In response to the second security domain having the single-domain trampling abnormality on the monitored unit, feeding back second security domain single-domain access abnormality reminder information;
[0023] In response to the single-domain trampling abnormality of the second security domain to the monitored unit not existing, it is determined that the single-domain access of the second security domain to the monitored unit is normal.
[0024] Furthermore, the method further comprises,
[0025] In response to the preset access right of the second security domain to the monitored unit being no access right, the first security domain sending the address information of the monitored unit to the second security domain through inter-core communication;
[0026] The second security domain configures the access attribute of the monitored unit as second security domain read-only through the second memory protection unit based on the address information;
[0027] The second memory protection unit and the firewall determine whether the second security domain has a cross-domain trampling anomaly on the monitored unit;
[0028] In response to the second memory protection unit and / or the firewall determining that the second security domain has the cross-domain trampling anomaly on the monitored unit, feeding back second security domain cross-domain access anomaly reminder information;
[0029] In response to the second memory protection unit and the firewall determining that the cross-domain trampling anomaly does not exist in the second security domain to the monitored unit, it is determined that the cross-domain access of the second security domain to the monitored unit is normal.
[0030] Furthermore, the at least two hardware domains include at least one application domain, and the method further includes:
[0031] In response to the preset access right of the application domain to the monitored unit being granted access right, the memory management unit corresponding to the application domain determines whether a single-domain trampling abnormality exists with respect to the monitored unit;
[0032] In response to the single-domain trampling anomaly of the application domain on the monitored unit, feeding back application domain single-domain access anomaly reminder information;
[0033] In response to the single-domain trampling abnormality of the application domain to the monitored unit not existing, it is determined that the single-domain access of the application domain to the monitored unit is normal.
[0034] Furthermore, the method further comprises,
[0035] In response to the preset access right of the application domain to the monitored unit being no access right, the first security domain sends the address information of the monitored unit to the application domain through inter-core communication;
[0036] The application domain determines, based on the address information, whether the monitored unit is mapped by the memory management unit;
[0037] In response to the monitored unit being mapped by the memory management unit, application domain cross-domain access exception reminder information is fed back.
[0038] Furthermore, the method further comprises,
[0039] In response to the monitored unit not being mapped by the memory management unit, the application domain and the firewall determine whether there is a cross-domain trampling anomaly on the monitored unit;
[0040] In response to the application domain and / or the firewall determining that the application domain has the cross-domain trampling anomaly on the monitored unit, feeding back application domain cross-domain access anomaly reminder information;
[0041] In response to the application domain and the firewall determining that the cross-domain trampling anomaly of the application domain to the monitored unit does not exist, it is determined that the cross-domain access of the application domain to the monitored unit is normal.
[0042] To achieve the above-mentioned purpose, the present application also provides a multi-core heterogeneous SOC, which is configured with at least two hardware domains and a firewall; the at least two hardware domains include a first security domain; wherein,
[0043] The first security domain is used to determine a monitored unit and determine a preset access right of each hardware domain to the monitored unit; wherein the monitored unit is a memory or a resource in the multi-core heterogeneous SOC;
[0044] Each hardware domain is used to respectively determine the actual access rights to the monitored unit; and based on the consistency between the actual access rights and the preset access rights, determine whether there is a single-domain trampling anomaly and a cross-domain trampling anomaly to the monitored unit; and in response to determining that there is the trampling anomaly, feedback trampling anomaly reminder information;
[0045] The firewall is used to start after the first security domain determines the preset access right, and perform cross-domain trampling anomaly monitoring on the monitored unit; and in response to determining the existence of the cross-domain trampling anomaly monitoring, feedback trampling anomaly reminder information.
[0046] To achieve the above objectives, the present application also provides an electronic device, including a memory and a processor, wherein the memory stores computer instructions, and the processor is configured to run the instructions to execute the memory and resource monitoring method based on a multi-core heterogeneous SOC as described above.
[0047] The present application discloses a multi-core heterogeneous SOC and its memory and resource monitoring method and device, which determines the monitored unit through the first security domain, and determines the preset access rights of each hardware domain to the monitored unit; and determines the actual access rights to the monitored unit through each hardware domain; and based on the consistency between the actual access rights and the preset access rights, the corresponding hardware domain monitors the monitored unit for single-domain trampling anomalies and cross-domain trampling anomalies; and monitors the monitored unit for cross-domain trampling anomalies by starting a firewall; and in response to determining that there is a trampling anomaly, feedbacks abnormal reminder information. Therefore, for the access monitoring within a single domain and across domains of a multi-core heterogeneous SOC, not only can trampling be effectively avoided, the reliability of monitoring, the standardization of memory usage and the rationality of resource allocation be improved, but also it saves time and effort, is highly efficient, and is convenient for developers or system users to adjust the use of system memory or resources in a timely manner.
[0048] Other features and advantages of the present application will be set forth in the following description, and in part will become apparent from the description, or may be understood by practicing the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:
[0050] Figure 1 is a flowchart of a memory and resource monitoring method based on a multi-core heterogeneous SOC according to an embodiment of the present application;
[0051] Figure 2 is a flowchart of a memory and resource monitoring method based on a multi-core heterogeneous SOC according to another embodiment of the present application;
[0052] Figure 3 is a flowchart of a memory and resource monitoring method based on a multi-core heterogeneous SOC according to another embodiment of the present application;
[0053] Figure 4 is a flowchart of a memory and resource monitoring method based on a multi-core heterogeneous SOC according to another embodiment of the present application;
[0054] Figure 5 is a structural block diagram of a multi-core heterogeneous SOC according to an embodiment of the present application;
[0055] Figure 6 for Figure 5 Schematic diagram of the functional structure of a multi-core heterogeneous SOC;
[0056] Figure 7 is a structural block diagram of a multi-core heterogeneous SOC according to another embodiment of the present application;
[0057] Figure 8 is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0058] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes and are not intended to limit the scope of protection of the present application.
[0059] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment". The relevant definitions of other terms will be given in the following description.
[0060] It should be noted that the concepts such as "first" and "second" mentioned in this application are only used to distinguish different modules and units, and are not used to limit the order or interdependence of the functions performed by these modules and units.
[0061] It should be noted that the modifications of "one" and "plurality" mentioned in this application are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more". "Plurality" should be understood as two or more.
[0062] Hereinafter, embodiments of the present application will be described in detail with reference to the accompanying drawings.
[0063] First of all, it should be noted that the memory and resource monitoring method provided in this application is used for multi-core heterogeneous SOC. The multi-core heterogeneous SOC contains a variety of hardware resources, including computing type hardware resources, such as CPU cores, GPU cores, etc.; storage type hardware resources, such as memory, etc.; control type hardware resources, such as power controllers, clock controllers, interrupt controllers, etc.; communication type hardware resources, such as buses, etc.
[0064] A variety of hardware resources are configured as multiple hardware domains, each hardware domain is configured to run a different operating system, and each hardware domain does not respond to data access requests from other hardware collections, nor does it respond to scheduling of other operating systems except the operating system configured on this hardware collection.
[0065] The multi-core heterogeneous SOC is also provided with hardware resources that support communication between different hardware domains, namely, inter-domain communication channels, which can also be called inter-core communication. The hardware resources are configured to support data transmission or read requests of hardware in different hardware domains to support the establishment of data communication links between different operating systems, realize data transmission across hardware resources, and information communication across operating systems. The memory and resource monitoring method based on multi-core heterogeneous SOC in this application is implemented based on the inter-domain communication channel.
[0066] Figure 1 The following is a flow chart of a memory and resource monitoring method based on a multi-core heterogeneous SOC according to an embodiment of the present application. Figure 1 , the memory and resource monitoring method based on multi-core heterogeneous SOC of this application is described in detail.
[0067] In step 101, the first security domain determines a monitored unit and determines preset access rights of each hardware domain to the monitored unit.
[0068] It should be noted that the monitored unit in this application refers to the monitored memory or resources in a multi-core heterogeneous SOC.
[0069] Specifically, the multi-core heterogeneous SOC is configured with at least two hardware domains and a firewall, and the hardware domain includes at least one application domain and at least one security domain. In a specific example, the application domain refers to the hardware domain that has strong computing performance and can support applications with high computing performance requirements. The security domain may include at least one of the following features: an architecture with high functional safety; running an operating system that meets high functional safety requirements; processing tasks with high functional safety requirements. In addition, the security domain in the SOC includes a first security domain, which is used to determine the monitored unit and determine whether each hardware domain has access rights to the monitored unit based on a preset configuration.
[0070] It is understandable that the security domain of the SOC may include only one security domain, namely the first security domain, or may include at least two security domains, namely the first security domain and at least one conventional security domain (the second security domain described below). This application does not impose any specific limitation on this.
[0071] In step 102, each hardware domain determines actual access rights to the monitored unit.
[0072] Specifically, the security domain is configured with a corresponding MPU, and the actual access rights of the corresponding security domain to the monitored unit are determined through the MPU; the application domain is configured with a corresponding MMU (Memory Manage Unit), and the actual access rights of the application domain to the monitored unit are determined through the MMU.
[0073] In step 103, based on the consistency between the actual access rights and the preset access rights, the corresponding hardware domain monitors the monitored unit for single-domain trampling anomalies and cross-domain trampling anomalies.
[0074] Specifically, for the monitored unit, if the actual access rights for access within a single domain are consistent with the preset access rights, it is determined that there is no single-domain stampede anomaly in the hardware domain; if the actual access rights for access across domains are consistent with the preset access rights, it is determined that there is no cross-domain stampede anomaly in the hardware domain; if the actual access rights for access within a single domain are inconsistent with the preset access rights, it is determined that there is a single-domain stampede anomaly in the hardware domain; if the actual access rights for access across domains are inconsistent with the preset access rights, it is determined that there is a cross-domain stampede anomaly in the hardware domain.
[0075] It should be noted that the trampling of the monitored unit includes memory trampling and resource trampling. Among them, memory trampling usually refers to the phenomenon that a large amount of memory is occupied due to improper memory allocation and release during the running of the program, thereby causing system performance degradation or even crash. Resource trampling can be excessive occupation or improper use of system resources. When a process or application occupies too much resources, it may cause other processes or applications to fail to run normally, or even cause the system to crash. Specifically for multi-core heterogeneous SOCs, single-domain trampling anomalies refer to anomalies caused by memory trampling and resource trampling within a single hardware domain; cross-domain trampling anomalies refer to anomalies caused by memory trampling and resource trampling between different hardware domains.
[0076] In step 104, the firewall is started to monitor the monitored unit for cross-domain trampling anomalies.
[0077] Specifically, after each hardware domain determines the actual access rights to the monitored unit, the firewall is started and monitors whether the monitored unit has an abnormality of cross-domain trampling on the monitored unit. In a specific example, the firewall can perform cross-domain monitoring of SOC and indirectly monitor cross-domain access to SOC external resources.
[0078] In step 105, in response to the presence of abnormal stepping, abnormal reminder information is fed back.
[0079] That is to say, for the above-mentioned monitored units, when the hardware domain monitors a single-domain trampling anomaly or a cross-domain trampling anomaly, or when the firewall monitors a cross-domain trampling anomaly, an abnormal reminder message will be fed back to remind the developer or system user that the unit may be trampled and the corresponding memory or resources need to be adjusted.
[0080] According to the memory and resource monitoring method based on multi-core heterogeneous SOC in the embodiment of the present application, the monitored unit is determined through the first security domain, and the preset access rights of each hardware domain to the monitored unit are determined; and the actual access rights to the monitored unit are determined through each hardware domain; and based on the consistency of the actual access rights and the preset access rights, the corresponding hardware domain performs single-domain and cross-domain trampling anomaly monitoring on the monitored unit; and the monitored unit is monitored for cross-domain trampling anomaly by starting the firewall; and in response to determining that there is a trampling anomaly, an abnormal reminder information is fed back. Therefore, for the access monitoring within a single domain and across domains of a multi-core heterogeneous SOC, not only can trampling be effectively avoided, the reliability of monitoring, the standardization of memory usage and the rationality of resource allocation be improved, but also time-saving and labor-saving, high efficiency, and convenient for developers or system users to adjust the use of system memory or resources in a timely manner.
[0081] In the present application embodiment, Figure 2 As shown, after step 101, the method specifically includes the following steps:
[0082] Step 201: In response to the preset access right of the first security domain to the monitored unit being access right, the first MPU corresponding to the first security domain configures the access attribute of the first security domain to the monitored unit as read-only.
[0083] Step 202: The first MPU determines whether there is a single-domain trampling anomaly in the first security domain to the monitored unit.
[0084] Step 203: In response to the single-domain trampling anomaly of the first security domain on the monitored unit, feedback of the single-domain access anomaly reminder information of the first security domain is provided.
[0085] Step 204 : In response to the fact that there is no single-domain trampling abnormality of the first security domain to the monitored unit, it is determined that the single-domain access of the first security domain to the monitored unit is normal.
[0086] That is to say, the first security domain is configured with a first MPU. If the first security domain is pre-configured to have access rights to the monitored unit, the access attribute of the first security domain to the monitored unit is first configured as read-only, and the first MPU is used to determine the abnormal situation of the single-domain trampling of the monitored unit by the first security domain. If the actual access rights of the first security domain to the monitored unit are inconsistent with the preset access rights, it is determined that the first security domain has a single-domain access abnormality to the monitored unit, and the single-domain access abnormality reminder information of the first security domain is fed back; otherwise, it is determined that the first security domain has normal access to the single domain of the monitored unit.
[0087] Furthermore, the method may also include:
[0088] Step 205: In response to the preset access permission of the first security domain to the monitored unit being no access permission, the first MPU configures the access attribute of the first security domain to the monitored unit as read-only.
[0089] Step 206: The first MPU and the firewall respectively determine whether there is any cross-domain trampling anomaly in the first security domain to the monitored unit.
[0090] Step 207: In response to the first memory protection unit and / or the firewall determining that the first security domain has a cross-domain trampling anomaly on the monitored unit, feedback is given of the first security domain cross-domain access anomaly reminder information.
[0091] Step 208: In response to the first memory protection unit and the firewall determining that there is no cross-domain trampling anomaly from the first security domain to the monitored unit, it is determined that the cross-domain access from the first security domain to the monitored unit is normal.
[0092] That is, if the first security domain is preconfigured to have no access rights to the monitored unit, the access attribute of the first security domain to the monitored unit is first configured as read-only, and then the first MPU and the firewall determine the abnormal trampling of the monitored unit by the first security domain. If at least one of the first MPU and the firewall determines that the actual access rights of the first security domain to the monitored unit are inconsistent with the preset access rights, it is determined that the first security domain has cross-domain access abnormalities to the monitored unit, and feedback is given to the first security domain cross-domain access abnormality reminder information; if the first MPU and the firewall both determine that the actual access rights of the first security domain to the monitored unit are consistent with the preset access rights, it is determined that the cross-domain access of the first security domain to the monitored unit is normal.
[0093] In the embodiment of the present application, the hardware domain of the SOC may include at least one second security domain. Each second security domain is configured with a corresponding second MPU. After step 101, the method specifically includes the following steps:
[0094] Step 301: In response to the preset access right of the second security domain to the monitored unit being allowed access right, the second MPU configures the access attribute of the monitored unit as second security domain read-only.
[0095] Step 302: The second MPU determines whether the second security domain has a single-domain trampling anomaly on the monitored unit.
[0096] Step 303: In response to the single-domain trampling abnormality of the second security domain on the monitored unit, feedback of the second security domain single-domain access abnormality reminder information is provided.
[0097] Step 304: In response to the fact that there is no single-domain trampling abnormality of the second security domain to the monitored unit, it is determined that the single-domain access of the second security domain to the monitored unit is normal.
[0098] That is to say, if the second security domain is preconfigured to have access rights to the monitored unit, the second MPU configures the access attribute of the second security domain to the monitored unit as read-only, and then determines the abnormality of the single-domain trampling of the monitored unit by the second security domain. If it is determined that the actual access rights of the second security domain to the monitored unit are consistent with the preset access rights, it is determined that the single-domain access of the monitored unit by the second security domain is normal; otherwise, it is determined that the second security domain has a single-domain access abnormality to the monitored unit, and feedback is given to the second security domain single-domain access abnormality reminder information.
[0099] Furthermore, the method may also include:
[0100] Step 305 , in response to the second security domain's preset access right to the monitored unit being no access right, the first security domain sends the address information of the monitored unit to the second security domain through inter-core communication.
[0101] Step 306: Based on the address information, the access attribute of the monitored unit is configured as read-only in the second security domain through the second MPU.
[0102] Step 307: The second MPU and the firewall determine whether the second security domain has a cross-domain trampling anomaly on the monitored unit.
[0103] Step 308: In response to the second MPU and / or the firewall determining that the second security domain has a cross-domain trampling anomaly on the monitored unit, feedback is given of the second security domain cross-domain access anomaly reminder information.
[0104] Step 309 , in response to the second MPU and the firewall determining that there is no cross-domain trampling anomaly from the second security domain to the monitored unit, it is determined that the cross-domain access from the second security domain to the monitored unit is normal.
[0105] That is, if the second security domain is preconfigured to have no access rights to the monitored unit, the address information of the monitored unit is sent to the second security domain through the first security domain via inter-core communication (mailbox). In a specific example, the address information of the monitored unit may include the starting address (addr) and size (size) of the unit. Then, based on the address information, the second security domain configures the access attribute of the second security domain to the monitored unit as read-only, and the second MPU and the firewall monitor the cross-domain trampling anomaly of the unit respectively. If at least one of the second MPU and the firewall determines that the actual access rights of the second security domain to the monitored unit are inconsistent with the preset access rights, it is determined that the second security domain has cross-domain access anomalies to the monitored unit, and feedbacks the cross-domain access anomaly reminder information of the second security domain; if the second MPU and the firewall both determine that the actual access rights of the second security domain to the monitored unit are consistent with the preset access rights, it is determined that the cross-domain access of the second security domain to the monitored unit is normal.
[0106] In the embodiment of the present application, the hardware domain of the SOC includes at least one application domain. Each application domain is configured with a corresponding MMU. After step 101, the method specifically includes the following steps:
[0107] Step 401 , in response to the preset access right of the application domain to the monitored unit being granted access right, the MMU corresponding to the application domain determines whether there is a single-domain trampling abnormality to the monitored unit.
[0108] Step 402: In response to the application domain having a single-domain trampling abnormality on the monitored unit, feedback of application domain single-domain access abnormality reminder information is provided.
[0109] Step 403: In response to the fact that there is no single-domain trampling abnormality of the application domain to the monitored unit, it is determined that the single-domain access of the application domain to the monitored unit is normal.
[0110] That is to say, if the application domain is pre-configured to have access rights to the monitored unit, the corresponding MMU determines the abnormality of the application domain's single-domain trampling on the monitored unit. If the actual access rights of the application domain to the monitored unit are inconsistent with the preset access rights, it is determined that the application domain has a single-domain access abnormality to the monitored unit, and feedback is given of the single-domain access abnormality reminder information of the application domain; otherwise, it is determined that the application domain has normal single-domain access to the monitored unit.
[0111] Furthermore, the method further comprises:
[0112] Step 404 , in response to the preset access right of the application domain to the monitored unit being no access right, the first security domain sends the address information of the monitored unit to the application domain through inter-core communication.
[0113] Step 405: The application domain determines whether the monitored unit is mapped by the MMU based on the address information.
[0114] Step 406 : in response to the monitored unit being mapped by the MMU, feedback of application domain cross-domain access exception reminder information is provided.
[0115] Furthermore, the method further comprises,
[0116] Step 407 : In response to the monitored unit not being mapped by the MMU, the application domain and the firewall determine whether there is a cross-domain trampling anomaly on the monitored unit.
[0117] Step 408: In response to the application domain and / or the firewall determining that there is a cross-domain trampling anomaly of the application domain to the monitored unit, feedback is given of an application domain cross-domain access anomaly reminder information.
[0118] Step 409 , in response to the application domain and the firewall both determining that there is no cross-domain trampling anomaly of the application domain to the monitored unit, it is determined that the cross-domain access of the application domain to the monitored unit is normal.
[0119] That is to say, if the application domain is preconfigured to have no access rights to the monitored unit, the address information of the monitored unit is sent to the application domain through the first security domain via inter-core communication (mailbox), so that the application domain can determine whether the monitored unit is mapped by the MMU based on the address information. If it is mapped, that is, the cross-domain access of the application domain is abnormal, then the abnormal reminder information is fed back; if it is not mapped, the cross-domain trampling abnormality of the unit is further monitored through the application domain and the firewall.
[0120] The present application will be further explained and illustrated by a specific embodiment below.
[0121] Figure 5 For a block diagram of a multi-core heterogeneous SOC structure according to this specific embodiment, refer to Figure 5 As shown in the figure, the multi-core heterogeneous SOC is configured with three hardware domains, namely: the secure domain (first security domain) corresponding to the R5 core, the safety domain (second security domain) corresponding to another R5 core, and the AP domain (application domain) corresponding to the A55 core. Figure 5 and Figure 6 As shown in the figure, the secure domain and the safety domain are configured with corresponding MPUs, and the AP domain is configured with MMUs. The three hardware domains can communicate between cores through mailboxes and are monitored by the firewall for access to memory and resources.
[0122] In summary, according to the memory and resource monitoring method based on multi-core heterogeneous SOC in the embodiment of the present application, the monitored unit is determined through the first security domain, and the preset access rights of each hardware domain to the monitored unit are determined; and the actual access rights to the monitored unit are determined respectively through each hardware domain; and based on the consistency between the actual access rights and the preset access rights, the corresponding hardware domain performs single-domain and cross-domain trampling anomaly monitoring on the monitored unit; and the monitored unit is monitored for cross-domain trampling anomaly by starting the firewall; and in response to determining that there is a trampling anomaly, an abnormal reminder information is fed back. Therefore, for the access monitoring within a single domain and across domains of a multi-core heterogeneous SOC, not only can trampling be effectively avoided, the reliability of monitoring, the standardization of memory usage and the rationality of resource allocation be improved, but also time-saving and labor-saving, high efficiency, and convenient for developers or system users to adjust the use of system memory or resources in a timely manner.
[0123] Figure 7 is a structural block diagram of a multi-core heterogeneous SOC according to an embodiment of the present application. Figure 7 As shown, the multi-core heterogeneous SOC 500 is configured with at least two hardware domains 510 and a firewall 520 ; the at least two hardware domains 510 include a first security domain 511 and other hardware domains 512 .
[0124] The first security domain 511 is used to determine the monitored unit and determine the preset access rights of each hardware domain 510 to the monitored unit; wherein the monitored unit is the memory or resource in the multi-core heterogeneous SOC 500;
[0125] Each hardware domain 510 is used to respectively determine the actual access rights to the monitored unit; and based on the consistency between the actual access rights and the preset access rights, determine whether there is a single-domain and cross-domain trampling anomaly on the monitored unit; and in response to determining that there is a trampling anomaly, feedback trampling anomaly reminder information;
[0126] The firewall 520 is used to start after the preset access rights are determined in the first security domain, monitor the monitored unit for cross-domain trampling anomalies, and feedback trampling anomaly reminder information in response to determining that there is a cross-domain trampling anomaly.
[0127] In the embodiment of the present application, the first security domain 511 is configured with a first MPU. The first security domain 511 is specifically used for: the first MPU configures the access attribute of the first security domain to the monitored unit as read-only; in response to the preset access right of the first security domain 511 to the monitored unit being access right, determining whether the first security domain 511 has a single-domain trampling abnormality to the monitored unit through the corresponding first MPU; in response to the single-domain trampling abnormality of the monitored unit by the first security domain 511, feedback of the single-domain access abnormality reminder information of the first security domain 511; in response to the single-domain trampling abnormality of the monitored unit by the first security domain 511, determining that the single-domain access of the monitored unit by the first security domain 511 is normal.
[0128] Furthermore, the first security domain 511 is also used for: in response to the preset access right of the first security domain 511 to the monitored unit being no access right, the first MPU and the firewall 520 respectively determine whether there is any cross-domain trampling anomaly of the first security domain 511 to the monitored unit; in response to at least one of the first security domain 511 and the firewall 520 having a cross-domain trampling anomaly to the monitored unit, feeding back cross-domain access anomaly reminder information of the first security domain 511; in response to the first MPU and the firewall 520 both determining that there is no cross-domain trampling anomaly of the first security domain 511 to the monitored unit, it is determined that the cross-domain access of the first security domain 511 to the monitored unit is normal.
[0129] In the embodiment of the present application, the hardware domain 510 also includes at least one second security domain ( Figure 7 The second security domain is used to: in response to the preset access right of the second security domain to the monitored unit being granted access right, configure the access attribute of the monitored unit to be read-only for the second security domain through the corresponding second MPU, and determine whether the second security domain has a single-domain trampling abnormality to the monitored unit; in response to the single-domain trampling abnormality of the second security domain to the monitored unit, feedback the single-domain access abnormality reminder information of the second security domain; in response to the single-domain trampling abnormality of the second security domain to the monitored unit, determine that the single-domain access of the second security domain to the monitored unit is normal.
[0130] Furthermore, the first security domain 511 is also used for: in response to the second security domain's preset access right to the monitored unit being no access right, the first security domain 511 sends the address information of the monitored unit to the second security domain through inter-core communication.
[0131] The second security domain is also used for: configuring the access attribute of the monitored unit to read-only for the second security domain through the second MPU based on the address information; determining whether there is any cross-domain trampling anomaly of the second security domain to the monitored unit through the second MPU and the firewall 520; in response to the existence of a trampling anomaly of the second security domain to the monitored unit, feeding back second security domain cross-domain access anomaly reminder information; in response to at least one of the second MPU and the firewall 520 determining that there is no cross-domain trampling anomaly of the second security domain to the monitored unit, determining that the cross-domain access of the second security domain to the monitored unit is normal.
[0132] In the embodiment of the present application, the hardware domain 510 includes at least one application domain ( Figure 7 ), the application domain is used for: in response to the preset access right of the application domain to the monitored unit being that the application domain has access right, determining through the MMU of the application domain whether there is a single-domain trampling abnormality of the application domain to the monitored unit; in response to the single-domain trampling abnormality of the application domain to the monitored unit, feeding back the single-domain access abnormality reminder information of the application domain; in response to the single-domain trampling abnormality of the application domain to the monitored unit, determining that the single-domain access of the application domain to the monitored unit is normal.
[0133] Furthermore, the first security domain 511 is also used for: in response to the preset access right of the application domain to the monitored unit being no access right, the first security domain 511 sends the address information of the monitored unit to the application domain through inter-core communication.
[0134] The application domain is also used to: determine whether the monitored unit is mapped by the memory management unit corresponding to the application domain based on the address information; and feedback application domain cross-domain access exception reminder information in response to the monitored unit being mapped by the memory management unit.
[0135] Furthermore, the application domain is also used for: in response to the monitored unit not being mapped by the memory management unit, the application domain and the firewall 520 respectively determine whether there is a cross-domain trampling anomaly with respect to the monitored unit; in response to at least one of the application domain and the firewall 520 determining that there is a cross-domain trampling anomaly with respect to the monitored unit, feedback of application domain cross-domain access anomaly reminder information; in response to the application domain and the firewall 520 determining that there is no cross-domain trampling anomaly with respect to the monitored unit, it is determined that the application domain's cross-domain access to the monitored unit is normal.
[0136] It should be noted that the explanation of the memory and resource monitoring method based on a multi-core heterogeneous SOC in the above embodiment is also applicable to the multi-core heterogeneous SOC in the above embodiment, and will not be repeated here.
[0137] Figure 8 FIG. 1 is a structural block diagram of an electronic device according to an embodiment of the present application. Figure 8As shown, the electronic device 600 includes a memory 601 and a processor 602. The memory 601 stores computer instructions, and the processor 602 is configured to run the instructions to execute the memory and resource monitoring method based on multi-core heterogeneous SOC in the above embodiment.
[0138] It should be understood that, although the steps in the flowcharts of the accompanying drawings of the specification are displayed in sequence according to the indications of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0139] Those skilled in the art can understand that the above are only preferred embodiments of the present application and are not intended to limit the present application. Although the present application is described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions recorded in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A memory and resource monitoring method based on multi-core heterogeneous SOC, characterized in that: The multi-core heterogeneous SOC is configured with at least two hardware domains and a firewall; the at least two hardware domains include a first security domain; the method includes, The first security domain determines a monitored unit, and determines preset access rights of each hardware domain to the monitored unit; wherein the monitored unit is a memory or a resource in the multi-core heterogeneous SOC; Each hardware domain determines the actual access rights to the monitored unit respectively; Based on the consistency between the actual access rights and the preset access rights, the corresponding hardware domain monitors the monitored unit for single-domain trampling anomalies and cross-domain trampling anomalies; Starting the firewall to perform cross-domain trampling anomaly monitoring on the monitored unit; In response to the hardware domain monitoring detecting a single-domain stampede anomaly or / and a cross-domain stampede anomaly, or when the firewall monitors a cross-domain stampede anomaly, feeding back anomaly reminder information; The single-domain trampling anomaly refers to anomalies caused by memory trampling and resource trampling within a single hardware domain; The cross-domain trampling anomaly refers to anomalies caused by memory trampling and resource trampling between different hardware domains; The memory trampling refers to the phenomenon that a large amount of memory is occupied due to improper memory allocation and release during program operation, thereby causing system performance degradation and crash; The resource trampling is the excessive occupation or improper use of system resources, which causes other processes or applications to fail to operate normally and triggers a system crash.
2. The method according to claim 1, characterized in that After the step of determining the preset access rights of each hardware domain to the monitored unit, the method further includes: In response to the preset access right of the first security domain to the monitored unit being allowed, the first memory protection unit corresponding to the first security domain configures the access attribute of the first security domain to the monitored unit as read-only, and determines whether there is a single-domain trampling anomaly of the first security domain to the monitored unit; In response to the single-domain trampling anomaly of the monitored unit by the first security domain, feeding back first security domain single-domain access anomaly reminder information; In response to the single-domain trampling anomaly not existing in the first security domain to the monitored unit, it is determined that the single-domain access of the first security domain to the monitored unit is normal.
3. The method according to claim 2, characterized in that The method further comprises, In response to the preset access right of the first security domain to the monitored unit being no access right, the first memory protection unit configures the access attribute of the first security domain to the monitored unit as read-only; The first memory protection unit and the firewall respectively determine whether the first security domain has a cross-domain trampling anomaly on the monitored unit; In response to the first memory protection unit and / or the firewall determining that the first security domain has the cross-domain trampling anomaly on the monitored unit, feeding back first security domain cross-domain access anomaly reminder information; In response to the first memory protection unit and the firewall determining that the cross-domain trampling anomaly does not exist in the first security domain to the monitored unit, it is determined that the cross-domain access of the first security domain to the monitored unit is normal.
4. The method according to claim 1, characterized in that: The at least two hardware domains include at least one second security domain; after the step of determining the preset access rights of each hardware domain to the monitored unit, the method further includes: In response to the preset access right of the second security domain to the monitored unit being allowed, the second security domain configures the access attribute of the monitored unit as second security domain read-only through the corresponding second memory protection unit, and determines whether the second security domain has a single-domain trampling anomaly to the monitored unit; In response to the second security domain having the single-domain trampling abnormality on the monitored unit, feeding back second security domain single-domain access abnormality reminder information; In response to the single-domain trampling abnormality of the second security domain to the monitored unit not existing, it is determined that the single-domain access of the second security domain to the monitored unit is normal.
5. The method according to claim 4, characterized in that The method further comprises, In response to the preset access right of the second security domain to the monitored unit being no access right, the first security domain sending the address information of the monitored unit to the second security domain through inter-core communication; The second security domain configures the access attribute of the monitored unit as second security domain read-only through the second memory protection unit based on the address information; The second memory protection unit and the firewall respectively determine whether the second security domain has a cross-domain trampling anomaly on the monitored unit; In response to the second memory protection unit and / or the firewall determining that the second security domain has the cross-domain trampling anomaly on the monitored unit, feeding back second security domain cross-domain access anomaly reminder information; In response to the second memory protection unit and the firewall determining that the cross-domain trampling anomaly does not exist in the second security domain to the monitored unit, it is determined that the cross-domain access of the second security domain to the monitored unit is normal.
6. The method according to claim 1, characterized in that The at least two hardware domains include at least one application domain; after the step of determining the preset access rights of each hardware domain to the monitored unit, the method further includes: In response to the preset access right of the application domain to the monitored unit being granted access right, the memory management unit corresponding to the application domain determines whether a single-domain trampling abnormality exists with respect to the monitored unit; In response to the single-domain trampling anomaly of the application domain on the monitored unit, feeding back application domain single-domain access anomaly reminder information; In response to the single-domain trampling abnormality of the application domain to the monitored unit not existing, it is determined that the single-domain access of the application domain to the monitored unit is normal.
7. The method according to claim 6, characterized in that The method further comprises, In response to the preset access right of the application domain to the monitored unit being no access right, the first security domain sends the address information of the monitored unit to the application domain through inter-core communication; The application domain determines, based on the address information, whether the monitored unit is mapped by the memory management unit; In response to the monitored unit being mapped by the memory management unit, application domain cross-domain access exception reminder information is fed back.
8. The method according to claim 7, characterized in that The method further comprises, In response to the monitored unit not being mapped by the memory management unit, the application domain and the firewall respectively determine whether there is a cross-domain trampling anomaly on the monitored unit; In response to the application domain and / or the firewall determining that the application domain has the cross-domain trampling anomaly on the monitored unit, feeding back application domain cross-domain access anomaly reminder information; In response to the application domain and the firewall determining that the cross-domain trampling anomaly of the application domain to the monitored unit does not exist, it is determined that the cross-domain access of the application domain to the monitored unit is normal.
9. A multi-core heterogeneous SOC, characterized in that: The multi-core heterogeneous SOC is configured with at least two hardware domains and a firewall; the at least two hardware domains include a first security domain; wherein, The first security domain is used to determine a monitored unit and determine a preset access right of each hardware domain to the monitored unit; wherein the monitored unit is a memory or a resource in the multi-core heterogeneous SOC; Each hardware domain is used to respectively determine the actual access rights to the monitored unit; and based on the consistency between the actual access rights and the preset access rights, determine whether there are single-domain trampling anomalies and cross-domain trampling anomalies to the monitored unit; and in response to the hardware domain monitoring the single-domain trampling anomaly and / or the cross-domain trampling anomaly, or when the firewall monitors the cross-domain trampling anomaly, feedback trampling anomaly reminder information; The firewall is used to start after the first security domain determines the preset access rights, monitor the monitored unit for cross-domain trampling anomaly; and in response to determining that the cross-domain trampling anomaly exists, feedback trampling anomaly reminder information; The single-domain trampling anomaly refers to anomalies caused by memory trampling and resource trampling within a single hardware domain; The cross-domain trampling anomaly refers to anomalies caused by memory trampling and resource trampling between different hardware domains; The memory trampling refers to the phenomenon that a large amount of memory is occupied due to improper memory allocation and release during program operation, thereby causing system performance degradation and crash; The resource trampling is the excessive occupation or improper use of system resources, which causes other processes or applications to fail to operate normally and triggers a system crash.
10. An electronic device comprising a memory and a processor, characterized in that: The memory stores computer instructions, and the processor is configured to run the instructions to execute the memory and resource monitoring method based on a multi-core heterogeneous SOC according to any one of claims 1 to 8.
Citation Information
Patent Citations
Firewall implementation method, chip, electronic equipment and computer readable storage medium
CN114844726A
Resource management method, related device and program product
CN118821239A