Peripheral access method and related device
By using trusted domain controllers and consistency verification mechanisms in the processor architecture, the problem of difficult security of peripheral access is solved, and the protection of secure peripherals and the stable operation of processor cores is achieved.
Patent Information
- Application Number
- CN202411075996.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-12-03
AI Technical Summary
In processor systems, it is difficult to ensure security during peripheral access, especially non-secure access requests may access secure target peripherals, resulting in security risks.
By introducing a trusted domain controller into the processor architecture, using the consistency verification mechanism, access requests are verified based on the security attributes in the identification information, ensuring that only requests that pass the verification are written to the shared storage space, and Processed by the second processor core, write requests that fail to pass the verification are discarded directly, and read requests that fail to pass the verification are returned to the default result to avoid accessing security peripherals and preventing the processor core from getting stuck.
It effectively avoids the risk of non-secure access requests to access secure peripherals, ensures security during peripheral access, and reduces the waiting time of processor cores, and prevents the occurrence of jamming.
Smart Images

Figure CN119066719A_ABST
Abstract
Description
Technical Field
[0001] The present specification relates to the field of communication technology, specifically, to a system-on-chip access technology under the field of communication technology, and more specifically, to a peripheral access method and related devices. Background Art
[0002] The processor (System-on-a-Chip, SOC) is a highly integrated integrated circuit. For the processor, peripherals refer to external devices connected to the processor to expand its functions. The normal operation of peripherals is of great significance to ensure the various extended functions of the system on chip. Therefore, it is necessary to provide a peripheral access method to ensure the security during the peripheral access process. Summary of the invention
[0003] The embodiments of this specification provide a method for accessing a peripheral device to achieve the purpose of ensuring the security of accessing a peripheral device.
[0004] To achieve the above technical objectives, the embodiments of this specification provide the following technical solutions:
[0005] In a first aspect, an embodiment of the present specification provides a peripheral access method, the peripheral access method is applied to a processor architecture, the processor architecture includes a first processor, an input-output processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, the input-output processor includes a trusted domain controller, a second processor core and a memory connected to the second processor core, the memory connected to the second processor core is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to realize communication between the first processor core and the second processor core, and a target shared space is allocated to the target peripheral in the shared storage space; the peripheral access method includes:
[0006] In response to the first access request, the trusted domain controller performs a consistency check on the first access request according to the identification information, and writes the first access request into the target shared space when the consistency check passes;
[0007] The first access request includes an access request for a target peripheral device sent by the first processor core; the first access request written in the target shared space is used to instruct the second processor core to read the first access request and access a peripheral controller corresponding to the target peripheral device according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request;
[0008] The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize the security type of the first access request, and the second security attribute is used to characterize the security type of the target shared space.
[0009] In this embodiment, when the input-output processor receives a first access request, it first performs a consistency check through the trusted domain controller based on the first security attribute of the first access request and the second security attribute of the target shared space corresponding to the target peripheral to be accessed by the first access request. The first access request that passes the check is allowed to be sent down (i.e., written to the target shared space), so that the second processor core writes to the target shared space in response to the first access request, reads the first access request from the target shared space, and accesses the peripheral controller corresponding to the target peripheral according to the first access request, so that the peripheral controller returns the execution result corresponding to the first access request. A first access request that fails the consistency check (for example, the first security attribute indicates that the security type of the first access request is insecure, and the second security attribute indicates that the security type of the second access request is secure) may no longer be issued (that is, the trusted domain controller no longer writes the first access request into the target shared space). In this way, the issuance of the first access request that fails the consistency check (for example, the first security attribute indicates that the security type of the first access request is insecure, and the second security attribute indicates that the security type of the second access request is secure) is avoided, thereby avoiding the occurrence of a situation where an insecure first access request accesses a secure target peripheral, which is beneficial to ensuring the security of peripherals during the peripheral access process.
[0010] In one embodiment, the peripheral access method further includes:
[0011] When the consistency check fails and the first access request is a write request, discarding the first access request by the trusted domain controller;
[0012] When the consistency check fails and the first access request is a read request, a default result is returned, where the default result includes multi-bit data whose values are all preset values.
[0013] In this embodiment, when the consistency check of the first access request fails, the first access request is no longer simply discarded, but is processed differently according to whether the first access request is a write request or a read request. Specifically, when the consistency check fails and the first access request is a write request, the first processor core does not always wait for the processing result of the write request, so the first access request can be directly discarded to avoid the issuance of the first access request that fails the consistency check; and when the consistency check of the first access request fails and the first access request is a read request, since the first processor core may wait for the requested read data to return before continuing to execute other instructions after issuing a read request, if the first access request is directly discarded in this case, it may cause the first processor core to be in a state of waiting for data to return for a long time, and it is impossible to process other instructions or tasks, causing the first processor core to become stuck. Therefore, in this embodiment, when the consistency check fails and the first access request is a read request, a default result is directly returned. The default result includes multi-bit data whose values are all preset values. In this way, the default result can be returned to the first processor core as a response result of the read request. While avoiding the first access request that fails the consistency check from accessing the target peripheral device, the problem of the first processor core being stuck is also avoided.
[0014] In one embodiment, before performing consistency check on the first access request, the method further includes:
[0015] The first security attribute is determined by the trusted domain controller according to the target access address of the first access request.
[0016] In this embodiment, the first security attribute of the first access request is determined based on the target access address of the first access request, which effectively reduces the information that the first processor core needs to carry when issuing the first access request. At the same time, it can also prevent attackers from illegally accessing the target peripheral device by forging the first security attribute carried in the first access request they issued.
[0017] In one embodiment, the shared storage space includes a default storage space and a secure storage space;
[0018] The determining, by the trusted domain controller according to the target access address of the first access request, the first security attribute comprises:
[0019] Traversing the secure storage space according to the target access address of the first access request through the trusted domain controller to obtain a traversal result;
[0020] If the traversal result indicates that the target access address of the first access request is located in the secure storage space, determining that the value of the first security attribute is a first value, and the first security attribute having the first value is used to indicate that the security type of the first access request is secure;
[0021] If the traversal result indicates that the target access address of the first access request is not located in the secure storage space, the value of the first security attribute is determined to be a second value, and the first security attribute having the second value is used to indicate that the security type of the first access request is non-secure.
[0022] In this embodiment, a specific method for determining the first security attribute is provided. In this embodiment, the shared storage space in the second memory is divided into a default storage space and a secure storage space. The target shared space allocated to the target peripheral may be located in the default storage space, or in the secure storage space, or may be partially located in the default storage space and partially located in the secure storage space. In this way, the secure storage space can be traversed according to the target access address of the first access request. If the target access address of the first access request is located in the secure storage space, the value of the first security attribute of the first access request is determined to be a first value representing security. If the target access address of the first access request is not located in the secure storage space, the value of the first security attribute of the first access request is determined to be a second value representing non-security. In this way, the purpose of flexibly determining the first security attribute of the first access request can be achieved.
[0023] In one embodiment, the input-output processor further includes: a register array, the register array includes a register group corresponding to the target shared space, the register group includes a first register and a second register, the first register is used to store a first pointer, the second register is used to store a second pointer, when the count values of the first pointer and the second pointer are different, it indicates that there is an access request to be processed in the shared storage space; the first count value of the first pointer is updated when the second processor core writes the access request into the shared storage space;
[0024] The identification information further includes: a third security attribute; the third security attribute is used to characterize the security type of the register group corresponding to the target shared space;
[0025] The performing a consistency check on the first access request according to the identification information, and writing the first access request into the target shared space when the consistency check passes, comprises:
[0026] When the values of the first security attribute, the second security attribute and the third security attribute are consistent, it is determined that the consistency check of the first access request passes.
[0027] In this embodiment, a register group corresponding to the target shared space is set in the input and output processor, and the register group includes a first register and a second register for storing the first pointer and the second pointer respectively. When the count values of the first pointer and the second pointer are different, it indicates that there is a pending first access request in the target shared space. That is, the count values of the first pointer and the second pointer can be used to determine whether there is a pending first access request in the target shared space. There is no need for the second processor core to access the target shared space in a polling manner to determine whether there is a pending first access request, which helps to reduce the computing pressure on the second processor core.
[0028] In addition, in this embodiment, a third security attribute is set for the security type of the register group corresponding to the target shared space. In this way, when the trusted domain controller performs a consistency check on the first access request based on the identification information, it is performed based on the values of multiple identifications (i.e., the first security attribute, the second security attribute, and the third security attribute). That is, starting from the security attributes of the first access request, the security attributes of the target shared space, and the security attributes of the register group corresponding to the target shared space, consistency verification is jointly performed, which is beneficial to comprehensively consider whether the first access request corresponds to the target peripheral it wants to access, avoid the occurrence of situations such as an insecure first access request accessing a secure target peripheral, and help to ensure the security of the peripherals during the peripheral access process.
[0029] In a second aspect, an embodiment of the present specification provides a peripheral access method, the peripheral access method is applied to a processor architecture, the processor architecture includes a first processor, an input-output processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, the input-output processor includes a trusted domain controller, a second processor core and a memory connected to the second processor core, the memory connected to the second processor core is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to realize communication between the first processor core and the second processor core, and a target shared space is allocated to the target peripheral in the shared storage space; the peripheral access method includes:
[0030] Sending a first access request to the trusted domain controller through the first processor core, wherein the first access request includes an access request for a target peripheral device; the first access request is used to instruct the trusted domain controller to perform a consistency check on the first access request according to identification information in response to the first access request, and write the first access request into the target shared space when the consistency check passes;
[0031] The first access request includes an access request for a target peripheral device sent by the first processor core;
[0032] The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize a security type of the first access request, and the second security attribute is used to characterize a security type of the target shared space; the first access request written in the target shared space is used to instruct the second processor core to read the first access request, and access the peripheral controller corresponding to the target peripheral according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request.
[0033] In one embodiment, sending the first access request to the trusted domain controller through the first processor core includes:
[0034] The first access request is encapsulated into a message in a preset format by the first processor core, and the message is sent to the trusted domain controller.
[0035] In this embodiment, the message format for communication is pre-negotiated between the first processor core and the second processor core. When the first processor core communicates with the second processor core, it only needs to encapsulate the information to be sent (such as the first access request) into a message in a preset format and store it in a shared storage space. The second processor core reads the message in the preset format from the shared storage space and parses it to obtain the message content. There is no need to communicate with each other based on a complex communication protocol, which is conducive to simplifying the communication process between the first processor core and the second processor core.
[0036] In a third aspect, an embodiment of the present specification further provides a processor architecture, including: a first processor, an input-output processor, and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, the input-output processor includes a trusted domain controller, a second processor core, and a memory, the memory is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to implement communication between the first processor core and the second processor core, and a target shared space is allocated to the target peripheral in the shared storage space; wherein,
[0037] The first processor core is configured to: send a first access request to the input / output processor; the first access request includes an access request for a target peripheral device;
[0038] The trusted domain controller is configured to: in response to the first access request, perform a consistency check on the first access request according to the identification information, and write the first access request into the target shared space when the consistency check passes;
[0039] The second processor core is configured to, in response to the first access request, write into the target shared space, read the first access request, and access the peripheral controller corresponding to the target peripheral according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request;
[0040] The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize the security type of the first access request, and the second security attribute is used to characterize the security type of the target shared space.
[0041] In one embodiment, the trusted domain controller includes: a control unit and a filtering unit; wherein,
[0042] The control unit includes a plurality of configuration registers, and the control unit is used to configure the values of the plurality of configuration registers in response to the configuration information, and the values of the plurality of configuration registers are used to configure the enabling state of the filtering unit and configure the default storage space and the security storage space of the memory;
[0043] The filtering unit is configured to, when the enabling state of the filtering unit is enabled, determine the first security attribute according to the target access address of the first access request, the default storage space and the secure storage space, perform a consistency check on the first access request according to the identification information, and write the first access request into the target shared space when the consistency check passes.
[0044] In this embodiment, the control unit of the trusted domain controller is used to implement the configuration of the filtering unit, and the filtering unit is used to implement a consistency check on the first access request. In this way, the control data flow and the access data flow are separated, which is conducive to ensuring the clear flow of different types of data within the trusted domain controller, avoiding the abnormal reception of data caused by the intersection of different types of data flows, and improving the operational reliability of the trusted domain controller.
[0045] In a fourth aspect, an embodiment of the present specification further provides a computing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the peripheral access method as described above when executing the computer program.
[0046] In a fifth aspect, an embodiment of the present specification further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the peripheral access method as described above is implemented.
[0047] In a sixth aspect, an embodiment of the present specification provides a computer program product or a computer program, wherein the computer program product includes a computer program, and the computer program is stored in a computer-readable storage medium; the processor of the computer device reads the computer program from the computer-readable storage medium, and the processor implements the steps of the above-mentioned peripheral access method when executing the computer program.
[0048] It can be seen from the above technical scheme that the peripheral access method provided in the embodiment of this specification, before writing the first access request sent by the first processor core into the target shared space, first performs a consistency check on the first access request based on identification information, and the identification information includes a first security attribute for characterizing the security type of the first access request and a second security attribute for characterizing the security type of the target shared space. In this way, it can be ensured that the first access request that passes the consistency check will be written into the target shared space and read and executed by the second processor core, thereby avoiding the issuance of the first access request that fails the consistency check (for example, the first security attribute characterizes that the security type of the first access request is non-secure, and the second security attribute characterizes that the security type of the second access request is secure), thereby avoiding the occurrence of situations such as the non-secure first access request accessing a secure target peripheral, which is beneficial to ensuring the security of the peripherals during the peripheral access process. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0050] Figure 1 A schematic diagram of a processor architecture provided for an implementation of this specification;
[0051] Figure 2 A schematic diagram of another processor structure provided for an embodiment of this specification;
[0052] Figure 3 A flowchart of a peripheral access method provided for one embodiment of this specification;
[0053] Figure 4 A flowchart of another peripheral access method provided for one embodiment of this specification;
[0054] Figure 5 A schematic diagram of the structure of a trusted domain controller provided for one embodiment of this specification;
[0055] Figure 6 A schematic diagram of the structure of a computing device provided for one embodiment of the present specification. DETAILED DESCRIPTION
[0056] Unless otherwise defined, the technical terms or scientific terms used in the embodiments of this specification shall have the common meanings understood by persons with ordinary skills in the field to which this specification belongs. The words "first", "second" and similar words used in the embodiments of this specification do not indicate any order, quantity or importance, but are only used to avoid confusion of constituent elements.
[0057] Unless the context requires otherwise, throughout the specification, "plurality" means "at least two", and "including" is interpreted as an open, inclusive meaning, that is, "including, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments", "examples", "specific examples" or "some examples" are intended to indicate that a particular feature, structure, material or characteristic associated with the embodiment or example is included in at least one embodiment or example of the specification. The schematic representation of the above terms does not necessarily refer to the same embodiment or example.
[0058] The technical solutions in the embodiments of this specification will be described below in conjunction with the drawings in the embodiments of this specification. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0059] Overview
[0060] As processor performance improves and functions continue to increase, the complexity of processor architecture is also increasing. In related technologies, a multi-core processor architecture refers to a processor architecture that includes two or more processor cores. In a multi-core processor, these processor cores can independently execute different instructions to meet the needs of processing different tasks at the same time, significantly improving the computer's parallel processing capabilities and efficiency; these processor cores can also collaboratively execute the same instruction, based on the performance of multiple processor cores to collaboratively complete complex calculations and other tasks with high performance requirements. Multi-core processor architecture can effectively solve the limitations of single-core processors in improving performance.
[0061] In order to give full play to the advantages of each processor core in the multi-core processor architecture, the embodiments of this specification provide an innovative processor architecture. Figure 1 , the processor architecture includes:
[0062] The first processor 100 and the input output processor (IOP) 110 , in some implementations, the processor architecture may further include at least one peripheral controller 120 .
[0063] The first processor 100 is communicatively connected to the input / output processor 110 via an on-chip network 130 , and the input / output processor 110 is respectively connected to at least one peripheral controller 120 .
[0064] The on-chip network 130 is a communication network between various components within the entire processor architecture, and is used to provide communication links between various components within the processor architecture. Various types of buses, bus interfaces, etc. can be integrated in the on-chip network 130 to meet the communication requirements between the input and output processor 110 and various processor architecture components such as the first processor 100, the second processor, and the first memory 150 based on any type of bus.
[0065] Specifically, the input / output processor 110 includes at least one dedicated second processor core 111 , and the second processor core 111 can serve as an intermediate medium when the first processor 100 interacts with at least one peripheral controller 120 .
[0066] The above-mentioned first processor 100 is an application processor (AP) in the processor architecture, which may include a first processor core 101. The first processor core 101 can be used as an application processor core in the processor architecture. The application processor core is the operation and control center of the entire processor architecture and is used to execute instructions and operations.
[0067] At the same time, the application processor core can also be used to start and control other processor cores in the processor architecture, such as the second processor core 111 in the input-output processor 110. For example, before the second processor core 111 in the input-output processor 110 is started, the processor core of the first processor 100 copies the firmware program stored in the memory to the SRAM of the input-output processor 110, so that the second processor core 111 in the input-output processor 110 can load the firmware program from the SRAM to start running.
[0068] At least one peripheral controller 120 in the above-mentioned processor architecture may include any external device connected to the processor architecture or a controller corresponding to an external device interface, such as a UART (Universal Asynchronous Receiver / Transmitter) controller, an I2C (Inter-Integrated Circuit, serial communication bus) controller, an SPI (Serial Peripheral Interface, serial peripheral interface) controller, an SD (Secure Digital, SD card) controller, a GMAC controller (Gigabit Media Access Controller, Gigabit Media Access Controller), and the like. The peripheral controller may be used to control the peripheral according to the instructions or data sent by the input and output processor. In practical applications, the processor architecture may integrate different peripheral controllers according to actual functional requirements. These peripheral controllers may support the same protocol or different protocols. The specific selection and implementation of the peripheral controller may refer to the actual requirements of the processor architecture and the implementation of related technologies, and this specification does not specifically limit this. Each peripheral controller may directly interact with the input and output processor for data. In some embodiments, the above-mentioned peripheral controller 120 may include a controller for a low-speed peripheral. In this embodiment, the low-speed peripheral controller 120 is connected to the first processor 100 through the input-output processor 110. The low-speed peripheral controller is connected to the input-output processor 110, and the input-output processor 110 performs communication interaction with the low-speed peripherals, without the need for the first processor core to specifically execute access requests for the low-speed peripherals, which is conducive to releasing at least part of the resources of the first processor core.
[0069] As for the high-speed peripheral controller in the processor architecture, it can be directly connected to the first processor 100, so that the first processor 100 can execute access requests for high-speed peripherals, and high-speed peripherals usually interact with the first processor 100 for relatively more important services, so that the first processor 100 and the high-speed peripherals are directly connected and can ensure the smooth execution of high-speed services. However, in some embodiments, the high-speed peripheral controller can also be connected to the second processor core 111, and the first processor core 101 can hand over some access requests for the high-speed peripheral controller to the second processor core 111 for execution, so as to further reduce the computing pressure of the first processor core 101 when the peripherals are accessed. Optionally, the first processor core 101 can delegate low-speed access requests to the high-speed peripheral controller to the second processor core 111 for execution. The low-speed access requests to the high-speed peripheral controller have relatively low requirements for data transmission rate, etc., and the performance of the second processor core 111 can meet the access requirements. Therefore, the low-speed access requests to the high-speed peripheral controller are delegated to the second processor core 111 for execution. While meeting the access requirements, the computing pressure on the first processor core 101 is reduced, which is beneficial to releasing the performance of the first processor core 101.
[0070] The input-output processor 110 can be integrated into the processor architecture to share the pressure of the first processor and serve as an intermediate medium for data exchange between the first processor and the peripheral controller, so that the first processor can access each peripheral controller through the input-output processor, thereby realizing control of the peripherals connected to the peripheral controller. The input-output processor 110 includes at least one second processor core 111 for executing data communication operations between the first processor 100 and the peripheral controller 120.
[0071] In one embodiment of the present specification, the above-mentioned second processor core 111 may specifically include a RISC-V (Reduced Instruction Set Computer-Five, a fifth-generation reduced instruction set computer) core, that is, a processor core of the RISC-V instruction architecture, which can complete instruction access to modules with low real-time requirements such as low-speed peripherals.
[0072] Based on the above-mentioned input / output processor 110 and the second processor core 111 therein, the input / output processor 110 serves as a communication medium between the first processor 100 and each peripheral controller 120. The first processor 100 only needs to be connected to the input / output processor 110, and the input / output processor 110 is connected to each peripheral controller 120 respectively. In this way, there is no need for the first processor 100 to establish a communication link with each peripheral controller 120 separately.
[0073] At the same time, the second processor core 111 in the input-output processor 110 serves as an intermediate medium when the first processor 100 interacts with each peripheral controller 120. When the first processor 100 needs to access any target peripheral controller among the peripheral controllers, it only needs to send an access request for the target peripheral controller to the input-output processor 110. The second processor core 111 in the input-output processor 110 executes access to the target peripheral controller according to the access request sent by the first processor 100, and feeds back the access result to the first processor 100. In the above process, the first processor 100 can send an access request for the target peripheral controller to the input-output processor 110. At this time, the first processor 100 can execute other operations without executing subsequent interactive operations with the target peripheral controller. Instead, the input-output processor 110 executes the actual access to the peripheral controller and feeds back the access result to the first processor 100. It can be seen that the above process greatly reduces the resource consumption when the first processor 100 interacts with the peripheral controller.
[0074] Furthermore, since the first processor 100 can delegate at least part of the interactive operations with the peripheral controller to the second processor core 111 for execution, the number of drivers for the peripheral controller installed in the first processor 100 can be reduced, and the operations of upgrading or updating the peripheral controller drivers can also be reduced, thereby further reducing the burden on the first processor 100 and reducing resource consumption.
[0075] In some optional embodiments, reference Figure 2 The processor architecture may further include a security processor 140 connected to the first processor 100 and connected to other parts of the processor architecture via an on-chip network 130 .
[0076] The security level of the security processor 140 may be higher than the security level of the first processor 100. Based on the high security level of the security processor 140, programs with high security level requirements may be run on the security processor 140, and a security measurement service module may be mounted in the security processor 140 to perform security measurement on other modules.
[0077] The security processor 140 can be used to perform security control on the processor architecture, for example, to actively perform security measurements on each module of the processor architecture or to perform security measurements on the corresponding modules in response to security measurement requests from each module, and to control at least some modules to operate when safety is confirmed through security measurements.
[0078] Still reference Figure 2Optionally, the input / output processor 110 may further include a second memory 112, a register array 113, a timer 114, a watchdog 115, a direct memory access 116, and a trusted domain controller 118. The second memory 112 may be used to store the target firmware corresponding to the second processor core, so that the second processor core can start and run based on the target firmware stored in the second memory 112 during operation. In addition, the second memory 112 may also provide a shared storage space, and both the first processor core 101 and the second processor core 111 have access rights to the shared storage space. The shared storage space may be used as an inter-core channel during the communication between the first processor core 101 and the second processor core 111, so as to meet the communication requirements between the first processor core 101 and the second processor core 111.
[0079] The register array 113 may be composed of a plurality of registers corresponding to different functions, such as a register for triggering an interrupt signal, a register for recording the data read and write status, a register for recording the number of data written, a register for recording the number of data read, a register for configuring the aforementioned inter-core channel capacity, and a register for recording the number of inter-core channels, etc. Of course, registers corresponding to other functions may also be set based on actual application requirements, which are not exhaustively listed in this specification. In addition, the register array 113 may also cooperate with the second memory 112 to construct an inter-core channel for realizing data exchange between the first processor core 101 and the second processor core 111. In one possible implementation, a shared storage space of a certain capacity in the second memory 112 and two registers of the register array can be used to cooperate in realizing data interaction between the first processor core 101 and the second processor core 111, wherein one of the registers is used to trigger an interrupt to the first processor core 101, so that the first processor core 101 responds to the interrupt to access the information stored in the second processor core 111 in the shared storage space, thereby realizing information transfer from the second processor core 111 to the first processor core 101, and the other register is used to trigger an interrupt to the second processor core 111, so that the second processor core 111 responds to the interrupt to access the information stored in the first processor core 101 in the shared storage space, thereby realizing information transfer from the first processor core 101 to the second processor core 111.
[0080] The role of the network interconnect 117 is similar to that of the on-chip network 130, and is also used as a data interaction path to realize data interaction between any two or more functional modules mounted on the network interconnect 117. For example, the data sent from the first processor core 101 to the second processor core 111 is sent to the shared memory space, the instructions of the second processor core 111 are transmitted to the second memory 112, and the instructions issued by the second processor core 111 are transmitted to the watchdog 115, the timer 114 and the peripheral controller 120, etc.
[0081] The role of the trusted domain controller 118 may include filtering requests issued by the first processor core 101. For example, in some embodiments, the trusted domain controller 118 may also filter requests issued by the first processor 100 according to the security attributes of the peripheral controller 120 after the second processor core 111 is started, so that the first processor core 101 can access the secure peripheral controller 120 by issuing a secure request; when the first processor core 101 requests to access the secure peripheral controller 120 by issuing an unsecure request, the request will be filtered by the trusted domain controller 118.
[0082] The watchdog 115 may include a timer chip, whose functions may include monitoring whether the second processor core 111 is operating normally. If the second processor core 111 is operating abnormally, it may exceed a predetermined time without returning a heartbeat signal to the watchdog 111, and the watchdog 115 may time out. When the watchdog 115 times out, the watchdog 115 will reset the second processor core 111 to restore it to normal and restart operation.
[0083] The timer (Timer) 114 can be used for timing inside the input / output processor 110, and can also be used for reporting interrupts at a fixed time.
[0084] Understandably, Figure 2 As an example of a processor architecture only, in some embodiments, the processor architecture may include Figure 2 Some or all of the modules shown may even include Figure 2 Other modules other than the modules shown in the figure, similarly, the modules in the input and output processor 110 may also be compared Figure 2 The modules shown are more or less. The connection relationship and position between the modules can also be adaptively adjusted, for example, in Figure 2 In the illustrated embodiment, the peripheral controller 120 is disposed outside the input-output processor 110, and establishes a connection relationship with other modules of the input-output processor 110 through the interface of the input-output processor 110 and the network interconnection 117. In other embodiments, the peripheral controller 120 may also be integrated inside the input-output processor 110, that is, the peripheral controller 120 is encapsulated inside the input-output processor 110, so that the privatization of the peripheral controller 120 is realized, and the input-output processor 110 does not need to describe the relevant information of the peripheral controller to a third party during operation, which is conducive to improving the security of the input-output processor 110. This specification does not limit this, and it depends on the actual situation.
[0085] As mentioned above, in Figure 1 and Figure 2In the processor architecture shown, the second processor core can serve as an intermediate medium when the first processor interacts with at least one peripheral controller. The first processor can hand over the access request for the peripheral to the second processor core for execution, so as to reduce the problem of performance degradation caused by excessive resources of the first processor being occupied by access to the peripheral. However, the inventors have found through research that different types of peripherals, and even different peripherals of the same type, may have different security requirements for data and access processes. For example, the privacy and security of internal data of different types of peripherals may be different, and different types of peripherals may have different requirements for access rights. This leads to different types of peripherals having different security requirements for data and access processes. Different peripherals of the same type may also have different security requirements for data and access processes due to different uses or internally stored data. For example, a hard disk storing encrypted data and a hard disk storing ordinary data may have different security requirements for the access process. In order to avoid non-secure access requests accessing peripherals with higher security requirements, which may bring security risks to the peripheral data itself, it can be done in the following way: Figure 1 and Figure 2 In the processor architecture shown, a shared storage space accessible to both the first processor core and the second processor core is set in the second memory, so that the first processor core and the second processor core can communicate with each other based on the shared storage space. At the same time, the corresponding target shared space can also be allocated to the target peripheral in the shared storage space. In the process of the first processor core accessing the peripheral, the trusted domain controller responds to the first access request and performs a consistency check on the first access request according to the identification information. Only when the consistency check passes, the first access request is written into the target shared space to implement the verification and filtering of the first access request, wherein the first access request includes an access request for the target peripheral sent by the first processor core; the first access request written into the target shared space is used to instruct the second processor core to read the first access request and access the peripheral controller corresponding to the target peripheral according to the first access request, so that the peripheral controller returns the execution result corresponding to the first access request; the identification information includes a first security attribute and a second security attribute, the first security attribute is used to characterize the security type of the first access request, and the second security attribute is used to characterize the security type of the target shared space. In this way, it can be ensured that the first access request that passes the consistency check will be written into the target shared space and read and executed by the second processor core, thereby avoiding the issuance of the first access request that fails the consistency check (for example, the first security attribute represents the security type of the first access request as non-secure, and the second security attribute represents the security type of the second access request as secure), thereby avoiding the situation where the non-secure first access request accesses the secure target peripheral, etc., which is beneficial to ensuring the security of the peripherals during the peripheral access process.
[0086] Based on the above concept, an implementation method of this specification provides a peripheral access method. The peripheral access method provided by the implementation method of this specification will be exemplarily described below in conjunction with the accompanying drawings.
[0087] Exemplary Methods
[0088] To be applied to Figure 1 and Figure 2 Taking the processor architecture shown in the figure as an example, the processor architecture includes a first processor, an input-output processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, the input-output processor includes a trusted domain controller, a second processor core and a memory connected to the second processor core (the memory connected to the second processor core in the input-output processor may refer to the second memory mentioned above), the memory connected to the second processor core is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to realize communication between the first processor core and the second processor core, and a target shared space is allocated to the target peripheral in the shared storage space; in particular, the method is applied to Figure 2 Taking the trusted domain controller in the processor architecture shown in as an example, a peripheral access method is provided, such as Figure 3 As shown, the peripheral access method includes:
[0089] S301: In response to a first access request, the trusted domain controller performs a consistency check on the first access request according to identification information, and writes the first access request into the target shared space when the consistency check passes;
[0090] The first access request includes an access request for a target peripheral device sent by the first processor core; the first access request written in the target shared space is used to instruct the second processor core to read the first access request and access a peripheral controller corresponding to the target peripheral device according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request;
[0091] The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize the security type of the first access request, and the second security attribute is used to characterize the security type of the target shared space.
[0092] In this embodiment, when the input-output processor receives a first access request, it first performs a consistency check through the trusted domain controller based on the first security attribute of the first access request and the second security attribute of the target shared space corresponding to the target peripheral to be accessed by the first access request. The first access request that passes the check is allowed to be sent down (i.e., written to the target shared space), so that the second processor core writes to the target shared space in response to the first access request, reads the first access request from the target shared space, and accesses the peripheral controller corresponding to the target peripheral according to the first access request, so that the peripheral controller returns the execution result corresponding to the first access request. A first access request that fails the consistency check (for example, the first security attribute indicates that the security type of the first access request is insecure, and the second security attribute indicates that the security type of the second access request is secure) may no longer be issued (that is, the trusted domain controller no longer writes the first access request into the target shared space). In this way, the issuance of the first access request that fails the consistency check (for example, the first security attribute indicates that the security type of the first access request is insecure, and the second security attribute indicates that the security type of the second access request is secure) is avoided, thereby avoiding the occurrence of a situation where an insecure first access request accesses a secure target peripheral, which is beneficial to ensuring the security of peripherals during the peripheral access process.
[0093] In order to process the read request and the write request in a targeted manner and avoid the occurrence of abnormal situations such as the first processor core being stuck due to the request being simply discarded, in one embodiment, the peripheral access method further includes:
[0094] When the consistency check fails and the first access request is a write request, discarding the first access request by the trusted domain controller;
[0095] When the consistency check fails and the first access request is a read request, a default result is returned, where the default result includes multi-bit data whose values are all preset values.
[0096] In this embodiment, when the consistency check of the first access request fails, the first access request is no longer simply discarded, but is processed differently according to whether the first access request is a write request or a read request. Specifically, when the consistency check fails and the first access request is a write request, the first processor core does not always wait for the processing result of the write request, so the first access request can be directly discarded to avoid the issuance of the first access request that fails the consistency check; and when the consistency check of the first access request fails and the first access request is a read request, since the first processor core may wait for the requested read data to return before continuing to execute other instructions after issuing a read request, if the first access request is directly discarded in this case, it may cause the first processor core to be in a state of waiting for data to return for a long time, and it is impossible to process other instructions or tasks, causing the first processor core to become stuck. Therefore, in this embodiment, when the consistency check fails and the first access request is a read request, a default result is directly returned. The default result includes multi-bit data whose values are all preset values. In this way, the default result can be returned to the first processor core as a response result of the read request. While avoiding the first access request that fails the consistency check from accessing the target peripheral device, the problem of the first processor core being stuck is also avoided.
[0097] In one embodiment, the first security attribute may be determined by the first processor core when the first processor core issues a first access request, and the first security attribute is carried in the first access request. In addition, in another embodiment, the first security attribute may also be determined by the trusted domain controller based on the target access address of the first access request. Specifically, before the consistency check of the first access request is performed, the method further includes:
[0098] The first security attribute is determined by the trusted domain controller according to the target access address of the first access request.
[0099] In this embodiment, the first security attribute of the first access request is determined based on the target access address of the first access request, which effectively reduces the information that the first processor core needs to carry when issuing the first access request. At the same time, it can also prevent attackers from illegally accessing the target peripheral device by forging the first security attribute carried in the first access request they issued.
[0100] In an optional implementation, the shared storage space includes a default storage space and a secure storage space;
[0101] The determining, by the trusted domain controller according to the target access address of the first access request, the first security attribute comprises:
[0102] Traversing the secure storage space according to the target access address of the first access request through the trusted domain controller to obtain a traversal result;
[0103] If the traversal result indicates that the target access address of the first access request is located in the secure storage space, determining that the value of the first security attribute is a first value, and the first security attribute having the first value is used to indicate that the security type of the first access request is secure;
[0104] If the traversal result indicates that the target access address of the first access request is not located in the secure storage space, the value of the first security attribute is determined to be a second value, and the first security attribute having the second value is used to indicate that the security type of the first access request is non-secure.
[0105] In this embodiment, a specific method for determining the first security attribute is provided. In this embodiment, the shared storage space in the second memory is divided into a default storage space and a secure storage space. The target shared space allocated to the target peripheral may be located in the default storage space, or in the secure storage space, or may be partially located in the default storage space and partially located in the secure storage space. In this way, the secure storage space can be traversed according to the target access address of the first access request. If the target access address of the first access request is located in the secure storage space, the value of the first security attribute of the first access request is determined to be a first value representing security. If the target access address of the first access request is not located in the secure storage space, the value of the first security attribute of the first access request is determined to be a second value representing non-security. In this way, the purpose of flexibly determining the first security attribute of the first access request can be achieved.
[0106] In one embodiment, the input-output processor further includes: a register array, the register array includes a register group corresponding to the target shared space, the register group includes a first register and a second register, the first register is used to store a first pointer, the second register is used to store a second pointer, when the count values of the first pointer and the second pointer are different, it indicates that there is an access request to be processed in the shared storage space; the first count value of the first pointer is updated when the second processor core writes the access request into the shared storage space;
[0107] The identification information further includes: a third security attribute; the third security attribute is used to characterize the security type of the register group corresponding to the target shared space;
[0108] The performing a consistency check on the first access request according to the identification information, and writing the first access request into the target shared space when the consistency check passes, comprises:
[0109] When the values of the first security attribute, the second security attribute and the third security attribute are consistent, it is determined that the consistency check of the first access request passes.
[0110] In this embodiment, a register group corresponding to the target shared space is set in the input and output processor, and the register group includes a first register and a second register for storing the first pointer and the second pointer respectively. When the count values of the first pointer and the second pointer are different, it indicates that there is a pending first access request in the target shared space. That is, the count values of the first pointer and the second pointer can be used to determine whether there is a pending first access request in the target shared space. There is no need for the second processor core to access the target shared space in a polling manner to determine whether there is a pending first access request, which helps to reduce the computing pressure on the second processor core.
[0111] In addition, in this embodiment, a third security attribute is set for the security type of the register group corresponding to the target shared space. In this way, when the trusted domain controller performs a consistency check on the first access request based on the identification information, it is performed based on the values of multiple identifications (i.e., the first security attribute, the second security attribute, and the third security attribute). That is, starting from the security attributes of the first access request, the security attributes of the target shared space, and the security attributes of the register group corresponding to the target shared space, consistency verification is jointly performed, which is beneficial to comprehensively consider whether the first access request corresponds to the target peripheral it wants to access, avoid the occurrence of situations such as an insecure first access request accessing a secure target peripheral, and help to ensure the security of the peripherals during the peripheral access process.
[0112] Accordingly, to be applied to Figure 2 Taking the first processor core in the processor architecture shown in the figure as an example, the embodiment of this specification also provides a peripheral access method, such as Figure 4 As shown, including:
[0113] S401: Sending a first access request to the trusted domain controller through the first processor core, where the first access request includes an access request for a target peripheral device; the first access request is used to instruct the trusted domain controller to perform a consistency check on the first access request according to identification information in response to the first access request, and write the first access request into the target shared space when the consistency check passes;
[0114] The first access request includes an access request for a target peripheral device sent by the first processor core;
[0115] The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize a security type of the first access request, and the second security attribute is used to characterize a security type of the target shared space; the first access request written in the target shared space is used to instruct the second processor core to read the first access request, and access the peripheral controller corresponding to the target peripheral according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request.
[0116] Optionally, in one implementation, sending the first access request to the trusted domain controller through the first processor core includes:
[0117] The first access request is encapsulated into a message in a preset format by the first processor core, and the message is sent to the trusted domain controller.
[0118] In this embodiment, the message format for communication is pre-negotiated between the first processor core and the second processor core. When the first processor core communicates with the second processor core, it only needs to encapsulate the information to be sent (such as the first access request) into a message in a preset format and store it in a shared storage space. The second processor core reads the message in the preset format from the shared storage space and parses it to obtain the message content. There is no need to communicate with each other based on a complex communication protocol, which is conducive to simplifying the communication process between the first processor core and the second processor core.
[0119] For specific limitations on the process of the trusted domain controller performing consistency verification on the first access request, please refer to the relevant limitations above, and this specification will not go into details here.
[0120] Exemplary Devices
[0121] In an exemplary embodiment of the present specification, a peripheral access device is further provided, the peripheral access device is applied to a processor architecture, the processor architecture includes a first processor, an input-output processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, the input-output processor includes a trusted domain controller, a second processor core and a memory connected to the second processor core, the memory connected to the second processor core is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to realize communication between the first processor core and the second processor core, and a target shared space is allocated to a target peripheral in the shared storage space; the peripheral access device includes:
[0122] a request writing module, configured to respond to the first access request through the trusted domain controller, perform a consistency check on the first access request according to the identification information, and write the first access request into the target shared space when the consistency check passes;
[0123] The first access request includes an access request for a target peripheral device sent by the first processor core; the first access request written in the target shared space is used to instruct the second processor core to read the first access request and access a peripheral controller corresponding to the target peripheral device according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request;
[0124] The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize the security type of the first access request, and the second security attribute is used to characterize the security type of the target shared space.
[0125] In an exemplary embodiment of the present specification, a peripheral access device is further provided, the peripheral access device is applied to a processor architecture, the processor architecture includes a first processor, an input-output processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, the input-output processor includes a trusted domain controller, a second processor core and a memory connected to the second processor core, the memory connected to the second processor core is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to realize communication between the first processor core and the second processor core, and a target shared space is allocated to a target peripheral in the shared storage space; the peripheral access device includes:
[0126] Sending a first access request to the trusted domain controller through the first processor core, wherein the first access request includes an access request for a target peripheral device; the first access request is used to instruct the trusted domain controller to perform a consistency check on the first access request according to identification information in response to the first access request, and write the first access request into the target shared space when the consistency check passes;
[0127] The first access request includes an access request for a target peripheral device sent by the first processor core;
[0128] The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize a security type of the first access request, and the second security attribute is used to characterize a security type of the target shared space; the first access request written in the target shared space is used to instruct the second processor core to read the first access request, and access the peripheral controller corresponding to the target peripheral according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request.
[0129] For the specific definition of the peripheral access device, please refer to the definition of the peripheral access method above, which will not be repeated here. Each module in the above peripheral access device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0130] Exemplary processor architecture and computing device
[0131] An embodiment of the present specification also provides a processor architecture, such as Figure 1 and Figure 2 As shown, it includes: a first processor, an input-output processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, the input-output processor includes a trusted domain controller, a second processor core and a memory, the memory is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to realize communication between the first processor core and the second processor core, and a target shared space is allocated to the target peripheral in the shared storage space; wherein,
[0132] The first processor core is configured to: send a first access request to the input / output processor; the first access request includes an access request for a target peripheral device;
[0133] The trusted domain controller is configured to: in response to the first access request, perform a consistency check on the first access request according to the identification information, and write the first access request into the target shared space when the consistency check passes;
[0134] The second processor core is configured to, in response to the first access request, write into the target shared space, read the first access request, and access the peripheral controller corresponding to the target peripheral according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request;
[0135] The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize the security type of the first access request, and the second security attribute is used to characterize the security type of the target shared space.
[0136] For the relevant limitations on the trusted domain controller and the second processor core, please refer to the relevant limitations above, and this specification will not elaborate on them here.
[0137] Optionally, refer to Figure 5 , the trusted domain controller includes: a control unit 1181 and a filtering unit 1182; wherein,
[0138] The control unit 1181 includes a plurality of configuration registers, and the control unit 1181 is used to configure the values of the plurality of configuration registers in response to the configuration information, and the values of the plurality of configuration registers are used to configure the enabling state of the filtering unit 1182 and configure the default storage space and the secure storage space of the memory;
[0139] The filtering unit 1182 is configured to, when the enabling state of the filtering unit 1182 is enabled, determine the first security attribute according to the target access address of the first access request, the default storage space and the secure storage space, perform a consistency check on the first access request according to the identification information, and write the first access request into the target shared space when the consistency check passes.
[0140] In this embodiment, the control unit 1181 of the trusted domain controller is used to implement the configuration of the filtering unit 1182, and the filtering unit 1182 is used to implement a consistency check on the first access request. In this way, the control data flow and the access data flow are separated, which is beneficial to ensure that different types of data flows within the trusted domain controller are clear, avoid different types of data flows that may cause abnormal reception of data due to intersection, and improve the operational reliability of the trusted domain controller.
[0141] In an optional embodiment, the specific structures of the control unit 1181 and the filtering unit 1182 can refer to Figure 5, the control unit 1181 includes a first bus slave port and multiple configuration registers, and the filtering unit 1182 may include a second bus slave port, a write request filtering unit, a read request filtering unit, and a bus host port; wherein the first bus slave port and the second bus slave port may both include a clock interface, a reset interface, and a bus interface, wherein the clock interface and the reset interface are respectively used to receive a clock signal and a reset signal, the clock signal is used to provide a clock reference for communication and work, and the reset signal is used to reset the bus slave port. The bus interface of the first bus slave port is used to receive configuration information for multiple configuration registers, configure the values of the multiple configuration registers through the first bus slave port based on the configuration information, and configure the filtering unit 1182 (write request filtering unit and read request filtering unit) based on the values of the multiple configuration registers. In addition, in some embodiments, the control unit 1181 may also be used to issue an interrupt.
[0142] The bus interface of the second bus slave port can be used to receive the first access request, and distribute it to the write request filtering unit or the read request filtering unit according to the read / write type of the first access request, so that the write request filtering unit or the read request filtering unit performs a consistency check on the first access request based on the configuration of the control unit, and implements filtering of the first access request, and the first access request that passes the consistency check is sent through the bus interface of the bus host port. In some embodiments, if the first access request does not pass the consistency check of the write request filtering unit or the read request filtering unit, the write request filtering unit or the read request filtering unit can also return an error signal to the first processor through the second bus slave port, and the error signal is used to indicate that the first access request has not passed the consistency check.
[0143] Another embodiment of this specification also provides a computing device, see Figure 6 As shown, an exemplary embodiment of the present specification also provides a computing device, including: a memory and a processor, the memory storing a computer program, and the processor executing the computer program when executing the computer program performs the steps of the peripheral access method according to various embodiments of the present specification described in the above embodiments of the present specification.
[0144] The internal structure of the computing device can be as follows Figure 6As shown, the computing device includes a processor, a memory, a network interface and an input device connected through a system bus. Among them, the processor of the computing device is used to provide computing and control capabilities. The memory of the computing device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computing device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps of the peripheral access method according to various embodiments of the present specification described in the above embodiments of the present specification are performed.
[0145] The processor may include a main processor and may also include a baseband chip, a modem, etc.
[0146] The memory stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes computer operation instructions. More specifically, the memory may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0147] The processor may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component.
[0148] The input device may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0149] Output devices may include means that allow information to be output to a user, such as display screens, printers, speakers, etc.
[0150] The communication interface may include using any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0151] The processor executes the program stored in the memory and calls other devices, which can be used to implement each step of any peripheral access method provided in the above embodiments of this specification.
[0152] The computing device may also include a display component and a voice component. The display component may be a liquid crystal display or an electronic ink display. The input device of the computing device may be a touch layer covered on the display component, or a button, trackball or touchpad provided on the housing of the computing device, or an external keyboard, touchpad or mouse.
[0153] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of this specification, and does not constitute a limitation on the computing device to which the scheme of this specification is applied. The specific computing device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0154] Exemplary computer program products and storage media
[0155] In addition to the above-mentioned methods and devices, the peripheral access method provided in the embodiments of this specification may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the peripheral access method according to various embodiments of this specification described in the above "Exemplary Method" section of this specification.
[0156] The computer program product may be implemented in hardware, software or a combination thereof. In one optional embodiment, the computer program product is implemented as a computer storage medium. In another optional embodiment, the computer program product is implemented as a software product, such as a software development kit (SDK).
[0157] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present specification, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0158] In addition, an embodiment of the present specification also provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the peripheral access method according to various embodiments of the present specification described in the above "Exemplary Method" section of the present specification.
[0159] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this specification can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0160] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0161] The above-mentioned embodiments only express several implementation methods of this specification, and the descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the solutions provided by the embodiments of this specification. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of this specification, which all belong to the protection scope of this specification. Therefore, the protection scope of the patent of this specification shall be based on the attached claims.
Claims
1. A peripheral access method, characterized in that: The peripheral access method is applied to a processor architecture, the processor architecture includes a first processor, an input-output processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, the input-output processor includes a trusted domain controller, a second processor core and a memory connected to the second processor core, the memory connected to the second processor core is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to realize communication between the first processor core and the second processor core, and a target shared space is allocated to a target peripheral in the shared storage space; The peripheral access method comprises: In response to the first access request, the trusted domain controller performs a consistency check on the first access request according to the identification information, and writes the first access request into the target shared space when the consistency check passes; The first access request includes an access request for a target peripheral device sent by the first processor core; the first access request written in the target shared space is used to instruct the second processor core to read the first access request and access a peripheral controller corresponding to the target peripheral device according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request; The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize the security type of the first access request, and the second security attribute is used to characterize the security type of the target shared space.
2. The method according to claim 1, characterized in that Also includes: When the consistency check fails and the first access request is a write request, discarding the first access request by the trusted domain controller; When the consistency check fails and the first access request is a read request, a default result is returned, where the default result includes multi-bit data whose values are all preset values.
3. The method according to claim 1, characterized in that: Before performing consistency check on the first access request, the method further includes: The first security attribute is determined by the trusted domain controller according to the target access address of the first access request.
4. The method according to claim 3, characterized in that The shared storage space includes a default storage space and a secure storage space; The determining, by the trusted domain controller according to the target access address of the first access request, the first security attribute comprises: Traversing the secure storage space according to the target access address of the first access request through the trusted domain controller to obtain a traversal result; If the traversal result indicates that the target access address of the first access request is located in the secure storage space, determining that the value of the first security attribute is a first value, and the first security attribute having the first value is used to indicate that the security type of the first access request is secure; If the traversal result indicates that the target access address of the first access request is not located in the secure storage space, the value of the first security attribute is determined to be a second value, and the first security attribute having the second value is used to indicate that the security type of the first access request is non-secure.
5. The method according to claim 1, characterized in that The input-output processor further includes: a register array, the register array includes a register group corresponding to the target shared space, the register group includes a first register and a second register, the first register is used to store a first pointer, the second register is used to store a second pointer, when the count values of the first pointer and the second pointer are different, it indicates that there is an access request to be processed in the shared storage space; the first count value of the first pointer is updated when the second processor core writes the access request into the shared storage space; The identification information further includes: a third security attribute; the third security attribute is used to characterize the security type of the register group corresponding to the target shared space; The performing a consistency check on the first access request according to the identification information, and writing the first access request into the target shared space when the consistency check passes, comprises: When the values of the first security attribute, the second security attribute and the third security attribute are consistent, it is determined that the consistency check of the first access request passes.
6. A peripheral access method, characterized in that: The peripheral access method is applied to a processor architecture, the processor architecture includes a first processor, an input-output processor and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, the input-output processor includes a trusted domain controller, a second processor core and a memory connected to the second processor core, the memory connected to the second processor core is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to realize communication between the first processor core and the second processor core, and a target shared space is allocated to a target peripheral in the shared storage space; The peripheral access method comprises: Sending a first access request to the trusted domain controller through the first processor core, wherein the first access request includes an access request for a target peripheral device; the first access request is used to instruct the trusted domain controller to perform a consistency check on the first access request according to identification information in response to the first access request, and write the first access request into the target shared space when the consistency check passes; The first access request includes an access request for a target peripheral device sent by the first processor core; The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize a security type of the first access request, and the second security attribute is used to characterize a security type of the target shared space; the first access request written in the target shared space is used to instruct the second processor core to read the first access request, and access the peripheral controller corresponding to the target peripheral according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request.
7. The method according to claim 6, characterized in that The sending a first access request to the trusted domain controller through the first processor core comprises: The first access request is encapsulated into a message in a preset format by the first processor core, and the message is sent to the trusted domain controller.
8. A processor architecture, characterized in that: include: A first processor, an input-output processor, and at least one peripheral controller; the input-output processor serves as an intermediate medium when the first processor interacts with the at least one peripheral controller; the first processor includes a first processor core, the input-output processor includes a trusted domain controller, a second processor core, and a memory, the memory is provided with a shared storage space accessible to both the first processor core and the second processor core, the shared storage space is used to realize communication between the first processor core and the second processor core, and a target shared space is allocated to the target peripheral in the shared storage space; wherein, The first processor core is configured to: send a first access request to the input / output processor; the first access request includes an access request for a target peripheral device; The trusted domain controller is configured to: in response to the first access request, perform a consistency check on the first access request according to the identification information, and write the first access request into the target shared space when the consistency check passes; The second processor core is configured to, in response to the first access request, write into the target shared space, read the first access request, and access the peripheral controller corresponding to the target peripheral according to the first access request, so that the peripheral controller returns an execution result corresponding to the first access request; The identification information includes a first security attribute and a second security attribute, wherein the first security attribute is used to characterize the security type of the first access request, and the second security attribute is used to characterize the security type of the target shared space.
9. The processor architecture according to claim 8, characterized in that: The trusted domain controller includes: a control unit and a filtering unit; wherein, The control unit includes a plurality of configuration registers, and the control unit is used to configure the values of the plurality of configuration registers in response to the configuration information, and the values of the plurality of configuration registers are used to configure the enabling state of the filtering unit and configure the default storage space and the security storage space of the memory; The filtering unit is configured to, when the enabling state of the filtering unit is enabled, determine the first security attribute according to the target access address of the first access request, the default storage space and the secure storage space, perform a consistency check on the first access request according to the identification information, and write the first access request into the target shared space when the consistency check passes.
10. A computing device, characterized in that The invention comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the peripheral access method according to any one of claims 1 to 7 when executing the computer program.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the peripheral access method according to any one of claims 1 to 7 is implemented.
