Apparatus and method for handling exception cause events - Patents.com
By having a first processing unit halt and trigger a second unit to handle exceptions, the system securely manages exception-causing events, enhancing security and efficiency by preventing unauthorized data access and reducing unnecessary exception level transitions.
Patent Information
- Application Number
- JP2021510655
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2018-12-06
- Filing Date
- 2019-10-16
- Publication Date
- 2024-10-17
- Estimated Expiration
- 2039-10-16
AI Technical Summary
Existing systems face challenges in securely handling exception-causing events by ensuring that less trusted code does not access data associated with more trusted code, particularly in the face of sophisticated attacks like cache timing side-channel attacks.
A system is implemented with a first processing unit that enters a stop mode upon encountering an exception-causing event, triggering a second processing unit to handle the exception via direct mapped access to the first unit's state information, allowing the first unit to remain at its current exception level and resume execution upon completion of the handling routine.
This approach enhances security by preventing unauthorized access to trusted data and reduces the need for transitioning exception levels, thereby improving system efficiency and mitigating attacks like Specter-based cache timing side-channel attacks.
Smart Images

Figure 0007569307000001 
Figure 0007569307000002 
Figure 0007569307000003
Abstract
Description
[Technical field]
[0001] The present technique relates to an apparatus and method for handling exception cause events. [Background technology]
[0002] When software executes on a processing unit, an event may occur that may cause an exception. This may result in the execution of an interrupt service routine to handle the exception cause event. Often, the interrupt service routine may execute at a higher level of software execution privilege and may be a more trusted piece of code than the code whose execution caused the exception cause event. In some example implementations, the level of software execution privilege may be referred to as an exception level, and thus, when an exception cause event occurs during the execution of a particular piece of software, there may be cases where the software transitions to this higher exception level to execute an interrupt service routine at this higher exception level.
[0003] In such systems, it is desirable to increase the level of security within the system to mitigate the risk of less trusted code accessing data associated with more trusted code. Summary of the Invention [Means for solving the problem]
[0004] In one example configuration, a system is provided comprising a first processing unit for executing program code and a second processing unit, the first processing unit comprising a control interface mapped into a memory address space of the second processing unit and configured to provide the second processing unit with direct-mapped access to state information of the first processing unit, the first processing unit responsive to at least one exception cause event entering a stopped mode in which the first processing unit stops execution of the program code and issues a trigger event, the second processing unit responsive to the trigger event executing an exception handling routine in which the second processing unit is arranged to access the state information via the control interface to modify the state information of the first processing unit as required by the exception handling routine, and the second processing unit arranged to upon completion of the exception handling routine, cause the first processing unit to exit the stopped mode and resume execution of the program code.
[0005] In another example configuration, a first processing unit is provided comprising: execution circuitry for executing program code; and a control interface configured to be mapped into a memory address space of the second processing unit and to provide the second processing unit with direct-mapped access to state information of the first processing unit; wherein in response to at least one exception cause event, the first processing unit enters a stopped mode in which the execution circuitry stops execution of the program code and a trigger event is issued; the control interface is arranged to allow the second processing unit to access and modify the state information of the first processing unit as required by the exception handling routine while the second processing unit is executing the exception handling routine in response to the trigger event; and the first processing unit is arranged to exit the stopped mode and resume execution of the program code when the second processing unit completes the exception handling routine.
[0006] In a further illustrative configuration, a second processing unit is provided comprising: an execution circuit for executing an exception handling routine in response to a trigger event issued by a first processing unit, the trigger event indicating the first processing unit has entered a stopped mode in which execution of program code by the first processing unit is stopped; and a communications interface arranged for a second processing unit to access a control interface of the first processing unit while executing the exception handling routine, the control interface being mapped into a memory address space of the second processing unit and configured to provide the second processing unit with directly mapped access to state information of the first processing unit, the second processing unit being arranged to access the state information via the control interface to modify the state information of the first processing unit as required by the exception handling routine, and the second processing unit being arranged and configured such that upon completion of the exception handling routine, the first processing unit exits the stopped mode and resumes execution of program code.
[0007] In a further illustrative configuration, a method for handling exception cause events in a system comprising a first processing unit for executing program code and a second processing unit is provided, the method including providing the first processing unit with a control interface that is mapped into a memory address space of the second processing unit and configured to provide the second processing unit with direct-mapped access to state information of the first processing unit; in response to at least one exception cause event in the first processing unit, placing the first processing unit into a stopped mode in which the first processing unit stops execution of the program code and issues a trigger event; in response to the trigger event, the second processing unit executes an exception handling routine that accesses the state information via the control interface to modify the state information of the first processing unit as required by the exception handling routine; and upon completion of the exception handling routine by the second processing unit, the first processing unit exits the stopped mode and resumes execution of the program code.
[0008] In another illustrative configuration, a system is provided having a first processing means for executing program code and a second processing means, the first processing means having a control interface means mapped into a memory address space of the second processing means to provide the second processing means with directly mapped access to state information of the first processing means, the first processing means for responding to at least one exception cause event by entering a stop mode to halt execution of the program code and by issuing a trigger event, the second processing means for executing an exception handling routine configured to access the state information of the first processing means via the control interface means in response to the trigger event to modify the state information as required by the exception handling routine, and the second processing means for causing the first processing means to exit the stop mode and resume execution of the program code upon completion of the exception handling routine.
[0009] The present technique will now be further described, by way of example only, with reference to examples such as those illustrated in the accompanying drawings. [Brief description of the drawings]
[0010] [Figure 1] FIG. 2 is a block diagram illustrating components provided within a system in accordance with one example implementation. [Diagram 2] FIG. 2 illustrates in greater detail a memory element that may be provided within the memory-mapped control interface of FIG. 1 in accordance with one example implementation. [Diagram 3] 1 is a flow diagram illustrating exception handling according to one example implementation. [Figure 4A] FIG. 1 illustrates exception handling without using the present technique. [Figure 4B] FIG. 1 illustrates exception handling when using the present technique. [Figure 5A] FIG. 2 illustrates an example implementation of a processing unit in which the techniques described herein may be utilized. [Figure 5B] FIG. 2 illustrates an example implementation of a processing unit in which the techniques described herein may be utilized. [Figure 6] FIG. 1 illustrates how the techniques described herein can be implemented to allow nested exception handling according to one example arrangement. [Figure 7] FIG. 13 illustrates an alternative example configuration in which an interrupt distributor is used to distribute interrupts to one of several different control cores. [Figure 8] FIG. 1 illustrates an example arrangement in which at least one level of cache may be shared between an application core and a control core. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0011] In one example configuration, a system may provide a first processing unit for executing program code and a second processing unit. Although the second processing unit may also execute program code, the techniques described herein are concerned with how the second processing unit is used in situations where an exception causing event occurs during execution of the program code by the first processing unit.
[0012] The first processing unit is mapped into the memory address space of the second processing unit and is provided with a control interface configured to provide the second processing unit with directly mapped access to state information of the first processing unit, such that via the control interface the second processing unit is provided with directly mapped access to at least some of the state of the first processing unit.
[0013] The first processing unit is arranged to, in response to at least one exception causing event, stop execution of the program code and enter a stop mode in which it issues a trigger event. The second processing unit is then arranged to, in response to such a trigger event, execute an exception handling routine that can access state information of the first processing unit via a control interface in order to modify the state information as required by the exception handling routine. Thus, in contrast to a typical approach in which the first processing unit itself would first transition to a higher level of software execution privileges as required to execute the required exception handling routine, according to the techniques described herein the first processing unit does not execute the exception handling routine, but instead the exception handling routine is executed by a separate processing unit. This therefore allows to achieve a physical separation between the first processing unit, which executes its own program code, and the separate processing unit used to execute the exception handling routine on behalf of the first processing unit. This can significantly improve security within the system.
[0014] Upon completion of the exception handling routine, the second processing unit can then be arranged to cause the first processing unit to exit the stop mode and resume execution of program code. Because the second processing unit has access to the necessary state information via the control interface of the first processing unit, it can efficiently manipulate the state of the first processing unit as required while executing the exception handling routine on behalf of the first processing unit, so that when the first processing unit exits the stop mode in due course it can properly resume execution of the program code in an updated state as required to handle the exception causing event.
[0015] In this manner, by providing a first processing unit with a control interface that is mapped into the memory address space of the second processing unit and providing the second processing unit with directly mapped access to the relevant state information of the first processing unit, execution of exception handling routines required to deal with exceptions caused by exception-causing events can be shifted away from the first processing unit to a physically separate processing unit, thereby significantly mitigating certain types of attacks that may attempt to gain access to trusted data from untrusted code.
[0016] The state information that allows the second processing unit to directly map access through the control interface of the first processing unit can be in a variety of forms. In one example implementation, such state information includes the contents of a set of registers of the first processing unit that are used to store data processed by the first processing unit when executing program code. Thus, during execution of an exception handling routine in the second processing unit, the second processing unit can efficiently read the contents of these registers using the control interface of the first processing unit and update the contents of these registers as necessary.
[0017] There are several ways in which the control interface can be arranged to provide the second processing unit with direct-mapped access to the set of registers of the first processing unit. In one example arrangement, the control interface provides a set of storage elements that are mapped into the memory address space of the second processing unit to provide direct-mapped access to the set of registers by the second processing unit. Thus, each storage element in the set can be addressed by the second processing unit and directly mapped to a corresponding register in the set of registers of the first processing unit. As a result, whenever the second processing unit makes a read or write access to one of these storage elements, this is used to trigger a corresponding read or write access to the associated register in the set of registers of the first processing unit.
[0018] In addition to, or instead of, accessing the set of registers of the first processing unit, the second processing unit may have directly mapped access to at least a portion of the memory address space of the first processing unit, and therefore at least a portion of the state information of the first processing unit made available to the second processing unit via the control interface may be part of the memory address space of the first processing unit.
[0019] In one example arrangement, such portions of the memory address space of the first processing unit may be arranged to form a secondary address space of the second processing unit that is separate from the primary address space of the second processing unit. There are several mechanisms that may be provided to enable the second processing unit to access the secondary address space. For example, separate load / store instructions may be used for this purpose, or tag bits may be added to the non-address portion of the address registers used by the second processing unit when generating memory addresses to affect whether the memory access occurs in the primary or secondary address space.
[0020] However, providing a secondary address space as shown above will likely require certain architectural changes to be made to the system. In an alternative implementation, such architectural changes may be avoided by mapping the relevant portion of the memory address space of the first processing unit into the primary address space of the second processing unit. For example, the control interface may provide a block of storage elements mapped into the memory address space of the second processing unit, with each storage element in the block being directly mapped to a corresponding memory location in at least a portion of the memory address space of the first processing unit. Thus, in such a case, the relevant memory address space of the first processing unit may be accessed by the second processing unit in much the same manner as the previously mentioned set of registers of the first processing unit may be accessed.
[0021] To enable configuration of how the blocks of memory elements in the control interface are associated with various memory locations of the portion of the memory address space of the first processing unit, the control interface may comprise mapping storage configurable to identify direct mappings between memory elements in the blocks of memory elements and corresponding memory locations in at least the portion of the memory address space of the first processing unit.
[0022] In one example implementation, any exception causing event that occurs while the first processing unit is executing program code may be handled in the manner described above, i.e., by the first processing unit entering a halted mode and issuing a trigger event, however, in other implementations this may be limited to only occuring for certain exception causing events, while other exception causing events may be handled in a more conventional manner, i.e., within the first processing unit itself, possibly with a transition of the exception level of the first processing unit prior to executing an exception handling routine.
[0023] In one implementation, the control interface may further comprise an exception event identification storage configurable to identify which exception cause events that, when encountered during execution of the program code by the first processing unit, will cause the first processing unit to enter a stopped mode and issue a trigger event. Thus, the first processing unit may be controlled by the contents of the configurable exception event identification storage such that, upon detection of an exception cause event, the first processing unit may determine whether it is appropriate to enter a stopped mode and issue a trigger event.
[0024] Such an approach provides great flexibility in the use of the above-mentioned technique. As an exemplary use case, the exception event identification storage can be configured to identify that, if an exception cause event is handled by the first processing unit, the first processing unit will enter a stopped mode and issue a trigger event whenever an exception cause event occurs that would require the first processing unit to transition to a specified exception level. Thus, in situations where handling of an exception cause event in the first processing unit would not cause the first processing unit to transition to the specified exception level, the first processing unit may itself be able to execute the required exception handling routine, but in situations where the first processing unit would need to transition to the specified exception level (or alternatively, the specified exception level or a higher exception level), instead of performing this step, the first processing unit may be arranged to enter a stopped mode and issue a trigger event, and thus a physically separate second processing unit will execute the required exception handling routine.
[0025] In one example implementation, the first processing unit is arranged to remain at its current exception level when entering the stopped mode, and the second processing unit is arranged to execute an exception handling routine at the selected exception level. Thus, an exception causing event is handled using the techniques described above, and the first processing unit does not need to change its current exception level. Instead, the first processing unit simply enters the stopped mode at its current exception level, and can resume execution of program code at this current exception level when it is eventually commanded to exit the stopped mode. This avoids the need for the first processing unit to perform steps that may otherwise be required if the first processing unit transitions to a different exception level to handle the exception handling routine. Such steps may include, for example, saving the current execution state and return address, entering the required mode / exception level, possibly flushing certain data from temporary storage, such as a local cache, etc. Thus, in addition to the security benefits that may be realized by employing the techniques described herein, certain efficiency benefits may also be realized in some implementations.
[0026] The selected exception level at which the second processing unit executes the exception handling routine can take a variety of forms. For example, in some cases the selected exception level of the second processing unit can be the same as the current exception level of the first processing unit. However, in one particular implementation, the selected exception level is a higher exception level than the current exception level of the first processing unit.
[0027] In one implementation, the trigger event can incorporate certain information to assist the second processing unit in identifying why the first processing unit entered the stopped mode. However, instead of supplementing the trigger event itself, in one implementation, the control interface can comprise syndrome storage that is mapped into the memory address space of the second processing unit and written to by the first processing unit to provide information used by the second processing unit to assist in identifying why the first processing unit entered the stopped mode. Thus, when the second processing unit handles the trigger event, the second processing unit can perform a read access to the syndrome storage to obtain information to assist in identifying why the first processing unit entered the stopped mode, thereby improving the efficiency of the processing required to handle the exception cause event.
[0028] There need not be a one-to-one mapping between the first and second processing units. For example, the second processing unit may perform the above-mentioned functions on behalf of various different processing units executing program code. For example, in one example arrangement, the system may further include a third processing unit with a further control interface that is mapped into the memory address space of the second processing unit and configured to provide the second processing unit with directly mapped access to state information of the third processing unit. In response to at least one exception cause event, the third processing unit may enter a stop mode in which it stops execution and issues a trigger event. The trigger event may carry information that enables the second processing unit to determine whether the trigger event was issued by the first processing unit or the third processing unit and to determine whether to access the first or third processing unit when executing the exception handling routine. Thus, in this case, the second processing unit can execute exception handling routines on behalf of both the first processing unit and the third processing unit and can access necessary state information of either processing unit as required via an associated control interface that is mapped into the memory address space of the second processing unit.
[0029] In one example implementation, exception handling can be nested to multiple levels within the system. Thus, the first processing unit itself can be arranged such that exception causing events occurring while executing code are handled by the additional processing unit, while the second processing unit can handle exceptions on behalf of the first processing unit. Thus, in one example arrangement, the system can further comprise an additional processing unit, the second processing unit comprising a second control interface that is mapped into the memory address space of the additional processing unit and configured to provide the additional processing unit with directly mapped access to state information of the second processing unit. The second processing unit can then, in response to at least one exception causing event occurring during execution of the program code on the second processing unit, enter a stop mode that stops execution of the program code executing on the second processing unit and issues a further trigger event. The additional processing unit then executes a further exception handling routine that is arranged to, in response to the further trigger event, access the state information via the second control interface to modify the state information of the second processing unit as required by the further exception handling routine. The additional processing unit is then arranged and configured such that, upon completion of the further exception handling routine, the second processing unit exits the stopped mode and resumes execution of program code running on the second processing unit.
[0030] It will be appreciated that with such an approach any arbitrary level of nesting can be achieved as required. According to such an implementation, each individual processing unit can be configured to only be able to operate at a subset of the exception levels available in the system. In fact, at one end, all individual processing units can be arranged to only run at a single exception level, if any exception causing event that would have caused a transition to a higher exception level is instead handled by the current processing unit, by the current processing unit entering a stopped mode and issuing a trigger event, which is then handled by another processing unit operating at this higher exception level.
[0031] The various processing units in the system can be of various types. In one example arrangement, the first processing unit is an application processing unit, the program code is application program code, and the second processing unit is a control processing unit. Thus, in one example arrangement, the first processing unit can be arranged to execute only application code and can be configured to operate only at a lowest level of software execution privileges, e.g., a lowest exception level. Any exception causing events that require code to be executed at a higher exception level are not handled by the first processing unit, but instead are evacuated to another processing unit by the techniques described herein.
[0032] In one example arrangement, the first processing unit and the second processing unit may be provided by separate processor cores. In one such arrangement, the first processing unit and the second processing unit may be provided with separate cache structures for at least a subset of the cache levels in the system. With proper separation of cache structures between the first processing unit and the second processing unit, this may further improve security benefits with respect to, for example, the recently disclosed speculation-based cache timing side-channel attack, where several techniques may be used to create scenarios in which cache timing analysis may then be exploited to leak information from incorrectly speculated execution of instructions. By ensuring that separate cache structures are used, such attacks may be mitigated at least at the higher levels of caches, such as the level 1 and level 2 caches.
[0033] The first and second processing units need not be separate processor cores. For example, in another implementation, the first and second processing units can be provided by separate threads of a multi-threaded processor core. The techniques described herein can be applied to such separate threads in a multi-threaded processor core, since each thread has its own architectural state.
[0034] As mentioned above, the techniques described herein can provide great flexibility in how a system is configured. For example, at least one of the first processing unit and the second processing unit can be restricted to only operating at a single exception level. In fact, as mentioned above, with appropriate nesting techniques, each individual processing unit may be restricted to only operating at a single exception level.
[0035] The trigger event issued by the first processing unit can be in various forms. For example, the trigger event can be explicitly targeted to a particular processing unit that will handle this trigger event, so that in such a case the second processing unit is the processing unit to which the trigger event is issued. However, in an alternative approach, the trigger event can be issued to some distribution mechanism that determines which processing unit will then handle this trigger event, in which case the second processing unit is a processing unit among several processing units that can respond to the trigger event.
[0036] A specific example will now be described with reference to the figures.
[0037] FIG. 1 is a block diagram of a system according to one example implementation. A first processing unit 10 is provided with a processing pipeline 25 for executing program code. During execution of instructions by the processing pipeline, the processing pipeline will access registers of a register set 30 in a conventional manner to obtain source operands for the instructions and to store result operands produced by execution of those instructions in the register set. Data can be loaded from memory into the registers by a load operation, and similarly data can be stored back to memory by execution of a store instruction. The memory system can include one or more levels of caches, such as cache 35 shown in FIG. 1.
[0038] As is well known to those skilled in the art, during the execution of program code within a processing unit, circumstances may arise that result in the occurrence of an exception, which circumstances are referred to herein as exception-causing events. Such exception-causing events may take a wide variety of different forms, such as, for example, an input / output (I / O) device request, a request to invoke an operating system service from a user program (often called a system call), an integer arithmetic overflow or underflow, a page fault, etc.
[0039] It is also known that a processing unit can execute at several different levels of software execution privilege, referred to herein as different exception levels. When an exception is caused by an exception-causing event, this typically requires the execution of an interrupt service routine (also referred to herein as an exception handling routine) to handle the exception. Often, but not in all cases, it may be necessary for the processing unit to transition to a different, more privileged exception level before executing the interrupt service routine to handle the exception.
[0040] To guarantee the security of data within a system, it is desirable to ensure that software executing at a certain exception level cannot access certain data associated with software executing at a higher exception level. Mechanisms are known that attempt to isolate data used by trusted code within a system so that it cannot be accessed by less trusted code executing at a lower exception level. However, attackers are becoming ever more sophisticated in the techniques they use to try to access trusted data when they execute untrusted code. As a particular example, a speculation-based cache timing side-channel attack (often called Spectre) has been developed where several techniques can be used so that cache timing analysis can then be exploited to try to leak information from erroneously speculated execution of instructions. Against this background, it would be desirable to improve security within a system when handling exceptions in order to ensure that trusted data manipulated at a higher exception level is not unwittingly made available to code executing at a lower, less trusted exception level.
[0041] As will be discussed in more detail herein, the first processing unit 10 is arranged and configured such that, for at least some of the types of exception causing events that may arise, the first processing unit does not handle the exception itself, for example by switching to a higher exception level and executing an appropriate interrupt service routine on the processing pipeline 25, but instead a mechanism is provided which enables the servicing of this exception to be handled by a physically separate processing unit, referred to in FIG. 1 as the second processing unit 20.
[0042] In particular, the first processing unit 10 has a memory mapped control interface 40 that is mapped into the memory address space of the second processing unit 20. In particular, there are provided a number of storage elements 45 within the memory mapped control interface 40 that are mapped into a portion of the memory address space of the second processing unit, allowing load and store instructions to be executed on the processing pipeline 50 to read from and write to these storage elements 45 by specifying corresponding addresses within the memory address range of the second processing unit.
[0043] Moreover, these storage elements 45 are configured to provide direct-mapped access to certain state information of the first processing unit. In particular, as will be discussed in more detail below with reference to FIG. 2, some of these storage elements may provide direct-mapped access to registers in the register set 30, allowing the second processing unit to read and update the contents of these registers when executing an interrupt service routine to handle exceptions raised by the first processing unit 10. Similarly, certain portions of the memory address space of the first processing unit may be made available to the second processing unit via the storage elements 45 to read data from, or write data to, memory locations in the memory address space of the first processing unit 10, by load or store operations performed by the second processing unit 20 on these storage elements. Thus, via memory element 45, the second processing unit may be able to perform read and write operations to register set 30, as indicated by bidirectional line 80 in FIG. 1, and similarly may be able to perform read and write operations to at least a subset of the first processing unit's memory address space, as indicated by bidirectional line 85 interfacing with cache 35 of the first processing unit 10.
[0044] The second processing unit may be arranged in a similar manner to the first processing unit, such that it may have a processing pipeline 50 arranged to execute instructions, during which the processing pipeline may access an associated set of registers 55 and may load data into these registers from memory via the second processing unit's local cache 60, or store data back from the registers to memory via the local cache 60.
[0045] According to the techniques described herein, for at least certain types of exception causing events, the processing pipeline 25 is arranged to enter a stop mode of operation in which it ceases execution of program code and issues a trigger event. In particular, the processing pipeline 25 may assert a stop mode signal on path 65 and output a trigger event 70 from the first processing unit 10. The trigger event may be directed to a specific processing unit or may be issued to an interrupt distribution entity which applies any suitable metric for determining which processing unit the trigger event should be directed to. In the present case, it is assumed that the trigger event is ultimately propagated to the second processing unit 20.
[0046] Upon receiving the trigger event, the second processing unit interrupts the processing running in the processing pipeline 50 of the second processing unit and, based on the information provided in the trigger event, determines to execute an interrupt service routine suitable for handling the exception raised by the first processing unit 10.
[0047] When executing an interrupt service routine, processing pipeline 50 may perform load and / or store operations via path 75 to memory addressable storage elements 45 in memory-mapped control interface 40. As previously described, a read or write access to a storage element triggers a corresponding access to a direct-mapped state-holding structure in the first processing unit, such as a register of register set 30 via path 80, or a memory location in the first processing unit's memory address space via path 85.
[0048] As a result, during processing of an interrupt service routine, the second processing unit 20 can access the required state in the first processing unit and can modify this state as required by the interrupt service routine.
[0049] While this processing is taking place under the control of the second processing unit, the first processing unit remains in halt mode and therefore does not execute any instructions in processing pipeline 25. Once the exception handling routine has been completed by the second processing unit, a signal can be issued on path 90 to indicate that the exception handling processing is complete, i.e., there has been a return from the exception. At this point, the first processing unit is free to resume executing program code and so a halt mode exit signal is transmitted on path 95 to processing pipeline 25 to resume program execution.
[0050] Note that such a mechanism does not require the processing pipeline 25 to transition out of its current exception level, i.e., the exception level in which the processing pipeline 25 was operating before the exception-causing event occurred. Instead, the processing pipeline 25 can only halt execution while remaining at the current exception level, and then eventually resume execution of program code while also remaining at the current exception level.
[0051] By using the memory-mapped control interface 40, it is possible to allow the physically separate processing unit 20 to effectively execute the exception handling routine by relegating the processing of the exception handling routine to the physically separate processing unit 20 and providing a mechanism for the physically separate processing unit to access and modify state information of the first processing unit as necessary. This results in significantly enhanced security within the system. For example, if the exception causing event is of a type that would normally require the first processing unit to enter a higher exception level before executing the exception handling routine, it is no longer necessary for this transition to be made within the first processing unit. Instead, the exception handling routine can be executed by the separate processing unit, which may or may not itself transition to a higher exception level in order to execute the exception handling routine; the physical separation between software operating at different exception levels in this case significantly enhances security.
[0052] If desired, the second processing unit 20 may be provided with memory-mapped access to other storage within the first processing unit, such as additional memory-mapped control registers 110. For example, an embedded trace macrocell (ETM) 100 may be provided within the first processing unit to generate a trace stream indicative of processing activity of the processing pipeline 25, the operation of which is controlled by certain control information 120 stored in the control registers 110. Similarly, a performance management unit (PMU) 105 may be provided to generate certain performance metrics indicative of the operational performance of the first processing unit, the performance management unit being configurable based on the control information 115 in the control registers 110. If desired, the second processing unit 20 may be provided with memory-mapped access to the control registers 110 to enable the second processing unit to program the operations to be performed by the ETM 100 and the PMU 105.
[0053] The memory-mapped control interface 40 may, in one implementation, be provided by enhancing the functionality provided within the debug interface of the first processing unit 110. In particular, when performing debug operations on the first processing unit, the debug interface may include a mechanism for allowing execution of the processing pipeline to be stopped when necessary. Such a mechanism may be supplemented to allow higher performance access from external devices, such as a second processing unit, by not simply providing a standard external debug interface, but also by providing direct-mapped access to certain state information of the first processing unit, and thus providing an efficient mechanism for interrupt service routines running on a separate processing unit 20 to access and update this state information during exception handling.
[0054] FIG. 2 is a more detailed diagram of memory element 45 that may be included within memory-mapped control interface 40 in one example implementation.
[0055] As shown, a set of storage elements 150 may be provided to allow the second processing unit direct mapped access to the registers 30 of the first processing unit. For example, each individual storage element in the set may be directly mapped to one of the registers in the register set 30. When the processing pipeline 50 in the second processing unit 20 then performs a load or store operation specifying a memory address that maps to a particular storage element in the set 150, this may be used to directly access a register in the register set. For example, when performing a load operation, the contents from the associated register 30 may be retrieved into a storage element in the set 150 for provision back to the processing pipeline 50, and similarly, when performing a store operation, data may be written to the addressed storage element in the set 150 for direct update to the corresponding register in the register set 30.
[0056] 2, blocks of storage elements 155 may be provided for direct-mapped access to portions of the memory address space of the first processing unit, if desired. For example, blocks of storage elements 155 may be associated with particular ranges of addresses in the memory address space of the second processing unit, such that load and store operations may be performed by the second processing unit to these blocks of storage elements. Further, each storage element may be directly mapped to an associated memory location in the memory address space of the first processing unit, such that any accesses made to such storage elements in turn are made directly to the associated memory location.
[0057] The manner in which storage elements in block 155 are mapped to particular memory locations in the memory address space of the first processing unit may be configurable, so that, for example, one or more mapping registers 160 may be provided to identify the mapping between storage elements in block 155 and corresponding memory locations in the memory address space 10 of the first processing unit. The mapping registers may be written in a variety of ways, for example, by trusted code executing on the second processing unit 20, by appropriate trusted code executing on the first processing unit 10, or by trusted code executing on a further processing unit that is used to set up the relationship between the first and second processing units. With such an approach, state information held in the memory of the first processing unit 10 may be accessed and updated during execution of an interrupt service routine on the processing pipeline 50 of the second processing unit 20 efficiently by direct mapped access provided by the memory mapped control interface 40.
[0058] The block of storage elements 155 configured with mapping registers 160 provides one mechanism by which the second processing unit 20 can be provided with direct mapped access to a portion of the memory address space of the first processing unit, although it will be appreciated that other mechanisms may be used as required. For example, the memory address space of the first processing unit 10 may be treated as a secondary address space of the second processing unit that is separate from the primary address space of the second processing unit. The second processing unit may then be provided with a mechanism to enable it to address the secondary address space of the second processing unit to access state information in the address space of the first processing unit 10 while executing an interrupt service routine on behalf of the first processing unit. There are several mechanisms that may be used for this. For example, the instruction set architecture may provide a separate set of load and store instructions that are used to access the secondary address space rather than the primary address space. Alternatively, tag bits can be added to the non-address portion of the address register used by the second processing unit when generating memory addresses to influence whether this generates a memory access in the primary or secondary address space. However, it will be appreciated that such a mechanism could potentially allow the entire address space of the first processing unit to be replicated as the secondary address space of the second processing unit, but may require certain architectural modifications to be performed. Thus, in some implementations, the mechanism described above with reference to FIG. 2 may be preferred. The amount of address space in the first processing unit that can be accessed by the second processing unit at any one time (i.e. without changing the mapping in the mapping register 165) is dictated by the size of the blocks of storage elements 155, providing a mechanism that can be performed without requiring any architectural modifications to the system.
[0059] As also shown in FIG. 2, one or more exception event identification registers 165 may be provided that can be programmed to identify what type of exception cause event will cause the first processing unit to enter a stopped mode and issue a triggering event, rather than attempting to deal with the exception itself (e.g., by triggering a change in exception level and execution of an interrupt service routine in the processing pipeline 25). This allows for a high degree of configurability as to when the stopped mode is used. For example, at one end of the scale, any exception cause event may cause the processing pipeline to enter a stopped mode, such that all exceptions are handled remotely by the second processing unit. However, if desired, one or more different types of exception cause events may be allowed to be handled by the first processing unit without triggering a stopped mode and relegating exception handling to the second processing unit.
[0060] In one example arrangement, the exception event identification register 165 can be programmed to identify that whenever an exception cause event occurs in the first processing unit that would require the first processing unit to transition to a specified exception level if the exception cause event were handled by the first processing unit, the occurrence of the exception cause event will cause a stop mode to be entered and a trigger event 70 to be issued to cause a physically separate processing unit, such as the second processing unit 20, to handle the exception. As a specific example, the first processing unit can be enabled to handle exception cause events that can be handled while remaining at exception level 0, apart from any exception cause events that would require a transition to exception level 1 or higher, which allows the processing pipeline 25 to enter a stop mode and evacuate handling of the exception to the physically separate processing unit. As another example, the first processing unit can be enabled to handle exceptions that can be handled at exception level 0 or exception level 1, but will enter a stop mode for any other exception cause events that would require a transition to exception level 2 or higher.
[0061] The exception event identification register 165 can be programmed in various ways, for example by trusted code executing on the second processing unit 20, by trusted code executing on the first processing unit 10, or by trusted code executing on a further processing unit used to set up a relationship between the first and second processing units.
[0062] In one implementation, the trigger event 70 may itself provide some information that enables the second processing unit to determine why the first processing unit entered the stop mode. However, in alternative implementations, one or more syndrome registers 170 may be provided in the storage element 45 for this purpose. In particular, the first processing unit may then write to these syndrome registers before entering the stop mode, so that the second processing unit may access the syndrome registers to obtain this information when it responds to the trigger event, and therefore when it executes an interrupt service routine.
[0063] 3 is a flow diagram illustrating the operation of the system of FIG. 1 when handling an exception cause event detected in the first processing unit 10. In step 200, it is determined whether the first processing unit detects that an exception needs to be taken. If this is detected, in step 205, it is determined whether the exception cause event requires the first processing unit to enter a halt mode. As mentioned above, this may depend on the configuration of the exception event identification register 165. If the exception cause event does not require the first processing unit to enter a halt mode, processing proceeds to step 210, where the first processing unit handles the exception in a conventional manner. As mentioned above, this may involve the first processing unit changing to a higher exception level.
[0064] If it is determined that the exception cause event requires the first processing unit to enter the stopped mode, then in step 215 the first processing unit remains at the first processing unit's current exception level, enters the stopped mode, and asserts the trigger event.
[0065] The trigger event can be targeted to a particular processing unit that will handle the exception, or can instead be routed by an interrupt redistribution mechanism that determines which processing unit the trigger event should be directed to. Whatever mechanism is used, the trigger event is ultimately received by the appropriate second processing unit, which in response to the trigger event issues an interrupt in step 220 to stop any processing currently being performed by the second processing unit, and then executes an appropriate exception handling routine to handle the exception. The determination of the exception handling routine can be made in a general manner, for example by reference to the type of exception that occurred. Furthermore, information such as the interrupt number issued as part of the trigger event allows the second processing unit to determine which first processing unit issued the trigger event, and therefore which memory-mapped control interface 40 it will communicate with when executing the exception handling routine.
[0066] As shown in step 220, during the process of executing the exception handling routine, the second processing unit 20 will access and update the state information 10 of the first processing unit via the storage elements 45 of the memory-mapped control interface 40 of the first processing unit 10. This may include, for example, accessing and updating the contents of one or more registers in the register set 30, and accessing and updating one or more memory locations in the memory address space of the first processing unit.
[0067] The second processing unit will then signal a return from the exception on path 90 to the first processing unit in step 225, causing the first processing unit to exit halt mode and resume execution of program code.
[0068] 4A and 4B illustrate the enhanced protection afforded to data when employing the above approach. In particular, FIG. 4A illustrates the approach that would be employed without the present technique, i.e., a first processing unit handling its own exception by, for example, transitioning to a higher exception level and then executing the necessary exception handling routine at this higher exception level. Assume initially that application code is running on the first processing unit (called CPU0 in FIG. 4A) at the application exception level, and then, at point 250, a trap is made to an exception handling routine. In this example, assume that upon reaching point 250, the processing unit transitions to a higher exception level, for example, an exception level associated with the operating system software, and then the exception handling routine is executed under the control of the operating system.
[0069] Both the application code that was executing before the trap point 250 and the operating system code used to execute the exception handling routine access the local cache 230 in CPU0. During execution of the exception handling routine, various types of data may then be read from and written to the cache 230 by the operating system software. This may include operating system specific data 255, 265, which may be considered to be data that belongs to the operating system and is not shared with the application code, but may also include user data 260, such as updated state information for the application exception level, which is the type of data to make available to the application code once the exception handling routine has completed and the processing pipeline has returned to the application exception level to resume execution of the application code.
[0070] Assume that in step 270, the exception handling routine is completed, thereby causing the processor to return from the exception and transition back to the application exception level (e.g., exception level (EL) 0), after which CPU0 resumes processing the application code and accesses the cache 230. Although various mechanisms can be used to try to protect this data from being accessed by the application code after returning from the exception handling routine, for example, by flushing the operating system specific data 255, 265 from the cache or by protecting this data using some other mechanism, there has been increased concern recently over the security of such data and the potential for side channel attacks to be used to access this data.
[0071] FIG. 4B illustrates when and how the security of such data can be improved using the techniques described herein. In particular, again assume that CPU0 is executing application code at an application exception level, e.g., EL0, and then an exception causing event occurs at point 275, resulting in a trap to an exception handling routine. According to the techniques described above, at this point CPU0 enters a halt mode and ceases executing instructions. An interrupt is generated by a second processing unit, referred to in FIG. 4B as CPU1, due to the issuance of a trigger event. At point 280, CPU1 then begins executing the required exception handling routine, which again may involve executing code at an operating system exception level, e.g., EL1. However, because the required exception routine is being executed by CPU1, operating system private data ("private data") 282, 286 can be read from and written to CPU1's local cache 240. Conversely, user data 284 to be shared with application code is written to CPU0's local cache 230 through CPU0's control interface 235 using the mechanism described above, i.e., direct-mapped access to CPU0's memory address space via storage elements in the memory-mapped control interface 235.
[0072] Eventually the exception handling routine completes, thus causing processing to return from the exception in step 290, which causes CPU0 to resume executing application code. However, because of the physical separation between CPU0 and CPU1, none of the operating system sensitive data was written to CPU0's cache 230, significantly enhancing security.
[0073] Furthermore, when using the mechanism of FIG. 4B, CPU0 never transitions from the application exception level (e.g., exception level 0), and thus (contrary to the situation where CPU0 itself transitions to a higher exception level to handle an exception) cannot access the privileges associated with the higher exception level, so the overall security is enhanced.
[0074] When adopting the techniques described with reference to FIG. 4B, some performance benefits may also be realized. For example, during exception handling, data is not stored in the cache 230 of CPU0 that has no relation to exception level 0, so the steps do not require maintaining the security of the data at exception level 1 when the exception handling routine is completed. For example, when the exception handling routine is completed at point 290, there is no need to flush any data from the cache 230 of CPU0.
[0075] Note that the techniques described herein can be extended such that the second processing unit can utilize many of the control functions during the operation of the first processing unit. For example, the second processing unit 20 can stop the first processing unit (which can be considered, for example, as an application core), and can be considered to be in the form of a control core that can switch contexts at any time, for example, to time-share the application core among multiple user processes. Thus, by handling exceptions for one or more types of exception-causing events, in addition to the control core providing system services to the application core, such an approach also enables the application core to effectively provide computing services to the control core. A single control core can manage multiple application cores in such a scenario.
[0076] The processing units in which the above-described techniques can be used can be of various types. For example, as shown in Fig. 5A, each of the processing units can be a separate processor core. Thus, multiple first processing units 300, 310 can be provided, each with an associated control interface 305, 315 that is memory-mapped into the memory address space of a second processing unit, referred to in Fig. 5A as a control core 320.
[0077] When an exception causing event occurs in any of the cores 300, 310, which is of a type that causes the core to enter a halted mode and issue a trigger event, the trigger event can be routed to the control core 320. Based on the exception number, the control core can determine which core issued the trigger event and can then execute an appropriate exception handling routine to handle the exception, taking into account the type of exception that occurred. Using the techniques described above, the control core can access and update the necessary state of the core 300, 310 that issued the trigger event via the associated control interface 305, 315.
[0078] However, the processing units need not be separate processor cores as shown in FIG. 5A. Instead, the separate processing units can be separate threads within a multi-threaded core such as that shown in FIG. 5B. Thus, the multi-threaded core 330 can have multiple threads 335, 345, each of which can have an associated control interface 340, 350. Although the different threads can share some processing resources of the multi-threaded core 330, the threads effectively form separate processing elements, with their own registers, addressing spaces, operating at their own particular exception levels, etc. Thus, individual threads can operate in the same manner as the first processing unit described above, and issue trigger events to a second processing unit to cause the second processing unit to handle the exception on the thread's behalf. Thus, the control core 360 can handle exceptions in exactly the same manner as described above with reference to the illustration of FIG. 5A, with the exception number information being used to identify the particular thread within the multi-threaded core that issued the trigger event.
[0079] Note that while in FIG. 5B control core 360 is shown as a separate processor core, in other implementations control core 360 may itself be one of the threads within multi-threaded core 330.
[0080] FIG. 6 illustrates how the techniques described herein can be used to support nested exception handling. Thus, in this example, the first processing unit is in the form of an application core 370 with an associated control interface 375 that is mapped into the memory address space of a second processing unit, which in this example is control core 1 380. However, during processing performed by control core 1 380, it may also be the case that an exception causing event is detected within control core 1 which requires that an exception be taken and an appropriate exception handling routine be executed. In such cases, the exception handling routine may be executed within control core 1 380 itself, for example by transitioning to a higher exception level and executing an appropriate exception handling routine, although in one alternative embodiment, control core 1 380 may also have a control interface 385 that is memory mapped into the memory address space of control core 2 390. With such an approach, control core 1 can enter a stop mode for certain exception cause events and issue a trigger event to cause control core 2 390 to execute an appropriate exception handling routine, during which control core 2 390 can access and update the necessary state in control core 1 380 via control interface 385.
[0081] It will be appreciated that the scheme shown in Figure 6 can be optionally extended to provide more nested levels, if necessary. Such a mechanism provides significant flexibility. For example, it will be appreciated that in one case, each individual core can be configured to only operate at a single exception level, with all exception-causing events being routed to a separate core for handling. In some cases, this can mean that the concept of exception levels can be completely unnecessary.
[0082] As with FIG. 5B above, in FIG. 6, elements 370, 380, and 390 are assumed to be separate processor cores, although in alternative implementations these elements may be provided by separate threads within a multi-threaded core.
[0083] 7 illustrates an implementation in which an interrupt distributor 420 is provided in a system. In this example, there are multiple control cores 410, 415, each of which can be provided with memory-mapped access to one or more application cores 400, 440. The application cores have associated control interfaces 405, 445 arranged to provide direct-mapped access to certain state information within those application cores, as described above, by the control cores that execute interrupt service routines on behalf of the application cores.
[0084] In such an implementation, when the application core 400 issues a trigger event, this can be in the form of an interrupt request that is passed to the interrupt distributor 420. Thus, when the application core 400 asserts a trigger event, it can issue an interrupt request to the interrupt distributor 420 on path 425. The interrupt distributor will then use a mechanism to determine which control core to route the interrupt request to, and will send the interrupt request to either control core 1 410 on path 430 or control 2 415 on path 435. It will be appreciated that while only two control cores are shown in FIG. 7 for simplicity, in other implementations more control cores can be provided and thus there may be more options for the interrupt distributor 420 as to which destination control core the interrupt request should be propagated to.
[0085] Assuming the interrupt request is accepted by the control core to which it was directed, processing proceeds essentially as described above, with the control core executing the appropriate exception handling routine, during which load and / or store operations may be performed to storage elements in memory-mapped control interface 405 to access and update state information within application core 400. Once the exception handling routine is completed, application core 400 is notified of a return from the exception and then exits halt mode to resume execution of application code.
[0086] In Figure 7, reference is made to an application core and a control core, but it will be appreciated from Figure 6 above that the core issuing the interrupt request does not have to be an application core, and the core itself may be executing software at a higher exception level than the application code.
[0087] It will also be appreciated from the foregoing that the various cores shown in FIG. 7 need not be physically separate processor cores, but instead may be separate threads running on a multi-threaded core.
[0088] In one implementation, the cache structures accessed by the application core and the control core can be separate, although in some cases one or more of the levels of cache can be shared as shown illustratively in FIG. 8. In this example, the application core 470 includes a local level 1 cache 475, and the control core 480 also includes an associated level 1 cache 485. However, if desired, the application core 470 and the control core 480 can share a level 2 cache 490. On the other hand, in some implementations, it may be deemed undesirable to share a level 2 cache structure in order to enhance robustness against cache timing side channel attacks, such as the Spectre-based attacks discussed above, in which case the application core and the control core can include separate level 2 cache structures and separate level 1 cache structures, and in other implementations the approach shown in FIG. 8 may be entirely acceptable. In particular, it should still be possible with such an approach to obtain many of the benefits of being able to handle exceptions by separate cores using the stop modes described above, e.g., physical separation of exception levels, and in some cases being able to operate at only a single exception level, arrangements where certain cores can be configured to support only a subset of the possible exception levels. By allowing sharing of at least some cache structures, this increases the area in which the presently described techniques can be applied, making them more easily applied, for example, to individual threads in a multi-threaded core.
[0089] When employing the techniques described herein, several benefits can be realized while improving overall security through physical separation of exception levels. First, note that the application software running on the application core does not need to be modified. Furthermore, the control core does not need to be running at a higher exception level, and can even be running at exception level 0 if it is enabled with memory-mapped access to the application core in the manner described above. As also described above, the control core's exceptions can themselves be trapped and handled by another core, allowing exception handling to be arbitrarily nested.
[0090] Furthermore, assuming the application core can count on delegating this exception to the control core, this application core may only run a subset of the exception levels, for example only EL0 (thus running a pure data plane core), simplifying the design considerably.
[0091] In one particular implementation, all application and control cores can be arranged such that they only need to execute a single exception level, potentially making it possible to eliminate the need for exception levels entirely.
[0092] As mentioned above, in one example implementation, the memory-mapped control interface 40 provided within the first processing unit 10 can be formed by enhancing the capabilities of an existing debug interface to enable fast memory-mapped access by the control core and directly map access to associated register state and / or memory address space. It is noted that the improved memory-mapped interface will also support existing debug use cases with improved efficiency, allowing an external debugger to access the core's registers faster and to see memory, thus providing additional benefits beyond those associated with exception handling.
[0093] As mentioned above, in one implementation physically separate processor cores may be used, but in alternative implementations the individual processing units may be in the form of individual threads within a multi-threaded core. Thus, an exception causing event occurring in a first thread may cause that thread to enter a stopped mode and the exception to be evicted to another thread for handling, and this other thread may have memory-mapped access to the state of the first thread. The nested approach described above may be employed in one such example implementation, with each thread corresponding to a particular exception level, thus allowing exceptions that need to be handled at a particular exception level to be directed to a particular thread that can operate at that exception level.
[0094] As mentioned above, in some implementations, the storage elements in the memory-mapped control interface 40 can be configured to be highly configurable as to the type of exception causing event that will cause the first processing unit to enter a stopped mode and issue a trigger event that will result in an exception handling routine being executed by a different processing unit. In some cases, the first processing unit can be arranged to always respond to an exception in this manner, regardless of the exception causing event. In this case, it can be seen from FIG. 3 above that step 205 is effectively eliminated, so there is no path forward to step 210 where the first processing unit handles the exception. Instead, processing will proceed directly to step 215, where the processing unit will remain at the processing unit's current exception level, enter a stopped mode, and assert a trigger event. This can significantly simplify the complexity of the first processing unit.
[0095] In this application, the word "configured to ..." is used to mean that an element of an apparatus has a configuration that can perform a defined operation. In this context, "configuration" means an arrangement or manner of interconnection of hardware or software. For example, an apparatus can have dedicated hardware to perform a defined operation, or a processor or other processing device can be programmed to perform a function. "Configured to" does not mean that an apparatus element needs to be modified in any way to perform a defined operation.
[0096] Although illustrative embodiments of the invention have been described in detail herein with reference to the accompanying drawings, it will be understood that the invention is not limited to those precise embodiments, and that various changes, additions, and modifications can be made by those skilled in the art without departing from the scope and spirit of the invention as defined by the appended claims. For example, various combinations of the features of the dependent claims can be made with the features of the independent claims without departing from the scope of the invention.
Claims
1. 1. A system comprising: a first processing unit for executing program code; a second processing unit; the first processing unit comprising a control interface that is mapped into a memory address space of the second processing unit and that is configured to provide the second processing unit with direct-mapped access to state information of the first processing unit; the first processing unit, in response to at least one exception cause event, entering a stop mode in which the first processing unit stops execution of the program code and issues a trigger event; the second processing unit executes, in response to the trigger event, the exception handling routine, the second processing unit being arranged to access state information of the first processing unit via the control interface to modify the state information as required by the exception handling routine; the second processing unit is arranged to cause the first processing unit to exit the halt mode and resume execution of the program code upon completion of the exception handling routine; the first processing unit being arranged to remain at its current exception level when entering the halted mode, and the second processing unit being arranged to execute the exception handling routine at a selected exception level; The system further comprises a third processing unit; the third processing unit comprising a further control interface that is mapped into the memory address space of the second processing unit and that is configured to provide the second processing unit with direct mapped access to state information of the third processing unit; the third processing unit, in response to at least one exception cause event, enters the stopped mode in which the third processing unit stops execution and issues the trigger event; The system, wherein the trigger event includes information that enables the second processing unit to determine whether the trigger event was issued by the first processing unit or the third processing unit, and to determine whether the first processing unit or the third processing unit should be accessed when executing the exception handling routine.
2. 2. The system of claim 1, wherein the state information of the first processing unit includes contents of a set of registers of the first processing unit used to store data processed by the first processing unit when executing the program code.
3. 3. The system of claim 2, wherein the control interface provides a set of storage elements mapped into the memory address space of the second processing unit to provide direct-mapped access to the set of registers by the second processing unit.
4. 4. The system of claim 1, wherein the state information of the first processing unit comprises data stored in at least a portion of a memory address space of the first processing unit.
5. 5. The system of claim 4, wherein said at least a portion of said memory address space of said first processing unit forms a secondary address space of said second processing unit.
6. 5. The system of claim 4, wherein the control interface provides a block of storage elements mapped into the memory address space of the second processing unit, each storage element in the block being directly mapped to a corresponding memory location in the at least a portion of the memory address space of the first processing unit.
7. 7. The system of claim 6, wherein the control interface comprises mapping storage configurable to identify the direct mapping between the Storage Elements in the block of Storage Elements and the corresponding memory locations in the at least a portion of the memory address space of the first processing unit.
8. 8. The system of claim 1, wherein the control interface comprises an exception event identification storage configurable to identify which exception cause event, when encountered during execution of the program code by the first processing unit, will cause the first processing unit to enter the stopped mode and issue the trigger event.
9. 9. The system of claim 8, wherein the exception event identification storage is configured to identify that, if an exception cause event occurs that would require the first processing unit to transition to a specified exception level if an exception cause event is handled by the first processing unit, the first processing unit will enter the stopped mode and issue the trigger event.
10. 2. The system of claim 1, wherein the selected exception level is an exception level higher than the current exception level of the first processing unit.
11. 11. The system of claim 1, wherein the control interface comprises syndrome storage mapped into the memory address space of the second processing unit and written by the first processing unit to provide information used by the second processing unit to assist in identifying why the first processing unit entered the stop mode.
12. 12. The system of claim 1, wherein the first processing unit is an application processing unit, the program code is application program code, and the second processing unit is a control processing unit.
13. 13. The system of claim 1, wherein the first processing unit and the second processing unit are provided by separate processor cores.
14. 14. The system of claim 1, wherein the first processing unit and the second processing unit comprise separate cache structures for at least a subset of cache levels in the system.
15. 15. The system of claim 1, wherein the first processing unit and the second processing unit are provided by separate threads of a multi-threaded processor core.
16. 16. The apparatus of claim 1, wherein at least one of the first processing unit and the second processing unit is restricted to only operating at a single exception level.
17. The second processing unit: a processing unit to which said trigger event is issued; A processing unit among a number of processing units that are capable of responding to said trigger event.
17. The device according to claim 1, wherein the first and second electrodes are connected to each other.
18. 1. A system comprising: a first processing unit for executing program code; A second processing unit; Equipped with the first processing unit comprising a control interface that is mapped into a memory address space of the second processing unit and that is configured to provide the second processing unit with direct-mapped access to state information of the first processing unit; the first processing unit, in response to at least one exception cause event, entering a stop mode in which the first processing unit stops execution of the program code and issues a trigger event; the second processing unit executes, in response to the trigger event, the exception handling routine, the second processing unit being arranged to access state information of the first processing unit via the control interface to modify the state information as required by the exception handling routine; the second processing unit is arranged to cause the first processing unit to exit the halt mode and resume execution of the program code upon completion of the exception handling routine; the first processing unit being arranged to remain at its current exception level when entering the halted mode, and the second processing unit being arranged to execute the exception handling routine at a selected exception level; The system further comprises an additional processing unit; the second processing unit comprising a second control interface that is mapped into a memory address space of the additional processing unit and that is configured to provide the additional processing unit with direct-mapped access to state information of the second processing unit; the second processing unit, in response to at least one exception cause event, enters the stopped mode in which it halts execution of program code executing on the second processing unit and issues a further trigger event; the additional processing unit executes a further exception handling routine, the further processing unit being arranged to, in response to the further trigger event, access state information of the second processing unit via the second control interface to modify the state information as required by the further exception handling routine; the additional processing unit is arranged to, upon completion of the further exception handling routine, cause the second processing unit to exit the stopped mode and resume execution of the program code running on the second processing unit.
19. a second processing unit, an execution circuit for executing an exception handling routine in response to a trigger event issued by a first processing unit, the trigger event indicating that the first processing unit has entered a halted mode in which execution of program code by the first processing unit is halted with the first processing unit at a current exception level; a communications interface arranged for the second processing unit to access a control interface of the first processing unit while executing the exception handling routine at a selected exception level, the control interface being mapped into a memory address space of the second processing unit and configured to provide the second processing unit with directly mapped access to state information of the first processing unit; Equipped with the second processing unit is arranged to access the state information of the first processing unit via the control interface to modify the state information of the first processing unit as required by the exception handling routine; the second processing unit is arranged to cause the first processing unit to exit the halt mode and resume execution of the program code upon completion of the exception handling routine; via said communication interface, said second processing unit is arranged to access a further control interface of a third processing unit, said further control interface being mapped into said memory address space of said second processing unit and configured to provide said second processing unit with directly mapped access to state information of said third processing unit; A second processing unit, wherein the trigger event includes information that enables the second processing unit to determine whether the trigger event was issued by the first processing unit or the third processing unit and to determine whether the first processing unit or the third processing unit should be accessed when executing the exception handling routine.
20. a second processing unit, an execution circuit for executing an exception handling routine in response to a trigger event issued by a first processing unit, the trigger event indicating that the first processing unit has entered a halted mode in which execution of program code by the first processing unit is halted with the first processing unit at a current exception level; a communications interface arranged for the second processing unit to access a control interface of the first processing unit while executing the exception handling routine at a selected exception level, the control interface being mapped into a memory address space of the second processing unit and configured to provide the second processing unit with directly mapped access to state information of the first processing unit; Equipped with the second processing unit is arranged to access the state information of the first processing unit via the control interface to modify the state information of the first processing unit as required by the exception handling routine; the second processing unit is arranged to cause the first processing unit to exit the halt mode and resume execution of the program code upon completion of the exception handling routine; the second processing unit comprising a second control interface configured to be mapped into a memory address space of an additional processing unit and to provide the additional processing unit with direct mapped access to state information of the second processing unit; the second processing unit, in response to at least one exception cause event, enters the stopped mode to halt execution of program code executing on the second processing unit and issues a further trigger event to cause the additional processing unit to execute a further exception handling routine; a second processing unit arranged to, upon completion of the further exception handling routine, exit the stop mode and resume execution of the program code running on the second processing unit.
21. 1. A method of handling an exception cause event in a system comprising a first processing unit for executing program code and a second processing unit, the method comprising: providing a control interface to the first processing unit, the control interface being mapped into a memory address space of the second processing unit and configured to provide the second processing unit with direct mapped access to state information of the first processing unit; in response to at least one exception cause event in the first processing unit, placing the first processing unit into a stop mode in which the first processing unit stops execution of the program code and issues a trigger event; in response to the trigger event, the second processing unit executes an exception handling routine that accesses the state information of the first processing unit via the control interface to modify the state information as required by the exception handling routine; upon completion of the exception handling routine by the second processing unit, the first processing unit exiting the halt mode and resuming execution of the program code. Including, 1. A method according to claim 1, wherein the first processing unit is arranged to remain at its current exception level when entering the halt mode, and the second processing unit is arranged to execute the exception handling routine at a selected exception level, The method further comprises: In response to the at least one exception cause event, causing a third processing unit to enter the stopped mode in which the third processing unit stops execution and issues the trigger event. Including, the third processing unit comprising a further control interface that is mapped into the memory address space of the second processing unit and configured to provide the second processing unit with direct mapped access to state information of the third processing unit; The method, wherein the trigger event includes information that enables the second processing unit to determine whether the trigger event was issued by the first processing unit or the third processing unit and to determine whether the first processing unit or the third processing unit should be accessed when executing the exception handling routine.
22. 1. A method of handling an exception cause event in a system comprising a first processing unit for executing program code and a second processing unit, the method comprising: providing a control interface to the first processing unit, the control interface being mapped into a memory address space of the second processing unit and configured to provide the second processing unit with direct mapped access to state information of the first processing unit; in response to at least one exception cause event in the first processing unit, placing the first processing unit into a stop mode in which the first processing unit stops execution of the program code and issues a trigger event; in response to the trigger event, the second processing unit executes an exception handling routine that accesses the state information of the first processing unit via the control interface to modify the state information as required by the exception handling routine; upon completion of the exception handling routine by the second processing unit, the first processing unit exiting the halt mode and resuming execution of the program code. Including, 1. A method according to claim 1, wherein the first processing unit is arranged to remain at its current exception level when entering the halt mode, and the second processing unit is arranged to execute the exception handling routine at a selected exception level, The method further comprises: Responsive to at least one exception causing event, causing the second processing unit to stop execution of program code executing on the second processing unit and enter the stopped mode for issuing further trigger events. Including, the second processing unit comprising a second control interface configured to be mapped into a memory address space of an additional processing unit and to provide the additional processing unit with direct mapped access to state information of the second processing unit; The method further comprises: in response to the further triggering event, causing the additional processing unit to execute a further exception handling routine arranged to access state information of the second processing unit via the second control interface to modify the state information as required by the further exception handling routine; upon completion of the further exception handling routine, causing the additional processing unit to cause the second processing unit to exit the halt mode and resume execution of the program code executing on the second processing unit; upon completion of the further exception handling routine, the additional processing unit causes the second processing unit to exit the halt mode and resume execution of program code executing on the second processing unit. A method comprising:
Citation Information
Patent Citations
Microcomputer system and microcomputer used therefor
JP1995064937A
System and method for processing interruption of asymmetrical multiprocessor architecture and exceptional event
JP1998154080A
Information processing device
JP2016091076A
Management of asynchronous interrupts in a transactional memory multiprocessor environment
US20170177338A1
