CN108345788A - Input-output record device and method, CPU and its data read-write operation method - Google Patents
Input-output record device and method, CPU and its data read-write operation method Download PDFInfo
- Publication number
- CN108345788A CN108345788A CN201710212740.5A CN201710212740A CN108345788A CN 108345788 A CN108345788 A CN 108345788A CN 201710212740 A CN201710212740 A CN 201710212740A CN 108345788 A CN108345788 A CN 108345788A
- Authority
- CN
- China
- Prior art keywords
- write operation
- cpu
- data read
- peripheral hardware
- input
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/55—Detecting local intrusion or implementing counter-measures
- G06F21/552—Detecting local intrusion or implementing counter-measures involving long-term monitoring or reporting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/57—Certifying or maintaining trusted computer platforms, e.g. secure boots or power-downs, version controls, system software checks, secure updates or assessing vulnerabilities
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Storage Device Security (AREA)
Abstract
The invention discloses a kind of input-output record device and method, CPU and its data read-write operation methods, wherein, input-output record device is set between CPU and peripheral hardware, for recording the data read-write operation between the CPU and the peripheral hardware, the data read-write operation includes the data read-write operation that the data read-write operation that the peripheral hardware is initiated and the CPU are initiated;Wherein, the input-output record device is additionally operable to that the CPU is asked to handle the data read-write operation that the peripheral hardware is initiated, and when receiving the instruction that the CPU is sent, the data packet for the data read-write operation that the peripheral hardware is initiated is sent to the CPU.Data read-write operation between CPU and peripheral hardware can accurately be recorded using the present invention, the uncertain influence that the asynchronous data read-write operation that peripheral hardware is initiated is brought is eliminated, provide the foundation for the input and output safety detection of CPU.
Description
Technical field
The present invention relates to field of computer technology more particularly to input-output record device and method, CPU and its data to read
Write operation method.
Background technology
This part intends to provides background or context for the embodiment of the present invention stated in claims.Description herein
Recognize it is the prior art not because not being included in this part.
With the large-scale application of the new technologies such as Network Information, information security becomes increasingly serious problem.Usually I
The information security that discusses all be confined to network security, software security etc., but as Recent study shows that hardware is pacified
It should also attract attention entirely.
The scale of hardware design is increasingly promoted with the promotion of hardware design level so that hardware Trojan horse is possibly realized:When
The source of the preceding Hardware I P (intellectual property) with CPU (central processing unit) to be used in the large-scale circuit of representative is diversified, firmly
The flow of part design complicates, and manufactures and designs under the safely controllable property that the factors such as flow division of labor refinement cause hardware final products
Drop.Increased in the design by the possibility of injection malice wooden horse or loophole (hereinafter referred wooden horse), while the increasing of hardware size
Add the difficulty for also increasing that wooden horse is identified and finds.In recent years, with the development of information security concept, the safety of hardware by
Gradually become the research hotspot of information security.
Invention content
Inventor has found, data read-write operation between CPU and peripheral hardware can be utilized to record, to the hardware security of CPU into
Row detection.For this purpose, a kind of input-output record device is provided in embodiments of the present invention, to realize between CPU and peripheral hardware
The function that is recorded of data read-write operation, so that the hardware security to CPU is detected.
Input-output record device in the embodiment of the present invention is set between CPU and peripheral hardware, for record the CPU with
Data read-write operation between the peripheral hardware, the data read-write operation include the data read-write operation and institute that the peripheral hardware is initiated
State the data read-write operation of CPU initiations;Wherein, the input-output record device is additionally operable to ask the CPU processing described outer
If the data read-write operation initiated, and when receiving the instruction that the CPU is sent, reading and writing data that the peripheral hardware is initiated
The data packet of operation is sent to the CPU.
In an embodiment of the present invention, a kind of input-output record method is additionally provided, including:
The data read-write operation between CPU and peripheral hardware is recorded, the data read-write operation includes the number that the peripheral hardware is initiated
The data read-write operation initiated according to read-write operation and the CPU;
The CPU is asked to handle the data read-write operation that the peripheral hardware is initiated, and in the finger for receiving the CPU transmissions
When showing, the data packet for the data read-write operation that the peripheral hardware is initiated is sent to the CPU.
In an embodiment of the present invention, a kind of central processing unit is additionally provided, including:
Request processing module, for when receiving the request of input-output record device transmission, pause to execute current
Instruction stream;
It indicates sending module, is indicated for being sent to the input-output record device, to indicate that the input and output are remembered
Recording device sends the data packet of pending data read-write operation;
Data processing module, the pending reading and writing data behaviour sent for receiving the input-output record device
The data packet of work, and complete the pending data read-write operation.
In an embodiment of the present invention, a kind of data read-write operation method of central processing unit is additionally provided, including:
When receiving the request of input-output record device transmission, pause executes current instruction stream;
It sends and indicates to the input-output record device, to indicate that it is described pending that input-output record device is sent
The data packet of data read-write operation;
The data packet for the pending data read-write operation that the input-output record device is sent is received, and is completed
The pending data read-write operation.
In the embodiment of the present invention, input-output record device is set between CPU and peripheral hardware, for recording CPU and peripheral hardware
Between data read-write operation, include peripheral hardware initiate data read-write operation and CPU initiate data read-write operation.To accurate
Ground records the data read-write operation between CPU and peripheral hardware, convenient for the data read-write operation record between later use CPU and peripheral hardware
The safety of CPU hardware is detected.Also, input-output record device is additionally operable to the number that request CPU processing peripheral hardwares are initiated
According to read-write operation, and receive CPU transmission instruction when, then by peripheral hardware initiate data read-write operation data packet send
To CPU, and then the uncertain influence that the asynchronous data read-write operation that peripheral hardware is initiated is brought is eliminated, the input and output for being CPU are pacified
Full inspection survey provides the foundation.
In the embodiment of the present invention, central processing unit when receiving the request of input-output record device transmission, hold by pause
Instruction stream before the trade, and send and indicate to the input-output record device, to indicate that the input-output record device is sent out
Send the data packet of pending data read-write operation.Then, the described pending of the input-output record device transmission is received
Data read-write operation data packet, and complete the pending data read-write operation.Therefore, peripheral hardware initiation can be eliminated
The uncertain influence that asynchronous data read-write operation is brought, provides the foundation for the input and output safety detection of CPU.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment
Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for
For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings
Attached drawing.In the accompanying drawings:
Fig. 1 is the schematic diagram of input-output record device in the embodiment of the present invention;
Fig. 2 is the specific example that input-output record device includes the first subregion and the second subregion in the embodiment of the present invention
Figure;
Fig. 3 is the instantiation figure of the data packet recorded in the first subregion and the second partitioned organization in the embodiment of the present invention;
Fig. 4 is the specific reality that input-output record device includes record buffer and pause buffer in the embodiment of the present invention
Illustration;
Fig. 5 is the schematic diagram of input-output record method in the embodiment of the present invention;
Fig. 6 is the schematic diagram of central processing unit in the embodiment of the present invention;
Fig. 7 is the schematic diagram of the data read-write operation method of central processing unit in the embodiment of the present invention;
Fig. 8 is the schematic block diagram that the system of the electronic equipment of the embodiment of the present invention is constituted.
Specific implementation mode
Understand in order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the accompanying drawings to this hair
Bright embodiment is described in further details.Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but simultaneously
It is not as a limitation of the invention.
Hardware security is the foundation stone of software security.All software security implementation methods are all based on the believable vacation of hardware
If that is, hardware should work according to behavior defined in its handbook.Majority of case is in design link, manufacture ring at present
Section carries out performance detection to hardware, is in the system for appear in user with the appearance of flight data recorder (unlike soft after being dispatched from the factory due to hardware
Part wooden horse, code are present in system, can be read and analyze), the behavior of hardware is it is difficult to monitoring or perception.
Further, since being difficult to judge the reasonability of hardware behavior, currently without the research for hardware security.
The input-output record device that the embodiment of the present invention proposes, can be read with the data between accurate recording CPU and peripheral hardware
Write operation, in order to later use, the record is detected hardware security, solves the problems, such as hardware security.Fig. 1 is the present invention
The schematic diagram of input-output record device in embodiment.As shown in Figure 1, the input-output record device 101 of the embodiment of the present invention
It is set between CPU 102 and peripheral hardware 103, for recording the data read-write operation between CPU 102 and peripheral hardware 103, the data
Read-write operation includes the data read-write operation that the data read-write operation that peripheral hardware 103 is initiated and CPU 102 are initiated.Wherein, it inputs defeated
Go out recording device 101 and be additionally operable to the data read-write operation that the request processing peripheral hardwares 103 of CPU 102 are initiated, and receives CPU
When the instruction of 102 transmissions, the data packet for the data read-write operation that peripheral hardware 103 is initiated is sent to CPU 102.
As described above, input-output record device is set between CPU and peripheral hardware.In the particular embodiment, it inputs defeated
Going out recording device can integrate with CPU core.In such cases, input-output record device is set to CPU and peripheral hardware
Between refer to that input-output record device is set between CPU core and peripheral hardware.Certainly, input-output record device can also
It is embodied as the chip independently of CPU, or is also implemented as other device forms, this is not limited by the present invention.For example,
Can be integrated on the same chip by the input-output record device part of functions of the embodiment of the present invention and CPU, and it is remaining
Other functions realization be independent chip, these change case should all fall into protection scope of the present invention.
Input-output record device records the data read-write operation that CPU is initiated, and also records the reading and writing data behaviour that peripheral hardware is initiated
Make.Wherein, the data read-write operation of CPU initiations for example may include:MMIO (Memory mapped I/O, memory mapping input
Output) etc. types data read-write operation;Peripheral hardware initiate data read-write operation for example may include:DMA(Direct
Memory Access, direct memory access), the data read-write operations of the types such as P2P (Peer to Peer, communication between devices).
It should be understood that the embodiment of the present invention only records the P2P data read-write operations by CPU, without recording without CPU's
P2P data read-write operations.For the data read-write operation that CPU is initiated, input-output record device is recorded.Peripheral hardware is sent out
The data read-write operation risen, what is initiated due to peripheral hardware is asynchronous data read-write operation, may bring uncertain influence, no
Conducive to the input and output safety detection of CPU.In embodiments of the present invention, the data read-write operation initiated for peripheral hardware, input are defeated
Go out recording device other than being recorded, the data read-write operation that can also ask CPU processing peripheral hardwares to be initiated is receiving CPU
When the instruction of transmission, then the data packet of data read-write operation that peripheral hardware is initiated is sent to CPU.In this way, input-output record fills
Setting can cooperate with processor, between the asynchronous data read-write operation of instruction execution is synchronized to instruction, to eliminate peripheral hardware
The uncertain influence that the asynchronous data read-write operation of initiation is brought, basis is provided for the input and output safety detection of CPU.
When it is implemented, input-output record device receive peripheral hardware initiation data read-write operation data packet after,
The data read-write operation for storing the data packet for the data read-write operation that peripheral hardware is initiated, and CPU processing peripheral hardwares being asked to be initiated.Wherein,
When the data packet for the data read-write operation that input-output record device can be initiated in the peripheral hardware stored reaches predetermined threshold value, ask
The data read-write operation for asking CPU processing peripheral hardwares to initiate.Certainly, the data that input-output record device is initiated in the peripheral hardware of storage are read
As an example of the data packet of write operation initiates request only when reaching predetermined threshold value to CPU, it can also be arranged according to actual demand and be inputted
Other conditions from request to CPU or opportunity that recording device initiates are exported, this is not limited by the present invention.For example, input and output are remembered
Recording device can also be asked when often receiving and storing the data packet of data read-write operation of peripheral hardware initiation to CPU initiations
It asks, these change case should all fall into protection scope of the present invention.It is read relative to the data that a peripheral hardware is initiated often are received and stored
The data packet of write operation is for initiating the scheme asked to CPU, in the data for the data read-write operation that the peripheral hardware of storage is initiated
It initiates to ask to CPU again when packet reaches predetermined threshold value, can causing CPU to avoid frequent initiation request, over-burden, accelerates CPU's
Response speed.
When it is implemented, the data that various ways request CPU processing peripheral hardwares are initiated may be used in input-output record device
Read-write operation.For example, input-output record device sends a notification message to CPU, ask CPU processing outer by the notification message
If the data read-write operation initiated.Certainly, the data read-write operation that CPU processing peripheral hardwares are initiated is asked in the form of notification message only
As an example of, those skilled in the art can show that some change case, these change case should all fall into the protection model of the present invention accordingly
It encloses.For example, input-output record device can use the mode interrupted, the data read-write operation that request CPU processing peripheral hardwares are initiated.
Input-output record device keeps in the number for the data read-write operation that peripheral hardware is initiated after the data read-write operation for receiving peripheral hardware initiation
According to packet, interrupt requests, the data read-write operation that request CPU processing peripheral hardwares are initiated are sent to CPU.CPU is receiving interrupt requests
Afterwards, pause executes current instruction stream, records the data read-write operation of the current location of instruction and the initiation of pending peripheral hardware, to
Input-output record device sends instruction.It should be understood that the priority that the embodiment of the present invention does not limit the above action execution is suitable
Sequence.The data packet for the data read-write operation that peripheral hardware is initiated is sent to by input-output record device after the instruction for receiving CPU
CPU, CPU can restore to execute after completing the data read-write operation that peripheral hardware is initiated according to the current instruction position of aforementioned record
Instruction stream.
Input-output record device can all record the data read-write operation between CPU and peripheral hardware.Certainly, exist
In other embodiments, input-output record device selectively can also only record a part of data between CPU and peripheral hardware
Read-write operation.Any recorded as the partial data read-write operation between selection CPU and peripheral hardware, input-output record device can
To preset some conditions or rule, or it can also be randomly chosen record, this is not limited by the present invention.As an example, it inputs
Output device can be preset:The only data read-write operation between record CPU and certain peripheral hardwares, in such cases, input and output note
Recording device can first get the mark of peripheral hardware involved by the data read-write operation when CPU or peripheral hardware initiate data read-write operation
Know, and is determined whether according to the mark of the peripheral hardware of acquisition to record the data read-write operation.Specifically, the peripheral hardware of acquisition can be checked
Identify whether identified for preset peripheral hardware, preset peripheral hardware mark, which corresponds to, to be needed to record the reading and writing data between CPU and grasps
The peripheral hardware of work needs to record the data read-write operation between CPU and the peripheral hardware if it is, determining.
For the data read-write operation that the CPU data read-write operations initiated and peripheral hardware are initiated, input-output record device will
Using different processing modes, therefore input-output record device is in the number for receiving the data read-write operation between CPU and peripheral hardware
After packet, need to judge to be the data read-write operation that CPU is initiated or the data read-write operation that peripheral hardware is initiated.Specific judgement side
Formula can there are many, this is not limited by the present invention.For example, the data of data read-write operation that can be between CPU and peripheral hardware
Packet one transaction ID of setting, the transaction ID can be used for the initiator of mark data read-write operation.Input-output record device can
The transaction ID in data packet to get the data read-write operation between CPU and peripheral hardware, and determined according to the transaction ID
Whether data read-write operation between CPU and peripheral hardware is data read-write operation that peripheral hardware is initiated.Those skilled in the art can evidence
This obtains some change case, these change case should all fall into protection scope of the present invention.As described above, input-output record device
After determining that the data read-write operation between CPU and peripheral hardware is the data read-write operation that peripheral hardware is initiated, request CPU processing peripheral hardware hairs
The data read-write operation risen, and when receiving the instruction of CPU transmissions, the data packet for the data read-write operation that peripheral hardware is initiated
It is sent to CPU, the uncertain influence that the asynchronous data read-write operation to eliminate peripheral hardware initiation is brought.
In the particular embodiment, it is searched for the ease of input-output record device between stored CPU and peripheral hardware
The data packet of data read-write operation, as shown in Fig. 2, may include in input-output record device 101:First subregion 201 is used
The data packet of CPU is flowed to by peripheral hardware in record;Second subregion 202, for recording the data packet for flowing to peripheral hardware by CPU.In Fig. 2
In, with indicate to be recorded to upward arrow be the data packet that CPU is flowed to by peripheral hardware in the first subregion 202, in the second subregion 202 with
What down arrow indicated to be recorded is the data packet that peripheral hardware is flowed to by CPU.
Further, inventor is it is considered that if grasp the reading and writing data between CPU and peripheral hardware according to the flow direction of data packet
The data packet of work is separately recorded in the first subregion and the second subregion, due to peripheral hardware initiate data read-write operation asynchronism, with
And other possible hash packets (such as system information is miscellaneous), the data recorded in the first subregion and the second subregion can be caused
Information mixes, and retrieval complexity increases, it is difficult to efficiently obtain the data entries of needs.Therefore, it is imitated to promote data retrieval
Rate, in the particular embodiment, input-output record device is according to the class record of read-write operation and tissue recorded data
Packet.Specifically, organizing the data for flowing to CPU by peripheral hardware recorded according to the type of data read-write operation in the first subregion
Packet organizes the data packet that peripheral hardware is flowed to by CPU recorded according to the type of data read-write operation in the second subregion, so as to
In promotion data search efficiency.
Fig. 3 is the instantiation figure of the data packet recorded in the first subregion and the second partitioned organization in the embodiment of the present invention.
As shown in figure 3, in this example, the first subregion and the second subregion include 4 sub-regions.Wherein, the first subregion includes:For remembering
Record MMIO types, flowed to by peripheral hardware CPU data packet the first subregion, indicated in figure 3 with digital 1;For recording DMA
Type, flowed to by peripheral hardware CPU data packet the second subregion, indicated in figure 3 with number 2;For record P2P types,
The third subregion of the data packet of CPU is flowed to by peripheral hardware, is indicated in figure 3 with number 3;For recording except MMIO types, DMA
Other than type and P2P types, the 4th subregion of other data packets that CPU is flowed to by peripheral hardware is indicated with number 4 in figure 3.
Second subregion includes:For record MMIO types, flowed to by CPU peripheral hardware data packet the 5th subregion, in figure 3 use number
5 indicate;For record DMA types, flowed to by CPU peripheral hardware data packet the 6th subregion, in figure 3 with number 6 come table
Show;For record P2P types, flowed to by CPU peripheral hardware data packet the 7th subregion, indicated in figure 3 with number 7;With
In record in addition to MMIO types, DMA types and P2P types, the 8th subregion of other data packets that peripheral hardware is flowed to by CPU,
It is indicated in figure 3 with number 8.
It is above-mentioned it is other in addition to MMIO types, DMA types and P2P types the data packet of CPU is flowed to by peripheral hardware, and remove
Other data packets that peripheral hardware is flowed to by CPU other than MMIO types, DMA types and P2P types, can be denoted as Misc, such as can wrap
It is miscellaneous to include system information etc..It should be understood that the division of above first subregion to the 8th subregion is in logic, not require
Division on physical address.It will also be appreciated that the present invention does not limit the data packet storage of MMIO, DMA, P2P and Misc type
Sequence between subregion, such as it can be recorded in addition to MMIO types, DMA types and P2P types in the first subregion
It is flowed to the data packet of CPU by peripheral hardware.Respectively according to the type of read-write operation come a group organization data in first subregion and the second subregion,
Corresponding information, this number can be directly read when needing in this way from corresponding data structure in the first subregion and the second subregion
According to the mode of record and tissue, data search efficiency can be greatly promoted, and then the letter that later use records in this way can be promoted
Breath carries out the efficiency of CPU safety detections.It will also be appreciated that with the development of technology, the read-write operation type in processor can
It can change, the read-write operation to be paid close attention to of safety detection also can accordingly change, therefore the organizational form of data
It can respective change.Without departing from the spirit of the present invention and the change case of objective, the protection model in the embodiment of the present invention should be all fallen
In enclosing.
In specific embodiment, the data packet that CPU is flowed to by peripheral hardware can be recorded successively in chronological order in the first subregion;
The data packet that peripheral hardware is flowed to by CPU can be recorded successively in chronological order in the second subregion.Record data successively in chronological order
Packet can further promote data search efficiency in order to lookup in the future.It is appreciated that recording data packet successively in chronological order
It is also a specific example, those skilled in the art can also obtain other change case accordingly, for example, it can be set to other
Packet data recording sequence or rule, this equally should also fall into protection scope of the present invention.
In specific example, division in logic can also be carried out to input-output record device, in order to its difference
The efficient execution of function.For example, in the example shown in Figure 4, input-output record device 101 may include:Record buffer
(Trace Buffer) 401 and pause buffer (Pause Buffer) 402.Record buffer 401 for record CPU 102 with
Data read-write operation between peripheral hardware 103, data read-write operation include the data read-write operation that peripheral hardware 103 is initiated and CPU102 hairs
The data read-write operation risen.Pause buffer 402 is used to that CPU 102 to be asked to handle the data read-write operation that peripheral hardware 103 is initiated, with
And when receiving the instruction of CPU102 transmissions, grasped by the reading and writing data that record buffer 401 initiates temporary peripheral hardware 103
The data packet of work is sent to CPU 102, so that record buffer 401 is able to record the data read-write operation that peripheral hardware 103 is initiated.Or
Person, the data read-write operation initiated by record buffer record CPU, the reading and writing data behaviour that pause buffer record peripheral hardware is initiated
Make, the data read-write operation that pause buffer request CPU processing peripheral hardwares are initiated is about to certainly when receiving the instruction of CPU transmissions
The data packet for the data read-write operation that the peripheral hardware of record is initiated is sent to CPU.
It is appreciated that realizing that the function of input-output record device is drawn for record buffer and pause buffer in this example
Record buffer and pause can not also be respectively set in point only differentiation in logic, when implementation in input-output record device
Buffer.For another example, input-output record device can be divided into two buffers, be respectively used to the number that record CPU 102 is initiated
The data read-write operation initiated according to read-write operation and peripheral hardware 103.Wherein, the data read-write operation for recording the initiation of peripheral hardware 103
Buffer, be additionally operable to keep in/buffer the data packet received, CPU sent data packets to again after being connected to the instruction of CPU 102
102.The embodiment of these variations should all fall into protection scope of the present invention.
Based on same inventive concept, a kind of input-output record method is additionally provided in the embodiment of the present invention, it is such as following
Described in embodiment.Since the principle that input-output record method solves the problems, such as is similar to input-output record device, input
The implementation of output recording method may refer to the implementation of input-output record device, and overlaps will not be repeated.
Fig. 5 is the schematic diagram of input-output record method in the embodiment of the present invention, as shown in figure 5, this method may include:
Step 501, the data read-write operation between CPU and peripheral hardware is recorded, wherein data read-write operation includes that peripheral hardware is initiated
Data read-write operation and CPU initiate data read-write operation;
Step 502, the data read-write operation that request CPU processing peripheral hardware is initiated, and in the instruction for receiving CPU transmissions
When, the data packet for the data read-write operation that peripheral hardware is initiated is sent to CPU.
It should be understood that in the specific implementation, the embodiment of the present invention does not limit step 501 and the execution of step 502 is suitable
Sequence.For example, for the data read-write operation that CPU is initiated, input-output record device only keeps a record without doing other processing.And it is right
In the data read-write operation that peripheral hardware is initiated, the data read-write operation of peripheral hardware initiation can be first recorded, then CPU is asked to handle the peripheral hardware
The data read-write operation of initiation;Alternatively, after CPU can also be asked to handle, the data of this peripheral hardware initiation handled of CPU are re-recorded
Read-write operation.These change case should also fall into protection scope of the present invention.
As previously mentioned, in the particular embodiment, the data read-write operation that request CPU processing peripheral hardwares are initiated may include:
When the data packet for the data read-write operation that the peripheral hardware of storage is initiated reaches predetermined threshold value, the number of request CPU processing peripheral hardware initiations
According to read-write operation.
As previously mentioned, in the particular embodiment, the data read-write operation that request CPU processing peripheral hardwares are initiated may include:
Use the mode of interruption, the data read-write operation of request CPU processing peripheral hardware initiations.
As previously mentioned, in the particular embodiment, input-output record method can also include:The mark of peripheral hardware is obtained,
And determined whether to record the data read-write operation between CPU and the peripheral hardware according to the mark of peripheral hardware.
As previously mentioned, in the particular embodiment, input-output record method can also include:Obtain CPU and peripheral hardware it
Between data read-write operation data packet in transaction ID, and according to transaction ID determine the data between CPU and peripheral hardware read
Write operation whether be peripheral hardware initiate data read-write operation.
As previously mentioned, in the particular embodiment, recording the data read-write operation between CPU and peripheral hardware, may include:Note
Record flows to the data packet of CPU by peripheral hardware and flows to the data packet of peripheral hardware by CPU.Wherein, according to the type of data read-write operation, group
Knit recorded the data packet of CPU flowed to by peripheral hardware and flow to the data packet of peripheral hardware by CPU.
As previously mentioned, in the particular embodiment, according to the type of data read-write operation, organize to be recorded by peripheral hardware stream
The data packet that peripheral hardware is flowed to the data packet of CPU and by CPU may include:Respectively press MMIO types, DMA types, P2P types,
And the type in addition to MMIO, DMA and P2P, what tissue was recorded is flowed to the data packet of CPU by peripheral hardware and is flowed to by CPU outer
If data packet.
As previously mentioned, in the particular embodiment, record flows to the data packet of CPU by peripheral hardware and flows to peripheral hardware by CPU
Data packet may include:Record the data that the data packet of CPU is flowed to by peripheral hardware and flows to peripheral hardware by CPU successively in chronological order
Packet.
Based on same inventive concept, a kind of central processing unit, such as the following examples are additionally provided in the embodiment of the present invention
It is described.Since the principle that central processing unit solves the problems, such as is opposite with aforementioned input-output record device, input-output record method
It answers, therefore the implementation of central processing unit may refer to the implementation of aforementioned input-output record device, input-output record method, weight
Multiple place repeats no more.
Fig. 6 is the schematic diagram of central processing unit in the embodiment of the present invention, as shown in fig. 6, the central processing unit may include:
Request processing module 601, for when receiving the request of input-output record device transmission, pause to execute current
Instruction stream;
It indicates sending module 602, is indicated for being sent to the input-output record device, to indicate the input and output
Recording device sends the data packet of the pending data read-write operation;
Data processing module 603 is read for receiving the pending data that the input-output record device is sent
The data packet of write operation, and complete the pending data read-write operation.
It should be understood that the data read-write operation that pending peripheral hardware is initiated refers to being handled after CPU this pause
The data read-write operation that peripheral hardware is initiated.For example, after receiving the interrupt requests that input-output record device is sent, CPU can be looked into
It sees in current input-output record device and has kept in the data read-write operation that how many peripheral hardwares are initiated, and select wherein at least a part of
The data read-write operation that peripheral hardware is initiated is handled, and (this selected partial data read-write operation, which is that the present invention is so-called, to be waited locating
The data read-write operation of reason).In one embodiment, when the pause of request processing module 601 executes current instruction stream, Ke Yi
After CPU has executed current instruction, pause executes next instruction.In another embodiment, CPU can be according to predefined plan
The pause on some opportunity is slightly selected to execute instruction stream.
In one embodiment, request processing module 601 is additionally operable to record the current location of instruction and pending data
Read-write operation, the data read-write operation is the data read-write operation that peripheral hardware is initiated, in order to subsequent safety detection.It should be understood that
, CPU can select to be recorded in when recording the data read-write operation that the current location of instruction and pending peripheral hardware are initiated
It in local storage or is recorded in input-output record device, the embodiment of the present invention is not construed as limiting this.
For example, the current location of instruction and pending data read-write operation can be sent to by CPU in indicating information
Input-output record device, so as to recorded in recording device the current location of instruction and pending data read-write operation (or
Person says, the data read-write operation of this processing).Daily record (log) may be used to record the current location of instruction and pending in CPU
Data read-write operation, naturally it is also possible to the current location of instruction and pending reading and writing data are recorded using other manner and grasped
Make, this is not limited by the present invention.Type (such as DMA or P2P classes of pending data read-write operation can be recorded when implementation
Type), the particular content of pending data read-write operation can also be recorded, such as read operation or write operation, the address etc. of read-write.
It will also be appreciated that the current location of instruction and pending data read-write operation can be recorded by input-output record device,
These change case should be all within the scope of the present invention.
It will also be appreciated that when aforementioned pending data read-write operation includes multiple data read-write operations, CPU can be with
The sequencing of processing is indicated in indicating information, and record processing is suitable while recording pending data read-write operation
Sequence.Those skilled in the art can show that some change case, these change case should all fall into protection scope of the present invention accordingly.
In one embodiment, request processing module 601 is additionally operable to record the current location of instruction and pending data
Read-write operation, the data read-write operation are the data read-write operation that peripheral hardware is initiated.For example, the pause of request processing module 601 is held
Instruction stream before the trade, and after recording the current location of instruction and pending data read-write operation, then indicate sending module to
Input-output record device sends instruction, to indicate that input-output record device sends the data of pending data read-write operation
Packet.In this way, can be obtained in detection device operational process and execute corresponding data read-write operation according to the record, so as to follow-up
Carry out safety judgement.
The method that safety detection is exemplified below.According to processor object run process initial operating state information
The initial operating state of detection device is set, processor is entered information as into the defeated of detection device during object run
Enter information.Make task of the detection device in a manner of meeting deterministic behavior in performance objective operational process, obtains detection device
Output information and/or terminate running state information.Wherein, deterministic behavior is the hardware behavioral standard of processor.When described
When detection device has executed the task during the object run, according to the output information of detection device and/or operation is terminated
Status information determines whether processor is safe during object run.Wherein, make detection device performance objective operational process
In task when, need to execute corresponding data according to the location of instruction of aforementioned record and pending data read-write operation and read
Write operation.
When aforementioned pending data read-write operation only includes a data read-write operation, instruction sending module instruction is defeated
Enter to export the data packet that recording device sends aforementioned pending data read-write operation.In other embodiments, it is waited for when aforementioned
When the data read-write operation of processing includes multiple data read-write operations, instruction sending module instruction input-output record device is sequentially
The data packet of pending data read-write operation is sent one by one.In this way, CPU can sequentially handle multiple data read-write operation.
It should be understood that the embodiment of the present invention does not limit request processing module 601 and indicates each step performed by sending module 602
Rapid sequencing.For example, when CPU determines the reading and writing data request that processing peripheral hardware is initiated, request processing module 601 can first be remembered
The current location of instruction and pending data read-write operation are recorded, then suspends and executes current instruction stream.Meanwhile it indicating to send mould
Block 602 can send to the input-output record device and indicate, to indicate that the input-output record device waits for described in sending
The data packet of the data read-write operation of processing.
It is a kind of it might be that pending data read-write operation includes multiple data read-write operations, instruction sends mould
Block 602 divides indicates that input-output record device sends the data packet of pending data read-write operation several times.For example, instruction is sent
For module 602 when first time sending instruction, instruction input-output record device sends the number of wherein a few a data read-write operations
According to packet, when sending instruction second, instruction input-output record device sends the data packet of remaining several data read-write operations.
Which, as the data packet for sending data read-write operation, can be notified by way of carrying mark in the instruction in transmission
Input-output record device.It is indicated several times for point, indicates which input-output record device sends in the instruction sent every time
The data packet of several data read-write operations can have various change example, and this is not limited by the present invention.
Indicate that sending module 602 can indicate that input-output record device sends all numbers that the peripheral hardware wherein stored is initiated
According to the data packet of read-write operation.In other embodiments, it can also be sent to input-output record device according to processing strategy
Instruction to indicate that input-output record device sends the data packet of selected pending data read-write operation, and will input defeated
Go out the storage in recording device other data read-write operations stay in next time interrupt after reprocess.Processor strategy can by with
Family is default, also can be by CPU according to current load real-time selection, and the embodiment of the present invention is not construed as limiting this.
After indicating that sending module 602 sends instruction to input-output record device, it is defeated that data processing module 603 receives input
Go out the data packet of the pending data read-write operation of recording device transmission, and completes pending data read-write operation.Wherein,
The data packet for the pending data read-write operation that data processing module 603 receives can be the data for including data content
Packet.Include data to be written in data packet for example, in the case where pending data read-write operation is data write operation
Content.The data packet for the pending data read-write operation that data processing module receives can also be request/request respond style
Data packet.For example, in the case where pending data read-write operation is data reading operation, the number of data processing module reception
It is read request data packet according to packet, does not include data content in data packet.
It should be understood that in different communication protocol, the signaling process of data read-write operation may be different.It illustrates below
Illustrate that data processing module 603 under a kind of signaling process handles the flow of data read-write operation, it should be understood that the present invention is implemented
Example is not limited to this.
For example, the data read-write operation that peripheral hardware is initiated may include the data read-write operation of the types such as DMA and P2P.For
The data write operation of DMA types, data processing module 603 need after receiving the data packet of data write operation of DMA types
Memory is written into data content in data packet.For the data reading operation of DMA types, data processing module is receiving DMA
After the request data package of the data reading operation of type, a read request response data packet can be first sent, then read from memory
Data content, and the data content read to peripheral hardware feedback.Data processing module to peripheral hardware feedback read data content when,
These data contents will be entered output recording device records.
For another example, for the data write operation of P2P types, data processing module 603 writes behaviour in the data for receiving P2P types
After the data packet of work, the other peripheral hardwares of target are written into the data content in data packet.For the data reading operation of P2P types, number
According to processing module 603 after receiving the data packet of data reading operation of P2P types, the reading of target peripheral can first be forwarded to respond
Then request data package reads data content from target peripheral, to the peripheral hardware feedback for initiating request.Wherein, data processing mould
For block when with peripheral hardware interaction data content, these data contents can be entered output recording device records.For MMIO types
Data read-write operation, signaling process is similar with the above signaling process, and to avoid repeating, details are not described herein.Data processing
Module 603 can be restored to execute instruction stream with request processing module after completing pending data read-write operation.
Based on same inventive concept, a kind of data read-write operation side of central processing unit is additionally provided in the embodiment of the present invention
Method, as described in the following examples.The principle and centre solved the problems, such as due to the data read-write operation method of central processing unit
It is corresponding to manage device, therefore the implementation of the data read-write operation method of central processing unit may refer to the reality of premise central processor
It applies, overlaps will not be repeated.
Fig. 7 is the schematic diagram of the data read-write operation method of central processing unit in the embodiment of the present invention, as shown in fig. 7, should
Method may include:
Step 701, when receiving the request of input-output record device transmission, pause executes current instruction stream;
Step 702, it sends and indicates to input-output record device, to indicate that it is pending that input-output record device is sent
The data packet of data read-write operation;
Step 703, the data packet for the pending data read-write operation that input-output record device is sent is received, and is completed
Pending data read-write operation.
As previously mentioned, in the particular embodiment, also to record the current location of instruction and pending reading and writing data behaviour
Make, data read-write operation is the data read-write operation that peripheral hardware is initiated.In this way, simultaneously foundation can be obtained in detection device operational process
The record executes corresponding data read-write operation, subsequently to carry out safety judgement.
As previously mentioned, in the particular embodiment, sending and indicating to input-output record device, to indicate that input and output are remembered
Recording device sends the data packet of pending data read-write operation, may include:When pending data read-write operation includes more
When a data read-write operation, instruction input-output record device sequentially sends the data of pending data read-write operation one by one
Packet.
As previously mentioned, in the particular embodiment, sending and indicating to input-output record device, to indicate that input and output are remembered
Recording device sends the data packet of the pending data read-write operation, may include:It is defeated to the input according to processing strategy
Go out recording device and send instruction, is grasped with indicating that the input-output record device sends the selected pending reading and writing data
The data packet of work.
As previously mentioned, in the particular embodiment, pending data read-write operation may include:DMA and/or P2P classes
The data read-write operation of type.
As previously mentioned, in the particular embodiment, the data read-write operation method of central processing unit can also include:Complete
After pending data read-write operation, restore to execute described instruction stream.
In conclusion in the embodiment of the present invention, input-output record device is set between CPU and peripheral hardware, for recording
Data read-write operation between CPU and peripheral hardware, including the reading and writing data that the data read-write operation of peripheral hardware initiation and CPU are initiated are grasped
Make.To accurately record the data read-write operation between CPU and peripheral hardware, convenient for the data between later use CPU and peripheral hardware
Read-write operation record is detected the safety of CPU hardware.Also, input-output record device is additionally operable to request CPU processing
Peripheral hardware initiate data read-write operation, and receive CPU transmission instruction when, then by peripheral hardware initiate data read-write operation
Data packet be sent to CPU, and then eliminate that the asynchronous data read-write operation that peripheral hardware is initiated brings it is uncertain influence, be CPU
Input and output safety detection provide the foundation.
In the embodiment of the present invention, central processing unit when receiving the request of input-output record device transmission, hold by pause
Instruction stream before the trade, and send and indicate to the input-output record device, to indicate that the input-output record device is sent out
Send the data packet of the pending data read-write operation.Then, the described of input-output record device transmission is received to wait for
The data packet of the data read-write operation of processing, and complete the pending data read-write operation.Therefore, peripheral hardware hair can be eliminated
The uncertain influence that the asynchronous data read-write operation risen is brought, provides the foundation for the input and output safety detection of CPU.
Fig. 8 is the schematic block diagram that the system of the electronic equipment of the embodiment of the present invention is constituted.As shown in figure 8, the electronic equipment
May include processor 801 and memory 802, memory 802 is coupled to processor 801.It is worth noting that, the figure is example
Property, the supplement or alternative structure can also be carried out using other kinds of structure, to realize communication, detection function or other work(
Energy.
In one embodiment, processor 801 can integrate the function of aforementioned input-output record device, such as can be by
It is configured to carry out control as follows:The data read-write operation between CPU and peripheral hardware is recorded, the data read-write operation includes described outer
If the data read-write operation that the data read-write operation and the CPU initiated are initiated;The CPU is asked to handle what the peripheral hardware was initiated
Data read-write operation, and when receiving the instruction that the CPU is sent, the number for the data read-write operation that the peripheral hardware is initiated
It is sent to the CPU according to packet.
Wherein, the request CPU handles the data read-write operation that the peripheral hardware is initiated, including:Described in storage
When the data packet for the data read-write operation that peripheral hardware is initiated reaches predetermined threshold value, the CPU is asked to handle the number that the peripheral hardware is initiated
According to read-write operation.
Wherein, the request CPU handles the data read-write operation that the peripheral hardware is initiated, including:Use the side of interruption
Formula asks the CPU to handle the data read-write operation that the peripheral hardware is initiated.
Wherein, processor 801 can be additionally configured to carry out control as follows:The mark of the peripheral hardware is obtained, and according to institute
The mark for stating peripheral hardware determines whether to record the data read-write operation between the CPU and the peripheral hardware.
Wherein, processor 801 can be additionally configured to carry out control as follows:It obtains between the CPU and the peripheral hardware
Transaction ID in the data packet of data read-write operation, and determined between the CPU and the peripheral hardware according to the transaction ID
Data read-write operation whether be data read-write operation that the peripheral hardware is initiated.
Wherein, the data read-write operation between the record CPU and peripheral hardware, including:Record is described in peripheral hardware flow direction
The data packet of CPU and the data packet that the peripheral hardware is flowed to by the CPU;Wherein, according to the type of data read-write operation, institute is organized
Record flows to the data packet of the CPU by the peripheral hardware and flows to the data packet of the peripheral hardware by the CPU.
Wherein, the type according to data read-write operation organizes the number that the CPU is flowed to by the peripheral hardware recorded
The data packet of the peripheral hardware is flowed to according to packet and by the CPU, including:Respectively press MMIO types, DMA types, P2P types and
Type in addition to MMIO, DMA and P2P organizes what is recorded to flow to the data packet of the CPU by the peripheral hardware and by described
CPU flows to the data packet of the peripheral hardware.
Wherein, the record flows to the data packet of the CPU by the peripheral hardware and flows to the number of the peripheral hardware by the CPU
According to packet, including:It records successively in chronological order and the data packet of the CPU is flowed to by the peripheral hardware and described in CPU flow directions
The data packet of peripheral hardware.
In another embodiment, input-output record device can be with 801 separate configuration of processor, such as can will be defeated
Enter to export recording device and be configured to the chip being connect with processor 801, realizes that input and output are remembered by the control of processor 801
The function of recording device.
As shown in figure 8, the electronic equipment can also include:Input unit 803, display unit 804 and power supply 805.It is worth
It is noted that the electronic equipment is also not necessary to include all components shown in fig. 8.In addition, electronic equipment can be with
Including the component being not shown in Fig. 8, the prior art can be referred to.
As shown in figure 8, processor 801 be otherwise referred to as controller or operational controls, may include microprocessor or other
Processor device and/or logic device, the processor 801 receive the operation of all parts of input and control electronics.
Wherein, memory 802 for example can be buffer, flash memory, hard disk driver, removable medium, volatile memory, it is non-easily
It is one or more in the property lost memory or other appropriate devices, configuration information, the processor of above-mentioned processor 801 can be stored
It is one or more in the information such as the instruction of 801 execution, the information of record.Processor 801 can execute the storage of memory 802
Program, to realize information storage or processing etc..In one embodiment, further include buffer storage in memory 802, that is, buffer
Device, to store average information.
Input unit 803 for example can be press key input device or touch input device, it is defeated for being provided to processor 801
Enter.Display unit 804 is used to carry out the display that image or word etc. show object, which for example can be that LCD is shown
Device, but the present invention is not limited thereto.Power supply 805 is used to provide electric power to electronic equipment.
The embodiment of the present invention also provides a kind of computer-readable instruction, wherein when executing described instruction in the electronic device
When, described program makes electronic equipment execute input-output record method as shown in Figure 5.
The embodiment of the present invention also provides a kind of storage medium being stored with computer-readable instruction, wherein the computer can
Reading instruction makes electronic equipment execute input-output record method as shown in Figure 5.
The embodiment of the present invention additionally provides a kind of electronic equipment, which can be desktop computer etc., this implementation
Example is without being limited thereto.In the present embodiment, the Each part of the electronic equipment is identical as electronic equipment shown in Fig. 8, electronic equipment
The function that middle processor 801 can be completed be referred to the data read-write operation method of central processing unit shown in Fig. 7 implementation and
The implementation of central processing unit shown in Fig. 6, content are incorporated in this, and overlaps will not be repeated.
In one embodiment, processor 801 can integrate the function of premise central processor, such as can be configured as
It carries out control as follows:When receiving the request of input-output record device transmission, pause executes current instruction stream;To described defeated
Enter to export recording device and send instruction, to indicate that the input-output record device sends the number of pending data read-write operation
According to packet;The data packet for the pending data read-write operation that the input-output record device is sent is received, and completes institute
State pending data read-write operation.
Wherein, processor 801 can be additionally configured to carry out control as follows:Record the current location of instruction and pending
Data read-write operation, the data read-write operation are the data read-write operation that peripheral hardware is initiated.
Wherein, described sent to the input-output record device indicates, to indicate that the input-output record device is sent out
The data packet of the pending data read-write operation is sent, including:When the pending data read-write operation includes multiple numbers
When according to read-write operation, indicate that the input-output record device sequentially sends the number of the pending data read-write operation one by one
According to packet.
Wherein, described sent to the input-output record device indicates, to indicate that the input-output record device is sent out
The data packet of the pending data read-write operation is sent, including:It is sent out to the input-output record device according to processing strategy
Instruction is sent, to indicate that the input-output record device sends the data packet of the selected pending data read-write operation.
Wherein, the pending data read-write operation includes:The data read-write operation of DMA and/or P2P types.
Wherein, processor 801 can be additionally configured to carry out control as follows:Complete the pending reading and writing data behaviour
After work, restore to execute described instruction stream.
In another embodiment, central processing unit can be with 801 separate configuration of processor, such as can be by central processing
Device is configured to the chip being connect with processor 801, and the function of central processing unit is realized by the control of processor 801.
The embodiment of the present invention also provides a kind of computer-readable instruction, wherein when executing described instruction in the electronic device
When, described program makes electronic equipment execute the data read-write operation method of central processing unit as shown in Figure 7.
The embodiment of the present invention also provides a kind of storage medium being stored with computer-readable instruction, wherein the computer can
Reading instruction makes electronic equipment execute the data read-write operation method of central processing unit as shown in Figure 7.
Field those of ordinary skill is it is to be appreciated that unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, depends on the specific application and design constraint of technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.
It is apparent to those skilled in the art that for convenience of description and succinctly, foregoing description is
The specific work process of system, device and unit, can refer to corresponding processes in the foregoing method embodiment, details are not described herein.
In several embodiments provided herein, it should be understood that disclosed systems, devices and methods, it can be with
It realizes by another way.For example, the apparatus embodiments described above are merely exemplary, for example, the unit
It divides, only a kind of division of logic function, formula that in actual implementation, there may be another division manner, such as multiple units or component
It can be combined or can be integrated into another system, or some features can be ignored or not executed.In addition, shown or beg for
The mutual coupling, direct-coupling or communication connection of opinion can be the INDIRECT COUPLING by some interfaces, device or module
Or communication connection, can also be electricity, mechanical or other form connections.
The module illustrated as separating component may or may not be physically separated, aobvious as module
The component shown may or may not be physical module, you can be located at a place, or may be distributed over multiple
On network module.Some or all of module therein can be selected according to the actual needs to realize the embodiment of the present invention
Purpose.
In addition, each function module in each embodiment of the present invention can be integrated in a processing module, it can also
It is that modules physically exist alone, can also be that two or more modules are integrated in a module.It is above-mentioned integrated
The form that hardware had both may be used in module is realized, can also be realized in the form of software function module.
If the integrated module is realized in the form of software function module and sells or use as independent product
When, it can be stored in a computer read/write memory medium.Based on this understanding, technical scheme of the present invention is substantially
The all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other words
It embodies, which is stored in a storage medium, including some instructions are used so that a computer
Equipment (can be personal computer, server or the network equipment etc.) executes the complete of each embodiment the method for the present invention
Portion or part steps.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Particular embodiments described above has carried out further in detail the purpose of the present invention, technical solution and advantageous effect
Describe in detail it is bright, it should be understood that the above is only a specific embodiment of the present invention, the guarantor being not intended to limit the present invention
Range is protected, all within the spirits and principles of the present invention, any modification, equivalent substitution, improvement and etc. done should be included in this
Within the protection domain of invention.
Claims (30)
1. a kind of input-output record device, which is characterized in that
The input-output record device is set between central processor CPU and peripheral hardware, for record the CPU with it is described outer
If data read-write operation between, the data read-write operation include the data read-write operation and the CPU that the peripheral hardware is initiated
The data read-write operation of initiation;
Wherein, the input-output record device is additionally operable to that the CPU is asked to handle the data read-write operation that the peripheral hardware is initiated,
And when receiving the instruction that the CPU is sent, the data packet for the data read-write operation that the peripheral hardware is initiated is sent to institute
State CPU.
2. input-output record device as described in claim 1, which is characterized in that the input-output record device is specifically used
Reach default threshold in the data packet for the data read-write operation initiated when the peripheral hardware stored in the input-output record device
When value, the CPU is asked to handle the data read-write operation that the peripheral hardware is initiated.
3. input-output record device as described in claim 1, which is characterized in that the input-output record device is specifically used
In using the mode interrupted, the CPU is asked to handle the data read-write operation that the peripheral hardware is initiated.
4. input-output record device as described in claim 1, which is characterized in that the input-output record device is additionally operable to
The mark of the peripheral hardware is obtained, and determines whether to record the number between the CPU and the peripheral hardware according to the mark of the peripheral hardware
According to read-write operation.
5. input-output record device as described in claim 1, which is characterized in that the input-output record device is additionally operable to
The transaction ID in the data packet of the data read-write operation between the CPU and the peripheral hardware is obtained, and according to the trading standard
Know and determines whether the data read-write operation between the CPU and the peripheral hardware is data read-write operation that the peripheral hardware is initiated.
6. the input-output record device as described in any one of claim 1 to 5, which is characterized in that the input and output note
Recording device includes:
First subregion, for recording the data packet for flowing to the CPU by the peripheral hardware;
Second subregion, for recording the data packet for flowing to the peripheral hardware by the CPU.
7. input-output record device as claimed in claim 6, which is characterized in that the first subregion is specifically used for being read according to data
The type of write operation organizes the data packet that the CPU is flowed to by the peripheral hardware recorded;Second subregion is specifically used for according to number
According to the type of read-write operation, the data packet that the peripheral hardware is flowed to by the CPU recorded is organized.
8. input-output record device as claimed in claim 7, which is characterized in that the first subregion includes:
For record memory mapping input and output MMIO types, flowed to by the peripheral hardware CPU data packet the first sub-district
Domain;
For record direct memory access DMA types, flowed to by the peripheral hardware CPU data packet the second subregion;
For communicate P2P types between recording equipment, flowed to by the peripheral hardware CPU data packet third subregion;
For recording in addition to MMIO types, DMA types and P2P types, other data packets that the CPU is flowed to by the peripheral hardware
The 4th subregion;
Second subregion includes:
For record MMIO types, flowed to by the CPU peripheral hardware data packet the 5th subregion;
For record DMA types, flowed to by the CPU peripheral hardware data packet the 6th subregion;
For record P2P types, flowed to by the CPU peripheral hardware data packet the 7th subregion;
For recording in addition to MMIO types, DMA types and P2P types, other data packets that the peripheral hardware is flowed to by the CPU
The 8th subregion.
9. input-output record device as claimed in claim 6, which is characterized in that the first subregion is specifically used in chronological order
The data packet that the CPU is flowed to by the peripheral hardware is recorded successively;Second subregion is specifically used for being recorded successively in chronological order by institute
State the data packet that CPU flows to the peripheral hardware.
10. the input-output record device as described in any one of claim 1 to 5, which is characterized in that the input and output note
Recording device includes:
Record buffer, for recording the data read-write operation between the CPU and the peripheral hardware, the data read-write operation packet
Include the data read-write operation that the peripheral hardware is initiated and the data read-write operation that the CPU is initiated;
Suspend buffer, for asking the CPU to handle the data read-write operation that the peripheral hardware is initiated, and it is described receiving
When the instruction that CPU is sent, pass through the data packet for the data read-write operation that the record buffer initiates the temporary peripheral hardware
It is sent to the CPU.
11. a kind of input-output record method, which is characterized in that including:
The data read-write operation between CPU and peripheral hardware is recorded, the data read-write operation includes the data reading that the peripheral hardware is initiated
The data read-write operation that write operation and the CPU are initiated;
The CPU is asked to handle the data read-write operation that the peripheral hardware is initiated, and in the instruction for receiving the CPU transmissions
When, the data packet for the data read-write operation that the peripheral hardware is initiated is sent to the CPU.
12. input-output record method as claimed in claim 11, which is characterized in that described in the request CPU processing
The data read-write operation that peripheral hardware is initiated, including:
When the data packet for the data read-write operation that the peripheral hardware of storage is initiated reaches predetermined threshold value, the CPU processing is asked
The data read-write operation that the peripheral hardware is initiated.
13. input-output record method as claimed in claim 11, which is characterized in that described in the request CPU processing
The data read-write operation that peripheral hardware is initiated, including:
Using the mode of interruption, the CPU is asked to handle the data read-write operation that the peripheral hardware is initiated.
14. input-output record method as claimed in claim 11, which is characterized in that further include:
The mark of the peripheral hardware is obtained, and determines whether to record between the CPU and the peripheral hardware according to the mark of the peripheral hardware
Data read-write operation.
15. input-output record method as claimed in claim 11, which is characterized in that further include:
The transaction ID in the data packet of the data read-write operation between the CPU and the peripheral hardware is obtained, and according to the friendship
Easily mark determines whether the data read-write operation between the CPU and the peripheral hardware is that the reading and writing data that the peripheral hardware is initiated is grasped
Make.
16. the input-output record method as described in any one of claim 11 to 15, which is characterized in that the record CPU
Data read-write operation between peripheral hardware, including:
Record flows to the data packet of the CPU by the peripheral hardware and flows to the data packet of the peripheral hardware by the CPU;Wherein, root
According to the type of data read-write operation, what tissue was recorded is flowed to the data packet of the CPU by the peripheral hardware and is flowed to by the CPU
The data packet of the peripheral hardware.
17. input-output record method as claimed in claim 16, which is characterized in that the class according to data read-write operation
Type, what tissue was recorded flows to the data packet of the CPU by the peripheral hardware and flows to the data packet of the peripheral hardware by the CPU,
Including:
MMIO types, DMA types, P2P types and the type in addition to MMIO, DMA and P2P are pressed respectively, what tissue was recorded
The data packet of the CPU is flowed to by the peripheral hardware and flows to the data packet of the peripheral hardware by the CPU.
18. input-output record method as claimed in claim 16, which is characterized in that the record flows to institute by the peripheral hardware
It states the data packet of CPU and flows to the data packet of the peripheral hardware by the CPU, including:
It records successively in chronological order and the data packet of the CPU is flowed to by the peripheral hardware and the peripheral hardware is flowed to by the CPU
Data packet.
19. a kind of central processing unit, which is characterized in that including:
Request processing module, for when receiving the request of input-output record device transmission, pause to execute current instruction
Stream;
It indicates sending module, is indicated for being sent to the input-output record device, to indicate that the input-output record fills
Set the data packet for sending pending data read-write operation;
Data processing module, for receiving the pending data read-write operation that the input-output record device is sent
Data packet, and complete the pending data read-write operation.
20. central processing unit as claimed in claim 19, which is characterized in that it is current that the request processing module is additionally operable to record
The location of instruction and pending data read-write operation, the data read-write operation be peripheral hardware initiate data read-write operation.
21. central processing unit as claimed in claim 19, which is characterized in that the instruction sending module is specifically used for when described
When pending data read-write operation includes multiple data read-write operations, indicate that the input-output record device is sequentially sent out one by one
Send the data packet of the pending data read-write operation.
22. central processing unit as claimed in claim 19, which is characterized in that the instruction sending module is specifically used for according to place
Reason strategy is sent to the input-output record device to be indicated, with indicate the input-output record device send it is selected described in
The data packet of pending data read-write operation.
23. central processing unit as claimed in claim 19, which is characterized in that the pending data read-write operation includes:
The data read-write operation of DMA and/or P2P types.
24. such as claim 19 to 23 any one of them central processing unit, which is characterized in that the data processing module is also used
In:After completing the pending data read-write operation, restore to execute described instruction stream.
25. a kind of data read-write operation method of central processing unit, which is characterized in that including:
When receiving the request of input-output record device transmission, pause executes current instruction stream;
It sends and indicates to the input-output record device, to indicate that the input-output record device sends pending data
The data packet of read-write operation;
The data packet for the pending data read-write operation that the input-output record device is sent is received, and described in completion
Pending data read-write operation.
26. method as claimed in claim 25, which is characterized in that further include:
The current location of instruction and pending data read-write operation are recorded, the data read-write operation is the data that peripheral hardware is initiated
Read-write operation.
27. method as claimed in claim 25, which is characterized in that it is described to send instruction to the input-output record device,
To indicate that the input-output record device sends the data packet of the pending data read-write operation, including:
When the pending data read-write operation includes multiple data read-write operations, the input-output record device is indicated
The data packet of the pending data read-write operation is sequentially sent one by one.
28. method as claimed in claim 25, which is characterized in that it is described to send instruction to the input-output record device,
To indicate that the input-output record device sends the data packet of the pending data read-write operation, including:
It is sent and is indicated to the input-output record device according to processing strategy, to indicate that the input-output record device is sent
The data packet of the selected pending data read-write operation.
29. method as claimed in claim 25, which is characterized in that the pending data read-write operation includes:DMA and/
Or the data read-write operation of P2P types.
30. such as claim 25 to 29 any one of them method, which is characterized in that further include:It is described pending in completion
After data read-write operation, restore to execute described instruction stream.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710212740.5A CN108345788A (en) | 2017-04-01 | 2017-04-01 | Input-output record device and method, CPU and its data read-write operation method |
US15/895,686 US10657022B2 (en) | 2017-02-20 | 2018-02-13 | Input and output recording device and method, CPU and data read and write operation method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710212740.5A CN108345788A (en) | 2017-04-01 | 2017-04-01 | Input-output record device and method, CPU and its data read-write operation method |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108345788A true CN108345788A (en) | 2018-07-31 |
Family
ID=62963023
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710212740.5A Pending CN108345788A (en) | 2017-02-20 | 2017-04-01 | Input-output record device and method, CPU and its data read-write operation method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108345788A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109144760A (en) * | 2018-06-29 | 2019-01-04 | 清华大学 | For obtaining the method, apparatus, system and medium of internal storage state |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1862518A (en) * | 2006-06-21 | 2006-11-15 | 北京中星微电子有限公司 | Asynchronous data buffer storage |
CN101587552A (en) * | 2008-05-20 | 2009-11-25 | 索尼株式会社 | Information processing apparatus, information processing system, method of processing information, and computer program |
CN101866328A (en) * | 2010-04-01 | 2010-10-20 | 和记奥普泰通信技术有限公司 | Automatically accessed serial bus read/write control method |
US20120054379A1 (en) * | 2010-08-30 | 2012-03-01 | Kafai Leung | Low power multi-touch scan control system |
CN103440462A (en) * | 2013-08-28 | 2013-12-11 | 成都卫士通信息产业股份有限公司 | Embedded control method for improving security and secrecy performance of security microprocessor |
CN105700999A (en) * | 2016-02-19 | 2016-06-22 | 珠海格力电器股份有限公司 | method and system for recording processor operation |
-
2017
- 2017-04-01 CN CN201710212740.5A patent/CN108345788A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1862518A (en) * | 2006-06-21 | 2006-11-15 | 北京中星微电子有限公司 | Asynchronous data buffer storage |
CN101587552A (en) * | 2008-05-20 | 2009-11-25 | 索尼株式会社 | Information processing apparatus, information processing system, method of processing information, and computer program |
CN101866328A (en) * | 2010-04-01 | 2010-10-20 | 和记奥普泰通信技术有限公司 | Automatically accessed serial bus read/write control method |
US20120054379A1 (en) * | 2010-08-30 | 2012-03-01 | Kafai Leung | Low power multi-touch scan control system |
CN103440462A (en) * | 2013-08-28 | 2013-12-11 | 成都卫士通信息产业股份有限公司 | Embedded control method for improving security and secrecy performance of security microprocessor |
CN105700999A (en) * | 2016-02-19 | 2016-06-22 | 珠海格力电器股份有限公司 | method and system for recording processor operation |
Non-Patent Citations (1)
Title |
---|
刘复华: "《MCS 296单片机及其应用系统设计》", 30 April 2004, 清华大学出版社 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109144760A (en) * | 2018-06-29 | 2019-01-04 | 清华大学 | For obtaining the method, apparatus, system and medium of internal storage state |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103885820B (en) | Information processor and information processing method | |
CN108681565A (en) | block chain data parallel processing method, device, equipment and storage medium | |
CN109447253B (en) | Video memory allocation method and device, computing equipment and computer storage medium | |
CN104111870B (en) | Interrupt processing device and method | |
WO2017156044A1 (en) | System and method for intelligent sales engagement | |
CN106201723A (en) | The resource regulating method of a kind of data center and device | |
CN108665272A (en) | Block chain data processing method, device, equipment and storage medium | |
CN110908837B (en) | Application program exception handling method and device, electronic equipment and storage medium | |
CN103853516B (en) | A kind of electronic equipment and switching method | |
CN103336672B (en) | Method for reading data, device and computing device | |
CN108255620A (en) | A kind of business logic processing method, apparatus, service server and system | |
US10657022B2 (en) | Input and output recording device and method, CPU and data read and write operation method thereof | |
CN107370684A (en) | Business current-limiting method and business current-limiting apparatus | |
CN110414990A (en) | Transaction risk early warning, preventing control method, device, equipment and prevention and control system | |
CN107798039A (en) | A kind of method of data synchronization and device | |
CN107578338A (en) | A kind of service publishing method, device and equipment | |
CN103838720B (en) | Page file, which is loaded into, executes method and apparatus | |
KR101212496B1 (en) | Method of representing usage of monitoring resource, computing apparatus for performing the same and record medium recording program for implementing the method | |
CN108345788A (en) | Input-output record device and method, CPU and its data read-write operation method | |
CN108345791B (en) | Processor security detection method, system and detection device | |
CN101981556A (en) | Device control method, device control program, and device selecting apparatus | |
CN101939733A (en) | External device access apparatus, control method thereof, and system lsi | |
CN104570913B (en) | A kind of PLC control process methods of frequency converter | |
CN105573469B (en) | Sensor control method and device | |
CN109829004A (en) | Data processing method, device, equipment and storage medium based on unmanned vehicle |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180731 |