CN111694602B - Cross-partition data processing method and device - Google Patents
Cross-partition data processing method and device Download PDFInfo
- Publication number
- CN111694602B CN111694602B CN202010534148.9A CN202010534148A CN111694602B CN 111694602 B CN111694602 B CN 111694602B CN 202010534148 A CN202010534148 A CN 202010534148A CN 111694602 B CN111694602 B CN 111694602B
- Authority
- CN
- China
- Prior art keywords
- partition
- memory access
- function
- initial
- access authority
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000005192 partition Methods 0.000 title claims abstract description 390
- 238000003672 processing method Methods 0.000 title claims abstract description 22
- 230000006870 function Effects 0.000 claims abstract description 142
- 238000012545 processing Methods 0.000 claims abstract description 16
- 238000000034 method Methods 0.000 claims description 16
- 230000008569 process Effects 0.000 description 8
- 230000009471 action Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000006978 adaptation Effects 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/14—Protection against unauthorised use of memory or access to memory
- G06F12/1458—Protection against unauthorised use of memory or access to memory by checking the subject access rights
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0877—Cache access modes
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30098—Register arrangements
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computer Security & Cryptography (AREA)
- Storage Device Security (AREA)
Abstract
The application discloses a data processing method and a data processing device across partitions, when a task in a first partition generates a function call request across partitions, switching the memory access authority of the first partition into the initial memory access authority of a second partition, calling a target function, and recovering the memory access authority of the first partition to the initial memory access authority after the call is completed. According to the initial memory access authority, the task in each partition can only write the memory space corresponding to the partition, so that each partition only occupies one register resource in the MPU, and the consumption of the register resource can be reduced; when the objective function is called, the memory access authority of the first partition is switched to the initial memory access authority of the second partition, and after the call is completed, the memory access authority of the first partition is restored to the initial memory access authority of the first partition, so that the objective function can be prevented from unexpectedly accessing the memory space corresponding to the first partition, and the possibility of occurrence of data security problems is reduced.
Description
Technical Field
The application relates to the technical field of automobile electronics, in particular to a cross-partition data processing method and device.
Background
With the increasing demands made by users on the quality and safety of automobiles, the role that functional safety occupies in automobile design is becoming more and more important. In order to realize the functional safety of the automobile, the functions with different safety levels are usually required to be isolated to form different subareas. Partitions may be understood as a collection of tasks, each partition including one or more tasks. Each partition is configured with a corresponding memory space, and the memory space accessible by each partition needs to be limited. Variables used by all tasks contained in one partition are stored in the memory space corresponding to the partition.
At present, the access limitation to each partition adopts the following modes: the partition with low security level can only access the memory space corresponding to the partition, and the partition with high security level can access the memory space corresponding to the partition and the memory spaces corresponding to other partitions with low security level. It should be noted that, accessing a memory space by a partition means: tasks in the partition access the memory space.
The above approach creates problems. For example, when a task of a partition of a high security level invokes a function in a partition of a low security level to implement certain functions, the function may undesirably access a memory space corresponding to the partition of the high security level, causing data security problems. Moreover, if one partition can perform a write operation on the memory space corresponding to the multiple partitions, the partition needs to occupy multiple register resources in the MPU (Memory Protection Unit ), and the register resources in the MPU are limited, so that the problem that the register resources cannot meet the requirement easily occurs.
Disclosure of Invention
In view of the foregoing, an object of the present application is to provide a cross-partition data processing method and apparatus, so as to reduce the possibility of occurrence of data security problems and reduce the consumption of register resources in an MPU.
In order to achieve the above purpose, the present application provides the following technical solutions:
on the one hand, the application provides a data processing method across partitions, and memory space corresponding to each partition and initial memory access authority of each partition are preconfigured for a plurality of partitions, wherein each task can only write the memory space corresponding to the partition to which each task belongs according to the initial memory access authority; the data processing method comprises the following steps:
when a task in a first partition generates a cross-partition function call request, switching the memory access authority of the first partition into the initial memory access authority of a second partition, wherein the first partition is any one of the partitions, and the second partition is the partition to which a target function indicated by the function call request belongs;
invoking the objective function;
and after the target function is called, restoring the memory access authority of the first partition to the initial memory access authority of the first partition.
Optionally, the data processing method further includes:
storing the output result of the objective function into a preset buffer register;
and after the memory access authority of the first partition is restored to the initial memory access authority of the first partition, outputting the output result to a memory space corresponding to the first partition.
Optionally, the switching the memory access permission of the first partition to the initial memory access permission of the second partition includes:
reading address information from a register corresponding to the second partition in the memory protection unit MPU;
and writing the read address information into a register corresponding to the first partition in the MPU.
Optionally, the restoring the memory access right of the first partition to the initial memory access right of the first partition includes:
and writing the initial address information of the first partition into a register corresponding to the first partition in the MPU.
On the other hand, the application provides a cross-partition data processing device, and memory space corresponding to each partition and initial memory access authority of each partition are preconfigured for a plurality of partitions, wherein each task can only write the memory space corresponding to the partition to which each task belongs according to the initial memory access authority; the data processing apparatus includes:
the memory access permission switching unit is used for switching the memory access permission of a first partition into the initial memory access permission of a second partition when a task in the first partition generates a cross-partition function call request, wherein the first partition is any one of the partitions, and the second partition is the partition to which an objective function indicated by the function call request belongs;
a calling function unit for calling the target function;
and the memory access right restoring unit is used for restoring the memory access right of the first partition to the initial memory access right of the first partition after the target function is called.
Optionally, the data processing apparatus further includes: a function result output unit;
the function result output unit is configured to store an output result of the objective function to a preset cache register, and output the output result to a memory space corresponding to the first partition after the memory access permission of the first partition is restored to the initial memory access permission of the first partition.
Optionally, the memory access permission switching unit switches the memory access permission of the first partition to the initial memory access permission of the second partition, specifically:
reading address information from a register corresponding to the second partition in the memory protection unit MPU; and writing the read address information into a register corresponding to the first partition in the MPU.
Optionally, the memory access right restoring unit restores the memory access right of the first partition to the initial memory access right of the first partition, specifically:
and writing the initial address information of the first partition into a register corresponding to the first partition in the MPU.
According to the cross-partition data processing method and device, corresponding memory spaces and initial memory access rights are pre-configured for each partition, and each task can only write the memory space corresponding to the partition to which the task belongs according to the initial memory access rights; when a task in a first partition generates a cross-partition function call request, the memory access authority of the first partition is switched to the initial memory access authority of a second partition (a target partition, namely a partition where a function is required to be called), the target function indicated by the function call request is called, and after the target function is called, the memory access authority of the first partition is restored to the initial memory access authority.
It can be seen that, based on the scheme provided in the present application, the initial memory access rights of each partition are configured to: the task in each partition can only write the memory space corresponding to the partition, so that each partition only occupies one register resource in the MPU, and the consumption of the register resource in the MPU can be reduced; in addition, when the task in the first partition calls the function in the second partition, the memory access authority of the first partition is switched to the initial memory access authority of the second partition, and after the function call is completed, the memory access authority of the first partition is restored to the initial memory access authority of the first partition, so that the called function (namely the target function) can be prevented from unexpectedly accessing the memory space corresponding to the first partition, and the possibility of occurrence of data security problems in the memory space corresponding to the first partition is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a cross-partition data processing method disclosed in an embodiment of the present application;
FIG. 2 is a flow chart of yet another cross-partition data processing method disclosed in an embodiment of the present application;
FIG. 3 is a block diagram of a cross-partition data processing apparatus according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
As known from the background art, in order to realize functional safety of an automobile, functions with different safety levels are generally required to be isolated to form different partitions. Each partition is configured with a corresponding memory space, and the memory space accessible by each partition needs to be limited.
At present, the access limitation to each partition adopts the following modes: the partition with low security level can only access the memory space corresponding to the partition, and the partition with high security level can access the memory space corresponding to the partition and the memory spaces corresponding to other partitions with low security level.
When a task in a partition with a low security level needs to call a function in a partition with a high security level to realize certain functions, the access right of the partition with the low security level is switched to the access right of the partition with the high security level, and then the function in the partition with the high security level is called. When a task in a partition of a high security level needs to call a function in a partition of a low security level to implement certain functions, the function is called directly.
The applicant researches find that when a task in a partition with a high security level calls a function in a partition with a low security level to realize certain functions, the called function has the access right of the partition with the high security level, and because the task in the partition with the low security level is not authenticated by the function security, the function in the partition with the low security level can unexpectedly access the memory space corresponding to the partition with the high security level during running, thereby causing data security problems. For example, when the called function overflows the pointer, the memory space corresponding to the partition with high security level is tampered, resulting in data errors and the like.
The applicant has also found that in the prior art, a partition of a high security level may access, in addition to its own memory space, also the memory space corresponding to a partition of another low security level. However, the memory spaces corresponding to the plurality of partitions are often discontinuous, so that each memory space in which a write operation can be performed for a partition with a high security level needs to occupy one register resource in the MPU, that is, the partition with a high security level needs to occupy a plurality of register resources in the MPU, and the register resource in the MPU is limited, so that a problem that the register resource in the MPU cannot meet the requirement easily occurs.
In view of this, the embodiments of the present application provide a cross-partition data processing method and apparatus, so as to reduce the possibility of data security problem and reduce the consumption of register resources in the MPU.
Referring to fig. 1, fig. 1 illustrates a cross-partition data processing method provided in an embodiment of the present application.
And presetting a memory space corresponding to each partition for a plurality of partitions, and presetting initial memory access rights of each partition, wherein each task can only write the memory space corresponding to the partition to which the task belongs according to the initial memory access rights. The data processing method comprises the following steps:
step S101: when a task in a first partition generates a cross-partition function call request, the memory access authority of the first partition is switched to the initial memory access authority of a second partition.
The first partition is any one of a plurality of partitions, and the second partition is a partition to which the target function indicated by the function call request belongs. For example, the first partition may be a high security level partition and the second partition may be a low security level partition.
In the specific implementation process of step S101, address information is read from a register corresponding to the second partition in the memory protection unit MPU, and the read address information is written into the register corresponding to the first partition in the MPU, so that the memory access permission of the first partition is switched to the initial memory access permission of the second partition.
In one possible implementation, the address information includes a start address and an end address.
In another possible implementation, the address information includes a starting address and a memory space size.
For example, the start address read from the register corresponding to the second partition in the memory protection unit MPU is A1, the end address read from the register corresponding to the second partition in the memory protection unit MPU is A2, and the start address A1 and the end address A2 are written into the register corresponding to the first partition in the MPU, thereby switching the memory access authority of the first partition to the initial memory access authority of the second partition. After the memory access authority of the first partition is switched, the starting address of the memory space in which the task in the first partition can perform writing operation is A1, and the ending address is A2.
For another example, the starting address read from the register corresponding to the second partition in the memory protection unit MPU is A5, the memory space size read from the register corresponding to the second partition in the memory protection unit MPU is 7KB, and the starting address A5 and the memory space size 7KB are written into the register corresponding to the first partition in the MPU, thereby switching the memory access right of the first partition to the initial memory access right of the second partition. After the memory access permission of the first partition is switched, the starting address of the memory space in which the task in the first partition can perform the writing operation is A5, and the size of the memory space is 7KB.
It can be understood that when a task in the first partition generates a cross-partition function call request, the memory access authority of the first partition is switched to the initial memory access authority of the second partition, that is, the first partition can only write the memory space corresponding to the second partition. When the task in the first partition calls the function in the second partition, the called function can only write the memory space corresponding to the second partition, and even if the called function overflows a pointer, the called function cannot modify the memory space corresponding to the first partition.
For example, partition a is a high security level partition, partition B is a low security level partition, the memory space corresponding to partition a is a space with addresses 00001 to 10000 (decimal) in RAM, the memory space corresponding to partition B is a space with addresses 10001 to 20000 (decimal) in RAM, and according to the initial memory access authority, tasks in partition a can only write to the space with addresses 00001 to 10000 in RAM, and tasks in partition B can only write to the space with addresses 10001 to 20000 in RAM.
When a function call request is generated by a task in the partition A and an objective function indicated by the function call request belongs to the partition B, the memory access authority of the partition A is switched to the initial memory access authority of the partition B, after the access authority is switched, the task in the partition A can only write the space with the addresses of 10001 to 20000 in the RAM, the called function can only write the space with the addresses of 10001 to 20000 in the RAM, but cannot write the space with the addresses of 00001 to 10000 in the RAM, and even if the called function overflows by a pointer, the called function cannot modify the memory space corresponding to the partition A.
That is, when a task in a partition of a high security level calls a function in a partition of a low security level to implement some functions, a situation that the called function unexpectedly accesses a memory space corresponding to the partition of the high security level does not occur, and the possibility of occurrence of a data security problem is reduced.
Step S102: and calling an objective function.
Step S103: and after the target function is called, restoring the memory access authority of the first partition to the initial memory access authority of the first partition.
In the specific implementation process of step S103, the initial address information of the first partition is written into a register corresponding to the first partition in the MPU, so that the memory access right of the first partition is restored to the initial memory access right thereof.
It can be appreciated that after the memory access rights of the first partition are restored to the initial memory rights, the task in the first partition can only access the memory space corresponding to the first partition.
According to the cross-partition data processing method, corresponding memory spaces and initial memory access rights are pre-configured for each partition, and each task can only write the memory space corresponding to the partition to which the task belongs according to the initial memory access rights; when a task in a first partition generates a cross-partition function call request, the memory access authority of the first partition is switched to the initial memory access authority of a second partition (a target partition, namely a partition where a function is required to be called), the target function indicated by the function call request is called, and after the target function is called, the memory access authority of the first partition is restored to the initial memory access authority.
It can be seen that, based on the scheme provided in the present application, the initial memory access rights of each partition are configured to: according to the initial memory access authority, the task in each partition can only write the memory space corresponding to the partition, so that each partition only occupies one register resource in the MPU, and the consumption of the register resource in the MPU can be reduced; in addition, when the task in the first partition calls the function in the second partition, the memory access authority of the first partition is switched to the initial memory access authority of the second partition, and after the function call is completed, the memory access authority of the first partition is restored to the initial memory access authority of the first partition, so that the called function (namely the target function) can be prevented from unexpectedly accessing the memory space corresponding to the first partition, and the possibility of occurrence of data security problems in the memory space corresponding to the first partition is reduced.
Referring to fig. 2, fig. 2 illustrates yet another cross-partition data processing method provided in an embodiment of the present application.
And presetting a memory space corresponding to each partition for a plurality of partitions, and presetting initial memory access rights of each partition, wherein each task can only write the memory space corresponding to the partition to which the task belongs according to the initial memory access rights. The data processing method comprises the following steps:
step S201: when a task in a first partition generates a cross-partition function call request, the memory access authority of the first partition is switched to the initial memory access authority of a second partition.
The execution principle of the specific implementation step S201 is just described with reference to step S101, and no detailed description is given here.
Step S202: and calling an objective function.
Step S203: and storing the output result of the objective function into a preset buffer register.
In the process of specifically implementing step S203, it may be implemented by using a stack. In the cross-partition function call process, the write operation authority of the stack is unchanged, so that an output result can be written into a preset cache register, and then the output result is taken out from the cache register.
It should be noted that, not all functions have output results, so fig. 2 is only an alternative embodiment disclosed in the present application, and in a specific implementation, if the objective function has no output result, refer to the embodiment of fig. 1.
Step S204: and after the target function is called, restoring the memory access authority of the first partition to the initial memory access authority of the first partition.
Step S205: and outputting the output result to the memory space corresponding to the first partition.
In the process of calling the objective function, the memory access authority of the first partition is switched to the initial memory access authority of the second partition, a task in the first partition can only write the memory space corresponding to the second partition, and the objective function cannot store an output result into the memory space corresponding to the first partition, so that after the memory access authority of the first partition is restored to the initial memory access authority of the first partition by storing the output result of the objective function into a preset cache register, the output result is output into the memory space corresponding to the first partition.
Based on the cross-partition data processing method provided by the application, the initial memory access authority of each partition is configured as follows: according to the initial memory access authority, the task in each partition can only write the memory space corresponding to the partition, so that each partition only occupies one register resource in the MPU, and the consumption of the register resource in the MPU can be reduced; in addition, when the task in the first partition calls the function in the second partition, the memory access authority of the first partition is switched to the initial memory access authority of the second partition, so that the called function (namely, the target function) can be prevented from unexpectedly accessing the memory space corresponding to the first partition, the possibility of occurrence of data security problems in the memory space corresponding to the first partition is reduced, if the called function needs to output a result, the output result is stored in a preset cache register, and after the memory access authority of the first partition is restored to the initial memory access authority of the first partition, the output result stored in the cache register is output to the memory space corresponding to the first partition.
It should be noted that, the read operation to the memory space generally does not cause a data security problem. Therefore, in the present application, each partition may be configured to perform a read operation on all the memory space.
The technical scheme disclosed in the application can be understood as follows: when the task in any partition needs to call the function in other partitions, the function call is realized through the preset function.
The function of the preset function is: switching the memory access rights of the source partition to the initial memory access rights of the target partition; and after the called function finishes data processing, restoring the memory access authority of the source partition to the initial memory access authority of the source partition. The function of the preset function further comprises: if the called function outputs the result, the output result is stored in a preset buffer register, and after the memory access authority of the source partition is restored to the initial memory access authority, the data is read from the buffer register and output to the memory space corresponding to the source partition.
The source partition refers to a partition needing to call a function across partitions, and the target partition is a partition to which the function needs to be called belongs.
After the function having the above function is constructed, the function is subjected to security authentication, and the function that passes the security authentication is regarded as a trusted function (may also be referred to as a trusted function) by which the function call across the partitions is realized.
Alternatively, the function having the above function is implemented in an OS (Operating System), and the OS is generally authenticated by functional security, so that the function implemented in the OS System is secure and reliable.
The above embodiments of the present application disclose a cross-partition data processing method, and correspondingly, the embodiments of the present application also disclose a cross-partition data processing device, and descriptions of the two may be referred to each other in the specification.
With reference to fig. 3, fig. 3 is a block diagram of a cross-partition data processing apparatus according to an embodiment of the present application.
The method comprises the steps of pre-configuring memory spaces corresponding to each partition for a plurality of partitions, and pre-configuring initial memory access rights of each partition, wherein each task can only write the memory space corresponding to the partition to which the task belongs according to the initial memory access rights.
The data processing apparatus includes: memory access right switching unit 301, calling function unit 302, and memory access right restoring unit 303.
The memory access authority switching unit 301 is configured to: when a task in a first partition generates a cross-partition function call request, the memory access authority of the first partition is switched to the initial memory access authority of a second partition. The first partition is any one of a plurality of partitions, and the second partition is a partition to which the target function indicated by the function call request belongs.
The call function unit 302 is configured to: for invoking the objective function.
The memory access right recovery unit 303 is configured to: and after the target function is called, restoring the memory access authority of the first partition to the initial memory access authority of the first partition.
According to the cross-partition data processing device, corresponding memory spaces and initial memory access rights are pre-configured for each partition, and each task can only write the memory space corresponding to the partition to which the task belongs according to the initial memory access rights; when a task in a first partition generates a cross-partition function call request, the memory access authority of the first partition is switched to the initial memory access authority of a second partition (a target partition, namely a partition where a function is required to be called), the target function indicated by the function call request is called, and after the target function is called, the memory access authority of the first partition is restored to the initial memory access authority.
It can be seen that, based on the scheme provided in the present application, the initial memory access rights of each partition are configured to: according to the initial memory access authority, the task in each partition can only write the memory space corresponding to the partition, so that each partition only occupies one register resource in the MPU, and the consumption of the register resource in the MPU can be reduced; in addition, when the task in the first partition calls the function in the second partition, the memory access authority of the first partition is switched to the initial memory access authority of the second partition, and after the function call is completed, the memory access authority of the first partition is restored to the initial memory access authority of the first partition, so that the called function (namely the target function) can be prevented from unexpectedly accessing the memory space corresponding to the first partition, and the possibility of occurrence of data security problems in the memory space corresponding to the first partition is reduced.
In one embodiment, the memory access permission switching unit 301 switches the memory access permission of the first partition to the initial memory access permission of the second partition, specifically: reading address information from a register corresponding to the second partition in the memory protection unit MPU; and writing the read address information into a register corresponding to the first partition in the MPU.
In one embodiment, the memory access right restoring unit 303 restores the memory access right of the first partition to the initial memory access right of the first partition, specifically: initial address information of the first partition is written into a register corresponding to the first partition in the MPU.
In one possible implementation, the address information includes a start address and an end address.
In another possible implementation, the address information includes a starting address and a memory space size.
In an embodiment, the function result output unit is further arranged on the basis of the data processing apparatus shown in fig. 3.
The function result output unit is used for: storing an output result of the objective function into a preset cache register; and after the memory access authority of the first partition is restored to the initial memory access authority of the first partition, outputting an output result to a memory space corresponding to the first partition.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described in a different point from other embodiments, and identical and similar parts between the embodiments are all enough to refer to each other. The data processing apparatus disclosed in the embodiment corresponds to the data processing method disclosed in the embodiment, so that the description is relatively simple, and the relevant points are referred to in the description of the method section.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.
Claims (8)
1. The cross-partition data processing method is characterized in that for a plurality of partitions, a memory space corresponding to each partition and an initial memory access authority of each partition are pre-configured, wherein each task can only write the memory space corresponding to the partition to which the task belongs according to the initial memory access authority, and each partition occupies one register resource in an MPU (micro processing unit); the data processing method comprises the following steps:
when a task in a first partition generates a cross-partition function call request, switching the memory access authority of the first partition into the initial memory access authority of a second partition, wherein the first partition is any one of the partitions, and the second partition is the partition to which a target function indicated by the function call request belongs;
invoking the objective function;
and after the target function is called, restoring the memory access authority of the first partition to the initial memory access authority of the first partition.
2. The method as recited in claim 1, further comprising:
storing the output result of the objective function into a preset buffer register;
and after the memory access authority of the first partition is restored to the initial memory access authority of the first partition, outputting the output result to a memory space corresponding to the first partition.
3. The method of claim 1, wherein the switching the memory access rights of the first partition to the initial memory access rights of the second partition comprises:
reading address information from a register corresponding to the second partition in the memory protection unit MPU;
and writing the read address information into a register corresponding to the first partition in the MPU.
4. The method of claim 3, wherein the restoring the memory access rights of the first partition to the initial memory access rights of the first partition comprises:
and writing the initial address information of the first partition into a register corresponding to the first partition in the MPU.
5. The data processing device crossing the partitions is characterized in that a memory space corresponding to each partition and an initial memory access authority of each partition are preconfigured for a plurality of partitions, wherein each task can only write the memory space corresponding to the partition to which the task belongs according to the initial memory access authority, and each partition occupies one register resource in an MPU (micro processing unit); the data processing apparatus includes:
the memory access permission switching unit is used for switching the memory access permission of a first partition into the initial memory access permission of a second partition when a task in the first partition generates a cross-partition function call request, wherein the first partition is any one of the partitions, and the second partition is the partition to which an objective function indicated by the function call request belongs;
a calling function unit for calling the target function;
and the memory access right restoring unit is used for restoring the memory access right of the first partition to the initial memory access right of the first partition after the target function is called.
6. The apparatus as recited in claim 5, further comprising: a function result output unit;
the function result output unit is configured to store an output result of the objective function to a preset cache register, and output the output result to a memory space corresponding to the first partition after the memory access permission of the first partition is restored to the initial memory access permission of the first partition.
7. The apparatus according to claim 5, wherein the memory access permission switching unit switches the memory access permission of the first partition to the initial memory access permission of the second partition, specifically:
reading address information from a register corresponding to the second partition in the memory protection unit MPU; and writing the read address information into a register corresponding to the first partition in the MPU.
8. The apparatus according to claim 7, wherein the memory access right restoring unit restores the memory access right of the first partition to the initial memory access right of the first partition, specifically:
and writing the initial address information of the first partition into a register corresponding to the first partition in the MPU.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010534148.9A CN111694602B (en) | 2020-06-12 | 2020-06-12 | Cross-partition data processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010534148.9A CN111694602B (en) | 2020-06-12 | 2020-06-12 | Cross-partition data processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111694602A CN111694602A (en) | 2020-09-22 |
CN111694602B true CN111694602B (en) | 2023-08-08 |
Family
ID=72480668
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010534148.9A Active CN111694602B (en) | 2020-06-12 | 2020-06-12 | Cross-partition data processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111694602B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112738219B (en) * | 2020-12-28 | 2022-06-10 | 中国第一汽车股份有限公司 | Program running method, program running device, vehicle and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2013140476A (en) * | 2012-01-04 | 2013-07-18 | Toyota Motor Corp | Information processing device, access authority giving method, program generation device, and method therefor |
US9213828B2 (en) * | 2012-02-08 | 2015-12-15 | Arm Limited | Data processing apparatus and method for protecting secure data and program code from non-secure access when switching between secure and less secure domains |
GB2522906B (en) * | 2014-02-10 | 2021-07-14 | Advanced Risc Mach Ltd | Region identifying operation for identifying a region of a memory attribute unit corresponding to a target memory address |
CN105787360B (en) * | 2016-03-02 | 2019-01-04 | 杭州字节信息技术有限公司 | A kind of Implementation Technology of embedded system memory safe access control |
-
2020
- 2020-06-12 CN CN202010534148.9A patent/CN111694602B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN111694602A (en) | 2020-09-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102062945B1 (en) | Information processing apparatus and method of controlling the same, and program | |
US20070089088A1 (en) | Dynamically determining a buffer-stack overrun | |
JP2018506784A (en) | Authenticated control stack | |
US20100082929A1 (en) | Memory protection method, information processing apparatus, and computer-readable storage medium that stores memory protection program | |
US9696933B2 (en) | Virtual machine manager initiated page-in of kernel pages | |
US9734326B2 (en) | Dynamic interrupt stack protection | |
CN110554911A (en) | Memory access and allocation method, memory controller and system | |
US9158690B2 (en) | Performing zero-copy sends in a networked file system with cryptographic signing | |
US20160062655A1 (en) | System and Method for Improved Memory Allocation in a Computer System | |
CN111694602B (en) | Cross-partition data processing method and device | |
CN114398631A (en) | Business processing method and device, electronic equipment and storage medium | |
CN112219202B (en) | Memory allocation for guest operating systems | |
EP3249540B1 (en) | Method for writing multiple copies into storage device, and storage device | |
US9684525B2 (en) | Apparatus for configuring operating system and method therefor | |
JPWO2010032330A1 (en) | Information processing apparatus and memory protection method thereof | |
JP2008532163A (en) | Computer device and method of operation paged in real time | |
CN112199042A (en) | Storage space management method, device, chip, equipment and storage medium | |
CN116225974B (en) | Memory management method and equipment thereof | |
CN111143418B (en) | Method, device, equipment and storage medium for reading data from database | |
US20140149709A1 (en) | Method and system for dynamically updating data fields of buffers | |
CN110442465B (en) | Multi-desktop environment shear plate sharing architecture and method thereof | |
WO2009104720A1 (en) | Resource usage control system, method of controlling resource usage, program for controlling resource usage | |
CN105844151B (en) | File storage protection implementation method and system | |
JP2012014493A (en) | Memory management device, memory management method and program | |
EP3915031B1 (en) | System management memory coherency detection |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information |
Address after: 4 / F, building 1, No.14 Jiuxianqiao Road, Chaoyang District, Beijing 100020 Applicant after: Beijing Jingwei Hirain Technologies Co.,Inc. Address before: 8 / F, block B, No. 11, Anxiang Beili, Chaoyang District, Beijing 100101 Applicant before: Beijing Jingwei HiRain Technologies Co.,Ltd. |
|
CB02 | Change of applicant information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |