Scheduling secure code segments on the processor cores of a processing unit
Patent Information
- Application Number
- JP2024531095
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-12-03
- Filing Date
- 2022-11-09
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-11-09
AI Technical Summary
Existing multithreaded processor systems struggle to efficiently manage secure code segments, leading to reduced performance and increased interference between threads, especially when secure execution is required for only a portion of the workload.
A method and system for scheduling secure code segments on processor cores using secure operating parameters to ensure exclusive secure execution, including uninterrupted execution, purging of design and non-design states, and adjusting thread priorities based on execution time and events.
This approach reduces interference and failures, improves system performance by ensuring secure threads have priority, and optimizes resource utilization through efficient scheduling of secure code segments.
Abstract
Description
[Technical field]
[0001] The present invention relates generally to data processing systems, and more particularly to a computer-implemented method, computer system, computer program product, and data processing system for scheduling secure code segments on a processor core of a processing unit. [Background technology]
[0002] A multithreaded processor may include multiple hardware threads that can execute simultaneously. One example of a multithreaded processor may be a simultaneous multithreaded (SMT) processor. Simultaneous multithreading allows instructions from more than one thread at a time to execute at any given instruction pipeline stage. Simultaneous multithreading may therefore allow multiple independent threads of execution to better utilize resources provided by the processor architecture. Simultaneous multithreading allows each processor in a virtual machine to be presented to an application as n processors, called threads.
[0003] Processes or threads from different customers, in the cloud or on-premise, can be virtualized on virtual machines (VMs) or containers and run on the same physical core. It is common to request that threads run in single-threaded mode.
[0004] One implementation of a pipeline for secure multi-threaded execution may be an integrated circuit for executing instructions, the integrated circuit including: a processor pipeline configured to execute instructions from two or more threads in parallel using execution units of the processor pipeline; and thread hazard circuitry configured to detect when an instruction of a first thread is designated as a sensitive instruction and, in response to detecting the sensitive instruction, to prevent instructions of threads other than the first thread from being executed using the execution units of the processor pipeline while the sensitive instruction is being executed by the execution units of the processor pipeline.
[0005] This implementation can only protect a single instruction that verifies that the architected state of a thread is isolated, and cannot take into account non-architected state.
[0006] While it is possible to permanently reserve cores for all secure work, this can effectively reduce overall processor performance if not performing secure work all the time, and this does not scale even if the majority of the work on a computer system requires a secure environment to run. Summary of the Invention
[0007] A computer-implemented method for scheduling secure code segments among threads on processor cores of a processing unit is proposed, the processing unit being configured to run, by at least one processor core, a first execution mode to execute program code on the at least one processor core and to execute program code of operational instructions of the threads on the at least one processor core, and for at least one of the threads, secure operation parameters are defined that control a requirement for exclusive secure execution of the secure code segments of the program code on the at least one processor core. The method includes at least requesting, by a first thread, exclusive secure execution of a secure code segment of program code on the at least one processor core, validating the request based on a secure operating parameter, configuring the at least one processor core for exclusive secure execution for the secure code segment when the secure operating parameter is below a predefined threshold, uninterruptibly executing the secure code segment on the at least one processor core, clearing architected and unarchitected state from the at least one processor core, increasing a secure operating parameter of the first thread based on an uninterrupted secure execution time of at least the first thread, configuring the at least one processor core to a first execution mode for executing the program code on the at least one processor core, periodically resetting the secure operating parameter, and switching to another thread when the secure operating parameter is greater than a predefined threshold.
[0008] According to the proposed method, a scheduling of secure code segments on a processor core of a processing unit is provided. Thus, for code segments that require execution in a secure container or secure execution mode that would otherwise block the processor core for a longer period of time, a secure execution of the code segment on a shared physical core is provided. This includes hardware circuitry and / or hypervisor code that checks that a thread requesting secure context execution has sufficient priority and, if not, does not change to exclusive secure execution, switches to another thread or switches back to the scheduler. The hardware circuitry and / or hypervisor code updates the priority of the thread when it leaves exclusive secure execution.
[0009] A secure code segment may require an exclusive secure context for at least a minimum amount of time and / or a minimum number of operational instructions, including at least securely placing a physical core into an exclusive secure mode under hardware control, executing uninterrupted for a minimum amount of time and / or a minimum number of operational instructions, and finally flushing at least architected and unarchitected state from cache storage or registers or memory of the physical core when exiting the secure code segment or when interrupting after an initial period and / or a minimum number of operational instructions.
[0010] Advantageously, interference between different code segments within a processor core can be avoided. The number of faults during the execution of a code segment can be reduced. Furthermore, preferably, the performance of a computer system can be improved by the proposed method of scheduling secure operation of secure code segments within a processor core.
[0011] According to an embodiment of the present invention, additionally or alternatively, when the secure operation parameter falls below a predefined threshold, the secure operation parameter of other threads, except the first thread, can be decreased based on at least the uninterrupted secure execution time of the first thread. The secure operation parameter, as a kind of priority counter, takes into account the uninterrupted secure execution time of the first thread. Alternatively, the secure operation parameter can also be implemented as a counter that takes into account the number of secure execution events by the same thread. Thus, if a thread has been running for a longer period on a processor core, the priority of the thread can be reduced. Thus, after the execution of the thread is finished, the priority of the first thread is reduced, which means that the priority of the other threads is increased by decreasing the secure operation parameter.
[0012] According to an embodiment of the present invention, the secure operating parameters of all threads may additionally or alternatively be decreased at periodic time intervals, thus improving the chances for each thread to equally obtain priority for a successful request for exclusive secure execution. The periodic time interval may be several minutes.
[0013] According to an embodiment of the present invention, additionally or alternatively, the secure operation parameters of the first thread can be updated under hardware control after leaving the exclusive secure execution mode. The secure operation parameters can be reduced by the amount of uninterrupted secure execution time or by the number of secure execution events if the secure operation parameters are implemented as a counter. Preferably, the risk of software failure and subsequent improper scheduling can be reduced.
[0014] According to an embodiment of the present invention, additionally or alternatively, after exiting the exclusive secure execution mode, the secure operating parameters of the first thread may be updated by the hypervisor code. The management of the secure operating parameters may advantageously be performed by the hypervisor.
[0015] According to an embodiment of the present invention, a request for exclusive secure execution of a secure code segment of program code on at least one processor core may additionally or alternatively be determined based on at least the secure operating parameters and / or the duration of the requested exclusive secure execution, so that not only the actual priority status of the secure operating parameters but also the estimated execution time in the exclusive secure execution mode may be taken into account to determine whether the request of the thread is granted or not.
[0016] According to an embodiment of the present invention, the secure operation parameter can additionally or alternatively be implemented as a priority parameter of a thread. The secure operation parameter can take into account the uninterrupted secure execution time of a first thread as a kind of priority counter. Alternatively, the secure operation parameter can also be implemented as a counter taking into account the number of secure execution events by the same thread. Advantageously, a priority of each thread for granting requests for exclusive secure execution can be defined.
[0017] According to one embodiment of the invention, the secure operation parameter may additionally or alternatively be implemented based on a counter of exclusive secure executions of threads, such that the number of completed exclusive secure executions may control the priority of threads for granting requests for exclusive secure execution.
[0018] Additionally or alternatively, according to an embodiment of the invention, the first execution mode of the processor core may be a simultaneous multithreading mode, which allows multiple independent threads of execution to better utilize resources provided by the processor architecture and is the normal execution mode of a typical processor core.
[0019] According to an embodiment of the present invention, the operating instructions may additionally or alternatively be implemented on a virtual machine or in a container. Preferably, processes / threads running on the same physical core from different customers in the cloud or on-premise may be virtualized on a virtual machine or container.
[0020] According to an embodiment of the present invention, additionally or alternatively, an exclusive secure execution of a secure code segment of a program code can be requested on a virtual machine or in a container. Preferably, processes or threads running on the same physical core from different customers in the cloud or on-premise can be virtualized on a virtual machine or in a container. Thus, a request for an exclusive secure execution of a secure code segment of a program code can also be directed to a virtual machine or a container in this way.
[0021] Further, a computer system for scheduling secure code segments among threads on a processor core of a processing unit is proposed, the processing unit being configured by at least one processor core. The computer system includes at least one processor unit having at least one processor core, the processor core being configured to run a first execution mode to execute program code on the at least one processor core and to execute program code of operational instructions of the threads on the at least one processor core. For at least one of the threads, secure operation parameters are defined that control a requirement for exclusive secure execution of the secure code segments of the program code on the at least one processor core.
[0022] The computer system is configured to perform a method including at least a first thread requesting exclusive secure execution of a secure code segment of program code on at least one processor core; validating the request based on a secure operating parameter; setting the at least one processor core to exclusive secure execution for the secure code segment when the secure operating parameter is below a predefined threshold; uninterruptibly executing the secure code segment on the at least one processor core; clearing architected and non-architected state from the at least one processor core; increasing a secure operating parameter of the first thread based on an uninterrupted secure execution time of at least the first thread; setting the at least one processor core to a first execution mode for executing the program code on the at least one processor core; periodically resetting the secure operating parameter; and switching to another thread when the secure operating parameter is greater than a predefined threshold.
[0023] On the proposed computer system, a secure operation scheduling of secure code segments on a processor core of a processing unit is provided. Thus, for code segments that require execution in a secure container or secure execution mode that would otherwise block the processor core for a longer period of time, a secure execution of the code segment on a shared physical core is provided. This includes hardware circuitry and / or hypervisor code that checks that a thread requesting secure context execution has sufficient priority and, if not, does not change to exclusive secure execution, switches to another thread, or switches back to the scheduler. The hardware circuitry and / or hypervisor code updates the priority of the thread when it leaves exclusive secure execution.
[0024] A secure code segment may require an exclusive secure context for at least a minimum amount of time and / or a minimum number of operational instructions, including at least securely placing a physical core into an exclusive secure mode under hardware control, executing uninterrupted for a minimum amount of time and / or a minimum number of operational instructions, and finally flushing at least architected and non-architected state from cache storage or registers or memory of the physical core when exiting the secure code segment or when interrupting after an initial period and / or a minimum number of operational instructions.
[0025] Advantageously, interference between different code segments within a processor core can be avoided. The number of faults during the execution of a code segment can be reduced. Furthermore, preferably, the performance of a computer system can be improved by the proposed method of scheduling secure operation of secure code segments within a processor core.
[0026] According to an embodiment of the present invention, additionally or alternatively, the computer system may be configured to reduce a secure operation parameter of other threads, except the first thread, based on at least the uninterrupted secure execution time of the first thread. The secure operation parameter, as a kind of priority counter, takes into account the uninterrupted secure execution time of the first thread. Alternatively, the secure operation parameter may also be implemented as a counter that takes into account the number of secure execution events by the same thread. Thus, if a thread has been running on a processor core for a longer period of time, the priority of the thread may be reduced. Thus, after the execution of the thread is finished, the priority of the first thread is reduced, which means that the priority of the other threads is increased by reducing the secure operation parameter.
[0027] According to an embodiment of the present invention, additionally or alternatively, the computer system may be configured to decrease the secure operation parameters of all threads at periodic time intervals, thus improving the likelihood for each thread to equally obtain priority for a successful request for exclusive secure execution. The periodic time interval may be several minutes.
[0028] According to an embodiment of the present invention, additionally or alternatively, the computer system may be configured to update, under hardware control, a secure operating parameter of the first thread after leaving the exclusive secure execution mode. The secure operating parameter may be reduced by the amount of uninterrupted secure execution time, or by the number of secure execution events if the secure operating parameter is implemented as a counter. Preferably, the risk of software failure and subsequent improper scheduling may be reduced.
[0029] According to an embodiment of the invention, additionally or alternatively, the computer system may be configured to update, by the hypervisor code, the secure operating parameters of the first thread after exiting the exclusive secure execution mode. The management of the secure operating parameters may advantageously be performed by the hypervisor.
[0030] According to an embodiment of the present invention, additionally or alternatively, the computer system may be configured to determine a request for exclusive secure execution of a secure code segment of the program code on at least one processor core based on at least the secure operating parameters and / or the duration of the requested exclusive secure execution, so that the actual priority status of the secure operating parameters as well as the estimated execution time in the exclusive secure execution mode may be taken into account to determine whether the thread's request is granted or not.
[0031] According to an embodiment of the present invention, the secure operation parameter can additionally or alternatively be implemented as a priority parameter of a thread. The secure operation parameter can take into account the uninterrupted secure execution time of a first thread as a kind of priority counter. Alternatively, the secure operation parameter can also be implemented as a counter taking into account the number of secure execution events by the same thread. Advantageously, a priority of each thread for granting requests for exclusive secure execution can be defined.
[0032] According to one embodiment of the invention, the secure operation parameter may additionally or alternatively be implemented based on a counter of exclusive secure executions of threads, such that the number of completed exclusive secure executions may control the priority of threads for granting requests for exclusive secure execution.
[0033] Additionally or alternatively, according to an embodiment of the invention, the first execution mode of the processor core may be a simultaneous multithreading mode, which allows multiple independent threads of execution to better utilize resources provided by the processor architecture and is the normal execution mode of a typical processor core.
[0034] According to an embodiment of the present invention, the operating instructions may additionally or alternatively be implemented on a virtual machine or in a container. Preferably, processes / threads running on the same physical core from different customers in the cloud or on-premise may be virtualized on a virtual machine or container.
[0035] According to an embodiment of the present invention, additionally or alternatively, the computer system can be configured to request exclusive secure execution of a secure code segment of the program code on a virtual machine or in a container. Preferably, processes / threads running on the same physical core from different customers in the cloud or on-premise can be virtualized on a virtual machine or container. Thus, requests for exclusive secure execution of a secure code segment of the program code can also be directed to a virtual machine or container in this way.
[0036] Further proposed is a preferred computer program product for scheduling secure code segments among threads on processor cores of a processing unit, the processing unit being configured to run, by at least one processor core, a first execution mode to execute program code on the at least one processor core and to execute program code of operational instructions of the threads on the at least one processor core, for at least one of the threads secure operation parameters are defined that control a requirement for exclusive secure execution of the secure code segments of the program code on the at least one processor core.
[0037] The computer program product comprises a computer readable storage medium having program instructions embodied therein, the program instructions including: causing a first thread to request exclusive secure execution of a secure code segment of program code on at least one processor core; validating the request based on a secure operating parameter; setting the at least one processor core to exclusive secure execution for the secure code segment when the secure operating parameter falls below a predefined threshold; uninterruptibly executing the secure code segment on the at least one processor core; and clearing architected and non-architected state from the at least one processor core. The method is executable to cause the computer system to perform a method including increasing a secure operating parameter of the first thread based on an uninterrupted secure execution time of at least the first thread when the secure operating parameter is greater than a predefined threshold, or decreasing a secure operating parameter of other threads except the first thread based on an uninterrupted secure execution time of at least the first thread, configuring at least one processor core into a first execution mode for executing program code on the at least one processor core, periodically resetting the secure operating parameter, and switching to another thread when the secure operating parameter is greater than a predefined threshold.
[0038] Furthermore, a data processing system is proposed for executing a data processing program comprising computer readable program instructions for carrying out the method described above.
[0039] The present invention, together with these and other objects and advantages, can best be understood from the following detailed description of illustrative embodiments, to which the invention is not limited. [Brief description of the drawings]
[0040] [Figure 1] 4 is a flow diagram of a computer-implemented method for scheduling secure code segments among threads on a processor core of a processing unit according to one embodiment of the present invention. [Diagram 2] 5 is a flow diagram of a computer-implemented method for scheduling secure code segments among threads on a processor core of a processing unit according to a further embodiment of the present invention. [Diagram 3] FIG. 1 illustrates an exemplary embodiment of a data processing system for performing the method according to the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0041] In the drawings, like elements are referred to by the same reference numerals. These drawings are merely schematic representations and are not intended to describe the specific parameters of the invention. Moreover, these drawings are intended to depict only typical embodiments of the invention and therefore should not be considered as limiting the scope of the invention.
[0042] Exemplary embodiments described herein provide a computer system for scheduling secure code segments among threads on a processor core of a processing unit, the processing unit being configured with at least one processor core. The computer system includes at least one processor unit having at least one processor core, the processor core configured to run a first execution mode to execute program code on the at least one processor core and to execute program code of operational instructions of the threads on the at least one processor core. For at least one of the threads, secure operation parameters are defined that control a requirement for exclusive secure execution of the secure code segments of the program code on the at least one processor core.
[0043] An exemplary embodiment includes a method for implementing a method of a secure code segment of program code, the method comprising: (i) a first thread requesting exclusive secure execution of a secure code segment of program code on at least one processor core; (ii) verifying the request based on a secure operating parameter; and (iii) if the secure operating parameter is below a predefined threshold, (iii.1) configuring the at least one processor core for exclusive secure execution for the secure code segment; (iii.2) uninterruptibly executing the secure code segment on the at least one processor core; (iii.3) clearing architected and non-architected state from the at least one processor core; and (iii.4) resetting the at least one processor core to the secure execution state. If the cure operation parameter is greater than a predefined threshold, the method may further include at least: (iii.5) increasing the secure operation parameter of the first thread based on an uninterrupted secure execution time of at least the first thread, or decreasing the secure operation parameters of other threads except the first thread based on an uninterrupted secure execution time of at least the first thread; (iii.6) setting at least one processor core to a first execution mode for the program code on the at least one processor core; and (iii.7) periodically resetting the secure operation parameter, and otherwise switching to another thread.
[0044] FIG. 1 illustrates a flow diagram of a computer-implemented method for scheduling secure code segments among threads on a processor core of a processing unit 216 illustrated in FIG. 3 according to one embodiment of the present invention.
[0045] The processing unit 216 is configured to run, by the at least one processor core, a first execution mode to execute program code on the at least one processor core, where program code of operational instructions of the threads are executed as normal execution in the first execution mode on the at least one processor core.
[0046] A first execution mode of the processor core may be a simultaneous multithreading mode. Simultaneous multithreading allows multiple independent threads of execution to better utilize resources provided by the processor architecture and is the normal execution mode of a typical processor core.
[0047] The operating instructions can be implemented on a virtual machine or a container. Preferably, processes / threads running on the same physical core from different customers in the cloud or on-premise can be virtualized on a virtual machine or in a container.
[0048] According to the proposed method, for at least one of the threads, a secure operation parameter is defined that controls a request for exclusive secure execution of a secure code segment of the program code on at least one processor core. The secure operation parameter serves as a priority parameter for the thread. For example, the secure operation parameter can be implemented based on a counter of exclusive secure execution of the thread.
[0049] In step S100 of the process flow shown in FIG. 1, on at least one processor core, program code of operational instructions for a thread is executed in a first execution mode as the normal execution mode of the processor core.
[0050] In step S102, a first thread requests exclusive secure execution of a secure code segment of program code on at least one processor core. The requesting of exclusive secure execution of the secure code segment of program code may be performed on a virtual machine or in a container, depending on the configuration of the computer system 212.
[0051] Next, in step S104, the request is confirmed based on the secure operating parameters. The determining about the request for exclusive secure execution of the secure code segment of the program code on the at least one processor core may be performed based on at least the secure operating parameters and / or a duration of the requested exclusive secure execution.
[0052] If the secure operation parameter is below a predefined threshold, i.e., if the thread has high priority for exclusive secure execution, the process may execute step S106, in which the exclusive secure execution is implemented by setting at least one processor core to exclusive secure execution for the secure code segment, uninterruptibly executing the secure code segment on the at least one processor core, and finally flushing engineered and non-engineered state from at least one cache storage or register or memory of the at least one processor core.
[0053] After terminating the exclusive secure execution, in step S108, a secure operation parameter of the first thread is increased based at least on the uninterrupted secure execution time of the first thread, thereby reducing the priority of the thread for further exclusive secure execution.
[0054] Alternatively or additionally, in step S110, secure operation parameters of other threads, except for the first thread, may be decreased based on at least the uninterrupted secure execution time of the first thread, thereby increasing the priority of the other threads for granting requests for exclusive secure execution.
[0055] Thus, step S110 may be optional. Additionally, in an alternative embodiment, step S110 may still be performed after step S108 is completed.
[0056] Updating the secure operating parameters of the first thread after exiting the exclusive secure execution mode may be realized under hardware control.
[0057] Alternatively, the secure operating parameters of the first thread may be updated by the hypervisor code after exiting the exclusive secure execution mode.
[0058] Next, in step S112, the at least one processor core is set to a first execution mode for the program code on the at least one processor core to continue normal execution.
[0059] If, in the above check in step S104, the secure operating parameter does not fall below the predefined threshold, processing is switched to another thread in step S114.
[0060] FIG. 2 illustrates a flow diagram of a computer-implemented method for scheduling secure operation of secure code segments on a processor core of a processing unit 216 according to a further embodiment of the present invention.
[0061] The secure operation parameter in this embodiment is implemented as a secure_counter that takes into account the number of secure execution events by the same thread or the duration of an exclusive secure execution period. This means that after realizing an exclusive secure execution period on a processor core, the secure operation parameter can be increased by one or by the duration of the exclusive secure execution.
[0062] The process flow may begin at step S200. First, in step S202, a secure operation parameter for the current thread, known as secure_counter, is set to 0 in this embodiment.
[0063] In step S204, the first execution is performed as a normal execution of the operational instruction of the thread.
[0064] Next, in step S206, a request for exclusive secure execution is placed by the thread.
[0065] In step S208, a check can be made as to whether the thread's secure_counter is below a secure operation threshold named secure_limit, which means that the thread has high priority for granting exclusive secure operation.
[0066] If the thread's secure_counter falls below this threshold, the process proceeds to step S210 where exclusive secure execution is set.
[0067] After terminating the exclusive secure execution, in step S212, the secure_counter of the first thread is increased by one, or for the duration of the exclusive secure execution, thus reducing the priority of the thread.
[0068] Step S214 may be an optional alternative or additional step to step S212, in which the secure_counter of all threads except the first thread currently being processed may be correspondingly decreased if their secure_counters are greater than 0, thereby increasing the priority of the other threads for granting requests for exclusive secure execution.
[0069] Then, in step S216, the processor core returns to normal execution.
[0070] If the check in step S208 shows that the secure_counter of the thread is not below the predefined secure_limit threshold, this means that the thread has a low priority for exclusive secure operation, and in step S220, processing is switched to another thread.
[0071] After returning to normal execution in step S216 or switching to another thread in step S220, in step S218, if the secure_counter of the corresponding thread is greater than 0, the secure_counter of all threads is periodically decremented, and normal execution continues in step S204. The period for decrementing the secure_counter can be defined, which can be every minute, or another suitable time interval.
[0072] 3 shows an exemplary embodiment of a data processing system 210 for executing the method according to the invention. The data processing system 210 comprises a computer system 212 for executing the proposed method according to an embodiment of the invention.
[0073] The computer system 212 is configured to schedule secure code segments among threads on a processor core of the processing unit 216, the processing unit 216 being configured by at least one processor core having at least one cache storage. The computer system 212 includes at least one processor unit 216 having at least one processor core having at least one cache storage. The processor core is configured to run a first execution mode to execute program code on the at least one processor core and to execute program code of operational instructions of the threads on the at least one processor core. For at least one of the threads, secure operation parameters are defined that control a requirement for exclusive secure execution of the secure code segments of the program code on the at least one processor core.
[0074] The computer system 212 includes: (i) a first thread requesting exclusive secure execution of a secure code segment of program code on at least one processor core; (ii) verifying the request based on a secure operation parameter; and (iii) if the secure operation parameter is below a predefined threshold, (iii.1) setting the at least one processor core to exclusive secure execution for the secure code segment; (iii.2) uninterruptibly executing the secure code segment on the at least one processor core; (iii.3) clearing engineered and non-engineered state from the at least one processor core; and (iii. (iii.4) if the secure operation parameter is greater than a predefined threshold, increasing the secure operation parameter of the first thread based on an uninterrupted secure execution time of at least the first thread or decreasing the secure operation parameters of other threads, except for the first thread, based on an uninterrupted secure execution time of at least the first thread; (iii.5) setting at least one processor core to a first execution mode for the program code on the at least one processor core; and (iii.6) periodically resetting the secure operation parameter and switching to another thread otherwise.
[0075] The computer system 212 may be configured to decrease a secure operation parameter of other threads, excluding the first thread, based on the uninterrupted secure execution time of at least the first thread.
[0076] The computer system may be further configured to decrease the secure operating parameters of all threads at periodic time intervals.
[0077] The computer system may be further configured to update, under hardware control, secure operating parameters of the first thread after exiting the exclusive secure execution mode.
[0078] The computer system may be further configured to update, by the hypervisor code, secure operating parameters of the first thread after exiting the exclusive secure execution mode.
[0079] The computer system may be further configured to determine a request for exclusive secure execution of the secure code segment of the program code on the at least one processor core based on at least the secure operating parameters and / or a duration of the requested exclusive secure execution.
[0080] The secure operation parameter may be implemented as a priority parameter of a thread.
[0081] The secure operation parameter may further be implemented based on a counter of exclusive secure execution of a thread.
[0082] The first execution mode of the processor core may be a simultaneous multithreading mode.
[0083] The operating instructions may be implemented on a virtual machine or within a container.
[0084] The computer system may be further configured to require exclusive secure execution of the secure code segments of the program code on the virtual machine or within the container.
[0085] 3, a schematic diagram of an example of a data processing system 210 is shown. Data processing system 210 is only one example of a suitable data processing system and is not intended to suggest any limitation to the scope of use or functionality of the embodiments of the invention described herein. Nevertheless, data processing system 210 is capable of being implemented with and / or performing any of the functionality described herein above.
[0086] Within data processing system 210 is computer system / server 212, which may operate in conjunction with numerous other general purpose or special purpose computing systems, environments, or configurations. Examples of well-known computing systems, environments, or configurations, or combinations thereof, that may be suitable for use with computer system / server 212 include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments that include any of the above systems or devices.
[0087] The computer system / server 212 may be described in the general context of computer system executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc., that perform particular tasks or implement particular abstract data types. The computer system / server 212 may be implemented in a distributed cloud computing environment where tasks are performed by remote processing devices linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media, including memory storage devices.
[0088] 3, computer system / server 212 in data processing system 210 is shown in the form of a general purpose computing device. Components of computer system / server 212 may include, but are not limited to, one or more processors or processing units 216, a system memory 228, and a bus 218 that couples various system components including the system memory 228 to the processor unit 216.
[0089] Bus 218 represents one or more of any of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures, including, by way of example and not limitation, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an Enhanced ISA (EISA) bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0090] Computer system / server 212 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer system / server 212 and includes both volatile and nonvolatile media, removable and non-removable media.
[0091] The system memory 228 may include computer system readable media in the form of volatile memory such as random access memory (RAM) 230 and / or cache memory 232. The computer system / server 212 may further include other removable / non-removable volatile / non-volatile computer system storage media. By way of example only, the storage system 234 may be provided for reading from and writing to a non-removable non-volatile magnetic medium (not shown, but typically referred to as a "hard drive"). Although not shown, a magnetic disk drive may be provided for reading from and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), as well as an optical disk drive for reading from or writing to a removable non-volatile optical disk, such as a CD-ROM, DVD-ROM, or other optical media. In such instances, each may be connected to the bus 218 by one or more data media interfaces. As further shown and described below, the memory 228 may include at least one program product having a set (e.g., at least one) program module configured to implement the functions of an embodiment of the present invention.
[0092] By way of example and not limitation, a program / utility 240 having a set (at least one) program module 242 may be stored in memory 228, as well as an operating system, one or more application programs, other program modules, and program data. Each of the operating system, one or more application programs, other program modules, and program data, or a combination thereof, may comprise an implementation of a networking environment. The program modules 242 generally implement the functions and / or methods of embodiments of the invention described herein.
[0093] The computer system / server 212 may also communicate with one or more external devices 214, such as a keyboard, a pointing device, a display 224, one or more devices that allow a user to interact with the computer system / server 212, or any device that allows the computer system / server 212 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.), or a combination thereof. Such communication may occur through an input / output (I / O) interface 222. Additionally, the computer system / server 212 may communicate with one or more networks, such as a local area network (LAN), a general wide area network (WAN), or a public network (e.g., the Internet), or a combination thereof, through a network adapter 220. As shown, the network adapter 220 communicates with other components of the computer system / server 212 through a bus 218. It is understood that other hardware and / or software components, not shown, may also be used with the computer system / server 212. Examples include, but are not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archiving storage systems.
[0094] The present invention may be a system, method, and / or computer program product, which may include a computer-readable storage medium (or media) having computer-readable program instructions for causing a processor to implement aspects of the present invention.
[0095] A computer readable storage medium may be a tangible device capable of holding and storing instructions for use by an instruction execution device. A computer readable storage medium may be, for example, but not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. A non-exhaustive list of more specific examples of computer readable storage media includes portable computer diskettes, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), static random access memories (SRAM), portable compact disk read-only memories (CD-ROM), digital versatile disks (DVD), memory sticks, floppy disks, mechanically encoded devices such as punch cards, or raised structures in grooves with instructions recorded thereon, and any suitable combination of the above. As used herein, a computer-readable storage medium should not be construed as being a transitory signal per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., light pulses passing through a fiber optic cable), or electrical signals transmitted through wires. The computer readable program instructions described herein can be downloaded from a computer readable storage medium to the respective computing / processing device or to an external computer or storage device via a network, such as the Internet, a local area network, a wide area network, or a wireless network, or a combination thereof. The network can include copper transmission cables, optical transmission fiber, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium in the respective computing / processing device. The computer readable program instructions for carrying out the operations of the present invention may be source or object code written in any combination of one or more programming languages, including assembler instructions, instruction set architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state setting data, or object oriented programming languages such as Smalltalk, C++, and conventional procedural programming languages such as the "C" programming language or similar programming languages. The computer readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA) may execute computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry to perform aspects of the present invention. Aspects of the present invention are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer readable program instructions.
[0096] These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, provide means for implementing the functions / operations specified in one or more blocks of the flowcharts and / or block diagrams to produce a machine. These computer readable program instructions may also be stored in a computer readable storage medium, such that the computer readable storage medium on which the instructions are stored comprises an article of manufacture including instructions that implement aspects of the functions / operations specified in one or more blocks of the flowcharts and / or block diagrams, and may direct a computer, programmable data processing apparatus, or other device, or combination thereof, to function in a particular manner.
[0097] The computer readable program instructions may also be loaded into a computer, other programmable data processing apparatus, or other device such that the instructions, which execute on a computer, other programmable apparatus, or other device, implement the functions / acts specified in one or more blocks of the flowcharts and / or block diagrams, causing the computer, other programmable apparatus, or other device to perform a series of operational steps to produce a computer-implemented process.
[0098] The flowcharts and block diagrams in these figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowcharts or block diagrams may represent a module, segment, or portion of instructions, which includes one or more executable instructions for implementing the specified logical function. In some alternative implementations, the functions described in the blocks may occur out of the order shown in these figures. For example, two blocks shown in succession may in fact be executed substantially simultaneously, or the blocks may be executed in the reverse order, depending on the functionality involved. It should also be noted that each block of the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a special purpose hardware-based system that performs the specified functions or operations or executes a combination of special purpose hardware and computer instructions.
[0099] The description of various embodiments of the present invention is presented for illustrative purposes and is not intended to be exhaustive or limiting to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terms used in this specification are selected to best explain the principles of the embodiments, practical applications, or technical improvements to the technology found in the market, or to enable those skilled in the art to understand the embodiments disclosed herein.
[0100] Further exemplary embodiments of the present disclosure are described in the following numbered clauses.
[0101] Numbered Clause 1: A computer-implemented method for scheduling secure code segments among threads on processor cores of a processing unit (216), the processing unit (216) being configured, by at least one processor core, to run a first execution mode to execute program code on the at least one processor core, and to execute program code of operational instructions of threads on the at least one processor core, wherein for at least one of the threads, secure operation parameters are defined that control a requirement for exclusive secure execution of the secure code segments of the program code on the at least one processor core, the method comprising: requesting exclusive secure execution of a secure code segment of program code on at least one processor core by a first thread; validating the request based on the secure operating parameters; configuring at least one processor core into exclusive secure execution for the secure code segment when the secure operating parameter falls below a predefined threshold; uninterruptibly executing a secure code segment on at least one processor core; clearing design and non-design state from at least one processor core; increasing a secure operating parameter of the first thread based on at least an uninterrupted secure execution time of the first thread; configuring at least one processor core into a first execution mode for executing program code on the at least one processor core; periodically resetting secure operating parameters; and switching to another thread when the secure operating parameter is greater than a predefined threshold.
[0102] Numbered Clause 2: The method of numbered clause 1, further decreasing the secure operating parameters of other threads, excluding the first thread, when the secure operating parameter falls below a predefined threshold, based on an uninterrupted secure execution time of at least the first thread.
[0103] Numbered Clause 3: The method according to numbered clause 1 or 2, wherein the secure operation parameters of all threads are reduced at periodic time intervals.
[0104] Numbered clause 4: The method of any one of numbered clauses 1 to 3, wherein the secure operation parameters of the first thread are updated under hardware control after exiting the exclusive secure execution mode.
[0105] Numbered clause 5: A method according to any one of numbered clauses 1 to 4, wherein secure operation parameters of the first thread are updated by hypervisor code after exiting the exclusive secure execution mode.
[0106] Numbered Clause 6: A method according to any one of numbered clauses 1 to 5, further determining a requirement for exclusive secure execution of a secure code segment of the program code on at least one processor core based on at least a secure operating parameter or a duration of the requested exclusive secure execution or both.
[0107] Clause 7: The method of any one of clauses 1 to 6, wherein the secure operation parameter is implemented as a priority parameter of a thread.
[0108] Numbered clause 8: The method of any one of numbered clauses 1 to 7, wherein the secure operation parameter is implemented based on a counter of exclusive secure execution of a thread.
[0109] Numbered clause 9: A method according to any one of numbered clauses 1 to 8, wherein the first execution mode for executing program code on the processor core is a simultaneous multithreading mode.
[0110] Clause 10: A method according to any one of clauses 1 to 9, wherein the operating instructions are implemented on a virtual machine or within a container.
[0111] Numbered clause 11: The method of numbered clause 10, further requiring exclusive secure execution of a secure code segment of the program code on the virtual machine or within the container.
[0112] Numbered clause 12: A computer system (212) for scheduling secure code segments among threads on a processor core of a processing unit (216), the processing unit (216) being configured by at least one processor core having at least one processor core, the processor core being configured to run a first execution mode to execute program code on the at least one processor core and to execute program code of operational instructions of threads on the at least one processor core, secure operation parameters are defined for at least one of the threads that control a request for exclusive secure execution of the secure code segments of the program code on the at least one processor core, and the computer system (212) is configured to: a first thread requesting exclusive secure execution of a secure code segment of program code on at least one processor core; validating the request based on the secure operating parameters; configuring at least one processor core into exclusive secure execution for the secure code segment when the secure operating parameter falls below a predefined threshold; uninterruptibly executing a secure code segment on at least one processor core; clearing design and non-design state from at least one processor core; increasing a secure operating parameter of the first thread based on at least an uninterrupted secure execution time of the first thread; configuring at least one processor core to a first execution mode for program code on the at least one processor core; periodically resetting secure operating parameters; 12. A computer system configured to perform the method of any one of numbered clauses 1 to 11, comprising at least switching to another thread when a secure operating parameter is greater than a predefined threshold.
[0113] Numbered clause 13: A computer system as described in numbered clause 12, configured to reduce a secure operating parameter of other threads, except for the first thread, when the secure operating parameter falls below a predefined threshold, based on an uninterrupted secure execution time of at least the first thread.
[0114] Numbered clause 14: A computer system as described in numbered clause 12 or 13, configured to decrease the secure operating parameters of all threads at periodic time intervals.
[0115] Numbered clause 15: A computer system as described in any one of numbered clauses 12 to 14, configured to update secure operating parameters of the first thread under hardware control after exiting the exclusive secure execution mode.
[0116] Numbered clause 16: A computer system as described in any one of numbered clauses 12 to 15, configured to update secure operating parameters of the first thread by the hypervisor code after exiting the exclusive secure execution mode.
[0117] Numbered clause 17: A computer system as described in any one of numbered clauses 12 to 16, configured to determine a request for exclusive secure execution of a secure code segment of program code on at least one processor core based on at least secure operating parameters or a duration of the requested exclusive secure execution or both.
[0118] Numbered clause 18: A computer system as described in any one of numbered clauses 12 to 17, wherein the secure operation parameter is implemented as a thread priority parameter.
[0119] Numbered clause 19: A computer system as described in any one of numbered clauses 12 to 18, wherein the secure operation parameter is implemented based on a counter of exclusive secure execution of a thread.
[0120] Numbered clause 20: A computer system as described in any one of numbered clauses 12 to 19, wherein a first execution mode for executing program code on a processor core is a simultaneous multithreading mode.
[0121] Numbered clause 21: A computer system as described in any one of numbered clauses 12 to 20, wherein the operating instructions are implemented on a virtual machine or within a container.
[0122] Numbered Clause 22: A computer system as described in clause 21, configured to require exclusive secure execution of secure code segments of program code on a virtual machine or within a container.
[0123] Numbered clause 23: A computer program product for scheduling secure code segments among threads on a processor core of a processing unit (216), the processing unit (216) being configured by at least one processor core to run a first execution mode to execute program code on the at least one processor core and to execute program code of operational instructions of the threads on the at least one processor core, secure operation parameters are defined for at least one of the threads that control a request for exclusive secure execution of the secure code segment of the program code on the at least one processor core, the computer program product comprising a computer readable storage medium having program instructions embodied therein, the program instructions being configured to cause a computer system (212) to: a first thread requesting exclusive secure execution of a secure code segment of program code on at least one processor core; validating the request based on the secure operating parameters; configuring at least one processor core into exclusive secure execution for the secure code segment when the secure operating parameter falls below a predefined threshold; uninterruptibly executing a secure code segment on at least one processor core; clearing design and non-design state from at least one processor core; increasing a secure operating parameter of the first thread based on at least an uninterrupted secure execution time of the first thread; configuring at least one processor core into a first execution mode for executing program code on the at least one processor core; periodically resetting secure operating parameters; and switching to another thread if the secure operating parameter is greater than a predefined threshold.
[0124] Numbered clause 24: A data processing system (210) for executing a data processing program (240) comprising computer readable program instructions for carrying out the method according to any one of numbered clauses 1 to 11.
[0125] Numbered Clause 25: An integrated circuit for executing instructions for scheduling among threads a secure code segment on a processor core of a processing unit, the processing unit being configured by at least one processor core having at least one processor unit having at least one processor core, the processor core being configured to run a first execution mode to execute program code on the at least one processor core, and to execute program code of operational instructions of threads on the at least one processor core, secure operation parameters are defined for at least one of the threads that control a request for exclusive secure execution of the secure code segment of the program code on the at least one processor core, and the integrated circuit is configured to: requesting exclusive secure execution of a secure code segment of program code on at least one processor core by a first thread; validating the request based on the secure operating parameters; configuring at least one processor core into exclusive secure execution for the secure code segment when the secure operating parameter falls below a predefined threshold; uninterruptibly executing a secure code segment on at least one processor core; clearing design and non-design state from at least one processor core; increasing a secure operation parameter based on an uninterrupted secure execution time of at least the first thread; configuring at least one processor core into a first execution mode for executing program code on the at least one processor core; switching to a second thread when the secure operating parameter is greater than a predefined threshold; and periodically resetting the secure operating parameters.
Claims
1. 1. A computer-implemented method for scheduling secure code segments among threads on processor cores of a processing unit, the processing unit being configured, by at least one processor core, to run a first execution mode to execute program code on the at least one processor core and to execute program code of operational instructions of threads on the at least one processor core, secure operation parameters are defined for at least one of the threads that control a requirement for exclusive secure execution of the secure code segments of the program code on the at least one processor core, the method comprising: requesting exclusive secure execution of the secure code segment of the program code on the at least one processor core by a first thread; validating the request based on the secure operating parameters; configuring the at least one processor core into exclusive secure execution for the secure code segment when the secure operating parameter falls below a predefined threshold; uninterruptibly executing the secure code segment on the at least one processor core; clearing design and non-design state from the at least one processor core; increasing the secure operating parameter based on at least an uninterrupted secure execution time of the first thread; setting the at least one processor core in the first execution mode for executing program code on the at least one processor core; switching to a second thread when the secure operating parameter is greater than the predefined threshold; periodically resetting said secure operating parameters; 4. A computer-implemented method comprising:
2. 2. The computer-implemented method of claim 1, further comprising: when the secure operating parameter falls below the predefined threshold, decreasing the secure operating parameter for all threads except the first thread based on the uninterrupted secure execution time of at least the first thread.
3. The computer-implemented method of claim 1 , wherein the secure operating parameters for all threads are decreased at periodic time intervals.
4. 2. The computer-implemented method of claim 1, wherein the secure operating parameters for the first thread are updated under hardware control after exiting the exclusive secure execution mode.
5. 2. The computer-implemented method of claim 1, wherein the secure operating parameters for the first thread are updated by hypervisor code after exiting the exclusive secure execution mode.
6. 2. The computer-implemented method of claim 1, further comprising: determining the request for exclusive secure execution of the secure code segment of the program code on the at least one processor core based at least on the secure operating parameters and a duration of the request.
7. The computer-implemented method of claim 1 , wherein the secure operating parameter is implemented as a priority parameter of the thread.
8. The computer-implemented method of claim 1 , wherein the secure operating parameter is implemented based on a counter of exclusive secure execution of a thread.
9. 2. The computer-implemented method of claim 1, wherein the first execution mode for executing program code on the processor core is a simultaneous multithreading mode.
10. The computer-implemented method of claim 1 , wherein the operating instructions are implemented on a virtual machine or within a container.
11. 11. The computer-implemented method of claim 10, further comprising: requiring exclusive secure execution of the secure code segments of the program code on the virtual machine or within the container.
12. 1. A computer system for scheduling secure code segments among threads on a processor core of a processing unit, the processing unit being configured with at least one processor core, the computer system comprising at least one processor unit having at least one processor core, the processor core being configured to run a first execution mode to execute program code on the at least one processor core and to execute program code of operational instructions of threads on the at least one processor core, secure operation parameters are defined for at least one of the threads controlling a requirement for exclusive secure execution of the secure code segments of the program code on the at least one processor core, the computer system being configured to: requesting exclusive secure execution of the secure code segment of the program code on the at least one processor core by a first thread; validating the request based on the secure operating parameters; configuring the at least one processor core into exclusive secure execution for the secure code segment when the secure operating parameter falls below a predefined threshold; uninterruptibly executing the secure code segment on the at least one processor core; clearing design and non-design state from the at least one processor core; increasing the secure operating parameter based on at least an uninterrupted secure execution time of the first thread; setting the at least one processor core in the first execution mode for executing program code on the at least one processor core; switching to a second thread when the secure operating parameter is greater than the predefined threshold; periodically resetting said secure operating parameters; 23. A computer system configured to perform a method comprising:
13. 13. The computer system of claim 12, further configured to reduce the secure operating parameter for all threads except the first thread based on the uninterrupted secure execution time of at least the first thread when the secure operating parameter falls below the predefined threshold.
14. 13. The computer system of claim 12, configured to decrease the secure operating parameter at periodic time intervals.
15. 13. The computer system of claim 12, configured to update the secure operating parameters for the first thread under hardware control after exiting the exclusive secure execution mode.
16. 13. The computer system of claim 12, further configured to update, by hypervisor code, the secure operating parameters for the first thread after exiting the exclusive secure execution mode.
17. 13. The computer system of claim 12, configured to determine the request for exclusive secure execution of the secure code segment of the program code on the at least one processor core based at least on the secure operating parameters and a duration of the request.
18. 13. The computer system of claim 12, wherein the secure operating parameter is implemented as a priority parameter of the thread.
19. 13. The computer system of claim 12, wherein the secure operation parameter is implemented based on a counter of exclusive secure execution of a thread.
20. 13. The computer system of claim 12, wherein the first execution mode for executing program code on the processor core is a simultaneous multithreading mode.
21. 13. The computer system of claim 12, wherein the operating instructions are implemented on a virtual machine or within a container.
22. 22. The computer system of claim 21, configured to request exclusive secure execution of the secure code segments of the program code on the virtual machine or within the container.
23. Program code for causing a processor core to execute a computer-implemented method according to any one of claims 1 to 11.
24. 2. A data processing system for executing a data processing program comprising computer readable program instructions for performing the computer implemented method of claim 1.
25. 1. An integrated circuit for executing instructions for scheduling secure code segments among threads on a processor core of a processing unit, the processing unit being configured with at least one processor core, the integrated circuit comprising at least one processor unit having at least one processor core, the processor core being configured to run a first execution mode to execute program code on the at least one processor core and to execute program code of operational instructions of threads on the at least one processor core, secure operation parameters are defined for at least one of the threads that control a requirement for exclusive secure execution of the secure code segments of the program code on the at least one processor core, the integrated circuit comprising: requesting exclusive secure execution of the secure code segment of the program code on the at least one processor core by a first thread; validating the request based on the secure operating parameters; configuring the at least one processor core into exclusive secure execution for the secure code segment when the secure operating parameter falls below a predefined threshold; uninterruptibly executing the secure code segment on the at least one processor core; clearing design and non-design state from the at least one processor core; increasing the secure operating parameter based on at least an uninterrupted secure execution time of the first thread; setting the at least one processor core in the first execution mode for executing program code on the at least one processor core; switching to a second thread when the secure operating parameter is greater than the predefined threshold; periodically resetting said secure operating parameters; 4. An integrated circuit configured to perform a method comprising:
