KR20180093769A - Method and apparatus for operating multi-processor system in electronic device - Google Patents

Method and apparatus for operating multi-processor system in electronic device Download PDF

Info

Publication number
KR20180093769A
KR20180093769A KR1020170096189A KR20170096189A KR20180093769A KR 20180093769 A KR20180093769 A KR 20180093769A KR 1020170096189 A KR1020170096189 A KR 1020170096189A KR 20170096189 A KR20170096189 A KR 20170096189A KR 20180093769 A KR20180093769 A KR 20180093769A
Authority
KR
South Korea
Prior art keywords
secure
thread
processor
security
cpu core
Prior art date
Application number
KR1020170096189A
Other languages
Korean (ko)
Other versions
KR102333693B1 (en
Inventor
알렉산더 니콜라비치 마티브
블라디미르 바이실리비치 포디아폴스키
Original Assignee
삼성전자주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자주식회사 filed Critical 삼성전자주식회사
Priority to US15/868,660 priority Critical patent/US10740496B2/en
Publication of KR20180093769A publication Critical patent/KR20180093769A/en
Application granted granted Critical
Publication of KR102333693B1 publication Critical patent/KR102333693B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Storage Device Security (AREA)

Abstract

A method and an apparatus for operating a multi-processor system in an electronic apparatus are provided. The electronic apparatus includes a memory for storing operation commands for running a secure operating system (OS) and a non-secure OS; and at least one processor including a plurality of processor cores. Upon generation of at least one secure OS thread in the secure OS installed on the electronic apparatus, the at least one processor generates information indicating a secure mode operation request by assigning at least one of the plurality of processors cores in the secure OS, and executes the secure OS thread on the at least one processor core assigned in a secure mode based on the information.

Description

전자 장치의 다중 프로세서 시스템 운영 방법 및 장치{METHOD AND APPARATUS FOR OPERATING MULTI-PROCESSOR SYSTEM IN ELECTRONIC DEVICE}[0001] METHOD AND APPARATUS FOR OPERATING MULTI-PROCESSOR SYSTEM IN ELECTRONIC DEVICE [0002]

본 개시는 전자 장치의 다중 프로세서 시스템에 관한 것으로서, 특히 전자 장치의 보안 OS(operating system)와 비보안 OS에 의한 다중 프로세서 시스템 운영 방법 및 장치에 관한 것이다.The present disclosure relates to a multiprocessor system of an electronic device, and more particularly, to a method and apparatus for operating a multiprocessor system with a secure operating system (OS) of an electronic device and a non-secure OS.

지난 수십 년 동안 전 세계에서 전자 장치과 같은 모바일 전자 장치 사용이 크게 증가하면서, 전자 장치는 음성 통신을 수행하고 SMS(short message service) 메시지를 교환하는 것만을 목적으로 하는 통상적인 이동 전화로부터 소형의 강력한 컴퓨팅 장치로 발전하여, 기본적인 통신 능력 외에, 다양한 확장이 가능한 인터넷 기반 기능을 포함하게 되었다. 특히, 현재 스마트폰의 하드웨어는 일반적으로 복수의 프로세서 또는 복수의 CPU(central processing unit) 코어를 포함하는 강력한 프로세서 또는 CPU와 대량의 기록 용량을 갖는 다중 레벨 메모리 시스템을 포함한다. BACKGROUND OF THE INVENTION In the last few decades, mobile electronic devices, such as electronic devices, have increased in use around the world, and electronic devices have evolved from conventional mobile phones to voice messaging and exchange of short message service (SMS) Computing devices, and in addition to basic communication capabilities, various extensible Internet-based functions have been included. In particular, current smartphone hardware typically includes a robust processor or CPU, including a plurality of processors or a plurality of central processing unit (CPU) cores, and a multilevel memory system having a large amount of write capacity.

또한, 최신 전자 장치에는 운영 체제(operating system, OS)가 설치되어 있어, 대부분의 응용 프로그램, 즉 어플리케이션 또는 앱은 인터넷을 통해 설치되고, 전자 장치의 OS 하에서 동작하여 사용자에게 여러 기능을 제공한다. 스마트폰에서 가장 많이 사용되는 모바일 운영체제는 안드로이드(android) 및 아이오에스(iOS)며, 모바일 앱은 일반적으로 두 개의 OS 각각에서 동작 가능한 각각의 버전으로 개발되고 있다. In addition, the latest electronic apparatuses are provided with an operating system (OS), and most application programs, i.e., applications or apps, are installed over the Internet, and operate under the OS of the electronic apparatuses to provide various functions to the users. The most popular mobile operating systems on smartphones are Android and iOS, and mobile apps are generally developed in versions that can run on both OSs.

전자 장치가 소형 컴퓨팅 장치로 부상함에 따라 컴퓨터에서 종전에 구현된 멀티 스레딩 기술을 전자 장치에 적용하고자 하는 움직임이 대두하였다. 멀티 aid스레딩 기술은 응용 프로그램의 실행을 다수의 실행 스레드(threads)로 분할하고, 응용 프로그램의 다수의 실행 스레드를 다수의 CPU 또는 다수의 CPU 코어에서 병렬로 실행함으로써 성능을 향상시키도록 설계되었다. 멀티 스레딩 기술은 특히 연산 집약적 앱에 유리하다. 최신 전자 장치의 모바일 OS는 이러한 연산 집약적 앱을 지원하기 위해 멀티 스레딩을 지원하도록 설계되는 추세이며, 이에 따라 다양한 액션 게임, 멀티미디어 앱 등과 같은 연산 집약적 앱의 원활한 동작을 지원할 수 있다.As electronic devices have emerged as compact computing devices, there has been a move to apply the multithreading technology previously implemented in computers to electronic devices. Multi-aid threading technology is designed to improve performance by dividing the execution of an application into multiple execution threads and executing multiple execution threads of the application in parallel on multiple CPUs or multiple CPU cores. Multithreading technology is particularly advantageous for compute-intensive apps. The mobile OS of modern electronic devices is designed to support multithreading to support these compute-intensive apps, which can support the smooth operation of compute-intensive apps, such as a variety of action games, multimedia apps, and the like.

한편, 전자 장치의 연산 능력 향상으로 인해 효율적인 전력 관리의 문제가 대두하였다. 최근의 스마트폰은 완충된 배터리가 한나절을 채 버티지 못하여 사용자에게 불편함을 주는 것이 일반적이다. 이에 따라 최신 전자 장치의 모바일 OS는 다수의 CPU 코어에 대해 경우에 따라 개별 CPU 코어를 비활성화하여 전력 소모를 줄이고 필요한 경우 개별 CPU 코어를 순차적으로 활성화하여 사용한다.On the other hand, the problem of efficient power management has arisen due to the improvement of the computing ability of electronic devices. In recent smartphones, it is common for users to feel uncomfortable because the buffered battery does not last for half a day. As a result, the mobile OS of modern electronic devices reduces power consumption by disabling individual CPU cores for multiple CPU cores, if necessary, and activates individual CPU cores sequentially when necessary.

문제는 보안이다. 최근 전자 장치는 다수의 앱 뿐만 아니라 모바일 OS 자체도 업데이트 등으로 확장 가능하므로, 인터넷을 통해 OS 또는 앱을 업데이트 또는 확장할 때 OS를 커널 수준까지 손상시킬 수 있는 악성 코드 등의 시스템 파괴 소프트웨어가 다운로드 될 수 있다. 따라서 데이터에 대해 보안 또한 상당히 취약해지게 된다.The problem is security. Recently, since electronic devices can expand not only a large number of apps but also mobile OS itself, the system destroying software such as a malicious code which can damage the OS to the kernel level when updating or expanding an OS or an app through the Internet is downloaded . As a result, the security of the data is also considerably weakened.

프로세서 아키텍처 설계 분야의 공지 기술인 트러스트 존(TrustZone) 기술에 따르면, 전자 장치의 리소스 측면에서 하드웨어 수준까지 서로 분리된 2개의 독립적인 환경인 보안 환경('보안 세계')과 비보안 환경('비보안 세계')이 제안된다. 2개의 독립적인 환경을 구현하기 위해 보안 환경에서 동작하는 시큐어 OS(secure OS)와 비보안 환경에서 동작하는 리치 OS(RichOS)를 각각 구현하여, CPU 또는 CPU 코어 각각이 보안 모드(secure mode) 또는 비보안 모드(non-secure mode)에서 작동하도록 구성된다. 하나의 CPU 코어가 보안 모드로 전환되면 시큐어 OS는 해당 CPU 코어에 대한 제어를 획득하고 보안 환경에서 사용하도록 규정된 전자 장치의 리소스를 사용할 수 있다. 또한, 다른 CPU 코어가 비보안 모드에 있으면 리치 OS가 해당 CPU 코어에 대한 제어를 획득하고 비보안 환경에서 사용하도록 규정된 리소스를 사용할 수 있다.According to TrustZone technology, a technology known in the field of processor architecture design, there are two independent environments, a security environment ('security world') and an unsecured environment ('non-security world' ) Is proposed. In order to realize two independent environments, a secure OS that operates in a secure environment and a rich OS (RichOS) that operates in an unsecured environment are respectively implemented so that each of the CPUs or CPU cores can perform a secure mode or a non- Mode (non-secure mode). When one CPU core is switched to secure mode, the secure OS can obtain control over that CPU core and use the resources of the electronic device specified for use in the secure environment. In addition, if the other CPU core is in the unsecured mode, the rich OS can obtain control over the CPU core and use the resources specified for use in an insecure environment.

리치 OS의 대표적인 예로는 안드로이드(Android)와 타이젠(Tizen)이 있으며, 리치 OS는 일반적으로 OS 인터페이스 및 유틸리티 또는 그 아래에서 실행되는 응용 프로그램과 관계없이 사용자가 직접 상호 작용하는 완전한 기능의 OS로 동작한다. 리치 OS의 일반적인 운영 측면은 널리 알려져 있으며, 리치 OS는 전자 장치의 하드웨어 수단을 직접 조작하는 드라이버를 포함하여 대부분의 드라이버를 구현하고, 특히 CPU 코어를 활성화 및 비활성화한다.Typical examples of rich operating systems are Android and Tizen. Rich OS is a full-featured operating system that interacts directly with the user, regardless of the OS interface and utilities, or any application running below it. . The general operating aspect of a rich OS is well known, and the rich OS implements most of the drivers, especially drivers, that directly manipulate the hardware means of the electronic device, and in particular enable and disable the CPU core.

리치 OS와는 달리 시큐어 OS는 크기가 작고 기능이 매우 제한되어 있어 오류가 발생하기 쉽고, 실제 보안 측면에서 민감한 작업만을 실행하며, 시큐어 OS에서만 실행되는 응용 프로그램 예를 들면, 신뢰성 응용 프로그램을 구동한다. 시큐어 OS의 제한된 기능으로 인해 시큐어 OS는 시큐어 OS 스레드의 실행을 위한 연산 자원을 직접 할당할 수 없다. 시큐어 OS는 리치 OS를 통해 리치 OS의 자체적 통신 프로세스에 따라 할당된 자원을 사용한다. 따라서 시큐어 OS 스레드에 따라 필요한 만큼의 CPU 코어를 할당받을 수 없다. 또한, 시큐어 OS는 유휴 CPU 코어를 활성화할 수 없으며, 시큐어 OS 작업을 최적화하기 위해 리치 OS에 이러한 활성화를 수행하도록 요청할 수도 없다.Unlike Rich OS, Secure OS runs applications that run only on secure OSs, for example, reliable applications, because they are small in size and very limited in functionality, are prone to errors, perform only sensitive work on real security. Due to the limited functionality of the Secure OS, the secure OS can not directly allocate computational resources for the execution of the secure OS thread. The secure OS uses the resources allocated according to the rich OS's own communication process through the rich OS. Therefore, it is impossible to allocate as much CPU core as necessary according to the secure OS thread. In addition, a secure OS can not activate an idle CPU core and can not request a rich OS to perform such an activation to optimize the operation of the secure OS.

결과적으로 시큐어 OS는 병렬 처리가 요구되는 실행이 있는 경우에도 단 하나의 CPU 코어에서 처리해야 하는 단일 코어 병렬화가 발생할 수 있다. 예전에는 시큐어 OS에서의 실행 성능 문제는 기술 분야에서 큰 관심사가 아니었으나 연산 집약적 보안 응용 프로그램들이 증가하고 있어 이에 따라 시큐어 OS 자체 성능뿐만 아니라 전체 전자 장치에 성능 문제를 일으키고 있다.As a result, a secure OS may incur a single core parallelism that must be handled by only one CPU core, even if there is an execution that requires parallelism. In the past, performance problems in the secure OS were not a big concern in the technology field, but the number of compute-intensive security applications is increasing, which causes performance problems in the entire electronic device as well as in the performance of the secure OS itself.

상술한 바와 같은 논의를 바탕으로, 본 개시(disclosure)는 전자 장치의 다중 프로세서 시스템 운영 방법 및 그 장치를 제공한다.Based on the foregoing discussion, the disclosure provides a method and apparatus for operating a multiprocessor system of an electronic device.

또한, 본 개시는 상술한 종래 기술의 문제점을 개선하는 전자 장치의 다중 프로세서 시스템 운영 방법 및 그 장치를 제공한다.The present disclosure also provides a method and apparatus for operating a multiprocessor system of an electronic device that overcomes the problems of the prior art described above.

본 개시에 따르면, 전자 장치 동작 방법이 제공된다. 전자 장치는 복수의 CPU(central processing unit) 코어를 갖는 적어도 하나의 프로세서를 포함한다. 각각의 CPU 코어는 보안 모드 또는 비보안 모드로 동작한다. 전자 장치에는 멀티 스레딩을 지원하는 비보안 운영 체제 및 보안 운영 체제가 설치되었다. 보안 OS(operating system) 및 비보안 OS는 하드웨어 레벨까지 서로 분리되며 적어도 하나의 미리 정의된 인터페이스를 통해 서로 통신할 수 있다. OS에서 스레드를 호출할 때, 보안 OS에서는 스레드를 CPU 코어에 할당하고, 이에 따라 CPU 마스크를 수정한다. CPU 마스크는 보안 OS에서 CPU 코어들에 대한 요청을 나타내는 정보를 비보안 OS에 전달하여 CPU 들에 대해 제어를 획득하기 위해 유지하는 데이터 구조이다. 보안 OS에 의해 수정된 CPU 마스크는 비보안 OS로 전달되고, 비보안 OS는 이에 기반하여, CPU 코어가 비활성화 된 경우 CPU 코어를 활성화하고, CPU 코어를 보안 모드로 전환함으로써 CPU 코어에 대한 제어를 보안 OS에 제공한다.According to the present disclosure, a method of operating an electronic device is provided. The electronic device includes at least one processor having a plurality of central processing unit (CPU) cores. Each CPU core operates in a secure or non-secure mode. Electronic devices have an unsecured operating system and a secure operating system that support multithreading. The secure operating system (OS) and non-secure OS are separated from each other up to the hardware level and can communicate with each other via at least one predefined interface. When the OS calls the thread, the security OS assigns the thread to the CPU core and modifies the CPU mask accordingly. The CPU mask is a data structure that transfers information indicating a request for CPU cores in the secure OS to the non-secure OS to maintain control over the CPUs. The CPU mask modified by the security OS is transmitted to the non-secure OS. On the basis of this, the non-secure OS activates the CPU core when the CPU core is deactivated, .

본 개시의 실시 예에 따라, 전자 장치의 자원 측면에서 비보안 환경과 보안 환경의 격리가 구현된다. CPU 코어 별로 비보안 환경과 보안 환경이 각각 구현된다. CPU 코어가 보안 모드에 있을 때, 보안 OS가 CPU 코어의 제어를 획득하고, 전자 장치의 자원을 보안 환경에서 사용할 수 있도록 운영한다. CPU 코어가 비보안 모드에 있을 때, 비보안 OS는 CPU 코어에 대한 제어를 획득하고, 비보안 환경에서 사용 가능한 전자 장치의 자원을 운영할 수 있다. 장치는 보안 환경에서 동작하는 경우, 비보안 환경에서는 사용할 수 없도록 구현된 하드웨어 자원을 포함한다. 보안 OS 스레드의 실행을 예약하도록 구성된 보안 OS 스케줄러를 포함한다. 비보안 OS는 비보안 OS 스레드의 실행을 예약하도록 구성된 비보안 OS 스케줄러 및 보안 OS 스케줄러와 통신하도록 구성된 비보안 OS 드라이버를 포함한다. 비보안 OS 드라이버는 CPU 코어를 활성화하도록 구성된다. 통신 프로세스는 통신 스레드 세트를 포함하며 각 통신 스레드는 서로 다른 CPU 코어에 매핑되어, 해당 CPU 코어에서 실행될 때 해당 CPU 코어가 보안 모드로 전환되도록 한다. 매핑은 통신 스레드의 선호도 속성을 설정하여 구현될 수 있다. 전자 장치는 보안 OS에 의해서만 접근 가능한 메모리 영역을 갖는다.In accordance with an embodiment of the present disclosure, isolation of an insecure environment and a secure environment is implemented in terms of resources of the electronic device. Unsecured environment and security environment are implemented for each CPU core. When the CPU core is in secure mode, the secure OS acquires control of the CPU core and operates the resources of the electronic device for use in a secure environment. When the CPU core is in the non-secure mode, the non-secure OS can gain control over the CPU core and operate the resources of the electronic devices available in an insecure environment. The apparatus includes hardware resources that are implemented such that they can not be used in an unsecured environment when operating in a secure environment. And a secure OS scheduler configured to schedule execution of a secure OS thread. The non-secure OS includes an insecure OS scheduler configured to schedule execution of an insecure OS thread and an insecure OS driver configured to communicate with a secure OS scheduler. The non-secure OS driver is configured to activate the CPU core. The communication process includes a set of communication threads and each communication thread is mapped to a different CPU core so that when the CPU core is executed, the CPU core is switched to the security mode. The mapping can be implemented by setting the preference attribute of the communication thread. The electronic device has a memory area accessible only by the secure OS.

본 개시의 실시 예에 따르면, 스레드는 보안 환경에서 실행되는 신뢰 어플리케이션에 의해 생성된 하나 이상의 보안 OS 스레드 중 하나이다. 신뢰 어플리케이션에 의해 수행될 명령을 비보안 OS 클라이언트가 제공하면, 통신 프로세스는 해당 명령을 큐에 배치하고, 해당 명령에 대해 통신 스레드를 할당한다. 해당 통신 스레드가 CPU 코어 상에서 시작될 때, CPU 코어를 보안 모드로 전환하고, 해당 CPU 코어에서 보안 OS 스케줄러가 실행되어 적어도 해당 스레드를 차단 해제한다.According to an embodiment of the present disclosure, a thread is one of one or more secure OS threads created by a trusted application running in a secure environment. When a non-secure OS client provides a command to be performed by a trusted application, the communication process places the command in a queue and allocates a communication thread for the command. When the communication thread is started on the CPU core, the CPU core is switched to the security mode, and the security OS scheduler is executed in the CPU core to unblock at least the thread.

본 개시의 실시 예에 따르면, 보안 OS 스케줄러에 의해 유지되는 데이터 구조는 비트 필드를 포함한다. 보안 OS 스케줄러에 의해 비트 필드가 수정된다. 비트 필드의 수정은, 해당 CPU 코어에 신뢰 어플리케이션의 보안 OS 스레드가 이전에 할당되지 않은 경우, 해당 CPU 코어에 대응하는 비트 엔트리를 설정하는 것을 포함한다. 이에 따라 해당 스레드가 보안 OS 스케줄러 큐에 배치되고, 스레드의 실행을 위해 시간이 할당된다.According to an embodiment of the present disclosure, the data structure maintained by the secure OS scheduler includes a bit field. The bit field is modified by the secure OS scheduler. Modification of the bit field includes setting a bit entry corresponding to the CPU core if the trusted OS thread of the trusted application has not been previously assigned. As a result, the thread is placed in the secure OS scheduler queue, and time is allocated for execution of the thread.

보안 OS 스케줄러에 의한 통신 프로세스에 따르면, CPU 코어에서 실행되는 보안 OS 스레드의 완료 또는 선점이 발생한다. 보안 OS 스레드 완료 시에는, 보안 OS 스레드가 차단되며, 해당 CPU 코어에서 현재 어느 보안 OS 스레드도 실행되고 있지 않으면, 해당 CPU 코어에 대응하는 비트 엔트리를 폐기하는 것으로 해당 CPU 마스크가 갱신되고, 갱신된 CPU 마스크는 해당 실행의 결과에 매입되어 비보안 OS에 결과가 전달된다. 선점 발생 시에는, CPU 마스크가 실행이 완료되지 않았음을 나타내는 결과에 매입되어 비보안 OS로 결과가 전달되거나 CPU 마스크가 공유 메모리에 저장된다. 이에 따라 해당 CPU 코어에 대한 제어는 비보안 환경으로 전환된다. According to the communication process by the security OS scheduler, completion or preemption of the security OS thread executed in the CPU core occurs. When the security OS thread is completed, the security OS thread is blocked. If no security OS thread is currently executed in the corresponding CPU core, the corresponding CPU mask is updated by discarding the bit entry corresponding to the corresponding CPU core, The CPU mask is embedded in the result of the execution and delivered to the non-secure OS. When a preemption occurs, the CPU mask is embedded in the result indicating that the execution is not completed, and the result is transmitted to the non-secure OS or the CPU mask is stored in the shared memory. Accordingly, control for the CPU core is switched to an insecure environment.

본 개시에 따른 통신 프로세스에 따르면, 비보안 OS 드라이버에 의해 상기 결과로부터 또는 공유 메모리로부터 CPU 마스크를 검색하고 해당 CPU 마스크를 현재 활성화된 CPU 코어들에 매칭한다. 특정 CPU 코어가 현재 비활성화 상태이면, 해당 CPU 코어를 활성화한다. CPU 마스크를 저장하여 통신 프로세서에서 이용하도록 한다.According to the communication process according to the present disclosure, the non-secure OS driver retrieves the CPU mask from the result or from the shared memory and matches the CPU mask to the currently active CPU cores. If a particular CPU core is currently inactive, activate that CPU core. The CPU mask is stored and used by the communication processor.

본 개시에 따른 통신 프로세스에 따르면, CPU 마스크를 모니터링하고 해당 CPU 코어에 매핑된 통신 스레드를 차단 해제하여 비보안 OS 스케줄러에 의해 통신 스레드가 비보안 OS 스케줄러 큐에 배치되도록 한다. 비보안 OS 스케줄러 큐로부터 통신 스레드의 실행이 해당 CPU 코어에서 시작되면 통신 스레드에 의해 해당 CPU 코어가 보안 모드로 전환된다. 따라서 해당 CPU 코어에서의 제어가 보안 환경으로 전환되고 해당 CPU 코어에서 보안 OS 스케줄러의 동작이 시작되며 보안 OS 스케줄러가 스레드를 실행한다. According to the communication process according to the present disclosure, the CPU mask is monitored and the communication thread mapped to the CPU core is unblocked so that the communication thread is placed in the non-secure OS scheduler queue by the non-secure OS scheduler. When the execution of the communication thread from the non-secure OS scheduler queue is started in the corresponding CPU core, the corresponding CPU core is switched to the security mode by the communication thread. Thus, the control in the CPU core is switched to the security environment, the operation of the security OS scheduler is started in the CPU core, and the security OS scheduler executes the thread.

CPU 코어에서의 스레드의 실행이 완료되면, 보안 OS 스케줄러에 의해 스레드가 차단되고, CPU 마스크가 갱신되어 실행 결과에 매입되며, 결과는 비보안 OS 드라이버로 제공되어 해당 CPU 코어에 대한 제어는 다시 비보안 환경으로 전환된다. 스레드의 차단은, 다른 보안 OS 스레드가 해당 CPU 코어에 현재 할당되지 않았으면 보안 OS 스케줄러에 의해 비트 엔트리를 폐기하는 것으로 갱신될 수 있다. 또한, 통신 프로세스에 따라 보안 OS 드라이버로부터 수신된 결과는 추가 처리를 위해 비보안 OS 클라이언트 어플리케이션으로 전달된다.When the execution of the thread in the CPU core is completed, the thread is blocked by the security OS scheduler, the CPU mask is updated and embedded in the execution result, the result is provided to the non-secure OS driver, . Blocking of threads may be updated by discarding bit entries by the secure OS scheduler if no other secure OS thread is currently allocated to that CPU core. In addition, the result received from the secure OS driver according to the communication process is transferred to the non-secure OS client application for further processing.

본 개시의 실시 예에 따르면, 시간 만료에 따른 또는 비보안 OS로부터 수신된 인터럽트에 의한 CPU 코어로부터의 스레드에 대한 선점 시, 보안 OS 스케줄러에 의해 해당 스레드를 보안 OS 스케줄러 큐로 보내 나중에 실행되도록 할 수 있다. According to an embodiment of the present disclosure, it is possible for a secure OS scheduler to send a thread to a secure OS scheduler queue for execution at a later time, upon preemption of a thread from the CPU core by an interrupt due to timeout or from an unsecured OS .

본 개시의 실시 예에 따라, 비보안 OS는, CPU 코어 번호에 의해 미리 정의된 순서로 전자 장치의 연산 부하가 증가함에 따라 현재 비활성화 CPU 코어를 순차적으로 활성화하도록 구성되고, 보안 OS 스케줄러는 미리 정의된 순서에 따라 보안 OS 스레드들에 CPU 코어들을 할당하도록 구성된다.According to an embodiment of the present disclosure, the non-secure OS is configured to sequentially activate the currently disabled CPU core as the computational load of the electronic device increases in a predefined order by the CPU core number, and the secure OS scheduler And to allocate CPU cores to the secure OS threads in order.

본 개시의 실시 예에 따라 전자 장치가 제공된다. 전자 장치는, 복수 개의 CPU 코어를 갖는 적어도 하나의 프로세서 또는 CPU를 포함한다. 각 CPU 코어는 보안 모드 또는 비보안 모드 중 하나에서 동작한다. 전자 장치에는 비보안 운영 체제(OS) 및 보안 운영 체제(OS)가 설치되며, 비보안 OS 및 보안 OS는 멀티 스레딩을 지원한다. 보안 OS는 보안 OS에서 발생한 스레드에 대해, CPU 코어를 할당하고, 할당은 CPU 마스크를 수정하는 것을 포함한다. CPU 마스크는 보안 OS 유지되는 데이터 구조로서 CPU 코어들에 대한 보안 OS의 현재 요구를 알린다. CPU 마스크는, 해당 CPU 코어에서의 제어를 보안 OS에 제공할 것을 비보안 OS에 요청하기 위해 비보안 OS로 전달되고, 이에 따라 해당 CPU 코어는 보안 모드로 전환되어 보안 OS가 해당 CPU 코어에서 제어를 획득한다.An electronic device is provided in accordance with an embodiment of the present disclosure. The electronic device includes at least one processor or CPU having a plurality of CPU cores. Each CPU core operates in either secure or non-secure mode. Non-secure operating systems (OS) and secure operating systems (OS) are installed in electronic devices, and non-secure OS and secure OS support multithreading. The secure OS includes allocating CPU cores for threads originating in the secure OS, and allocating includes modifying CPU masks. The CPU mask is a security OS maintained data structure that informs the current needs of the secure OS for the CPU cores. The CPU mask is transferred to the non-security OS to request the non-security OS to provide control to the security OS by the corresponding CPU core, so that the CPU core is switched to the security mode and the security OS acquires control from the corresponding CPU core do.

본 개시에 따라 복수의 프로세서 코어를 갖는 적어도 하나의 프로세서를 포함하는 전자 장치의 동작 방법이 제공된다. 전자 장치에 설치된 보안 OS(operating system)에서 적어도 하나의 보안 OS 스레드가 생성되고, 상기 보안 OS에서 상기 복수의 프로세서 코어 중 적어도 하나의 프로세서 코어를 지정하여 보안 모드 동작 수행 요청을 나타내는 정보를 생성하며, 상기 정보를 전송하고, 상기 정보에 기초하여 할당된 상기 적어도 하나의 프로세서 코어에서 보안 모드로 상기 보안 OS 스레드를 실행한다. 스레드 생성 시, 제1 보안 OS 스레드 및 제2 보안 OS 스레드가 생성되면, 상기 제1 보안 OS 스레드를 실행하기 위한 제1 프로세서 코어 및 상기 제2 보안 OS 스레드를 실행하기 위한 제2 프로세서 코어 각각을 지정하여 보안 모드 동작 수행 요청을 나타내는 상기 정보를 생성한다. 한편, 상기 지정된 프로세서 코어가 비활성화 상태인 경우 상기 지정된 프로세서 코어에 대한 활성화 요청을 포함하는 상기 정보를 생성한다. 또한, 상기 복수의 프로세서 코어에 대한 사용 정보를 기초로 상기 복수의 프로세서 코어 중 상기 보안 OS 스레드를 실행할 상기 적어도 하나의 프로세서를 결정할 수 있다. 상기 보안 OS 스레드의 선호도 속성을 기초로 상기 복수의 프로세서 코어 중 상기 보안 OS 스레드를 실행할 상기 적어도 하나의 프로세서 코어를 결정한다. 이 경우, 서로 다른 보안 OS 스레드는 서로 다른 프로세서 코어에서 실행되도록 상기 적어도 하나의 프로세서를 결정할 수 있다. 또한, 상기 복수의 프로세서 코어 중 가장 작은 수의 보안 OS 스레드가 실행되고 있는 프로세서 코어에서 상기 보안 OS 스레드가 실행되도록 상기 적어도 하나의 프로세서 코어를 결정할 수 있다. There is provided an operating method of an electronic device including at least one processor having a plurality of processor cores in accordance with the present disclosure. At least one secure OS thread is created in a security operating system installed in the electronic device and at least one processor core among the plurality of processor cores is specified in the secure OS to generate information indicating a request for performing a secure mode operation And transmits the information and executes the secure OS thread in the secure mode in the at least one processor core allocated based on the information. When a thread is created, a first processor core for executing the first secure OS thread and a second processor core for executing the second secure OS thread, respectively, are created when a first secure OS thread and a second secure OS thread are created And generates the information indicating the request for performing the secure mode operation. And generates the information including the activation request for the designated processor core when the designated processor core is in the inactive state. And determine the at least one processor to execute the secure OS thread among the plurality of processor cores based on usage information for the plurality of processor cores. Determines the at least one processor core to execute the secure OS thread among the plurality of processor cores based on the preference attribute of the secure OS thread. In this case, different security OS threads may determine the at least one processor to run on different processor cores. In addition, the at least one processor core may be determined such that the secure OS thread is executed in a processor core in which the smallest number of secure OS threads among the plurality of processor cores are executing.

본 개시에 따르면, 보안 OS(operating system)와 비보안 OS를 수행하기 위한 동작 명령을 저장하는 메모리와 복수의 프로세서 코어를 갖는 적어도 하나의 프로세서가 제공된다. 적어도 하나의 프로세서는, 상기 전자 장치에 설치된 보안 OS(operating system)에서 적어도 하나의 보안 OS 스레드가 생성되면, 상기 보안 OS에서 상기 복수의 프로세서 코어 중 적어도 하나의 프로세서 코어를 지정하여 보안 모드 동작 수행 요청을 나타내는 정보를 생성하고 전송하며, 상기 정보에 기초하여 할당된 상기 적어도 하나의 프로세서 코어에서 보안 모드로 상기 보안 OS 스레드를 실행한다. According to the present disclosure, there is provided at least one processor having a memory and a plurality of processor cores storing operating instructions for operating a secure OS and a non-secure OS. Wherein at least one processor is configured to perform at least one of a plurality of processor cores in the secure OS to perform a secure mode operation when at least one secure OS thread is created in a security OS installed in the electronic device Generates and transmits information indicative of the request, and executes the secure OS thread in secure mode in the at least one processor core allocated based on the information.

본 개시의 다양한 실시 예들에 따른 장치 및 방법은, 보안 OS(operating system)에 의한 CPU(central processing unit 코어들에 대한 사용 요청을 가능케 함으로써, 보안 환경의 상황에 따라 사용 가능한 CPU 코어들의 개수를 최적화할 수 있다. 또한, 보안 OS의 동작 속도를 향상시키고 보안 OS의 응답 지연을 최소화할 수 있어서, 보안 OS의 성능이 향상된다.An apparatus and method in accordance with various embodiments of the present disclosure optimizes the number of usable CPU cores depending on the context of the security environment by enabling use of CPUs (central processing unit cores) by a secure OS In addition, the operation speed of the security OS can be improved and the response delay of the security OS can be minimized, thereby improving the performance of the security OS.

본 개시에서 얻을 수 있는 효과는 이상에서 언급한 효과들로 제한되지 않으며, 언급하지 않은 또 다른 효과들은 아래의 기재로부터 본 개시가 속하는 기술 분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다.The effects obtainable from the present disclosure are not limited to the effects mentioned above, and other effects not mentioned can be clearly understood by those skilled in the art from the description below will be.

도 1은 4개의 CPU(central processing unit) 코어를 갖는 CPU를 포함하는 전자 장치의 개략도이다.
도 2는 본 개시의 전자 장치에서 수행되는 보안 OS(operating system) 및 비보안 OS 운영 메커니즘을 설명하기 위한 흐름도이다.
도 3은 CPU 마스크의 구현 예를 설명하기 위한 도면이다.
도 4는 본 개시에 따른 보안 OS 및 비보안 OS의 동작을 수행하기 위한 구성을 설명하기 위한 도면이다.
도 5는 본 개시의 실시 예에 따른 전자 장치에서 보안 OS 및 비보안 OS를 운영하는 방법을 설명하기 위한 흐름도이다.
1 is a schematic diagram of an electronic device including a CPU having four central processing unit (CPU) cores.
2 is a flow chart illustrating a secure operating system (OS) and non-secure OS operating mechanism performed in the electronic apparatus of the present disclosure.
3 is a diagram for explaining an implementation example of a CPU mask.
4 is a diagram for explaining a configuration for performing operations of the secure OS and the non-secure OS according to the present disclosure.
5 is a flow chart illustrating a method of operating a secure OS and an unsecured OS in an electronic device according to an embodiment of the present disclosure.

본 개시에서 사용되는 용어들은 단지 특정한 실시 예를 설명하기 위해 사용된 것으로, 다른 실시 예의 범위를 한정하려는 의도가 아닐 수 있다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함할 수 있다. 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 용어들은 본 개시에 기재된 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가질 수 있다. 본 개시에 사용된 용어들 중 일반적인 사전에 정의된 용어들은, 관련 기술의 문맥상 가지는 의미와 동일 또는 유사한 의미로 해석될 수 있으며, 본 개시에서 명백하게 정의되지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다. 경우에 따라서, 본 개시에서 정의된 용어일지라도 본 개시의 실시 예들을 배제하도록 해석될 수 없다.The terms used in this disclosure are used only to describe certain embodiments and may not be intended to limit the scope of other embodiments. The singular expressions may include plural expressions unless the context clearly dictates otherwise. Terms used herein, including technical or scientific terms, may have the same meaning as commonly understood by one of ordinary skill in the art. The general predefined terms used in this disclosure may be interpreted as having the same or similar meaning as the contextual meanings of the related art and, unless explicitly defined in the present disclosure, include ideally or in an excessively formal sense . In some cases, the terms defined in this disclosure can not be construed to exclude embodiments of the present disclosure.

이하에서 설명되는 본 개시의 다양한 실시 예들에서는 하드웨어적인 접근 방법을 예시로서 설명한다. 하지만, 본 개시의 다양한 실시 예들에서는 하드웨어와 소프트웨어를 모두 사용하는 기술을 포함하고 있으므로, 본 개시의 다양한 실시 예들이 소프트웨어 기반의 접근 방법을 제외하는 것은 아니다.In the various embodiments of the present disclosure described below, a hardware approach is illustrated by way of example. However, the various embodiments of the present disclosure do not exclude a software-based approach, since various embodiments of the present disclosure include techniques that use both hardware and software.

본 개시는 전자 장치의 다중 프로세서 시스템 운영 방법 및 그 장치 보안 OS(secure operating system)의 개선된 구현을 갖는 전자 장치 및 그 동작 방법에 관한 것이다. 이하 설명에서 사용되는 장치의 구성 요소를 지칭하는 용어, 사용 환경을 지칭하는 용어 등은 설명의 편의를 위해 예시된 것이다. 따라서, 본 개시가 후술되는 용어들에 한정되는 것은 아니며, 동등한 기술적 의미를 가지는 다른 용어가 사용될 수 있다.This disclosure relates to a method of operating a multiprocessor system of an electronic device and an electronic device having an improved implementation of the device secure operating system (OS) and method of operation thereof. The terms referring to components of the apparatuses used in the following description, terms referring to the use environment, and the like are illustrated for convenience of explanation. Accordingly, the present disclosure is not limited to the following terms, and other terms having equivalent technical meanings can be used.

본 개시에 따른 전자 장치는 공지된 타 하드웨어 구성 요소 외에, 다수의 CPU 코어를 갖는 적어도 하나의 CPU 또는 프로세서를 포함한다. 본 개시에 따른 전자 장치에서 CPU 코어라는 명칭은 단지 설명의 편의를 위한 것으로 용어에 한정되지 않고 복수의 CPU 또는 복수의 프로세서를 의미하거나 복수의 CPU 코어를 갖는 적어도 하나의 CPU 또는 적어도 하나의 프로세서 등을 의미한다. 즉, 본 개시에서 CPU 코어는 이하 설명하는 기능을 수행하기 위한 프로세싱 단위체로서 이러한 단위체가 복수 개 채용된 전자 장치에 적용될 수 있다. The electronic device according to the present disclosure includes at least one CPU or processor having a plurality of CPU cores in addition to other known hardware components. The term CPU core in the electronic device according to the present disclosure is not limited to a term for convenience of description and means a plurality of CPUs or a plurality of processors or at least one CPU or at least one processor having a plurality of CPU cores . That is, in the present disclosure, the CPU core can be applied to an electronic apparatus having a plurality of such unit bodies as a processing unit for performing the functions described below.

도 1은 4개의 CPU(central processing unit) 코어를 갖는 CPU를 포함하는 스마트폰의 개략도이다. 1 is a schematic diagram of a smartphone including a CPU having four central processing unit (CPU) cores.

도 1을 참조하면, 전자 장치는 CPU 110 및 메모리 120를 포함한다. CPU 110는 다수의 CPU 코어들 112-1 내지 112-4를 포함한다. 각 CPU 코어는 물리적으로 활성화 또는 비활성화(enabled/disabled), 예를 들어, 스위치 온 또는 오프할 수 있으며, 보안 모드(secure mode) 또는 비보안 모드(non-secure mode)에서 각각 동작하도록 적응된다. 전자 장치에는 비보안 OS인 리치 OS(RichOS)와 보안 OS인 시큐어 OS(SecureOS)라는 두 개의 운영 체제가 설치된다. 즉, 메모리 120는 보안 OS와 비보안 OS를 수행하기 위한 동작 명령을 저장한다. 여기서는 설명의 편의를 위해 보안 OS의 예로 시큐어 OS를, 비보안 OS의 예로 리치 OS를 제시하였으나 본 개시는 이에 한정되지 않으며 본 개시의 실시 예들은 보안 OS와 비보안 OS로 구별된 두 개의 운용 체제를 설치하여 동작하는 임의의 전자 기기에 적용될 수 있다. Referring to FIG. 1, an electronic device includes a CPU 110 and a memory 120. The CPU 110 includes a plurality of CPU cores 112-1 to 112-4. Each CPU core may be physically enabled or disabled, e.g., switched on or off, and adapted to operate in a secure mode or a non-secure mode, respectively. There are two operating systems installed in electronic devices: RichOS, an insecure OS, and SecureOS, a secure OS. That is, the memory 120 stores an operation command for executing the secure OS and the non-secure OS. Here, for convenience of explanation, a secure OS is shown as an example of a secure OS, and a rich OS is shown as an example of a non-secure OS. However, the present disclosure is not limited to this, and embodiments of the present disclosure include two operating systems The present invention can be applied to any electronic apparatus that operates by using a computer.

본 개시는 전자 장치가 다수의 CPU 또는 프로세서를 채용한 경우 각 CPU 또는 프로세서별로 각각 동작하도록 구현될 수 있으며, 이하 설명의 편의상 각 CPU 코어 또는 프로세서 코어 별로 동작하는 경우를 예로 들어 설명한다. 보안 OS와 비보안 OS의 각각의 모드에서 각 OS는 별도의 자체적 시스템 레지스터를 갖는다. 하나의 CPU 코어가 보안 모드로 전환되면 보안 OS는 해당 CPU 코어에 대한 제어를 획득하고 보안 환경에서 사용하도록 규정된 전자 장치의 리소스를 사용할 수 있다. 이와 동시에, 다른 CPU 코어가 비보안 모드에 있을 때 비보안 OS는 해당 CPU 코어에 대한 제어를 획득하고 비보안 환경에서 사용하도록 규정된 리소스를 사용할 수 있다. 즉, 비보안 환경과 보안 환경은 각각 CPU 코어 단위로 활성화된다. 예를 들어, 하나의 CPU 코어가 보안 모드에서 작동하여 보안 환경에서 보안 OS가 해당 CPU 코어를 제어하고 있는 동안 다른 CPU 코어는 비보안 환경의 비보안 OS 제어 하에 비보안 모드로 작동 할 수 있다. The present disclosure can be implemented by operating each CPU or each processor when an electronic device employs a plurality of CPUs or processors, and will be described below by way of example for the convenience of description for each CPU core or processor core. In each mode of the secure OS and the non-secure OS, each OS has its own system register. When one CPU core is switched to security mode, the security OS obtains control over the CPU core and can use the resources of the electronic device specified for use in the secure environment. At the same time, when another CPU core is in non-secure mode, an insecure OS can gain control over that CPU core and use resources specified for use in an insecure environment. That is, the non-secure environment and the secure environment are activated in units of CPU core, respectively. For example, while one CPU core is operating in secure mode and the security OS is controlling the CPU core in a secure environment, the other CPU core may operate in an unsecured mode under non-secure OS control in an insecure environment.

비보안 OS 및 보안 OS는 모두 멀티 스레딩(multi-threading)을 지원하며 전자 장치에서 동시에(simultaneously) 작동하도록 구성된다. 보안 OS 및 비보안 OS는 하드웨어 레벨까지 서로 엄격하게 격리된다. 두 개의 OS 사이의 통신을 위해 적어도 하나의 사전 정의된 인터페이스가 제공된다. 상기 인터페이스는 예를 들면 다음의 문서에 정의되어 있다.Both non-secure OS and secure OS support multi-threading and are configured to operate simultaneously in electronic devices. Secure OS and non-secure OS are strictly isolated from each other up to the hardware level. At least one predefined interface is provided for communication between the two OSs. The interface is defined, for example, in the following document.

http://infocenter.arm.com/help/topic/com.arm.doc.prd29-genc-009492c/PRD29-GENC-009492C_trustzone_security_whitepaper.pdf http://infocenter.arm.com/help/topic/com.arm.doc.prd29-genc-009492c/PRD29-GENC-009492C_trustzone_security_whitepaper.pdf

구글 트러스티(Google Trusty)는 공지된 보안 OS의 일 예이며, 안드로이드(Android)와 타이젠(Tizen) 등의 공지된 모바일 운영체제는 비보안 OS의 일 예이다. Google Trusty is an example of a known security OS, and known mobile operating systems such as Android and Tizen are examples of non-secure OSs.

두 개의 격리된 운영 체제들은, 전자 장치의 자원의 측면에서 비-보안 환경 ('non-secure world') 및 보안 환경 ('secure world')으로서 구현된다. 상술한 바와 같이, 비-보안 환경과 보안 환경 각각은 CPU 코어 별로 적용될 수 있다. 즉, 상술한 바와 같이 하나의 CPU 코어가 보안 모드에 있을 때, 보안 OS는 해당 CPU 코어에서의 제어를 획득하여 보안 환경에서 사용 가능하도록 설정된 전자 장치의 자원을 운영할 수 있다. 또한, 하나의 CPU 코어가 비보안 모드에 있을 때는, 비보안 OS가 해당 CPU 코어에서의 제어를 획득하여 비보안 환경에서 사용 가능하도록 설정된 전자 장치의 자원을 운영할 수 있다. 이 경우, 전자 장치의 특정 하드웨어 리소스가 보안 환경에서 사용될 때는 해당 리소스는 비보안 환경에서는 절대로 사용할 수 없도록 설정되어 있다. 특히, 보안 OS에 의해서만 액세스 가능한 전자 장치 메모리 (예를 들어, DRAM)의 영역이 존재한다. 이와 같이 보안 OS에 의해서만 액세스 가능한 전자 장치의 리소스는 비보안 환경에서는 절대로 물리적으로 액세스할 수 없다. 따라서, 예를 들어 보안 키, 또는 보안 코드 등의 매우 민감한 정보를 안전하게 유지 관리할 수 있다. 비보안 OS를 커널 수준에서 원격 제어 권한을 통해 제어하는 경우에도 보안 OS에 의해서만 액세스 가능한 리소스에는 접근할 수 없다. The two isolated operating systems are implemented as a 'non-secure world' and a 'secure world' in terms of the resources of the electronic device. As described above, each of the non-secure environment and the secure environment can be applied to each CPU core. That is, as described above, when one CPU core is in the security mode, the security OS obtains control from the CPU core and can operate resources of the electronic device set to be available in the security environment. Further, when one CPU core is in the non-security mode, the non-security OS acquires the control from the CPU core and can operate the resources of the electronic device set to be available in the non-security environment. In this case, when a specific hardware resource of the electronic device is used in a security environment, the resource is set to be disabled in an unsecured environment. In particular, there is an area of electronic device memory (e.g., DRAM) accessible only by a secure OS. In this way, the resources of electronic devices accessible only by the secure OS are never physically accessible in an insecure environment. Thus, highly sensitive information such as, for example, a security key or a security code can be securely maintained. Even when the non-security OS is controlled by the remote control authority at the kernel level, it can not access the resources that are accessible only by the security OS.

한편, 본 개시에서 전자 장치가 부팅 될 때, 부트 시퀀스가 완료되면 보안 OS가 먼저 초기화되고 비보안 OS는 그 후에 초기화될 수 있다. 비보안 OS에 특화된 시스템 구성 요소로서 비보안 OS 드라이버가 구현되며, 보안 OS에 특화된 시스템 구성 요소로서 보안 OS 스케줄러가 구현된다. 비보안 OS 드라이버와 보안 OS 스케줄러는 상술한 인터페이스를 통해 서로 통신하도록 구현된다. 보안 OS와의 통신 기능을 제공하는 외에도, 비보안 OS 드라이버는 CPU 코어를 활성화하고 비활성화하는 기능을 수행한다. 보안 OS 스케줄러는 보안 OS 스레드의 실행 큐를 유지 관리하여 보안 OS 스레드의 실행을 스케줄링한다. 한편, 비보안 모드에서 비보안 OS 스케줄러가 구현되며 비보안 OS 스레드의 실행 큐를 유지 관리하여 비보안 OS 스레드의 실행을 스케줄링한다. On the other hand, when the electronic device is booted in the present disclosure, when the boot sequence is completed, the secure OS can be initialized first and the non-secure OS can be initialized thereafter. The non-security OS driver is implemented as a system component specific to a non-security OS, and a security OS scheduler is implemented as a system component specific to a security OS. The non-secure OS driver and the secure OS scheduler are implemented to communicate with each other via the interface described above. In addition to providing communication with the security OS, the non-security OS driver functions to activate and deactivate the CPU core. The secure OS scheduler maintains an execution queue of the secure OS thread to schedule the execution of the secure OS thread. On the other hand, an unsecured OS scheduler is implemented in the non-security mode, and the execution of the non-secure OS thread is scheduled by maintaining the execution queue of the non-secure OS thread.

전자 장치가 예를 들어 스마트폰으로 구현된 경우를 예를 들어 설명하면, 사용자가 터치 스크린 잠금을 해제하기 위해 스마트폰의 잠긴 터치 스크린에 비밀번호를 입력하기 시작하면, 비보안 OS 클라이언트 응용 프로그램이 통신 프로세스로 전송되는 명령을 실행한다. 통신 프로세스는 스마트폰의 CPU 코어 수와 동일한 수의 통신 스레드 세트로 구성되며 비보안 OS에 의해 제공되는 기능이다. 각 통신 스레드는 특정 CPU 코어에 매핑되어 상기 통신 스레드가 상기 CPU 코어 상에서 실행될 수 있다. 이러한 매핑은 대칭형 멀티 프로세싱 기술에 의해 소개되었다. 통신 스레드가 CPU 코어에서 실행을 시작하면 CPU 코어를 보안 모드로 전환한다. 따라서, 명령이 수신되면, 통신 프로세스는 그 명령을 할당하기 위해 통신 스레드 중 하나를 차단 해제하고, 해당 통신 스레드는 일부 CPU 코어에서 실행되고 해당 CPU 코어를 보안 모드로 전환한다. 이에 따라 보안 OS는 CPU 코어에서 제어를 획득하고, 보안 OS 스케줄러가 실행을 시작하며 보안 처리된 터치 스크린 입력을 담당하는 신뢰 어플리케이션의 스레드를 차단 해제한다. 신뢰 어플리케이션의 스레드는 보안 모드의 CPU 코어에서 명령을 처리하기 위해 실행되며, 실행 중에 스마트폰의 모든 터치 스크린 컨트롤러는 보안 환경에서만 동작한다. 즉, 다른 CPU 코어에서 실행 중인 비보안 OS 어플리케이션 뿐만 아니라 비보안 OS 자체도 터치 스크린에 물리적으로 접근할 수 없다. 이러한 접근 거부는 해당 컨트롤러를 서비스하는 버스 수준에서 구현된다. 스마트폰의 다른 하드웨어도 다른 상황에서 비보안 환경에서 사용할 수 없게 될 수 있다. 명령 처리가 완료되면 스레드가 차단되고 CPU 코어를 비보안 모드로 다시 전환하고 처리 결과가 시큐어 OS 스케줄러에 의해 비보안 OS 드라이버에 전달되어 통신 프로세스에 의해 비보안 OS 클라이언트 어플리케이션으로 전송된다. 따라서, 비밀번호 인증과 같은 민감한 동작은 변조로부터 안전한 방식으로 수행될 수 있다. For example, if the electronic device is implemented as a smart phone, for example, when the user begins to enter a password on the locked touch screen of the smartphone to unlock the touch screen, Quot ;. The communication process consists of the same number of communication threads as the number of CPU cores of the smartphone and is a function provided by the non-secure OS. Each communication thread is mapped to a specific CPU core so that the communication thread can be executed on the CPU core. This mapping has been introduced by symmetric multiprocessing techniques. When the communication thread starts executing on the CPU core, the CPU core is switched to the security mode. Thus, when a command is received, the communication process unblocks one of the communication threads to allocate the command, and the communication thread runs on some CPU cores and switches the CPU cores to secure mode. The security OS thereby obtains control from the CPU core, and the secure OS scheduler begins execution and unblocks the thread of the trusted application responsible for the secure touch-screen input. The thread of the trust application is executed to process commands in the CPU core in secure mode, and all touch screen controllers of the smartphone operate only in the secure environment during execution. In other words, non-secure OS applications running on different CPU cores, as well as non-secure OS itself, can not physically access the touch screen. This access denial is implemented at the bus level servicing the controller. Other hardware on the smartphone can also become unusable under non-secure circumstances in other situations. When the command processing is completed, the thread is interrupted, the CPU core is switched back to the non-secure mode, and the processing result is transferred to the non-secure OS driver by the secure OS scheduler and transferred to the non-secure OS client application by the communication process. Thus, sensitive operations such as password authentication can be performed in a manner that is secure from tampering.

도 2는 본 개시의 전자 장치에서 수행되는 보안 OS 및 비보안 OS 운영 메커니즘을 설명하기 위한 흐름도이다.2 is a flow chart for illustrating a secure OS and a non-secure OS operating mechanism performed in the electronic apparatus of the present disclosure;

이하, 도 2를 참조하여, 본 개시에 따른 전자 장치에서 보안 OS 및 비보안 OS를 운영하는 방법 200을 설명한다. 2, a method 200 for operating a secure OS and an unsecured OS in an electronic device according to the present disclosure is described.

단계 201에 따르면, 보안 OS에서 보안 환경에서 실행되는 명령 수행을 위해 스레드 A로 표시된 적어도 하나의 보안 OS 실행 스레드(execution thread)를 생성한다. 여기서는 스레드 A를 예를 들어 설명하나 복수 개의 스레드, 예를 들면 스레드 A 및 스레드 B가 동시에 또는 순차로 생성될 수 있으며, 후술하는 단계는 스레드 A 및 스레드 B가 동시에 또는 순차로 생성되는 경우 동시에 또는 순차로 수행될 수 있다. According to step 201, at least one secure OS execution thread indicated by thread A is created for execution of an instruction executed in the secure OS in the secure environment. Here, thread A is described by way of example, but a plurality of threads, for example, thread A and thread B, may be generated simultaneously or sequentially, and the steps described below may be performed concurrently or sequentially when thread A and thread B are generated simultaneously or sequentially Can be performed sequentially.

단계 203에서는, 보안 OS에서 스레드 A가 생성됨에 따라, 보안 OS의 CPU 코어 중 예를 들어 CPU 코어 A로 표시된 CPU 코어를 지정하고 지정된 CPU 코어 A에서 스레드 A를 실행하기 위해, 보안 OS는 CPU 코어 A에 대해 보안 모드로 동작을 수행하도록 할당해달라는 요청을 나타내는 정보를 생성한다. 보안 모드 동작 수행 요청을 나타내는 정보는, 보안 OS가 CPU 코어 A를 지정하고 지정된 CPU 코어 A에 대해 제어를 보안 모드로 할당해달라는 요청을 비보안 OS에 알리기 위한 것으로서 할당이 요구되는 하나 또는 그 이상의 CPU 코어에 대한 정보, 예를 들어 요구되는 CPU 코어의 식별 정보, 요구되는 CPU 코어의 개수, 요구되는 CPU 코어의 현재 사용 정보 등을 나타낼 수 있다. In step 203, as the thread A is created in the secure OS, the security OS specifies the CPU core indicated by, for example, CPU core A among the CPU cores of the secure OS and executes the thread A on the designated CPU core A, A < / RTI > to request to be assigned to perform an operation in secure mode. The information indicating the security mode operation execution request is information for notifying the non-secure OS that the security OS designates the CPU core A and allocates control to the security mode for the designated CPU core A, and designates one or more CPUs Information about the core, e.g., identification of the required CPU core, the number of required CPU cores, current usage information of the requested CPU core, and the like.

본 개시의 일 실시 예에 따르면, 보안 모드 동작 수행 요청 정보의 일 예로서 보안 OS에서 요청 정보를 나타내기 위한 특정 데이터 구조가 제안된다. 이하, 이러한 데이터 구조를 예를 들어 'CPU 마스크'라고 칭한다. 보안 OS는 CPU 마스크를 사용하여 CPU 코어에서의 보안 OS의 현재 요구 사항에 대해 비보안 OS에 알릴 수 있다. CPU 마스크는, 개별 보안 OS 스레드를 특정 CPU 코어에 할당하기 위해 본 개시에 따라 일 예로서 설계된 데이터 구조이다. According to an embodiment of the present disclosure, a specific data structure for indicating request information in a secure OS is suggested as an example of security mode operation execution request information. Hereinafter, this data structure is referred to as a " CPU mask ". The security OS can use the CPU mask to inform the nonsecure OS about the current requirements of the secure OS on the CPU core. The CPU mask is a data structure designed by way of example in accordance with this disclosure to allocate individual secure OS threads to a particular CPU core.

도 3은 CPU 마스크의 구현 예를 설명하기 위한 도면이다. 도 3은 본 개시의 일 실시 예에 따른 CPU 마스크가 각 CPU 코어 당 하나의 비트 필드로서 구현된 예를 나타낸다. 이 경우, 구현된 구조에 따른 미리 정의된 비트 필드에 대한 통신 처리 프로세스가 사전에 보안 OS와 비보안 OS에 의해 협의된다. 도 3을 참조하면, 스레드, 보다 구체적으로는 보안 OS 스레드를 나타내는 데이터 구조 중에서, 적어도 하나의 비트 필드를 이용하여 해당 보안 OS 스레드를 특정 CPU 코어에 할당하도록 요청하는 정보를 나타낼 수 있다. 예를 들어, 각 비트 필드가 나타내는 CPU 코어는 미리 정의되며, 특정 CPU 코어에 해당하는 비트 필드의 엔트리, 예를 들면 비트 값에 의해 해당 CPU 코어의 할당 요청을 나타내도록 구현할 수 있다. 이와 달리, 각 CPU 코어에 해당하는 미리 정의된 식별 번호를 비트 필드 엔트리로 입력하여 해당 CPU 코어의 할당 요청을 나타내도록 구현할 수도 있다. 도 3의 예에서는 CPU 0 또는 CPU N-2에 대한 할당 요청을 나타낸다. 한편, 스레드가 차단되어 어느 CPU 코어에도 할당되지 않은 경우, 특정 값, 예를 들면 0을 상기 비트 필드의 엔트리, 예를 들면 비트 값으로서 포함하도록 구현한다. 3 is a diagram for explaining an implementation example of a CPU mask. Figure 3 shows an example in which a CPU mask according to one embodiment of the present disclosure is implemented as one bit field per CPU core. In this case, the communication processing process for the predefined bit field according to the implemented structure is negotiated by the security OS and the non-security OS in advance. Referring to FIG. 3, from among data structures representing threads, more specifically, a secure OS thread, at least one bit field may be used to indicate information requesting to allocate a corresponding secure OS thread to a specific CPU core. For example, the CPU core indicated by each bit field is predefined and can be implemented to indicate an allocation request of the CPU core by an entry of a bit field corresponding to a specific CPU core, for example, a bit value. Alternatively, a predefined identification number corresponding to each CPU core may be input as a bit field entry to indicate an allocation request of the corresponding CPU core. In the example of FIG. 3, it indicates an allocation request for CPU 0 or CPU N-2. On the other hand, when the thread is blocked and is not allocated to any CPU core, a specific value, for example, 0, is implemented to include as an entry in the bit field, for example, a bit value.

또한, 보안 OS 스케줄러는 복수의 기준 카운터, 예를 들면 CPU 코어 전체 개수에 대응하는 개수의 기준 카운터를 포함하는 기준 카운터 어레이를 구현할 수 있으며, 각 CPU 코어에 현재 얼마나 많은 스레드가 할당되어 있는지를 각각의 기준 카운터로 계수할 수 있다. 이에 따라 각 기준 카운터는 각 CPU 코어의 사용 정보를 나타낼 수 있다. 특정 스레드가 특정 CPU 코어에 할당되면 기준 카운터 어레이 중 해당 CPU 코어에 대응하는 기준 카운터가 1씩 증가한다. 반대로 스레드가 해당 CPU 코어에서 할당 해제되면 해당 카운터가 1씩 감소한다. 본 개시의 일 실시 예에 따르면, 상기 기준 카운터가 0이 되면, CPU 마스크에서 해당 CPU 코어에 대응하는 비트 엔트리는 예를 들면 0으로 폐기될 수 있다. 도 3에 예시된 CPU 마스크는 각 CPU 코어에 대한 보안 모드 실행 요청을 나타내는 외에 각 기준 카운터에 의해 나타내는 각 CPU 코어의 사용 정보를 나타내도록 변형될 수도 있다. Also, the secure OS scheduler may implement a reference counter array that includes a plurality of reference counters, e.g., a number of reference counters corresponding to the total number of CPU cores, and determines how many threads are currently allocated to each CPU core Can be counted by the reference counter of the reference value. Accordingly, each reference counter can indicate usage information of each CPU core. When a particular thread is assigned to a particular CPU core, the reference counter corresponding to that CPU core in the reference counter array is incremented by one. Conversely, when a thread is deallocated from its CPU core, the counter is decremented by one. According to one embodiment of the present disclosure, when the reference counter becomes 0, the bit entry corresponding to the CPU core in the CPU mask may be discarded to 0, for example. The CPU mask illustrated in FIG. 3 may be modified to indicate usage information of each CPU core indicated by each reference counter in addition to indicating a security mode execution request for each CPU core.

보안 OS에서 스레드에 대해 CPU 코어를 요청할 때 복수의 CPU 코어에 대한 현재 사용 정보를 이용하여 예를 들면, 가장 작은 개수의 스레드가 할당된 CPU 코어 순으로 할당하도록 할 수 있다. 또한, 특정 스레드를 특정 CPU 코어에 매핑하기 위해, 해당 스레드의 선호도 속성(affinity property)을 이용할 수 있다. 선호도 속성은 예를 들면, 각각의 스레드가 서로 다른 CPU 코어에 매핑되도록 설정될 수 있다. 또한, 특정 스레드에 대해 '약한 선호도(weak affinity)'가 설정될 수 있으며, 이에 따르면 스레드가 실행될 CPU 코어를 별도로 지정하지 않았다면 해당 스레드가 임의의 CPU 코어에서 실행되는 것이 허용됨을 나타낸다. 또한, 스레드 각각이 설정된 선호도 속성에 따라 할당되는 CPU 코어에서만 실행되도록 구현할 수 있다. 다른 예로는 전자 장치가 성능이 다른 2개 이상의 CPU 코어로 구성된 경우, 스레드의 선호도 정보는 성능이 높은 CPU 코어 또는 성능이 낮은 CPU 코어 중 어느 하나에 할당되도록 설정될 수 있다. 보안 OS에서는 스레드의 선호도 속성 설정을 포함하는 사용 정보를 확인하고 이에 기초하여 해당 스레드에 CPU 코어를 매핑한다. 따라서 선호도 속성을 이용하여 스레드 처리 능력을 향상시키는 동시에 높은 성능이 요구되는 스레드와 그렇지 않은 스레드의 요구를 충족시켜 처리 효율을 높이고 전력 소비를 낮출 수 있다. 이와 달리, 스레드의 선호도 속성은 보안 OS 스케줄러에 의해 무시되거나 수정될 수도 있다. When a security OS requests a CPU core for a thread, the current usage information for a plurality of CPU cores may be used to allocate, for example, the smallest number of threads allocated in order of allocated CPU cores. Further, in order to map a specific thread to a specific CPU core, an affinity property of the thread can be used. The preference attribute may be set, for example, such that each thread is mapped to a different CPU core. Also, a " weak affinity " may be set for a particular thread, indicating that the thread is allowed to run on any CPU core unless the thread has specified a CPU core to run on. Also, each of the threads can be implemented to be executed only on the CPU core allocated according to the set preference attribute. As another example, if the electronic device is composed of two or more CPU cores with different performance, the thread's preference information may be set to be assigned to either a high-performance CPU core or a low-performance CPU core. The security OS identifies the usage information, including the thread's preference attribute settings, and maps the CPU core to that thread based on that information. Therefore, by using the preference attribute, the thread processing ability can be improved, and at the same time, the processing efficiency can be improved and the power consumption can be lowered by meeting the demands of the thread having high performance and the thread having not high performance. Alternatively, the thread's preference attribute may be ignored or modified by the secure OS scheduler.

상술한 단계 203에서, 보안 OS, 또는 보안 OS 스케줄러는 CPU 코어 A에 대응하는 비트 필드의 비트 엔트리를 설정하여 보안 OS가 스레드 A의 실행을 위해 CPU 코어 A를 필요로 함을 나타내도록 CPU 마스크를 수정한다. In step 203 described above, the secure OS, or secure OS scheduler, sets a bit entry in the bit field corresponding to CPU core A to set the CPU mask to indicate that the secure OS requires CPU core A for execution of thread A Modify it.

CPU 마스크를 비트 필드로서 구현한 상기 예는 본 개시를 한정하지 않으며, CPU 마스크 데이터 구조에 대한 다른 구현이 가능함은 당업자에게 자명하다. It should be apparent to those skilled in the art that the above example of implementing a CPU mask as a bit field does not limit the present disclosure and that other implementations of the CPU mask data structure are possible.

단계 205에서, 보안 OS는, CPU 코어 A에 대한 제어를 보안 OS 에게 할당하도록 요청하기 위해 생성된 요청 정보, 예를 들면 CPU 마스크를 비보안 OS로 전송한다. 이때 통신은 보안 OS와 비보안 OS 간의 상술한 인터페이스를 통해 이루어진다. CPU 코어 A에 대응하는 CPU 마스크에 설정된 비트 엔트리는, 비트 엔트리가 예를 들면 0으로 폐기되지 않는 한, 비보안 OS가 해당 CPU 코어 A를 비활성화하지 않도록 한다. In step 205, the secure OS transmits the generated request information, for example a CPU mask, to the non-secure OS to request the control OS to allocate control to the secure OS. At this time, communication is performed through the above-described interface between the secure OS and the non-secure OS. The bit entry set in the CPU mask corresponding to the CPU core A ensures that the non-secure OS does not deactivate the CPU core A unless the bit entry is discarded as 0, for example.

단계 207에서, 보안 모드 수행 동작을 위한 CPU 코어 할당 요청 정보, 예를 들면 CPU 마스크에 기초하여, 비보안 OS는 CPU 코어 A를 보안 모드로 동작하도록 할당한다. 이를 위해 비보안 OS는 CPU 코어 A를 보안 모드로 전환할 수 있다. 예를 들어 비보안 OS는 CPU 코어 A에 대한 비보안 OS 스레드 할당을 차단하고 해당 CPU 코어 A가 보안 모드로 전환되도록 할 수 있다. 이때, 비보안 OS는, CPU 코어 A가 현재 비활성화되어 있으면, 수신된 CPU 마스크에 기초하여, CPU 코어 A를 활성화한다. 따라서 CPU 코어 A에 대한 제어가 보안 OS에 제공되며 보안 OS는 할당된 CPU 코어A를 보안 모드로 동작시키고 보안 OS 스레드A를 실행한다. In step 207, based on the CPU core allocation request information for performing the secure mode, for example, the CPU mask, the non-secure OS allocates the CPU core A to operate in the security mode. For this, the non-security OS can switch CPU core A to security mode. For example, an insecure OS may block non-secure OS thread allocation to CPU core A and cause its CPU core A to switch to secure mode. At this time, when the CPU core A is currently inactivated, the non-security OS activates the CPU core A based on the received CPU mask. Thus, control of CPU core A is provided to the security OS, and the security OS operates the allocated CPU core A in the security mode and executes the security OS thread A.

이상 설명된 방법 200은 스레드 A에 한정되지 않고 임의의 보안 OS 스레드에 대해 동일하게 수행될 수 있다. 또한, 복수의 보안 OS 스레드에 대해서도 실행될 수 있다. The method 200 described above is not limited to thread A and can be performed equally for any secure OS thread. It can also be executed against a plurality of secure OS threads.

도 4는 본 개시에 따른 보안 OS 및 비보안 OS의 동작을 설명하기 위한 도면이다.4 is a diagram for explaining the operation of the secure OS and the non-secure OS according to the present disclosure.

이하, 도 4를 참조하여 본 개시의 실시 예에 따른 단계 201 내지 207의 수행과 관련된 보안 OS 및 비보안 OS의 구성 및 해당 구성에 따라 수행되는 동작들에 대해 설명한다. Hereinafter, with reference to FIG. 4, the configuration of the secure OS and the non-secure OS and the operations performed according to the configuration will be described in connection with the execution of steps 201 to 207 according to the embodiment of the present disclosure.

보안 OS는 보안 OS 스케줄러 401을 포함한다. 보안 OS 스케줄러 401의 기본 기능은 보안 OS 스레드의 실행을 스케줄링하는 것이다. 일 실시 예에 따르면, 보안 OS 스케줄러 401은 상술한 바와 같이 보안 OS에서 CPU 마스크를 유지하고 이를 이용하여 CPU 코어에 보안 OS 스레드를 할당하도록 구성된다. CPU 마스크는 할당된 내용에 따라 적절하게 수정될 수 있다. 즉, 단계 203는 본 개시의 실시 예에서 보안 OS 스케줄러 401에 의해 수행될 수 있다. The secure OS includes a secure OS scheduler 401. The basic function of the secure OS scheduler 401 is to schedule the execution of the secure OS thread. According to one embodiment, the secure OS scheduler 401 is configured to maintain a CPU mask in the secure OS and use it to allocate a secure OS thread to the CPU core, as described above. The CPU mask can be appropriately modified according to the assigned contents. That is, step 203 may be performed by the secure OS scheduler 401 in the embodiment of the present disclosure.

비보안 OS는, 전자 장치에서 연산 부하가 증가함에 따라, CPU 코어 번호에 의해 정의되는 미리 설정된 순서대로 현재 비활성화된 CPU 코어를 순차적으로 활성화하도록 구성된다. 실시 예에 따라서, 보안 OS 스케줄러 401은 상기 미리 설정된 순서에 따라 보안 OS 스레드에 CPU 코어를 할당하도록 할 수 있다. 또한, 실시 예에 따라서, 보안 OS 스케줄러 401은 각 CPU 코어의 사용 정보에 기초하여 사용량이 적은 CPU 코어 순으로, 예를 들면 기준 카운터가 낮은 CPU 코어에 대해 우선적으로 보안 OS 스레드가 할당되도록 할 수 있다. The non-secure OS is configured to sequentially activate the currently disabled CPU cores in a predetermined order defined by the CPU core number as the computing load increases in the electronic device. According to an embodiment, the secure OS scheduler 401 may cause the secure OS thread to allocate a CPU core according to the predetermined order. In addition, according to the embodiment, the secure OS scheduler 401 can preferentially allocate a secure OS thread to a CPU core having a low usage amount in descending order of CPU cores, for example, based on usage information of each CPU core have.

비보안 OS는 비보안 OS 스케줄러(미도시)를 포함하며, 비보안 OS 스케줄러는 보안 OS 스케줄러와 유사하게 비보안 OS 스레드의 실행을 스케줄링하도록 구성된다. The non-secure OS includes a non-secure OS scheduler (not shown), and the non-secure OS scheduler is configured to schedule the execution of the non-secure OS thread similarly to the secure OS scheduler.

비보안 OS는 비보안 OS 드라이버 410을 포함한다. 상술한 바와 같이, 비보안 OS 드라이버 410은 보안 OS 스케줄러 401과 통신하여 요청된 CPU 코어들을 물리적으로 활성화 또는 불활성화하도록 구성된다. 또한, 보안 OS 스케줄러 401에 의해 요청된 CPU 코어를 보안 모드로 전환하여 보안 OS로 제공한다. 보안 OS와 비보안 OS 사이의 통신은, 전술한 바와 같은 미리 정의된 인터페이스 405를 통해 보안 OS 스케줄러 401와 비보안 OS 드라이버 410 사이에서 수행된다. The non-secure OS includes an insecure OS driver 410. As described above, the non-secure OS driver 410 is configured to communicate with the secure OS scheduler 401 to physically activate or deactivate the requested CPU cores. In addition, the CPU core requested by the secure OS scheduler 401 is switched to the security mode and provided to the security OS. The communication between the secure OS and the insecure OS is performed between the secure OS scheduler 401 and the insecure OS driver 410 through the predefined interface 405 as described above.

본 개시의 실시 예에 따른 통신 프로세스에 대해 설명한다. 본 개시의 실시 예에서 설명되는 통신 프로세스는, 보안 OS와 비보안 OS 사이의 통신에 기초하여 비보안 OS 시스템에 의해 수행된다. 따라서, 비보안 OS 드라이버 410은, 보안 OS 스레드를 처리하기 위한 보안 환경과의 통신에 따른 통신 스레드에 대해 특정 시간 동안(time slice) 허여된 CPU 코어에서 해당 보안 OS 스레드를 처리할 수 있도록 해당 CPU 코어를 보안 모드로 전환할 수 있다. A communication process according to an embodiment of the present disclosure will be described. The communication process described in the embodiments of the present disclosure is performed by an insecure OS system based on communication between a secure OS and an insecure OS. Accordingly, the nonsecure OS driver 410 is able to process a corresponding OS thread in a CPU core granted a time slice to a communication thread for communication with a secure environment for processing a secure OS thread, To the security mode.

하나의 통신 스레드 세트에 포함되는 통신 스레드의 개수는 전자 장치의 CPU 코어의 개수와 동일하고, 각 통신 스레드가 각각의 CPU 코어에 매핑되어 해당 통신 스레드가 매핑된 CPU 코어에서 실행되도록 구현된다. 비보안 OS 스레드의 실행을 위한 보안 OS와 비보안 OS 사이의 통신을 위한 통신 스레드가 매핑된 CPU 코어에서 실행되기 시작할 때, 매핑된 해당 CPU 코어는 보안 모드로 전환된다. The number of communication threads included in one communication thread set is equal to the number of CPU cores of the electronic device and each communication thread is mapped to each CPU core so that the communication thread is executed in the mapped CPU core. When a communication thread for communication between a secure OS and an insecure OS for execution of an insecure OS thread starts to execute on a mapped CPU core, the mapped CPU core is switched to the security mode.

비보안 OS 시스템에 의해 수행되는 통신 프로세스는, 본 개시에서 설명하는 보안 환경과 통신하기 위한 통신 스레드 외에도, 비보안 OS 클라이언트와 상호 동작을 위한 스레드를 포함할 수 있다. The communication process performed by the non-secure OS system may include a thread for interaction with the non-secure OS client, in addition to the communication thread for communicating with the secure environment described in this disclosure.

상술한 바와 같은 매핑은 통신 스레드의 선호도 속성(affinity property)을 설정함으로써 또한 구현될 수 있다. 예를 들어, 통신 스레드에 대해 '약한 선호도(weak affinity)'가 설정될 수 있으며, 이는 통신 스레드가 실행될 CPU 코어가 지정되지 않았다면 통신 스레드가 임의의 CPU 코어에서 실행되는 것이 허용됨을 나타낸다. 또 다른 예로는 전자 장치가 2개의 서로 다른 CPU 코어 클러스터를 포함하고 큰 클러스터는 고성능 CPU 코어들로 구성되고, 작은 클러스터는 생산성이 높지 않은 전력 효율적인 저성능 CPU 코어들로 구성되는 경우에 적용된다. 이 경우 통신 스레드에 대한 선호도 속성이 큰 클러스터의 CPU 코어에 할당되는 방식으로 설정되면 해당 통신 스레드는 고성능 CPU 코어에서 실행되고 특정 통신 스레드가 작은 클러스터의 CPU 코어에 할당되는 방식으로 설정되면 해당 통신 스레드는 저성능 CPU 코어에서 실행된다. 따라서 선호도 속성을 이용하여 성능과 전력 소비 간의 균형을 맞출 수 있다. The mapping as described above may also be implemented by setting the affinity property of the communication thread. For example, a 'weak affinity' may be set for a communication thread, which indicates that the communication thread is allowed to run on any CPU core if the CPU core on which the communication thread is to be executed is not specified. Another example applies when the electronic device comprises two different CPU core clusters, the larger clusters are composed of high performance CPU cores, and the smaller clusters are composed of power efficient low performance CPU cores which are not very productive. In this case, if the affinity property for a communication thread is set to be allocated to the CPU core of a large cluster, if the communication thread is set to run on a high-performance CPU core and a specific communication thread is assigned to a CPU core of a small cluster, Run on a low-performance CPU core. Therefore, a balance between performance and power consumption can be achieved using the preference property.

본 개시의 실시 예에 따르면, 각각의 통신 스레드가 서로 다른 CPU 코어에 매핑되는 방식으로 통신 스레드의 선호도 속성을 설정할 수 있다. 즉, 각각의 통신 스레드에 대한 선호도 속성이 통신 스레드와 CPU 코어 사이에 일대일 대응하도록 정의되는 방식으로 설정될 수 있다. 이러한 설정에서, 통신 스레드 각각은 설정된 선호도 속성에 따라 할당되는 CPU 코어에서만 실행되도록 할 수 있다. 비보안 OS 드라이버 또는 비보안 OS 스케줄러는 통신 스레드의 설정을 확인하고 해당 통신 스레드에 할당된 CPU 코어에 해당 통신 스레드를 매핑한다. According to an embodiment of the present disclosure, the preference attribute of a communication thread can be set in such a way that each communication thread is mapped to a different CPU core. That is, the preference attribute for each communication thread may be set to be defined to correspond one-to-one between the communication thread and the CPU core. In this setup, each of the communication threads can be made to run only on the CPU core assigned according to the set preference attribute. The non-secure OS driver or non-secure OS scheduler checks the configuration of the communication thread and maps the communication thread to the CPU core assigned to the communication thread.

한편, 통신 스레드의 선호도 속성은 비보안 OS에서 필요한 경우 무시되거나 수정될 수 있다. 특정 CPU 코어가 비보안 OS 드라이버 310에 의해 비활성화되는 경우, 이에 따라 비보안 OS 스케줄러는 해당 통신 스레드의 선호도 속성을 수정하여 비보안 OS의 해당 CPU 코어에 해당하는 통신 스레드의 매핑을 폐기할 수 있다. 또한, 필요한 CPU 코어들을 사용할 수 없는 경우, 비보안 OS 스케줄러는 선호도 속성을 무시하고 해당 스레드를 현재 사용 가능한 CPU 코어에서 실행할 수 있다. 반대로, 이전에 비활성화된 CPU 코어가 다시 활성화되는 경우, 선호도 속성은 다시 활성화된 CPU 코어에 해당하는 통신 스레드의 매핑을 복원하도록 수정될 수 있다. On the other hand, the preference attribute of the communication thread can be ignored or modified if necessary in the non-secure OS. When a specific CPU core is deactivated by the non-secure OS driver 310, the non-secure OS scheduler can modify the preference attribute of the corresponding communication thread to discard the mapping of the communication thread corresponding to the corresponding CPU core of the non-secure OS. Also, if the required CPU cores are not available, the non-secure OS scheduler can ignore the preference attribute and run the thread on the currently available CPU core. Conversely, if the previously deactivated CPU core is reactivated, the preference attribute may be modified to restore the mapping of the communication thread corresponding to the re-activated CPU core.

이하, 도 2, 4 및 5를 참조하여, 본 개시의 실시 예를 설명한다. 도 5는 본 개시의 실시 예에 따른 전자 장치의 동작 프로세스 500을 나타내는 흐름도이다. Hereinafter, an embodiment of the present disclosure will be described with reference to Figs. 2, 4 and 5. Fig. 5 is a flow diagram illustrating an operational process 500 of an electronic device according to an embodiment of the present disclosure.

단계 501에서, 비보안 환경에서 실행되는 비보안 OS 클라이언트 응용 프로그램 320이 명령을 발행한다. 비보안 OS 클라이언트 320은 텍스트 및/또는 그래픽 암호를 입력하기 위한 GUI 또는 휴대 단말기의 터치 스크린을 잠금 해제하기 위해 사용자의 홍채를 주사하기 위한 GUI를 사용자에게 제공하도록 구성되는 어플리케이션일 수 있으며, 사용자에 의해 입력되는 정보를 획득하도록 구성될 수 있다. 터치 스크린 잠금을 해제하려는 사용자의 시도에 따라 GUI와 사용자의 상호 작용의 시작에 응답하여 비보안 OS 클라이언트 응용 프로그램 420에 의해 명령이 발행된다. 사용자 인증을 담당하는 보안 환경에서 실행되는 보안 OS 신뢰 어플리케이션(SecureOS trusted application) 402에 의해 명령이 처리되는 특정 실시 예를 가정한다. 신뢰 어플리케이션 402는, 자원에 대한 수요가 비교적 작은, 사용자의 텍스트 암호를 확인하는 응용 프로그램이거나, 또는 자원에 대한 수요가 매우 많은, 사용자의 홍채를 확인하도록 구성된 응용 프로그램일 수 있다. 즉, 명령은 실질적으로 신뢰 어플리케이션 402가 입력된 정보를 적절하게 처리하고 비보안 OS 클라이언트 어플리케이션 420으로 처리 결과를 반환하도록 구성된다. In step 501, the non-secure OS client application 320 executing in an insecure environment issues an instruction. The non-secure OS client 320 may be an application configured to provide a user with a GUI for entering text and / or graphics passwords or a GUI for scanning a user's iris to unlock the touch screen of the wireless terminal, And can be configured to obtain input information. The command is issued by the non-secure OS client application 420 in response to the user's attempt to unlock the touch screen and in response to the start of the user's interaction with the GUI. It is assumed that the command is processed by a secure OS trusted application 402 running in a secure environment that is responsible for user authentication. The trust application 402 may be an application program that confirms a user's textual password with a relatively small demand for resources, or an application program configured to identify a user's iris with a very high demand for resources. That is, the command is configured such that the trusted application 402 properly processes the input information and returns the processing result to the non-secure OS client application 420.

신뢰 어플리케이션 402는 멀티 스레드 응용 프로그램이다. 따라서, 하나 이상의 보안 OS 스레드들이 생성된다. 상술된 명령의 부재 시, 예를 들어, 전자 장치가 대기(stanby) 모드에 있고 현재 사용자가 사용하지 않을 때, 또는 터치스크린의 잠금이 성공적으로 해제된 후 사용자가 전자 장치를 작동할 때, 신뢰 어플리케이션의 스레드는 차단된다. Trust application 402 is a multi-threaded application. Thus, one or more secure OS threads are created. In the absence of the above-mentioned command, for example, when the electronic device is in stanby mode and the current user is not using it, or when the user operates the electronic device after the lock of the touch screen is successfully released, The application thread is blocked.

비보안 OS 클라이언트가 명령을 발행한 후, 단계 502에서 통신 프로세스는 명령을 수신하고, 수신된 명령을 할당하기 위해 통신 스레드 중 하나를 차단 해제(unblock)하고, 이에 따라, 통신 스레드를 비보안 OS 스케줄러의 실행 큐에 배치한다. After the non-secure OS client issues the command, in step 502 the communication process receives the command and unblocks one of the communication threads to allocate the received command, thereby causing the communication thread to communicate with the non-secure OS scheduler Place it in the run queue.

이어서, 단계 502에서, 해당 통신 스레드가 비보안 OS 스케줄러에 의해 그에 할당된 CPU 코어(이하, CPU 코어 O로 칭함)에서 실행되기 시작할 때, 통신 스레드는 CPU 코어 O를 보안 모드로 전환(switching)한다. 전환 시, 보안 OS 스케줄러 401은 CPU 코어 O 상에서 실행을 시작하고, 명령 처리를 담당하는 하나 이상의 신뢰 어플리케이션 402의 보안 OS 스레드 중 적어도 하나의 실행 스레드를 차단 해제(unblock)한다. Then, at step 502, when the communication thread starts executing in the CPU core (hereinafter referred to as CPU core O) allocated thereto by the non-secure OS scheduler, the communication thread switches the CPU core O to the security mode . Upon switching, the secure OS scheduler 401 begins execution on CPU core O and unblocks at least one execution thread of the secure OS threads of one or more trusted applications 402 responsible for command processing.

이하, 신뢰 어플리케이션 402의 복수의 스레드가 차단 해제되고, 스레드 A가 그 복수의 스레드 중 하나인 예를 설명한다. Hereinafter, an example is described in which a plurality of threads of the trust application 402 are unblocked and thread A is one of the plurality of threads.

단계 503에서, 보안 OS 스케줄러 401은 차단 해제된 스레드 A에 CPU 코어 A를 할당하고, 할당을 수행할 때 CPU 마스크를 갱신한다. 상술한 바와 같이, 특히, 신뢰 어플리케이션의 보안 OS 스레드가 이전에 CPU 코어 A에 전혀 할당되지 않았으면, 보안 OS 스케줄러 401은 CPU 마스크에서 CPU 코어 A에 대응하는 비트 엔트리를 설정한다. 이 경우 비트 엔트리가 예를 들면 '0'에서 '1'로 수정된다. 다른 실행 스레드도 동일하게 처리된다. 즉, 이러한 방식으로 CPU 마스크 내의 비트 엔트리들을 설정하여 CPU 코어들에 대한 현재 보안 OS의 요구를 나타낸다. 이어서, 보안 OS 스케줄러는 차단 해제된 스레드 각각을 보안 OS 스케줄러 큐에 배치하고 각 스레드 실행을 위한 시간(time quote)을 할당한다. In step 503, the secure OS scheduler 401 allocates CPU core A to the unblocked thread A, and updates the CPU mask when performing the allocation. As described above, in particular, if the secure OS thread of the trusted application has not been previously assigned to CPU core A, the secure OS scheduler 401 sets the bit entry corresponding to CPU core A in the CPU mask. In this case, the bit entry is modified from '0' to '1', for example. Other execution threads are handled identically. That is, it sets the bit entries in the CPU mask in this manner to indicate the current security OS requirement for the CPU cores. The secure OS scheduler then places each unblocked thread in the secure OS scheduler queue and allocates a time quote for each thread execution.

전술한 바와 같이, 보안 OS 스케줄러 401은 이어서 CPU 코어 O의 해당 큐의 상단에 있는 복수의 스레드 중 하나(이하, 스레드 O라 칭함)의 실행으로 전환한다. 이 경우, 스레드 O는, CPU 마스크에서 스레드 O에 현재 할당한 CPU 코어와는 다른 CPU 코어 O 상에서 실행된다. 스레드 A는 현재 보안 OS 스케줄러 큐에 있는 것으로 가정한다. 한편, 신뢰 어플리케이션 스레드를 실행하는 동안 전자 장치의 특정 하드웨어, 예를 들어 터치 스크린 컨트롤러 등은 보안 환경에서만 작동 가능하다. As described above, the secure OS scheduler 401 then switches to execution of one of a plurality of threads (hereinafter referred to as thread O) at the top of the corresponding queue of CPU core O. In this case, thread O is executed on the CPU core O different from the CPU core currently assigned to thread O in the CPU mask. It is assumed that thread A is currently in the secure OS scheduler queue. On the other hand, certain hardware of an electronic device, such as a touch screen controller, etc., can only operate in a secure environment while running a trusted application thread.

도 5의 단계 501 내지 503은 실질적으로 도 2의 단계 201 및 203에 포함될 수 있다. Steps 501 to 503 of FIG. 5 may be substantially included in steps 201 and 203 of FIG.

단계 504는, 스레드 O의 실행 가능한 시나리오에 관한 것이다. 한편으로, CPU 코어 O에서 현재 실행중인 스레드 O에 대한 선점(preemption)이 발생할 수 있다. 이 경우, 스레드 O는 보안 OS 스케줄러 큐에 반환되어 스레드 O의 실행이 이후에 재개되도록 한다. 스레드 O는, 본 개시 전반에서 예시적 기준 실행 스레드로서 설명의 명확성을 위해 사용하는 스레드 A와 실질적으로 다르지 않으며 단지 설명의 편의를 위한 것이다. 이하, 동작에 대해 스레드 A와 관련하여 설명한다. Step 504 relates to an executable scenario of thread O. On the other hand, a preemption may occur for the thread O currently executing in the CPU core O. In this case, thread O is returned to the secure OS scheduler queue, causing execution of thread O to resume later. Thread O is not substantially different from Thread A used for clarity of illustration as an example reference run thread throughout this disclosure and is for convenience of description only. Hereinafter, the operation will be described with reference to thread A. [

선점은 다음과 같은 이유로 발생할 수 있다. 우선, 실행 스레드 O는 이에 할당된 시간(time quote) 만료 시 보안 OS 스케줄러 401에 의해 선점될 수 있다. 둘째, 선점은 비보안 OS에서 인터럽트(interruption) 시 발생할 수 있으며, 이러한 메커니즘은 보안 OS/비보안 OS 기반 무선 시스템에서 기본적으로 제공된다. 후자의 경우, 선점이 일단 발생하면, CPU 코어의 제어가 비보안 환경으로 전환되고, 비보안 OS에 의해 인터럽트가 처리될 수 있으며, 이어서 보안 환경으로 다시 전환된다. Preemption can occur for the following reasons. First, the execution thread O may be preempted by the secure OS scheduler 401 upon expiration of the time quote allocated thereto. Second, preemption can occur when an interruption occurs in a non-secure OS, and this mechanism is provided basically in a secure OS / non-secure OS based wireless system. In the latter case, once the preemption occurs, control of the CPU core is switched to an insecure environment, an interrupt can be handled by the insecure OS, and then switched back to the secure environment.

본 개시에 따르면, 선점 발생 시 보안 OS 스케줄러 401에 의해 인터페이스 405를 통해 비보안 OS 드라이버 410으로 종료되지 않은 실행을 나타내는 특정 결과를 리턴한다. 현재의 CPU 마스크는 해당 특정 결과에 첨부되어 전달될 수 있다. 이와 다른 실시 예로, 선점에 따라 보안 OS 스케줄러 401은 현재 CPU 마스크를 공유 메모리에 배치함으로써 비보안 OS 드라이버 410로 전달할 수 있다. According to the present disclosure, the security OS scheduler 401, upon occurrence of a preemption, returns a specific result, via interface 405, to the non-secure OS driver 410 indicating an unfinished execution. The current CPU mask can be passed along with the specific result. In another embodiment, the secure OS scheduler 401 may forward the current CPU mask to the non-secure OS driver 410 by placing it in a shared memory.

한편, 전술한 스레드 O의 최초 실행 시점 또는 보안 OS 스케줄러 큐에서 그 후속 실행 시점에 CPU 코어 O에서 스레드 O의 실행을 성공적으로 완료할 수 있다. 이 경우, 보안 OS 스케줄러 401은 스레드 O를 차단한 후, 현재 CPU 코어에 할당된 다른 보안 OS 스레드가 없으면, 예를 들어 CPU 코어 O와 관련된 기준 카운터가 0인 경우, CPU 코어 O에 대응하는 비트 엔트리를 0으로 하여 CPU 마스크를 갱신하고, 현재 CPU 마스크를 실행 결과에 포함한다. 이후, 성공적인 실행 결과가 보안 OS 스케줄러 401에 의해 인터페이스 405를 통해 비보안 OS 드라이버 410으로 전달되고, CPU 코어 O 의 제어는 비보안 환경으로 다시 전환된다. On the other hand, the execution of thread O in CPU core O can be successfully completed at the initial execution time of thread O, or at the subsequent execution time in the secure OS scheduler queue. In this case, the security OS scheduler 401 blocks the thread O, and if there is no other secure OS thread assigned to the current CPU core, for example, if the reference counter associated with the CPU core O is 0, the bit corresponding to the CPU core O The entry is set to 0 to update the CPU mask, and the current CPU mask is included in the execution result. Thereafter, the successful execution result is transmitted to the non-secure OS driver 410 via the interface 405 by the secure OS scheduler 401, and the control of the CPU core O is switched back to the non-secure environment.

상술한 바와 같은 선점의 이유는, 유일한 이유가 아니며, 다른 이유가 또한 가능하다. 특히, 본 개시의 실시 예에 따라 이하의 메커니즘이 제공될 수 있다. CPU 마스크가 보안 OS에서 수정될 때, 수정이 현재 CPU 코어에서 실행되는 보안 OS 스레드와 연관되지 않은 경우, 현재 실행중인 보안 OS 스레드는 해당 CPU 코어로부터 선점되고 보안 OS 스케줄러 큐에 배치된다. 이러한 메커니즘에 의해, 수정된 CPU 마스크를, 상술한 선점 관련 방식 중 임의의 방식으로, 보다 효과적으로 비보안 OS로 전달할 수 있으며, 이에 따라 비보안 OS가 적시에 CPU 마스크의 최신 버전을 확인할 수 있게 된다. The reason for the preemption as described above is not the only reason, and other reasons are also possible. In particular, the following mechanisms may be provided in accordance with embodiments of the present disclosure. When the CPU mask is modified in the secure OS, if the modification is not associated with a secure OS thread running on the current CPU core, the currently executing secure OS thread is preempted from that CPU core and placed in the secure OS scheduler queue. With this mechanism, the modified CPU mask can be more effectively delivered to the non-secure OS in any of the above-described preemption-related schemes, thereby allowing the non-secure OS to verify the latest version of the CPU mask in a timely manner.

도 5의 단계 504는 도 2의 단계 205에 대응한다. 도 2를 참조하여 설명된 단계 203에 더해, 비보안 OS 드라이버는 CPU 마스크의 각 비트가 설정된 동안 CPU 코어에 대한 비활성화를 금지하도록 구성된다. 이는 비보안 OS 커널에서의 알림 시스템(notification system)을 통해 구현된다. 비보안 OS 커널이 하드웨어 CPU 코어를 비활성화하려고 할 때, 예를 들면 해당 이벤트에 대한 알림에 가입한 모든 객체의 ‘의견’을 확인하도록 구현할 수 있다. Step 504 of FIG. 5 corresponds to step 205 of FIG. In addition to step 203 described with reference to Figure 2, the non-secure OS driver is configured to prohibit deactivation of the CPU core while each bit of the CPU mask is set. It is implemented through a notification system in the non-secure OS kernel. An insecure OS kernel can be implemented to try to disable the hardware CPU core, for example, to check the 'feedback' of all objects subscribed to the notification for that event.

단계 504가 완료되면, 프로세스 500은 비보안 환경으로 전환된다. When step 504 is completed, the process 500 is switched to an insecure environment.

단계 505에서, 비보안 OS 드라이버 410은 공유 메모리로부터 또는 보안 OS 스케줄러 401에 의해 전달된 결과로부터 CPU 마스크를 검색한다. 이에 따라, 비보안 OS 드라이버 410은 현재 활성화된 CPU 코어들과 CPU 마스크를 매칭하고, CPU 코어 A가 현재 비활성화 상태이면, CPU 코어 A를 활성화한다. 마지막으로, 비보안 OS 드라이버 410은, 통신 프로세스에서 사용 가능한 비보안 환경 내의 저장 위치에 CPU 마스크를 저장한다. CPU 코어 A는 단지 설명의 편의상 참조 CPU 코어로 본 개시에 전반적으로 사용되는 것으로, 다른 CPU 코어가 상술한 방법으로 활성화될 수 있다. In step 505, the non-secure OS driver 410 retrieves the CPU mask from the shared memory or from the result passed by the secure OS scheduler 401. Accordingly, the non-secure OS driver 410 matches the currently active CPU cores with the CPU mask, and activates the CPU core A if the CPU core A is currently inactive. Finally, the non-secure OS driver 410 stores the CPU mask in the storage location in the non-secure environment usable in the communication process. CPU core A is used throughout this disclosure as a reference CPU core only for convenience of explanation, and other CPU cores may be activated in the manner described above.

통신 프로세스에 따르면 CPU 마스크를 확인하고, 단계 506에서 비보안 OS 스케줄러는 CPU 코어 A에 매핑된 통신 스레드를 차단 해제하고, 이어서 비보안 OS 스케줄러 큐에 차단 해제된 통신 스레드를 배치한다. 비보안 OS 스케줄러 큐로부터 통신 스레드가 CPU 코어 A에서 실행이 시작될 때, 통신 스레드는 CPU 코어 A를 보안 모드로 전환하여, CPU 코어 A에서의 제어를 보안 환경으로 전환한다. 단계 506에서, 통신 프로세스에 따르면 비보안 OS 드라이버 410으로부터 수신된 결과는 추가 처리를 위해 비보안 OS 클라이언트 어플리케이션 420으로 전달된다. According to the communication process, the CPU mask is checked, and in step 506 the non-secure OS scheduler unblocks the communication thread mapped to CPU core A, and then places the unblocked communication thread in the non-secure OS scheduler queue. When a communication thread from the non-secure OS scheduler queue starts executing on CPU core A, the communication thread turns CPU core A into secure mode and switches control from CPU core A to the secure environment. In step 506, according to the communication process, the result received from the non-secure OS driver 410 is delivered to the non-secure OS client application 420 for further processing.

단계 506의 완료에 따라, 프로세스 500은 다시 보안 환경으로 전환된다. Upon completion of step 506, the process 500 is switched back to the secure environment.

단계 507에서, 보안 OS 스케줄러 401은 CPU 코어 A에서 실행을 시작하고, 현재 보안 OS 스케줄러 큐의 상단에 있는, 신뢰 어플리케이션 420의 보안 OS 스레드를 실행한다. 실행되는 스레드는 스레드 A일 수 있으나 이에 한정되지는 않는다. At step 507, the secure OS scheduler 401 begins execution at CPU core A and executes the secure OS thread of the trust application 420 at the top of the current secure OS scheduler queue. The thread to be executed may be thread A, but is not limited thereto.

CPU 코어 A에서의 스레드 A의 실행이 성공적으로 완료되면 단계 508이 수행된다. 단계 508에서, 보안 OS 스케줄러 401은 스레드 A를 차단하고, CPU 마스크를 갱신하여 실행 결과에 매입하며, 상기 결과를 비보안 OS 드라이버 410에 제공한다. 이때, CPU 코어 A와 관련된 기준 카운터가 0인 경우 CPU 코어 A의 비트 엔트리는 예를 들면 0으로 설정되어 폐기된다. 이에 따라, CPU 코어 A에서의 제어는 다시 비보안 환경으로 전환된다. 이후, 통신 프로세스에 따르면, 단계 509에서 상술한 바와 같은 비보안 OS 드라이버 410에서 수신된 결과는, 추가 처리를 위해 비보안 OS 클라이언트 어플리케이션 420으로 전달된다. Step 508 is performed if execution of thread A in CPU core A is successfully completed. In step 508, the secure OS scheduler 401 intercepts thread A, updates the CPU mask to embed it in the execution result, and provides the result to the non-secure OS driver 410. At this time, when the reference counter associated with the CPU core A is 0, the bit entry of the CPU core A is set to 0, for example, and discarded. Thereby, the control in the CPU core A is switched again to the non-security environment. Thereafter, according to the communication process, the result received in the non-secure OS driver 410 as described above in step 509 is passed to the non-secure OS client application 420 for further processing.

본 개시에 따르면, 보안 OS가 보안 OS 스레드에 대한 CPU 코어 할당을 요청할 수 있다. 따라서, 보안 OS가 보안 OS 스레드에 대한 CPU 코어 할당을 관리할 수 있게 된다. 또한, 보안 OS가 사용 가능한 CPU 코어의 수를 제어할 수 있다. 따라서, 보안 OS에서 필요에 맞게 기존 자원을 보다 효율적으로 사용할 수 있다. 또한, 생체 인식과 같은 연산 집약적 작업들을 신속하게 수행할 수 있도록 보안 OS의 성능이 향상된다.According to the present disclosure, a secure OS may request a CPU core allocation for a secure OS thread. Thus, the security OS is able to manage the CPU core allocation for the secure OS thread. In addition, the security OS can control the number of available CPU cores. Therefore, the security OS can use existing resources more efficiently as needed. In addition, the performance of a secure OS is improved to quickly perform computationally intensive tasks such as biometrics.

본 개시의 청구항 또는 명세서에 기재된 실시 예들에 따른 방법들은 하드웨어, 소프트웨어, 또는 하드웨어와 소프트웨어의 조합의 형태로 구현될(implemented) 수 있다. Methods according to the claims of the present disclosure or the embodiments described in the specification may be implemented in hardware, software, or a combination of hardware and software.

소프트웨어로 구현하는 경우, 하나 이상의 프로그램(소프트웨어 모듈)을 저장하는 컴퓨터 판독 가능 저장 매체가 제공될 수 있다. 컴퓨터 판독 가능 저장 매체에 저장되는 하나 이상의 프로그램은, 전자 장치(device) 내의 하나 이상의 프로세서에 의해 실행 가능하도록 구성된다(configured for execution). 하나 이상의 프로그램은, 전자 장치로 하여금 본 개시의 청구항 또는 명세서에 기재된 실시 예들에 따른 방법들을 실행하게 하는 명령어(instructions)를 포함한다. When implemented in software, a computer-readable storage medium storing one or more programs (software modules) may be provided. One or more programs stored on a computer-readable storage medium are configured for execution by one or more processors in an electronic device. The one or more programs include instructions that cause the electronic device to perform the methods in accordance with the embodiments of the present disclosure or the claims of the present disclosure.

이러한 프로그램(소프트웨어 모듈, 소프트웨어)은 랜덤 액세스 메모리 (random access memory), 플래시(flash) 메모리를 포함하는 불휘발성(non-volatile) 메모리, 롬(read only memory, ROM), 전기적 삭제가능 프로그램가능 롬(electrically erasable programmable read only memory, EEPROM), 자기 디스크 저장 장치(magnetic disc storage device), 컴팩트 디스크 롬(compact disc-ROM, CD-ROM), 디지털 다목적 디스크(digital versatile discs, DVDs) 또는 다른 형태의 광학 저장 장치, 마그네틱 카세트(magnetic cassette)에 저장될 수 있다. 또는, 이들의 일부 또는 전부의 조합으로 구성된 메모리에 저장될 수 있다. 또한, 각각의 구성 메모리는 다수 개 포함될 수도 있다. Such programs (software modules, software) may be stored in a computer readable medium such as a random access memory, a non-volatile memory including flash memory, a read only memory (ROM), an electrically erasable programmable ROM but are not limited to, electrically erasable programmable read only memory (EEPROM), magnetic disc storage device, compact disc-ROM (CD-ROM), digital versatile discs An optical storage device, or a magnetic cassette. Or a combination of some or all of these. In addition, a plurality of constituent memories may be included.

또한, 프로그램은 인터넷(Internet), 인트라넷(Intranet), LAN(local area network), WAN(wide area network), 또는 SAN(storage area network)과 같은 통신 네트워크, 또는 이들의 조합으로 구성된 통신 네트워크를 통하여 접근(access)할 수 있는 부착 가능한(attachable) 저장 장치(storage device)에 저장될 수 있다. 이러한 저장 장치는 외부 포트를 통하여 본 개시의 실시 예를 수행하는 장치에 접속할 수 있다. 또한, 통신 네트워크상의 별도의 저장장치가 본 개시의 실시 예를 수행하는 장치에 접속할 수도 있다.The program may also be stored on a communication network, such as the Internet, an Intranet, a local area network (LAN), a wide area network (WAN), a communication network such as a storage area network (SAN) And can be stored in an attachable storage device that can be accessed. Such a storage device may be connected to an apparatus performing an embodiment of the present disclosure via an external port. Further, a separate storage device on the communication network may be connected to an apparatus performing the embodiments of the present disclosure.

상술한 본 개시의 구체적인 실시 예들에서, 개시에 포함되는 구성 요소는 제시된 구체적인 실시 예에 따라 단수 또는 복수로 표현되었다. 그러나, 단수 또는 복수의 표현은 설명의 편의를 위해 제시한 상황에 적합하게 선택된 것으로서, 본 개시가 단수 또는 복수의 구성 요소에 제한되는 것은 아니며, 복수로 표현된 구성 요소라 하더라도 단수로 구성되거나, 단수로 표현된 구성 요소라 하더라도 복수로 구성될 수 있다.In the specific embodiments of the present disclosure described above, the elements included in the disclosure have been expressed singular or plural, in accordance with the specific embodiments shown. It should be understood, however, that the singular or plural representations are selected appropriately according to the situations presented for the convenience of description, and the present disclosure is not limited to the singular or plural constituent elements, And may be composed of a plurality of elements even if they are expressed.

한편 본 개시의 상세한 설명에서는 구체적인 실시 예에 관해 설명하였으나, 본 개시의 범위에서 벗어나지 않는 한도 내에서 여러 가지 변형이 가능함은 물론이다. 그러므로 본 개시의 범위는 설명된 실시 예에 국한되어 정해져서는 아니 되며 후술하는 특허청구의 범위뿐만 아니라 이 특허청구의 범위와 균등한 것들에 의해 정해져야 한다.While the invention has been described in connection with what is presently considered to be the most practical and preferred embodiment, it is to be understood that the invention is not limited to the disclosed embodiments. Therefore, the scope of the present disclosure should not be limited to the embodiments described, but should be determined by the scope of the appended claims, as well as the appended claims.

401: 보안 OS 스케줄러
402: 신뢰 어플리케이션
410: 비보안 OS 드라이버
420: 클라이언트 어플리케이션
401: Security OS Scheduler
402: Trusted Application
410: Non-secure OS driver
420: Client application

Claims (14)

복수의 프로세서 코어를 갖는 적어도 하나의 프로세서를 포함하는 전자 장치의 동작 방법에 있어서,
상기 전자 장치에 설치된 보안 OS(operating system)에서 적어도 하나의 보안 OS 스레드를 생성하는 단계;
상기 보안 OS에서 상기 복수의 프로세서 코어 중 적어도 하나의 프로세서 코어를 지정하여 보안 모드 동작 수행 요청을 나타내는 정보를 생성하는 단계;
상기 정보를 전송하는 단계; 및
상기 정보에 기초하여 할당된 상기 적어도 하나의 프로세서 코어에서 보안 모드로 상기 보안 OS 스레드를 실행하는 단계;를 포함하는 방법.
A method of operating an electronic device comprising at least one processor having a plurality of processor cores,
Creating at least one secure OS thread in a secure operating system (OS) installed in the electronic device;
Designating at least one processor core among the plurality of processor cores in the secure OS to generate information indicating a request for performing a secure mode operation;
Transmitting the information; And
And executing the secure OS thread in a secure mode in the at least one processor core allocated based on the information.
청구항 1에 있어서,
상기 정보를 생성하는 단계는,
제1 보안 OS 스레드 및 제2 보안 OS 스레드가 생성되면, 상기 제1 보안 OS 스레드를 실행하기 위한 제1 프로세서 코어 및 상기 제2 보안 OS 스레드를 실행하기 위한 제2 프로세서 코어 각각을 지정하여 보안 모드 동작 수행 요청을 나타내는 상기 정보를 생성하는 단계를 포함하는 방법.
The method according to claim 1,
Wherein the step of generating the information comprises:
A first processor core for executing the first security OS thread and a second processor core for executing the second security OS thread are specified and a security mode And generating the information indicative of an action execution request.
청구항 1에 있어서,
상기 정보를 생성하는 단계는,
상기 지정된 프로세서 코어가 비활성화 상태인 경우 상기 지정된 프로세서 코어에 대한 활성화 요청을 포함하는 상기 정보를 생성하는 단계를 포함하는 방법.
The method according to claim 1,
Wherein the step of generating the information comprises:
Generating the information including an activation request for the designated processor core if the designated processor core is in an inactive state.
청구항 1에 있어서,
상기 정보를 생성하는 단계는,
상기 복수의 프로세서 코어에 대한 사용 정보를 기초로 상기 복수의 프로세서 코어 중 상기 보안 OS 스레드를 실행할 상기 적어도 하나의 프로세서 코어를 결정하는 단계를 포함하는 방법.
The method according to claim 1,
Wherein the step of generating the information comprises:
Determining the at least one processor core to execute the secure OS thread among the plurality of processor cores based on usage information for the plurality of processor cores.
청구항 4에 있어서,
상기 정보를 생성하는 단계는,
상기 보안 OS 스레드의 선호도 속성을 기초로 상기 복수의 프로세서 코어 중 상기 보안 OS 스레드를 실행할 상기 적어도 하나의 프로세서 코어를 결정하는 단계를 포함하는 방법.
The method of claim 4,
Wherein the step of generating the information comprises:
Determining the at least one processor core to execute the secure OS thread among the plurality of processor cores based on the preference attribute of the secure OS thread.
청구항 4 및 5 중 어느 하나에 있어서,
상기 적어도 하나의 프로세서 코어를 결정하는 단계는,
서로 다른 보안 OS 스레드는 서로 다른 프로세서 코어에서 실행되도록 상기 적어도 하나의 프로세서 코어를 결정하는 단계를 포함하는 방법.
The method according to any one of claims 4 and 5,
Wherein determining the at least one processor core comprises:
Wherein the different security OS threads comprise determining the at least one processor core to run at different processor cores.
청구항 4 및 5 중 어느 하나에 있어서,
상기 적어도 하나의 프로세서 코어를 결정하는 단계는,
상기 복수의 프로세서 코어 중 가장 작은 수의 보안 OS 스레드가 실행되고 있는 프로세서 코어에서 상기 보안 OS 스레드가 실행되도록 상기 적어도 하나의 프로세서 코어를 결정하는 단계를 포함하는 방법.
The method according to any one of claims 4 and 5,
Wherein determining the at least one processor core comprises:
Determining the at least one processor core to execute the secure OS thread at a processor core in which the smallest number of secure OS threads of the plurality of processor cores are running.
전자 장치에 있어서,
보안 OS(operating system)와 비보안 OS를 수행하기 위한 동작 명령을 저장하는 메모리; 및
복수의 프로세서 코어를 갖는 적어도 하나의 프로세서를 포함하며,
상기 적어도 하나의 프로세서는,
상기 전자 장치에 설치된 보안 OS(operating system)에서 적어도 하나의 보안 OS 스레드가 생성되면,
상기 보안 OS에서 상기 복수의 프로세서 코어 중 적어도 하나의 프로세서 코어를 지정하여 보안 모드 동작 수행 요청을 나타내는 정보를 생성하고 전송하며,
상기 정보에 기초하여 할당된 상기 적어도 하나의 프로세서 코어에서 보안 모드로 상기 보안 OS 스레드를 실행하는 전자 장치.
In an electronic device,
A memory for storing an operation command for executing a security OS and an insecure OS; And
And at least one processor having a plurality of processor cores,
Wherein the at least one processor comprises:
When at least one secure OS thread is created in a security operating system installed in the electronic device,
Generating and transmitting information indicating a request for performing a secure mode operation by designating at least one processor core among the plurality of processor cores in the secure OS,
And executes the secure OS thread in a secure mode in the at least one processor core allocated based on the information.
청구항 8에 있어서,
상기 적어도 하나의 프로세서는,
제1 보안 OS 스레드 및 제2 보안 OS 스레드가 생성되면,
상기 제1 보안 OS 스레드를 실행하기 위한 제1 프로세서 코어 및 상기 제2 보안 OS 스레드를 실행하기 위한 제2 프로세서 코어 각각을 지정하여 보안 모드 동작 수행 요청을 나타내는 상기 정보를 생성하는 전자 장치.
The method of claim 8,
Wherein the at least one processor comprises:
When the first security OS thread and the second security OS thread are generated,
A first processor core for executing the first security OS thread and a second processor core for executing the second security OS thread, respectively, to generate the information indicating a request for performing a secure mode operation.
청구항 8에 있어서,
상기 적어도 하나의 프로세서는, 상기 적어도 하나의 프로세서 코어가 비활성화 상태인 경우 상기 적어도 하나의 프로세서 코어에 대한 활성화 요청을 포함하는 상기 정보를 생성하는 전자 장치.
The method of claim 8,
Wherein the at least one processor generates the information comprising an activation request for the at least one processor core if the at least one processor core is in an inactive state.
청구항 8에 있어서,
상기 적어도 하나의 프로세서는, 상기 복수의 프로세서 코어에 대한 사용 정보를 기초로 상기 복수의 프로세서 코어 중 상기 보안 OS 스레드를 실행할 상기 적어도 하나의 프로세서 코어를 결정하는 전자 장치.
The method of claim 8,
Wherein the at least one processor determines the at least one processor core to execute the secure OS thread among the plurality of processor cores based on usage information for the plurality of processor cores.
청구항 8에 있어서,
상기 적어도 하나의 프로세서는, 상기 보안 OS 스레드의 선호도 속성을 기초로 상기 복수의 프로세서 코어 중 상기 보안 OS 스레드를 실행할 상기 적어도 하나의 프로세서 코어를 결정하는 전자 장치.
The method of claim 8,
Wherein the at least one processor determines the at least one processor core to execute the secure OS thread among the plurality of processor cores based on a preference attribute of the secure OS thread.
청구항 11 및 12 중 어느 하나에 있어서,
상기 적어도 하나의 프로세서는, 서로 다른 보안 OS 스레드가 서로 다른 프로세서 코어에서 실행되도록 상기 적어도 하나의 프로세서 코어를 결정하는 전자 장치.
The method according to any one of claims 11 and 12,
Wherein the at least one processor determines the at least one processor core such that different secure OS threads run on different processor cores.
청구항 11 및 12 중 어느 하나에 있어서,
상기 적어도 하나의 프로세서는, 상기 복수의 프로세서 코어 중 가장 작은 수의 보안 OS 스레드가 실행되고 있는 프로세서 코어에서 상기 보안 OS 스레드가 실행되도록 상기 적어도 하나의 프로세서 코어를 결정하는 전자 장치.

The method according to any one of claims 11 and 12,
Wherein the at least one processor determines the at least one processor core such that the secure OS thread is executed in a processor core in which the smallest number of secure OS threads of the plurality of processor cores are executing.

KR1020170096189A 2017-02-13 2017-07-28 Method and apparatus for operating multi-processor system in electronic device KR102333693B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/868,660 US10740496B2 (en) 2017-02-13 2018-01-11 Method and apparatus for operating multi-processor system in electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
RU2017104527A RU2641226C1 (en) 2017-02-13 2017-02-13 Method of secureos functioning on multiprocessor systems in mobile devices
RU2017104527 2017-02-13

Publications (2)

Publication Number Publication Date
KR20180093769A true KR20180093769A (en) 2018-08-22
KR102333693B1 KR102333693B1 (en) 2021-12-01

Family

ID=63453287

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020170096189A KR102333693B1 (en) 2017-02-13 2017-07-28 Method and apparatus for operating multi-processor system in electronic device

Country Status (2)

Country Link
KR (1) KR102333693B1 (en)
RU (1) RU2641226C1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040153672A1 (en) * 2002-11-18 2004-08-05 Arm Limited Switching between secure and non-secure processing modes
US20130014124A1 (en) * 2009-12-30 2013-01-10 Ibm Corporation Reducing cross queue synchronization on systems with low memory latency across distributed processing nodes
US20150302219A1 (en) * 2012-05-16 2015-10-22 Nokia Corporation Method in a processor, an apparatus and a computer program product

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7698552B2 (en) * 2004-06-03 2010-04-13 Intel Corporation Launching a secure kernel in a multiprocessor system
US8375221B1 (en) * 2011-07-29 2013-02-12 Microsoft Corporation Firmware-based trusted platform module for arm processor architectures and trustzone security extensions
KR101954733B1 (en) * 2012-10-26 2019-03-06 삼성전자주식회사 System-on-chip processing secured contents and mobile device comprising the same
WO2016128443A1 (en) * 2015-02-11 2016-08-18 Siemens Aktiengesellschaft Method to isolate real-time or safety-critical software and operating system from non-critical software and operating system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040153672A1 (en) * 2002-11-18 2004-08-05 Arm Limited Switching between secure and non-secure processing modes
US20130014124A1 (en) * 2009-12-30 2013-01-10 Ibm Corporation Reducing cross queue synchronization on systems with low memory latency across distributed processing nodes
US20150302219A1 (en) * 2012-05-16 2015-10-22 Nokia Corporation Method in a processor, an apparatus and a computer program product

Also Published As

Publication number Publication date
KR102333693B1 (en) 2021-12-01
RU2641226C1 (en) 2018-01-16

Similar Documents

Publication Publication Date Title
US7788669B2 (en) System for isolating first computing environment from second execution environment while sharing resources by copying data from first portion to second portion of memory
US8595361B2 (en) Virtual machine software license management
US9633231B2 (en) Hardware-protective data processing systems and methods using an application executing in a secure domain
KR102204501B1 (en) A method and apparatus for interrupt handling
US7827326B2 (en) Method and apparatus for delegation of secure operating mode access privilege from processor to peripheral
JP2007220086A (en) Input/output controller, input/output control system, and input/output control method
JP4345630B2 (en) Information processing apparatus, interrupt processing control method, and computer program
EP3842973B1 (en) Security schemes for multiple trusted-execution-environments (tees) and multiple rich-execution-environments (rees)
TW201617957A (en) Management of authenticated variables
US10360386B2 (en) Hardware enforcement of providing separate operating system environments for mobile devices
US10474494B2 (en) Information processing apparatus, information processing method, and computer program product
US11455387B2 (en) Worker thread scheduling in trusted execution environment
US10740496B2 (en) Method and apparatus for operating multi-processor system in electronic device
US11520879B2 (en) Trusted execution environment migration method
US10229077B2 (en) Method for data transfer between real-time tasks using a DMA memory controller
EP2840496B1 (en) Method, system and an executable piece of code for controlling the use of hardware resources of a computer system
US8689288B2 (en) Apparatus and method for protecting system in virtualized environment
CN107066331B (en) TrustZone-based resource allocation method and equipment
WO2017012339A1 (en) Resource management method and apparatus
CN112464182A (en) Safety management and control method, device, medium and equipment for mobile equipment management
CN113946528A (en) Method and device for switching system architecture
KR102333693B1 (en) Method and apparatus for operating multi-processor system in electronic device
CN115413337A (en) Electronic device, system-on-chip and physical core allocation method
KR101334842B1 (en) Virtual machine manager for platform of terminal having function of virtualization and method thereof
US20150207661A1 (en) System and method for providing priority based access to resources for applications

Legal Events

Date Code Title Description
A201 Request for examination
E701 Decision to grant or registration of patent right