CN108446137A - Channel register initial method, device and dma device, terminal - Google Patents
Channel register initial method, device and dma device, terminal Download PDFInfo
- Publication number
- CN108446137A CN108446137A CN201810161671.4A CN201810161671A CN108446137A CN 108446137 A CN108446137 A CN 108446137A CN 201810161671 A CN201810161671 A CN 201810161671A CN 108446137 A CN108446137 A CN 108446137A
- Authority
- CN
- China
- Prior art keywords
- data
- instruction
- moving
- information
- dma device
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 68
- 238000012545 processing Methods 0.000 claims abstract description 166
- 230000002093 peripheral effect Effects 0.000 claims description 99
- 230000003993 interaction Effects 0.000 claims description 27
- 230000002452 interceptive effect Effects 0.000 claims description 14
- 238000004891 communication Methods 0.000 claims description 11
- 230000008569 process Effects 0.000 abstract description 17
- 238000012544 monitoring process Methods 0.000 abstract description 5
- 230000005540 biological transmission Effects 0.000 description 14
- 230000008859 change Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 7
- 238000004590 computer program Methods 0.000 description 5
- 238000012512 characterization method Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- ZXQYGBMAQZUVMI-GCMPRSNUSA-N gamma-cyhalothrin Chemical compound CC1(C)[C@@H](\C=C(/Cl)C(F)(F)F)[C@H]1C(=O)O[C@H](C#N)C1=CC=CC(OC=2C=CC=CC=2)=C1 ZXQYGBMAQZUVMI-GCMPRSNUSA-N 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- 241000894006 Bacteria Species 0.000 description 1
- 241001269238 Data Species 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000000284 extract Substances 0.000 description 1
- 230000007274 generation of a signal involved in cell-cell signaling Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 238000010129 solution processing Methods 0.000 description 1
Classifications
-
- 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
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
The invention discloses a kind of channel register initial method, device and dma device, terminals; the channel register initial method provided through this embodiment initializes the channel register in dma device; what dma device received is no longer direct initialization information, but the data-moving through overprotection processing instructs.Initialization information is not exposed directly.The present embodiment also provides a kind of channel register apparatus for initializing, dma device, terminal; since solution protects processing rule corresponding with protection processing rule; the data-moving instruction only obtained through protection processing rule process can just be commanded processor and successfully solve the initialization information that protection is handled; therefore; protection processing handles two processes with solution protection and cooperates; it can realize the certification in the source instructed to data-moving; realize the monitoring moved to DMA data; ensure the legitimacy of data-moving requesting party, and then the safety of lifting system.
Description
Technical field
The present invention relates to security technology area, more specifically to a kind of channel register initial method, device and
Dma device, terminal.
Background technology
Direct memory access (Direct Memory Access, DMA) refers to that data move the intervention for not needing CPU,
And the technology of data exchange can be directly carried out between making storage device.Dma device is responsible for the work that data are carried in systems,
It is the important component of system data access, the data moved can be one section of program, can also be general data;It can
To realize the data-moving between external storage equipment and terminal memory, it can also realize that an external storage equipment arrives another
Data-moving between external storage equipment.
In traditional DMA, dma device gets the source address for waiting for moving data, destination address from bus and carries number
According to the initialization informations such as size, it is then initial according to being carried out to the channel register of its inside according to these initialization informations
Change, after obtaining the dma device exchange interface right to use so as to the channel register after initialized, according to corresponding source address, mesh
The information such as address carry out automatic data-moving.But there is no the abilities for distinguishing initialization information source for dma device.Cause
This, if attacker obtains the course of work of dma device by various attack means, such as network attack, side-channel attack
And agreement, it is possible to seize dma device on both sides by the arms.At this point, the initialization informations such as source address, destination address and data volume are from attack
Person, rather than CPU.In this way, attacker is possible to get around the monitoring of CPU and operating system, it is implanted into attacker in memory.
After attacker is implanted memory, CPU can execute these programs when specific, under attack, system safety by
It threatens.
So it is urgent to provide a solution now, it is held as a hostage to avoid dma device, threatens the problem of system safety.
Invention content
The technical problem to be solved in the present invention is:It solves traditional dma device to be easy to be held as a hostage, under the control of attacker
Moving data influences the problem of system safety, for the technical problem, provides a kind of channel register initial method, device
And dma device, terminal.
In order to solve the above technical problems, the present invention provides a kind of channel register initial method, it is applied to central processing
Device CPU, the channel register initial method include:
The CPU according to data carry task configuration pin in direct memory access dma device channel register it is initial
Change information, the initialization information includes for at least one in source address in the data-moving task and destination address
A indicative information;
The CPU carries out protection to the initialization information according to protection processing rule and handles to obtain data-moving instruction;
Data-moving instruction is sent to the dma device by the CPU, so that the dma device is based on the number
According to the initialization for moving instruction realization channel register.
Further, it the present invention provides a kind of channel register initial method, is set applied to direct memory access DMA
Standby, the channel register initial method includes:
The instruction interaction interface data-moving of the dma device instructs;
The instruction processing unit of the dma device protects processing rule to carry out solution protection to data-moving instruction according to solution
Processing, obtains this corresponding initialization information of data-moving task, the initialization information includes for the data
Move the indicative information of at least one of source address and destination address in task;
Described instruction processor the initialization information is written in channel register idle in the dma device, real
The initialization of the existing channel register.
Optionally, after the instruction interaction interface data-moving instruction of the dma device, further include:Described instruction
Interactive interface will be in data-moving instruction storage to the Instruction Register of the dma device;
The instruction processing unit of the dma device protects processing rule to carry out solution protection to data-moving instruction according to solution
Before processing, further include:Described instruction processor reads the data-moving instruction from described instruction buffer.
Optionally, the instruction processing unit of the dma device according to solution protect processing rule to the data-moving instruct into
Row solution protection processing, including:
If the solution protection processing rule includes decoding rule, described instruction processor is according to the decoding rule to institute
Data-moving is stated to instruct into row decoding processing;
If the solution protection processing rule includes decryption rule, described instruction processor is according to decryption rule to institute
Data-moving instruction is stated to be decrypted;
If the solution protection processing rule is simultaneously including decoding rule and decryption rule, described instruction processor is first according to institute
It states decoding rule to instruct into row decoding processing the data-moving, then decoding result is carried out further according to decryption rule
Decryption processing;Or, described instruction processor is first decrypted data-moving instruction according to decryption rule, so
Decrypted result is handled into row decoding further according to decoding rule afterwards.
Optionally, the initialization information is written channel idle in the dma device and deposited by described instruction processor
In device, including:
Described instruction processor determines the type of the data-moving instruction;
Instruction is moved if data-moving instruction is delay data, and described instruction processor is by the initialization information
Peripheral hardware information register is written;
After receiving the hardware requests signal from the external storage equipment, described instruction processor is from the peripheral hardware
The initialization information is read in information register, and is selected one from channel register idle in the dma device and write
Enter the initialization information.
Optionally, after described instruction processor determines the type that the data-moving instructs, further include:
If the data-moving instruction is that instant data-moving instructs, described instruction processor is obtaining the initialization
After information, one write-in initialization information of selection directly from channel register idle in the dma device.
Optionally, each peripheral hardware information register and each external storage equipment one being connected on outside in bus in the dma device
One corresponds to;Peripheral hardware information register is written in the initialization information by described instruction processor, including:
Described instruction processor determines the delay according to the external storage equipment identification information in the initialization information
Data-moving instructs targeted external storage equipment;
The initialization information is written the corresponding peripheral hardware information of the external storage equipment and deposited by described instruction processor
Device.
Further, the present invention provides a kind of channel register apparatus for initializing, including:
Configuration module, for carrying task configuration pin to channel register in direct memory access dma device according to data
Initialization information, the initialization information includes for in source address in the data-moving task and destination address
At least one indicative information;
Protection module handles to obtain data-moving for carrying out protection to the initialization information according to protection processing rule
Instruction;
Interactive module, for data-moving instruction to be sent to the dma device, so that the dma device is based on
The initialization of channel register is realized in the data-moving instruction.
Further, the present invention provides a kind of dma devices, including instruction interaction interface, channel register and instruction
Processor;
Described instruction interactive interface is for receiving data-moving instruction;Described instruction processor is used for according to solution protection processing
Rule carries out solution protection processing to data-moving instruction, obtains this corresponding initialization information of data-moving task, and
The initialization information is written in channel register idle in the dma device, realizes the initial of the channel register
Change, the initialization information include for at least one of source address and destination address in the data-moving task into
The information of row instruction.
Optionally, the dma device further includes Instruction Register, and described instruction buffer is respectively the same as described instruction processing
Device, the communication connection of described instruction interactive interface;The data that described instruction buffer is used to receive described instruction interactive interface
It moves instruction to be cached, be read for described instruction processor and protects processing rule to carry out at solution protection according to the solution
Reason.
Optionally, described instruction interactive interface is the slave interface of the dma device.
Optionally, described instruction processor includes at least one of decoding module and deciphering module;The decoding module
For being handled into row decoding the information of reception according to decoding rule, the deciphering module is used for according to decryption rule to reception
Information is decrypted.
Optionally, the dma device further includes peripheral hardware information register;At the peripheral hardware information register and described instruction
Manage device communication connection;
Described instruction processor is used to protect processing rule to carry out at solution protection data-moving instruction according to solution
Reason after obtaining the initialization information, determines the type of the data-moving instruction, and be determining that the data-moving instructs
When delay data moves instruction, the peripheral hardware information register is written into the initialization information;It is receiving from described outer
After connecing the hardware requests signal of storage device, the initialization information is read from the peripheral hardware information register, and from described
A write-in initialization information is selected in dma device in idle channel register.
Optionally, described instruction processor is additionally operable to determining that the data-moving instruction is that instant data-moving instructs
When, one write-in initialization information of selection directly from channel register idle in the dma device.
Optionally, each peripheral hardware information register in the dma device and each external storage being connected on outside in bus
Equipment corresponds;Described instruction processor is used to be determined according to the external storage equipment identification information in the initialization information
The delay data, which is moved, instructs targeted external storage equipment, and the initialization information write-in external storage is set
Standby corresponding peripheral hardware information register.
Further, the present invention provides a kind of terminal, the terminal includes bus and any one of them DMA as above
Equipment, the instruction interaction interface connection of the dma device is on the bus.
Further, the present invention provides a kind of storage mediums, which is characterized in that storage medium storage there are one or
The multiple programs of person, one or more of programs can be executed by one or more processor, to realize first item institute as above
The step of channel register initial method stated.
Advantageous effect
A kind of channel register initial method of present invention offer, device and dma device, terminal, for traditional dma device
The problem of being easy to kidnap the data to move influence system safety by attacker, the present embodiment provides at the beginning of a kind of channel register
Beginning method, CPU carry initialization information of the task configuration pin to channel register in dma device, initialization letter according to data
Breath includes for the indicative information of at least one of source address and destination address in data-moving task;Then,
CPU carries out protection to initialization information according to protection processing rule and handles to obtain data-moving instruction, and data-moving is instructed
It is sent to dma device, instruction processing unit is transmitted to after the instruction interaction interface to data-moving instruction of dma device, instructs
Processor protects processing rule to carry out solution protection processing to data-moving instruction according to solution, obtains this data-moving task correspondence
Initialization information, then instruction processing unit initialization information is written in dma device in idle channel register, realize logical
The initialization of road register.The channel register initial method provided through this embodiment deposits the channel in dma device
Device is initialized, and what dma device received is no longer direct initialization information, but the data-moving handled through overprotection refers to
It enables.Initialization information is not exposed directly.The present embodiment also provides a kind of channel register apparatus for initializing, dma device, terminal
And storage medium is only obtained through protection processing rule process since solution protects processing rule corresponding with protection processing rule
Data-moving instruction can just be commanded processor and successfully solve the initialization information that protection is handled, therefore, protection processing and solution
Protection handles two processes and cooperates, and can realize that DMA data is moved in the certification in the source instructed to data-moving, realization
Monitoring, ensure the legitimacy of data-moving requesting party, and then the safety of lifting system.
Description of the drawings
Present invention will be further explained below with reference to the attached drawings and examples, in attached drawing:
Fig. 1 is a kind of structural schematic diagram of traditional dma device;
Fig. 2 is a kind of flow chart of the channel register initial method provided in the embodiment of the present invention one;
Fig. 3 is a kind of structural schematic diagram of the dma device provided in the embodiment of the present invention one;
Fig. 4 is another structural schematic diagram of the dma device provided in the embodiment of the present invention one;
Fig. 5 is a kind of flow that channel register is written in initialization information by instruction processing unit in the embodiment of the present invention one
Figure;
Fig. 6 is a kind of structural schematic diagram of the dma device provided in the embodiment of the present invention two;
Fig. 7 is a kind of flow chart of the channel register initial method provided in the embodiment of the present invention two;
Fig. 8 is a kind of structural schematic diagram of the dma device provided in the embodiment of the present invention three;
Fig. 9 is a kind of flow chart of the channel register initial method provided in the embodiment of the present invention three;
Figure 10 is a kind of structural schematic diagram of the terminal provided in the embodiment of the present invention four;
Figure 11 is a kind of structural schematic diagram of the channel register apparatus for initializing provided in the embodiment of the present invention four.
Specific implementation mode
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Before each scheme to the present invention is introduced, first the structure and its data of common dma device are removed here
Advection journey is simply illustrated, Fig. 1 is referred to:
Dma device 10 includes that controller 101, host interface 102, slave interface 103, channel register 104 and inside are slow
105 are deposited, inner buffer 105 is communicated to connect with host interface 102, meanwhile, 102 equal homologous ray of slave interface 103 and host interface
Bus communication connects.Slave interface 103 is used as slave in bus, for receiving the bus request from CPU, such as initializes logical
The initialization information of road register, or inquire the request etc. of dma device internal channel register information.Host interface 102 is total
It is used as host on line, realizes data-moving, such as initiates bus read operation and source address data is read out, be cached to inner buffer
In 105, or initiates the data that the internal portion of total line write transactions caches in 105 and write destination address etc..
Slave interface 103 is communicated to connect with channel register 104, and slave interface 103 is getting initialization from bus
After information, it can be written in channel register 104.When the channel register 104 obtains the right to use of host interface 102,
Controller 101 can be read in the write-in host interface 102 of the initialization information in the channel register 104, to host interface 102
It is initialized, corresponding data-moving task is realized according to the initialization information of write-in to control host interface 102.It is logical
Often, a data-moving can only be written in a channel register 104 asks corresponding initialization information therefore to have been written into
The channel register 104 that initialization information and not yet completion corresponding data move task belongs to occupied, if there is currently numbers
According to task of moving, then the idle channel register 104 that initialization information currently can only not yet be written to those is written.
May include one or more channel registers 104 in dma device 10, these channel registers 104 can be generically and collectively referred to as " logical
Road register file ", although the corresponding initialization information of multiple data-moving tasks can be stored in channel register heap simultaneously,
But in fact, host interface 102 can only execute a data-moving task in synchronization, therefore, in synchronization, be up to
One channel register 104 has the right to use of host interface 102.In order to determine current time, which channel register 104 has
Also further include channel moderator (not shown in figure 1) in dma device 10 for the right to use of host interface 102.Channel moderator is used
It is managed in the right to use to host interface 102.
Under normal conditions, there is the not only CPU of data-moving demand, external storage equipment in also external bus again (with
Lower abbreviation " peripheral hardware), initialization information can be directly sent to by bus at slave interface 103 by CPU, and then be connect by slave
Mouth 103 realizes the initialization of channel register 104 by the idle channel register 104 of initialization information write-in.But peripheral hardware
The case where initiating when data-moving is asked is different:It is outer to be located at when needing dma device 10 to carry out DMA data to move, Ke Yifa
Send hardware requests signal to controller 101, controlling host interface 102 by controller 101 accesses the peripheral hardware, obtains this data and removes
The corresponding initialization information of shifting task.Idle channel deposit can be written after getting initialization information in host interface 102
In device.In some examples, the initialization information got can be first sent to controller 101 by host interface 102, by controlling
Device 101 processed is written into the channel register 104 of idle state.But in other examples, host interface 102 can be direct
It is communicated to connect with channel register 104, an idle channel register is written into the initialization information got from peripheral hardware
104。
As it can be seen that traditional dma device 10 is by slave interface 103 when being initialized to channel register 104
Or host interface 102 gets the initialization information of channel register 104 to be written by bus.Therefore, if to bus into
Row is monitored, and attacker is possible to the agreement for getting the course of work of dma device 10 and using, so that it may be sent with oneself initial
Change information makes it move the position that attacker's specified data is specified to attacker to seize dma device 10 on both sides by the arms, for example, seizing on both sides by the arms
Dma device 10 moves trojan horse program in terminal memory, after allowing CPU readings to execute the trojan horse program, control terminal.
So there are larger security risks for traditional dma device and its data-moving flow, in order to promote the peace of terminal
Quan Xing, a kind of channel register initial method of present invention offer, device and dma device, terminal, below by each embodiment pair
Channel register initial method, terminal and dma device in the present invention etc. are introduced:
Embodiment one:
The present embodiment can be executed channel register initial method jointly by CPU with dma device, with reference to Fig. 2
The flow of the channel register initial method is introduced:
S202:CPU according to data carry task configuration pin in direct memory access dma device channel register it is initial
Change information.
In the present embodiment, the corresponding initialization information of data-moving task is handed down to dma device by CPU.So nothing
By being the data-moving task from CPU itself, or for the data-moving task of peripheral hardware, the initialization of channel register is believed
Breath is configured by CPU.In the present embodiment, initialization information is for source address and destination address in each data-moving task
At least one of indicative information.For example, in some examples of the present embodiment, include simultaneously in initialization information
The source address and destination address of data-moving.In this case, dma device, may not after getting initialization information
It needs to obtain other information again, so that it may to carry out data-moving according to initialization information.Work as in other examples of the present embodiment
In, initialization information includes the source address of data-moving, but does not include destination address, and in this case, dma device may
Need to obtain the destination address of data-moving by other means.For example, data-moving task actual purpose address is a certain
A peripheral hardware, then for dma device before executing data-moving task, dma device can receive the hardware requests letter of peripheral hardware initiation
Number, the corresponding destination address of data-moving task is determined according to the hardware requests signal.Also in some examples, initialization letter
Breath includes destination address but in this case can also with not obtaining source by other means by dma device including source address
Location.For example, dma device first initializes channel register according to the initialization information of CPU configurations, when a certain peripheral hardware needs
It, can be by hard when the destination address for asking dma device that will be specified in the data-moving to initialization information of oneself storage inside
Part request signal specifies the source address of data-moving to dma device.
It should be understood that in initialization information, in addition to being used for specifying the corresponding source of data-moving task to dma device
Can also include the information and data-moving mistake for specifying moving data amount other than the information of address and/or destination address
Control information in journey, for example, the information such as read data bit every time during data-moving.
S204:CPU carries out protection to initialization information according to protection processing rule and handles to obtain data-moving instruction.
CPU, can be first to initial after it will be used to configure the initialization information that channel register initializes
Change information carries out protection and handles to obtain data-moving instruction, so that initialization information is not directly exposed in bus, is disliked
Meaning attacker directly listens to, to understand the chance of dma device initialization procedure to malicious attack side.In the present embodiment,
CPU can carry out coded treatment to it according to preset coding rule to the protection processing of initialization information, can also be root
It is encrypted according to preset encryption rule.It, can be right of course for the further safety for promoting initialization information
It, which carries out protection processing, to carry out coded treatment and encryption to it simultaneously.When protection processing simultaneously include coded treatment and
When encryption, protection processing rule includes just coding rule and encryption rule simultaneously, and CPU can be first according to coding to initialization
Information carries out coded treatment, and then obtained information is encrypted according to encryption rule, refers to obtain data-moving
It enables.Certainly, CPU can also first be encrypted initialization information according to preset encryption rule, then be advised according to coding
Coded treatment then is carried out to the information that encryption obtains, to obtain data-moving instruction.
In some examples of the present embodiment, CPU can carry out coded treatment and encryption to initialization information simultaneously,
May include two parts information unlike aforementioned schemes, in data-moving instruction, first part is to be advised according to pre-arranged code
The coding information that coded treatment obtains then is carried out to initialization information;The second part is according to preset encryption rule to initial
Change the encryption information that information is encrypted.In this way, after dma device receives data-moving instruction, basis is needed
First part's information during decoding rule corresponding with CPU side coding rule instructs data-moving handles to obtain the into row decoding
One initialization information, in addition, also second part information to be decrypted according to decryption corresponding with CPU side encryption rule rule
Processing obtains the second initialization information.In order to ensure that safety, dma device can be only initial in the first initialization information and second
Change under information unanimous circumstances, channel register could be initialized according to the initialization information of acquisition.
S206:Data-moving instruction is sent to the instruction interaction interface of dma device by CPU.
In the present embodiment, the data-moving instruction of the instruction interaction interface of dma device comes from CPU, but can manage
Solution, in other examples, data-moving instruction can also be sent to instruction interaction interface by other objects.
After CPU carries out protection to initialization information to be handled to obtain data-moving instruction instruction, which can be removed
It moves instruction and is sent to dma device.For the ease of those skilled in the art understand that channel register initial method, it is first right here
The structure of dma device provided in this embodiment is simply introduced, and Fig. 3 is referred to:
Dma device 30 includes instruction interaction interface 301, channel register 302 and instruction processing unit 303, wherein instructing
Processor 303 is communicated to connect with instruction interaction interface 301, channel register 302 respectively.In a kind of example of the present embodiment,
CPU can move instruction by system bus to dma device transmission data.In 30 side of dma device, instruction interaction interface 301 can
To receive the data-moving instruction that CPU is sent from bus, data-moving instruction is then transferred to instruction processing unit 303.It answers
When that can be connected with direct communication between the instruction interaction interface 301 in understanding, dma device 30 and instruction processing unit 303, such as
Shown in Fig. 3, after instruction interaction interface 301 receives data-moving instruction, it is transferred directly to instruction processing unit 303.
In addition to this, the instruction interaction interface in dma device and between instruction processing unit can also indirect communication connect,
In some examples of the present embodiment, as shown in figure 4, dma device 40 is in addition to including instruction interaction interface 401, channel register
402 and instruction processing unit 403 outside, further include Instruction Register 404, instruction interaction interface 401 receives data-moving instruction
Afterwards, first by the Instruction Register 404 of data-moving instruction buffer to dma device 40, so that instruction processing unit 403 is meeting
When treatment conditions, data-moving instruction is read from Instruction Register 404 and carries out solution protection processing.So the present embodiment
Some examples in the dma device (dma device 30 as shown in Figure 3) that provides, instruction interaction interface and instruction processing unit it
Between be directly connected to, and other examples provide dma device (dma device 40 as shown in Figure 4) in, instruction interaction interface with
Instruction Register is provided between instruction processing unit, the data-moving instruction to be arrived to instruction interaction interface carries out interim
Caching.It is understood that Instruction Register needs follow the principle of " cannot be write when full, cannot be read when empty ".
S208:The instruction processing unit of dma device protects processing rule to carry out at solution protection data-moving instruction according to solution
Reason, obtains this corresponding initialization information of data-moving task.
Dma device protects processing procedure to the solution that data protection instructs, with CPU to the protection processing procedure of initialization information
It is the process of two contraries, solution protection processing rule is also Corresponding matching with protection processing rule.If protection processing is root
Coded treatment is carried out to initialization information according to preset coding rule, solution protection processing is translated according to corresponding with coding rule
Code rule instructs into row decoding processing, to obtain original initialization information data-moving.If protection processing is basis
Initialization information is encrypted in preset encryption rule, and solution protection processing procedure is then right according to preset decryption rule
Data-moving instruction is decrypted, and obtains initialization information.Certainly, if CPU has carried out at coding initialization information
It is encrypted again after reason, then instruction processing unit should first be decrypted data-moving instruction, then to it
Initialization information can be just obtained into row decoding processing.After if CPU has first carried out encryption to initialization information, and to passing through
Encrypted information has carried out coded treatment, then the instruction processing unit of dma device should first refer to data-moving according to decoding rule
It enables into row decoding processing, the information then obtained to decoding further according to decryption rule is decrypted, initial to get
Change information.
Since CPU can be varied to the protection processing of initialization information, instruction processing unit refers to data-moving
The solution protection processing of order can also be various, as long as rule that the two uses etc. is corresponding, can be protected in initialization information
Meanwhile ensureing that instruction processing unit can restore the information initialized to channel register.
S210:Instruction processing unit initialization information is written in channel register idle in dma device, realizes that channel is posted
The initialization of storage.
When instruction processing unit is instructed according to data-moving and protects processing is regular to obtain with the regular corresponding solution of processing is protected
To after initialization information, obtained initialization information can be written in channel register idle in dma device, be realized logical
The initialization of road register, so as to dma device in subsequent process host interface according to the initialization information in channel register
Execute corresponding data-moving task.
It is understood that after instruction processing unit obtains initialization information, it can be written into channel deposit immediately
In device heap in an idle channel register, can also initialization information be first written to other and be initialized for interim storage
In the register of information, reading initialization information is written to the free time from these interim registers again when meeting condition
Channel register in.For example, in some examples of the present embodiment, instruction processing unit can be according to the class of data-moving instruction
Type decides whether that initialization information is written in channel register immediately, refers to Fig. 5:
S502:Instruction processing unit judges whether the type of data-moving instruction is instant data-moving instruction.
If the determination result is YES, then enter S504.Otherwise, S506 is executed.In these examples, data-moving instruction point
Instruction is moved for the instruction of instant data-moving and delay data, wherein the instruction of instant data-moving is typically because the data of CPU are removed
Shifting demand and initiate, it is desirable that dma device responds as early as possible, complete data-moving task.In general, the institute of data-moving instruction immediately is right
The initialization information answered includes source address, destination address, waits for moving data amount and control information etc..And delay data is moved
Instruction is initiated for peripheral hardware, and delay data, which moves instruction, cannot individually control dma device completion data-moving task, because
It cooperates for its needs and the hardware requests signal that peripheral hardware is sent to instruction processing unit.So the data-moving that CPU is sent refers to
It is only the partial information into the specified execution data-moving task of dma device, such as source address or destination address in advance to enable,
In some examples, it can further include and wait for moving data amount, or even further include control information etc..
In some examples of the present embodiment, dma device can be after carrying out solution protection processing to data-moving instruction
Obtained initialization information come determine the data-moving instruction type need not pass through other if initialization information is complete
Mode obtains information again, then the instruction is instant data-moving instruction;And if lacking execution data-moving in initialization information
Certain or certain several information necessary to task, need to obtain by other means, then data-moving instruction, which belongs to, prolongs
When data-moving instruct.In other examples of the present embodiment, CPU can wherein be carried when generating data-moving instruction
Characterizing the identification information of type, such as the type of instruction is moved by " 1 " characterize data and is instructed for instant data-moving, led to
It crosses " 0 " characterization delay data and moves instruction.
S504:The initialization information is written in selection one to instruction processing unit directly from idle channel register.
It is instructed if data-moving instruction is instant data-moving, instruction processing unit is after obtaining initialization information, directly
A write-in initialization information is selected from channel register idle in dma device.In some examples of the present embodiment,
S506:Peripheral hardware information register is written in initialization information by instruction processing unit.
In some examples of the present embodiment, the peripheral hardware for interim storage initialization information is provided in dma device
Information register refers to Fig. 6:Dma device 60 includes instruction interaction interface 601, channel register 602 and instruction processing unit
603, Instruction Register 604 and peripheral hardware information register 605.Peripheral hardware information register 605 and 603 communication link of instruction processing unit
It connects.After instruction processing unit 603 reads out a data from Instruction Register 604 moves instruction by solution protection processing,
Determine that data-moving instruction is that delay data moves instruction, therefore, instruction processing unit 603 can will solve what protection was handled
In initialization information storage to peripheral hardware information register 605.
It is understood that can have multiple with the peripheral hardware of system bus communication connection, in this case, removed in data
It moves in instruction to carry and is used to indicate the identification information that the data-moving instructs targeted peripheral hardware, for example, a delay data is removed
Moving instruction is sent for peripheral hardware A, then carries " A " in the instruction, and it is to be directed to peripheral hardware B that another delay data, which moves instruction,
It sends, then carries " B " in the instruction for informing that the dma device delay data moves what instruction hour hands initiated peripheral hardware B.
In this way, dma device is when instructing corresponding initialization information to be written to peripheral hardware information register the data-moving, it can basis
The difference of peripheral hardware distinguishes storage, after the hardware requests signal of subsequently received peripheral hardware, can accurately read out with outside
If corresponding initialization information.
In some examples of embodiment, when each peripheral hardware information register of dma device, can open to all peripheral hardwares,
For example, being directed to one of peripheral hardware information register, the initialization information for peripheral hardware A can be both stored, can also have been stored
For the initialization information of peripheral hardware B.But, empty for the different storage of different peripheral assignments in the peripheral hardware information register
Between.Or the peripheral hardware information register can carry corresponding peripheral hardware identification information in the initialization information of storage.In this way, working as
When needing to read out the initialization information for some peripheral hardware, instruction processing unit to corresponding position extracts, or reads and carry
The initialization information of peripheral hardware identification information.
In the other example of the present embodiment, each peripheral hardware information register and peripheral hardware in dma device are uniquely right
It answers, for example, can also include a, b, c, d tetra- outer with tetra- peripheral hardwares of external A, B, C, D, accordingly, in dma device on system bus
If information register, wherein peripheral hardware information register a is used to store the corresponding initialization letter of data-moving task for peripheral hardware A
Breath, peripheral hardware information register b are used to store initialization information ... corresponding to the data-moving task for peripheral hardware B with such
It pushes away.So when instruction processing unit determines that the instruction of some data-moving belongs to delay data and moves instruction, and determine the delay number
It is that when being directed to peripheral hardware C, corresponding initialization information can be written in peripheral hardware information register c according to instruction is moved.This
In embodiment, peripheral hardware information register is 4 registers of each peripheral assignment, the address of memory channel and control information.Each
Peripheral hardware information register has default value, if there is initialization information needs to be written in some peripheral hardware information register, then may be used
To cover information old in the peripheral hardware information register using current information.
S508:After instruction processing unit receives the hardware requests signal from external storage equipment, deposited from peripheral hardware information
Initialization information is read in device, and a write-in initialization information is selected from channel register idle in dma device.
When some is externally provided with data-moving demand, hardware requests signal can be sent to dma device, in dma device
Instruction processing unit is receiving hardware requests signal, determines that the hardware requests signal is initiated by which peripheral hardware, then arrives
The initialization information stored before is read in corresponding peripheral hardware information register, then, the current idle from channel register heap
Channel register in selection one initialization information that reads out is written, complete the initialization of channel register.
Channel register initial method and dma device provided in this embodiment, are connect by the instruction interaction in dma device
Mouthful instruction processing unit is added between channel register, so that CPU is before issuing initialization information, it can be first to initial
Change information and carry out protection processing, initialization information is avoided directly to be exposed when being transmitted in bus, avoids attacker total by monitoring
Line understands the initialization procedure of channel register, to ensure that dma device carries out the reliability of data-moving, lifting system safety
Property.
Embodiment two:
The present embodiment will continue stream to channel register initial method in dma device side on the basis of embodiment one
Journey is introduced, and the data-moving instruction issued here with CPU is that instant data-moving instructs, and instruction interaction interface is DMA
It is illustrated for the slave interface of equipment, refers to Fig. 7:
S701:Slave interface receives data-moving instruction from bus;
S702:Whether slave interface decision instruction buffer has expired;
If Instruction Register has been expired, slave interface can not be by the data-moving instruction buffer received to Instruction Register
In, therefore if the determination result is YES, then execute S703;Otherwise S704 is executed.
S703:Slave interface feeds back the information that characterization dma device temporarily cannot respond to CPU;
For example, in the present embodiment, slave interface can send RETRY (retrying) or SPLIT by system bus to CPU
(leaving) responds to CPU, informs that CPU retransmits data-moving instruction in due course.
S704:Data-moving instruction is written in Instruction Register by slave interface;
In the present embodiment, the data-moving stored in Instruction Register is instructed by slave interface write instruction, by instructing
Processor is read.Instruction Register uses the structure of first in first out, and the instruction for entering instruction buffer at first is read at first.It is empty
Full signal is controlled by read-write pointer, and by Instruction Register internal maintenance, slave interface and instruction processing unit only provide read-write pointer
Read and write enable signal.
S705:Instruction processing unit judges whether idle channel register;
If judging result is no, instruction processing unit continues to execute S705 after waiting for a period of time, and if judging result is
It is that then instruction processing unit reads a data from Instruction Register and moves instruction and enter S706.
S706:Instruction processing unit carries out solution protection processing to the data-moving instruction read out.
In some examples of the present embodiment, instruction processing unit includes at least one in decoding module and deciphering module
It is a.Wherein, decoding module is used for according to decoding rule to the information of reception into row decoding processing, and deciphering module is used for according to decryption
The information of reception is decrypted in rule.It should be understood that when instruction processing unit includes decoding module and decryption simultaneously
When module, the connection relation between decoding module and deciphering module can influence solution protection process flow.If for example, decoding module point
Not with Instruction Register, deciphering module communicate to connect, then solution protection processing flow be then first by decoding module according to decoding
Rule instructs into row decoding processing data-moving, and then decoding result is decrypted according to decryption rule by deciphering module
Reason, to obtain initialization information.
In a kind of example of the present embodiment, instruction processing unit only includes decoding module, then instruction processing unit is according to translating
Code rule can be obtained corresponding initial after instructing the data-moving read out from Instruction Register into row decoding processing
Change information.
S707:An idle channel register is written in initialization information by instruction processing unit.
Its type is can determine whether while instruction processing unit carries out solution protection processing to data-moving instruction, in the present embodiment
In, since data-moving instruction belongs to instant data-moving instruction, after instruction processing unit obtains initialization information, Ke Yizhi
It connects and is written into idle channel register, complete the initialization of channel register.
In some examples of the present embodiment, channel moderator is made with the principle managing main frame interface of " first in first out "
With power:The channel register being first initialised first obtains the right to use of host interface, that is, being currently located at channel register heap top
The channel register at end possesses the host interface right to use.It, can be to logical after some channel register completes initialization
The road moderator application host interface right to use, if it is not allowed to use host interface currently, which can be with one
Straight application, until obtaining the host interface right to use.If some channel register obtains the host interface right to use, DMA
The controller of equipment can initialize host interface according to the initialization information in the channel register, and start host interface and hold
The corresponding data-moving task of row.
In general, the direct data stored in memory of dma device, which is moved, is divided into two processes:Process one reads number from source address
According to the inner buffer for being written to dma device;Process two writes data to designated destination from the inner buffer of dma device
Location.In order to complete the two processes, dma device can be to bus request bus mastership twice.Data-moving task can succeed
Terminate, in this case, channel register discharges host interface, and controller is according to the initialization in next channel register
Information initializing host interface.Data-moving task can also mistake terminate, in this scenario, host interface sends out fault interrupt
To CPU, channel register discharges host interface, and it is the free time to identify the channel register, and controller is posted according to next channel
Initialization information in storage initializes host interface.Data-moving task can also retry or block end, at this point, channel is deposited
Device discharges host interface, and finally preserves current transmission information in channel register heap, meanwhile, controller is according to next
Initialization information in channel register initializes host interface.In addition, data-moving task can also terminate in advance, at this point,
Channel register discharges host interface, and finally preserves current transmission information in channel register heap, and controller is under
Initialization information in one channel register initializes host interface.
Channel register initial method provided in this embodiment, dma device slave interface and channel register it
Between be additionally arranged for the data cached Instruction Register for moving instruction, and for data-moving instruction carry out solution protection processing
Instruction processing unit.CPU will be used to form data-moving instruction after carrying out initialization information coded treatment to channel register, keep away
Exempt from initialization information directly externally to expose when transmitting in bus, to the channel register initialization of exposure dma device
Process.After dma device receives the initialization information that protect, need to handle it into row decoding by instruction processing unit,
The solution protection of initialization information could be completed, and then the initialization of channel register could be completed.This channel register is initial
Change method improves the safety of the reliability and system of dma device data-moving.
Embodiment three:
When in order to solve in the prior art to initialize the channel register in dma device, directly transmission initialization
Information causes dma device to be easy to be seized on both sides by the arms by malicious attack side, to move malicious attack side's specified data, threatens system peace
Full problem, the present embodiment provides a kind of dma devices, with reference to Fig. 8 and Fig. 9 to the structure and dma device of the dma device
The initialization procedure of middle channel register is introduced:
Dma device 80 includes slave interface 801, Instruction Register 802, instruction processing unit 803, channel register 804, outer
If information register 805, controller 806, host interface 807, inner buffer 808.Slave interface 801 and Instruction Register 802
Communication connection.Instruction Register 802 can be used for storing the data-moving instruction that slave interface 801 receives, at instruction
It manages device 803 to read, and protects processing rule to carry out solution protection processing according to preset solution.Instruction processing unit 803 is deposited with channel
Device 804, peripheral hardware information register 805 communicate to connect, after obtaining the initialization information for channel register, instruction processing
Device 803 initialization information can be written in channel register 804 according to the type selection that data-moving instructs or peripheral hardware is believed
It ceases in register 805.If initialization information has been written in peripheral hardware information register 805, when instruction processing unit 803 receives
After the hardware requests signal that corresponding peripheral hardware is initiated, initialization information can be read again and be written in channel register 804.It is logical
Road register 804 is communicated to connect with controller 806, and controller 806 can be by the current channel with 807 right to use of host interface
Initialization information in register 804 is read, and is initialized to host interface 807 according to the information of reading, so as to host
Interface 807 executes the corresponding data-moving task of initialization information upon initialization.
Slave interface 801, host interface 807 are respectively used to communicate to connect with system bus, and host interface 807 is in bus
As host, data-moving is realized, such as initiate bus read operation and source address data are read out, be cached to inner buffer 808
In, or initiate the data that the internal portion of total line write transactions caches in 808 and write destination address etc..Host interface 807 is posted including one group
Storage, host interface state machine, host interface 807 reads in inner buffer from the data received in bus in source address, total writing
It again will be in the data broadcasting to bus in inner buffer 808 when line.
When host interface 807 is worked with transmission mode, the read operation of a designated length is executed, then executes primary specified length
The write operation of degree.At this point, channel register 804 occupies host interface 807 in the form of locking, i.e., in some channel register
804 when possessing the right to use of host interface 807, cannot allow other channel registers while application or occupying host interface 807, no
Then send out alarm signal.Host interface 807 is also responsible for safeguarding the address of 80 inner buffer 808 of dma device simultaneously.
The workflow of host interface 807 approximately as:
1, host interface 807 receives the enabling signal generation bus request signal of controller 806 and asks locking signal simultaneously
Initialize host interface register.
Specifically, host interface 807 receives the enabling signal initialization host interface of controller 806, including configuring request
Lock register, bus mastership register, mode register, host interface source address register, host interface destination address
Register, address accumulator register, Read-write Catrol register, transmission sized registers, transmission state register, outburst type are posted
Storage reads residue length register, write-read residue length register.Host interface 807 is according to residue length register and burst
Type calculates the value of burst register and current burst residue length register.
Address information is provided by the source/destination address register of each channel register.Transmission size information is posted by each channel
The transmission sized registers of storage provide.It is remaining long to read residue length register, write-read residue length register and current burst
Degree register is used for judging the transmission direction of current transmission.
2, host interface 807 after the highest priority response for receiving bus arbiter, read address signal and read to control by driving
Signal processed is to bus.The data read from source address by bus are stored in inner buffer 808.If data length is more than
The length of one secondary burst, then continuation application bus from given address all specified datas of reading until being stored in inner buffer
Until 808.
3, in a transmission mode, host interface 807 applies for that bus initiates write operation, drives writing address signal and writes control letter
Number arrive bus.Data in inner buffer 808 are written to designated destination location.
4, the end of transmission.
Slave interface 801 is used as slave in bus, can receive the data-moving instruction from CPU, in addition, due to
Between channel register 804, instruction processing unit 803, Instruction Register 802 and slave interface 801 can with two-way communication, because
This, when slave interface 801 receives the instruction of CPU, the information that can also be read out in channel register 804 is written to bus
On, so that CPU is monitored the state of in dma device 80 channel register.
It can be instant data-moving instruction according to the instruction of foregoing description data-moving, can also be that delay data is removed
Instruction is moved, the present embodiment is to be introduced for the delay data initiated for peripheral hardware D moves instruction by data-moving instruction:
S901:Slave interface receives data-moving instruction by bus;
S902:Whether slave interface decision instruction buffer has expired;
If Instruction Register has been expired, slave interface can not be by the data-moving instruction buffer received to Instruction Register
In, therefore if the determination result is YES, then execute S903;Otherwise S904 is executed.
S903:Slave interface feeds back the information that characterization dma device temporarily cannot respond to CPU;
For example, in the present embodiment, slave interface can send RETRY or SPLIT to CPU by system bus and respond to
CPU informs that CPU retransmits data-moving instruction in due course.
S904:Data-moving instruction is written in Instruction Register by slave interface;
S905:Instruction processing unit moves instruction to the delay data read out and carries out solution protection processing.
The solution that instruction processing unit moves delay data instruction protects processing procedure referring to the introduction in embodiment two, here
It repeats no more.In the present embodiment, may include data in the initialization information corresponding to the data-moving task for peripheral hardware
The information such as byte number, outburst type and the conveying length of the destination address, transmission moved.In the present embodiment, peripheral hardware D can be
Data acquisition equipment, the data acquisition equipment is after collecting enough data, it may be desirable to which dma device is by its collected number
According to moving in terminal memory.
S906:Corresponding peripheral hardware information register d is written in initialization information by instruction processing unit.
Instruction processing unit to delay data move instruction carry out solution protection processing while, it may be determined that go out currently processed
The type of data-moving instruction belong to delay data and move instruction.Therefore, the initialization in obtaining data-moving instruction
After information, initialization information can be written to corresponding peripheral hardware information register by instruction processing unit.Since the delay data is removed
Moving instruction is initiated for peripheral hardware D, and therefore, initialization information can be written to peripheral hardware information register d by instruction processing unit
In the middle, using original information in current initialization information covering peripheral hardware information register d.
In the present embodiment, because the peripheral hardware being connect with bus communication is corresponded between peripheral hardware information register, because
This finds that no peripheral hardware information register can be deposited after if instruction processing unit parses the instruction of some data-moving
It stores up the data-moving and instructs corresponding initialization information, then it is to be directed to any one peripheral hardware to illustrate data-moving instruction not, because
This data-moving is illegal when instructing, and dma device can be without carrying out corresponding data-moving task.
S907:Instruction processing unit receives the hardware requests signal that peripheral hardware D is initiated;
S908:Instruction processing unit reads initialization information from peripheral hardware information register d and an idle channel is written
Register.
When idle channel register is written in the initialization information read from peripheral hardware information register d by instruction processing unit
Later, which can be to the channel moderator application host interface right to use, if it is not allowed to use host currently
Interface, then the channel register can apply always, until obtaining the host interface right to use.If the channel register obtains
The host interface right to use, then the controller of dma device can be initialized and be led according to initialization information in the channel register
Machine interface, and start host interface and execute corresponding data-moving task.
Channel register initial method provided in this embodiment need not be by DMA for the data-moving task of peripheral hardware
The controller control host interface of equipment accesses peripheral hardware and obtains initialization information, but unification issues data-moving instruction by CPU,
It avoids host interface from accessing peripheral hardware and obtains attacker's acquisition that initialization information causes initialization information to be easy monitored bus, from
And based on initialization information understand dma device channel register initialization flow, and then seize on both sides by the arms dma device move it is unsafe
Data influence system safety.
Moreover, because each peripheral hardware information register and each peripheral hardware being connected on outside in bus correspond in dma device, it is this
One-to-one relationship can occasionally ensure that each peripheral hardware information register only stores the initialization information for corresponding peripheral hardware.It therefore, can be with
The legitimacy of data-moving command source is authenticated to a certain extent.
Example IV:
The present embodiment provides a kind of terminal, which includes the dma device that foregoing embodiments provide, the finger of dma device
Enable interactive interface be connected in the bus of terminal, can be realized by bus in terminal other be connected to the logical of the device in bus
Letter.Refer to Figure 10:Terminal 1 includes CPU 11, memory 12, bus 13 and dma device 14, and CPU 11, memory 12 and DMA are set
Standby 14 are communicated to connect by bus 13, and the structure of wherein dma device 14 may refer to the introduction in aforementioned any embodiment.
The present embodiment also provides a kind of channel register apparatus for initializing, below to the knot of channel register apparatus for initializing
Structure is introduced, and refers to Figure 11:
Channel register apparatus for initializing 110 includes configuration module 111, protection module 112 and interactive module 113,
Middle configuration module 111 be used for according to data carry task configuration pin in direct memory access dma device channel register just
Beginningization information.Protection module 112 is used to carry out protection to initialization information according to protection processing rule to handle to obtain data-moving
Instruction.Interactive module 113 is used to data-moving instruction being sent to dma device, so that dma device is based on data-moving instruction in fact
The initialization of existing channel register.
Each module realizes that the detail of corresponding function may refer to aforementioned implementation in channel register apparatus for initializing 110
Introduction in example, which is not described herein again.The function bacterium of each module can be by Figure 10 in channel register apparatus for initializing 110
CPU 11 is realized.
The present embodiment also provides a kind of storage medium, can be stored with for realizing foregoing embodiments in the storage medium
The computer program of the channel register initial method of middle introduction.In some examples of the present embodiment, the storage medium
In can only be stored with the first computer program, the first computer program reads for one or more processors, compiles and holds
Row, to realize channel register initial method in CPU side flow;In another example of the present embodiment, which is situated between
Second computer program can be only stored in matter, second computer program reads for one or more processors, compiles simultaneously
It executes, to realize channel register initial method the dma device side the step of.
Terminal provided in this embodiment, since CPU side solution protects processing rule to protect processing rule right with dma device side
It answers, therefore, after CPU carries out protection processing according to protection processing rule to initialization information, the solution only through dma device side is protected
Just therefore getable initialization information protects processing to cooperate with solution protection two processes of processing to shield processing rule process,
Initialization information can not only be avoided to be directly exposed in bus to transmit, it can also enough realize to carry out data-moving instruction
The monitoring moved to DMA data is realized in the certification in source, ensures the legitimacy of data-moving requesting party, and then the peace of lifting system
Quan Xing.
It should be noted that herein, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that process, method, article or device including a series of elements include not only those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including this
There is also other identical elements in the process of element, method, article or device.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical scheme of the present invention substantially in other words does the prior art
Going out the part of contribution can be expressed in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal equipment (can be mobile phone, computer, clothes
Be engaged in device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited in above-mentioned specific
Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art
Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much
Form, all of these belong to the protection of the present invention.
Claims (16)
1. a kind of channel register initial method is applied to central processor CPU, which is characterized in that the channel register
Initial method includes:
The CPU carries task configuration pin according to data and believes the initialization of channel register in direct memory access dma device
Breath, the initialization information include for at least one of source address and destination address in the data-moving task into
The information of row instruction;
The CPU carries out protection to the initialization information according to protection processing rule and handles to obtain data-moving instruction;
Data-moving instruction is sent to the dma device by the CPU, so that the dma device is removed based on the data
Move the initialization that channel register is realized in instruction.
2. a kind of channel register initial method is applied to direct memory access dma device, which is characterized in that the channel
Initialization of register method includes:
The instruction interaction interface data-moving of the dma device instructs;
The instruction processing unit of the dma device protects processing rule to carry out at solution protection data-moving instruction according to solution
Reason, obtains this corresponding initialization information of data-moving task, the initialization information includes for being removed to the data
The indicative information of at least one of source address and destination address in shifting task;
Described instruction processor the initialization information is written in channel register idle in the dma device, realizes institute
State the initialization of channel register.
3. channel register initial method as claimed in claim 2, which is characterized in that the instruction interaction of the dma device
After the instruction of interface data-moving, further include:Described instruction interactive interface is by data-moving instruction storage described in
In the Instruction Register of dma device;
The instruction processing unit of the dma device protects processing rule to carry out solution protection processing to data-moving instruction according to solution
Before, further include:Described instruction processor reads the data-moving instruction from described instruction buffer.
4. channel register initial method as claimed in claim 2, which is characterized in that the instruction of the dma device is handled
Device protects processing rule to carry out solution protection processing to data-moving instruction according to solution, including:
If the solution protection processing rule includes decoding rule, described instruction processor is according to the decoding rule to the number
It is instructed into row decoding processing according to moving;
If the solution protection processing rule includes decryption rule, described instruction processor is according to decryption rule to the number
It is decrypted according to instruction is moved;
If the solution protection processing rule is simultaneously including decoding rule and decryption rule, described instruction processor is first translated according to
Code rule instructs into row decoding processing the data-moving, and then decoding result is decrypted further according to decryption rule
Processing;Or, described instruction processor is first decrypted data-moving instruction according to decryption rule, then again
Decrypted result is handled into row decoding according to decoding rule.
5. such as claim 2-4 any one of them channel register initial methods, which is characterized in that described instruction processor
The initialization information is written in channel register idle in the dma device, including:
Described instruction processor determines the type of the data-moving instruction;
If the data-moving instruction is that delay data moves instruction, the initialization information is written described instruction processor
Peripheral hardware information register;
After receiving the hardware requests signal from the external storage equipment, described instruction processor is from the peripheral hardware information
The initialization information is read in register, and a write-in institute is selected from channel register idle in the dma device
State initialization information.
6. channel register initial method as claimed in claim 5, which is characterized in that described in described instruction processor determines
After the type of data-moving instruction, further include:
If the data-moving instruction is that instant data-moving instructs, described instruction processor is obtaining the initialization information
Afterwards, one write-in initialization information of selection directly from channel register idle in the dma device.
7. channel register initial method as claimed in claim 5, which is characterized in that each peripheral hardware letter in the dma device
Breath register and each external storage equipment being connected on outside in bus correspond;Described instruction processor is by the initialization information
Peripheral hardware information register is written, including:
Described instruction processor determines the delay data according to the external storage equipment identification information in the initialization information
It moves and instructs targeted external storage equipment;
The corresponding peripheral hardware information register of the external storage equipment is written in the initialization information by described instruction processor.
8. a kind of channel register apparatus for initializing, which is characterized in that including:
Configuration module, for according to data carry task configuration pin in direct memory access dma device channel register just
Beginningization information, the initialization information include for in source address in the data-moving task and destination address at least
One indicative information;
Protection module, handles to obtain data-moving for carrying out protection to the initialization information according to protection processing rule and refers to
It enables;
Interactive module, for data-moving instruction to be sent to the dma device, so that the dma device is based on described
The initialization of channel register is realized in data-moving instruction.
9. a kind of dma device, which is characterized in that including instruction interaction interface, channel register and instruction processing unit;
Described instruction interactive interface is for receiving data-moving instruction;Described instruction processor is used to protect processing rule according to solution
Solution protection processing is carried out to data-moving instruction, obtains this corresponding initialization information of data-moving task, and by institute
It states initialization information to be written in channel register idle in the dma device, realizes the initialization of the channel register, institute
It includes for referring to at least one of source address and destination address in the data-moving task to state initialization information
The information shown.
10. dma device as claimed in claim 9, which is characterized in that the dma device further includes Instruction Register, the finger
Buffer is enabled to be communicated to connect respectively with described instruction processor, described instruction interactive interface;Described instruction buffer is used for institute
State instruction interaction interface to data-moving instruction cached, for described instruction processor read and according to the solution
Protection processing rule carries out solution protection processing.
11. dma device as claimed in claim 9, which is characterized in that described instruction interactive interface be the dma device from
Machine interface.
12. dma device as claimed in claim 9, which is characterized in that described instruction processor includes decoding module and decryption mould
It is in the block at least one;The decoding module is used to handle the information of reception into row decoding according to decoding rule, the decryption
Module is used to that the information of reception to be decrypted according to decryption rule.
13. such as claim 9-12 any one of them dma devices, which is characterized in that the dma device further includes peripheral hardware information
Register;The peripheral hardware information register is connect with described instruction processor communication;
Described instruction processor is used to protect processing rule to carry out solution protection processing to data-moving instruction according to solution, obtains
To after the initialization information, the type of the data-moving instruction is determined, and determining that the data-moving instruction is delay
When data-moving instructs, the peripheral hardware information register is written into the initialization information;It external is deposited from described receiving
After the hardware requests signal for storing up equipment, the initialization information is read from the peripheral hardware information register, and set from the DMA
One write-in initialization information of selection in the channel register of standby interior free time.
14. dma device as claimed in claim 13, which is characterized in that described instruction processor is additionally operable to determining the number
According to move instruction be instant data-moving instruction when, directly from channel register idle in the dma device select one
The initialization information is written.
15. dma device as claimed in claim 13, which is characterized in that each peripheral hardware information deposit in the dma device
Device and each external storage equipment being connected on outside in bus correspond;Described instruction processor is used for according to the initialization information
In external storage equipment identification information determine that the delay data is moved and instruct targeted external storage equipment, and will be described
The corresponding peripheral hardware information register of the external storage equipment is written in initialization information.
16. a kind of terminal, which is characterized in that the terminal includes bus and such as claim 9-15 any one of them DMA
Equipment, the instruction interaction interface connection of the dma device is on the bus.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810161671.4A CN108446137A (en) | 2018-02-26 | 2018-02-26 | Channel register initial method, device and dma device, terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810161671.4A CN108446137A (en) | 2018-02-26 | 2018-02-26 | Channel register initial method, device and dma device, terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108446137A true CN108446137A (en) | 2018-08-24 |
Family
ID=63192613
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810161671.4A Pending CN108446137A (en) | 2018-02-26 | 2018-02-26 | Channel register initial method, device and dma device, terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108446137A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109597654A (en) * | 2018-12-07 | 2019-04-09 | 湖南国科微电子股份有限公司 | Initialization of register method, the generation method and embedded system of configurations table |
CN110442364A (en) * | 2019-07-10 | 2019-11-12 | 北京欧铼德微电子技术有限公司 | Processing method, processing system, display device and its electronic equipment of register |
CN114399034A (en) * | 2021-12-30 | 2022-04-26 | 北京奕斯伟计算技术有限公司 | Data handling method for direct memory access device |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20030083100A (en) * | 2002-04-19 | 2003-10-30 | 한국전자통신연구원 | Block encrypting device for fast session switching and method of operating the same |
US20050005092A1 (en) * | 2003-06-26 | 2005-01-06 | Jeong Seung-Youl | Method and apparatus for protecting data during storage/retrieval |
CN102591824A (en) * | 2011-12-27 | 2012-07-18 | 深圳国微技术有限公司 | DMA (direct memory access) controller for controlling security data transfer in SOC (system on a chip) chip system |
US20130080726A1 (en) * | 2011-09-25 | 2013-03-28 | Andrew G. Kegel | Input/output memory management unit with protection mode for preventing memory access by i/o devices |
CN107346401A (en) * | 2016-05-06 | 2017-11-14 | 波音公司 | Information Guarantee System for safely configuration processor |
-
2018
- 2018-02-26 CN CN201810161671.4A patent/CN108446137A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20030083100A (en) * | 2002-04-19 | 2003-10-30 | 한국전자통신연구원 | Block encrypting device for fast session switching and method of operating the same |
US20050005092A1 (en) * | 2003-06-26 | 2005-01-06 | Jeong Seung-Youl | Method and apparatus for protecting data during storage/retrieval |
US20130080726A1 (en) * | 2011-09-25 | 2013-03-28 | Andrew G. Kegel | Input/output memory management unit with protection mode for preventing memory access by i/o devices |
CN102591824A (en) * | 2011-12-27 | 2012-07-18 | 深圳国微技术有限公司 | DMA (direct memory access) controller for controlling security data transfer in SOC (system on a chip) chip system |
CN107346401A (en) * | 2016-05-06 | 2017-11-14 | 波音公司 | Information Guarantee System for safely configuration processor |
Non-Patent Citations (2)
Title |
---|
邓家荣;: "DMA工作方式探析及应用", 福建电脑, no. 05, 1 May 2009 (2009-05-01), pages 136 * |
邓程方;王铮;: "基于流加密的CPU私化的研究", 计算机技术与发展, no. 05, 10 May 2011 (2011-05-10), pages 140 - 144 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109597654A (en) * | 2018-12-07 | 2019-04-09 | 湖南国科微电子股份有限公司 | Initialization of register method, the generation method and embedded system of configurations table |
CN109597654B (en) * | 2018-12-07 | 2022-01-11 | 湖南国科微电子股份有限公司 | Register initialization method, basic configuration table generation method and embedded system |
CN110442364A (en) * | 2019-07-10 | 2019-11-12 | 北京欧铼德微电子技术有限公司 | Processing method, processing system, display device and its electronic equipment of register |
CN114399034A (en) * | 2021-12-30 | 2022-04-26 | 北京奕斯伟计算技术有限公司 | Data handling method for direct memory access device |
CN114399034B (en) * | 2021-12-30 | 2023-05-02 | 北京奕斯伟计算技术股份有限公司 | Data handling method for direct memory access device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7363389B2 (en) | Apparatus and method for enhanced channel adapter performance through implementation of a completion queue engine and address translation engine | |
CN105518611B (en) | A kind of remote direct data access method, equipment and system | |
CN104252375B (en) | Method and system for sharing USB Key positioned at multiple virtual machines of different main frames | |
CN107851151A (en) | Protect the status information of virtual machine | |
CN108446137A (en) | Channel register initial method, device and dma device, terminal | |
US5093910A (en) | Serial data transmission between redundant channels | |
CN116635820B (en) | Method and apparatus for controlling a compute-store processor | |
CN107851152A (en) | Technology for the distributed operation of safety governor | |
CN110958215B (en) | Secure on-line received network packet processing | |
CN111930676A (en) | Method, device, system and storage medium for communication among multiple processors | |
CN106657052A (en) | Access management method and system for storage data | |
CN108139984A (en) | Secure subsystem | |
CN105389120B (en) | Support the RMA API by alive messages | |
CN103685578B (en) | The data transmission method of master-slave equipment | |
CN110096542A (en) | Data verification processing method, device, system and the medium of decentralization | |
CN103812739B (en) | FPGA and DSP communicator and communication means | |
CN104268483B (en) | Data protecting system, device and method | |
JPH10143439A (en) | Data processor | |
CN108182119A (en) | Read and write abruption control method and device, storage medium and electronic device | |
KR100302223B1 (en) | The secret interface for the process control computer and the method of transferring its data | |
CN107924440A (en) | Secured computing environment | |
CN110958216B (en) | Secure online network packet transmission | |
CN109992539A (en) | Double main machine coordination working devices | |
CN104994225B (en) | A kind of short message sending control method and short message transmission control device | |
CN107590088B (en) | A kind of processing method, system and the relevant apparatus of DMA read operations |
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 |