TW200422849A - Exception types within a secure processing system - Google Patents

Exception types within a secure processing system Download PDF

Info

Publication number
TW200422849A
TW200422849A TW92132189A TW92132189A TW200422849A TW 200422849 A TW200422849 A TW 200422849A TW 92132189 A TW92132189 A TW 92132189A TW 92132189 A TW92132189 A TW 92132189A TW 200422849 A TW200422849 A TW 200422849A
Authority
TW
Taiwan
Prior art keywords
security
mode
exception
processor
secure
Prior art date
Application number
TW92132189A
Other languages
Chinese (zh)
Other versions
TWI292099B (en
Inventor
Simon Charles Watt
Christopher Bentley Dornan
Luc Orion
Nicolas Chaussade
Lionel Belnet
Stephane Eric Sebastien Brochier
Original Assignee
Advanced Risc Mach Ltd
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
Priority claimed from GB0226905A external-priority patent/GB0226905D0/en
Priority claimed from GB0226902A external-priority patent/GB0226902D0/en
Priority claimed from GB0303449A external-priority patent/GB0303449D0/en
Application filed by Advanced Risc Mach Ltd filed Critical Advanced Risc Mach Ltd
Publication of TW200422849A publication Critical patent/TW200422849A/en
Application granted granted Critical
Publication of TWI292099B publication Critical patent/TWI292099B/en

Links

Landscapes

  • Storage Device Security (AREA)
  • Stored Programmes (AREA)

Abstract

There is a provided a data processing system comprising: a processor operable in a plurality of modes and either a secure domain or a non-secure domain including: at least one secure mode being a mode in said secure domain; and at least one non-secure mode being a mode in said non-secure domain; wherein when said processor is executing a program in a secure mode said program has access to secure data which is not accessible when said processor is operating in a non-secure mode; said processor is responsive to one or more exception conditions for triggering exception processing using an exception handler, said processor being operable to select said exception handler from among a plurality of possible exception handlers in dependence upon whether said processor is operating is said secure domain of said non-secure domain.

Description

200422849 玖、發明說明: 【發明所屬之技術領域】 田 本發明與資料處理系統相關。尤其疋·本發明與在 安全性網域和一非安全性網域中操作之資料處理系統 關,其中欲以控制方法在該些網域之間轉換。 【先前技術】 為執行在資訊處理設備所載入的應用 典、型的資 處理設備包括處理器。在一作業系統的控制下操作該處 器。被要求以執行任何特定應用的資料通常儲存在資訊 理設備的一記憶體之内。人們將了解,資料可以包含在 應用之内所含有的指令和/或在關於處理器那些指令的 行期間所使用的實際資料值。 此處有許多例子,當該些應用所使用之至少一資料 敏感資料時,其不應該由能夠在該處理器上執行的其他 用所存取。舉一示例,當資訊處理設備是智慧卡時,而 些應用之一是使用敏感資料的一安全性應用,例如,安 金鑰’用以執行驗證、認證、解密等等。在此類的情況1 吾人很清楚確保此類敏感資料的安全之重要性,使其不 被可能在該資料處理設備中載入的其他應用所存取,例 企圖存取上述安全性資料之已被載入的駭客應用。 在習知系統中,確保作業系統能提供足夠的安全性 破保在該作業系統的控制中所執行的其他應用不能存取 應用的安全性資料通常是作業系統開發者的工作。麸 相 訊 理 處 該 執 是 應 該 全 能 如 以 3 200422849 如果系統變得更複雜,一般傾向是作業系統變得更大和更 複雜,而此類的情況下,讓作業系統本身確保足夠安全性 變得愈益困難。 尋求針對敏感資料提供安全性儲存和針對惡意程式碼 提供保護之系統示例係論述於美國專利申請案 u s 2002/0007456 A1 和美國專利 US 6,292,874 B 和 US 6,282,657 B。 因此,為尋求維護在資料處理設備的記憶體之内所含 _ 有的此類安全性資料的安全性,亟需提供一改進的技術。 【發明内容】 本發明之一態樣提供用以處理資料之設備,該設備包 含: 可在多數模式及一安全性網域或一非安全性網域之一 中操作一處理器,包括·· 在上述安全性網域中之至少一安全性模式,·和 在上述非安全性網域中之至少一非安全性模式;· 其中200422849 发明 Description of the invention: [Technical field to which the invention belongs] Tian This invention relates to data processing systems. In particular, the present invention relates to a data processing system operating in a secure domain and a non-secure domain, in which it is intended to switch between the domains in a controlled manner. [Prior Art] A typical type of data processing device includes a processor for executing applications loaded in an information processing device. The device is operated under the control of an operating system. The data required to perform any particular application is usually stored in a memory of the information processing device. It will be understood that the data may contain instructions contained within the application and / or actual data values used during the execution of those instructions regarding the processor. There are many examples here. When at least one piece of data used by the applications is sensitive, it should not be accessed by other applications that can execute on the processor. As an example, when the information processing device is a smart card, one of the applications is a security application using sensitive data, for example, a security key 'is used to perform authentication, authentication, decryption, and so on. In such cases1 I understand the importance of ensuring the security of such sensitive data so that it is not accessible by other applications that may be loaded in the data processing device, such as attempts to access the security data Loaded hacking application. In the conventional system, ensuring that the operating system can provide sufficient security. It is usually the job of the operating system developer to ensure that other applications executed under the control of the operating system cannot access the application's security data. Bran phase should be omnipotent, such as 3 200422849 If the system becomes more complex, the general tendency is that the operating system becomes larger and more complex, and in such cases, let the operating system itself ensure sufficient security becomes Increasingly difficult. Examples of systems seeking to provide secure storage for sensitive data and protection against malicious code are discussed in US patent application US 2002/0007456 A1 and US patents US 6,292,874 B and US 6,282,657 B. Therefore, in order to seek to maintain the security of such security data contained in the memory of the data processing equipment, there is an urgent need to provide an improved technology. [Summary of the Invention] One aspect of the present invention provides a device for processing data. The device includes: a processor that can operate in most modes and one of a secure network domain or a non-secure network domain, including ... At least one security mode in the security domain, and at least one non-security mode in the non-security domain;

當上述處理器正在—安 L . , U 、 ^ 女全性模式下執行一程式時,上 述程式存取安全性資 貝料’其為當該處理器在一非安全性模 式下操作時所不能存取的; 該處理器回應一或多备 ^ ^ η 4多數異常狀況以使用一異常管理器 觸發異常處理,兮m 慝 該處理器可操作依據是否該處理器是操作 於該安全性網域或兮 h 次wx非戈全性網域,以自多數可能的異常 4 200422849 管理器選擇該異常管理器。 本發明確認異常處理在一安全性系統中會出現之 的安全性弱點。本發明之解決之道係藉由提供具有一 數異常之結合的一系統,上述異常可選擇性引導至安 或非安全性異常管理器以及一或多數異常被引導至一 全性和安全性異常管理器中之一專屬者。提供選擇性 常促使達成一所欲程度彈性之異常管理,以調和各種 系統及類似者的需求,當專屬的異常以一種較難破壞 法提供一受限制的且良好定義的回應給一特定的異常 一示例,一監視器(w a t c h d 〇 g)安全性定時器可以相關 專屬異常,其保證由一安全性異常管理器管理,以使 監視器定時器所觸發的定期安全性檢查不會被鎖定。 本發明有助於結合所提供之一監控模式,藉以在 全性網域和該非安全性網域間的所有轉換必須由負責 安全性活動的監控模式進行,例如在轉換等等時清除 值。 本發明專屬的異常之較佳示例是一安全性中斷信 常、一模式轉換軟體中斷信號和一重設異常。可選擇 常的較佳示例是一中斷信號異常、一軟體中斷信號、 定義指令異常、一預取中止異常、一資料中止異常和 速中斷信號異常。 本發明之另一態樣提供用以處理資料之方法,該 包含下列步驟: 使用可在多數模式及一安全性網域或一非安全性 潛在 或多 全性 非安 的異 作業 的方 。舉 於一 由該 該安 資料 登錄 號異 性異 一未 一性 方法 網域 200422849 之一中操作之一處理器執行一程 八,包括: 在上述非安全性網域中之至,丨女全性模式;和 少一非安全性模式; 在上述安全性網域中之至少 其中 當上述處理器正在一安全性模 述程式存取安全性資料,其為當該下執仃-程式時’上 式下操作時所不能存取的;# ㉟器在-非安全性模 回應一或多數異常狀況,使用— 處理;其中 異常管理器觸發異常 一非安全性異常管理器 異常管理器中之一可選 可由在一非安全性模式操作之 或在一安全性模式操作之一安全性 擇者選擇該些異常之至少一者;和 該些異常之至少-者係一專屬異常,其由在一非安全 性模式操作之-非安全性異常管理器和在一安全性模式操 作之一安全性異常管理器中之一專屬者所管理。 【實施方式】 第一圖為依據本發明之較佳實施例描述一資料處理設 備之方塊圖。該資料處理設備與一處理器核心i 〇共同作 用,其中提供一安排以執行一系列指令之算術邏輯單元 (ALU,arithmetic logic unit)16。該 ALU 16 所需要的資料 係在一登錄區塊1 4之内儲存❶為核心1 〇提供各種監控功 能以截取指示處理器核心活動的診斷資料。舉一示例,提 供一丧入式追縱模組(ETM,Embedded Trace Module)22 ’ 200422849 依據定義欲追蹤之活動的ΕΤΜ 22之内的某些控制登錄26 内容,產生該處理器核心某些活動的即時追蹤。該此追縱 信號通常被輸出至一追蹤缓衝器,此處能夠在其後分析它 們。提供一向量中斷控制器21以管理可以由各種週邊提供 的多數中斷服務(本文不予贅述)。 尤有甚者’如第一圖所示’能夠在核心10之内提供的 另一監控功能性是一偵錯功能,在資料存取設備之外的— 偵錯應用能藉由連結一或多數掃描鏈1 2的連接測試存取 群組(JTAG,Joint Test Acces Group)控制器 18 與核心 1〇 通訊。關於處理器核心1 0各部分的狀態資訊可以藉由該些 掃描鏈12和JTAG控制器1 8輸出至外部偵錯應用。一在 線模擬器(ICE,In Circuit Emulator)20係用作在登錄24之 内,儲存確認何時·起始和停止偵錯功能之情況,和因此, 例如’被用來儲存斷點(breakp oint)、監視點 (watchpoints)、等等。 核心1 0係藉由記憶體管理邏輯3 0與一系統匯流排40 連結,該記憶體管理邏輯3 0係被安排為管理核心1 〇所發 出的記憶體存取請求,用以存取在資料處理設備的記憶體 位置。可以藉由直接連接至系統匯流排40之記憶體單元, 例如,第一圖所示之快取38和緊接記憶體(TCM,Tightly Coupled Memory)36部署某些部分的記憶體。也可以為存 取此類記憶體提供額外的裝置,例如,直接記憶體存取 (DMA)控制器32。通常,將提供各種控制登錄34以定義 晶片各種元件的某些控制參數,此處,這些控制登錄也稱 7 200422849 作輔助處理器15(CP15)登錄。 可以藉由一外部匯流排界面42使含有核心1 〇的晶片 與一外部匯流排70(例如依據由ARM Limited所發展之「先 進微控制單元匯流排架構(Advanced Microcontroller Bus Architecture,AMBA)」規格所操作的一匯流排)連結並可以 把各種裝置連接至外部匯流排70。這些裝置可以包括例如 數位信號處理器(DSP)的主控裝置,以及各種受控裝置,例 如開機唯讀記憶體44、螢幕驅動器46、外部記憶體56、 輸入/輸出(I/O)界面60或金錄儲存單元64。在第一圖所示 之各種受控裝置可視為是資料處理設備之全部記憶體的共 同作用部分。例如,開機唯讀記憶體44將形成資料處理設 備之可尋址記憶體的部分,外部記憶體5 6亦然。尤有甚 者,例如螢幕驅動器46、輸入輸出界面60和金鑰儲存單 元64之裝置都分別包括例如登錄或緩衝器 48、62、66之 獨立可尋址内部儲存元件,其作為資料處理設備全部記憶 艘的一部分。如稍後將更詳細討論者,記憶體的一部分, 例如,外部記憶體56的一部分將被用來儲存定義相關於記 憶體存取控制之一或多數的分頁表58。 熟知該項技藝者將了解,通常替外部匯流排70提供判 優器(arbiter)和解碼器邏輯54,該判優器被用來對由多數 主控裝置所發出的多數記憶體存取請求進行判斷,例如, 核心10、DMA 32、DSP 50、DMA 52、等等,而將用該解 碼器來決定外部匯流排上的受控裝置所該處理之任何特定 記憶體存取請求。 8 22849 在一些實施例中,可以對含有核心1 〇的晶片外部提供 卜部匯流排’在其他實施例中,將整合晶片(on-chip)以對 胃外部匯流排提供核心1 0。其比在外部匯流排是非整合晶 片(〇ff-chip)時更有利於保持外部匯流排上的安全性資料 之安全性;當外部匯流排是非整合晶片時,可以用資料加 密技術來增進安全性資料的安全性。 第2圖圖示在具有一安全性網域和一非安全性網域的 一處理系統上執行的各種程式。為系統提供至少部分在一 監控模式中執行的一監控程式72。在該示例性實施例中, 安全性狀態旗標僅在監控模式之内是可寫入的存取和可以 由該監控程式72寫入。該監控程式72負責管理在安全性 網域和非安全性網域之間任一方向之所有轉換。以核心外 的觀點來看,監控模式總是安全的而監控程式係在安全性 記憶體中。When the processor is executing a program in Ann L., U, ^ female holistic mode, the program accesses security information 'which is impossible when the processor is operating in a non-safe mode Access; the processor responds to one or more backups ^ ^ η 4 Most abnormal conditions use an exception manager to trigger exception handling. The processor is operable based on whether the processor is operating in the security domain Or wx non-geodomains, select the exception manager from most possible exceptions 4 200422849 manager. The present invention identifies security weaknesses that can occur in a security system for exception handling. The solution of the present invention is to provide a system with a combination of a number of exceptions, which can be selectively directed to a security or non-security exception manager and one or more exceptions to be directed to a global and security exception One of the managers. Providing selectivity often leads to a desired degree of flexibility in anomaly management to reconcile the needs of various systems and the like, when proprietary anomalies provide a limited and well-defined response to a particular anomaly in a more difficult way As an example, a watchdog security timer may be associated with a dedicated exception, which is guaranteed to be managed by a security exception manager, so that regular security checks triggered by the watchdog timer are not locked. The present invention facilitates combining one of the provided monitoring modes whereby all conversions between the full domain and the non-secure network domain must be performed by the monitoring mode responsible for security activities, such as clearing values during conversion and so on. Preferred examples of the exceptions exclusive to the present invention are a security interrupt signal, a mode switch software interrupt signal, and a reset exception. The preferred examples of optional are an interrupt signal exception, a software interrupt signal, a defined instruction exception, a prefetch abort exception, a data abort exception, and a quick interrupt signal exception. Another aspect of the present invention provides a method for processing data, which includes the following steps: using a method that can operate in most modes and a secure network domain or a non-secure potential or multi-security non-secure operation. For example, one of the operations performed by one of the operations in the security information registration number heterosexual heterogeneity method domain 200422849 includes a process of eight, including: in the above non-secure domain, female all-sex Mode; and at least one non-security mode; at least one of the above security domains when the processor is accessing security data in a security profiler, which is when the program is executed Cannot be accessed during the operation; # ㉟ 器 在 -non-security mode responds to one or most of the abnormal conditions, use-handle; among which the exception manager triggers an exception-one of the non-security exception manager exception manager is optional At least one of the exceptions may be selected by a security selector operating in one of the non-safety modes or in one of the security modes; and at least one of the exceptions is a proprietary exception that is controlled by a non-safety Of the security mode operation-managed by one of the non-security exception manager and one of the security exception managers operating in one security mode. [Embodiment] The first figure is a block diagram describing a data processing device according to a preferred embodiment of the present invention. The data processing device functions in conjunction with a processor core i0, which provides an arithmetic logic unit (ALU) 16 arranged to execute a series of instructions. The data required by the ALU 16 is stored in a log-in block 14 as the core 10 and provides various monitoring functions to intercept diagnostic data indicating the core activity of the processor. As an example, an embedded trace module (ETM) 22 '200422849 is provided to register 26 content according to certain controls within the ET 22 that defines the activity to be traced, generating certain activities of the processor core Real-time tracking. The tracking signals are usually output to a tracking buffer where they can be analyzed later. A vectored interrupt controller 21 is provided to manage most of the interrupt services that can be provided by various peripherals (which will not be repeated here). What's more, another monitoring functionality that can be provided within Core 10 as shown in the first figure is a debugging function, which is outside of the data access device — the debugging application can be connected by one or more The connection test access group (JTAG, Joint Test Acces Group) controller 18 of the scan chain 12 communicates with the core 10. The status information of each part of the processor core 10 can be output to external debugging applications through these scan chains 12 and JTAG controller 18. An online circuit emulator (ICE, In Circuit Emulator) 20 is used to store the confirmation when to start and stop the debugging function within the registration 24, and therefore, for example, 'is used to store a breakpoint (breakp oint) , Watchpoints, etc. Core 10 is connected to a system bus 40 through memory management logic 30. The memory management logic 30 is arranged to manage memory access requests issued by core 10 to access the data. The memory location of the processing device. Some parts of memory can be deployed by a memory unit directly connected to the system bus 40, for example, cache 38 and Tightly Coupled Memory (TCM) 36 shown in the first figure. Additional devices may also be provided for accessing such memory, such as a direct memory access (DMA) controller 32. In general, various control registrations 34 will be provided to define certain control parameters of various components of the wafer. Here, these control registrations are also referred to as 7 200422849 as the auxiliary processor 15 (CP15) registration. A chip containing the core 10 and an external bus 70 (for example, according to the "Advanced Microcontroller Bus Architecture (AMBA)" specification developed by ARM Limited can be used through an external bus interface 42 An operating bus) is connected and various devices can be connected to the external bus 70. These devices may include, for example, a master control device of a digital signal processor (DSP), and various controlled devices such as a boot-only read-only memory 44, a screen driver 46, an external memory 56, an input / output (I / O) interface 60 OR 金 录 ial storage unit 64. The various controlled devices shown in the first figure can be regarded as a common part of the entire memory of the data processing equipment. For example, the boot-only read-only memory 44 will form part of the addressable memory of the data processing device, as will the external memory 56. In particular, devices such as the screen driver 46, the input-output interface 60, and the key storage unit 64 each include individually addressable internal storage elements such as a login or buffer 48, 62, 66, which are all used as data processing equipment. Part of the memory ship. As will be discussed in more detail later, a portion of the memory, for example, a portion of the external memory 56 will be used to store a paging table 58 that defines one or more of the memory access controls. Those skilled in the art will understand that an arbiter and decoder logic 54 are usually provided for the external bus 70. The arbiter is used to perform most memory access requests issued by most master devices. Judging, for example, the core 10, DMA 32, DSP 50, DMA 52, etc., and the decoder will be used to determine any specific memory access request that the controlled device on the external bus should process. 8 22849 In some embodiments, a bus bar may be provided externally to a wafer containing a core 10. In other embodiments, an on-chip will be integrated to provide a core 10 to an external gastric bus. It is more conducive to maintaining the security of the security data on the external bus than when the external bus is a non-integrated chip. When the external bus is a non-integrated chip, data encryption technology can be used to improve the security. Information security. Fig. 2 illustrates various programs executed on a processing system having a secure domain and a non-secure domain. A monitoring program 72 is provided for the system to execute at least partially in a monitoring mode. In this exemplary embodiment, the security status flag is a writable access only within the monitoring mode and can be written by the monitoring program 72. The monitor 72 is responsible for managing all transitions in either direction between the secure domain and the non-secure domain. From an out-of-core point of view, the monitoring mode is always safe and the monitoring program is tied to security memory.

在非安全性網域之内,提供一非安全性作業系統 74 和與該非安全性作業系統74共同作用的多數非安全性應 用程式76、78。在安全性網域中,提供了一安全性核心穋 式80。該安全性核心程式80能夠視為形成一安全性作業 系統。通常將設計此類安全性核心程式8 0為僅提供那些對 於處理活動所必須的功能’以使安全性核心8 〇盡可能小而 簡單,因為如此才易於確保安全性。圖示與安全性核心8 〇 共同執行之多數安全性應用82、84。 第3圖圖示與不同安全性網域相關的處理模式的一矩 陣。在該特定示例中’該處理模式就安全性網域而論是對 200422849 稱的,而因此模式1和模式2在安全性和非安全性形式中 皆存在。 在系統中監控模式具有安全性存取的最高的層級,和 在示例性實施例中是授權以在非安全性網域和安全性網域 之間的任一方向轉換的唯一模式。因此,所有網域轉換都 在監控模式之内,藉由監控模式和監控程式72的執行而進 行轉換。Within a non-secure domain, a non-secure operating system 74 and most non-secure applications 76, 78 are provided which interact with the non-secure operating system 74. In the security domain, a security core 80 is provided. The security kernel program 80 can be regarded as forming a security operating system. Generally, such a security core program 80 will be designed to provide only those functions necessary for processing activities' so that the security core 80 is as small and simple as possible, because it is easy to ensure security. Shown are most security applications 82, 84 that are implemented in conjunction with the security core 80. Figure 3 illustrates a matrix of processing patterns associated with different security domains. In this particular example, 'this processing mode is called 200422849 in terms of a secure domain, and therefore mode 1 and mode 2 exist in both secure and non-secure forms. The monitoring mode has the highest level of security access in the system, and in the exemplary embodiment is the only mode authorized to switch in either direction between a non-secure domain and a secure domain. Therefore, all domain conversions are within the monitoring mode, and are performed by the monitoring mode and the execution of the monitoring program 72.

第4圖圖示另一組非安全性網域處理模式1、2、3、4, 以及安全性網域處理模式a、b、c。相對於第3圖的對稱 安排,第4圖圖示一些處理模式可能不出現在一或其他安 全性網域。再次圖示監控模式8 6,其為涵蓋非安全性網域 和安全性網域。能夠把監控模式 86視為一安全性處理模 式,因為可以在該模式中改變安全性狀態旗標以及在該監 控模式中的監控程式 72自己有能力設定該安全性狀態旗 標,整體而言,其在系統之内有效地提供安全性的終極層 級。FIG. 4 illustrates another set of non-secure network domain processing modes 1, 2, 3, and 4, and secure network domain processing modes a, b, and c. With respect to the symmetrical arrangement of Figure 3, Figure 4 illustrates that some processing modes may not appear in one or other secure domains. The monitoring mode 8 6 is shown again, which covers non-secure and secure domains. The monitoring mode 86 can be regarded as a security processing mode, because the security status flag can be changed in this mode and the monitoring program 72 in the monitoring mode has the ability to set the security status flag by itself. Overall, It effectively provides the ultimate level of security within the system.

第5圖圖示就安全性網域而言處理模式的另一安排。 在該安排令,安全性和非安全性網域兩者和一進一步的網 域皆被確認。該進一步的網域也許是以一種不需要與上述 安全性網域或非安全性網域相互作用的一種方法,自一系 統的其他部分獨立出來,因而就其本身而言,它屬於何者 的問題就不重要了。 吾人將了解一處理系統,例如通常為一微處理器提供 登錄區塊88,其中可以儲存運算元值。第6圖圖示程式設 10 200422849 计人員的一不例性登錄區塊之一模組檢視,其具有為某些 處理模式中的某些登錄數字所提供之專屬登錄β尤其是, 第6圖的示例是習知ARM的登錄區塊的擴充(例如,在 ARM Limited(英國劍橋)的ARM 7處理器中所提供者)其被 提供以每一處理模式的一專屬儲存程式狀態登錄、一專屬 堆疊指標登錄和一專屬鏈結登錄R14,但是在這種情況 下,由一監控模式所供應者擴充。如第6圖所示,快速中 斷模式具有被提供的額外專屬登錄,以使在進入上述快速 中斷模式時’不需要儲存然後自其他模式還原登錄狀況。 監控模式亦可以在選擇性的實施例中以一種類似快速中斷 模式的方法被提供以專屬的進一步登錄,用以加快一安全 性網域轉換的處理速度和減少與此類轉換相關的系統等待 時間。 第7圖圖示另一實施例,其中以二種完全和分離登錄 區塊的形式提供登錄區塊88,其分別用於安全性網域和非 安全性網域。這種方法將安全性資料儲存在可在安全性網 域操作的登錄中’當對非安全性網域進行轉換時,能夠防 止資料變為可存取。然而,如果允許並為所欲,藉由使用 快速而有效的機制將其放在非安全性網域和安全性網域皆 可存取的登錄中’上述安排阻礙將資料自非安全性網域傳 遞至安全性網域的可能性。 具有安全性登錄區塊的一重要優點是避免在從一情境 轉換至另一情境前需要清除登錄内容。如果等待時間不是 特殊問題,可以使用沒有安全性網域情境的重複登錄的_ 11 200422849 簡化硬體系、统,如第6®。監控模式負責從一網域轉換為 另一網域。由一監控程式至少部分在監控模式中執行還原 内容、儲存先前内容、以及清除登錄。該系統之行為因此 像是一虛擬化模組。這種類型的實施例將在下文中進一步 討論。在本文中論及安全特徵時,應該參考,例如,ar^ 7的程式設計人員模組。 處理器模式(Processor M〇des、 相對於在安全性情境中的多數模式,相同的模式支援 安全性和非安全性網域兩者(請參考第8圖)。監控模式知 道核心的目前狀態,不論是安全性或非安全性(例如,當讀 取自所儲存的一 S位元時,其係一辅助處理器設定登錄)。 在第8圖,只要一 SMI(軟體監控中斷指令,s〇ftware Monitor Interrupt instruction)發生,核心進入監控模式, 以適當地自一情境轉換到另一情境。 參考第9圖,其中SMIs在使用者模式是被允許的: 1. 排程發動執行緒1。 2. 執行緒 1需要執行一安全性功能= = >SMI安全性呼 叫,核心進入監控模式。在硬體下控制現有 PC,而 CPSR(current processor status register)被儲存在 R14_mon,以及 SPSR__mon(saved processor status register for the monitor mode)和 IRQ/FIQ 中斷失效。 3 . 監控程式進行下列任務: 籲設置S位元(安全性狀態旗標)。 12 200422849 • 將至少R14 — mon和SPSR—mon儲存在堆叠中,在 一安全性應用執行時,若異常發生才不致於失去非 安全性内容。 • 檢查是否有一新執行緒要發動:安全性執行緒 一機制(在一些示例實施例中,藉由執行緒ID表) 指示執行緒1在該安全性情境中是啟用的。 • IRQ/FIQ中斷再次啟用。一安全性應用此時能夠以 安全性使用者模式起始。 4·執行安全性執行緒1至完成,而後(將SMI)發展出監 控程式模式的「自安全性返回」功能(當核心進入監控 模式時,則IRQ/FIQ中斷失效)。 5· 「自安全性返回(return from secure)」功能進行下列任 務: •指示完成安全性執行緒1 (例如,在一執行緒ID表 的情況下,從該表移除執行緒i)。 籲從堆叠非安全性内容還原並清除需要的登錄,以使 一旦返回非安全性網域,則不能讀取任何安全性資 料。 •然後,以—SUBS指令(它使程式計數還原為正確 的點和更新該些狀態旗標)回到非安全性網域,(從 還原的Ri4一m〇n)還原PC和(從spSR_m〇n)還原 CPSR。所以,在非安全性網域巾的返回點是在執 行緒1先前所執行的SMI指令之後。 6·執行執行緒1至結束,然後交回給排程。 13 200422849 一些上述功能性也許根據特定實施例分別在監控程式 和安全性作業系統間出間。 在其他實施例中,可以要求不允許SMIs出現在使用 者模式中。 安全性情境的進入 重設 當一硬體重設發生,使MMU失效和ARM核心(處理 器)以S位元集發展出安全性監督模式。如為所欲,一旦安 全性開機終止,至監控模式之SMI可以被執行而監控可以 轉換至非安全性情境的OS(非安全性svc模式)。如果希望 以使用先前的OS,它能夠在安全性監督模式中只是開始而 忽略安全性狀態。 SMI指令Figure 5 illustrates another arrangement of processing modes in terms of a security domain. Under this arrangement, both secure and non-secure domains and a further domain are identified. This further domain may be a method that does not require interaction with the above-mentioned secure or non-secure domains and is independent of other parts of a system, so it is a question of who it is It doesn't matter. I will understand a processing system, such as a login block 88 typically provided for a microprocessor, in which operand values can be stored. Figure 6 shows a module view of an example of an example login block for a programmer 10 200422849, which has an exclusive login β provided for certain login numbers in certain processing modes. In particular, Figure 6 An example is the extension of the known ARM registration block (for example, provided in the ARM 7 processor of ARM Limited (Cambridge, UK)) which is provided with a dedicated stored program status registration, a dedicated Stack index registration and a dedicated link registration R14, but in this case, it is extended by a supplier in a monitoring mode. As shown in Fig. 6, the quick interrupt mode has an additional exclusive login provided so that when entering the aforementioned quick interrupt mode, it is not necessary to save and then restore the login status from other modes. The monitoring mode can also be provided in an alternative embodiment in a manner similar to the fast interrupt mode with exclusive further logins to speed up the processing of a secure domain transition and reduce the system wait time associated with such transitions . Figure 7 illustrates another embodiment in which login blocks 88 are provided in the form of two fully and separated login blocks, which are used for a secure domain and a non-secure domain, respectively. This method stores the security data in a registry that can be operated in a secure domain. When a non-secure domain is switched, it prevents the data from becoming accessible. However, if allowed and desired, by using a fast and effective mechanism to place it in a registry that is accessible by both non-secure and secure domains, the above arrangement prevents the transfer of data from non-secure domains. Possibility of passing to a secure domain. An important advantage of having a secure login block is to avoid the need to clear login content before transitioning from one situation to another. If the waiting time is not a special issue, you can use the repeated login without security domain context_ 11 200422849 to simplify the hardware system, such as Section 6®. The monitoring mode is responsible for transitioning from one domain to another. Restoring content, saving previous content, and clearing registrations are performed at least in part by a monitoring program in monitoring mode. The system thus behaves like a virtualization module. Embodiments of this type are discussed further below. When discussing security features in this article, reference should be made to, for example, the programmer module of ar ^ 7. Processor mode (Processor Mode, as opposed to most modes in a security context, the same mode supports both secure and non-secure domains (see Figure 8). The monitoring mode knows the current state of the core, Whether it is security or non-security (for example, when read from a stored S bit, it is an auxiliary processor setting register). In Figure 8, as long as there is an SMI (software monitoring interrupt instruction, s〇) ftware Monitor Interrupt instruction) occurs, and the core enters the monitoring mode to appropriately transition from one situation to another. Refer to Figure 9 where SMIs are allowed in user mode: 1. Scheduled to launch thread 1. 2 Thread 1 needs to perform a security function = = > SMI security call, the core enters the monitoring mode. The existing PC is controlled under hardware, and CPSR (current processor status register) is stored in R14_mon, and SPSR__mon (saved processor status register for the monitor mode) and IRQ / FIQ interrupt failure. 3. The monitor performs the following tasks: Calls for setting the S bit (security status flag). 12 2 00422849 • Store at least R14 — mon and SPSR — mon on the stack. When a security application is executed, if the exception occurs, the non-security content will not be lost. • Check if there is a new thread to launch: security thread A mechanism (in some example embodiments, by the thread ID table) that indicates that thread 1 is enabled in the security context. • IRQ / FIQ interrupts are enabled again. A security application can now be used with security. 4) Execute security thread 1 to completion, and then (SMI) developed the "self-safety return" function of the monitor program mode (when the core enters the monitor mode, the IRQ / FIQ interrupt is invalidated). 5. The "return from secure" function performs the following tasks: • Instructs the completion of a secure thread 1 (for example, in the case of a thread ID table, remove thread i from the table). Restore and clear the required logins from the stack of non-secure content so that once the non-secure domain is returned, no security information can be read. • Then, the —SUBS command (which enables The type count is restored to the correct point and the status flags are updated) Back to the non-secure domain, (from the restored Ri4_mn) to restore the PC and (from spSR_m0n) to restore the CPSR. So, in the non-secure The return point of the sexual domain towel is after the SMI instruction previously executed by thread 1. 6. Execute thread 1 to the end, and then return to the schedule. 13 200422849 Some of the above-mentioned functionalities may differ between the monitoring program and the security operating system, depending on the specific embodiment. In other embodiments, SMIs may be required to be disallowed from appearing in the user mode. Entry of Security Context Reset When a hard reset occurs, the MMU is disabled and the ARM core (processor) develops a security oversight mode with the S-bit set. As desired, once the secure boot is terminated, the SMI to monitoring mode can be executed and the monitoring can be switched to an OS (non-security svc mode) in a non-security context. If you want to use the previous OS, it can just start in the security supervision mode and ignore the security state. SMI instruction

指令(轉換軟體中斷指令的一模式)能夠從非安全性網 域中的任何非安全性模式呼叫(如上文所述,其可以希望將 SMIs限制為權限模式),但是,由相關的向量所決定的目 標進入點總是固定的並在監控模式之内。它由SMI管理器 決定發展出必須執行的適當安全性功能(例如,由以指令藉 遞之運算元控制)。 從非安全性情境傳遞參數至安全性情境,能夠藉由共 用在一第6圖類型登錄區塊之内的登錄來執行。 14 228 49 、 田一 SMI發生在非安全性情境,ARM核心可能在硬體 進行下列動作: 發展出SMI向量(在安全性記憶體存取中是允許 的,因為你現下在監控模式中)至監控模式 •储存PC至R14 —mon和(:以厌至”化一m〇n 在監控模式中開始執行安全性異常管理器(如果有 多執行緒,還原/儲存内容) 鲁發展出安全性使用者模式(或另一模式,例如svc 模式)以實施適當的功能 *當該核心在監控模式下,IRQ和FIQ失效(等待時 間增加) 安全性情境出口 有二種退出安全性情境的可能: 鲁該安全性功能完成而吾人返回先前呼叫該功能的 非安全性模式。 •由非安全性異常中斷了安全性功能(例如, IRQ/FIQ/SMI) 〇 安全性功能的正常結東 安全性功能正常終止而我們需要還原正好在以後 的指令,在非安全性情境重新繼續一應用。在安全性使用 者模式中,一”SMI"指令被執行以返回具有與「自安全性 情境返回」例式相對應的適當參數的模式。在該階段,登 15 200422849 錄被清除以在非安全性和安全性情境之間避免資料的洩 漏,而後非安全性内容之一般目的登錄被還原以及以它們 在非安全性情境中所獲得的值更新非安全性區塊登錄。 R14 —mon和 SPSR—mon 因此在 SMI之後,藉由執行一 "MOVS PC, R14”指令獲得適當值以重新繼續非安全性應 用0 起因於非安全性異常之安全性功能的退出 該狀況下,安全性功能未完成而必須在進入非安全性 異常管理器前儲存該安全性内容,無論如何需要處理該些 中斷。 安全性中斷 對於安全性中斷有幾種可能性 依據下列兩點,提出兩種可能的解決方案: • 其為何種中斷(安全性或非安全性) • 當IRQ發生時,核心處於何種模式(在安全性或在 非安全性情境中) 解決方案一 在該解決方案中,需要以兩種不同的方式支援安全性 和非安全性中斷。 當在非安全性情境中,如果 • 一 IRQ發生,則當在ARM核心(例如ARM 7)時, 16 200422849 核心進入IRQ模式以處理該中斷。 • 一 sIRQ發生,則核心進入監控模式以儲存非 性内容,而後進入〆安全性IRQ管理器以處 安金性中斷。 當在安全性情境中,如果 • 一 SIRQ發生,則核心進入安全性IRQ管理器 核心不退出該安全性情境。 • 一 IRQ發生,核心進入儲存安全性内容之監 式,而後進入一非安全性IRQ管理器,以處 非安全性中斷。 另言之,當不屬於目前情境的中斷發生時,核心 進入監控模式,否則其停留在目前情境中(請參考| 圖)。 發生在安全性情境 請參考第11 Α圖: 1 ·排程發動執行緒1。 2·執行緒1需要執行一安全性功能=>SMI安全 叫,核心進入監控模式。目前PC和CPSR儲存在R14 和 SPSR一mon 中,使 IRQ/FIQ 失效。 3 ·監控管理器(程式)進行下列任務: • 設置該S位元。 •儲存至少R14一mon和SPSR一mon於堆疊中(亦 安全 理該 0該 控模 理該 直接 ί 10 性呼 mon 可能 17 200422849 輸入其他登錄),以使在安全性應用執行時,如果 異常發生才不會失去非安全性内容。 * 檢查是否有一新執行緒要發動:安全性執行緒1。 一機制(藉由執行緒ID表)指示執行緒1在該安全 性情境中是啟用的。 • 安全性應用此時能夠以安全性使用者模式起始。而 後IRQ/FIQ再次啟用。 4.當安全性執行緒i執行時、一 IRQ發生。該核心直 接跳入監控模式(專屬向量)和在監控模式中的SPSR—mon 之R14一mon和CPSR儲存現有pc,(而後使IRQ/fiq失效)。 5 ·必須儲存安全性内容,還原先前的非安全性内容。 監控管理器必預進入IRQ模式,以適當值更新 R14一irq/SPSR一irq,而後將控制交給非安全性IRq管理器。 6· IRQ管理器提供IRQ服務,而後將控制交回給在非 安全性情境中的執行緒1。藉由還原SPRS一irq和R14」rq 為CPSR和PC,現下執行緒1已經指向已被中斷的SMI 指令。 7 · S ΜI指令被再次執行(與2相同之指令)。 8·監控管理器察覺先前已中斷之執行緒,並將該執行 緒1内容還原’而後其在使用者模式中發展出安全性執行 緒1,指向該已經中斷的指令。 9·安全性執行緒1執行至其完成而止,而後在龄控 式(專屬於SMI)中發展出「自安全性返回」功能。 1 〇 ·該「自安全性返回」功能進行下列任務. 18 200422849 • 指示安全性執行緒1已完成(例如,在一執行緒lP 表的情況下,自該表移除執行緒1) ° • 自堆疊非安全性内容還原並清除需要的登錄’以像 一旦返回非安全性情境無法讀取任何安全性資料。 • 以一 SUBS指令回到非安全性情境,(自被還原的 R14一mon)還原 PC 和(從 SPSR — mon)還原 CPSR。部 麼,在非安全性情境中的返回點應該是在執行賭1 中先前執行的SMI之後的指令。 11.執行緒1執行至結束,而後交回控制給排程。 在非安全性愔燴發生之SIRO 請參考第11B圖: 1 ·排程發動執行緒1。 2·當安全性執行緒1執行時,一 SIRQ發生。核心直 接跳至監控模式(專屬向量)並在監控模式中SPSR_mon的 R14一mon和CPSR儲存現有的PC,而後使IRQ/FIQ失效。 3 ·非安全性内容必須被儲存,而後核心進入安全性 IRQ管理器。 4. 該IRQ管理器提供siRQ服務,而後以適當參數用 一 SMI將控制交回給監控模式管理器。 5. 該監控管理器還原非安全性内容,因此一 SUBS指 令使核心回到非安全性情境並重新繼續中斷的執行緒i。 6 ·執行執行緒1直到結束,而後將控制交回給排程。 第ΠΑ圖的機制具有提供進入安全性情境的一種決定 19 200422849 性方法的優點。然而,有一些問題與中斷優先權相關:例 如,當一 SIRQ在安全性中斷管理器中執行時,可能發生 一具有較高優先權的一非安全性IRQ。一旦該非安全性 IRQ完成,有需要再次產生SIRQ事件,該核心才能夠重 新繼續該安全性中斷。 解決方案二 在該機制中(請參考第12圖)兩種不同或僅一種的腳 位(pin)可以支援安全性以及非安全性中斷。使用兩種腳位 以減少中斷等待時間。 當在非安全性情境中,如果 • 一 IRQ發生,核心進入IRQ模式,以處理該中斷, 如同在ARM7系統中。 • 一 SIRQ發生,核心進入IRQ管理器,其中一 SMI 指令將使該核心發展出監控模式以儲存非安全性 内容,而後發展出一安全性IRQ管理器,以管理 該安全性中斷。 當在一安全性情境中,如果 • 一 SIRQ發生,核心進入安全性IRQ管理器。該核 心不退出該安全性情境。 • 一 IRQ發生,核心進入安全性IRQ管理器,其中 一 SMI指令將使該核心發展出監控模式(安全性内 容所儲存處),而後進入一非安全性IRQ管理器以 20 200422849 處理該非安全性中斷。 在安全性情境發生之IRQ 請參考第1 3 A圖: 1 ·排程發動執行緒1。 2·執行緒1需要執行一安全性功能==>!5%1安全性呼 叫’核心進入監控模式。目前PC和CPSR被儲存在R14一mon 和 SPSR—mon,使 IRQ/FIQ 失效 3.監控管理器進行下列任務: • 設置S位元。 *在一堆叠中儲存至少R1 4_mon和SPSR_mon(其他 登錄亦然),因此在安全性應用執行時,如果一異 常發生才不致於失去非安全性内容。 #檢查是否有一新執行緒要發動:安全性執行緒1。 一機制(藉由執行緒ID表)指示執行緒1在該安全 性情境中是啟用的。 •安全性應用此時能夠以安全性使用者模式起始。 IRQ/FIQ再次啟用。 4·當安全性執行緒1執行時、一 IRQ發生。核心直接 跳至安全性IRQ模式。 5·核心儲存現有PC在R14一irq和SPSR一irq在CPSR。 IRQ管理器偵測其為非安全性中斷並以適當參數執行一 SMI以進入監控模式。 6 ·必須儲存安全性内容,還原先前的非安全性内容。 21 200422849 監控管理器藉由讀取該CP SR知道SMI來自何處。其也能 夠進入IRQ模式讀取R14一IRQ/SPSR_irq,以適當地儲存安 全性内容。其也能夠在這些相同的登錄中儲存一旦完成該 IRQ例式必須還原的非安全性内容。 7· IRQ管理器提供IRQ服務,而後在該非安全性情境 中將控制交回給執行緒1。藉由還原§PRg」rq* R14」rq 至CPSR和PC,現下核心指向已經中斷的SMI指令。 8·再次執行SMI指令(如2之相同指令)。 9·監控管理器察覺先前中斷的該執行緒,並把該執行 緒1狀況還原。而後其在使用者模式中發展出安全性執行 緒1,指向已經中斷的指令。 I 〇·安全性執行緒1執行到其完成,而後發展出「自 安全性返回」;在監控模式(屬專於SMI)中的功能。 II · 「自安全性返回」功能進行下列任務: • 指示安全性執行緒1已完成(即,在一執行緒ID表 的情況下,自該表移除執行緒1)。 • 從堆疊非安全性内容還原和清除所需要的登錄,因 此一旦吾人返回非安全性情境,不能夠讀取任何安 全性資訊。 鲁以一 SUBS指令發展回到非安全性情境,(從 SPSR —mon)還原 PC 和(從 SPSR_mon)還原 CPSR 〇 在非安全性情境中的返回點應該是在執行緒1中 先前執行的SMI之後的指令。 1 2 ·執行緒1執行直到結束,而後交回給排程接手。 22 200422849The instruction (a mode for converting software interrupt instructions) can be called from any non-security mode in the non-security domain (as mentioned above, it may wish to restrict SMIs to the permission mode), but it is determined by the relevant vector The target entry point is always fixed and within monitoring mode. It is up to the SMI manager to develop appropriate security functions that must be performed (for example, controlled by operands borrowed by instructions). Passing parameters from a non-secure context to a security context can be performed by registering within a login block of the type shown in Figure 6. 14 228 49 、 Tianyi SMI occurs in a non-security situation. The ARM core may perform the following actions in hardware: Develop the SMI vector (allowed in security memory access, because you are currently in monitoring mode) to Monitoring mode • Store PC to R14 —mon and (: Ignore ”to start a security in the monitoring mode (if there are multiple threads, restore / store content) Lu develops security use (Or another mode, such as svc mode) to implement appropriate functions The security function is completed and I return to the non-security mode that previously called the function. • The security function was interrupted by a non-security exception (eg, IRQ / FIQ / SMI) 〇 The security function is normal The security function is normal Termination and we need to restore the instruction that is just after, and resume an application in a non-safety situation. In the security user mode, an "SMI" instruction is To return to the model with appropriate parameters corresponding to the "Self-safety situation return" example. At this stage, Den 15 200422849 was cleared to avoid data leakage between non-security and safety situations, and then The general purpose registrations of the security content are restored and the non-secure block registrations are updated with the values they obtained in the non-security context. R14 —mon and SPSR —mon So after SMI, by executing a "MOVS PC , R14 ”instruction to obtain the appropriate value to resume the non-safety application There are several possibilities for security interrupts. There are two possible solutions based on the following two points: • What kind of interrupt (security or non-security) is it? When the IRQ occurs, what mode is the core in (in a security or non-security context) Solution 1 In this solution There are two different ways to support security and non-security interrupts. When in a non-security context, if an IRQ occurs, then when in an ARM core (such as ARM 7), 16 200422849 core enters IRQ mode to handle The interruption. • When an sIRQ occurs, the core enters monitoring mode to store non-sexual content, and then enters the security IRQ manager to handle the gold interrupt. When in a security context, if • a SIRQ occurs, the core enters The core of the security IRQ manager does not exit the security context. • When an IRQ occurs, the core enters a monitoring mode that stores security content, and then enters a non-security IRQ manager to handle non-security interrupts. In other words, when an interruption that does not belong to the current context occurs, the core enters the monitoring mode, otherwise it stays in the current context (see Figure |). Occurs in a security situation Please refer to Figure 11 Α: 1 · Schedule thread 1 to start. 2. Thread 1 needs to perform a security function => SMI security call, the core enters the monitoring mode. PC and CPSR are currently stored in R14 and SPSR_mon, which disables IRQ / FIQ. 3 · The monitoring manager (program) performs the following tasks: • Sets the S bit. • Store at least R14-mon and SPSR-mon in the stack (also secure the 0, the control module, and the direct ί 10 sex call mon may 17 200422849 enter other logins) so that if an exception occurs during the execution of the security application So that you do n’t lose non-security content. * Check if there is a new thread to launch: Security thread 1. A mechanism (via the thread ID table) indicates that thread 1 is enabled in the security context. • The security application can now start in a security consumer mode. IRQ / FIQ is then enabled again. 4. When the security thread i executes, an IRQ occurs. The core directly jumps into the monitoring mode (exclusive vector) and the SP14-mon R14-mon and CPSR in the monitoring mode store the existing PC (then invalidate the IRQ / fiq). 5 · Security content must be stored to restore previous non-security content. The monitoring manager must enter the IRQ mode in advance, update R14-irq / SPSR-irq with appropriate values, and then pass control to the non-secure IRq manager. 6. The IRQ manager provides IRQ services and then passes control back to the thread in a non-security context1. By restoring SPRS_irq and R14 ″ rq to CPSR and PC, thread 1 now points to the interrupted SMI instruction. 7 · S MI instruction is executed again (same instruction as 2). 8. The monitoring manager detects the previously interrupted thread and restores the content of the thread 1 'and then develops a security thread 1 in the user mode to point to the interrupted instruction. 9. Safety Thread 1 runs until it is completed, and then develops the "Self-Safe Return" function in the age-controlled (exclusive to SMI). 1 〇 · The "Self-Return to Security" function performs the following tasks. 18 200422849 • Indicates that security thread 1 is complete (for example, in the case of a thread lP table, remove thread 1 from the table) ° • Self-stacking non-security content restores and clears the required logins' as if no security data could be read once the non-security context was returned. • Return to the non-security situation with a SUBS instruction, (from R14-mon being restored) PC and (from SPSR — mon) CPSR. Then, the return point in a non-safety context should be the instruction following the previously executed SMI in bet 1. 11. Thread 1 executes to the end, and then returns control to the schedule. Please refer to Figure 11B for SIRO that occurs during non-security scams. 1 Schedule the execution of thread 1. 2. When security thread 1 executes, a SIRQ occurs. The core directly jumps to the monitoring mode (exclusive vector) and in the monitoring mode, R14_mon of SPSR_mon and CPSR store the existing PC, and then invalidate the IRQ / FIQ. 3 Non-secure content must be stored before the core enters the security IRQ manager. 4. The IRQ manager provides the siRQ service, and then returns control to the monitoring mode manager with an SMI with appropriate parameters. 5. The monitoring manager restores non-security content, so a SUBS instruction returns the core to the non-security context and resumes the interrupted thread i. 6 Execute thread 1 until the end, and then return control to the schedule. The mechanism of Figure ΠA has the advantage of providing a method of decision-making into the security context. 19 200422849 However, there are some issues related to interrupt priority: for example, when a SIRQ is executed in a secure interrupt manager, a non-secure IRQ with a higher priority may occur. Once the non-safety IRQ is completed and a SIRQ event needs to be generated again, the core can resume the safety interrupt. Solution two In this mechanism (please refer to Figure 12), two different or only one pin can support security and non-security interrupts. Two pins are used to reduce interrupt wait time. When in an unsafe situation, if an IRQ occurs, the core enters IRQ mode to handle the interrupt, as in an ARM7 system. • An SIRQ occurs and the core enters the IRQ manager. One of the SMI instructions will cause the core to develop a monitoring mode to store non-secure content, and then develop a secure IRQ manager to manage the security interrupt. When in a security context, if a SIRQ occurs, the core enters the security IRQ manager. The core does not exit the security context. • When an IRQ occurs, the core enters the security IRQ manager. One of the SMI instructions will cause the core to develop a monitoring mode (where the security content is stored), and then enter a non-security IRQ manager to handle the non-security by 20 200422849. Break. For IRQs that occur in a security situation, please refer to Figure 13 A: 1 • Schedule thread 1 to start. 2. Thread 1 needs to perform a security function == >! 5% 1 Security call 'core enters monitoring mode. The PC and CPSR are currently stored in R14_mon and SPSR_mon, invalidating IRQ / FIQ. 3. The monitoring manager performs the following tasks: • Setting the S bit. * Store at least R1 4_mon and SPSR_mon (the same is true for other logins) in a stack, so if an abnormality occurs during the execution of a security application, the non-security content will not be lost. #Check if there is a new thread to launch: Security thread 1. A mechanism (via the thread ID table) indicates that thread 1 is enabled in the security context. • The security application can now be started in a secure user mode. IRQ / FIQ is enabled again. 4. When security thread 1 executes, an IRQ occurs. The core jumps directly to the security IRQ mode. 5. The core stores the existing PC in R14-irq and SPSR-irq in CPSR. The IRQ manager detects it as a non-security interrupt and executes an SMI with the appropriate parameters to enter the monitor mode. 6 · Security content must be stored to restore previous non-security content. 21 200422849 The monitoring manager knows where the SMI comes from by reading the CP SR. It can also enter IRQ mode to read R14-IRQ / SPSR_irq to properly store security content. It can also store non-secure content that must be restored once the IRQ instance is completed in these same registries. 7. The IRQ manager provides IRQ services and then returns control to thread 1 in this non-security context. By restoring §PRg ”rq * R14” rq to CPSR and PC, the current core points to the interrupted SMI instruction. 8. Execute the SMI instruction again (such as the same instruction in 2). 9. The monitoring manager detects the previously interrupted thread and restores the state of the thread 1. It then developed security thread 1 in user mode, pointing to the interrupted instruction. I 〇 Safety thread 1 executes to its completion, and then develops "Self-Return"; a function in the monitoring mode (specialized in SMI). II · The "Self-Return to Security" function performs the following tasks: • Indicates that security thread 1 is complete (that is, in the case of a thread ID table, thread 1 is removed from the table). • Restore and clear required logins from stacked non-security content, so once we return to a non-security context, we cannot read any security information. Lu developed a SUBS instruction to return to the non-safety situation, restore the PC (from SPSR —mon) and restore the CPSR (from SPSR_mon). The return point in the non-safety situation should be after the previously executed SMI in thread 1. Instructions. 1 2 · Thread 1 executes until the end, and then returns to the schedule to take over. 22 200422849

性情境發生的SIRO 請參考第13B圖: i .排程發動執行緒1。 2. 當安全性執行緒1執行時,一 SIRQ發生。 3. 核心直接跳至IRQ模式,和儲存現有?(:在R14」rq 及儲存CPSR在SPSR一irq。之後使irq失效。jrq管理器 偵測其係一 SIRQ並一以適當參數執行一 SMI指令。 4 · 一旦在監控模式中,必須儲存非安全性内容,而後 核心進入安全性IRQ管理器。 5.安全性IRQ管理器提供SIRQ服務例式服務,而後 以具有適當參數的SMI把控制交回給監控。 6·監控管理器還原非安全性内容,因此一 subs指令 使核心回到非安全性情境和重新繼續中斷的IRQ管理器。 7·此時IRQ管理器可藉由執行一 sUBS回到非安全性 執行緒。 8·執行緒1執行到結束,而後把控制交回給排程。 參考第12圖的機制,不需要在許多中斷的情況下再次 產生SIRQ事件,但是不保證一定執行安全性中斷。 異常向j 至少保留兩實體向量表(雖然自一虛擬位址來看,它們 看似一單一向量表)一供非安全性記憶體的非安全性情境 23 200422849 之用,一供安全性記憶體的安全 J文主性情境之用(不可自非安全 性情境存取)。用於安全性和非安 μ丄 F女全性情境之不同虛擬至實 體記憶體映射,有效地允許相同 J的虛擬圮憶體位址存取在 實體S己憶體中儲存的不同向晋矣 u门篁表。監控模式總是使用純粹 的記憶體映射以在實體記憶體中提供一第三向量表。 如果該些中斷依照第1 2圖的播 固幻機制,對每一表格就會有 Γ W ^涿向1集在安全性和非安全性 如第14圖所示之下列向詈。續忐县隹 記憶體是重複的。 異常 向量偏移值 --~--------- 對應模式 重設(Reset) 0x00 監督模式(s位元組) 未定義(Undef) 0x04 里控模式/未定義(Undef)模4 SWI 0x08 監督模式/監控模式 預取中止 (Prefetch Abort) OxOC 中止模式(abort mode) 資料中止 (Data Abort) 0x10 中止模式(abort mode) IRQ/SIRQ 0x18 IRQ模式 FIQ OxlX FIQ模式 SMI 0x20 未定義(Undef)模式/監控模式For SIRO in sexual situations, please refer to Figure 13B: i. Schedule Thread 1. 2. When security thread 1 executes, a SIRQ occurs. 3. The core jumps directly to IRQ mode, and saves the existing one? (: R14 "rq and store CPSR in SPSR-irq. After that, disable irq. The jrq manager detects that it is a SIRQ and executes an SMI instruction with appropriate parameters. 4 · Once in monitoring mode, non-secure must be stored Sexual content, and then the core enters the security IRQ manager. 5. The security IRQ manager provides SIRQ service routine services, and then returns control to the monitoring with SMI with appropriate parameters. 6. The monitoring manager restores non-security content Therefore, a subs instruction returns the core to the non-security context and resumes the interrupted IRQ manager. 7. At this time, the IRQ manager can return to the non-security thread by executing a sUBS. 8. Thread 1 executes to End, and then return control to the schedule. Referring to the mechanism in Figure 12, there is no need to generate SIRQ events again in the case of many interrupts, but security interrupts are not guaranteed to be performed. Exceptions to j at least two entity vector tables ( Although they look like a single vector table from a virtual address, one is for the non-secure scenario 23 200422849 of non-secure memory, and one is for the security of secure memory. The use of primary contexts (not accessible from non-secure sexual contexts). Used for different virtual-to-physical memory mappings for security and non-secure female sexual contexts, effectively allowing the same J's virtual memory address Access the different memory tables stored in the physical memory of the entity S. The monitoring mode always uses pure memory mapping to provide a third vector table in the physical memory. If the interrupts follow the first The mechanism of broadcast solid magic in Fig. 2 will have Γ W ^ 涿 for each table. The set of safety and non-security is as shown in Fig. 14. The following directions are repeated. Exception vector offset value-~ --------- Correspondence mode reset (Reset) 0x00 Supervision mode (s byte) Undefined (Undef) 0x04 Control mode / Undefined mode 4 SWI 0x08 Supervision mode / Monitor mode Prefetch Abort OxOC Abort mode Data Abort 0x10 Abort mode IRQ / SIRQ 0x18 IRQ mode FIQ OxlX FIQ mode SMI 0x20 Undefined (Undef ) Mode / Monitoring Mode

Reset(重設)進入只存在於安全性向量表中。當一 Reset 在非安全性情境中執行時,核心硬體促使進入監督模式和 設定S位元,從而在安全性記憶體中才能存取該Reset向 24 200422849 量。 第1 5圖圖开 式和監控模式的 向量設計,以符 性。每一異常向 表基礎位址登錄 的一基礎位址。 前狀態對應之該 量表基礎位址。: 實體記憶體映射 之三個不同向量」 的一系統(設定控 罩。該異常捕捉 標。該些旗標指: 異常而操作指導: (其為一種安全性 的向量。異常捕, 可寫入。在一非· 捉遮罩登錄所防 錄不包括一重設 同在安全性向量 中的該重設向量 此可見,在第1 5 該向量表,而非. ;分別應用於一安全性模式、一非安全性模 三個異常向量表。上述異常向量表用異常 ^安全性和非安全性作業系統的需要和特 頁表都可以在CP1 5中具有一相關的向量 ,又該CP15在記憶體之内館存指向該表 當一異常發生時,硬體將參考與系統的目 向量表基礎位址登錄,以決定所使用的向 選擇性地,應用於不同…模式之不同虛擬至 ,可用以區別儲存在不同實體記憶體位址 表。如第1 6圖所示,在與處理器核心相關 制)輔助處理器(CP 15)中提供異常捕捉遮 遮罩登錄提供與各自異常類型相關的旗 禾硬體是否應該為在其現有網域中相關的 進行至向量,或應該促成轉換至監控模式 模式型態)而後依照在監控模式向量表中 捉遮罩登錄(異常控制登錄)只在監控模式 安全性模式中時,讀取存取亦可由異常捕 止。由此可見,第16圖的異常捕捉遮罩登 向量的旗標,當該系統不被設定為總是如 表所設定般,強迫其跳至安全性監督模式 ,以保證一安全性開機和反向相容性。由 圖中,為了完整性,重設向量已經出現於 $全性監督模式安全性向量表。Reset entry exists only in the security vector table. When a Reset is performed in a non-safety context, the core hardware prompts the supervisor mode and sets the S bit, so that the Reset can be accessed in the security memory. Figure 15 shows the vector design of the open and monitoring modes for consistency. Each exception is registered as a base address of the table base address. The previous state corresponds to the base address of the scale. : Three different vectors of physical memory mapping ”(a set of control masks. The exception capture flags. These flags refer to: Abnormal operation instructions: (It is a safety vector. Exception catch, can be written The recording of a non-catch mask registration does not include a reset vector that is also in the security vector. This can be seen in the vector table instead of .5; respectively applied to a security mode, A non-safety module with three exception vector tables. The above-mentioned exception vector table uses exceptions ^ The requirements of safety and non-safety operating systems and special page tables can have a related vector in CP1 5 and the CP15 in memory The internal storage points to the table. When an exception occurs, the hardware registers the reference and system's target table base address to determine the direction used. It can be selectively applied to different virtual modes of different ... modes, which can be used to The difference is stored in different physical memory address tables. As shown in Figure 16, the auxiliary processor (CP 15) is provided in the auxiliary processor (CP 15) system to provide exception capture masks. Logins are provided to provide flags related to their respective exception types. Whether the hardware should be related to the vector in its existing domain, or should it facilitate the transition to the monitoring mode mode type), and then follow the mask registration in the monitoring mode vector table (exception control registration). It is only safe in the monitoring mode In the sexual mode, read access can also be stopped by exception. It can be seen that the flag of the exception capture mask in Figure 16 when the system is not set to always be as set in the table, forcing it to jump to the safety supervision mode to ensure a safe boot and anti- To compatibility. From the figure, for the sake of completeness, the reset vector has appeared in the security vector table of the fully-supervised mode.

25 200422849 第16圖亦圖示異常捕捉遮罩登錄之中的不同異常類 型的旗標是可設計的,例如在安全性開機期間藉由監控程 式為之。選擇性地,一些或某些旗標若能在某些實施中由 實體輸入信號所提供,例如安全性中斷旗標SIRQ可以被 硬接為總是促使進入監控模式及執行對應的監控模式安全 性中斷請求向量,當接收到一安全性中斷信號時。第16 圓圖示,只有異常捕捉登錄的部分與非安全性網域異常相 關’可程式位元的一類似部分將被提供給安全性網域異常。 吾人可以自上文了解,在一層級中,硬體依據該些異 常控制登錄旗標,促使現有網域異常管理器或監控模式異 常管理器提供一中斷,其僅為所應用的第一層級控制。舉 一示例,亦可能有一異常發生在安全性模式中,而該安全 性模式異常向量係依照安全性模式異常管理器,但此時該 安全性模式異常管理器由該異常的本質決定其由非安全性 異常管理器來處理會比較好,及因此利用一 SMI指令以轉 換至非安全性模式並請求非安全性異常管理器。亦有可能 有一轉換,其中硬體可進行非安全性異常管理器的起始, 但之後它執行把程序導引至安全性異常管理器或監控模式 異常管理器的指令。 型異常相關的另 一可能類型轉換請求。在第98步驟中,25 200422849 Figure 16 also illustrates that different types of exception flags in the exception capture mask registration can be designed, for example, by a monitoring program during security boot. Optionally, if some or some flags can be provided by the physical input signal in some implementations, for example, the security interrupt flag SIRQ can be hard-wired to always cause the monitor mode to be entered and the corresponding monitor mode security to be implemented. Interrupt request vector when a security interrupt signal is received. The 16th circle shows that only a portion of the exception capture registration that is related to the non-safety domain exception's programmable bit will be provided to the safety domain exception. I can understand from the above that in one level, the hardware controls the login flags based on these exception control, causing the existing domain exception manager or monitoring mode exception manager to provide an interrupt, which is only the first level of control applied . For example, an exception may also occur in the security mode, and the security mode exception vector is based on the security mode exception manager, but at this time, the security mode exception manager is determined by the nature of the exception. It would be better for the security exception manager to handle this, and therefore an SMI instruction is used to switch to the non-security mode and request the non-security exception manager. It is also possible to have a transition in which the hardware can initiate the non-security exception manager, but then it executes instructions that direct the program to the security exception manager or the monitoring mode exception manager. Another possible type conversion request is related to a type exception. In step 98,

第1 7圖是一流程圖,圖示之系統操作能支援與一新類 1少哪甲,硬 現有程式狀 ,則觸發一 在第1〇〇步 26 200422849 驟,該CPSR違反異常的產生,導致對在監控模式之内之 一適當異常向量進行參照,而監控程式係在第1〇2步称執 行,以處理該CPSR違反異常。 吾人將了解,除了支援先前所討論過的SMI指令外可 能提供如第1 7圖相關討論之在安全性網域和非安全性網 域之間起始一轉換的機制。可以提供異常機制以回應未經 授權之欲轉換模式的意圖,而所有經授權的意圖都應該藉 由一 SMI指令進行。選擇性地,此類機制也許是在安全性 網域和非安全性網域之間轉換的合法方法或可提供以崎予 反向相容性,其具有(例如,可能企圖清除處理狀態登錄的) 既除程式碼,即使並非真的在安全性網域和非安全性網域 之間從事未經授權之轉換意圖。 ~ 如上所述,一般而言,當處理器在監控模式中操作時, 會令中斷失效。之所以如此,是為了增進系統的安全性。 當一中斷發生時,該時刻處理器的狀態被儲存在中斷異常 登錄中,因此當中斷功能完成時,可以在中斷點重新繼續 被中斷的功能之處理。如果在監控模式中允許該處理,其 可能降低監控模式的安全性,可能造成安全性資料洩漏之 路徑。因此,通常會令中斷在監控模式中失效。然而,在 監控模式期間令中斷失效的結果是,增加了中斷等待的時 間。 如果處理器執行功能的狀態未儲存,亦有可能在監控 模式中允許中斷。其只能在一中斷之後,該功能未重新繼 續時進行。因此,藉由在監控模式中只允許能安全地重新 27 200422849 啟動之功能的中斷,可以解決在監控模式下之中斷等待時 間的問題。在這種情況下,在監控模式中一中斷之後,一 旦完成該中斷,相關於該功能之處理的資料未被儲存,並 被拋棄且指示處理器自它的開始處開始處理它的起始功 能。在上述示例中,當處理器只是返回轉換至監控模式之 點時,它只是一件簡單的事情。應該注意的是,重新開始 一功能只對某些可以重新開始且仍然產生可重複性結果的 功能有可能。如果該功能改變該處理器之狀態,在重新開 始它時會產生一不同結果’則重新開始功能並不是個好主 意。因此,只有能安全地重新開始的那些功能能夠在監控 模式中中斷,對於其他功能而言,則使該些中斷失效。 η兆們,题理發生在監控 笫18圖圖示依據本發 模式的中斷的一種方法。在一非安全性模式中,一 smi發 生在任務A的處理期間,而其將處理器轉換至監控模式。 該SMI指令使核心藉由專屬的非安全性隨向量進入監控 模式。PC的現有狀態被儲存,s位元被設置且令中斷失效: 通常,用LR一mon和SPSR mon來蚀产办— 和-來錯存非安全性模式的Pc 而後在監控模式中起始一 e 犯·功能〇功能c所進行 之第一件事’疋啟用該些中斷, 而後功能C被處理。如果 中斷在功能C的處理期間發生, 〜不使該些中斷失效,以 接受和執行該令斷。然而,監控 以 模式指標對處理器指示, 在一中斷之後,不重新繼續該功 , 亦不重新起動。選擇 性地,可籍由控制參數分別指示處 + 里器β因此,在一中斷 28 200422849 之後,以LR_mon及SPSR_mon值更新該些中斷異常向量 而不儲存處理器的現有狀態。 如第18圖所示,在中斷任務-任務B完成之後,處理 器讀取已經拷貝到中斷登錄的SMI指令的位址’及執行一 SMI和再次開始處理功能C。 上述處理只作用於功能C是可以重新開始的時候,意 即如果重新開始處理C將產生可重複的處理夕驟。這並不 是說,功能C改變了處理器的任何狀態,例如堆疊指標可 能影響它將來的處理。在此,一稱作可重複的功能是因為 具有冪等(idempotence)。處理一功能之該問題之一方法係 重新安排定義該功能之程式碼,在該方法中,該程式碼之 第一部分具有冪等,一旦不再有可能安排具有冪等的程式 碼時,令中斷失效。例如,如果程式碼C牵涉到寫入堆疊, 那麼至少一開始它有可能這麼做而無需更新該堆疊指標。 一旦決定該程式碼不再能夠安全地重新開始,則功能C的 程式碼能夠指示該處理器令中斷失效,而後其能夠對正確 的位置更新堆疊指標。如第1 8圖所示,其中經由於功能c 的處理’以某種方法令中斷失效。 第1 9圖圖示一輕微地不同的示例。在該示例中,藉由 任務C處理的某種方法,設定了 一進一步的控制參數。它 指示任務C的下列部分並非嚴格的冪等,但是,能夠被安 全地重新開始,確保一改進的例式先被執行。該改進的例 式使處理器的狀態還原為在任務C的一開始時的樣子,在 任務結束時,如果它不被中斷,當它已經完成時,使任務 29 200422849 c能夠安全地重新開始並產生安全的處理器狀態。在一些 實施例中,在進一步的控制參數被設定的點’當處理器的 _婆狀態被修正(例如,更新堆疊指標),可以令中斷失效 〆段短期的時間。如此允許該處理器稍後被還原至一冪等 狀態。 當一中斷在進一步的控制參數被設定之後發生時,則 有雨種可能的處理方法。 一Figure 17 is a flowchart showing the operation of the system that can support a new class 1. If the existing program is hard, it triggers a step at step 100 26 200422849. The CPSR violation exception is generated. As a result, a reference is made to an appropriate exception vector within the monitoring mode, and the monitoring program is executed at step 102 to handle the CPSR violation exception. I will understand that in addition to supporting the SMI instructions previously discussed, it may provide a mechanism for initiating a transition between a secure domain and a non-secure domain as discussed in relation to FIG. 17. An exception mechanism can be provided in response to an unauthorized intent to switch modes, and all authorized intents should be performed through an SMI instruction. Alternatively, such a mechanism may be a legal method of transitioning between a secure domain and a non-secure domain, or it may provide backward compatibility with ) Except for code, even if it is not really an unauthorized conversion intent between a secure domain and a non-secure domain. ~ As mentioned above, in general, interrupts are disabled when the processor is operating in monitor mode. The reason for this is to improve the security of the system. When an interrupt occurs, the state of the processor at that moment is stored in the interrupt exception registration. Therefore, when the interrupt function is completed, the processing of the interrupted function can be resumed at the interrupt point. If this processing is allowed in the monitoring mode, it may reduce the security of the monitoring mode and may cause the path of security data leakage. Therefore, interrupts are usually disabled in monitor mode. However, as a result of disabling the interrupt during the monitor mode, the interrupt wait time is increased. It is also possible to enable interrupts in monitor mode if the state of the processor's execution function is not stored. It can only be performed after an interruption and the function is not resumed. Therefore, by allowing only interrupts that can be safely restarted in the monitoring mode, the problem of interrupt waiting time in the monitoring mode can be solved. In this case, after an interruption in the monitoring mode, once the interruption is completed, the data related to the processing of the function is not stored and discarded and the processor is instructed to start processing its initial function from its beginning. . In the example above, when the processor simply returns to the point where it transitioned to monitor mode, it is a simple matter. It should be noted that restarting a function is only possible for some functions that can be restarted and still produce repeatable results. If the function changes the state of the processor and it will produce a different result when it is restarted, then it is not a good idea to restart the function. Therefore, only those functions that can be safely restarted can be interrupted in the monitor mode, and for other functions, these interrupts are disabled. Trillion, the thesis occurs in the monitor. Figure 18 illustrates a method of interruption according to the present pattern. In a non-secure mode, an smi occurs during the processing of task A, and it switches the processor to monitor mode. The SMI instruction enables the core to enter the monitoring mode with the vector through dedicated non-security. The current state of the PC is stored, the s bit is set and the interrupt is disabled: Normally, LR_mon and SPSRmon are used to erode the production office — and-to stagger the Pc in non-security mode and then start a e. Function 0. The first thing that function c does is to enable the interrupts, and then function C is processed. If an interrupt occurs during the processing of function C, ~ the interrupts are not invalidated to accept and execute the order. However, the monitoring instructs the processor with a mode indicator, and after an interruption, the function is not resumed or restarted. Optionally, the control parameters can be used to indicate the processor + processor β respectively. Therefore, after an interrupt 28 200422849, the interrupt exception vectors are updated with the LR_mon and SPSR_mon values without storing the current state of the processor. As shown in FIG. 18, after the interrupt task-task B is completed, the processor reads the address of the SMI instruction which has been copied to the interrupt registration and executes an SMI and starts processing function C again. The above processing only works when function C can be restarted, which means that if process C is restarted, a repeatable processing step will be generated. This is not to say that function C changes any state of the processor, for example, stacking metrics may affect future processing. Here, a function that is called repeatable is because it has idempotence. One way to deal with the problem of a function is to rearrange the code that defines the function. In this method, the first part of the code has idempotent. Once it is no longer possible to arrange the code with idempotent, interrupt Failure. For example, if code C involves writing to the stack, then it is possible to do so at least initially without updating the stack index. Once it is determined that the code can no longer be restarted safely, the code of function C can instruct the processor to disable the interrupt, and then it can update the stack index to the correct position. As shown in Fig. 18, the interruption is disabled in some way by the processing of the function c. Figure 19 illustrates a slightly different example. In this example, a further control parameter is set by some method handled by task C. It indicates that the following parts of Task C are not strictly idempotent, but can be safely restarted, ensuring that an improved routine is executed first. This improved example restores the state of the processor to what it was at the beginning of task C. At the end of the task, if it is not interrupted, when it has completed, it enables task 29 200422849 c to restart safely and Generate a secure processor state. In some embodiments, at a point where further control parameters are set, when the processor's status is modified (for example, updating the stack index), the interrupt can be disabled for a short period of time. This allows the processor to be restored to an idempotent state later. When an interruption occurs after further control parameters are set, there is a possibility of rain treatment. One

處理中斷的改進例式,就是能夠立即處理中斷並在稍後> 成中斷,執行SMI而後在重新開始任務C之前,執行該s 進的例式(在F2)。如所示者,在上述二實施例中,在監老 模式中執行該改進的例式,並因此在非安全性網域中的幸 行(其不知道安全性網域或監控模式)並不受到影響。 如第19圖所示,程式碼c之一第一部分具有冪等』 能夠在一中斷之後重新開始。一第二部分可重新開始,^ 保首先執行一改進的例式。而其藉由設定一「進一步」老 制參數來指示,而程式碼之一最後部分不能被重新開二: 並因此在處理程式碼之前,中斷是失效的。The improved routine for handling interrupts is an example that can handle the interrupt immediately and then > break it later, execute SMI, and then execute this step before restarting task C (at F2). As shown, in the above two embodiments, the improved example is executed in the monitoring mode, and therefore the good luck in the non-secure network domain (which does not know the security network domain or monitoring mode) is not affected. As shown in Figure 19, one of the first part of the code c has idempotence "and can be restarted after an interruption. A second part can be restarted, ensuring that an improved example is performed first. And it is indicated by setting a "further" old parameter, and the last part of one of the code cannot be reopened: and therefore the interrupt is invalidated before the code is processed.

第20圖圖示一選擇性 在這種情況下,其相異方 丹他貫施例,中斷在監控握 控模式期間是啟用的。而後在監老 冥式中執行的功能令中斷失 LL ^ ^ 双,一旦它們不再能夠被安4Figure 20 illustrates a selectivity. In this case, its alien party implements interrupts that are enabled during the monitoring grip mode. Then the functions performed in the Supervisor's Underworld style caused the interruption to lose LL ^ ^ double, once they can no longer be installed 4

地重新開始。其只在監控模 j钣女S 新門私^ t 模式中所有被中斷的功能能被言 新開始而非能重新繼續時有可能。 有一些方法,能夠確俾 能,% + 保所有在某一模式下執行之习 月& 而非在中斷時重新繼婊 啜續。一種方法是藉由增加新的肩 30 200422849 理器狀態,其中中斷儲存指令序列的開始位址,而非中斷 的指令的位址。在這種情況下,總是在該狀態下執行監控 模式。一選擇性的方法是藉由在每一功能開始時,預載入 在一功能的開始位址至中斷異常登錄,並在中斷之後使處 理器狀態其後的寫入失效,以中斷異常登錄。 如第20圖所示之實施例,如果要求功能可以安全地重 新開始,功能之重新開始可以在中斷功能結束之後立即完 成,或在一改進的例式之後完成。 雖然就一具有安全性、非安全性網域和一監控模式之 系統而論,上文已經描述了處理中斷等待時間的方法,但 可以明白,其能應用於有功能由於一特定原因而不應該重 新繼續的任何系統。通常此類功能可藉由使增加中斷等待 時間的中斷失效而作用。在一中斷之後,改正功能為可重 新開始和控制該處理器以重新起動他們,為了功能處理的 至少一部份,允許啟用該些中斷及幫助減少中斷等待時 間。例如一作業系統的一般内容轉換。To start again. It is possible only when all the interrupted functions in the monitoring mode can be said to be started again rather than resumed. There are ways to ensure that it works,% + to ensure that all exercises performed in a certain mode & are not resumed when interrupted. One method is by adding a new shoulder state. 200422849 The interrupt stores the start address of the instruction sequence instead of the address of the interrupted instruction. In this case, the monitoring mode is always executed in this state. An alternative method is to interrupt the abnormal registration by preloading the start address of a function to the interrupt exception registration at the beginning of each function, and invalidating the subsequent writing of the processor state after the interrupt. In the embodiment shown in FIG. 20, if the function is required to be restarted safely, the restart of the function may be completed immediately after the interrupt function is completed, or after an improved routine. Although a method of handling interrupt latency has been described above with respect to a system with a secure, non-secure domain, and a monitoring mode, it can be understood that it can be applied to a function that should not be used for a specific reason Resume any system. Normally such functions can be used by disabling interrupts that increase interrupt latency. After an interrupt, the correct function is to restart and control the processor to restart them. For at least part of the functional processing, allow the interrupts to be enabled and help reduce interrupt wait time. For example, the general content conversion of an operating system.

存取安全性和非安全性記憶體 如第一圖所示之資料處理設備具有記憶體,其當中包 括TCM 36、快取38、ROM 44、受控裝置的記憶體和外 部記憶體5 6。如第3 7圖所示,例如,記憶體被分割為安 全性和非安全性記憶體。吾人將了解,在製造時,在記憶 體的安全性記憶體區域和非安全性記憶體區域之間通常沒 有任何實際區別,但反而由資料處理設備的一安全性作業 31 200422849 系統定義該些區域’當在該安全性網域作業時。因此,含 憶體裝置的任何實體部公 、 11己 可以被分配為安全性記憤體 而任何實體部分可以被分配為非安全性記憶體。 , 如第2囷至第5圓所示’處理系統具有-安全性網域 和-非安全性網域。在該安全性網射,提供 性 ^ 、 陡模式執行。提供一監控程式72, 其涵盍安全性和非安全性網㉟,以及其至少一部分以一龄 控模式執行。在本發明 的實施例中,監控程式邹分以監控 模式並部分m性模式執行。如第iQ圖所*,有 安全性模式,其中包括、—監督模式svc。 監控程式72負責管理在安全性和非安全性網域之 任一方向的所有改變。參昭 Μ第8圖和第9圖在章節「處理 模式」中描述了 -些它的功能。該監控程式負責在 全性模式中所發出的_模 供武轉換睛求SMI,以初始化自 述非安全性模式到上述安 <文主性模式的一轉換,以及g 安全性模式中所發出的 汉貝貝在 ^ 模式轉換請未SMI,以初舲外ό 上述安全性模式到上沭韭6 ^ 初始化自 I以上4非安全性模式的_轉換 境間的轉換」所述,在監 士章即情 性和非安全性網域中之—M ^ s , 史生係自女全 之轉換至少一些登錄至^ 此涉及儲存在一網域中存在的-登錄狀態和^他者。如 入一新狀態至登錄(或在在其他網域寫 (次在登錄中還原以前儲 文亦論及,當執行些—轉換時, 的狀態)。本 失效。較佳的實施例是,令監控模式;:錄的:取可能會 因為監控程式所執# 有中斷都失效。 執仃的監控模式涵蓋安全性以及非安 32 全性網域,所以證實為 部署欲部署之功能。因::的監控程式是很重要的:即只 此如果監控程式愈簡置合士立丨 t性模式只允許在安全性網域中執行程序。在::安 施例中,權限安全性模 在本發明的實 H 和監控模式允許存取; 性和非安全性記憶體。 才仔取相同的安全 _由確保該權限安全 相同的安全性和非安全 、式看見」 4 δ己憶體,把僅能在監抟描斗、丄 行的功能轉換至允許簡仆控模式中執 間化的監控程式之安全性掇4、 外,其允許在一權限安全 f生模式。此 性模式中*ί呆作的一處理 至監控模式,反之亦然。 處里直接轉換 的轉換是允許的,而在κ 、至‘控模式 域。非權限安全性模々ν 1 、 卩女全性網 力“ · 式須使用SMI’以進入監控模h 叹之後,系統進入權限安全性模式。在網之; 有助於健存狀態式和權限安全性模式之間來回的轉換 施例中’允許自安全性權限模式中以及自監 工式中存取s旗標。如果允許安全性權限模式在維 式流程的控制時,將處理器轉換到監控模式,則此類安全 性權限模式已經I古絲换c^ — 貝女全 飞匕,生具有轉換S旗標(位疋)的有效能力。 此’規定只能夠在監控模式中改變s旗標的額外複 能證實為正確的。应 处釣iitb伽甘π 不 方法儲設定旗標相同的 方法儲存S旗標,又該些其他設定旗標可以由一或 安全性權限模式所改變。本技術包括在多數安全性權限= 式之一中改變S旗標的此類實施例。 回到先前討論的示例性實施例,設備具有定義模式和 33 200422849 定義 許的 全性 全性 任何 式, 述〇 以及 僅能 全性 存取 式當 非安 體。 體, 性記 tb -~ 然而 控模 開機 在本設備的一示 非安全性記憶體 在監控和安全性 記憶體在監控模 例中,記憶體被分 ,而安全性和非安 模式中存取。較佳 式、安全性模式和 模式的權限層級的一處理器核心1 〇 · ^ a,即,任何模式允 肊集。因此,以習知方法安排處理 描# 峻亥心以允許安 犋式和監控模式存取安全性和非安 M , ^ F文全性記憶體,及安 模式存取監控模式允許存取的所有 ^ 隐體,和允許在 權限安全性模式中所操作的處理直 |接轉換至監控模 汉之亦然。處理器核心1 〇之較佳安撫 $-所允許者如下所 割為安全性記憶艘 全性記憶體二者皆 的實施例為,非安 非安全性模式中町 本設備之另一示例’在監控模式和一或多數安全性模 中’拒絕安全性模式對非安全性記憶體的存取;和在 全性模式中拒絕安全性和監控模式存取非安全性記憶 因此’僅允许在監控和安全性模式中存取安全性記憶 以及僅能藉由增進安全性之非安全性模式存取非安食 憶體。 本設備的示例中,設備的重設或開機可以在視為需要 安全性模式、權限模式更高權限之監控模式中執行。 ,在設備的許多示例中,因為允許在安全性模式和炱 式之間直接轉換’安排在一安全性模式中提供重設及 是有可能的。 如第2圖所述’在安全性網域、和在一安全性模式,Accessing secure and non-secure memory The data processing device shown in the first figure has memory, which includes TCM 36, cache 38, ROM 44, memory for controlled devices, and external memory 56. As shown in Figure 37, for example, the memory is divided into secure and non-secure memory. I will understand that at the time of manufacture, there is usually no actual difference between the secure memory area and the non-secure memory area, but these areas are defined by a security job of the data processing equipment 31 200422849 system. 'When operating in this security domain. Therefore, any physical department of the memory device can be allocated as a security memory and any physical portion can be allocated as non-safety memory. As shown in the second to fifth circles, the 'processing system has a -secure domain and a -non-secure domain. In this safety net shot, the sexual mode is provided, and the steep mode is executed. A monitoring program 72 is provided, which includes security and non-security networks, and at least a portion of which is implemented in a one-year-controlled mode. In the embodiment of the present invention, the monitoring program Zou Fen is executed in a monitoring mode and a partial m-mode. As shown in figure iQ *, there are security modes, including,-supervision mode svc. The monitor 72 is responsible for managing all changes in either direction of the secure and non-secure domains. Refer to Figure 8 and Figure 9 in the "Processing Mode" section for some of its functions. The monitoring program is responsible for the conversion of the _ mode for the SMI issued in the holistic mode to initiate the conversion of the self-described non-safety mode to the above-mentioned security mode, and the g-safety mode. In the transition of ^ mode, please ask SMI to start with the above security mode to the above 6 ^ Initialize the transition from the above _ 4 non-security mode _ transition environment, as described in the Supervisor Chapter That is, M ^ s in the emotional and non-secure domains, and the history students are converted from women's all at least some logins to ^ This involves the existence of-login status and ^ other stored in a domain. Such as entering a new state to log in (or write in other domains (times before the restore in the log also mentioned in the previous storage, when performing some-conversion, the state of). This invalidation. The preferred embodiment is to make Monitoring mode:: Recorded: It may be disabled due to the interruption of the monitoring program. The implemented monitoring mode covers security and non-security 32 domains, so it is confirmed to be a function to be deployed. Because :: The monitoring program is very important: that is, if the monitoring program becomes simpler, the t-mode can only be executed in the security domain. In the example: the security mode of the permission is in the present invention. The real H and monitoring modes allow access; sexual and non-secure memory. Only take the same security _ by ensuring that the security is the same security and non-secure, see "4 δ memory, only can The functions of monitoring and tracing are switched to the security of the monitoring program that allows execution in the simple server control mode. 4. In addition, it allows a security and security mode. In this sexual mode Once processed to monitor mode, otherwise Of course, the conversion of direct conversion is allowed, while in κ, to the 'control mode domain. Non-permission security mode 々ν 1, 卩 female full-scale network power "mode must use SMI' to enter the monitoring mode h sigh After that, the system enters the permission security mode. In the network, it helps to switch back and forth between the health state type and the permission security mode. In the embodiment, 'allow the access to the s flag in the self-security permission mode and in the self-supervision mode. If the security permission mode is allowed to switch the processor to the monitoring mode during the control of the dimensional process, this type of security permission mode has been changed from csv to c ^ — the belle is full of daggers, and it has the conversion S flag. The effective capacity of the tag (bit). This' requirement can only be changed in the monitoring mode. The additional resumption of the s flag can be confirmed to be correct. It should be used to store the i flag. The flag cannot be stored in the same way as the S flag. However, the other setting flags can be changed by one or the security permission mode. The present technology includes such an embodiment in which the S flag is changed in one of most security permission = expressions. Returning to the previously discussed exemplary embodiment ,Assume It has the definition mode and 33 200422849 definition of the holistic and holistic any formula, which is described as 0 and can only be accessed by the holistic type. It is not safe. However, the control mode is not safe in the device. Sex memory in monitoring and security memory in the monitoring model, memory is divided, and security and non-security mode access. Better, security mode and mode permission level of a processor core 1 ○ a, that is, any mode allows the set. Therefore, the processing method is arranged in a conventional way. Jun Haixin allows security and non-security access to security and non-security mode. The security mode access monitoring mode allows access to all ^ hidden bodies, and allows the operation in the permission security mode to directly switch to the monitoring mode and vice versa. The better comfort of processor core 10 is to allow the following to be cut into a secure memory, a holistic memory, and an example of both. The non-security mode is another example of a local machine in monitoring mode. Access to non-secure memory in security mode and one or more security modes; and deny access to non-secure memory in security mode and monitoring mode in full mode and therefore 'allow only in monitoring and security Access to secure memory in sexual mode and access to non-secretory memory only through non-secure mode that enhances security. In the example of this device, resetting or turning on the device can be performed in a monitoring mode that is deemed to require a security mode and a higher privilege mode. In many instances of the device, it is possible to provide resetting in a security mode because it allows a direct transition between security mode and mode to be provided. As shown in Figure 2 ’in the security domain and in a security mode,

34. 200422849 —安全性核心8 〇 (或作業系統)功能’和一或多數的安全性 應用程式82、84可以在安全性核心80中執行。允許該安 全性核心和〉或安全性應用程式或在一安全性模式中執行 的任何其他程式碼存取安全性和非安全性記憶體兩者。 雖然以具有處理器的設備描述本發明之示例’本發明 可以由一電腦程式所部署,當在合適的處理器上執行時, 該電腦程式以如本章節所述之操作設定該處理器。 下文中,參照第21圖至2 3圖,本發明之一選擇性實 施例論及出自一程式設計人員之模式觀點: 下文中,吾人所使用之術語必能以ARM處理器(由英 國劍橋的ARM Limited所設計)的技術背景了解。 • S位元:安全性狀態位元,包含在一專屬CP 1 5登錄中。 ❿ 「安全性/非安全性狀態」。由S位元值定義這種狀態。 其指示是否核心可以存取安全性情境,(其當處於安全 性狀態中,即 s = l)或僅限制非安全性情境(s = o)。請注 意監控模式(詳見下文)優先於該s位元狀態。 • 「非安全性情境」可供不需要安全性的非安全性應用所 存取的所有硬體/軟體群組。 • 「安全性情境」僅供吾人執行安全性程式碼時存取的所 有硬體/軟體(核心、記憶體…)群組。 •監控模式:一種新的模式,其負責在安全性和非安全性 狀態之間的轉換。 簡而言之 _核心總是能夠存取非安全性情境。 35 200422849 •僅在核心處於安全性狀態或監控模式時,該核心能夠存 取安全性情境。 • SMI:軟體監控中斷:一種新的指令,其令核心藉由一 專屬的SMI異常向量以進入監控模式。「執行緒id」: 與每一執行緒相關的識別符(由一 〇 S所控制)。對某些 類型的OS而言’當OS在非安全性情境中執行時,每 次呼叫一女全性功能,就需要傳遞一現有執行緒ID參 數’以連接安全性功能與它所呼叫的非安全性應用。該 安全性情境因此能夠支援多執行緒。 •安全性中斷定義由安全性週邊所產生的中斷。 程式設計人員的模組 C a r b ο η核心概觀34. 200422849-Security Core 80 (or operating system) functions' and one or more security applications 82, 84 can be executed in Security Core 80. This security core and / or security application or any other code running in a security mode is allowed to access both secure and non-secure memory. Although an example of the invention is described in terms of a device with a processor 'The invention can be deployed by a computer program that, when executed on a suitable processor, sets the processor with the operations described in this section. In the following, referring to FIGS. 21 to 23, an alternative embodiment of the present invention refers to a model perspective from a programmer: In the following, the terminology we use must be based on an ARM processor (from Cambridge, UK Designed by ARM Limited). • S bit: Security status bit, included in a dedicated CP 1 5 login. ❿ "Security / non-security status". This state is defined by the S-bit value. It indicates whether the core can access the security context (when it is in a security state, ie, s = l) or restricts only non-security contexts (s = o). Please note that the monitoring mode (see below) takes precedence over this s-bit state. • A "non-security context" provides access to all hardware / software groups that are accessed by non-security applications that do not require security. • A Security Context is a group of all hardware / software (core, memory ...) that is only accessible to me when executing security code. • Monitoring mode: A new mode that is responsible for transitioning between security and non-security states. In short _ the core is always able to access non-security contexts. 35 200422849 • Only when the core is in the security state or monitoring mode, the core can access the security context. • SMI: Software Monitoring Interrupt: A new instruction that allows the core to enter the monitoring mode through a dedicated SMI exception vector. "Thread id": An identifier (controlled by 10S) associated with each thread. For some types of OS, 'When the OS executes in a non-security context, each time a female full-featured function is called, an existing thread ID parameter needs to be passed' to connect the security function with the non-feature it calls Security applications. This security scenario can therefore support multiple threads. • Security interrupts define interrupts generated by security perimeters. Programmer's Module C a r b ο η Core Overview

控制所允許的指令或事件修改 歸功於包含*金*9 ---- 全性)位元」,核 態。 該S位元,即,自一種 36 200422849 狀態改變到另一狀態,是系統安全性的一重要特徵。本解 決方案提出増加-新模式「監控模式」,其「監督」在兩種 狀態之間的轉換。該監控模式(藉由寫入適當的cpi5登錄 中)是唯一被允許改變該S位元者。 最後,本發明提出對異常處理添加某些彈性的方法。 除了 Reset(重設)外’所有的異常若不是在它們所發生處處 理’就是被導向監控模式。歸因於一專屬一 cpi5登錄, 這是可以設定的。 該解決方案的細節將在下列段落中討論。 處理器狀態和槿式 Carb_on新特微 安金二味或非安全性狀鈸rs #开.)The modification of instructions or events allowed by the control is attributed to the inclusion of * gold * 9 ---- holistic) bits ", nuclear status. The S bit, that is, changing from one state to another state is an important feature of system security. This solution proposes a “monitoring mode”, a new mode of addition-new mode, whose “supervision” changes between the two states. The monitoring mode (by writing in the appropriate cpi5 login) is the only one allowed to change the S bit. Finally, the present invention proposes a method that adds some flexibility to exception handling. Except for Reset, all exceptions are either handled in their occurrence or are directed to the monitoring mode. Due to an exclusive one cpi5 login, this can be set. The details of this solution are discussed in the following paragraphs. Processor status and hibiscus Carb_on new special micro Anjin second taste or non-security traits 钹 rs # 开.)

Carbon核心的一主要特徵是s位元的存在其指示是 否核心是在一安全性(S = 1)或非安全性(s = 〇)狀態。當在安 全性狀態中時,核心能在安全性或非安全性情境態樣存取 任何資料。當在非安全性狀態時,核心僅限於該非安全性 情境。 對該規則的唯一例外涉及監控模式,其優先於該s位 元資訊。甚至在S = 0時,當它在監控模式中,核心將執行 安全性權限存取。進一步的資訊請參考下一段落之監控模 式。 只能夠在監控模式中讀取和寫入該S位元。不論該s 位元的值為何,如果任何其他的模式試著去存取它,若不 37 200422849 是被忽略就是導致一 Undefined(未定義)異常 除了 Reset(重設)之外,所有的異常不會 態位元。在Reset(重設)上,設定該s位元, 督模式開始。詳細資訊請參照開機章節。 安全性/非安全性狀態是分離的且其 ARM/Thumb/Java 狀態。 麗控模式A major feature of the Carbon core is the presence of the s-bit, which indicates whether the core is in a secure (S = 1) or non-secure (s = 0) state. When in a secure state, the core can access any data in a security or non-security context. When in a non-security state, the core is limited to that non-security situation. The only exception to this rule relates to the monitoring mode, which takes precedence over the s-bit information. Even when S = 0, when it is in monitor mode, the core will perform security permission access. For further information, please refer to the monitoring mode in the next paragraph. This S bit can only be read and written in the monitor mode. Regardless of the value of the s bit, if any other mode tries to access it, if it is not ignored, 2004200422849 will result in an Undefined exception. All exceptions except Reset Meeting bit. On Reset, the s bit is set and the monitor mode starts. For more information, please refer to the booting chapter. The security / non-security state is separate and its ARM / Thumb / Java state. Li control mode

Carbon系統的一其他重要特徵是一新 式」的產生。它將用來在安全性和非安全性 核心轉換。它總是被視為一安全性模式,即s 當在監控模式中時,核心總是對外部情境執 存取。 任何安全性權限模式(即,當S = 1時之;| 由僅是寫入CPSR模式位元(MSR、MOVS、 者)轉換為監控模式。然而,它在任何非安全 性使用者模式中是禁止的。如果這發生了, 引起一異常。 可能有需要一專屬的CPSR違反異常。 安全性模式或安全性使用者模式直接寫入該 任何欲轉換為監控模式之意圖引起該異常。 當監控模式是啟用時,除了 Reset以外 際上失效了: φ 所有中斷經過遮罩處理(mask); 影響安全性狀 而核心將以監 操作是獨立於 模式「監控模 狀態之間控制 丨位元值為何, 行安全性權限 餮限模式)能藉 或相當的指令 性模式或安全 則忽略指令或 藉由從任何非 CPSR,可由 ’所有異常實 200422849 φ 所有記憶體異常不是被忽略就是引起一重大異常。 • 未定義的/SWI/SMI被忽略或引起一重大異常。 當進入一監控模式時,該些中斷自動失效而系統監控 應被寫下,以使系統監控執行時,不會有其他類型的異常 發生了的。 監控模式需要有一些私有登錄。該解決方案提出人們 僅重複最小組的登錄,即,R13 (sp一mon)、R14(lr—mon)和 SPSR(spsr—mon) 〇 在監控模式中,MMU將失效(平面位址映射,flat address map)以及MPU或分割檢測器亦然(監控模式將總 是執行安全性權限外部存取)❶然而,尤其是設計的MPU 區域屬性(快取能力(cacheability)…等等)仍然是啟用的。 可選擇性地,監控模式可以使用所有被安全性網域所使用 的映射。 新指合 本發明所提出者需要向既有ARM指令集中添加一新 的指令。 使用SMI(軟體監控中斷)指令以進入監控模式(在一固 定的SMI異常向量發展出來)。該指令主要用來對指示監 控在非安全性和安全性狀態之間的調換(Swap)。 可選擇性地(或額外地)’亦可能增加一新指令以允許 監控模式向/從監控堆疊儲存/還原任何其他模式的狀態, 39 200422849 以改進内容轉換的表現。 處」單 如先前的段落中所述’僅有一新模式被加入核心。所 有既存模式持續可獲得,並在於安全性和非安全性狀態中 都存在。 事實上,Carbon使用者將了解如第21圖所示之架構。 處理器登辞 本發明之實施例提出安全性和非安全性情境共用相同 的登錄區塊。$意味著,當藉由監控模式從一情境轉換為 另者時系統監控將需要儲存第一情境内容,以及在第 二情境中產生(或還原)一内容。 傳遞參數成為容易的任務:一旦系統監控改變了該s 位元,在第一情境中的一登錄中所含有的任何資料將可用 於第二情境中之相同的登錄中。 然而,除了有限數量之登錄專用於傳遞參數, 嚴格地控制,當從安全性傳遞至非安全性狀態時, 他登錄都需要清除,以避免洩漏任何安全性資料。 由監控核心確保。 其需要 所有其 它需要 亦可能部署一硬體機制或一新指令,在從安全性轉換 至非安全性狀態時直接清除登錄。 所提出的另一解決方案涉及重複所有(或大多數)既有 登錄區塊,因此具有在安全性和非安全性狀態之間具有兩 40 200422849 實體上刀離的登錄區塊。該解决方案主要具有清楚地分離 在登錄中所含有的安全性和非安全性資料的優點。在安全 性和非安全性狀態之間亦允許快速的内容轉換。然而,缺 點是藉由登錄的傳遞參數變得困難,除非吾人產生一些專 屬的指令,以允許該安全性情境存取非安全性登錄。 第22圖依據處理器模式圖示可用的登錄。請注意,處 理器狀態對本主題沒有影響。 異常 安全性中《yj· 現有解決方銮 本發明提出當在現有核心時’保持相同的中斷腳位 (pin),即,IRQ和FIQ。相關於異常捕捉遮罩登錄(Exception Trap Mask register,詳見下文)’對於任何系統應該有足夠 彈性,以部署和處理不同種類中斷。 VIC加強 本發明藉由下列方法加強 V1 c (向量中斷控制器, Vectored Interrupt Controller) : VIC 可以含有與每一向量 位址相關的一安全性資訊位元。該位元僅能由監控或安全 性權限模式設計。其指示是否所考慮的中斷應該視為安全 性,以及因此應該在安全性中處理。 本發明亦增加兩新向量位址登錄,一供所有在非安全 性狀態中發生的安全性中斷,另一供所有在安全性狀態中 41 200422849 發生的非安全性中斷。 包含在CP15中的S位元資訊可讓VIC獲得,以作為 一新VIC輸入。 下表概述一些不同可能歷程,其依據引入的中斷之狀 態(安全性或非安全性,由相關於每一中斷線之S位元指示) 和核心的狀態(在VIC中,CP15 = S輸入信號之S位元)。One other important feature of the Carbon system is the creation of a new style. It will be used to switch between security and non-security cores. It is always regarded as a security mode, that is, when in monitoring mode, the core always performs access to external contexts. Any security permission mode (that is, when S = 1; | is converted from a write-only CPSR mode bit (MSR, MOVS, or others) to a monitoring mode. However, it is in any non-security user mode Prohibited. If this happens, cause an exception. There may be a need for a dedicated CPSR violation exception. The security mode or security user mode directly writes any intent to switch to the monitoring mode to cause the exception. When the monitoring mode When it is enabled, it is invalid except for Reset: φ All interrupts are masked; the security behavior is affected and the core will monitor operations independently of the mode. Security permission limit mode) can be equivalent to the prescriptive mode or the security ignores the instruction or by using any non-CPSR, it can be 'all exceptions real 200422849 φ All memory exceptions are either ignored or cause a major exception. The defined / SWI / SMI is ignored or caused a major anomaly. When entering a monitoring mode, the interrupts are automatically disabled and system monitoring should be disabled. In order to prevent other types of exceptions from occurring when the system monitoring is performed. The monitoring mode requires some private logins. This solution proposes that people only repeat the login of the smallest group, that is, R13 (sp-mon), R14 (lr-mon) and SPSR (spsr-mon) 〇 In monitoring mode, MMU will fail (flat address map), as well as MPU or split detector (monitoring mode will always execute security permissions outside Access) ❶ However, especially the designed MPU region attributes (cacheability ... etc.) are still enabled. Alternatively, the monitoring mode can use all mappings used by the security domain. New Refers to the present invention, the presenter needs to add a new instruction to the existing ARM instruction set. Use the SMI (software monitoring interrupt) instruction to enter the monitoring mode (developed from a fixed SMI exception vector). This instruction is mainly used to Indicate monitoring swap (Swap) between non-safety and security status. Optionally (or additionally) 'may also add a new instruction to allow monitoring mode to / from Monitor the status of the stack store / restore of any other mode, 39 200422849 to improve the performance of content conversion. As described in the previous paragraph, ‘only a new mode has been added to the core. All existing models are continuously available and exist in both security and non-security states. In fact, Carbon users will understand the architecture shown in Figure 21. Processor Logging In An embodiment of the present invention proposes that security and non-security scenarios share the same login block. $ Means that when transitioning from one situation to another by the monitoring mode, the system monitoring will need to store the content of the first situation and generate (or restore) a content in the second situation. Passing parameters becomes an easy task: once the s bit is changed by system monitoring, any data contained in one login in the first scenario will be available in the same login in the second scenario. However, in addition to a limited number of logins dedicated to passing parameters, strict control, when passing from security to non-security status, his logins need to be cleared to avoid leaking any security information. Ensured by the monitoring core. It requires all other needs. It is also possible to deploy a hardware mechanism or a new instruction to clear the login directly when transitioning from a secure to a non-secure state. Another proposed solution involves repeating all (or most) of the existing login blocks, and therefore having two login blocks with a knife on the entity between security and non-security states. This solution mainly has the advantage of clearly separating the security and non-security data contained in the login. Fast content transitions are also allowed between security and non-security states. However, the disadvantage is that it is difficult to pass parameters through the login, unless we generate some specialized instructions to allow the security context to access non-secure logins. Figure 22 illustrates the available logins based on the processor mode. Note that processor status has no effect on this topic. "Yj · Existing Solution" in Exceptional Security The present invention proposes to keep the same interrupt pins, i.e., IRQ and FIQ, when in the existing core. Regarding Exception Trap Mask register (see below for details) ’should be flexible enough for any system to deploy and handle different types of interrupts. VIC Enhancement The present invention enhances V1 c (Vectored Interrupt Controller) by the following methods: VIC may contain a security information bit associated with each vector address. This bit can only be designed by monitoring or security permission mode. It indicates whether the interruption considered should be considered security and therefore should be handled in security. The present invention also adds two new vector address registrations, one for all security interrupts that occur in a non-security state, and the other for all non-security interrupts that occur in a security state 41 200422849. The S-bit information contained in CP15 is made available to the VIC as a new VIC input. The following table outlines some different possible processes, which are based on the status of the interrupt introduced (safety or non-safety, indicated by the S bit associated with each interrupt line) and the status of the core (in VIC, CP15 = S input S bit of the signal).

42 200422849 量。因此它呈現給核心 包含在向量位址登錄 之位址,又該登錄專屬 於所有發生在安全性 情境之非安全性中 斷。核心(仍在安全性 情境)之後發展至該位 址,該處它應發現一 SMI指令,以轉換至非 安全性情境。一旦在非 安全性情境,它就能存 取正確的ISR。 斷線之核心非安全性位 址。該核心僅需要在該位 址發展,又該位址應發現 相關的非安全性ISR。 異常管理設定 為改進Carbon彈性,一新的登錄「異常捕捉遮罩」將 被加入CP 1 5内。該登錄包含下列位元: 位元0: Undef異常(非安全性狀態) 位元1: SWI異常(非安全性狀態) 位元 2: Prefetch abort異常(非安全性狀態) 位元 3: Data abort異常(非安全性狀態) 位元4: IRQ異常(非安全性狀態) 位元5: FIQ異常(非安全性狀態) 位元6: SMI異常(非安全性/安全性狀態s) 位元16: Undef異常(安全性狀態) 43 200422849 位元17: SWI異常(安全性狀態) 位元1 8: Prefetch abort異常(安全性狀態) 位元19: Data abort異常(安全性狀態) 位元20: IRQ異常(安全性狀態) 位元2 1 : FIQ異常(安全性狀態)42 200422849 volume. Therefore it presents to the kernel the address contained in the vector address registration, which in turn is exclusive to all non-security interrupts that occur in the security context. The core (still in the security context) develops to that address, where it should find an SMI instruction to transition to a non-security context. Once in a non-safety context, it can access the correct ISR. Disconnected core non-security address. The core only needs to develop at that address, and the address should discover the relevant non-security ISR. Anomaly management settings To improve the flexibility of Carbon, a new registration “Anomaly Capture Mask” will be added to CP 1 5. This entry contains the following bits: Bit 0: Undef exception (non-security state) Bit 1: SWI exception (non-security state) Bit 2: Prefetch abort exception (non-security state) Bit 3: Data abort Exception (non-safe status) Bit 4: IRQ exception (non-safe status) Bit 5: FIQ exception (non-safe status) Bit 6: SMI exception (non-safe / safe status s) Bit 16 : Undef exception (security state) 43 200422849 bit 17: SWI exception (security state) bit 1 8: Prefetch abort exception (security state) bit 19: Data abort exception (security state) bit 20: IRQ exception (security status) Bit 2 1: FIQ exception (security status)

Reset(重設)異常在登錄中不總是具有對應的位元β Reset總是使核心藉由它專屬的向量進入安全性監督模式。 如果一位元設置了,所對應的異常使核心進入監控模 式。否則,在其發生的情境中在它所對應的管理器處理該 異常。 該登錄只可見於監控模式中。在任何其他模式中嘗試 存取它的任何指令都會被忽略。 該登錄應該被初始化為一系統專屬值,依據該系統θ 否支援一監控。該功能能由VIC所控制。 異當向晉_ 分別有安全性和非安全性情境,所以也需要分別的安 全性以及非安全性異常向量表。 此外,如果監控也能夠捕捉一些異常,吾人也需要專 屬於監控的一第三異常向量表。 下表概述三種不同的異常向量表: 在非安全性記憶體中: 44 200422849 位址 異常 模式 自動存取的時機 ΟχΟΟ 鶴 麵 0x04 Undef Undef 在核心處於非安全性狀態和異常 捕捉遮罩登錄時,所執行之未定 義指令[Non-secure Undef] = 0 0x08 SWI Supervisor (監督) 在核心處於非安全性狀態和異常 捕捉遮罩登錄時,所執行之SWI 指令[Non-secure SWI] = 0 0x0c Prefetch Abort Abort (中止) 在核心處於非安全性狀態和異常 捕捉遮罩登錄時,所執行之中止 指令[Non-secure Pabort]==0 0x10 Data Abort Abort 在核心處於非安全性狀態和異常 捕捉遮罩登錄時,所執行之中止 資料[Non-secure DAbort] = 0 0x14 保留 0x18 IRQ IRQ 在核心處於非安全性狀態和異常 捕捉遮罩登錄時,所設定(assert) 的 IRQ 腳位(pin)[Non-secure IRQ] = 0 Ox 1 c FIQ FIQ 在核心處於非安全性狀態和異常 捕捉遮罩登錄時,所設定(assert) 的 FIQ 腳位(pin)[Non-secure FIQ]=〇The Reset (reset) exception does not always have a corresponding bit in the registration. Β Reset always causes the core to enter the security supervision mode through its exclusive vector. If a bit is set, the corresponding exception causes the core to enter the monitoring mode. Otherwise, it handles the exception in its corresponding manager in the context in which it occurred. This login is only visible in monitoring mode. Any instruction attempting to access it in any other mode is ignored. The registration should be initialized to a system-specific value, depending on whether the system θ supports a monitoring. This function can be controlled by VIC. Differentiating _ has security and non-safety scenarios, so separate security and non-safety exception vector tables are also needed. In addition, if the monitoring can also catch some anomalies, we also need a third abnormal vector table dedicated to monitoring. The following table outlines three different exception vector tables: In non-safe memory: 44 200422849 Timing of automatic access to the address exception mode ΟχΟΟ Crane face 0x04 Undef Undef When the core is in an unsafe state and the exception capture mask is registered, Undefined instruction executed [Non-secure Undef] = 0 0x08 SWI Supervisor (Supervisory) When the core is in a non-secure state and the exception capture mask is logged in, the SWI instruction executed [Non-secure SWI] = 0 0x0c Prefetch Abort Abort (Abort) The abort instruction executed when the core is in a non-secure state and the exception capture mask is logged in [Non-secure Pabort] == 0 0x10 Data Abort Abort is in a non-secure state and the exception capture mask is in the core At the time of registration, the execution suspension data [Non-secure DAbort] = 0 0x14 Reserved 0x18 IRQ IRQ When the core is in a non-secure state and the exception capture mask is registered, the set IRQ pin (ass) [Non -secure IRQ] = 0 Ox 1 c FIQ FIQ The FIQ pin set (assert) when the core is in a non-safe state and the exception capture mask is registered ( pin) [Non-secure FIQ] = 〇

45 200422849 在安全性記憶體中: 位址 異常 模式 自動存取的時機 0x00 Reset* Supervisor (監督) 重設設定的腳位 0x04 Undef Undef 在核心處於安全性狀態和異常捕 捉遮罩登錄時,所執行之未定義 指令[Secure Undef] = 0 0x08 SWI Supervisor (監督) 在核心處於安全性狀態和異常捕 捉遮罩登錄時,所執行之SWI指 令[Secure SWI] = 0 0x0c Prefetch Abort Abort (中止) 在核心處於安全性狀態和異常捕 捉遮罩登錄時,所執行之中止指 令[Secure Pabort] = 0 0x10 Data Abort Abort 在核心處於安全性狀態和異常捕 捉遮罩登錄時,所執行之中止資 料[Secure DAbort] = 0 0x14 保留 0x18 IRQ IRQ 在核心處於安全性狀態和異常捕 捉遮罩登錄時,所設定(assert)的 IRQ 腳位(pin)[Secure IRQ] = 0 Ox 1 c FIQ FIQ 在核心處於安全性狀態和異常捕 捉遮罩登錄時,所設定(assert)的 FIQ 腳位(pin)[Secure FIQ] = 0 46 200422849 在監控記憶體中(平面映射flat mapping): 位址 異常 模式 自動存取的時機 0x00 - _ - 0x04 Undef Monitor(監 控) 在核心處於安全性狀態和異常 捕捉遮罩登錄時,所執行之未定 義指令[Secure Undef] = i 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所執行之未 定義指令[Non-Secure UndefJ = l 0x08 SWI Monitor(監 控) 在核心處於安全性狀態和異常 捕捉遮罩登錄時,所執行之SWI 指令[Secure SWI] = 1 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所執行之 SWI 指令[Non-Secure SWI] = 1 0x0c Prefetch Monitor(監 在核心處於安全性狀態和異常 Abort 控) 捕捉遮罩登錄時,所執行之中止 指令[Secure Pabort] = l 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所執行之中 止指令[Non-Secure Pabort] = l 0x10 Data Monitor(監 在核心處於安全性狀態和異常 Abort 控) 捕捉遮罩登錄時,所執行之中止 47 200422849 資料[Secure DAbort] = l 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所執行之中 止資料[Non-Secure DAbort] = l 0x14 SMI Monitor(監 控) 0x18 IRQ Monitor(監 控) 在核心處於安全性狀態和異常 捕捉遮罩登錄時,所設定(assert) 的 IRQ 腳位(pin)[SecureIRQ] = 0 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所設定 (assert) 的 IRQ 腳 位 (pin)[Non-Secure IRQ] = 0 Ox 1 c FIQ Monitor (監 控) 在核心處於安全性狀態和異常 捕捉遮罩登錄時,所設定(assert) 的 FIQ 腳位(pin) [Secure FIQ] = 0 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所設定 (assert)的 FIQ 腳位(pin) [Non-Secure FIQ]=045 200422849 In the security memory: The timing of automatic access to the address exception mode 0x00 Reset * Supervisor resets the set pin 0x04 Undef Undef is executed when the core is in the security state and the exception trap mask is registered. Undefined instruction [Secure Undef] = 0 0x08 SWI Supervisor (Supervision) When the core is in a secure state and the exception capture mask is logged in, the SWI instruction [Secure SWI] = 0 0x0c Prefetch Abort Abort (Abort) is in the core Aborted instruction executed during security status and exception capture mask registration [Secure Pabort] = 0 0x10 Data Abort Abort Aborted data executed when core is in security status and exception capture mask registration [Secure DAbort] = 0 0x14 Reserved 0x18 IRQ IRQ When the core is in the security state and the exception capture mask is registered, the set IRQ pin [Secure IRQ] = 0 Ox 1 c FIQ FIQ is in the core security state When registering with the exception capture mask, the set FIQ pin [Secure FIQ] = 0 46 200422849 In the body (flat mapping): The timing of automatic access to the address exception mode 0x00-_-0x04 Undef Monitor (monitoring) When the core is in a security state and the exception capture mask is registered, the undefined instruction [Secure Undef] = i Undefined instruction executed when the core is in a non-secure state and the exception capture mask is logged in [Non-Secure UndefJ = l 0x08 SWI Monitor (Monitoring) The core is in a secure state and the exception capture mask is logged in When executing the SWI instruction [Secure SWI] = 1 When the core is in a non-secure state and the exception capture mask is logged in, the executed SWI instruction [Non-Secure SWI] = 1 0x0c Prefetch Monitor Sexual status and abnormal Abort control) abort instruction executed during capture mask login [Secure Pabort] = l abort instruction executed when core is in a non-secure state and abnormal capture mask login [Non-Secure Pabort] = l 0x10 Data Monitor (Monitoring the core is in a security state and abnormal Abort control) The execution of capture mask login was aborted 47 200422849 [Secure DAbort] = l When the core is in a non-secure state and the exception capture mask is logged in, the execution suspension data [Non-Secure DAbort] = l 0x14 SMI Monitor (monitoring) 0x18 IRQ Monitor (monitoring) Set IRQ pin (assert) [SecureIRQ] = 0 when the security status and exception capture mask are registered. IRQ set (assert) when the core is in a non-safe state and the exception capture mask is registered. Pin [Non-Secure IRQ] = 0 Ox 1 c FIQ Monitor (Monitor) When the core is in a safe state and the exception capture mask is registered, the FIQ pin set (assert) [Secure FIQ ] = 0 When the core is in a non-secure state and the exception capture mask is registered, the set FIQ pin (ass) [Non-Secure FIQ] = 0

在監控模式中,可以有兩份異常向量,因此每一異常 都將有二個不同的相關向量: 一供出現於非安全性狀態的異常 48 200422849 偵測 擇之 存第 容。 括私 狀態 換為 一供出現於安全性狀態的異常 如此可以降低異常等待時間,因為監控核心不再需要 異常發生處的初始狀態。 請注意,該特徵僅限於一些異常,SMI是最合適的選 一,用以改進·在安全性和非安全性狀態之間的轉換。 情境間的轉換 當在狀態間轉換時,監控模式必須在它的監控堆疊儲 一種狀態的内容,和從該監控堆疊還原第二個狀態内 監控模式因此需要存取任何其他模式之任何登錄,包 有登錄(rl4、SPSR…)。 為了處理它’本發明所提出的解決方案包含在安全性 中’給予任何權限模式藉由純粹寫入CPSR,直接轉 監控模式的權限。 在情境之間轉換之此類系統執行如下·· *進入監控模式 •設定s位元 *轉換至監督模式-儲存監控登錄於MONITOR(監控) 堆疊(當然,監督模式需要存取該監控堆疊指標, 但這是容易辦到的,例如藉由使用一普通登錄(R0 至 R8)) *轉換至System(系統)模式-儲存登錄(如同使用者 49 200422849 模式)於監控堆疊 ♦ IRQ登錄於監控堆疊 鲁一旦所有模式的所有私有登錄都儲存了,以一簡單 MSR指令回到監控模式(只是寫入監控值於CPSR 模式攔位) 另一些解決方案也被考慮: 鲁增加一新指令,其允許監控在自己的堆疊儲存其他 模式的私有登錄。 *以一新的「狀態」部署監控,即,能夠在監控狀態 (具有該些適當存取權利)和在IRQ(或任何其他的) 模式,看見IRQ(或任何其他的)私有登錄。 基本歷程(請參照第23圖) 1.執行緒1在非安全性情境中(S位元==〇)執行,該執 行緒需要執行一安全性功能=>SMI指令。 2 · S ΜI指令使核心藉由一非安全性S ΜI向量進入監 控模式。使用LR一mon和SPSR一mon來儲存非安全 性模式之PC以及CPSR。在該階段落S位元保持 不變,雖然該系統現下在安全性狀態中。監控核心 儲存非安全性内容於監控中。其亦發送LR_mon和 SPSR一mon〇此時監控核心藉由寫入CP15登錄改變 S位元。在該實施例中,監控核心保持追蹤,一「安 全性執行緒1」在該安全性情境中開始(例如,藉 50 200422849 由更新一執行緒ID表)。最後,它退出監控模式並 轉換至安全性監督模式。 3 ·安全性核心發送應用至正確的安全性記憶體位 置,而後轉換至使用者模式(例如,使用一 M〇vS)。 4. 在安全性使用者模式中執行安全性功能。一旦完 成,藉由執行適當的SWI呼叫「退出(exit)」功能。 5. SWI指令使核心藉由一專屬SWI向量進入安全性 svc模式,依序執行「退出」功能。該「退出」功 能以一 "SMI"結束,以轉換回監控模式。 6. SMI指令使核心藉由專屬的安全性SMI向量進入 監控模式。利用LR一mon和SPSR —mon來健存安全 性svc模式的PC和CPSR。S位元保持不變(例如 安全性狀態)。監控核心登錄該安全性執行緒1完 成的事實。之後,其藉由寫入CP15登錄,改變S 位元,以回到非安全性狀態。監控核心自監控堆疊 還原非安全性内容。其亦載入預先在第2步驟所儲 存的 LR — mon 和 CPSR一mon。最後,以一 SUBS(以 該指令,在非安全性使用者模式中,將使該核心返 回)退出監控模式。 7 ·執行緒1能夠正常重新繼續。 參照第6圖,在安全性和非安全性網域之間,共用所 有登錄都。在監控模式中,轉換發生在從安全性和非安全 性網域之一轉換登錄至另一者。其涉及儲存在一網域中存 51 200422849 在的一登錄之 錄(或在該登截 間的轉換」章 吾人希望 行該轉換所花 轉換時,使共 持不變。例如 換。舉例來說 境中不需要。 換至安全性網 使登錄失 用該些登錄的 中寫入控制位 選擇性地 元至一 CP15 : 所寫入的位元 失效,但是, FIQ登錄 錄失效而快速 回應異常,監 失效的登錄中 他網域之新資 可以安排 模式中的所有 狀態,和在另一娘I A 1办 網域中寫入新的狀態至該餐 艮還原先前儲存的妝能 什的狀態),亦如上文中「 節所述者β τ 间s 該轉換所花費的時間。為了降低勃 費的時間’當在安全性和非安全性網域之間 用的登錄失效,以使存 1兩卄%兵肀的資料值保 ,考慮從非安全拇娘j p本丨—人t f生網域到安全性網域的一轉 ,假設顯示在第6圖之FIQ登錄在安全性情 因此’使那些登錄失效,且不需要把他們轉 域,且不需要儲存那些登錄的内容。 效可以藉由幾個方法诖士、 π 口万法達成。一種方法是把使 模式鎖住。在指示失效模式的一 CP15登錦 元以達成。 可以再人以心令為基礎,ϋ由寫入控制位 a錄中使對登錄的存取失效。在CP 1 5登錄 只與該登錄相關,而非模式,所以模式並未 對该模式的登錄所做的存取則失效。 儲存與快速中斷相關的資料。如果該FIQ登 中斷發生’處理器發出異常信號至監控。為 控模式可操作以儲存與一網域相關和在上述 儲存的任何資料值,並載入該登錄相關於其 料值,而後啟用該FIQ模式登錄。 處理器’以使當處理器轉換網域時,在監控 區塊登錄都失效。選擇性地,當轉換網域以In monitoring mode, there can be two exception vectors, so each anomaly will have two different correlation vectors: One for anomalies that appear in a non-safe state 48 200422849 Detect. The private state is changed to an exception for the security state. This can reduce the waiting time for the exception, because the monitoring core no longer needs the initial state where the exception occurred. Please note that this feature is limited to some exceptions, and SMI is the most suitable choice to improve the transition between security and non-security states. Transition between situations When transitioning between states, the monitoring mode must store the contents of one state in its monitoring stack, and restore the monitoring mode in the second state from the monitoring stack. Therefore, it needs to access any logins, There are logins (rl4, SPSR ...). In order to deal with it, the solution proposed by the present invention is included in security 'to give any permission mode to the authority of the monitoring mode directly by simply writing to the CPSR. This type of system switching between scenarios is performed as follows: * Entering the monitoring mode • Setting the s bit * Switching to the monitoring mode-Storage monitoring is logged into the MONITOR stack (of course, the monitoring mode requires access to the monitoring stack indicator, But this is easy to do, for example, by using a normal login (R0 to R8)) * Switch to System mode-store login (as user 49 200422849 mode) in the monitoring stack ♦ IRQ login in the monitoring stack Once all the private logins of all modes are stored, return to the monitoring mode with a simple MSR instruction (just write the monitoring value to the CPSR mode stop). Other solutions are also considered: Lu added a new instruction that allows monitoring in Your own stack stores private logins for other modes. * Deploy monitoring with a new "state", that is, see the IRQ (or any other) private login in the monitoring state (with those appropriate access rights) and in IRQ (or any other) mode. Basic process (please refer to Figure 23) 1. Thread 1 is executed in a non-safety situation (S bit == 〇). This thread needs to execute a security function => SMI instruction. 2 · The S MI instruction causes the core to enter monitoring mode through a non-safe S MI vector. LR_mon and SPSR_mon are used to store the PC and CPSR in non-security mode. The S bit remains unchanged at this stage, although the system is now in a security state. Monitoring core Stores non-security content in monitoring. It also sends LR_mon and SPSR_mon. At this time, the monitoring core changes the S bit by writing to the CP15 register. In this embodiment, the monitoring core keeps track and a "safe thread 1" starts in the security context (for example, by updating a thread ID table by 50 200422849). Finally, it exits monitoring mode and transitions to security monitoring mode. 3 • The security core sends the application to the correct security memory location and then switches to user mode (for example, using a MovS). 4. Perform security functions in security consumer mode. Once this is done, call the "exit" function by performing the appropriate SWI call. 5. The SWI instruction enables the core to enter the security svc mode through a dedicated SWI vector, and sequentially execute the "exit" function. The "exit" function ends with a " SMI " to switch back to the monitoring mode. 6. The SMI instruction enables the core to enter the monitoring mode through the dedicated security SMI vector. Use LR_mon and SPSR_mon to store PC and CPSR in security svc mode. The S bit remains unchanged (for example, security status). The monitoring core logs into the fact that this security thread 1 is completed. Afterwards, it logs in by writing to CP15 and changes the S bit to return to the non-secure state. The monitoring core self-monitors the stack to restore non-security content. It also loads the LR_mon and CPSR_mon previously stored in step 2. Finally, exit the monitoring mode with a SUBS (with this instruction, the core will be returned in non-secure user mode). 7 Thread 1 can resume normally. Referring to Figure 6, all logins are shared between secure and non-secure domains. In monitoring mode, the transition occurs when transitioning from one of the secure and non-secure domains to the other. It involves storing a registered record (or conversion between the registrations) stored in a domain name 51 200422849. Chapter I hope that the conversion used in the conversion will be held unchanged. For example, change. For example It is not required in the environment. Switch to the safety net to make the login misuse. The write control bits of these logins are selectively set to a CP15: the written bits are invalid, but the FIQ login is invalid and the response is abnormal. In the invalid registration, the new resources of other domains can arrange all the states in the mode, and write the new state in the domain of another IA 1 office to restore the state of the previously saved makeup), also As described in the section above, the time it takes for the conversion between β τ and s. In order to reduce the cost of time, when the login used between the secure and non-secure domains is invalidated, so as to save 1% to 2% The data protection of 保, consider a turn from the non-secure thumb jp 丨 —— human tf birth domain to the security domain, assuming that the FIQ login shown in Figure 6 is in the security profile and therefore 'disable those logins, and No need to transfer them to the domain, There is no need to store those registered contents. The effect can be achieved by several methods, such as the warrior and the pi port. One method is to lock the mode. A CP15 is used to indicate the failure mode. Based on the order, the access to the login is invalidated by writing to the control bit a. The login in CP 1 5 is only related to the login, not the mode, so the mode does not save the login of the mode. It will be invalid. Store the data related to the fast interruption. If the FIQ logout interruption occurs, the processor sends an abnormal signal to the monitor. The control mode is operable to store any data value related to a domain and stored in the above, and load it. Entering the login is related to its value, and then enabling the FIQ mode login. Processor 'so that when the processor changes the domain, the login in the monitoring block is invalid. Optionally, when the domain is converted to

52 200422849 及其他程式設計人 共用的登錄中的一 員選擇失效時, 些預設者來選擇 登錄的失效可以利用在 ▲控模式中轉換網域時,可以安排處理器,以4 一或多咨數共用登錄失效’以及-或多數其他共用登錄將、 們的資枓在離開—網域時儲#,和將新資料裁入另一海 域。該新資料可以是空值資料。52 200422849 When one of the logins shared by other programmers chooses to fail, some defaulters can choose to disable the login. When the domain is switched in ▲ control mode, the processor can be arranged to use one or more 'Shared login invalidation' and-or most other shared logins, will store # when leaving the -domain, and send new data to another sea area. The new data can be null data.

第24圖圖示向一傳統綱核心中增加—安全性處理 選擇的概念。肖圖圖示含有安全性處理選擇的處理器如何 能夠藉由向一既有核心增加安全性處理選擇而形成°。如果 該系統想要具有與一既有作業系統之反向相容性,直覺上 會認為該既有系統係操作於處理器的傳統非安全性部分。 然而,如該圖之下半部所示以及下文將進一步詳論者,事 實上,一既有系統係操作於系統的安全性部分。Figure 24 illustrates adding to the core of a traditional program-the concept of security processing options. The diagram illustrates how a processor with security processing options can be formed by adding security processing options to an existing core. If the system wanted to be backward compatible with an existing operating system, it would intuitively be assumed that the existing system was operating on the traditional non-secure part of the processor. However, as shown in the lower half of the figure and discussed further below, in fact, an existing system is operating in the security part of the system.

第25圖圖示具有一安全性和非安全性網域之一處理 器,並圖示重設,且與第2圖類似。第2圖圖示一處理器, 適用於執行一安全性敏感型態之操作,其以一安全性〇s 系統在安全性網域中控制處理,和以一非安全性〇S系統 在#安全性網域中控制處理。然而,該處理器亦反向相容 於一傳統舊版作業系統,及因此該處理器可以使用一舊版 作業系統,使用一非安全性敏感的方法操作。 如第2 5圖所示’在安全性網域中的重設,以及此處具 有S位元或安全性狀態旗標設定之無論什麼類型的操作所 發生的重設。在一非安全性敏感類型操作情況下,重設發 生在安全性網域,並之後繼續在安全性網域中處理。然而 53 200422849 舊版作業系統控制處理不知道系統的安全性態樣。 如第25圖所示,執行重設以在安全性監督模式下,設 置開始處理處的位址,而不論是否處理是安全性敏感或是 事實上非安全性敏感。一旦執行了重設,則在之後執行一 開機或重開機中所出現的額外任務。該開機機制詳述如下。 開機機制必須顧及下列特徵: • 保持與舊版作業系統的相容性。 • 在最權限模式中開機以確保系統的安全性。 因此。Carbon核心將在安全性監督模式中開機。 不同的系統將是: _ 對於想要執行舊版作業系統的系統而言,不考慮該 S位元,而核心將僅知道其在監督模式中開機。 • 對於想要使用Carbon特徵的系統,核心在安全性 權限模式中開機,又該安全性權限模式應能設定在 系統中的所有安全性防護(有可能在交換至監控模 式之後) 上述開機機制之細節而論,本發明實施例的處理器重 設處理器,以在安全性監督模式中開始在所有情況下的處 理。在一非安全性敏感類型操作的情況下,雖然安全性在 此處不是問題,因為已設置了 s位元(儘管作業系統不知 道),實際上作業系統是在安全性網域中操作。它有個優 54 200422849 點,無法自非安全性網域存取的記憶體部分,在該情況下 是可存取的° 在所有情況下’在安全性監督模式中開機亦有利於安 全性敏感系統’因為它有助於確保系統的安全性。在安全 性敏感系統中’在開機時提供位址給在安全性監督模式中 儲存開機程式之處,以及因此允許系統設定為一安全性系 統,和轉換為監控模式。一般而言,自安全性監督模气轉 換為監控模式疋允許的,和在一適當時間啟用安全性系 統’以開始在監控模式中處理,以初始化監控模式架構、 _ 第26圖圖示’第1步驟,由一非安全性作業系統執〜 之一非安全性執行緒NSA。第2步驟,非安全性執行= NS A藉由在第3步驟執行一監控模式程式的監控模式,〃 叫安全性網域。監控模式程式改變S位元以轉換網域,和 在第5步驟移動到安全性作業系統之前,執行任何必要的 内容儲存和内容還原。而後在第6步驟受一中斷· ^ w lrq支配 之剛,執行對應的安全性執行緒S A。在第7步驟,中斷處 理硬體觸發返回監控模式,此處決定是否由安全性作業系 統或非安全性作業系統所處理。在這種情況下,在第9步 驟開始’由非安全性作業系統處理該中斷。 ’ 當由非安全性作業系統處理該中斷時,在第 -r ^ ^ 步驟一 常執行緒轉換操作之前,在非安全性作業系統 改執仃緒NSA已作為現有任務重新繼續。該執行緒轉換 I以是一時間事件或類似者的結果。在第12步驟中、,由非 安全性作業系統在非安全性網域中執行一不同的執行緒 55 200422849 NSB,以及此時在第14 7鄉藉由監控網域/程式 旗標,使 為一中斷 成執行或 因為一安 程式使用 ,又該軟 在由非安 始的執行 斷的該些 作業系統 式檢查軟 全性執行 執行時中 步驟,在 全性作業 所設定之 新開始該 網域進行呼叫。在第7步 輝 監控程式儲存了一 用一些其他的機制,用以指;— 知不t全性作業系統因 而在上一次暫停,而非因兔 U馬一安全性執行緒已完 因為正常的請求而離開, 肉就延麼放下。因此, 全性作業系統被一中斷暫俸 1甘怜,在第15步驟,監控 一軟體仿製的中斷,以再+、仓 衣J | 乂丹-人進入安全性作業系統 體仿製的中斷設定了一返回鈾 口轨行緒ID。(例如, 全性執行緒NSB請求時,由农入以a池3 ^ 田女全性作業系統所開 緒之識別符,其他的參數眘姐+ &、 令聚貪枓亦然)。軟體仿製中 參數可以作為一登錄值傳遞。Figure 25 shows a processor with one of the secure and non-secure domains, and the reset is similar to Figure 2. Figure 2 illustrates a processor suitable for performing a security-sensitive operation, which uses a security 0s system to control processing in the security domain, and a non-security 0S system in #security Control processing in the sexual domain. However, the processor is also backward compatible with a traditional legacy operating system, and therefore the processor can operate with a legacy operating system using a non-security sensitive method. As shown in Figure 25, the reset in the security domain and the reset that occurs regardless of the type of operation that has the S bit or security status flag set here. In the case of a non-security-sensitive type of operation, resets occur in the security domain, and then continue processing in the security domain. However, the control process of the old operating system 53 200422849 does not know the security aspect of the system. As shown in Figure 25, a reset is performed to set the address of the processing start in the security supervision mode, regardless of whether the processing is security sensitive or indeed non-security sensitive. Once a reset has been performed, additional tasks that occur during a power-on or power-on are performed thereafter. The boot mechanism is detailed below. The boot mechanism must take into account the following characteristics: • Maintain compatibility with older operating systems. • Power on in the most privileged mode to ensure system security. therefore. Carbon Core will boot in a security oversight mode. The different systems will be: _ For systems that want to run an older operating system, the S bit is not considered, and the kernel will only know that it is powered on in supervisor mode. • For systems that want to use Carbon features, the core boots in the security permission mode, and the security permission mode should be able to set all security protections in the system (possibly after switching to monitoring mode). In detail, the processor of the embodiment of the present invention resets the processor to start processing in all cases in the security supervision mode. In the case of a non-security-sensitive type of operation, although security is not an issue here because the s-bit is set (although the operating system is unknown), the operating system is actually operating in the security domain. It has an excellent 54 200422849 point, a portion of memory that cannot be accessed from non-secure domains, in which case it is accessible ° In all cases, 'booting in security supervision mode is also conducive to security sensitivity System 'because it helps ensure system security. In a security sensitive system, the address is provided at boot time where the boot program is stored in the security supervision mode, and thus allows the system to be set as a security system and switched to a monitoring mode. In general, the self-safety monitoring model gas is converted to the monitoring mode 疋 allowed, and the security system is enabled at an appropriate time to start processing in the monitoring mode to initialize the monitoring mode architecture, _ Figure 26 1 step, performed by a non-safety operating system ~ one of the non-safety threads NSA. Step 2, non-secure execution = NS A executes a monitoring mode of the monitoring mode program in step 3, which is called a security domain. The monitoring mode program changes the S bit to change the domain, and performs any necessary content storage and content restoration before moving to the security operating system in step 5. Then in step 6, subject to an interruption ^ w lrq, execute the corresponding security thread SA. In step 7, the interrupt processing hardware triggers a return to the monitoring mode, where it is determined whether to be processed by a secure operating system or a non-secure operating system. In this case, the interrupt is handled by the non-secure operating system beginning at step 9. ' ’When the interrupt is handled by a non-safety operating system, before the -r ^ ^ Step 1 regular thread switching operation, the NSA has been resumed as an existing task in the non-safety operating system. The thread transition I is the result of a time event or the like. In step 12, a different thread is executed by the non-secure operating system in the non-secure network domain. 55 200422849 NSB, and at this time, the domain / program flag is monitored at Once interrupted into execution or because of a security program, the software should perform steps in the operating system-type inspection software when the non-annual execution is interrupted, and then start the domain at the new operation set. Make a call. In step 7, the monitor program stores some other mechanisms to refer to;-it is known that the holistic operating system was suspended for the last time, not because the security thread has been completed because of normal operation. When asked to leave, the meat was put off. Therefore, the entire operating system was temporarily interrupted by an interruption. In step 15, a software imitation interrupt was monitored to set the interruption of the imitation of the security operation system. As soon as the uranium orbital thread ID is returned. (For example, when the NSB request is sent to the general thread, the identifier entered by the farmer will be a pool 3 ^ Tian Nu comprehensive operation system, and other parameters such as Shen + + and Ling Ju are also the same). In software imitation, the parameter can be passed as a registered value.

在第15步驟,該仿製的軟體中斷觸發安全性 的-返回中斷管理器例式。_返回中斷管理器例 體仿製中斷的返回執行緒ID,以決定是否符合安 緒SA❸ID ’其在上一次安全性作業系統暫停前 斷。在這種情況下,沒有符合的,並因此在第16 已經健存安全性執行緒SA的内容以後,觸發安 系統,以將執行緒轉換為如非安全性執行緒NSB 返回執行緒。而後能夠在被請求時,由中斷處重 安全性執行緒SA。 第27圖圖不在第26圖所示之行為類型的另一示例。 該示例中,當程序在非安全性作業系統的控制中進行以處 理該IRQ時,沒有非安全性執行緒轉換,㈣此當由安全 性作業系統的返回中斷管理器收到軟體仿製中斷時,其決 56 200422849 疋不需要任何執行緒轉換和在第i 5纟驟僅是重新繼 安全性執行緒S A · 24 第28圓是一流程圖,圖示由返回執行緒管理器所執行 的處理。在第4002步驟啟動返回執行緒管理器。在第邨= 步驟,當暫停安全性作業系統時,對敕體仿製中斷 執行緒識料進行檢查和與現有執行安全性執行緒比較。 如果該些符合,則程序進行至第4006步驟當中安全性 行緒重新繼續。如果在第4004步驟的比較未符合,則程 進行至第4008步驟,其中在第4010步驟轉換至新的 :執行緒之前’儲存舊的安全性執行緒的内容,(為 新繼續)。新執行緒已經在進行中,所以第4〇 新繼續。 少鄉重 使任::換?示之處理,藉此一受控安全性作業系統可以 性作ΠΓ主控非安全性作業系統執行。該主控非安全 業系、,先可以是不具月通訊機制的一 協調女沾h > 舊版作業系統,並 調匕的動作以配合其他作業系統 器操作4第29圏之一初始進入點,非安==主控 行-非安全性執行緒NSA。該非安全性執 、、統執 ^ . 執行緒N S A呼叫一 性執行緒,該安全性執行緒欲由 一教舻击此, 女全性作業系統利用 進人在 MI呼叫)執行。在第2步驟,該隨呼叫 中控模式中執行的一監控程式1以在第4步驟 行任何需要:二入安全性作業系統之前,該監控程式執 、 谷儲存和轉換。此時安全% A t 4 對應的安全性執行緒SA。該安全性執=性作業系統起始 執仃緒可能藉由監控模 57 200422849 式將控制退回至非安全性作業系,统,例如由於—定時事件 或類似者。在第9步驟,當非安全性執行緒隐再度將控 制再次傳遞至安全性作業系統時’它藉由再度發出原始: 體中斷以達成。軟體包括辨識NSA的非安全性執行緒比、 欲:用之目標安全性執行緒ID的安全性執行緒ι〇、,即辨 識安^性執行緒SA的執行緒ID,以及其他的參數。 當在第9步驟所產生的啤叫由監控程式所傳遞,和在 =2步驟藉由安全性作業系統在安全性網域中接收時,能 ::該非安全性執行,緒ID,以決定是否已被非安全性作 業f轉換了内容。也可以檢查目標執行緒的安全性執行 加叔、、了解女全性作業系統下的正確的執行緒是否已重 新 或以一新的執行緒起動。在第29圖的示例中,在安 全性網域中不需要由安全性作業系統進行任何執 換。 第广圖與第29圖類似’除了第”驟執行緒的轉 換㈣安全性作業系統的控制下,在非安全性網域中發生 二乍業1此’在第11步驟中,使軟體,斷呼叫橫跨至安全 統的’是一不同的非安全性執行緒励。在第14 ::全性作業系統確認非安全性執行緒腦的不同執 :二此執行涉及儲存安全性執行緒SA的内容和 开〇 I文全性執行緒SB的任務轉換。 31圖是一流程圖,圖示當接收-軟體中斷以作為-ϋ重新繼續安全性作業系統的執行緒之呼叫時,由安 全性作業系統所執行的處理。在第4012步驟中,接收了該 58 200422849 呼叫。在第4014步驟中,檢查呼叫的參數,以決定他們是 否在安全性作業系統中,與現有啟用的安全性執行緒相符 合。如果符合,則在第 40 1 6步驟重新開始該安全性執行 緒。如果不符合,則程序進行至第4018步驟,其中決定是 否可使用新近請求的執行緒。該新近請求的執行緒可能因 為它是或它需要一特有資源,又該資源已經被在一安全性 作業系統中的一些其他的執行緒所使用,所以無法獲得。 在這種情況下,在第4020步驟中,以一適當訊息傳回非安 全性作業系統,拒絕該呼叫《如果在第401 8步驟決定新執 行緒可用,則程序進行至第4022步驟,其中舊的安全性執 行緒的内容被健存,以供之後可能重新開始之用。在第 4024步驟,如同對安全性作業系統所進行的軟體中斷呼叫 之設定,轉換至新的安全性執行緒。 第32圖圖示一操作,據以進行一優先權倒置,當在具 有多個作業系統之一系統中處理中斷時,由不同的作業系 統處理不同的中斷。 處理以安全性作業系統執行一安全性執行緒 SA開 始。而後由一第一中斷Int 1所中斷。其在監控模式中觸 發監控程式,以決定是否中斷要在安全性網域或非安全性 網域中處理。在這種情況下,該中斷欲在安全性網域處理, 而程序返回到安全性作業系統以及開始中斷Int 1的中斷 處理例式。中途藉由執行Int 1的中斷處理例式,具有較 高優先權的一進一步中斷Int 2被接收。因此,停止Int 1 的中斷管理器和用以在監控模式中決定中斷Int 2在何處 59 200422849 處理之監控程 性作業系統處 和啟始的Int 時,非安全性 暫停的暫停中 可以執行一些 安全性執行緒 務時。 第33圖匿 的問題。當中 根(STUB)中斷 管理器是相對 網域,和在安 該中斷Int 1 域中存根中斷 s己錄’其指示 在安全性 高優先權Int 斷Int 2的中 Int 2的中斷管 存根中斷管理 以及因此將重 器將出現,如 處,據此該呼 式。在這種情況下’中斷Int 2要由非安全 理,並因此把控制傳遞至非安全性作業系统 2之中斷管理器。當中斷Int2的管理器完成 作業系統不具有指示在安全性網域中服務被 斷In…資訊。因此,非安全性作業系統 進一步步驟,例如任務轉換或啟始不同的非 NSB,當仍然未能對原始中斷Int i提供服 !示一技術,據以避免與第32囷的操作相關 斷Int 1發生時,監控程式把它傳遞至一存 管理器啟動處之非安全性網域。該存根中斷 地小且快速藉由監控模式使程序返回安全性 全性網域中觸發中斷Int 1的中斷管理器。 主要在女全性網域中處理,而在非安全性網 管理器的啟動能夠視為一種型態的位置保持 非安全性網域,中斷在安全性網域中暫停。 網域中’中斷Int 1的中斷管理器再次受到 2的支配。在非安全性網域中,仍舊觸發中 斷管理器的執行。然而,在這種情況下,當 理器完成時’非安全性作業系統便擁有指示 器的資料’因為中斷lnt i仍然是未完成的, 新繼續該存根中斷管理器。該存根中斷管理 同它暫停於其進行回到安全性網域的呼叫 叫將再次執行並因此轉換至安全性網域。一 60 200422849 旦回到安全性網域,安全性網域在其中斷處能夠自己再次 開始中斷Int 1的中斷管理器。當中斷Int i的中斷管理器 在安全性網域中完成時,進行回到非安全性網域的呼叫, 以在原來的執行安全性執行緒s A重新繼續前,在非安全 性網域中關閉存根中斷管理器。 第34圖圖示與它們的優先權相關之不同類型中斷,以 及如何處理它們。可以使用純粹安全性網域中斷管理器, 處理尚優先權中斷,確保沒有較高優先權的中斷由非安全 性網域處理。一旦有一中斷具有比後續中斷較高之優先 權,並在非安全性網域中處理,則所有較低優先的中斷若 不是純粹在非安全性網域中處理,就是利用在第3 3圖所示 存根中斷管理器技術,據以使非安全性網域可以持續追蹤 那些中斷,即使它們主要處理在安全性網域中發生者。 如先前所述者,使用監控模式來在安全性網域和非安 全性網域之間執行轉換。在實施例中,在兩不同網域之間 共用登錄,這涉及儲存該些登錄中的狀態到記憶體,而後 自記憶體為終點網域載入這種新狀態至登錄中。對未在兩 網域之間共用的任何登錄而言,不須儲存狀態,因為該些 登錄不會被其他網域所存取,而在該些狀態之間轉換係作 為在安全性和非安全性網域之間轉換的一直接結果(即,在 CP 1 5登錄之一中儲存的s位元的值決定所使用之非共 用登錄)。 "" 當在監控模式中由處理器設定資料控制處理器對記憶 體的存取時,部分狀態需要被轉換。因為在每一網域中有 61 200422849 不同的§己憶體,例如,安全性網域存取安全性記憶醴 存安全性資料,該安全性記憶體不能從非安全性網 取’很明顯地,處理器設定資料將需要在轉換網域時g 如第35圖所示,在CP15登錄34中儲存該處理 定資料’而在一實施例中,該些登錄在網域之間共用 此’當在安全性網域和非安全性網域之間轉換監控 時’現存於CP15登錄34的處理器設定資料需要自 轉出至記憶體,而與終點網域有關的處理器設定資料 載入至CP15登錄34。 因為CP15登錄中的處理器設定資料通常在系統 記憶體的存取有立即的影響,則很明顯地,如果在監 式中操作時由處理器更新了它們,該些設定將立即生 然而’對在監控模式中欲設定處理器設定資料的一靜 疋之監控模式而言,這是不希望發生的。 因此’如第35圖所示,在本發明監控模式一實施 提供特疋的處理器設定資料2〇〇〇 ,它能夠用來覆蓋 登錄34的處理器設定資料34,當處理器在監控模式 作時。如第35圖所示,在它輸入時,藉由多工轉換器 接收儲存在CP15登錄的處理器設定資料和監控模i 處理器設定資料2000,可加以達成。此外,多工轉換 經由路徑2〇15,接收一控制信號,指示是否處理毫 監控模式中操作。#果處理器不是在監控模式" 在CP15登錄34的處理器設定資料被輸出至系統. 理器是在監控模式中操作的情況下,&之,該多_ 以儲 域存 t變。 器設 。因 模式 CP15 需要 中對 控模 效。 態設 例中 CP15 中操 2010 ,專屬 2010 L下在 e,則 L在處 卜換器 62 200422849 2010輸出監控模式專屬處理器設定資料2 〇〇〇,以確保所應 用的處理器设定資料是一致的,當處理器是在監控模式中 操作時。 監控模式專屬處理器設定資料可以寫死(Hard-Coded) 在系統中,從而確保其不能被操縱。然而,亦有可能程式 設計該監控模式專屬處理器設定資料,而不損害安全性, 當在一安全性權限模式中操作時,確保只能由處理器修改 監控模式專屬處理器設定資料。就監控模式專屬處理器設 定資料的設定而言,這允許一些彈性。如果安排該監控模 式專屬處理器設定資料為可程式設計的,則能夠在系統中 的任何適當地方儲存設定資料,如在cpl5登錄34中的一 組個別的登錄3 4中。 通常 模式中為 上述實施 記憶體管 式中時, 至實體記 被安排為 即,將使 器能夠可 址的映射 當處 設定資料 «^疋a控模式專屬處理器設定資料 處理器的操作提供一非常安全的環境。因此,在 例中,該監控模式專屬處理器設定資料可能設定 理單元30為失效的,當該處理器係操作於監控模 據此,使可能被該記憶體管理.單元所應用的虛擬 憶體轉譯失效。在此類狀況了,該處理器將總是 直接發出實體位址,當發出記憶體存取請求時, 用平面映射。其確保在監控模式中操作時,處理 靠地存取記憶體,而不管是否 疋企任何虛擬至實體位 是相配合的。 理器在監控模式中操作時, 现徑模式專屬處理器 通常也允許處理器存取安全性 庄貝枓。其由網域狀 63 200422849 態位元形式的記憶體允許資料設定為佳,在安全性處理器 設定資料中,具有相同值的網域狀態位元會被設定給相同 值的網域狀態位元(’’ s π位元)。因此,不管儲存在CP 1 5登 錄中的網域狀態之實際值為何,該值會被由監控模式專屬 處理器設定資料所設定的網域狀態位元所覆蓋,以確定監 控模式已存取安全性資料。 監控模式專屬處理器設定資料可以設定其他用來控制 對部分記憶體存取的資料。例如,當處理器在監控模式中 操作時,監控模式專屬處理器設定資料可以設定快取3 8 不要用來存取資料。 在上述的實施例中,已經假設所有含有處理器設定資 料的CP 1 5登錄都在網域間被共用。然而,在一選擇性的 實施例中,將一些CP15登錄予以「分塊(banked)」,例如, 有用以儲存處理器設定資料的一特定項目的兩登錄,一登 錄町以在非安全性網域中存取並含有非安全性網域的處理 器設定資料之項目值,和另一登錄在安全性網域可在安全 性網域中存取並含有安全性網域的處理器設定資料之項目 值。 不被分塊的一 CP15登錄是含有"S"位元者,但原則上 如果希望的話,任何其他的CP 1 5登錄都可以被分塊。在 此類實施例中,由監控模式所做的處理器設定資料的轉 換’涉及將任何共用的CP 1 5登錄轉換至記憶體中,現在 該處理器设定資料在在該些共用登錄中,和在該些共用的 cp 1 5登錄中’載入與終點網域有關的處理器設定資料。對 64 200422849 任何分塊的登錄而言,不必儲存該處理器設定資料至記憶 體中,相反地,由於改變儲在相關的共用CP 15登錄中的S 位元值,轉換將自動地發生。 如先前所述,監控模式處理器設定資料將一網域狀態 位元,其覆蓋儲存在CP15登錄的資料,但是具有與用於 安全性網域之網域狀態位元相同之值(即,在上述實施例中 的S位元值1)。當一些CP15登錄被分塊時,它意味著在 第35圖中至少部分監控模式專屬處理器設定資料2000能 夠從在被分塊的登錄中儲存的安全性處理器設定資料中導 出,因為在轉換處理期間未對記憶體寫入出該些登錄内容。 因此,舉一示例,因為監控模式專屬處理器將設定一 網域狀態位元,以覆蓋當不在監控模式中所使用者。而在 較佳實施例中,它有與在安全性網域中所使用者相同的 值’它意味著選擇可存取的分塊Cpi5登錄的邏輯是允許 存取安全性分塊C P 1 5。藉由允許監控模式將該安全性處理 器設定資料用作監控模式專屬處理器設定資料的相關部 分’能夠實施對資源的儲存,因為不再需要為監控模式專 屬處理器設定資料的該些項目提供一組個別的登錄。 第3 6圖是一流程圖,圖示當需要在一網域之間轉換 時,用以執行處理器設定資料的轉換的步驟。如先前所述, 發出S M1指令’以促使進行網域之間的轉換。因此,在 第2020步驟’等待一 SMI指令的發出。當接收一 SMI指 令時,處理器進行至第2〇3〇步驟,其中處理器在監控模^ 中開始執仃監控程 <,它使該監控模式專屬處理器設定資 65 200422849 料被使作在前往多工轉換号 號的結果,導致多工轉換器 資料。如先前所述,它可能 以從在被分塊的登錄中储存 到某些部分。 2010的路徑2015上的控制信 轉換監控模式專屬處理器設定 疋一組自我包含的資料,或可 的安全性處理器設定資料所得 此後’在第2040步挪 ,_ . 夕驟,自發出SMI指令至記憶體的 網域儲存現有的狀態,它句 匕1括從任何共用的CP 1 5登錄, 儲存與上述網域相關的卢田 關的處理器設定資料狀態。通常,會撥 出部分記憶體,以供儲在+ 译存此類狀態之用。而後,在第2050 步驟,轉換狀態指標為妒A^ , …心向3有終點網域的對應狀態之記 憶體。因此,通常,為了 y- Ub 与了儲存狀態資訊配置兩部分記憶體,In step 15, the fake software interrupt triggers a security-back interrupt manager routine. _Return Interrupt Manager Example It simulates the return thread ID of the interrupt to determine whether it conforms to the SA SAID ’which was interrupted before the last time the security operating system was suspended. In this case, there is no compliance, and therefore after the content of the security thread SA has been stored in the 16th, the security system is triggered to convert the thread into a non-safe thread NSB and return the thread. Then, when requested, the security thread SA can be interrupted. Figure 27 is another example of the type of behavior not shown in Figure 26. In this example, when the program is under the control of a non-safety operating system to handle the IRQ, there is no non-safety thread transition, so when a software imitation interrupt is received by the return interrupt manager of the safe operating system, Its decision 56 200422849 (No thread conversion is required and only the safety thread SA is resumed in step i 5). The 28th circle is a flowchart illustrating the processing performed by the return thread manager. The return thread manager is started in step 4002. In the first village = step, when the safety operating system is suspended, the carcass imitation interrupt thread is checked and compared with the existing execution security thread. If they match, the process proceeds to step 4006 and the safety thread resumes. If the comparison in step 4004 does not match, the process proceeds to step 4008, where the transition to the new: before thread in step 4010 'stores the contents of the old security thread (to continue for the new). The new thread is already in progress, so the 40th new one continues. Shao Xiangzhong Envoy :: Change? As shown in the figure, a controlled safety operation system can be executed as a main non-safety operation system. The main control of the non-security industry department can be a coordinating woman without a monthly communication mechanism. ≫ The old operating system, and adjust the action of the dagger to cooperate with other operating systems. Operation 29 One of the initial entry points , Non-security == master control line-non-security thread NSA. The non-safety executive, the executive executive ^. The thread N S A calls a sexual thread, and the security thread wants to be attacked by a teacher, and the female holistic operating system uses an incoming call at MI) to execute. In the second step, a monitoring program 1 executed in the call control mode is performed in step 4 to perform any required operation: before entering the security operating system, the monitoring program is executed, stored and converted. The safety thread SA corresponding to the safety% A t 4 at this time. The safety enforcement = initial operating system execution may return control to a non-safety operating system by monitoring mode 57 200422849, for example, due to a timed event or the like. In step 9, when the non-safety thread implicitly re-transmits control to the secure operating system again ', it does so by issuing the original: system interrupt again. The software includes identifying the non-safety thread ratio of the NSA, the security thread of the target security thread ID, the thread ID that identifies the security thread SA, and other parameters. When the beer call generated in step 9 is passed by the monitoring program, and received in the security domain by the security operating system in step 2, the non-security execution can be performed with the ID to determine whether Content has been converted by non-security job f. You can also check the safe execution of the target thread, and understand whether the correct thread under the female holistic operating system has been restarted or started with a new thread. In the example in Figure 29, no security operating system is required to perform any exchanges in the secure domain. The second image is similar to the second image. "Except for the transition of the first thread", under the control of the security operating system, a second event occurs in a non-secure network domain. In step 11, the software is interrupted. The call across the security system is a different non-secure thread. In the 14th :: Comprehensive operating system, the non-security thread is identified as a different brain: the second execution involves the storage of the security thread SA. Contents and tasks of the full thread SB task transition. Figure 31 is a flow chart illustrating the operation of security when receiving-software interrupts as a call to resume the thread of the security operating system. The processing performed by the system. In step 4012, the 58 200422849 call is received. In step 4014, the parameters of the call are checked to determine whether they are in a security operating system and are compatible with an existing enabled security thread. Yes. If it does, then restart the security thread at step 40 16. If not, the program proceeds to step 4018 where it decides whether the newly requested thread can be used. The recent request The requested thread may not be available because it is or it requires a unique resource that is already used by some other thread in a secure operating system. In this case, at step 4020 In response, an appropriate message is returned to the non-security operating system, and the call is rejected. "If it is determined in step 4018 that a new thread is available, the process proceeds to step 4022, where the content of the old security thread is saved. , For possible restart later. At step 4024, the setting is switched to a new security thread like the setting of a software interrupt call to the security operating system. Figure 32 illustrates an operation based on which A priority is inverted. When an interrupt is processed in one of the systems with multiple operating systems, different interrupts are processed by different operating systems. Processing begins with the security operating system executing a security thread SA. Then it starts with a first Interrupted by Int 1. It triggers a monitor in monitoring mode to determine whether the interrupt is to be processed in a secure or non-secure domain. In this case, the interrupt is to be processed in the security domain, and the program returns to the security operating system and starts the interrupt processing routine of interrupting Int 1. The interrupt processing routine of Int 1 has a higher priority in the middle. A further interruption of the right Int 2 is received. Therefore, the interruption manager of Int 1 is stopped and in the monitoring mode is used to determine where the interruption of Int 2 is performed. During the non-safety pause, some security threads can be executed. The problem shown in Figure 33. The stub interrupt manager is a relative network domain, and the stub interrupt s interrupt in the Int 1 domain Record 'which indicates that the security management of the high-priority Int interrupt Int 2 interrupts the management of stub interrupts of Int 2 and will therefore occur again, as appropriate, according to this call. In this case, 'Interrupt Int 2 is to be handled by non-secure, and therefore control is passed to the interrupt manager of non-secure operating system 2. When the manager of Int2 is interrupted, the operating system does not have a message indicating that the service was interrupted in the security domain ... Therefore, further steps of the non-safety operating system, such as task switching or starting a different non-NSB, still fail to provide service to the original interruption Int i! Show a technique to avoid interruption Int 1 related to the 32nd operation When this happens, the monitor passes it to a non-secure domain at the start of the storage manager. The stub interrupt is small and quickly returns the program to security by monitoring mode. The interrupt manager triggers interrupt Int 1 in the global domain. It is mainly handled in women's holistic domains, while initiation of the non-safety network manager can be regarded as a type of location to maintain the non-safety domain, and the interruption is suspended in the safety domain. The interrupt manager for 'interrupt Int 1 in the domain is again dominated by 2. In non-secure domains, the execution of the interrupt manager is still triggered. However, in this case, the 'non-secure operating system has the data of the indicator' when the processor is complete, because the interrupt lnt i is still incomplete, and the stub interrupt manager is newly continued. The stub interruption management and the call with which it paused to return to the secure domain will be executed again and therefore transferred to the secure domain. Once 60 200422849 returned to the security domain, the security domain was able to start interrupting Int 1's interrupt manager again on its own. When the interrupt manager of the interrupt Int i is done in the secure domain, make a call back to the non-secure domain to perform the original execution of the security thread s A in the non-secure domain. Close the stub interrupt manager. Figure 34 illustrates the different types of interrupts related to their priorities and how to deal with them. A purely secure domain interrupt manager can be used to handle priority interrupts, ensuring that no higher priority interrupts are handled by non-secure domains. Once an interrupt has a higher priority than subsequent interrupts and is processed in a non-safety domain, all lower-priority interrupts are either handled purely in the non-safety domain or are used in Figure 33. The stub interrupt manager technology enables non-secure domains to keep track of those interrupts, even if they primarily deal with those who occur in the secure domain. As mentioned earlier, monitor mode is used to perform transitions between secure and non-secure domains. In an embodiment, the registration is shared between two different domains, which involves storing the states in those registrations into memory, and then loading this new state into the registration from the memory as the destination domain. For any logins that are not shared between the two domains, there is no need to save the state, because those logins will not be accessed by other domains, and the transition between these states is as secure and non-secure A direct result of the conversion between sexual domains (ie, the value of the s-bit stored in one of the CP 15 registrations determines the non-shared registration used). " " When the processor sets data to control the processor's access to memory in the monitor mode, some states need to be switched. Because there are 61 200422849 different §memory bodies in each domain, for example, a secure domain accesses a secure memory and stores security data, the secure memory cannot be fetched from a non-secure network. The processor setting data will need to be stored in the CP15 login 34 when the domain is converted as shown in Figure 35. 'In one embodiment, these registrations share this between domains'. When switching monitoring between a secure domain and a non-secure domain, the processor setting data existing in the CP15 registry 34 needs to be automatically transferred to memory, and the processor setting data related to the destination domain is loaded into the CP15 registry 34. Because the processor setting data in the CP15 registration usually has an immediate effect on system memory access, it is clear that if the processor updates them during operation in the monitor mode, these settings will immediately occur. This is undesirable in terms of a quiet monitoring mode in which the processor setting data is to be set in the monitoring mode. Therefore, as shown in FIG. 35, the implementation of the monitoring mode of the present invention provides special processor setting data 2000, which can be used to cover the processor setting data 34 of the login 34. When the processor is in the monitoring mode, Time. As shown in Fig. 35, when it is input, it can be achieved by receiving the processor setting data registered in CP15 and the monitoring mode i processor setting data 2000 through the multiplexer. In addition, multiplexing receives a control signal via path 2015 to indicate whether to handle operation in the milli-monitor mode. # 果 Processor is not in the monitoring mode " The processor setting data registered in CP15 34 is output to the system. If the processor is operating in the monitoring mode, & Device settings. Due to the mode CP15, the central control mode is required. In the state setting example, CP15 is used in 2010, and the exclusive 2010 L is under e, so L is in the converter 62 200422849 2010 output monitoring mode exclusive processor setting data 2 〇〇, to ensure that the applied processor setting data is consistent Yes, when the processor is operating in monitor mode. The dedicated processor setting data of the monitoring mode can be hard-coded in the system to ensure that it cannot be manipulated. However, it is also possible to program the processor-specific setting data of the monitoring mode without compromising security. When operating in a security permission mode, ensure that the processor-only setting data of the monitoring mode can only be modified by the processor. This allows some flexibility in terms of the settings of the processor dedicated to the monitoring mode. If the monitoring mode dedicated processor setting data is arranged to be programmable, the setting data can be stored anywhere in the system, such as in a separate set of registrations 34 in cpl5 registration 34. In the normal mode, when the memory tube is implemented as described above, the entity record is arranged as follows, which will enable the addressable mapping of the local setting data «^ 疋 a control mode exclusive processor setting data processor operation to provide a Very safe environment. Therefore, in the example, the setting data of the dedicated processor of the monitoring mode may set the processing unit 30 to be invalid. When the processor is operating on the monitoring module, it may be managed by the memory. The virtual memory applied by the unit Translation is invalid. In such a situation, the processor will always directly issue the physical address, and when a memory access request is issued, a plane mapping is used. It ensures that when operating in the monitoring mode, processing accesses the memory irrespective of whether or not any virtual-to-physical bits are compatible. When the processor is operating in the monitor mode, the dedicated processor in the current mode usually also allows the processor to access security. It is configured by domain-like memory in the form of 2004 200422849 state bits. In the security processor setting data, the domain state bits with the same value are set to the domain state bits with the same value. ('' S π bit). Therefore, regardless of the actual value of the domain status stored in the CP 1 5 registry, the value will be overwritten by the domain status bit set by the monitoring mode-specific processor setting data to ensure that the monitoring mode has access security Sexual information. The monitor-specific processor setting data can be set to other data used to control access to part of the memory. For example, when the processor is operating in the monitoring mode, the dedicated processor setting data of the monitoring mode can be set to cache 3 8 and should not be used to access the data. In the embodiment described above, it has been assumed that all CP 1 5 logins containing processor setting data are shared across network domains. However, in an alternative embodiment, some CP15 entries are "banked", for example, there are two entries for a specific item to store processor setting data, and one entry to a non-secure network. The value of an item that is accessed in a domain and contains processor configuration data for a non-secure domain, and that of another processor registered in a security domain that can be accessed in a secure domain and contains processor configuration data for a secure domain Item value. A non-blocked CP15 login is one that contains the "S" bit, but in principle any other CP 1 5 login can be blocked if desired. In such embodiments, the conversion of processor setting data by the monitoring mode 'converts any shared CP 1 5 registrations into memory, and now the processor setting data is in these shared registrations, And 'load the processor configuration data related to the destination domain in these shared cp 1 5 registrations. For 64 200422849 any block registration, it is not necessary to store the processor setting data in the memory. On the contrary, the conversion will occur automatically due to changing the S bit value stored in the associated shared CP 15 registration. As mentioned previously, the monitoring mode processor setting data will have a domain status bit that overrides the data stored in the CP15 registry, but has the same value as the domain status bit for the security domain (ie, in the The S-bit value 1) in the above embodiment. When some CP15 logins are partitioned, it means that at least part of the monitoring mode dedicated processor setting data 2000 in Figure 35 can be derived from the security processor setting data stored in the partitioned login, because in the conversion These registrations were not written to the memory during processing. Therefore, as an example, the dedicated processor in the monitoring mode will set a domain status bit to cover users who are not in the monitoring mode. And in the preferred embodiment, it has the same value as the user in the security domain. It means that the logic of selecting the accessible block Cpi5 login is to allow access to the security block C P 1 5. By allowing the monitoring mode to use the security processor setting data as the relevant part of the monitoring mode dedicated processor setting data, 'the storage of resources can be implemented because it is no longer necessary to provide these items for the monitoring mode dedicated processor setting data. A set of individual logins. Fig. 36 is a flowchart illustrating the steps for performing the conversion of the processor setting data when the conversion is required between a network domain. As mentioned earlier, the SM1 command is issued to facilitate the transition between the domains. Therefore, in step 2020 ', it is awaited that an SMI instruction is issued. When receiving an SMI instruction, the processor proceeds to step 2030, where the processor starts executing the monitoring process in the monitoring mode ^, which makes the monitoring mode exclusive processor setting data 65 200422849 expected to be used as The result of going to the multiplex conversion number results in multiplexer data. As mentioned earlier, it may be stored in some parts from the blocked entry. Control path on the path of 2010. Switch to monitoring mode. Dedicated processor settings. A set of self-contained data, or available security processor settings data. Afterwards, 'moved in step 2040, _. Xi, since the SMI command The domain to the memory stores the existing status, which includes logging in from any shared CP 15 and storing the status of the processor setting data of the Lutianguan related to the above domain. Normally, a portion of memory is set aside for storage in + such states. Then, in step 2050, the conversion status indicator is jealous A ^,… the heart 3 has the corresponding status memory of the destination domain. Therefore, usually, two parts of memory are allocated for y-Ub and storage state information.

一配置為儲存非安全性_ A 丨王網域的狀態,而一配置為儲存安全 性網域的狀態。 一旦在第2050步驟轉換了狀態指標,現下狀態指標所 才曰向的狀態在第2060步驟中被載入相關的共用cpl5登錄 裡,其包含為終點網域所載入之相關處理器設定資料。此 後’在第2070步驟’當在監控模式中時,監控程式退出, 而之後處理器在終點網域中轉換至所需要的模式。 第3 7圖詳細圖示本發明一實施例之記憶體管理邏輯 30的操作。該記憶體管理邏輯包含一記憶體管理單元 (MMU)2 00和一記憶體保護單元(MPU)220。由被設定一虛 擬位址的核心1 0發出的任何存取請求將經由路徑234傳遞 至該MMU 2 00,該MMU 2 00負責執行預定的存取控制功 能,尤其是決定與虛擬位址對應的實體位址,和決定存取 66 200422849 許可權限和決定區域屬性。 資料處理設備的記憶體系統包含安全性記憶體和 全性記憶體。用來儲存存取安全性資料的安全性記憶 希望被核心ίο所存取,或一或多數的其它主控裝置, 心或其它的裝置在在安全性模式中操作和因此在安全 域中操作時。 在第3 7圖所示之本發明的實施例中,在非安全性 下’在核心1 0執行的應用在安全性記憶體中存取安全 料的策略是藉由該MPU 2 20中的分割檢測器所執行 MPU 2 20由安全性作業系統所安排,本文中亦指安全 心 〇 依據本發明之較佳實施例,在非安全性記憶體中 一非安全性分頁表5 8,例如在外部記憶體5 6的一非 性記憶體部分’並用以為在上述分頁表中所定義的每 女全性e己憶體區域儲存對應的描述符(descript〇r)。該 符所包含的資訊’可從中得到用以令MMU執行預定 取控制功能所需的存取控制資訊,並據以在參照第3 7 述之實施例中’提供關於虛擬至實體位址映射的資訊 取許可權限、和任何區域屬性。 此外’依據本發明之較佳實施例,在記憶體系統 全性記憶體中,至少提供一安全性分頁表5 8 ,例如在 記憶體56的一安全性部分中,其再次為在該表中所定 一些記憶體區域提供一相關的描述符。當處理器在一 全性模式中操作時,將參考該非安全性分頁表,以獲 非安 體只 當核 性網 模式 性資 ,該 性核 提供 安全 一非 描述 的存 圖所 、存 的安 外部 義的 非安 得用 67 200422849 於管理記憶體存取的相關描述符,反之,當處理器在安全 性模式中操作時’將使用來自安全性分頁表的描述符。 自相關分頁表獲得描述符至MMU的過程如下。由核 心1 〇發出的記憶體存取請求設定一虛擬位址,一查詢執行 於micro-TLB 206(TLB係主要轉譯參考緩衝(transiation lookaside buffer)),其為一些虛擬位址部分之一儲存獲自 相關分頁表的對應實體位址部分。因此,micro-TLB 206 將把虛擬位址的一某部分與在micro-TLB中儲存的對應虛 擬位址部分比較,以決定是否符合。比較的部分通常是虛 擬位址的多數重要位元的一些預定的數字,位元的數目依 據在分頁表58中的分頁粒度。在micro-TLB 206中執行的 查詢通常相對地快速,因為micro-TLB 206只包括相對地 少量的項目,例如八項。 當沒有在micro-TLB 206中找到符合者(hit)的時候, 則記憶體存取請求被經由路徑242傳遞到含有獲取自該些 分頁表的一些描述符之主要TLB 208。稍後將在下文中進 一步討論,來自非安全性分頁表和安全性分頁表的描述符 都能夠在主要TLB 208中共存,而在主要TLB中的每一項 目都具有一對應的旗標(本文中稱為網域旗標),其可設定 以指示是否在項目中對應的描述符已經從一安全性分頁表 或一非安全性分頁表獲得。吾人將了解,對於所有在它們 的記憶體存取請求中直接設定實體位址的安全性模式操作 而言,是不需要主要TLB中的此類旗標的,當主要tlb 只儲存非安全性描述符時。 68 200422849 在主要TLB 208中,執行一類似查詢程序,以決疋疋 否在記憶體存取請求中發出的虛擬位址的相關部分對應於 在主要TLB 208中與描述符相關的任何虛擬位址部分’又 該主要TLB相關於操作的特定模式。因此,如果核心10 在非安全性模式中操作,主要TLB 208中只有已經從非安 全性分頁表得到的該些描述符會被檢查,反之如果核心1 〇 在安全性模式中操作,則在主要TLB中只有已經從安全性 分頁表得到的描述符會被檢查。 如果在主要TLB中,檢查處理的結果有符合者,則自 相關描述符提取存取控制資訊並經由路徑242傳送。尤其 是’描述符的虛擬位址部分和對應的實體位址部分將經由 路徑上242被繞送到micro-TLB 206,以儲存在micro-TLB 的一項目中,載入存取許可權限至存取許可邏輯202,而 載入區域屬性至區域屬性邏輯204。存取許可邏輯202和 區域屬性邏輯204可以與micro-TLB分離,或可以合併於 micro-TLB 中。 此刻,MMU 200能夠處理記憶體存取請求,因為現下 在micro-TLB 206中有將一符合者。因此,micro-TLB 206 將產生實體位址,其可能經由路徑2 3 8輸出至系統匯流排 4〇,以繞送至相關的記憶體,這若不是藉由晶片整合 (on-chip)記憶體,如TCM 36、快取38等等,就是藉由可 經由外部匯流排界面42存取的外部記憶體單元之一。同 時,記憶體存取邏輯202將決定是否允許記憶體存取,和 如果不允許核心在現有模式的操作中存取該特定的記憶體 69 200422849 位址,則經由路徑230發出一中止訊號回到核心ι〇。例如, 不論在安全性記憶體或非安全性記憶鱧中,當核心在監督 模式下操作時,核心設定記憶體的特定部分為只能被核心 所存取,而因此,當在例如使用者模式下時,如果核心企 圖存取此類記憶體位址’存取許可邏輯2〇2將摘測到核心 1〇目前不具有適當的存取權限’並藉由路徑23〇發出中土 信號。這將使記憶體存取中止。最後,區域屬性邏輯2〇4 將決定特定記憶體的區域屬性,例如是否存取是可快取 的、可緩衝的、等等,和經由路徑232發出此類信號,其 中將用它們來決定記憶體存取請求的資料是否能夠被快 取,例如在該快取38中,是否在寫入存取的情況下,所寫 入的資料能夠被緩衝,等等。 在主要TLB 208中沒有符合者的情況下,則轉譯表行 走邏輯(translation table walk logic)21〇被用來存取相關 分頁表5 8,以經由路徑248截取所需要的描述符,而後經 由路徑246令描述符傳遞至主要TLB 208,以儲存取其中。 非安全性分頁表和安全性分頁表兩者的基礎位址將儲存在 錄C P 1 5 3 4中’而處理器核心1 〇所操作的現有網域, 即安全性網域或非安全性網域,亦將在CP 1 5的一登錄中 設定’當轉換在非安全性網域和安全性網域之間發生時, 或反之亦然’網域狀態登錄將由監控模式設置。網域狀態 登錄的内容在本文中將稱作網域位元。因此,如果需要執 行一轉譯表行走程序,該轉譯表行走邏輯21〇將知道核心 所執行之網域,和因此知道所用以存取該相關表的基礎位 70 200422849 址。而後該虛擬位址被用作對該基礎位址的補 當的分頁表中存取適當的項目,以獲得所需要 一旦由轉譯表行走邏輯21〇截取了該描述 主要TLB 208中’則在該主要TLB中將獲得 以及呼叫先前描述的程序,以戴取存取控制資 儲存在micro-TLB 2 06、存取許可邏輯中202 邏輯2〇4中’而後記憶體存取可由MMU200作 如先前所述,在較佳實施例中,主要TLB 存來自安全性分頁表和非安全性分頁表兩者的 是、一旦在micro-TLB 206中儲存了相關資訊,, 200處理記憶體存取請求。在較佳實施例中, 208和micro-TLB 206間的資料傳輸是由位於 刀割檢測器2 2 2所監控,以確保當核心1 〇在一 式中操作時’沒有存取控制資訊自主要TLB中 輸至micro-TLB 206中,如果這樣的話,將導 記憶體中產生一實體位址。 記憶體保護單元係由安全性作業系統所管 定於在安全性記憶體和非安全性記憶體之間 CP 1 5 34分割資訊的登錄中。而後分割檢測器 分割資訊,以決定的是否存取控制資訊傳輸至 2 0 6 ’其允許在一非安全性模式中由核心1 〇存 憶體。尤有甚者,在較佳實施例中,當核心i 〇 非安全性模式中’如同在CP 1 5網域狀態登錄 式所设定的網域位元所指示般,可操作分割檢 償,以在適 的描述符。 符,並置於 一符合者, 訊,和將它 和區域屬性 動。 208能夠儲 描述符,但 P、能由MMU 在主要TLB MPU 220 的 非安全性模 的描敘符傳 致在安全性 理,其能設 定義分割的 222能參考 micro-TLB 取安全性記 係操作於一 中由監控模 測器222以 71 200422849 經由路徑 244,監控企圖自該主要 TLB2 08擷取至 micro-TLB 206之任一實體位址部分,和依據該實體位址 部分,決定是否之後為該虛擬位址所產生的實體位址是在 安全性記憶體中。在這種狀況下,分割檢測器222將經由 路徑2 3 0對核心1 0發出中止信號,以防止記憶體存取發生。 吾人將了解,能夠安排分割檢測器2 2 2以確實防止實 體位址部分被儲存在micro-TLB 206中,或選擇性地實體 位址部分仍然儲存在micro-TLB 206中,但是中止處理的 部分將從micro-TLB 206中把不正確的實體位址部分移 除,例如藉由清除micro-TLB 206。 只要核心1 〇在一非安全性模式和一安全性模式之間 藉由監控模式改變,監控模式將改變CP 1 5網域狀態登錄 中網域位元值,以指示處理器的操作所變成的網域。作為 網域之間傳輸程序的一部分,將清除micro-TLB 206,和 因此在安全性網域以及非安全性網域之間轉換之後的第一 記憶體存取將在micr〇-TLB 206產生不符者(miss),和請 求自主要TLB 208截取存取資訊,或直接自相關分頁表截 取相關的描述符。 藉由上述方法,吾人將了解,分割檢測器2 2 2將確保 當核心在非安全性網域中操作時,如果意圖截取允許存取 安全性記憶體的micr〇-TLB 206存取控制資訊,將產生一 記憶體存取中止。 如果處理器核心1 〇操作的任何模式中,安排記憶體存 取請求以直接設定一實體位址,則在MMU 200的操作模 72 200422849 式中將失效,而實體位址將經由路徑236傳遞至 220。在操作的一安全性模式中,存取許可邏輯224和 屬性邏輯226依據替在CP15 34中分割資訊登錄的對 域所定義的存取許可權限和區域屬性,執行必要的存 可和區域屬性分析。如果企圖被存取的安全性記憶體 是在只能在一特定模式操作中存取之安全性記憶體的 分中,例如安全性權限模式,則核心在一不同模式操 意圖的存取,例如,一安全性使用者模式,將導致存 了邏輯224產生一中止,以相同於MMU的存取許可 202在此類環境中產生一中止的方法,經由路徑230 核心°同樣地,區域屬性邏輯226將產生可快取的以 緩衝的信號,以相同於MMU的區域屬性邏輯204替 擬位址設定的記憶體存取請求產生此類信號。假定允 存取’此時存取請求經由路徑2 4 〇進行至系統匯流排 從此類’其繞送至適當的記憶體單元。 為了存取請求指定一實體位址之一非安全性存取 取請求將藉由路徑236被繞送到分割檢測器222,其 CP15登錄34的分割資訊以執行分割檢查,以決定是 體位址在安全性記憶體中指定一位置,該情況下,將 經由路徑230產生中止信號。 上述記憶體管理邏輯的程序現下參照第39圖和 圓的流程圖進一步詳盡描述。第39圖圖示在核心10 的程式產生一虛擬位址的情況,如第300步驟所示。 監控模式所設定之在CP15網域狀態登錄34中的相關 區域 應區 取許 仅置 〜部 作所 取許 邏輯 傳至 及可 以虛 許該 40, ,存 參照 否實 再次 % 40 執行 依據 網域 73 200422849 位元’將指示核心是否現下在一安全性網域或非安全性網 域中執行。該情況下,核心正在一安全性網域中執行,過 程發展至第302步驟,其中在micro-TLB 206中執行一·查 5旬以了解是否虛擬位址的相關部分符合在micro-TLB中的 虛擬位址部分之一。如果在第3〇2步驟中符合,處理直接 發展至第312步驟,其中存取許可邏輯2〇2執行必要的存 取許可分析。在第3 14步驟,其決定是否有一存取許可違 反,而如果有,則程序進行至第316步驟,其中存取許可 邏輯202經由路徑230發出一中止。否則,如果沒有存取 許可違反,則處理從第314步驟進行至第318步驟,其中 進行記憶體存取。特別是區域屬性邏輯204將經由路徑232 輸出必要的可快取和可緩衝屬性,以及micr〇_TLB 2〇6將 如稍早所述經由路徑238發出實體位址。 如果在第302步驟在micro-TLB有不符者,則在第3料 步驟在±要TLB 208中執行一查詢程序以以是否所需要 的安全性描述符在主要TLB中存在n則在第3〇6步 驟執行_分頁表行走程序,冑以轉譯表行走邏輯21〇 全性分頁表獲得需要的描述符,如第37圖稍早所述 程序進行至第308步驟,或直接從第3〇4 步驟,如果安全性描述符已經存在於主要二至第- 在第308步驟’其決定主要tlb現下含有該有 (tagged)的安全性描述符,以及因此程序進行至第31籤 驟,其中在micro_TLB載入含有實艘位址部分:步 子部分。因為核心10現下正在安全性模式中執行,二待的 钒仃分割檢 74 200422849 測器222不需要執行任何分割檢查功能。 此時程序進行至第3 12步驟,其中記憶體存取的其餘 部分如稍早所述般進行。 如果非安全性記憶體存取,處理從第300步驟進行至 第320步驟,其中在micro-TLB 206執行一查詢程序以自 一非安全性描述符決定對應的實體位址部分是否存在。如 果有’則程序直接發展至第3 36步驟,其中由存取許可邏 輯202檢查存取許可權限。在該點應注意到,如果相關實 體位址部分是在micro-TLB中,其假設沒有安全性違反, 因為在被储存到micr〇-TLB中之前,分割檢測器22有效 地監督該資訊。一旦在第336步驟已經檢查了該存取許 可,則程序進行至第338步驟,其中決定是否有任何違反, 其中存取許可錯誤中止在第316步驟發出。否則,程序進 行至第3 1 8步驟,其中記憶體存取的其餘部分如稍早所討 論般執行。 如果在第320步驟未有符合者位於micro-TLB,則程 序進行至第322步驟,其中在主要TLB 208執行一查尋程 序以決定相關的非安全性描述符是否存在。否則,由轉譯 表行走邏輯210在第324步驟執行一分頁表行走程序,以 自非安全性分頁表截取必要的非安全性描述符至主要tlb 208。此時程序進行至第326步驟,或直接自第322步驟進 行至第326步驟,如果在第322步驟在主要TLB 2〇8中出 現符合者。在第326步驟,其決定主要TLB現下含有所考 慮的虛擬位址的有效附加的非安全性描述符,而後在第 75 200422849 328 - 部分 指向 指向 有安 檢剛 反, 有實 驟, 存取 作瘙 錄中 在第 220 可, 行, 模式 割檢 安全 反, 全性 中的 步驟分割檢測器222檢查從(在描述符中給定實體位址 的)記憶體存取請求的虛擬位址所產生的實體位址將 非安全性記憶體中的一位置。否則,即如果實體位址 安全性記憶體中的一位置,則在第3 3 0步驟,其決定 全性一違反,而程序進行至第332步驟,其中由分割 器222發出一安全性/非安全性錯誤中止。 然而,如果分割檢測器邏輯222決定沒有安全性違 則程序進行至第334步驟,其中在micr〇_TLB載入含 體位址部分的相關描述符的子部分,其後在第3 3 6步 以先前所述之方式進行記憶體存取。 參照第4 0圖現下描述直接發出一實體位址的記憶體 請求的處理。如先前所述,在該歷程中,MMU 200將 ,其最好由登錄一 MMU啟用位元之CP15的一相關登 的設定所達成’該設定程序由監控模式所執行β因此, 3 5 0步驟,核心1 0將產生將經由路徑2 3 6傳送到MPU 裡的一實體位址。而後,在第352步驟,MPU檢查許 以確認被請求的記憶體存取能夠以現有的操作模式進 即使用者、監督、等等。此外,如果核心在非安全性 中操作’不論是否實體位址在非安全性記憶體中,分 測器2 2 2在第3 5 2步驟也將檢查是否實體記憶體在非 性模式中。而後,在第354步驟,其決定是否有一違 即,是否存取許可程序揭露了 一違反,或如果在非安 模式中’分割檢查程序確認了一違反。如果該些違反 任一發生’則程序進行至第356步驟,其中由MPU 22 0 76 200422849 產生 在二 中, 一安 358 址,, 將啟 位址 所有 作的 了解 能夠 完全 以由 取請 安全 全的 之主 當一 另一 MMU取代。在這種情況下,可能不需要與 一存取终可錯誤中止。吾人將了解,在某些1 種類型的中止之間沒有差別,而在選擇性 該中止信號可公指示是否其關聯於一存取許 全性錯誤。 如果在第3 54步驟沒偵測到任何違反,程序 步驟’其中發生記憶體存取由實體位址確認έ 在較佳實施例中,僅安排監控模式直接產 乂及因此在所有其它情況中,如稍早所述般, 用以及將發生從記憶體存取請求的虛擬位址 第38圖圖示記憶體管理邏輯的一選擇性實) 記憶體存取請求都指定一虛擬位址,以及因 任何模式中直接產生實體位址。在該歷程中 ’不需要一個別的MPU 220,和反之分割 合併於MMU 200之中。這改變悄悄地發生 相同於稍早參照第37圖至第39圖所討論之4 吾人將了解’各種其它選擇亦有可能。例如 指定虛擬位址的安全性和非安全性模式發出 求,能提供二MMU,一供安全性存取請求, 性存取請求,即,在第37圖中的Μρυ 22〇 要TLB使用之旗標,其用 MMU在它的主要TLB中 MMU在它的主要TLB儲 以定義安全性或非 儲存非安全性描述 存安全性描述符。 a施例中, 的實施例 可錯誤或 進行至第 勺位置。 生實體位 MMU 200 產生實體 包例,其中 此未在操 ,吾人將 :測器222 ,程序以 I式進行。 ’假定可 記憶體存 和一供非 能用一完 ^ 一 MMU 安全性, 符,以及 當然,仍 77 、、:需要刀割檢測器以檢查當核心在非安全性網域中時, 否意圖存取安全性記憶體。 位址如果’選擇性地’所有記憶體存取請求直接指定實 妹求 選擇性的執行可以使用二MPU,一供安全性存 和供非安全性存取請求。用於非安全性存取讀 的MPU可妒女山—入 東、 b有由女全性分割檢測器所監督之它的存取 "、確保不在非安全性模式中允許存取安全性記憶體 第37圖或第38圖之任一安排可以提供進一步的 可以安排分割檢測器222以執行一些分割檢查,以 督轉譯表订走邏輯210的活動。尤其是,如果核心現下 非安全性網域中操作,則能安排分割檢測器222進行 查^只要轉譯表行走邏輯21〇企圖存取一分頁表,其存 非安全性分頁表而非安全性分頁表。如果偵測到一違反 最好月b產生中止信號。因為轉譯表行走邏輯21〇通常藉 使一分頁表基礎位址與由記憶體存取請求發出的虛擬位 某二位元、纟σ合’以執行該分頁表查詢,該分割檢測可 涉及,例如,檢查轉譯表行走邏輯2丨〇係使用一非安全 刀頁表的一基礎位址而非一安全性分頁表的一基礎位址 第4 1圖圖示當核心丨〇在—非安全性模式中操作時 由分割檢測器222執行的程序。吾人將了解,在正常的 作下’從非安全性分頁表獲得的描述符應該只描述在非 全吐°己憶體中映射的一分頁。然而,在軟鱧攻擊中,描 符可能被竄改,以使它現下描述含有記憶體的非安全性 安全性區域的一部分。因此,考慮第41圖之一示例,受 是 體 取 求 請 〇 特 監 在 檢 取 由 址 能 性 操 安 述 和 篡 78 200422849 改的非安全性描述符可以涵蓋一分頁其包栝非安全性區 域370、3 72、374和安全性區域376、378、38〇。如果作 $記憶體存取請求的一部分發出的虛擬位址此時符合在一 安全性記憶體區域的一實體位址,如第41圖所示之安全性 »己隐體區域3 7 6 ’則安排分割檢測器2 2 2產生一中止以防 止存取發生。因此,即使意圖存取安全性記憶體之企圖篡 改了非安全性描述符,分割檢測器222防止該存取發生。 相對地,如果使用該描述符導出的實體位址與一非安全性 任己憶體區域一 S,例如,如第4 j圖所示的區域3 74,則載 入micro-TLB 2 06裡的存取控制資訊僅確認該非安全性區 域374。因此,在非安全性記憶體區域374中的存取能夠 發生,但是,對任何安全性區域376、378或38〇的存取 不能夠發生。因此,可以看到即使主要TLB 2〇8可能含來 自已被竄改的非安全性分頁表的描述符,micr〇 TLB將只 包含實體位址部分,其將啟用對非安全性記憶體區域的存 取。 如稍早所述,在實施例中,非安全性模式和安全性模 式可以產生指定虛擬位址的記憶體存取請求,而後記憶體 最好都包括非安全性記憶體中的一非安全性分頁表,和安 全性記憶體中的一安全性分頁表。在非安全性模式中時, 轉譯表行走邏輯210將參考該非安全性分頁表,而在安全 性模式中時,轉譯表行走邏輯21〇將參考安全性分頁表。 第42圖示該兩分頁表。如在第42圖所示,可能在例如第 1圖所示之外部記憶體5 6中的非安全性記憶體3 9〇包括在 79 200422849 其中之〆#安全性分頁表395,其參考一基礎位址397在 一 CP15發錄34中指定。同樣地,在安全性記憶體4〇〇中, 其可以再次在第1圖所示之外部記憶體5 6中,提供一對應 的安全性分頁表405,其由一安全性分頁表基礎位址407 在一複製的CP15登錄34中指定。在非安全性分頁表395 中的每一描述符都將指向在非安全性記憶體3 9 0中的一對 應非安全性分頁’而在安全性分頁表405中的每一描述符 都將定義安全性記憶體400中的對應安全性分頁。此外, 將在稍後詳述的’對某些區域的記憶體而言,是可能共用 記憶體區域4 1 0,其為非安全性模式和安全性模式所能存 取。 第43圖依據較佳實施例,詳述在主要TLB 208中執 行的查詢程序。如先前所述,主要TLB208包括一網域旗 標425,其確認是否對應的描述符435係來自安全性分頁 表或非安全性分頁表。它確保當執行一查尋程序時,僅相 關於核心1 0所操作之特定網域的描述符會被檢查。第43 圖圖示一示例,其中核心執行於也稱作安全性情境之一安 全性網域。可自第43圖看出,當執行一主要TLB 2〇8查 詢時,它將導致忽略描述符440,和僅描述符445被認定 為查尋程序的候選者。 依據本發明之較佳實施例,在本文中亦稱作ASID旗 標之一額外程序ID旗標43〇使提供以從程序專屬分頁表 確認描述符。@此,程序P1、!>2和P3每一具有在記憶體 中提供的對應分頁表,和進一步可以對非安全性操作和安 80 200422849 全性操作有不同的分頁表。尤有甚者,吾人將了解,在安 全性網域中的程序PI、P2、P3可以完全獨立於在非安全 性網域中的程序PI、P2、P3。因此,如第43圖所示,略 檢查網域之外,當需要主要TLB查詢208時,也檢查ASid 旗標。 因此,在第43 ·圖的示例中,在安全性網域,執行程序 P1,該查尋程序確認在主要TLB· 208中僅兩項目45〇,、 ^ ’以 及依據是否在兩描述符中有虛擬位址部分符合由記憶體存 取請求所發出的虛擬位址部分,產生符合者(hit)或不符者 (miss)。如果有,則把該相關的存取控制資訊截取並傳遞 至micro-TLB 206、存取許可邏輯2〇2和區域屬性邏輯 204 。否則,一不符者發生,以及轉譯表行走邏輯21〇被 用於從提供給安全性程序P1的分頁表截取需要的描述符 至主要TLB 208裡。熟知本項技藝者將了解,有許多管理 TLB的内容的技術,並因此當截取一新的描述符以储存在 主要TLB 208中’而主要TLB已經滿載,可以用多數習去 技術之任一來決定欲自主要TLB去除的描述符,以為新描 述符製造空間,例如最近使用的方法,等等。 吾人將了解,用於操作的安全性模式的安全性核心可 以完全獨立於非安全性作業系而發展。然而,在某此情兄 中,安全性核心和非安全性作業系統發展可以密切地連 接,而在此情況下,適於允許安全性應用使用非安全性描 述符。的確,這將允許安全性應用藉由僅知的虛擬位址直 接存取非安全性資料(以共用)。其當然假設安全性虛擬映 81 200422849 射和和非安全性虛擬映射可供特定ASID執行。在此類歷 程中,不需要預先導入標簽以(即,網域旗標)在安全性和 隹女全性描述符之間識別。反之在TLB中以所有可用的描 述符執行查詢。 在較佳的實施例中,在主要TLB的架構和先前所述之 刀離的安全性和非安全性描述符的架構,能夠由在Cp15 控制登錄中所提供的特定位元所設置。在較佳實施例中, 只由安全性核心設置該位元。 在實施例中,允許安全性應用直接使用一非安全性虛 擬位址,其亦可能從安全性網域使非安全性堆疊指標變為 可獲得。它能夠藉由複製確認非安全性堆疊指標的非安全 性登錄值至CP15登錄34中的一專屬登錄.此時它將促使 非安全性應用依據被安全性應用所理解的規劃藉由該堆叠 傳遞參數。 如稍早所述,記憶體可能被分割為非安全性和安全性 部分,以及使用專屬於分割檢測器222之CP15登錄34, 由核心控制該分割。基本分割方法係基於在典型Mpu裝置 中定義之區域存取許可。因此,把記憶體分成多數區域, 以及最好能用它的基礎位址、大小、記憶體屬性和存取許 可定義每一區,域。尤有甚者,當設計重疊區域時,上方區 域的廣性擁有最高的優先權。此外,依據本發明之較佳實 施例,提供一新的區域屬性以定義是否對應的區域在安全 性記憶體或在非安全性記憶體中。由安全性核心使用該新 的區域屬性來定義欲被作為安全性記憶體來保護的記憶體 82 200422849 部分。 在開機階段,如第44圖所示般執行一第一分割。該初 始分割將決定分發給非安全性情境、非安全性作業系統和 非安全性應用的記憶體460的數量。該數量與在分割中定 義的非安全性區域一致。而後由非安全性作業系統將該資 訊用於它的記憶體管理。其餘的記憶體462、464 (被定義 為安全性的)不被非安全性作業系統所知道。為了保護非安 全性情境的完整性,可設計非安全性記憶體為只允許安全 性權限模式存取。因此,安全性應用將不被該些非安全性 者所竄改。如第44圖所示,在該開機階段分割之後,記憶 體460可用於供非安全性作業系統使用、記憶體462可用 於供安全性核心使用,以及記憶體464可用於供安全性應 用使用。 一旦已經執行了該開機階段分割,由使用 MMU 200 的非安全性作業系統處理非安全性記憶體460的記憶體映 射,以及因此能夠以一並通模式定義一系列非安全性分 頁。如第45圖所述。 如果一安全性應用需要與一非安全性應用共用記憶 體,安全性核心能夠改變記憶體一部分的權限以從一網域 傳送偽造資料至其他者。因此,如第46圖所示,安全性核 心能夠在檢查非安全性分頁的完整性以後,改變該分頁的 權限,以使安全性分頁466變為可存取之共用記憶體。 當記憶體的分割改變時,micro-TLB 206需要被清除。 因此,在該歷程中,當其後發生一非安全性存取時,在 83 200422849 micro-TLB 206將發生一不符者,以及因此從主要TLB 208 載入一新的描述符《由MPU的分割檢測器222在其後檢查 該新的描述符,當意圖截取它至micro-TLB 206時,所以 將與記憶體的新分割一致。 在較佳實施例中,該快取3 8是虛擬索引和實體附加 的。因此,當在該快取38中執行一存取時,首先在 micro-TLB 2 06已經執行一查詢,而因此存取許可(尤其是 安全性和非安全性許可)將被檢查。因此,在快取3 8中不 能由非安全性應用儲存安全性資料,並因此在非安全性模 式中不能執行對安全性資料的存取。 然而,在非安全性網域對一安全性應用而言,可能發 生一問題是能夠使用快取操作登錄以進行作療 (inVaudate)、清除或去除該快取。其需要保證此類操作不 會影響系統的安全性。例如,如果非安全性作業系統欲作 瘙快取38而不用清除它,在取代前,任何外部記憶體必須 寫入任何安全性受污染的資料。較佳的實施料,安全性 資料係在快取中附加,和因此如果希望的話,能夠 區別地處理。 .. 狂式執行一「依 據值址作癭快取線」操作,由分割檢測器222 址,以及如果快取線是一安全性快取線, = 和作廢」操作’從而確保系統的安全性能維青除 在較佳實施例中,由一非安全性程犬 甚者, 弓|作瘙快取線」操作成為「依據索引清除和作廢门據索 々1卞瘙」。同樣地, 84 200422849 由一非安全性程式執行的所有「作癆全部」操作成為「清 除和作癆全部」。 此外,參考第一圖,micro-TLB 206控制DMA 32對 TCM 36的任何存取。因此,當DMA 32在TLB執行查詢, 以把它的虛擬位址轉換成一實體者時,添加於主要TLB内 的先前所述之旗標允許執行需要的安全性檢查,猶如已由 核心1 0發出存取請求般。此外,將在稍後討論,一複製部 分被連接至外部匯流排70,最好位在判優器(arbitel:)/解碼 區塊之中,以使在DMA 32藉由外部匯流排界面42直接存 取與外部匯流排70連結的記憶體時,使與外部匯流排連接 的複製分割檢測器檢查存取的有效性。尤有甚者,在某些 較佳實施例中,有可能向CP 1 5登錄34中添加一位元以定 義是否DMA控制器32可用於非安全性網域,當在一權限 模式中操作時,該位元僅允許由安全性核心設置。 考慮TCM36,如果安全性資料被置於TCM36之中, 必須小心地處理它。舉一示例,可想見一歷程,其中非安 全性作業系統為TCM記憶體36設計實體位址範圍,以使 其重疊一外部安全性記憶體部分。如果操作的模式之後改 變至一安全性模式,安全性核心可能導致資料儲存在上述 重疊部分,而通常在TCM 36儲存該資料,因為TCM 36通 常具有比外部記憶體較高之優先權。如果非安全性作業系 統之後為TCM 3 6改變實體位址空間的設定’以使先前的 安全性區域現下映射至記憶體的非安全性實體區域,吾人 將了解,此時該非安全性作業系統能夠存取該安全性資 85 200422849 竣區域為非安全性而將不宣告 料,因為分割檢測器將視 中止0因此,簡而言之,如要Tri 果TCM被設定為以正常的本地 端RAM作用,而非SamrtCarfiA l田a — 匕ache,如果它可以移動TCM基 礎的登錄至非安全性實體位址,則可崎也—人 丨此祉,則可能讓非安全性作業系 統讀取安全性情境資料。 ' ' 用以防止上述歷程,在輕 <去眘 牧K佳貫施例中提供控制位元於One is configured to store the state of the non-secure domain, and one is configured to store the state of the secure domain. Once the status indicator is converted in step 2050, the current status of the current status indicator is loaded into the relevant shared cpl5 registry in step 2060, which contains the relevant processor setting data loaded for the destination domain. Thereafter, at step 2070, when in the monitor mode, the monitor program exits, and then the processor switches to the desired mode in the destination domain. Figures 37 and 7 illustrate the operation of the memory management logic 30 according to an embodiment of the present invention in detail. The memory management logic includes a memory management unit (MMU) 200 and a memory protection unit (MPU) 220. Any access request issued by the core 10 which is set with a virtual address will be passed to the MMU 2 00 via the path 234. The MMU 2 00 is responsible for performing predetermined access control functions, especially determining the correspondence with the virtual address. Physical address, and decide access 66 200422849 permissions and determine area attributes. The memory system of the data processing device includes a security memory and a full memory. The secure memory used to store access to security data is intended to be accessed by the core, or one or more of other master devices, the heart or other devices when operating in a security mode and therefore in a secure domain . In the embodiment of the present invention shown in FIG. 37, the strategy of accessing the security material in the security memory by the application executing on the core 10 under non-security is by the partitioning in the MPU 2 20 The MPU 2 20 executed by the detector is arranged by a secure operating system, which is also referred to herein as a safe heart. According to a preferred embodiment of the present invention, a non-secure page table 5 8 in non-secure memory, such as externally A non-sexual memory portion of the memory 56 is used to store a corresponding descriptor (descriptor) for each female general e memory area defined in the above paging table. The information contained in the symbol 'can be used to obtain the access control information required for the MMU to perform the predetermined fetch control function, and accordingly, in the embodiment described with reference to 37,' providing information on the virtual to physical address mapping Information for permission, and any regional attributes. In addition, according to a preferred embodiment of the present invention, at least one security paging table 5 8 is provided in the full memory of the memory system, for example, in a security part of the memory 56, which is again in the table The specified memory regions provide an associated descriptor. When the processor is operating in a full-scale mode, it will refer to the non-security paging table to obtain non-safety-only core network model sexual resources. The external non-secret uses 67 200422849 to manage the related descriptors of memory access. Conversely, when the processor is operating in the security mode, the descriptors from the security paging table will be used. The process of obtaining the descriptor from the auto-correlated paging table to the MMU is as follows. The memory access request issued by the core 10 sets a virtual address, and a query is executed on the micro-TLB 206 (TLB is the main translation lookaside buffer), which is one of the virtual address parts. The corresponding physical address portion of the autocorrelation paging table. Therefore, the micro-TLB 206 will compare a certain part of the virtual address with the corresponding virtual address part stored in the micro-TLB to determine compliance. The part of the comparison is usually some predetermined number of most significant bits of the virtual address. The number of bits is based on the paging granularity in the paging table 58. Queries executed in micro-TLB 206 are generally relatively fast because micro-TLB 206 includes only a relatively small number of items, such as eight items. When no hit is found in the micro-TLB 206, the memory access request is passed via the path 242 to the main TLB 208 containing some descriptors obtained from the paging tables. As will be discussed further later, descriptors from both the non-security paging table and the security paging table can coexist in the main TLB 208, and each entry in the main TLB has a corresponding flag (in this article (Referred to as a domain flag), which can be set to indicate whether the corresponding descriptor in the item has been obtained from a security paging table or a non-security paging table. I will understand that for all security mode operations that directly set the physical address in their memory access request, such flags in the main TLB are not needed, and when the main tlb stores only non-security descriptors Time. 68 200422849 In the main TLB 208, execute a similar query procedure to determine whether the relevant part of the virtual address issued in the memory access request corresponds to any virtual address associated with the descriptor in the main TLB 208 Partially, this main TLB is related to a specific mode of operation. Therefore, if Core 10 is operating in non-security mode, only those descriptors in the main TLB 208 that have been obtained from the non-security paging table will be checked. Otherwise, if Core 10 is operating in security mode, In TLB, only the descriptors that have been obtained from the security paging table are checked. If there is a match in the result of the check processing in the main TLB, the access control information is extracted from the relevant descriptor and transmitted via the path 242. In particular, the virtual address part of the 'descriptor and the corresponding physical address part will be routed to the micro-TLB 206 via the path 242 to be stored in an item of the micro-TLB, and the access permission is loaded to the memory. The permission logic 202 is fetched, and the region attribute is loaded into the region attribute logic 204. The access permission logic 202 and the area attribute logic 204 may be separated from the micro-TLB or may be incorporated in the micro-TLB. At this point, the MMU 200 is able to handle memory access requests because there is now a match in the micro-TLB 206. Therefore, the micro-TLB 206 will generate a physical address, which may be output to the system bus 40 via the path 2 3 8 to be routed to the relevant memory, if not by on-chip memory , Such as TCM 36, cache 38, etc., is one of the external memory units accessible through the external bus interface 42. At the same time, the memory access logic 202 will decide whether to allow the memory access, and if the kernel is not allowed to access the specific memory 69 200422849 address in the operation of the existing mode, it will send a stop signal via path 230 to return Core ι〇. For example, whether in secure or non-secure memory, when the core is operating in supervised mode, the core sets certain parts of the memory to be accessible only by the core, and therefore, when in, for example, user mode At the next time, if the core attempts to access such a memory address, the 'access permission logic 202 will detect that the core 10 does not currently have appropriate access rights' and send a Middle-earth signal via path 23. This will suspend memory access. Finally, the region attribute logic 204 will determine the region attributes of a particular memory, such as whether access is cacheable, bufferable, etc., and issue such signals via path 232, which will be used to determine memory Whether the data requested by the body access can be cached, for example, in the cache 38, whether the written data can be buffered in the case of write access, and so on. In the case where there is no match in the main TLB 208, the translation table walk logic 21 is used to access the relevant paging table 58 to intercept the required descriptors via path 248 and then via path 246 passes the descriptor to the main TLB 208 for storage and retrieval. The base address of both the non-security paging table and the security paging table will be stored in the CP 1 5 3 4 'and the existing network domain operated by the processor core 10, that is, the security network domain or the non-security network. The domain will also be set in a login of CP 15 when the transition occurs between a non-secure domain and a secure domain, or vice versa. The domain status registration will be set by the monitoring mode. Domain Status Registered content will be referred to as the domain bit in this article. Therefore, if it is necessary to execute a translation table walking program, the translation table walking logic 21 will know the domain that the core executes, and therefore the base bit 70 200422849 address used to access the related table. The virtual address is then used as a supplementary paging table for the base address to access the appropriate entries to obtain what is needed. Once the description is intercepted by the translation table walking logic 21, the description in the main TLB 208 is' in the main The TLB will obtain and call the previously described procedures to store access control data in micro-TLB 2 06, access permission logic 202 logic 204, and then memory access can be performed by MMU200 as previously described. In the preferred embodiment, the main TLB store is from both the security paging table and the non-security paging table. Once the relevant information is stored in the micro-TLB 206, 200 processes the memory access request. In the preferred embodiment, the data transmission between 208 and micro-TLB 206 is monitored by a cutting detector 2 2 2 to ensure that when the core 10 operates in a formula 'no access control information from the main TLB The input to micro-TLB 206, if so, will generate a physical address in the memory. The memory protection unit is managed by the secure operating system and is registered in the CP 1 5 34 division information between the secure memory and the non-secure memory. The segmentation detector then splits the information to determine whether the access control information is transmitted to 206 ', which allows the core 10 memory to be used in a non-secure mode. In particular, in the preferred embodiment, when the core i 0 non-security mode is' as indicated by the network domain bit set in the CP 1 5 domain status registration mode, split compensation can be operated, Take the appropriate descriptor. Character, and place it in a match, message, and move it with the zone attribute. 208 can store descriptors, but P, can be transmitted by the MMU descriptive symbol of the non-security module of the main TLB MPU 220, which can be set in the security theory. It can be set to define the segmented 222, which can refer to the micro-TLB for security records. Operated by a monitoring module 222 at 71 200422849 via path 244, monitoring attempts to retrieve any physical address portion from the main TLB2 08 to micro-TLB 206, and decide whether to follow the physical address portion based on the physical address portion The physical address generated for the virtual address is in security memory. In this case, the partition detector 222 will send a termination signal to the core 10 via the path 230 to prevent memory access from occurring. I will understand that the segmentation detector 2 2 2 can be arranged to actually prevent the physical address portion from being stored in the micro-TLB 206, or alternatively the physical address portion is still stored in the micro-TLB 206, but the processing portion is aborted The incorrect physical address portion will be removed from the micro-TLB 206, for example by clearing the micro-TLB 206. As long as the core 10 is changed between a non-security mode and a security mode by the monitoring mode, the monitoring mode will change the value of the domain bit in the CP 1 5 domain status registration to indicate the operation of the processor. Domain. As part of the transfer process between domains, the micro-TLB 206 will be cleared, and therefore the first memory access after switching between the secure and non-secure domains will cause a mismatch in micr0-TLB 206 (Miss), and request to intercept the access information from the main TLB 208, or directly intercept the relevant descriptors from the relevant paging table. With the above method, I will understand that the segmentation detector 2 2 2 will ensure that when the core is operating in a non-secure domain, if the intention is to intercept the micr0-TLB 206 access control information that allows access to the security memory, A memory access abort will be generated. If in any mode of operation of the processor core 10, a memory access request is arranged to directly set a physical address, the operation mode 72 200422849 of MMU 200 will be invalidated, and the physical address will be passed to path 236. 220. In a security mode of operation, the access permission logic 224 and the attribute logic 226 perform the necessary storage and region attribute analysis based on the access permission permissions and region attributes defined for the domains registered for the segmentation of information in CP15 34. . If the attempted access to the security memory is in a security memory that can only be accessed in a specific mode of operation, such as the security permission mode, then the core intends to access in a different mode, such as A security user mode will result in a suspension of stored logic 224, and a suspension method in such an environment with the same access permission 202 as the MMU, via path 230 core ° Similarly, area attribute logic 226 A cacheable, buffered signal will be generated, and a memory access request set for the pseudo address with the same area attribute logic 204 as the MMU will generate such a signal. It is assumed that the access is allowed 'at this time the access request is made to the system bus via path 2 40 and from this type it is routed to the appropriate memory unit. A non-secure access request that specifies a physical address for the access request will be routed to the segmentation detector 222 via path 236, whose CP15 registers the segmentation information of 34 to perform a segmentation check to determine whether the physical address is in A location is specified in the security memory, in which case an abort signal is generated via the path 230. The above-mentioned procedure of the memory management logic is now described in further detail with reference to Fig. 39 and the circular flowchart. FIG. 39 illustrates a case where a program in the core 10 generates a virtual address, as shown in step 300. The relevant area in the CP15 domain status registration 34 set in the monitoring mode should be set to allow only the ~ ~ logic obtained by the department to pass and can be allowed to 40, with reference to whether it is true again% 40 implementation based on the domain 73 200422849 bit will indicate whether the core is currently executing in a secure or non-secure domain. In this case, the core is being executed in a security domain, and the process proceeds to step 302, where a check is performed in micro-TLB 206 to see if the relevant part of the virtual address matches the micro-TLB. One of the virtual address parts. If it matches in step 302, the process proceeds directly to step 312, where the access permission logic 202 performs the necessary access permission analysis. At step 314, it is determined whether there is an access permission violation, and if so, the program proceeds to step 316, where the access permission logic 202 issues a suspension via path 230. Otherwise, if there is no access permission violation, the process proceeds from step 314 to step 318, where memory access is performed. In particular, the area attribute logic 204 will output the necessary cacheable and bufferable attributes via path 232, and micr0_TLB206 will issue the physical address via path 238 as described earlier. If there is a discrepancy in the micro-TLB in step 302, then in step 3, a query procedure is executed in ± request TLB 208 to see if the required security descriptors are present in the main TLB. 6 steps execution _ paging table walking program, the translation table walking logic 21 holistic paging table to obtain the required descriptors, as described earlier in Figure 37, the program proceeds to step 308, or directly from step 304 If the security descriptor already exists in the main two to the first-in step 308 'It is determined that the main tlb now contains the tagged security descriptor, and therefore the program proceeds to the 31st step, which is contained in the micro_TLB The entry contains the real ship address part: the step subpart. Because the core 10 is currently being executed in the security mode, the second vanadium scandium segmentation inspection 74 200422849 detector 222 does not need to perform any segmentation inspection functions. At this point, the process proceeds to step 32, where the rest of the memory access is performed as described earlier. If non-secure memory is accessed, the process proceeds from step 300 to step 320, where a query procedure is executed at micro-TLB 206 to determine whether a corresponding physical address portion exists from a non-security descriptor. If there is', the program proceeds directly to step 36, where the access permission logic 202 checks the access permission right. It should be noted at this point that if the relevant entity address part is in a micro-TLB, it is assumed that there is no security violation, because the segmentation detector 22 effectively monitors this information before being stored in the micr0-TLB. Once the access permission has been checked in step 336, the process proceeds to step 338, where a decision is made as to whether there has been any violation, and the access permission error is aborted in step 316. Otherwise, the program proceeds to step 318, where the rest of the memory access is performed as discussed earlier. If no conformant is located in the micro-TLB at step 320, the program proceeds to step 322, where a lookup procedure is performed at the main TLB 208 to determine whether the relevant non-security descriptor exists. Otherwise, the translation table walk logic 210 executes a paging table walk procedure at step 324 to intercept the necessary non-security descriptors from the non-secure paging table to the main tlb 208. At this point, the procedure proceeds to step 326, or directly from step 322 to step 326, if a conformant appears in the main TLB 2008 at step 322. In step 326, it is determined that the main TLB now contains a valid additional non-security descriptor of the virtual address under consideration, and then in section 75 200422849 328-some points point to the security check, the step, the access, and the access. In step 220, the line, pattern cut, security check, and full step split detector 222 check the virtual address generated from the memory access request (of the physical address given in the descriptor). A physical address will be a location in non-secure memory. Otherwise, if there is a location in the physical address security memory, then in step 330, it decides a total violation, and the program proceeds to step 332, where a security / non-issue is issued by the splitter 222 Security error aborted. However, if the partition detector logic 222 decides that there is no security violation, the program proceeds to step 334, in which a sub-portion of the relevant descriptor containing the body address portion is loaded in micr0_TLB, and thereafter in steps 33.6 to Memory access is performed in the manner described previously. The processing of directly issuing a memory request of a physical address will now be described with reference to FIG. 40. As mentioned earlier, in this process, the MMU 200 will, preferably, be achieved by a relevant login setting of the CP15 registering an MMU enable bit. 'The setting procedure is performed by the monitoring mode β. Therefore, step 3 5 0 The core 10 will generate a physical address that will be transmitted to the MPU via path 2 3 6. Then, in step 352, the MPU checks to make sure that the requested memory access can be accessed by the user, supervisor, etc. in the existing operation mode. In addition, if the core is operating in non-secure ', whether or not the physical address is in non-secure memory, the analyzer 2 2 2 will check whether the physical memory is in non-sex mode in step 3 52. Then, at step 354, it is determined whether there is a violation, that is, whether the access permission procedure has disclosed a violation, or if in the non-security mode, the 'segment check procedure has confirmed a violation. If any of these violations occur, the procedure proceeds to step 356, in which the MPU 22 0 76 200422849 is generated in the second middle school, an address 358, and the understanding of all the work of the open address can be completely taken for safety. The master should be replaced by another MMU. In this case, it may not be necessary to abort with an access. I will understand that there is no difference between certain 1 types of aborts, and that in selective the abort signal can publicly indicate whether it is associated with an access permission error. If no violation is detected in step 3 54, the program step 'where memory access occurs is confirmed by the physical address. In the preferred embodiment, only the monitoring mode is scheduled to be directly generated and therefore in all other cases, As mentioned earlier, the virtual address with and from which a memory access request will occur is shown in Figure 38. Figure 38 illustrates an alternative implementation of memory management logic. Memory access requests specify a virtual address, and Generate physical addresses directly in any mode. In the process, ’there is no need for another MPU 220, and vice versa, it is merged into MMU 200. This change happens quietly the same as discussed earlier with reference to Figures 37 to 39. 4 I will understand that various other options are also possible. For example, the security and non-security modes of the specified virtual address are issued, and two MMUs can be provided, one for the security access request, and the sexual access request, that is, Μρυ 22 in Figure 37. The flag of TLB is required. Standard, which uses the MMU in its main TLB to store the security descriptor in the main TLB to define a security or non-storage non-security description. In an embodiment, the embodiment may be wrong or proceed to the first spoon position. The MMU 200 generates a physical package example, in which this is not in operation, we will: the tester 222, the program is performed in I-style. 'Assumes that memory can be used and one is not available. One MMU security, character, and of course, still 77, :: need a knife detector to check if the core is in a non-secure domain. Access security memory. If the address is 'selectively', all memory access requests directly specify the real request. Selective execution can use two MPUs, one for secure storage and one for non-secure access requests. MPU for non-secure access reading can be jealous to female mountain-Ito, b has its access supervised by female holistic segmentation detector, "ensures that access to secure memory is not allowed in non-secure mode Any of the arrangements in Figure 37 or Figure 38 may provide further activities that may be arranged by the segmentation detector 222 to perform some segmentation checks to supervise the translation table order logic 210. In particular, if the core is operating in a non-secure domain, the segmentation detector 222 can be arranged to look up. As long as the translation table walking logic 21 attempts to access a page table, it stores the non-security page table instead of the security page. table. If a violation is detected, it is best to generate a stop signal on month b. Because the translation table walking logic 21 usually uses a paging table base address and a virtual bit sent by a memory access request to perform a paging table query, the segmentation detection may involve, for example, , Check the translation table walk logic 2 丨 〇 uses a base address of a non-secure page table instead of a base address of a security paging table Figure 41 illustrates when the core 丨 〇 in-non-security mode The program executed by the segmentation detector 222 during the middle operation. I will understand that under normal operation, the descriptor obtained from the non-secure paging table should only describe one page mapped in the non-full memory. However, in a soft palate attack, the descriptor may be tampered with so that it now describes a portion of the non-secure security area containing memory. Therefore, consider one of the examples in Figure 41. The recipient requested that the Special Supervisor seize the non-security descriptor modified by the site ’s functional operations and security. Zones 370, 3 72, 374 and security zones 376, 378, 38. If the virtual address issued as part of the $ memory access request now matches a physical address in a secure memory region, as shown in Figure 41, security »Hidden region 3 7 6 'then The partition detector 2 2 2 is arranged to generate a stop to prevent access from occurring. Therefore, even if an attempt to access the secure memory has tampered with the non-security descriptor, the partition detector 222 prevents that access from occurring. In contrast, if the physical address derived from the descriptor and a non-secure memory region S, for example, region 3 74 as shown in Figure 4j, are loaded into micro-TLB 2 06 The access control information only confirms the non-security area 374. Therefore, access in the non-secure memory area 374 can occur, but access to any of the security areas 376, 378, or 380 cannot occur. Therefore, it can be seen that even though the main TLB 2008 may contain descriptors from tampered non-secure paging tables, the micr0 TLB will only contain the physical address portion, which will enable the storage of non-secure memory areas. take. As mentioned earlier, in the embodiment, the non-security mode and the security mode can generate a memory access request for a specified virtual address, and then the memory preferably includes a non-security in the non-security memory. A paging table, and a security paging table in security memory. When in the non-security mode, the translation table walking logic 210 will refer to the non-security paging table, while in the security mode, the translation table walking logic 21 will refer to the security paging table. Figure 42 illustrates the two-page table. As shown in FIG. 42, unsafe memory 3 9 that may be in, for example, the external memory 5 6 shown in FIG. 1 is included in 79 200422849, among them #security pagination table 395, which refers to a basis Address 397 is specified in a CP15 release 34. Similarly, in the security memory 400, a corresponding security paging table 405 can be provided in the external memory 56 shown in FIG. 1 again, which is based on a security paging table base address. 407 Specified in a duplicate CP15 login 34. Each descriptor in the non-secure page table 395 will point to a corresponding non-secure page in the non-secure memory 390, and each descriptor in the security page table 405 will be defined The corresponding security pages in the security memory 400. In addition, as will be described later, 'for some regions of memory, it is possible to share the memory region 4 1 0, which is accessible by the non-security mode and the security mode. Figure 43 details the query procedure performed in the main TLB 208 according to the preferred embodiment. As mentioned earlier, the main TLB 208 includes a domain flag 425, which confirms whether the corresponding descriptor 435 is from a security paging table or a non-security paging table. It ensures that when a search procedure is performed, only descriptors related to the specific domain where the core 10 operates are checked. Figure 43 illustrates an example where the core is implemented in a security domain, also known as a security scenario. It can be seen from Figure 43 that when a main TLB 208 query is performed, it will cause descriptor 440 to be ignored, and only descriptor 445 will be identified as a candidate for the search procedure. According to a preferred embodiment of the present invention, an additional program ID flag 43, also referred to herein as an ASID flag, is provided to confirm the descriptor from the program-specific paging table. @This, the programs P1,! ≫ 2 and P3 each have a corresponding paging table provided in the memory, and further can have different paging tables for non-security operations and security operations. In particular, I will understand that programs PI, P2, and P3 in a secure domain can be completely independent of programs PI, P2, and P3 in a non-secure domain. Therefore, as shown in Fig. 43, the ASid flag is also checked when the main TLB query 208 is required outside the domain. Therefore, in the example of Fig. 43, in the security domain, the program P1 is executed, and the search procedure confirms that only two items 45, ^, ^ 'in the main TLB. 208, and whether there is a dummy in the two descriptors The address part matches the virtual address part issued by the memory access request, and a hit or a miss is generated. If so, the relevant access control information is intercepted and passed to the micro-TLB 206, the access permission logic 202, and the area attribute logic 204. Otherwise, a non-compliance occurs and the translation table walk logic 21 is used to intercept the required descriptors from the paging table provided to the security program P1 into the main TLB 208. Those skilled in the art will understand that there are many techniques for managing the contents of TLB, and therefore when a new descriptor is intercepted to be stored in the main TLB 208 'and the main TLB is already full, you can use any of the most learned techniques Decide which descriptors to remove from the main TLB, to make room for new descriptors, such as the most recently used method, etc. I will understand that the security core of the security model for operation can be developed completely independently of the non-safety operating system. However, in one such brother, the core of security and the development of non-secure operating systems can be closely linked, and in this case, it is appropriate to allow non-security descriptors to be used by security applications. Indeed, this will allow security applications to directly access non-secure data (for sharing) with only known virtual addresses. It of course assumes that security virtual mappings and 2004 and non-security virtual mappings are available for specific ASIDs to perform. In such a history, there is no need to pre-import tags to identify (ie, domain flags) between security and maidenness descriptors. Instead the query is executed in the TLB with all available descriptors. In the preferred embodiment, the architecture of the main TLB and the previously described architecture of the security and non-security descriptors can be set by specific bits provided in the Cp15 control login. In the preferred embodiment, this bit is set only by the security core. In an embodiment, a security application is allowed to directly use a non-secure virtual address, which may also make the non-security stack index available from the security network domain. It can confirm the non-security registration value of the non-security stack indicator by copying it to an exclusive registration in the CP15 registration 34. At this time, it will cause the non-security application to pass through the stack according to the plan understood by the security application. parameter. As mentioned earlier, the memory may be partitioned into non-security and security parts, and the CP34 login 34 dedicated to the partition detector 222 is used to control the partition. The basic partitioning method is based on zone access permissions defined in a typical Mpu device. Therefore, the memory is divided into a plurality of regions, and it is best to define each region and domain with its base address, size, memory attributes, and access permissions. In particular, when designing overlapping areas, the breadth of the upper area has the highest priority. In addition, according to a preferred embodiment of the present invention, a new region attribute is provided to define whether the corresponding region is in a secure memory or a non-secure memory. The new zone attribute is used by the security core to define the memory to be protected as security memory 82 200422849 section. In the startup phase, a first partition is performed as shown in FIG. 44. This initial partitioning will determine the amount of memory 460 to be distributed to non-security scenarios, non-security operating systems, and non-security applications. This number is consistent with the non-security area defined in the segmentation. This information is then used by non-secure operating systems for its memory management. The remaining memories 462, 464 (defined as secure) are not known to non-secure operating systems. To protect the integrity of non-secure contexts, non-secure memory can be designed to allow access only to the security permission mode. Therefore, security applications will not be tampered with by those who are not secure. As shown in FIG. 44, after the boot-up phase is divided, the memory 460 can be used for non-security operating systems, the memory 462 can be used for security cores, and the memory 464 can be used for security applications. Once this boot phase partition has been performed, the memory map of the non-secure memory 460 is handled by the non-secure operating system using the MMU 200, and thus a series of non-secure pages can be defined in a unified mode. As shown in Figure 45. If a security application needs to share memory with a non-security application, the security core can change the permissions of a part of the memory to transfer fake data from a domain to others. Therefore, as shown in Figure 46, the security core can change the permissions of the non-secure page after checking the integrity of the non-secure page so that the security page 466 becomes accessible shared memory. When the memory partition is changed, the micro-TLB 206 needs to be cleared. Therefore, in the process, when a non-secure access occurs later, a discrepancy will occur at 83 200422849 micro-TLB 206, and therefore a new descriptor "Segmentation by MPU" will be loaded from the main TLB 208 The detector 222 then checks the new descriptor when it intends to intercept it to the micro-TLB 206, so it will be consistent with the new segmentation of the memory. In the preferred embodiment, the cache 38 is a virtual index and a physical addition. Therefore, when an access is performed in the cache 38, a query has been performed in micro-TLB 2 06 first, and therefore access permissions (especially security and non-security permissions) will be checked. Therefore, the security data cannot be stored by the non-security application in the cache 38, and thus the access to the security data cannot be performed in the non-security mode. However, for a security application in a non-secure domain, a problem may arise in being able to log in using a cache operation for inVaudate, clear, or remove the cache. It needs to ensure that such operations do not affect the security of the system. For example, if a non-safety operating system wants to do cache 38 without clearing it, any external memory must be written with any security-contaminated data before it can be replaced. For better implementation, security data is appended to the cache, and therefore can be processed differently if desired. .. perform a "cache line by value" operation by splitting the address of the detector 222, and if the cache line is a security cache line, "= invalidate" operation 'to ensure the security performance of the system In the preferred embodiment, the operation of the bow is made by a non-safety process dog, and the operation of "archiving pruritus cache line" becomes "clearing and invalidating pruritus according to the index". Similarly, 84 200422849 all "do all" operations performed by a non-secure program become "clear and do all". In addition, referring to the first figure, the micro-TLB 206 controls any access of the DMA 32 to the TCM 36. Therefore, when the DMA 32 performs a query in the TLB to convert its virtual address to an entity, the previously mentioned flags added to the main TLB allow the required security checks to be performed as if they had been issued by the core 10 Access request like. In addition, as will be discussed later, a copy is connected to the external bus 70, preferably in the arbitel: / decoding block, so that the external bus interface 42 is directly used in the DMA 32 When the memory connected to the external bus 70 is accessed, the copy division detector connected to the external bus 70 checks the validity of the access. In particular, in some preferred embodiments, it is possible to add a bit to the CP 1 5 login 34 to define whether the DMA controller 32 is available for non-secure domains when operating in a privileged mode This bit is only allowed to be set by the security core. Consider TCM36, if security data is placed in TCM36, it must be handled with care. As an example, imagine a journey in which a non-secure operating system designs a physical address range for the TCM memory 36 so that it overlaps an external security memory portion. If the mode of operation is changed to a security mode later, the security core may cause the data to be stored in the above-mentioned overlap, and the data is usually stored in the TCM 36, because the TCM 36 usually has higher priority than the external memory. If the non-secure operating system subsequently changes the physical address space setting for TCM 3 6 so that the previous security area is now mapped to the non-secure physical area of the memory, I will understand that at this time the non-secure operating system can Access to this security resource 85 200422849 The completion area is non-secure and will not be announced, because the segmentation detector will treat the suspension as 0. Therefore, in short, if the Trim TCM is set to function as a normal local RAM Instead of SamrtCarfiA Tiana — if it can move the TCM-based login to the address of a non-secure entity, then Kazaki also — people, this may allow non-secure operating systems to read the security context data. '' To prevent the above process, provide control bits in the < Don't Care of the Best Practices example.

CP15登錄34其只能在安全性模式操作中存取,和提供兩 可能的架構。在一第一架構中,把控制位元設置成” 1 ”,其 中TCM只能夠由安全性權限模式控制。因此,在cpi5 w 中意圖對TCM控制意圖進行的任何非安全性存取將導致 進入一未定義指令異常。因此,在該第一架構中,安全性 模式和非安全性模式都能夠使用TCM,但是,僅由安全性 權限模式控制該TCM。在第二架構中,把該控制位元設置 成,其中TCM能夠由非安全性作業系統控制。在這種 情況下’只能由非安全性應用使用該TCM。沒有任何安全 性資料可以從TCM處載入或存入TCM。因此,當執行安The CP15 login 34 can only be accessed during security mode operation, and provides two possible architectures. In a first architecture, the control bit is set to "1", where the TCM can only be controlled by the security permission mode. Therefore, any insecure access to the TCM control intent in cpi5w will result in entry into an undefined instruction exception. Therefore, in this first architecture, both the security mode and the non-security mode can use the TCM, but the TCM is controlled only by the security permission mode. In the second architecture, the control bit is set such that the TCM can be controlled by a non-safety operating system. In this case 'the TCM can only be used by non-security applications. No security data can be loaded from TCM or stored in TCM. So when performing security

全性存取時,不在TCM中執行查詢以了解位址是否與該 TCM位址範圍符合。 預設的情況下,想像僅能由非安全性作業系統使用 TCM ’在這種歷程中,不需要改變非安全性作業系統。 如先前所述,除了在MPU 220提供分割檢測器222之 外’本發明之較佳實施例也提供一類似的分割檢測區塊其 連接至外部匯流排70,該額外的分割檢測器被用於監督其 他主控裝置對記憶體的存取,例如,數位信號處理器 86 200422849 (DSP)50、直接連接至外部匯流排的DMA控制器52、經由 外部匯流排界面42連接至外部匯流排的DMA控制器32、 等等。在某些實施例中,如稍後將討論的,有可能只有一 分割檢測區塊連接至外部匯流排,而不提供一分割檢測器 作為記憶體管理邏輯3 0的一部分。在一些此類實施例中, 可以選擇性地提供一分割檢測器作為記憶體管理邏輯3 〇 的一部分,在此類示例中,該分割檢測器被視為除了與裝 置匯流排連結的那個以外,所提供之一進一步的分割檢測 器。 如先前所述,全部的記憶體系統能包含多數記憶體單 元,而上述之多種可能存在於外部匯流排7〇,例如,外部 Λ憶體56、開機R0M 44、或真正的緩衝或在週邊裝置中 的登錄48、62、66,例如,螢幕驅動器46、I/O界面60、During full access, no query is performed in the TCM to see if the address matches the TCM address range. By default, imagine that TCM can only be used by non-safety operating systems. In this process, there is no need to change the non-safety operating system. As mentioned previously, in addition to providing a segmentation detector 222 at the MPU 220, the preferred embodiment of the present invention also provides a similar segmentation detection block which is connected to the external bus 70. This additional segmentation detector is used for Supervises memory access by other master devices, such as digital signal processor 86 200422849 (DSP) 50, DMA controller 52 connected directly to external bus, DMA connected to external bus via external bus interface 42 Controller 32, etc. In some embodiments, as will be discussed later, it is possible that only one split detection block is connected to the external bus without providing a split detector as part of the memory management logic 30. In some such embodiments, a segmentation detector may optionally be provided as part of the memory management logic 30. In such examples, the segmentation detector is considered to be in addition to the one connected to the device bus, One of the further segmentation detectors provided. As mentioned earlier, all memory systems can contain most memory units, and many of the above may exist on external buses 70, such as external Δ memory 56, boot ROM 44, or true buffering or on peripheral devices Registrations 48, 62, 66 in, for example, screen driver 46, I / O interface 60,

金鑰貯藏單元64、笪鲮 .,.L 等專。此外,記憶體系統的不同部分可 能需要被定義為安全性記愔 留一 ( f己隐例如,可能需要在金鑰貯藏 翠το 64中的金鑰緩衝存 渚存器破視為一安全性記憶體。 如果與外部匯流排連牡的一 則报明齠认 ° 裝置意圖存取安全性記憶體, 則很明顯地,在含有核心 艘管理邏輯30將不… 片中提供先前所述的記憶 、弭將不能監督此類存取。 第4 7圖圖不如何委 裝置匯流排)之額 至外部匯流排(本文中亦指 額外的分割檢測器49 ^ ^ ^ 流排,以使I认θ + 92通常女排該外部匯 :無,裝置(例如,裝置47〇 體存取細求,都會進入上述 -己隐 請求也包括在_ # A 卩匯奴排。該些記憶體存取 亥外部匯流排上的某些信號其定義操作的模 87 200422849 :例例如權限的、…的、等等。依照本發明之較佳實 -己憶體存取清求亦涉及發出一網域信號至該外部匯 模卜以媒認是否該設備係操作於安全性模式或非安全性 實。最好能在硬體層級發出該網域信號,以及在較佳 例中’能夠在安全性或非安全性網域中操作的—裝置 括:預設的腳位1以輸出該網域信號至外部匯流排 '路徑490。為了描述它,在外部匯流排上,在另一俨 號路經488之外,單獨顯示該路徑49〇。 口 網域信號(本文亦指"S位元")將確認是否發出記憶體 存取凊求的設備係操作於安全性網域或非安全性網域,和 由連接至外部匯流排的分割檢測器492接收該資訊❶該分 割檢測器492將亦已經存取分割資訊其確認記憶體之區域 疋安全性或非安全性的,和因此可以被安排為僅允許一裝 置存取記憶體的特定部分,如果該s位元係被宣告作確認 一安全性模式的操作。 在預設的情況下,想像不宣告該s位元,和因此一預 先存在的非安全性裝置(諸如第47圖所示之裝置472)將不 輸出一宣告的S位7G ,和因此絕不允許由分分割檢測器492 存取記憶體的任何安全性部分,不論是在螢幕驅動器 480、輸入輸出界面484之中的登錄或緩衝器482、486中, 或在外部記憶體4 7 4中。 為供描述之故,用來在主控裝置(諸如,裝置47〇、472) 所發出的記憶體存取請求之間進行判優(arbiter之判優器 區塊’係獨立於用以決定服務記憶體存取請求的適當記憶 88 200422849 體裝置之解碼器478和獨立於分割檢測器492來解說。然 而,吾人將了解,上述元件之一或多數可以整合於相同的 單元中,如果希望的話。 第48圖圖示一選擇性實施例,其中未提供分割檢測器 492,而反之安排每一記憶體裝置 474、480、484依據 S 位元的值監督自己的記憶體存取。因此,如果裝置470要 在非安全性模式下,對在被標示為安全性記憶體之螢幕驅 動器480中的一登錄482宣告記憶體存取請求,則該螢幕 驅動器480將決定S位元未被宣告,以及不處理該記憶體 存取請求。因此,可想見以各種記憶體裝置的適當設計, 可以避免需要在外部匯流排上分別提供一分割檢測器 492 〇 在第47圖和第48圖的上述内容中,"S位元”被用作 確認發出記憶體存取請求的裝置係在安全性網域或非安全 性網域中操作。以另一種角度觀之,該S位元可視為指示 記憶體存取請求屬於安全性網域或非安全性網域。 在第37圖和第38圖所述之實施例中,一單一 MMU(連 同單——組分頁表)被用來執行虛擬至實體位址轉譯。以此 類方法,實體位址空間通常以如第49圖所示之簡單模式在 非安全性記憶體和安全性記憶體之間分成區塊。對於記憶 體系統中之記憶體單元之一,本文之一實體位址空間2 1 00 所包含範圍開始於位址零並延伸至位址Y,例如,外部記 憶體5 6。為了每一記憶體單元,可尋址記憶體通常被切割 為兩部分,一第一部分2 11 0被分配為非安全性記憶體和一 89 200422849 第二部分2 1 2 0被分配為安全性記憶體。 以此類方法,吾人將了解,有某些實體位址不能被特 定網域所存取,以及此類差異對用使於該些網域的作業系 統將十分明顯。而用於安全性網域之作業系統將知道非安 全性網域的存在,也因此將不在意這點,在非安全性網域 中的作業系統最好應該不需要知道安全性網域的存在,但 是,反之應該操作地好似不在安全性網域般。 在一進一步的議題中,吾人將了解一非安全性作業系 統知道外部記憶體的位址空間為開始於位址零和延伸至位 址X ’和該非安全性作業系統不需要知道任何關於該安全 性核心的事,以及尤其是從位址χ+丨延伸至位址γ的安全 性記憶體的存在。相反地,該安全性核心將不知道它的位 址空間係開始於位址零其通常不為一作業系統所預期者。 一減輕上述顧慮的實施例,藉由允許安全性記憶體區 域完全不被具有它的實體位址空間的非安全性作業系統所 知,和藉由啟用安全性網域中的安全性核心和非安全性網 域中的非安全性作業系統,以知道外部記憶體的位址空間 係開始於位址零,如第51圖所述。這裡,實體位址空間 2 2 00能在分頁層級被切割為安全性或非安全性區塊。在第 5 1圖所示之示例中,所示之外部記憶體的位址空間係被切 割為四個區塊2210、2220、2230和2240,包含兩安全性 記憶體區域和兩非安全性記憶體區域。 相反於藉由一單一分頁表轉換在虛擬位址空間和該實 體位址空間之間轉換,參照一第一分頁表和一第二分頁表 90 200422849 執行兩分離層的位址轉譯,從而導入一中間位址空間的概 念’依據是否處理器在安全性網域或非安全性網域中,其 能作不同的安排。尤有甚者,如第51圖所示,藉由使用在 一組分頁表2250中的一安全性分頁表中所提供的描述 符’實體位址空間中的兩安全性記憶體區域2210和2230 能夠在中間位址空間映射至單一區域2265。對在處理器上 執行的作業系統而言,其將視中間位址空間為實體位址空 間’並將用MMU來在該中間位址空間中使虛擬位址轉變 成中間位址。 同樣地,能夠為非安全性網域設定中間位址空間 22 70,其中藉由在該組分頁表225〇的一非安全性分頁表中 的對應描述符,將在實體位址空間中的兩非安全性記憶體 區域 2220和 2240映射至非安全性網域的非安全性區域 2275。 在一實施例中,如第5 0 A圖所示,經由中間位址對虛 擬位址至實體位址的轉譯係使用兩獨立的MMUs所控制。 在第50A圖中的MMUs 2150和MMUs 2170可視為以相似 於第37圖所示之MMU 200的方法建構,但是,為了簡化 說明’省略了某些細節。 第一 MMU 2150 包括一 micro-TLB 2155、一主要 TLB 2160和轉譯表行走邏輯2165,而同樣地,第二MMU2170 包括一 micro-TLB 2175、一主要TLB 2180和轉譯表行走 邏輯2 1 8 5。當處理器在非安全性網域中操作時,由非安全 性作業系統控制該第一 MMU,或者當處理器在安全性網域 91 200422849 中操作時’由安全性核心控制。然而,在較佳實施例中, 該第二MMU只能由安全性核心或監控程式所控制。 當處理器核心1 0發出記憶體存取請求時,其將藉由路Key storage unit 64, 笪 鲮.,. L, etc. In addition, different parts of the memory system may need to be defined as security records (for example, the key buffer memory in the key store το 64 may be broken as a secure memory). If a report connected to the external bus acknowledges that the device intends to access the security memory, it is clear that the core ship management logic 30 will not ... Such access will not be supervised. Figures 4 to 7 do not show how the device bus is commissioned to the external bus (also referred to in this article as an additional segmentation detector 49 ^ ^ ^ bus to make I recognize θ + 92 Usually the women ’s volleyball team ’s external bus: None, devices (for example, device 47 ’s physical access request, will enter the above-self-hidden request is also included in _ # A 卩 sink slave bus. These memory accesses on the external bus Some signals that define the operation mode of the signal 87 200422849: for example, permission, ..., etc. According to the preferred embodiment of the present invention-memory access request also involves sending a domain signal to the external sink module According to the media, whether the device is operated on Full mode or non-secure. It is best to send the domain signal at the hardware level, and in the preferred case, 'capable of operating in a secure or non-secure domain — the device includes: Bit 1 to output this domain signal to the external bus' path 490. In order to describe it, on the external bus, outside the other route 488, the path 49 is displayed separately. Port network signal (this article Also refers to " S bit ") the device that confirms whether or not to issue a memory access request is operating in a secure or non-secure domain, and is received by a split detector 492 connected to an external bus Information: The segmentation detector 492 will also have access to the region of the segmentation information that confirms its memory. Security or non-security, and therefore can be arranged to allow only one device to access a specific part of the memory. The bit system is declared to confirm a security mode. By default, imagine that the s-bit is not declared, and therefore a pre-existing non-security device (such as device 472 shown in Figure 47) Will not output a declared S 7G, and therefore it is never allowed to access any security part of the memory by the partition detector 492, whether it is in the registry or buffers 482, 486 in the screen driver 480, the input / output interface 484, or in external memory Body 4 7 4. For descriptive purposes, it is used to arbitrate between memory access requests issued by a master device (such as device 47, 472) (arbiter's arbiter block 'system The decoder 478 independent of the appropriate memory 88 200422849 which determines the service memory access request and the independent detector 492 are explained. However, I will understand that one or more of the above components can be integrated in the same unit Medium, if desired. Figure 48 illustrates an alternative embodiment in which the segmentation detector 492 is not provided, and instead each memory device 474, 480, 484 is arranged to monitor its own memory access based on the value of the S bit. Therefore, if the device 470 is to declare a memory access request to a login 482 in the screen driver 480 marked as secure memory in the non-security mode, the screen driver 480 will determine that the S bit is not Declares, and does not process the memory access request. Therefore, it is conceivable that with the proper design of various memory devices, it is possible to avoid the need to provide a separate detector 492 on the external bus. In the above content of FIGS. 47 and 48, the "S bit" is The device for confirming that the memory access request is operated in a secure domain or a non-secure domain. Viewed from another perspective, the S bit can be regarded as indicating that the memory access request belongs to the secure domain. Or non-secure domains. In the embodiments described in Figures 37 and 38, a single MMU (along with a single-component page table) is used to perform virtual-to-physical address translation. In this way, The physical address space is usually divided between non-secure memory and secure memory in a simple mode as shown in Figure 49. For one of the memory units in a memory system, this article is a physical address Space 2 1 00 contains a range starting at address zero and extending to address Y, for example, external memory 5 6. For each memory unit, the addressable memory is usually cut into two parts, a first part 2 11 0 is assigned as non-security Sexual memory and a 89 200422849 part 2 1 2 0 are allocated as secure memory. In this way, I will understand that there are certain physical addresses that cannot be accessed by specific domains, and such differences The operating system used for these domains will be very obvious. The operating system used for security domains will know the existence of non-secure domains, and therefore will not care about this. In non-secure domains The operating system should preferably not need to know the existence of the security domain, but on the contrary, it should operate as if it is not in the security domain. In a further issue, we will understand that a non-security operating system knows the external memory The address space starts at address zero and extends to address X 'and the non-secure operating system does not need to know anything about the security core, and especially extends from address χ + 丨 to address γ The existence of security memory. Conversely, the security core will not know that its address space starts at address zero, which is usually not what one would expect from an operating system.-Implementation to alleviate the above concerns For example, by allowing a secure memory region to be completely unknown to a non-secure operating system with its physical address space, and by enabling the security core in the security domain and the non-security domain in the Non-security operating systems to know that the external memory's address space starts at address zero, as shown in Figure 51. Here, the physical address space 2 2 00 can be cut to secure or non-secure at the paging level In the example shown in Figure 51, the address space of the external memory shown is cut into four blocks 2210, 2220, 2230, and 2240, which contain two secure memory areas and two Non-secure memory area. Instead of converting between the virtual address space and the physical address space by a single paging table conversion, refer to a first paging table and a second paging table 90 200422849 to perform two separate layers Address translation, thereby introducing the concept of an intermediate address space 'depending on whether the processor is in a secure or non-secure domain, it can make different arrangements. In particular, as shown in FIG. 51, two security memory regions 2210 and 2230 in the physical address space are provided by using a descriptor 'physical address space provided in a set of page tables 2250. Able to map to a single region 2265 in the middle address space. For the operating system running on the processor, it will regard the intermediate address space as the physical address space 'and will use the MMU to transform the virtual address into the intermediate address space in the intermediate address space. Similarly, the intermediate address space 22 70 can be set for non-secure domains, where the corresponding descriptors in a non-secure paging table of the component page table 2250 will be two in the physical address space. The non-secure memory regions 2220 and 2240 are mapped to the non-secure region 2275 of the non-secure domain. In one embodiment, as shown in FIG. 50A, the translation of the virtual address to the physical address via the intermediate address is controlled by two independent MMUs. The MMUs 2150 and MMUs 2170 in FIG. 50A can be considered to be constructed in a similar manner to the MMU 200 shown in FIG. 37, but some details have been omitted for the sake of simplicity. The first MMU 2150 includes a micro-TLB 2155, a main TLB 2160, and translation table walking logic 2165. Similarly, the second MMU 2170 includes a micro-TLB 2175, a main TLB 2180, and translation table walking logic 2 1 8 5. The first MMU is controlled by a non-secure operating system when the processor is operating in a non-security domain, or is controlled by the security core when the processor is operating in a security domain 91 200422849. However, in a preferred embodiment, the second MMU can only be controlled by a security core or a monitoring program. When the processor core 10 issues a memory access request, it will

徑 2153 發出一虛擬位址至 micro-TLB 2155。micro.T£B 2155將儲存一些虛擬位址部分,其對應於自儲存在主要 TLB 2160中的描述符所截取的中間位址部分。在主要τlb 2 1 60的描述'符係截取自與第一 mMU 2 1 50相關的一第一組 分頁表的分頁表。如果在micro-TLB 2155中偵測到一符合 者,則micro-TLB 2155能夠經由路徑2157發出與經由路 徑2 1 5 3所接收的虛擬位址對應的一中間位址。如果在Path 2153 sends a virtual address to micro-TLB 2155. micro.T £ B 2155 will store some virtual address portions that correspond to the middle address portion intercepted from the descriptors stored in the main TLB 2160. The description of the main τlb 2 1 60 'symbol is taken from a paging table of a first set of paging tables associated with the first mMU 2 1 50. If a match is detected in the micro-TLB 2155, the micro-TLB 2155 can send an intermediate address corresponding to the virtual address received via the path 2 1 5 3 via the path 2157. If in

micro-TLB 2155中未有一符合者,則將參考主要TLB 2160以了解是否在主要TLB中偵測到一符合者。而如果 有的話,將截取虛擬位址部分和對應的中間位址部分至 m i c r 〇 - T L B 2 1 5 5,而後中間位址能夠經由路徑2 1 5 7發出。 如果在micro-TLB 2155和主要TLB 2160中未有一符 合者,則轉譯表行走邏輯2 1 65被用於為所需的描述符從可 被第一 MMU 2 1 50所存取之一第一組分頁表的一預定分頁 表發出一請求。通常,可能有相關於安全性網域或非安全 性網域的個別程序的分頁表,以及該些分頁表的中間基礎 位址將可被轉譯表行走邏輯2 1 6 5存取,例如從CP 1 5登錄 34中的適當登錄。因此,轉譯表行走邏輯2165能夠經由 路徑2167發出一中間位址,以自適當的分頁表請求一描述 符。 安排第二 MMU 2170為經由路徑 2157上接收 92 200422849 micro-TLB 2155或經由路徑2167接收轉譯表行走邏輯 2165所輸出之任何中間位址,以及如果在2175 中偵測到一符合者’則之後micro-TLB能夠經由路徑2192 發出所需的實體位址至記憶體,以經由資料匯流排219〇 截取需要的資料。如果經由路徑2157發出一中間位址,將 使需要的資料傳回到核心1 0,而對於經由路徑2丨67所發 出的一中間位址,這將使需要的描述符傳回到第一 mmu 2150,以在主要TLB 2160中儲存。 如果micro-TLB 2175有一不符者,則將參考主要TLB 2180’以及如果在主要TLB中有一符合者,則傳回需要的 中間位址部分和對應的實體位址部分至m i c r 〇 - T L B 2 1 7 5, 以促使micro-TLB 2175經由路徑2192發出需要的實體位 址。然而,如果在micro-TLB 2175或主要TLB 2180皆沒 有符合者,而後安排轉譯表行走邏輯2 1 8 5從相關分頁表經 由路徑2 1 94输出對需要的描述符的請求,又該相關分頁表 係在與一第二MMU 2170相關的分頁表的一第二組分頁表 中。該第二組分頁表包括使中間位址部分與實體位址部分 相關的描述符,以及通常對於安全性網域有至少一分頁表 和對於非安全性網域有一分頁表《當一請求經由路徑2 1 94 發出時,它將導致相關描述符從第二組分頁表傳回至第二 MMU 2170,以儲存在主要TLB 2180中。 第50A圖所述之實施例之操作現將藉由下文申之特例 進一步解說,其中縮寫VA指虛擬位址,ία指中間位址, 和PA指實體位址。 93 200422849 1) 核心發出 VA = 300 [ΙΑ = 5000, PA = 7000] 2) 在MMU 1的micro-TLB發現不符者 3) 在MMU 1的主要TLB發現不符者 分頁表1基礎位址 =8000 ΙΑ [PA = 10000] 4) 在MMU 1的轉譯表行走邏輯執行分頁表查詢 -發出 IA = 8003 5) 在MMU 2的micro-TLB發現不符者If there is no match in micro-TLB 2155, reference will be made to the main TLB 2160 to see if a match is detected in the main TLB. And if there is, the virtual address part and the corresponding middle address part will be intercepted to m i c r 0-T L B 2 1 5 5 and then the middle address can be sent out via the path 2 1 5 7. If there is no match in micro-TLB 2155 and main TLB 2160, the translation table walking logic 2 1 65 is used for the required descriptors from one of the first groups accessible by the first MMU 2 1 50 A predetermined paging table issues a request. In general, there may be paging tables for individual programs related to secure or non-secure domains, and the intermediate base addresses of these paging tables will be accessible by the translation table walk logic 2 1 6 5 such as from the CP 1 5 Log in as appropriate for 34. Therefore, the translation table walk logic 2165 can issue an intermediate address via path 2167 to request a descriptor from the appropriate paging table. Arrange the second MMU 2170 to receive any intermediate address output by the translation logic 2165 via path 2157 92 200422849 micro-TLB 2155 or via path 2167, and if a match is detected in 2175 'then micro -The TLB can send the required physical address to the memory via path 2192 to intercept the required data via the data bus 2190. If an intermediate address is issued via path 2157, the required data will be transmitted back to core 10, and for an intermediate address issued via path 2 丨 67, this will cause the required descriptors to be returned to the first mmu 2150 to store in the main TLB 2160. If there is a discrepancy between micro-TLB 2175, it will refer to the main TLB 2180 'and if there is a match in the main TLB, it will return the required middle address part and the corresponding physical address part to micr 〇- TLB 2 1 7 5 to cause micro-TLB 2175 to issue the required physical address via path 2192. However, if there is no match in micro-TLB 2175 or main TLB 2180, then the translation table walk logic 2 1 8 5 is output from the relevant paging table via path 2 1 94 to request the required descriptor, and the relevant paging table It is in a second group page table of a page table related to a second MMU 2170. The second set of page tables includes a descriptor that relates the middle address part to the physical address part, and usually has at least one paging table for secure domains and a paging table for non-secure domains. When 2 1 94 is issued, it will cause the relevant descriptors to be transferred back from the second set of page tables to the second MMU 2170 for storage in the main TLB 2180. The operation of the embodiment described in FIG. 50A will now be further explained by the special case described below, where the abbreviation VA refers to a virtual address, ία refers to an intermediate address, and PA refers to a physical address. 93 200422849 1) The core issues VA = 300 [ΙΑ = 5000, PA = 7000] 2) A discrepancy is found in the micro-TLB of MMU 1 3) A discrepancy is found in the main TLB of MMU 1 Paging Table 1 Base address = 8000 ΙΑ [PA = 10000] 4) Performing pagination table query in the translation logic of MMU 1-Issue IA = 8003 5) Mismatch found in micro-TLB of MMU 2

6) 在MMU 2的主要TLB發現不符者 分頁表2基礎位址 =12000 PA 7) 在MMU 2的轉譯表行走邏輯執行分頁表查詢 -發出 PA =12008 ”8000 IA = 10000 PA·’傳回作分頁表資料6) The main TLB of MMU 2 is found to be inconsistent. Paging table 2 base address = 12000 PA 7) Performs pagination table query on the translation logic of MMU 2-Issue PA = 12008 ”8000 IA = 10000 PA · ' Pagination table information

8) -儲存在MMU 2的主要TLB8)-Primary TLB stored in MMU 2

9) -儲存在 MMU 2 的 micro-TLB 10) 在MMU 2的micro-TLB現在有符合者(hit) -發出 PA =10003 ,,3000 VA = 5000 ΙΑ,’傳回作分頁表資料9)-micro-TLB stored in MMU 2 10) micro-TLB in MMU 2 now has hits

11) -儲存在MMU 1的主要TLB11)-Primary TLB stored in MMU 1

12) -儲存在 MMU 1 的 micro-TLB 13) 在MMU 1的micro-TLB現在有符合者(hit) 發出ΙΑ = 5000以執行資料存取 14) 在MMU 2的micro-TLB發現不符者 15) 在MMU 2的主要TLB發現不符者 16) 在MMU 2的轉譯表行走邏輯執行分頁表查詢 94 200422849 -發出 PA = 12005 ”5000 ΙΑ = 7000 PA"傳回作分頁表資料12)-The micro-TLB stored in MMU 1 13) The micro-TLB in MMU 1 now has a hit (hit) Issue IA = 5000 to perform data access 14) The non-conformance found in the micro-TLB of MMU 2 15) A discrepancy was found in the main TLB of MMU 2. 16) The translation logic of the MMU 2 walks through the paging table query.

17) -儲存在MMU 2的主要TLB17)-Primary TLB stored in MMU 2

18) -儲存在 MMU 2 的 micro-TLB 19) 在MMU 2的micro-TLB發現符合者(hit) -發出 PA = 7000以執行資料存取 2〇)在實體位址7000的資料被傳回至核心 下一次核心發出一記憶體存取請求(稱為VA 3〇〇1.) 1) 核心發出 VA = 3001 2) 在MMU 1的micro-TLB發現符合者,請求IA 5〇〇1 發出至MMU2 3) 在MMU 2的micro-TLB發現符合者,請求pA 7〇〇1 發出至memory 4) 在PA 7001的資料被傳回至核心。 吾人將了解,上述示例中在MMU的micr〇_TLB和主 要TLB所發生的不符者,以及因此該示例代表示「最壞情 況下」的歷程。通常,預期在micro-TLBs或主要TLB中 之至少一個發現一符合者,從而大大地減少截取資料的時 間。 回到第5 1圖,在一安全性區域的較佳實施例中,在實 體位址空間的某一特定區域中通常提供第二組分頁表 2250。第一組分頁表可以分成兩種類型,即安全性分頁表 95 200422849 和非安全性分頁表。較佳的實施例為,該些安全性分頁表 將連續出現在該中間位址空間2 2 6 5中,在非安全性中間位 址空間2275中的非安全性分頁表亦然。然而,它們不需要 被連續置於實體位址空間中,而因此,例如,第一組分頁 表的安全性分頁表可以遍及安全性區域2210、2230,以及 以類似方法非安全性分頁表可以遍及非安全性記憶體區域 2220 和 2240 〇 如先前所述,使用兩組分頁表的二層方法之主要優點 之一對安全性網域的作業系統和非安全性網域的作業系統 而言,能夠安排該實體位址空間在零點開始,其通常是一 作業系統所期望的。額外的安全性記憶體區域可以完全不 為具有自身的「實體位址」空間的非安全性作業系統所知, 因為它視它的實體位址空間為中間位址空間其能夠被安排 為具有中間位址的連續序列。 此外,使用此類方法可以大大地簡化在非安全性記憶 體和安全性記憶體之間的記憶體轉換區域的處理。如第5 2 圖所示。能夠從第52圖知道,記憶體的一區域2300,例 如一單一分頁記憶體,可以存在於非安全性記憶體區域 2220中,以及同樣地記憶體區域2310可以存在於安全性 記憶體區域2210中。然而,上述兩記憶體區域2300和2310 可能藉由在第二組分頁表中改變相關描述符而易於被調 換,以使區域23 00現下變成一安全性區域其映射至安全性 網域的中間位址空間中的區域2305,而區域2310現下變 成一非安全性區域其映射至非安全性網域的中間位址空間 96 200422849 的區域23 1 5。在安全性網域非安全性網域中,其可以完全 清楚地發生在作業系統,因為從實體位址空間的觀點確實 分別是安全性網域或非安全性網域的中間位址空間。因 此,該方法在每一作業系統中避免實體位址空間的任何再 次定義。 現將參照第5 0B圖描述本發明的一選擇性實施例,其 亦使用二MMU,但以不同於第50A圖之安排。比較第50A 圖和第5 0B圖可以知道,安排幾乎相同,但是在該實施例 中,安排第一 MMU 2150以執行虛擬位址至實體位址的轉 譯,以及安排第二MMU執行中間位址至實體位址的轉譯。 因此,相反用於第50A圖之實施例,自第一 MMU 2150的 micro-TLB 2155 至第二 MMU 2170 的 micro-TLB2175 之路 徑,安排第一 MMU的micro-TLB 2155經由路徑2192直 接輸出一實體位址,如第50B圖所示。在第50B圖所示之 實施例的操作現將藉由下文中的特例解說《其中,核心記 憶體存取請求的詳細程序係相同於先前在第5 0 A圖所示 者。 1) 核心發出 VA = 300 [IA = 5000,PA = 7000] 2) 在MMU 1的micro-TLB和主要TLB發現不符者 分頁表1基礎位址=8000 ΙΑ [PA = 10000] 3) 在MMU 1的轉譯表行走邏輯執行分頁表查詢 -發出 IA = 800318)-The micro-TLB stored in MMU 2 19) A match was found in the micro-TLB of MMU 2 (hit)-PA = 7000 is issued to perform data access 2) The data at the physical address 7000 is returned to The next time the core issues a memory access request (called VA 3〇01.) 1) The core sends VA = 3001 2) A matcher is found in the micro-TLB of MMU 1 and requests IA 5001 to be sent to MMU2 3) If a match is found in the micro-TLB of MMU 2, request pA 7001 to the memory 4) The data in PA 7001 is transmitted back to the core. I will understand that the discrepancy between the micr0_TLB and the main TLB of the MMU in the above example, and therefore the example represents the "worst case" process. Generally, it is expected that a conformer will be found in at least one of the micro-TLBs or the main TLB, thereby greatly reducing the time to intercept the data. Returning to FIG. 51, in a preferred embodiment of a security area, a second set of page tables 2250 is usually provided in a specific area of the physical address space. The first group of page tables can be divided into two types, namely, security paging tables 95 200422849 and non-security paging tables. In a preferred embodiment, the security paging tables will continuously appear in the middle address space 2 2 65, and the same is true for the non-security paging tables in the non-secure middle address space 2275. However, they do not need to be consecutively placed in the physical address space, and therefore, for example, the security paging table of the first group of page tables can be spread across the security areas 2210, 2230, and in a similar manner, the non-security paging tables can be spread across Non-secure memory regions 2220 and 2240. As mentioned earlier, one of the main advantages of the two-tier approach using two-component page tables is that for operating systems in secure domains and operating systems in non-secure domains, Arrange the physical address space to start at zero, which is usually what an operating system would expect. The extra secure memory area can be completely unknown to a non-secure operating system with its own "physical address" space, because it treats its physical address space as an intermediate address space which can be arranged to have intermediate A continuous sequence of addresses. In addition, the use of such methods can greatly simplify the processing of memory transition regions between non-secure and secure memory. As shown in Figure 5 2. As can be seen from FIG. 52, a region 2300 of the memory, such as a single page memory, may exist in the non-secure memory region 2220, and similarly, the memory region 2310 may exist in the secure memory region 2210. . However, the above two memory regions 2300 and 2310 may be easily swapped by changing the relevant descriptors in the second set of page tables, so that region 23 00 now becomes a security region that maps to the middle of the security domain. Area 2305 in the address space, and area 2310 now becomes a non-secure area which maps to the area 23 1 5 of the intermediate address space 96 200422849 of the non-secure network domain. In a secure domain and a non-secure domain, it can occur completely clearly in the operating system, because from the perspective of the physical address space, it is indeed the intermediate address space of the secure domain or the non-secure domain, respectively. Therefore, the method avoids any redefinition of the physical address space in each operating system. An alternative embodiment of the present invention will now be described with reference to FIG. 50B, which also uses two MMUs, but in an arrangement different from that of FIG. 50A. Comparing Figure 50A and Figure 50B, it can be seen that the arrangements are almost the same, but in this embodiment, the first MMU 2150 is arranged to perform the translation of the virtual address to the physical address, and the second MMU is arranged to perform the intermediate address to Translation of physical addresses. Therefore, for the embodiment shown in FIG. 50A, the path from the micro-TLB 2155 of the first MMU 2150 to the micro-TLB 2175 of the second MMU 2170 is arranged. The micro-TLB 2155 of the first MMU directly outputs an entity via the path 2192. Address, as shown in Figure 50B. The operation of the embodiment shown in Fig. 50B will now be explained in the following special case. "The detailed procedure of the core memory access request is the same as that previously shown in Fig. 50A. 1) The core issues VA = 300 [IA = 5000, PA = 7000] 2) A discrepancy is found between the micro-TLB and the main TLB of MMU 1 Page 1 Base address = 8000 ΙΑ [PA = 10000] 3) On MMU 1 Translation table walk logic executes paging table query-issue IA = 8003

4) 在MMU 2的micro-TLB和主要TLB發現不符者IA 8003 97 2004228494) A discrepancy between the micro-TLB and the main TLB of MMU 2 is found. IA 8003 97 200422849

分頁表2基礎位址= 12000 PA 5) 在MMU 2的轉譯表行走邏輯執行分頁表查詢 -發出 PA =12008 "8000 IA = 10000 PA"傳回作分頁表資料 6) "8000 IA — 10000 PA"映射儲存在MMU 2的主要Base address of paging table 2 = 12000 PA 5) Execute the paging table query in the translation logic of MMU 2-Issue PA = 12008 " 8000 IA = 10000 PA " Return as paging table data 6) " 8000 IA — 10000 PA " maps stored in MMU 2 main

TLB 和 micro-TLB 7) 在MMU 2的micro-TLB現在自步驟(3)轉譯至pA 1003並發出取回(fetch) "3000 VA = 5000 ΙΑ”傳回作分頁表資料TLB and micro-TLB 7) The micro-TLB at MMU 2 is now translated from step (3) to pA 1003 and issued a fetch " 3000 VA = 5000 ΙΑ "is returned as pagination table data

5月注意·該轉澤由MMU1保留在暫存中,但不直接儲 存在任何TLB 8) MMU 1的轉譯表行走邏輯現在發出LA = 5000的 請求至MMU2 9) 在MMU 2的miCr〇-TLB和主要TLB發現不符者 IA 5000 10) 在MMU 2的轉譯表行走邏輯執行分頁表查詢 -發出 PA =12005 π5000 IA = 7000 PA”傳回作分頁表資料Note in May · This translation is retained in the temporary storage by MMU1, but is not directly stored in any TLB 8) The translation logic of MMU 1 walking request now sends a request of LA = 5000 to MMU2 9) miCr0-TLB IA 5000 found to be inconsistent with the main TLB. 10) Perform pagination table query in the translation logic of MMU 2-Issue PA = 12005 π5000 IA = 7000 PA.

11) MMU 2 儲存"500〇 ΙΑ = 7000 ΡΑ"在 micro-TLB 和主要TLB中。該轉譯亦連至mmU 1。11) MMU 2 is stored " 500 00 ΙΑ = 7000 ΡΑ " in micro-TLB and main TLB. The translation is also connected to mmU 1.

12a) MMU 2發出pa = 7000存取至記憶體 12b) MMU 1 結合 ”300〇 VA = 5000 ΙΑ,,和 π5〇〇〇 IA = 7000 PA1’描述符以給定一 ”3〇〇〇 va = 7000 PA"描述符,其 儲存在MMU 1的主要tLB和micro-TLB 98 200422849 13)在PA 7000的資料被傳回至核心 下-人核〜發出一記憶體存取請求(稱為VA 3001 .·) 1) 核心發出 VA = 3〇〇1 2) 在MMU 1的micr〇-TLB發現符合者,mmu ι發出 PA = 7001的請求 3) 在PA 7001的資料被傳回至核心。 自第5 0 A圖所提供之上述示例的比較可以看出,這裡 的主要差別在第7步驟,其中MMU 1不直接儲存第一表 描述符,以及在第12b步驟(12a和12b能夠同時發生)其 中MMU 1亦接收IA->PA轉譯並進行結合以及在它的TLBs 中儲存結合的描述符。 因此,吾人可以了解,當選擇性實施例仍然使用兩組 分頁表來使虛擬位址轉換成實體位址,事實上是當一符合 者發生在 micro-TLB 2155 或主要 TLB 2160 時,micro-TLB 2155和主要TLB 2160儲存虛擬位址至實體位址的轉譯, 以避免需要在該兩MMU中執行查詢。在這種情況下,第 一 MMU可以直接自核心控制請求,而無需參照第二MMU。 吾人將了解,能夠安排第二 MMU 2170 不包括 micro-TLB 2175和主要TLB 2180,其中分頁表行走邏輯 2185用於需要由第二MMU控制的每一請求。它可以為第 二MMU節省複雜度和消耗,和可以可接受只需要相對少 的第二 MMU的假設。因為每一請求將需要使用第一 99 200422849 MMU,通常在第一 MMU 2150 包括 micro-TLB 2155 和主 要TLB 2160較為有利,以改進第一 MMU的作業速度。 應該注意的是分頁表中的分頁可以改變大小,以及因 此可能有兩半的轉譯之描述符與不同大小的分頁相關。通 常,MMU 1的分頁比MMU 2分頁小,但這並非必要的。 例如: 表 1 在 0x40003 000 映射至 0x00081000 之 4Kb 表 2 在 0x00000 000 映射至 0x02000000 之 1 Mb 此處,兩大小中的最小者必須用於結合轉譯,所以索:t 合描述符是 在 0x40003 00 0 映射至 0x02 081000 之 4Kb 然而,資料在情境間的調換(如先前參照第5 2圖所述) 係可能反向的,例如: 表 1 在 OxcOOOOOOO 映射至 0x00000000 之 1Mb 表 2 在 0x00042000 映射至 0x02042000 之 4Kb 現下,在位址〇xc0042010之一查詢從核心給定映射: 在 0xc0042000 至 0x02042000 之 4Kb 即,該二大小中的最小者總是用於結合映射。 請注意,第二情況中,處理較不有效率,因為在存取 不同的4Kb區域時,表1中的描述符(1Mb)將反覆查尋和 100 200422849 放棄。然而,在一典型系統中,大多數的情況下,表2的 描述符將較大(如第一示例所述),其更有效(能夠使1 Mb 映射為指向ΙΑ空間的適當部分之其它4Kb分頁再使用)。 如第50A、50B圖所示,使用二分離MMU的選擇性方 法’單一 MMU能夠使用於第53圖,其中當主要TLB 2420 出現一不符者時,甴MMU產生一異常(其使軟體在核心10 中執行以依據來自兩組不同分頁表的描述符之結合產生虛 擬至實體位址轉譯。尤其是,如第53圖所示,核心1〇與12a) MMU 2 issues pa = 7000 access to memory 12b) MMU 1 combines "30000VA = 5000 IA, and π50000IA = 7000 PA1 'descriptor to give one" 30000va = 7000 PA " descriptor, which is stored in the main tLB and micro-TLB 98 of 2004 MMU 1) 13) The data of PA 7000 is transferred back to the core-human core ~ issue a memory access request (called VA 3001. ·) 1) The core issues VA = 3001. 2) A match is found in the micr0-TLB of MMU 1 and mmmu sends a request of PA = 7001. 3) The data in PA 7001 is transmitted back to the core. From the comparison of the above example provided in Figure 50 A, it can be seen that the main difference here is in step 7, where MMU 1 does not directly store the first table descriptor, and in step 12b (12a and 12b can occur simultaneously) ) Among them, MMU 1 also receives IA-> PA translation and combines, and stores the combined descriptors in its TLBs. Therefore, I can understand that when the alternative embodiment still uses two sets of page tables to convert the virtual address into a physical address, in fact when a conformer occurs in micro-TLB 2155 or main TLB 2160, micro-TLB The 2155 and the main TLB 2160 store the translation of the virtual address to the physical address to avoid the need to perform queries in the two MMUs. In this case, the first MMU can control the request directly from the core without having to refer to the second MMU. I will understand that being able to schedule the second MMU 2170 does not include the micro-TLB 2175 and the main TLB 2180, where the paging table walking logic 2185 is used for every request that needs to be controlled by the second MMU. It can save complexity and consumption for the second MMU, and can accept the assumption that only a relatively small number of second MMUs are needed. Because each request will require the use of the first 99 200422849 MMU, it is usually advantageous to include the micro-TLB 2155 and the main TLB 2160 in the first MMU 2150 to improve the operating speed of the first MMU. It should be noted that the pages in the paging table can be resized, and thus there may be two halves of the translated descriptors associated with pages of different sizes. In general, the paging of MMU 1 is smaller than the paging of MMU 2, but this is not necessary. For example: Table 1 maps to 4Kb at 0x40003 000 to 0x00081000 Table 2 Maps to 1 Mb at 0x00000 000 to 0x02000000 Here, the smallest of the two sizes must be used in conjunction with translation, so the: t combination descriptor is at 0x40003 00 0 Mapping to 4Kb of 0x02 081000 However, the exchange of data between contexts (as described earlier with reference to Figure 52) may be reversed, for example: Table 1 Mapping from 0x00000000 to 1Mb at 0x0004000000 4Kb Now, query the given mapping from the core at one of the addresses 0xc0042010: 4Kb at 0xc0042000 to 0x02042000 That is, the smallest of the two sizes is always used to combine the mappings. Please note that in the second case, the processing is less efficient, because when accessing different 4Kb regions, the descriptor (1Mb) in Table 1 will be searched repeatedly and discarded by 100 200422849. However, in a typical system, in most cases, the descriptors of Table 2 will be larger (as described in the first example), which is more efficient (capable of mapping 1 Mb to other 4Kb pointing to the appropriate part of the IA space) Paging again). As shown in Figures 50A and 50B, a selective method using two separate MMUs' Single MMU can be used in Figure 53. When a discrepancy occurs in the main TLB 2420, the 甴 MMU generates an exception (which causes the software to To execute virtual to physical address translation based on a combination of descriptors from two different sets of paging tables. In particular, as shown in Figure 53, cores 10 and 10

MMU 2400 連結(其包括一 micro-TLB 2410 和一主要 TLB 2420°當核心10發出一記憶體存取請求時,經由路徑243〇 提供虛擬位址,以及如果在micro-TLB觀察到一符合者 時,則對應的實體位址經由路徑244〇上直接輸出,使該資 料經由路徑2450傳回核心1〇。然而,如果在mic^TLB 241〇有不符者,則參考主要tlb 242〇以及如果在主要tlb 中各有相關的描述4,則相關的虛擬位址部分以及到對應 實體位址部分被截取至miTLB241G,之後,實體位址 月夠、座由路& 2440發出。然而,如果主| tlb也產生不 符者’則產生一異常經由路徑2422送至核心。現下將參照 第54圖進一步描述在核心中自接收此類異常後的處理。 在第54圖所示,如果在第25〇〇步驟由核心偵測到 一 TLB不符者異常,則核心在第251〇步驟為該異常以一 預狄向量進入監控模式。此時它將使分頁表與執行的程式 碼合併卩執行纟帛54圖所示之步驟的其餘部分。 尤其是,在第2520步驟,經由路徑243〇發出虛擬位 101 200422849 址和截取在micro-TLB 2410和主要tlb 242〇所產生之不 符者(此後,稱為錯誤虛擬位址(心川叩virtual s))之i,依據在第一組表格的適當表格的中間基 礎位址,在第2530步驟決定所需第-描述符之中間位址。 决定了中間位址(通常用虛擬位址與中間基礎位址之 某種預設的結合),而後參照在第二組表格中的相關表,以 為該第-描述符獲得對應的實體位址。此後,在第255〇MMU 2400 link (which includes a micro-TLB 2410 and a primary TLB 2420 °) When the core 10 issues a memory access request, a virtual address is provided via path 2440, and if a conformer is observed in the micro-TLB , The corresponding physical address is directly output via path 2440, so that the data is returned to core 10 via path 2450. However, if there is a discrepancy in mic ^ TLB 241〇, refer to the main tlb 242〇 and if the main Each tlb has a related description4, then the relevant virtual address part and the corresponding physical address part are intercepted to miTLB241G. After that, the physical address is enough, and the block is issued by Road & 2440. However, if the main | tlb If a discrepancy is also generated, an exception is generated and sent to the core via path 2422. The processing after receiving such an exception in the core will be further described with reference to FIG. 54. As shown in FIG. 54, if it is at step 2500 When the core detects an abnormality of the TLB non-compliance, the core enters the monitoring mode with a predetermined vector for the exception at step 2510. At this time, it will merge the paging table with the executed code and execute it.纟 帛 54 The rest of the steps shown in Figure 54. In particular, in step 2520, the virtual bit 101 200422849 is issued via path 243〇 and the discrepancies generated between micro-TLB 2410 and main tlb 242〇 (hereafter, Called the wrong virtual address (心 川 叩 virtual s)), i, based on the intermediate base address in the appropriate table of the first set of tables, determines the intermediate address of the required -descriptor in step 2530. Middle address (usually using a predetermined combination of virtual address and intermediate base address), and then referring to the related table in the second set of tables to obtain the corresponding physical address for the first descriptor. Thereafter, On the 255th

步驟’能夠從記憶體取得第—插述符決定錯誤虛擬位址的 中間位址。 而後,在第2560步驟,再次參考第二表以找尋第二描 述符以替錯誤虛擬位址的中間位址給定實體位址。此後在 第2570步驟,取回該第二描述符以獲得錯誤虛擬位址的實 體位址。 一旦已經獲得了上述資訊,則程式使第一和第二描述 符。併以產生給定需要的虛擬位址至實體位址轉譯的新描 述符,第2 5 8 0步驟執行該步驟。以先前參照第5 〇B圖所Step 'can obtain the first-insert from memory to determine the middle address of the wrong virtual address. Then, in step 2560, refer to the second table again to find the second descriptor to give the physical address for the middle address of the wrong virtual address. Thereafter in step 2570, the second descriptor is retrieved to obtain the physical address of the wrong virtual address. Once the above information has been obtained, the program makes the first and second descriptors. And in order to generate a new descriptor for the required virtual address to physical address translation, step 2585 performs this step. As previously referred to Figure 5 〇B

述之類似方法,由軟體再次執行合併把最小的分頁表大小 用於結合的轉譯。此後,在第2590 ·步驟,在主要TLB 2420 中儲存該新的描述符,而後程序在第2595步驟自異常返 回〇 此後,安排核心1 〇經由路徑2430為記憶體存取請求 再次發出虛擬位址,其仍將在micro-TLB 2410產生不符 者,但是現下將在主要TLB 2420產生一符合者。因此, 虛擬位址部分和對應實體位址部分能夠被截取至 102 200422849 micro-TLB 2410 ’ 之後,micro_TLB 2410 能夠經由路撰 2440 ’使所需的資料經由路徑2450傳回核心10。 吾人將了解’在先前參照第50A圖和第50B圖所述之 選擇性實施例中’藉由軟體使用上文中參照第5 3圖和第 54圖所述之原則,管理在上述實施例中的MMU之一或二 者。 不論是否如第5〇A圖或第50B圖所示般使用二 MMU,或如第53圖所示般使用一 MMU,當在監控模式操 作時由處理器管理第二組分頁表的事實(或選擇性地在一 權限安全性模式中)確保該些分頁表為安全性者。結果,當 處理器在非安全性網域中時,其只能夠看見非安全性記憶 體因為田在非女全性網域中時,只能由處理器所能看見 的第一組分頁表為非安全性網域產生中間位址空間。結 果’不需要提供一分割檢測器作為如第一圖所示之記憶體 管理邏輯3 0的部分。然而,在外部匯流排上仍然提供分 割檢測器以監控由其它匯流排主控器在系統中進行的存 取〇 在先前參照第_ % j 7圖和第3 8圖所討論之實施例中,提 供—與^^ U 2 0 0相關 相關之分割檢測器222,和因此當要在該 快取38中執行存取眛 + · 1 寻’在micro-TLB 206中已經先執行了 一查詢’以及因此已组 ‘檢查了存取許可(尤其是安全性和非 安全性許可)。因此,+ 在此類實施例中,不能由非安全性應 用在快取38中儲存炎γ # 予女全性資料。對快取的存取係在由 分割檢測器222所勃/ 、, 仃之分割檢測之控制下,以及因此不 103 200422849 能在非安全十: 然而,在 並非為經由: 資料處理設1 測器,用以j 在此類實施i 系統匯流排 和快取3 8, 因此需要某, 式中操作時 資料存取。 第55 備,其中提, 進行之存取 查邏輯。如: 至系統匯流^ 連結。核心 面42連接至 一^控制®流^ 核心1 0 界面42可視 亦作為一裝j 排連結,例: 472。亦連接 4•模式中執行斜安全性資料的存取。 .本發明之一選擇性實施例中,分割檢測器222 备統匯流排4〇所進行之監控存取所提供,反之 背僅有與外部匯流排70連結的一單一分割檢 監控連接至外部匯流排的記憶體單元的存取。 列中’此時它意味著處理器核心1 〇能夠存取與 40直接連結的任何記憶體單元,例如τ〇μ36 而無需由外部分割檢測器監督該些存取,以及 生機制以確保處理器核心1 〇在一非安全性模 ’不會存取在該快取38或TCM 36中非安全性 圖依據本發明的一實施例圖示一資料處理設 供一機制以使快取38和/或TCM 36控制對其 ,而無需提供與MMU 2〇〇相關之任何分割檢 第55圖所示,核心1〇係藉由mmu 200連接 非40,快取38和TCM 36亦與系統匯流排4〇 10、快取38和TCM 36係藉由外部匯流排界 外部匯流排70,其包含一位址匯流排2620、 非2630和一資料匯流排2640,如第55圖所示。 、MMU2〇〇、快取38、TCM36和外部匯流排 為構成連接至外部匯流排70之一單一裝置, 复匯流排,以及其它裝置亦可與上述裝置匯流 如安全性週邊裝置47〇或非安全性週邊裝置 至裝置匯流排70的是一或多數的記憶體單 104 200422849 元,例如外部記憶體5 6。此外,一匯流排控制單元 係連接至裝置匯流排70,並通常包括一判優器2652、 碼器2654和一分割檢測器2656。為了對連接裝置匯 的元件之操作進行一般的討論,應參照先前描述的I 圖’判優器、解碼器和分割檢測器係被顯示為一個別 塊’但是當置於單一控制方塊2650中時,該些元件以 的方法運作。 在第56圖中進一步詳述第55圖中的MMU 2 00。 將第56圖與第37圖進行比較,可以看到MMU 200 與第37圖MMU完全相同的方法建構,唯一的差別是 檢測器222並非供作監視在主要TLB 208和micro 2〇6之間經由路徑242的資料傳送。如果處理器核心 出指定一虛擬位址的記憶體存取請求,而後記憶體存 求將繞經MMU 200,和以稍早第37圖所述般處理 micro-TLB 206經由路徑238輸出一實體位址至系統 排40。反之,如果記憶體存取請求直接指定一實體么 這將略過MMU 200,並經由路徑236直接繞送至系統 排40。在一實施例中,只有當處理器在監控模式中 時’產生直接指定實體位址之記憶體存取請求。 回顧先前對MMU 200之敘述,和尤其是第43圖 述’主要TLB 208將含有一些描述符435 ,以及對每 述符將提供一網域旗標425以確定是否對應的描述符 自一安全性分頁表或一非安全性分頁表。上述描述符 和相關的網域旗標425係在第55圖中的MMU 2〇〇中 2650 一解 流排 % 47 的區 相同 藉由 係以 分割 -TLB 10發 取請 ,從 匯流 乙址, 匯流 操作 的描 一描 係來 435 概要 105 200422849 地描述。 當核心1 〇發出一記憶體存取請求時,將導係該記憶 存取請求的一實體位址被輸出至系統匯流排4 0,以及通 此時快取3 8將執行一查詢程序,以決定是否該位址所指 資料項係儲存在該快取中。只要在該快取中發生一不 者,即其決定屬於該存取請求的資料項未儲存在該快 中,由快取啟始一線填充(linefill)程序,以從外部記憶 5 6截取一行資料其包括屬於記憶體存取請求的資料項。 其是,該快取將藉由 EBI 42輸出一線填充請求至裝置 流棑70的控制匯流排2630,和一開始位址輸出至位址 流棑2620。此外,一 HPROT信號將經由路徑2632輸出 控制匯流排2630,其將包括當發出記憶體存取請求時之 定核心操作模式的網域信號。因此,能夠將線填充程序 為快取3 8對外部匯流排之原始記憶體存取請求的傳播。 由分割檢測器2656接收該HP ROT信號,和因此確 該分割檢測器當外部記憶體存取請求發出時,是否裝置 外部記憶體5 6所請求的指定資料(在這種情況下,該裝 與核心10和快取38共同作用)係在安全性網域或在非安 性網域中操作。分割檢測器2656亦將存取確認記憶體區 係安全性或非安全性之分割資訊,和因此能夠決定裝置 否允許存取其所請求的資料。因此,如果在HPROT信 中的網域^號(也如S位元本文中提到)宣告確認到對該 料的存取係由該敬置所請求,則當在一安全性模式中操 時,能夠女排分割檢測器僅允許一裝置存取記憶體之一 體 常 定 符 取 體 尤 匯 匯 至 指 視 認 白 置 全 域 是 號 資 作 安 106 200422849 全性部.分。 如果該分割檢測器決定不允許該核心1 0存取所請求 的資料,例如,因為HPROT信號已確認該核心並非在一 非安全性模式下操作,但是線填充請求企圖自記憶體之一 安全性區域中的外部記憶體取回資料,則分割檢測器265 6 發出一中止信號至控制匯流排2630(其將經由路徑2636傳 回至EBI 42,導致經由路徑2670向核心1〇發出中止信 號。然而,如果分割檢測器2656決定允許存取,則輸出一 S私籤信號,以確定自外部記憶體截取的資料是安全性資 料或非女全性資料,以及該S標籤信號經由路徑2 6 3 4至 傳回至EBI 42 ,和設定相關於快取線26〇〇之旗標屬於線 填充處理。 同時,控制邏輯2650授權外部記憶體56所出所請求 之線填充資料,藉由EBI 42經由路徑268〇傳回資料至快 取38,以儲存於相關的快取線26〇〇。因此,該處理之結果, 用外部記憶體56的資料項填充快取中所選擇的快取線將 填滿來自外部記憶體56之資料項,該些資料項包括屬於來 自核心1〇之原始記憶體存取請求的資料項。屬於來自該核 心記憶體存取請求的資料項之後能夠被選擇性地自快取 38傳回核心,或能夠選擇性地經由路徑266〇從ebi 42傳 回至核心1 0以直接提供。 因it在較佳實施例中,由上述線填充處理將導致快 取線原始儲存資料之發生,與該快取線相關的旗標2602 將依據分割撿測器2656所提供的值進行設定,以及之後將 107 200422849 由快取38使用該面旗標以直接控制對快取線26〇〇中的資 料項的任何爾後之存取。因此,如果之後核心1 〇使在快取 38的一特定快取線2600產生一符合者之記憶體存取請求 發出,該快取38將檢查相關的旗標26〇2之值,並將該值 與核心1 0現有操作模式之值比較。在較佳實施例中,由在 CP 1 5網域狀態登錄中的監控模式所設定之一網域位元指 示核心1 〇所操作之現有模式。因此,當處理器核心丨〇在 操作於一安全性操作模式中時,能夠安排快取3 8只允許在 一快取線中的資料項,其被對應的旗標2602指示為可由處 理器核心1 0所存取的安全性資料《當核心在一非安全性模 式中操作時,核心存取快取3 8中的安全性資料之任何意 圖,將導致經快取3 8經由路徑2 6 7 〇產生中止信號。 能夠以多種方法設立T c M 3 6。在一實施例中,其能 夠像快取般建立,和安排實施例為包括多數線2 6 1 〇,藉由 與該快取38相同的方法,其每一具有與之相關的一旗標 2612。使用與先前所述之快取38完全相同的方法管理對 TCM 36的存取,和導致一線填充處理執行之任何TCM不 符者,其結果為資料將被截取至—特定線26 1 0,以及分割 檢測器2656將產生需要的S標籤值,用以儲存與該線2610 相關的旗標2 6 1 2。 在一選擇性實施例中,可以使TCM 36設立為外部記 憶體56的延伸和用以儲存經常儲存被處理器使用的資 料,因為經由系統匯流排對TCM的存取通常比對外部記憶 體的存取更快速。在此類實施例中,TCM 3 6不使用旗標 108 200422849 2612 ’反之使用一不同機制來控制對tcm的存取。尤其 如先别所述在此類實施例中,提供可由處理器設立之 一控制旗標,當在一權限安全性模式中執行時指示是否只 有在執行於一權限安全性模式下時,可由處理器控制緊接 β己憶體,或當執行於至少一非安全性模式中時,可由處理 控制 由女全性作業系統設置控制旗標,和實際定義是 否可由權限安全性模式或非安全性模式控制。因此, 所此夠定義一架構係TCM只能在當處理器在一權限安全 眭模式中操作時被控制。在此類實施例中,對控制登 錄之任何存取意圖將導致進入一未定義的指令異常。 在選擇性的架構中,當在一非安全性模式中操作時, 能夠由處理器控制TCM。在此類實施例中,只由非安全性 應用使用該TCM。不能夠儲存任何安全性資料或從 載入。因此,當執行一安全性存取時,在中不執行任 何查詢,以了解位址是否與該TCM位址範圍符合。 第57圖之流程圖說明當操作於處理器核心丨〇之一非 女全性程式產生一虛擬位址時,由第55圖的設備所執行之 處理,首先,在第2705步驟,在micr〇-TLB 2〇6中執行一 查珣,以及如果它產生—符合者,則micr〇 TLB在第 步驟檢查存取許可。參照第56圖,該程序能夠視為由存取 許可邏輯202執行。 如果在第2705步驟,在micro-TLB査詢發生—不符 者,則在非安全性描述符儲存於其中的主要tlb2〇8執二 一查詢(第2710步驟)。如果它產生一不符者,則在第2715 109 200422849 步驊執打一分頁表行走程序(如先前參照第3 7圖所討論 者),其中在第2720步驟以後,它決定主要Tlb含有該有 效梯籤(tagged)的非安全性描述符。如果在第271〇步驟產 生/符合者’則程序直接進行至第2720步驟。 此後,在第2725步驟,micrQ.TLB把含有實體位址的 描述符的部分載入,其後在第273〇步驟micr〇 TLB檢查 該些存取許可。 如果在第2730步驟發現有一違反存取許可者,則程序 進行至第2740步驟,其中經由路徑23〇發出中止信號至處 理器核心(類似於在第55圖所示之路徑267〇)。然而,如 果未伯測到違反者,則在第2745步驟決定是否該程序與一 可快取的資料項相關。否則,則在第279〇步驟初始一外部 存取,以企圖自外部記憶體56截取資料項。在第2795步 騨,分割檢測器2656將決定是否有安全性分割違反,即, 如果處理器核心10在一非安全 r 生模式中操作時企圖存取 在安全性記憶體中的一資料項,以及如果摘測到一違反 者,則分割檢測器2656將在第277<水邮女 肘隹第2775步驟產生令止信號。 然而’假設沒有安全性分名丨眘 -另女金〖生刀割違反,則程序進行至第2785 步驟,其為資料存取所發生處。 的,則在第2750步驟在快 貝疋了决取 摘測到…者,則在第2二 快取查詢’以及如果 線V驟快取決定是否有安全性 線‘籤違反。因此’在該階段 ^ ^ & »» ^ Γ、取將檢查與包含資料項 取線相關的旗標之值,和將把該旗標的值與核心 200422849 1 〇作業模式比較,以決定是否授權核心存取請求的資料 項。如果偵測到一安全性線標籤違反,則程序進行至第 2 760步驟,其中由快取38產生一安全性違反錯誤中止信 號和經由路徑2670發出至核心10。然而,假設在第2755 步驟未偵測到安全性線標籤違反,則在第2785步驟執行資 料存取。 如果當快取查詢在第2750步驟執行時發生一快取不 符者,則在第2765步驟初始一快取線填充。在第2770步 驟,此時分割檢測器2 6 5 6偵測是否有一安全性分割違反, 若有則在第2 7 7 5步驟發出一中止信號。然而,假設未偵測 到安全性分割違反,則快取線填充在第2780步驟進行,在 第2785步驟完成資料存取。 如第 57 圖所示,第 2705、271〇、2715、272〇、2725、 2730 和 2735 步驟在 MMU 中執行,第 2745、275〇、2755、 2 7 6 5 2 7 8 0和2 7 9 0步驟由快取執行,以及由分割檢測器 執行第2770步驟和第2795步驟。A similar method is described in which the software performs the merge again and uses the smallest page table size for the combined translation. After that, in step 2590, the new descriptor is stored in the main TLB 2420, and then the program returns from the exception in step 2595. After that, the core 1 is scheduled to issue a virtual address for the memory access request via path 2430. It will still generate non-conformances in micro-TLB 2410, but will now generate a conformant in main TLB 2420. Therefore, the virtual address part and the corresponding physical address part can be intercepted to 102 200422849 micro-TLB 2410 ′, and micro_TLB 2410 can transmit the required data back to core 10 via path 2450. I will understand 'in the alternative embodiment described previously with reference to Figures 50A and 50B' by software using the principles described above with reference to Figures 53 and 54 to manage the One or both of the MMU. Regardless of whether two MMUs are used as shown in Figure 50A or 50B, or one MMU is used as shown in Figure 53, the fact that the processor manages the second set of page tables when operating in monitor mode (or (Optionally in a permission security mode) to ensure that the paging tables are secure. As a result, when the processor is in a non-secure domain, it can only see non-secure memory. When Tian is in a non-female full-scale domain, the first set of page tables that can only be seen by the processor is Non-secure domains create intermediate address spaces. As a result, it is not necessary to provide a segmentation detector as part of the memory management logic 30 as shown in the first figure. However, a split detector is still provided on the external bus to monitor access in the system by other bus masters. In the embodiments previously discussed with reference to Figures 7 and 38, Provided-a segmentation detector 222 related to ^^ U 2 0 0, and therefore when access is to be performed in the cache 38 + + 1 seek 'A query has been executed first in the micro-TLB 206' and As a result, access permissions (especially security and non-security permissions) have been checked. Therefore, + In such embodiments, non-safety applications cannot store inflammation ## in the cache 38 for holistic data of women. The access to the cache is under the control of the segmentation detection by the segmentation detector 222 /, and therefore not 103 200422849 can be in the non-secure ten: However, if it is not for: via a data processing device It is used to implement the i system bus and cache 3 8 in this type, so some data access is needed during the operation. No. 55, which mentions the access check logic performed. Example: Link to the system confluence ^ link. The core surface 42 is connected to a ^ Control® flow ^ The core 1 0 interface 42 is also visible as a row j connection, for example: 472. It is also connected to perform access to oblique security data in 4 • mode. In an alternative embodiment of the present invention, the segmentation detector 222 is provided by the monitoring access by the integrated bus 40, otherwise there is only a single segment inspection monitoring connected to the external bus 70 connected to the external bus Of memory cells. In this column, it means that the processor core 10 can access any memory unit directly connected to 40, such as τ〇μ36 without having to monitor these accesses by an external partition detector, and a mechanism to ensure the processor The core 10 does not access an insecure module in the cache 38 or the TCM 36. The insecure map according to an embodiment of the present invention illustrates a data processing device for a mechanism to enable the cache 38 and / Or TCM 36 controls it without providing any segmentation inspection related to MMU 2000. As shown in Figure 55, core 10 is connected to non-40 through mmu 200, cache 38 and TCM 36 are also connected to the system bus 4 〇10, cache 38 and TCM 36 are external bus 70 by external bus, which includes a single address bus 2620, non 2630 and a data bus 2640, as shown in Figure 55. , MMU200, cache 38, TCM36, and external buses constitute a single device connected to external bus 70, multiple buses, and other devices can also merge with the above devices such as security peripherals 47 or non-secure The peripheral device-to-device bus 70 is one or most of the memory list 104 200422849 yuan, such as external memory 56. In addition, a bus control unit is connected to the device bus 70, and generally includes an arbiter 2652, an encoder 2654, and a split detector 2656. For a general discussion of the operation of the components connected to the device sink, reference should be made to the previously described I diagram 'The arbiter, decoder, and segmentation detector are shown as a single block' but when placed in a single control block 2650 , These components work in the same way. MMU 2000 in FIG. 55 is further detailed in FIG. 56. Comparing Figure 56 and Figure 37, you can see that the MMU 200 is constructed in exactly the same way as the MMU in Figure 37. The only difference is that the detector 222 is not used for monitoring between the main TLB 208 and micro 206. Data transmission on path 242. If the processor core issues a memory access request specifying a virtual address, the memory access will then bypass the MMU 200 and process the micro-TLB 206 as described earlier in Figure 37 to output a physical bit via path 238 Address to system row 40. Conversely, if the memory access request directly specifies an entity, this will bypass the MMU 200 and directly route to the system bank 40 via path 236. In one embodiment, only when the processor is in the monitor mode 'generates a memory access request that directly specifies the physical address. Looking back at the previous description of MMU 200, and especially Figure 43, the 'main TLB 208 will contain some descriptors 435, and a domain flag 425 will be provided for each descriptor to determine if the corresponding descriptor is self-securing. A paging table or a non-secure paging table. The above descriptors and related domain flags 425 are the same as the 2650-streaming% 47 of MMU 2000 in Figure 55. By sending the request with a split-TLB 10 The description of the confluence operation is described in 435 Summary 105 200422849. When the core 10 issues a memory access request, a physical address that leads to the memory access request is output to the system bus 40, and at this time, the cache 38 will execute a query procedure to Determines whether the data item at the address is stored in the cache. As long as nothing happens in the cache, it means that the data item that belongs to the access request is not stored in the cache. The cache starts a linefill process to intercept a row of data from external memory 5 6 It includes data items that belong to a memory access request. That is, the cache will output a one-line fill request to the control bus 2630 of the device stream 70 through the EBI 42 and output the initial address to the address stream 2620. In addition, a HPROT signal will be output via the path 2632 to the control bus 2630, which will include a domain signal of a certain core operation mode when a memory access request is issued. Therefore, the line filling procedure can be cached for propagation of 38 to the original memory access request of the external bus. The HP ROT signal is received by the partition detector 2656, and therefore it is determined whether the partition detector installs the specified data requested by the external memory 56 when the external memory access request is issued (in this case, the Core 10 and cache 38 work together) to operate in a secure domain or a non-secure domain. The split detector 2656 will also access split information that confirms the security or non-security of the memory area, and can therefore determine whether the device will allow access to the data it requests. Therefore, if the domain name ^ in the HPROT letter (also referred to in the S bit text) declares that the access to the material is requested by the respect, then when operating in a security mode The women's volleyball segmentation detector can only allow a device to access the memory of one of the regular identifiers and transfer it to the designated white zone, which is designated as No. 106 200422849. If the partition detector decides that the core 10 is not allowed to access the requested data, for example, because the HPROT signal has confirmed that the core is not operating in a non-secure mode, but the line fill request attempts to be secure from one of the memories The external memory in the area retrieves the data, and the segmentation detector 265 6 sends a stop signal to the control bus 2630 (which will be returned to the EBI 42 via path 2636, resulting in a stop signal to the core 10 via path 2670. However, If the segmentation detector 2656 decides to allow access, it outputs an S private signature signal to determine whether the data intercepted from the external memory is security data or non-feminine data, and that the S label signal passes the path 2 6 3 4 To return to EBI 42, and set the flag related to the cache line 2600 is a line filling process. At the same time, the control logic 2650 authorizes the requested line filling data from the external memory 56 through EBI 42 via path 268 〇Returns data to cache 38 to be stored in the relevant cache line 260. Therefore, the result of this processing is filled with the data items selected in the external memory 56 The cache line will be filled with data items from the external memory 56. These data items include data items belonging to the original memory access request from the core 10. After the data items belonging to the core memory access request can be Is selectively returned from the cache 38 to the core, or can be selectively returned from the ebi 42 to the core 10 via the path 2660 for direct provisioning. Because it is in the preferred embodiment, the line filling process described above will result in Occurrence of the original stored data of the cache line. The flag 2602 related to the cache line will be set according to the value provided by the splitter 2656, and then 107 200422849 will be used by cache 38 to directly control the flag. Any subsequent access to the data item in cache line 2600. Therefore, if core 10 then causes a particular cache line 2600 in cache 38 to generate a conformant memory access request, the The cache 38 will check the value of the relevant flag 2602 and compare this value with the value of the existing operating mode of the core 10. In the preferred embodiment, the monitoring mode in the CP 15 domain status registration Set a domain The bit indicates the existing mode operated by the core 10. Therefore, when the processor core 丨 〇 is operating in a secure operation mode, the cache 38 can be arranged to cache data items that are only allowed in one cache line. The corresponding flag 2602 indicates the security data accessible by the processor core 10 "Any intention of the core to access the security data in the cache 38 when the core is operating in a non-security mode, Will result in a suspension signal via cache 3 8 via path 2 67. T c M 3 6 can be set up in a variety of ways. In one embodiment, it can be built like a cache, and the embodiment is arranged to include a majority line 2 6 10, in the same way as the cache 38, each of which has a flag 2612 associated with it. Use exactly the same method as previously described for cache 38 to manage access to TCM 36, and any TCM discrepancy that caused the first-line fill process to be performed, with the result that the data will be intercepted to—specific line 26 1 0, and segmented The detector 2656 will generate the required S-tag value to store the flag 2 6 1 2 associated with the line 2610. In an alternative embodiment, the TCM 36 can be set up as an extension of the external memory 56 and used to store data that is often used by the processor, because access to the TCM via the system bus is usually better than external memory Faster access. In such embodiments, the TCM 36 does not use the flag 108 200422849 2612 ', but instead uses a different mechanism to control access to tcm. In particular, as described above, in such embodiments, a control flag is provided that can be set by the processor and indicates whether it can be processed by the processor when executed in a permission security mode. The controller controls the beta memory, or when it is executed in at least one non-security mode, it can be controlled by the process. The control flag is set by the female holistic operating system, and it can actually define whether it can be authorized security mode or non-security mode. control. Therefore, it is sufficient to define an architecture TCM that can only be controlled when the processor is operating in a privileged security mode. In such embodiments, any intent to access the control log will result in entry into an undefined instruction exception. In an alternative architecture, the TCM can be controlled by the processor when operating in a non-security mode. In such embodiments, the TCM is used only by non-security applications. No security data can be stored or loaded from. Therefore, when performing a secure access, no query is performed in it to find out if the address matches the TCM address range. The flowchart in Figure 57 illustrates the processing performed by the device in Figure 55 when a non-female holistic program operating on the processor core generates a virtual address. First, in step 2705, in micr. -A check is performed in TLB 206, and if it generates a conformant, micr0 TLB checks the access permission in step 1. Referring to Fig. 56, the program can be regarded as being executed by the access permission logic 202. If at step 2705, a query occurs at the micro-TLB—a non-conformance is performed, the second query is performed at the main tlb2008 where the non-security descriptor is stored (step 2710). If it produces a discrepancy, a page table walking procedure is executed at step 2715 109 200422849 (as discussed previously with reference to Figure 37), where after step 2720 it decides that the main Tlb contains the valid ladder Tagged non-security descriptor. If generated / conformant 'at step 2710, the procedure proceeds directly to step 2720. Thereafter, in step 2725, micrQ.TLB loads the part of the descriptor containing the physical address, and then in step 273, the micr TLB checks the access permissions. If an access violator is found in step 2730, the program proceeds to step 2740, in which an abort signal is sent to the processor core via path 23 (similar to path 267 in FIG. 55). However, if no violator has been detected, then in step 2745 a decision is made as to whether the procedure is related to a cacheable data item. Otherwise, an external access is initiated in step 279 to attempt to intercept the data item from the external memory 56. At step 2795, the segmentation detector 2656 will determine if there is a security segmentation violation, that is, if the processor core 10 attempts to access a data item in secure memory while operating in an unsecure mode, And if a violator is picked up, the segmentation detector 2656 will generate a stop signal at step 277 < water mail elbow step 2775. However, ‘assuming there is no security name 丨 careful-another female gold 〖raw knife cutting violation, the process proceeds to step 2785, where the data access occurs. If yes, then in step 2750, the decision is made in the cache. If you find…, then in the 2nd cache query ’and if the line V snap cache determines whether there is a security line‘ signature violation ’. So 'at this stage ^ ^ & »» ^ Γ, take the value of the flag that will check the line associated with the contained data item, and compare the value of this flag with the core 200422849 1 0 operation mode to decide whether to authorize Core access requested data item. If a security line label violation is detected, the process proceeds to step 2760 where a security violation error abort signal is generated by cache 38 and sent to core 10 via path 2670. However, assuming no security line label violation is detected in step 2755, data access is performed in step 2785. If a cache mismatch occurs when the cache query is executed in step 2750, then a cache line fill is initiated in step 2765. At step 2770, the segmentation detector 2 6 5 6 detects whether there is a security segmentation violation, and if so, sends a stop signal at step 2 7 7. However, assuming no security segmentation violation is detected, the cache line filling is performed in step 2780, and data access is completed in step 2785. As shown in Figure 57, steps 2705, 2710, 2715, 2720, 2725, 2730, and 2735 are performed in the MMU, and 2745, 2750, 2755, 2 7 6 5 2 7 8 0, and 2 7 9 0 Steps are performed by the cache, and steps 2770 and 2795 are performed by the segmentation detector.

第58圖是一流程圖,圖示在核心中執行的一安全性程 弋產生虛擬位址時所執行的類似程序(第2800步驟)。藉 由比較第 57圖和篦 ssm =. 第8圖,吾人將了解,在MMU中經由 斤執订之第2 8 0 5步驟係相似於先前參照第5 7圖^ 之經由2735的第2705步驟。唯一的差別在第2810步 ::在主要TLB中所執行之查詢係相關於在主要TL】 ==安全性描述符,其結果為在第282。步驟」 TLB含有有效標籤的安全性描述符。 111 200422849 在快取中,該快取不再需要尋找任何安全性線標鐵違 反,因為如第5 8圖所示,假設安全性程式能夠存取安全性 資料和非安全性資料。因此,如果在第2 8 5 0步驟快取查詢 期間發生一符合者,則程序直接進行至資料存取步驟第 2 8 8 5步驟。 同樣地,如果需要對外部記憶體的外部存取(即,在第 2865或2890步驟)’分割檢測器不需要執行分割檢查,因 為再次假設安全性程式能夠存取安全性資料或非安全性資 在快取中執行的第2845、2850、2865、2880和289〇 步驟係類似於先前參照第57圖所述之第2745、275〇、 2765、2780 和 2790 步驟 〇 第59圖圖示在處理器上執行的不同模式和應用。依據 本發明的一實施例’虛線指示在處理器的監控期間不同模 式和/或應用如何能夠彼此分別和分開。 監控一處理器以找尋可能錯誤和發現應用為何不如預 期般執行的能力是非常有用的以及許多處理器提供此類功 能。能夠以包括偵錯和追蹤的功能之許多方法執行該監控。 依據本發明之技術,在處理器中偵錯能夠以幾種模式 操作,包括停機彳貞錯模式以及監控偵錯模式。該些模式侵 入和使程式在欲停止時執行。在停機偵錯模式中:當一: 點(breakpoint)或一監視點(watchp〇int)發生時,核心停止 並從其餘的系統分離以及核心進入備錯狀態…開始時核 心停止,*道(pipe—清除以及未有任何指令被預先取 112 200422849 回。使PC凍結以及忽略任何中斷(IRq和FIq)。而後可能 檢查核心内部狀態(藉由JTAG序列界面)以及記憶體系統 的狀態。該狀態對程式執行是侵入式的,因為它可能修改 現有模式、改變登錄狀況、等等。一旦偵錯終止,核心利 用Debug TAP藉由掃描Restart指令,從偵錯狀態退出。 而後程式重新繼續執行。 在監控债錯模式中,一斷點或監視點使核心進入中止 模式,分別採用預取(prefetch)或資料中止向量(Data Abort vectors)。在這種情況下,如果核心處於停機(Halt)偵錯模 式’核心仍然在一功能模式下且不停止。中止管理器與一 偵錯應用通訊,以存取處理器和辅助處理器狀態或傾印記 憶體。一偵錯監控程式處於偵錯硬體和軟體偵錯器之間。 如果已設定控制登錄DSCR以及偵錯狀態的位元11(詳見 下文),能夠阻止中斷(FIQ和irq)。在監控偵錯模式,在 資料中止(Data Aborts)和預取中止(prefetch Aborts)中使 向量截取失效,以避免因為替監控偵錯模式產生的中止, 使處理器被迫進入不可恢復的狀態。應該注意的是監控偵 錯模式是一種偵錯模式以及不相關於處理器的監控模式 (監督在安全性情境和非安全性情境之間轉換的模式)。 偵錯在某種時刻能夠提供處理器狀態的快照。其在接 收到偵錯初始請求時,藉由在各種登錄上註解該些值以達 成。在一掃描鏈上記錄了該些值(第67圖中的541、5 44 ) 以及而後它們使用JTAG控制器(第!圖的18)依序輸出。 監控核心的一種選擇方法是用追蹤(trace)。追蹤不是 113 200422849 呆作則記錄爾後的狀態。追縱是 侵入式的和如果 在第一圖中的2 2、26之嵌入式珀 式追縱巨細胞(ETM,EmbeddedFig. 58 is a flowchart showing a similar procedure executed when a virtual address is generated in the core (step 2800). By comparing Fig. 57 and 篦 ssm =. Fig. 8, we will understand that the 2 8 0 5 step ordered by the cat in the MMU is similar to the 2705 step through 2735 which was previously referred to Fig. 5 7 ^ . The only difference is in step 2810 :: The query performed in the main TLB is related to the main TL] == security descriptor, and the result is at step 282. Step "The TLB contains a security descriptor for a valid tag. 111 200422849 In the cache, the cache no longer needs to find any security line marking violations, because as shown in Figure 5-8, it is assumed that the security program can access security and non-security data. Therefore, if a match occurs during the cache query in step 2850, the procedure proceeds directly to step 2888 in the data access step. Similarly, if external access to external memory is required (ie, at steps 2865 or 2890), the 'segmentation detector does not need to perform a segmentation check because again it is assumed that the security program can access security data or non-security data. Steps 2845, 2850, 2865, 2880, and 289 performed in the cache are similar to steps 2745, 275, 2765, 2780, and 2790 described earlier with reference to Figure 57. Figure 59 illustrates the processor Different modes and applications on the implementation. An embodiment ' according to the invention ' dotted line indicates how different modes and / or applications can be separated and separated from each other during the monitoring of the processor. The ability to monitor a processor for possible errors and discover why an application is not performing as expected is very useful and many processors provide such functionality. This monitoring can be performed in many ways including functions for debugging and tracing. According to the technology of the present invention, the debug in the processor can be operated in several modes, including a shutdown error mode and a monitor debug mode. These modes invade and cause the program to execute when it is about to stop. In the shutdown debugging mode: When a breakpoint or a watchpoint occurs, the core stops and separates from the rest of the system and the core enters a standby state ... the core stops at the beginning, * — Cleared and no instruction was fetched 112 200422849 in advance. Freezes the PC and ignores any interrupts (IRq and FIq). Then it is possible to check the internal state of the core (via the JTAG sequence interface) and the state of the memory system. This state is Program execution is intrusive because it may modify the existing mode, change the registration status, etc. Once the debugging is terminated, the kernel uses the Debug TAP to exit the debugging state by scanning the Restart instruction. Then the program resumes execution. During monitoring In the debt fault mode, a breakpoint or a monitoring point causes the core to enter the abort mode, using prefetch or data abort vectors respectively. In this case, if the core is in the Halt debug mode 'The core is still in a functional mode and does not stop. The suspension manager communicates with a debug application to access the processor and auxiliary services Processor status or dump memory. A debug monitor is located between the debug hardware and the software debugger. If bit 11 (see below) that controls the registration of DSCR and debug status is set, it can prevent interrupts (FIQ and irq). In monitoring and debugging mode, invalidate vector interception in data aborts and prefetch aborts to avoid the processor being forced to stop due to the suspension generated for monitoring and debugging mode. Enter an unrecoverable state. It should be noted that the monitoring and debugging mode is a debugging mode and a monitoring mode that is not related to the processor (the mode of supervising the transition between the security context and the non-security context). This kind of moment can provide a snapshot of the state of the processor. When the initial request for debugging is received, it is achieved by annotating these values on various logins. These values are recorded on a scan chain (541 in Figure 67) , 5 44), and then they are sequentially output using the JTAG controller (Figure 18 in Figure 18). One option for the monitoring core is to use traces. Traces are not 113 200422849 State after. 追縱 is invasive and, if embedded Perot type 追縱 cytomegalovirus 2,26 2 in the first figure (ETM, Embedded

Trace Macr〇cen)上執行。ETM有—追縱埠口藉以輸出追 縱資訊’而後可由外部追縱埠口分析器分析。 本技術實施例的處理器在兩;雜从 仕两刀離的網域中操作,在所 述之實施例中,該些網域包括安全柯4非—人 文金性和非安全性網域。然 而,由於監控功能的目@,熟習該項技藝著將清楚該也網 域可能是彼此間資料不會茂漏的任何兩網域。纟技術的實 施例關聯於防止在兩網域間資料的茂漏以及諸如镇錯和追 蹤之監控功能,其允許對整個系統便利的存取,又該整個 系統係在網域間資料洩漏的潛在來源。 在上述之安全性和非安全性網域或情境的示例中,安 全性資料不能被非安全性情境獲得。此外,如果在安全性 情境中允許债錯,它可能有助於限制或隱藏安全性情境中 的一些資料。第5 9圖的虛線顯示一些可能方法的示例,其 劃分資料存取和提供不同層級的粒度(granuUrityp在第 59圖,方塊500顯示監控模式和其為所有模式中最安全 者,並控制在安全性和非安全性情境之間轉換。在監控模 式500之下有一監督模式52〇。而後具有應用522和Μ# 之非安全性使用者模式,以及具有應用512、514和516 之安全性使用者模式。只能控制監控模式(偵錯和追蹤)監 控非安全性模式(虛線501左邊)。選擇性地,可以允許監 控非安全性網域或情境和安全性使用者模式(5 〇丨的左邊 和501右邊在502下面的部分)。在一進一步的實施例中, 114 200422849 可以允許在安全性使用者網域中執行非安全性情境和某些 應用,在這種情況下,由虛線5 03進一步劃分。此類劃分 有助於在可以執行不同應用的不同使用者之間防止安全性 資料的洩漏❶在某些控制情況下,可以允許監控整個系統。 依據所需的粒度,於監控功能期間,核心的下列部分需要 具有它們控制的存取。 在一偵錯情況下,可以設定四種登錄;指令錯誤狀態 登錄(如果SR)、資料錯誤狀態登錄(DFSR)、錯誤位址登錄 (FAR)、和指令錯誤位址(IFAR) 〇當從安全性情境到非安全 性情境時,在一些實施例中應清除上述登錄,以避免資料 的任何洩漏。 PC樣本登錄:Debug TAP能夠藉由掃描鏈7存取該 P C。當在安全性情境中偵錯時,可以依據在安全性情境中 選擇的彳貞錯粒度對該值進行遮當核心在安全性 情境中執行時,讓非安全性情境、或加上安全性使用者應 用的非安全性情境不能得到p C的任何值是重要的。 TLB項目:可能使用CP15以讀取micro-TLB項目讀 寫主要TLB。吾人也能夠控制主要TLB和micro-TLB的載 入和配對(matching)。這種操作必須嚴格地控制,尤其是 如果安全性執行緒偵錯需要MMU/MPU的援助。 效能監控控制登錄:效能控制登錄針對該些快取不符 者、micr〇-TLB不符者、外部記憶體請求、執行的分支指 令、等等給予資訊。非安全性情境不應該存取該些資料, 即使在偵錯狀態中。即使偵錯在安全性情境中失效,該些 115 200422849 計數應可在安全性情境中操作。 在快取系統中偵錯:在一快取的系統中的摘錯一定是 非侵入式(observable)的。為了在快取和外部記憶體之間保 持一致性,這是重要的。使用CP 15能夠使快取失效,或 能夠強迫該快取寫入一所有區域。無論如何,在偵錯中允 許對快取行為的修jE可能是安全性的弱點而應該要控制。 位元組順序(Endianness):不應該允許能夠存取偵錯的 非女全性情i兄或女全性使用者應用改變位元組順序。改變 該位元組順序可能導致安全性核心故障。依據粒度,在偵 錯中禁止位元組順序的存取。 在監控功能開始時,可以控制核心部分的監控功能之 存取。偵錯和追蹤可用許多方法初始。本技術的實施例藉 由僅允許在某些條件下初始,以控制對核心的某些安全性 部分的監控功能的存取。 本技術的實施例藉由下列粒度尋求對進入監控功能的 限制: 藉由分別控制侵入式和非侵入式(追縱)偵錯; 藉由只允許在安全性使用者模式中或在整個安 全性情境中偵錯項目; 藉由只允許在安全性使用者模式中和更考慮執 行緒ID進行偵錯(應用執行)。 為了控制一監控功能的初始化,了解能夠如何初始功 能是重要的。第60圖顯示一表說明初始一監控功能之可能 116 200422849 方法’初始的監控功能型態和此類初始化指令可以由 設計。 通常’能夠藉由軟體或藉由硬體進入該些監控指 即’藉由JTAG控制器❶為了控制監控功能的初始化 用控制值。上述包含位置相依之啟動位元和因此如果 特疋位元,只充許在設定了該啟動位元的情況下啟 控在女全性登錄CP 14儲存了該些位元(偵錯和狀 制登錄、DSCR),其位於在ICE 53〇中(請參考第67圖 在較佳的實施例中,有啟動侵入和停用侵入和 入偵錯的四位元,上述包含一安全性偵錯啟動位元、 全性追蹤啟動位元、一安全性使用者模式啟動位元和 全性執行緒偵知啟動位元。該些控制值用於為監控功 供一定程度的可控制粒度以及因而能夠幫助防止一特 域的/¾漏。第6 1圖提供該些位元的概要以及如何能夠 它們。 在安全性網域中的一登錄中儲存該些控制位元, 對該登錄的存取限制於三種可能性。藉由輔助 器MRC/MCR指令提供軟體存取,而上述只允許來自 性監督模式者。選擇性地,能夠從任何其它模式使用 權碼提供軟體存取。一進一步的選擇與硬體存取較 關’並涉及利用在JTAG的輸入埠來寫入指令。除了 輸入與監控功能的有效性相關的控制值以外,能夠用 入埠來輸入與處理器的其它功能相關的控制值。 與掃描鏈和JTAG相關的進一步細節如下文所述。 程式 令, 而使 出現 動監 態控 )° 非侵 一安 一安 能提 定網 存取 以及 處理 安全 —授 為相 用來 該輪 117 200422849 登錄邏輯格(Register logic cell) 每個集積電路(1C)包含兩種邏輯: • 組合邏輯格;例如AND、OR、INV閘。依據一或 多數輸入信號,用此類閘或此類閘的結合來計算布林 (Boolean)表示。 • 登錄邏輯格;例如LATCH、FLIP-FLOP。用此類格 來記錄任何信號值。第62圖顯示一正邊(positive-edge) 觸發的 FLIP-FLOP : 當正邊事件在時脈信號(CK)上發生時,輸出(Q)接收了 輸入(D)的值;否則輸出(Q)使它的值保留在記憶體。 掃描鍵格 為了測驗或偵錯之目的,需要略過登錄邏輯格之功能 性存取並直接存取該些登錄邏輯格的内容。因此登錄格係 整合於在第63圖所示的一掃描鏈格。 在功能性模式中,掃描啟動(SE,Scan Enable)係清楚 的和登錄格以一單一登錄格作用。在測驗或偵錯模式中, 設置SE而輸入資料能夠來自掃入(SI,Scan In)輸入而非d 輸入。 掃描鏈 如第64圖所示,所有掃描鏈格都被串鏈為掃描鏈。 在功能模式中,SE是清楚的以及通常都能夠存取所有 118 200422849 登錄格和與電路的复仓溫絡 八邏輯相互作用。在測驗(Test)或偵 錯(Debug)模式中,se被今罾以芬产 ^ 破《又置以及在一掃描鏈彼此間串鏈 所有的登錄。資料能夠爽白s — 來自第掃描鏈格和能夠依每一時 脈週期的節奏藉由任何直女搞* Π八匕知描鏈格轉換。能夠轉換出資 料以了解登錄内容。 使用4貞# TAP控制器以控制一些掃描鏈。該τΑρ 控制器能夠選擇特定的掃描鍵:其連接「掃描入」和「掃 描出」信號;至特定掃描鏈。之後資助能夠被掃描人串鍵裡、 轉換或掃描出。由一 JTAG埠界面由外部控制該TAP控 制器。第65圖圖示一 TAP控制器。 選擇姓失效播拋綠故 基於安全性原因,一些登錄不可以被掃描鏈存取,甚 至在偵錯或測驗模式亦然。一稱作jaDI(JTag存取失效) 的新輸入能夠允許從一整個掃描鏈動態或靜態地移除一掃 描鏈格,而不必修改積體電路中的掃描鏈架構。第66A和 第66B圖不該輸入。 如果JADI是未啟用的(jadI = 〇),不論是否在功能或 測驗或偵錯模式中,掃描鏈如往常一樣工作。如果JADI 是啟用的(JAD 1=1),以及吾人在測驗或偵錯模式中,一些 掃描鍵格(由設計者選擇)可以自掃描鍵架構r移除」。為了 保持相同數量的掃描鏈格,JTAG選擇性失效掃描鏈格使 119 200422849 用一略過登錄(bypass register)。請注意掃描出(SO,San out)以及掃描鏈格輸出(Q)現下是不同的。 第67圖圖示包括JTAG之一些部分的處理器。在正常 的操作中,指令記憶體5 5 0與核心通訊亦可以在某些狀況 下與登錄CP14通訊和重設控制值。通常僅容許自安全性 監督模式進行。 當偵錯初始化,藉由Debug TAP(偵錯TAP) 580輸入 指令,且其即為控制核心者。偵錯下的核心以逐一步驟模 式執行。Debug TAP藉由核心存取 CP14(依據輸入於 JSDAEN PIN之存取控制信號,其以JADI PIN顯示(第45 圖之 JTAG 存取失效輸入,JTAG ACCESS DISABLE INPUT)) 以及也能夠藉由該方法重設控制值。 藉由存取控制信號 JSDAEN控制了藉由 Debug TAP 5 80對CP 14登錄的存取。這麼安排係為使存取尤其是寫入 存取允許JSDAEN必須設為高。當已確認該整個處理器, 在機板階段(board stage)期間,在整個系統啟用債錯並設 JSDAEN為高。一旦已經檢查了系統,貝1J JSDAEN PIN能 夠接地,它意味著現下不能藉由Debug TAP 5 80在安全性 模式啟用偵錯。在生產模式中的一般處理器具有接地之 JSDAEN。因此只能藉由經由指令記憶體550繞送之軟體 存取控制值。經由該繞送之存取係限制在安全性監督模式 或在提供一授權碼的另一模式(請參考第68圖)。 應該注意的是,在預設中,偵錯(侵入和非侵入-追蹤) 只能用於非安全性情境中。為使它們可用於安全性情境 120 200422849 中,需要設置控制值啟用位元。 它的優點是偵錯只能總是由使用者初始以 情境中執行。因此,雖然在偵錯中使用者通常 安全性情境,是許多情況下它並不是問題’因 的存取是受限的以及在可用之前的機板階段已 安全性情境。因此可預見在許多情況下安全性 是不必要的。如果必要,一安全性監督仍然能 C Ρ 1 4的軟體繞送初始化偵錯。 第6 8圖圖示偵錯初始化的控制。在該圖1 的一部份包括一儲存元件601 (如先前所述可£ 登錄)其中儲存指示是否系統在安全性情境中 狀態位元S。核心600也包括一登錄602,其 理器所執行之模式(例如使用者模式)以及一登 供一内容識別符以確認現下執行於核心之應用 當到達一斷點時,一比較器將在登錄6 1 1 與在登錄6 1 2中儲存的核心位址比較,把信號 輯620。控制邏輯620查看安全性狀態S、模 行緒(内容識別符)603並把其與控制值和在登金 的條件狀態比較。如果系統不是在安全性情境 —「進入偵錯」信號將在630輸出。然而如果 全性情境中操作,則控制邏輯620將查看模式 如果它是在使用者模式,將檢查以了解是否使 啟用和偵錯啟用位元已設定。如果它們是的話 初始化,便了解執行緒憤知位元(thread aware 在非安全性 不能夠存取 為對該情境 經徹底確認 情境的偵錯 夠藉由寫入 I7,核心600 又是一 CP15 的一安全性 包括指示處 錄603其提 或執行緒。 儲存的斷點 送到控制邏 式602和執 I CP14儲存 中操作,則 系統是在安 602 ,以及 用者模式已 ’則偵錯將 bit)尚未初 121 200422849 始化。上文中描述控制值的階層性本質。 只 階 能 模 在第68圖亦圖示監控控制的執行绪偵知部分和如何 能夠自安全性監督模式(在本實施例中,處理器係在生產 段而JSDAEN接地)轉換在登錄CP14中蚀六μ ^ 1 Τ储存的控制值。 夠使用一授權碼從一安全性使用者模式 力八進入安全性監督 式,而後能夠在CP14設置控制值。 當位址比較器610指示斷點已經到達時,控制邏輯62〇 輸出-「進入偵錯」信號,便了解執行緒比較器“Ο顯示 就該執行緒而言允許偵錯。假設在Cp丨4設置了執行緒偵 知初始化位元。如果執行緒偵知初始化位元係設置一斷點 之後’如果位址和内容識別符合在斷點中和在允許的執行 緒指標中指示的該些,則只能進入偵錯或追蹤。在一監控 功能初始化之後,只能在比較器640偵測到偵測内容識別 符為一允許的執行緒時,繼續診斷資料的擷取。當一内容 識別符顯示執行的應用不是一允許者時,則阻止診斷資料 的掏取。 應該注意的是,在較佳實施例中,有粒度中的某種階 層。實際上安全性偵錯或追蹤啟用位元係在頂部,接下來 為安全性使用者模式啟用位元,和最後是安全性執行緒偵 知啟用位70 °如第69Α圖和第69Β圖所述(詳見下文)。 在「^貞錯和狀態控制(Debug and Status Control)」登 錄(CP 14)保留的控制值依據網域、模式和執行緒控制安全 性偵錯粒度。其在安全性監督模式之頂部。一旦設定了「偵 錯和狀態控制」登錄CP 1 4,由安全性監督模式設計對應的 122 200422849 斷點、監視點、等等,使核心進入偵錯狀態。 第69A圖概述侵入式偵錯的安全性偵錯粒度。重設的 預設值係以灰色表示。 相關於非侵入式偵錯之偵錯粒度亦然。第69B圖概述 在這種情況下的安全性偵錯粒度,此第也用灰色表示重設 的預設值。 請注意安全性使用者模式偵錯啟用位元和安全性執行 緒偵知偵錯啟用位元一般用於侵入式和非侵入式偵錯。 一執行緒偵知初始化位元係儲存在登錄c p 1 4中並指 不疋否依據應用需要粒度。如果執行緒彳貞知位元已經初始 化,控制邏輯將進一步檢查應用識別符或執行緒603是在 執行緒偵知控制值中所指示者,如果是,則偵錯將被初始 化。如果使用者模式或偵錯啟用位元之任一未設置或執行 緒偵知位元已設置以及執行的應用不是在執行緒债知控制 值中所指示者’則將忽略該斷點以及核心將繼續進行其原 來所進行者而偵錯將不被初始化。 除控制監控功能的初始化以外,也能夠藉由一類似方 法控制在一監控功能期間診斷資料的擷取。為了達成上述 目的,在監控功能的操作期間核心必須繼續考慮兩控制 值’即在登錄CP 1 4儲存之啟用位元和它們的相關條件。 第7 〇圖圖示一監控功能執行時的粒度。在這種情況 下,區域Α相關於被允許擷取診斷資料的區域,區域β相 關於控制值在CP 1 4儲存的區域,意指它不可能截取診斷 資料。 123 200422849 因 斷資料 域B時 行,反 到程式 截取而 在 令總是 的擷取 此 而論, 就 全與偵 其失效 性情境 取和追 速。可 因此當 ETM應 情境。 蠱 當 此,當執行偵錯時以及一程式在區域A操作時,診 在偵錯期間是以逐步的方式輸出。當操作轉換為: ,其為不允許診斷資料擷取處,偵錯以逐步方式進 之其自動進行而沒有任何資料被擷取。如此繼續直 的操作再次進入區域A,據以再次開始診斷資料的 偵錯繼續以逐步方式執行。 上述實施例中,如果未啟用安全性網域,一 smi指 被視為一基本事件(atomic event)而阻止診斷資料 〇 外,如果已設置執行緒偵知初始化位元,則就應用 亦出現操作期間的監控功能的粒度。 非侵入式偵錯或追蹤而論,其係由ETM所達成且完 錯無關。當•啟用追蹤,ETM像往常一般作用,而當 時,ETM依據選擇的粒度在安全性情境或部分安全 隱藏追蹤。避免在未啟用時ETM在安全性網域中擷 蹤診斷資料之一種方法係在s位元為高時使etm減 由使該S位元與ETMPWRDOWN信號結合以達成, 核心進入安全性情境時,保留ETM的最後值。因此 該追蹤一 S ΜI指令而後減速直到核心回到非安全性 因此,ΕΤΜ將只監督非安全性活動。 些不同的監控功能和它們的粒度將摘要如下。 益段(board stage)的得入式确錯 JSDAEN PIN未接地時之機板階段,在任何開始時 124 200422849 丰又前有可能在任何地方初始彳貞錯。同樣地,如果吾人在安 全性監督模式中,吾人有類似權限。 如果吾人在停機偵錯模式(halt debug mode)初始化偵 錯’所有登錄都是可存取的(非安全性和安全性登錄區塊) 以及除了專屬於控制的位元以外,能夠傾印整個記憶體。 能夠從任何模式和任何網域進入偵錯停機模式。能夠 在安全性或在非安全性記憶體設置斷點和監視點。在偵錯 狀態中’可以藉由利用一 MCR指令僅改變S位元以進入 安全性情境。 在當安全性異常發生時能夠進入偵錯模式,用以擴充 向量捕捉登錄(vector trap register)之新位元如下; SMI向量捕捉啟用; 安全性資料中止向量捕捉啟用; 安全性預取中止向量捕捉啟用;和 女全性未疋義向量捕捉啟用。 在監控偵錯模式,如果吾人允許在任何地方偵錯,甚 至在非安全性情境呼叫一 SMI時,可能以逐步偵錯進入安 全性情境。當一斷點在安全性網域中發生時,安全性中止 管理器可操作以傾印安全性登錄區塊和安全性記憶體。 在安全性和在非安全性情境的兩中止管理器將它們的 資訊給予梢錯器應用,以使偵錯器視窗(在相關的偵錯控制 PC上)在安全性和非安全性情境二者中都可顯示登錄狀 態。 、 125 200422849 第7 1A圖顯示當在監控偵錯模式中設定核心 在安全性情境中啟用時所發生者。第71Β圖顯示 錯模式中δ又疋核心時和偵錯在安全性情境中停用 者。之後之程序將詳述如下。 在生產階段的侵入式偵錯 在生產階段中,當JSDAEN有接地和偵錯限 全性情境,除非安全性監督有其他的決定,則在 顯示所發生者。在這種情況下,應該總是把SMI 本指令(atomic instruction),因此在進入偵錯狀 是先完成安全性功能。 進入偵錯停機模式有下列限 僅在非安全性情境中考慮外部偵錯請求或内 求。如果在安全性情境中已宣告EDBGRQ(外部摘 External Debug Request),一旦安全性功能終止 入偵錯停機模式,而核心回到非安全性情境中。 在安全性記憶體為斷點或監視點設計不會產 及當程式設計位址符合時核心不停止。 向量捕捉登錄(Vector Trap Register,詳見一 及非安全性異常。如前所述所有擴充捕捉啟用位 生影響。 一旦在停機偵錯模式中,則應用下列限制: 不能改變S位元以強制進入安全性情境, 時和偵錯 在監控偵 時所發生 制為非安 第71B圖 視為一^基 態之前總 部偵錯請 錯請求, 則核心進 生影響以 7文)僅涉 元不會產 非啟用安 126 200422849 全性偵錯。 如果僅纟*纟性監督模<中允許偵錯不能夠改變模式 位元。 不能改變控制安全性偵錯的專屬位元。 如果一 SMI被载< 入和執行(以系統速度存取),僅在當 完全執行安全性功能時,核心再次進入偵錯狀態。 在監控偵錯模式中因為不能在安全性情境中發生監 控,安全性中止管理器不需要支援偵錯監控程式。在非安 •全性情境中,逐步步驟是可能的,但是只要一 SMI執行, 則完全執行安全性功能,換言之,當「步驟開始(step-in)」 和「步驟結束(step-over)」在所有其它指令都可能時,一 XWSI只允許「步驟結束(step_over)」。因此xwsi被視為 一基本指令(atomic instruction)。 使一旦安全性偵錯失效,吾人有下列限制: 在進入監控模式之前: 在非安全性情境中只考慮斷點和監視點。如果已設置 位元 S,略過斷點/監視點。請注意,監視點單元以 MCR/MRC(CP14)存取,這將不造成安全性問題,因為斷點 /監視點對安全性記憶體不會有影響。 通常用BKPT來代替斷點所設定之指令。假定在記憶 體中覆寫.上述指令係依據BKPT指令,其僅在非安全性模 式中有可能。 向量捕捉登錄僅涉及非安全性異常。如前所述所有擴 充捕捉啟用位元不會產生影響。資料中止和預取中止啟用 127 200422849 位元 s位 於安 模式 錯狀 它回 心地 入一 總之 模式 何人 的安 式碼 保持 應該失效以避免強迫處理器進入一不可恢復狀態。 藉由JTAG ’吾人對停機模式有相同的限制(不能修改 元、等等)。 一旦在監控模式(非安全性中止模式) 非安王|±中止管理器能夠傾印非安全性情境和不可見 全性區塊登錄及安全性記憶體。 以基本SMI指令執行安全性功能 不月b改變s位元以強制進入安全性情境。 如果/、在安全性監督模式中不允許偵錯,不能夠改變 位元。 "月/主意’如果外部偵錯請求(EDBGRQ)發生, 在非安全性情境中,核心終止現有指令並立即進入價 態(在停機模式中)。 在安全性情境中,終止現有功能並進入偵錯狀態,當 到非安全性情境時。 新的偵錯需求在核心硬體中意味著一些修正。必須精 控制S位元,以及基於安全性,該安全性位元不能插 掃描鏈中。 ’在偵錯中,僅在安全性監督模式中啟用偵錯時改變 位元。如此將防止能夠在安全性網域中存取偵錯的任 能夠藉由改變系統(修改TBL項目、等等)以存取所有 全性情境。這種方法中,每一執行緒能夠對自己的程 也只能對自已的程式碼進行偵錯。必須使安全性核心 其女全性。因此在非安全性情境中執行核心時進入偵 128 200422849 錯,只能夠如前所述般改變模式位元。 本技術的實施例使用一新的向量捕捉登錄 trap register)。如果在該登錄中的位元之一設定為 應的向量觸發,處理器進入偵錯狀態如同一斷點已 於自相關的異常向量取回的一指令。該些位元的行 依在偵錯控制登錄中的「在安全性情境啟用中 (Debug in Secure world Enable)」之位元值而不同。 該新的向量捕捉登錄包括下列位元: D一s — abort、P — s一abort、S一undef、SMI、FIQ、Trace Macrocen). ETM has—tracking port to output tracking information ’, which can then be analyzed by an external tracking port analyzer. The processor in the embodiment of the present technology operates in two domains, which are separated from each other. In the described embodiment, these domains include secure, non-human, and non-secure domains. However, due to the purpose of the monitoring function, familiarity with this skill will make it clear that this domain may be any two domains that do not leak information about each other. The embodiments of the 纟 technology are related to preventing leakage of data between two network domains and monitoring functions such as error correction and tracking, which allow convenient access to the entire system, which is also a potential for data leakage between network domains. source. In the above examples of secure and non-secure domains or situations, security information cannot be obtained by non-secure situations. In addition, if debt is allowed in a security context, it may help limit or hide some of the information in the security context. The dashed lines in Figures 5 and 9 show examples of some possible methods that divide data access and provide different levels of granularity (granuUrityp in Figure 59. Block 500 shows the monitoring mode and it is the safest of all modes and controls the security Switch between sexual and non-secure contexts. There is a supervision mode 52 under the monitoring mode 500. Then there are non-security user modes with applications 522 and M #, and security users with applications 512, 514, and 516 Mode. Only monitoring mode (debug and trace) can be controlled. Monitoring non-security mode (left side of dashed line 501). Optionally, monitoring of non-secure domains or context and security user mode (left side of 5 〇 丨) can be allowed. And 501 to the right below 502). In a further embodiment, 114 200422849 may allow execution of non-security contexts and certain applications in the security user domain, in which case, the dashed line 5 03 Further divisions. Such divisions can help prevent the leakage of security data between different users who can execute different applications. Allows monitoring of the entire system. Depending on the required granularity, during the monitoring function, the following parts of the core need to have access they control. In a debug situation, four types of logins can be set; instruction error status login (if SR), Data Error Status Registration (DFSR), Error Address Registration (FAR), and Instruction Error Address (IFAR) 〇 When changing from a security situation to a non-security situation, the above registration should be cleared in some embodiments to avoid data Any leak of the PC sample log: Debug TAP can access the PC via scan chain 7. When debugging in the security context, the value can be obscured according to the granularity selected in the security context When executing in a security context, it is important that the non-security context, or the non-security context added by the security user application, cannot get any value of p C. TLB project: CP15 may be used to read micro-TLB The project reads and writes the main TLB. We can also control the loading and matching of the main TLB and micro-TLB. This operation must be strictly controlled, especially if it is safe Thread debugging requires the assistance of MMU / MPU. Performance monitoring control registration: The performance control registration gives information on those cache mismatches, micr0-TLB non-compliances, external memory requests, branch instructions executed, etc. Non- The security context should not access this data, even in the debugging state. Even if debugging fails in the security context, these 115 200422849 counts should be operable in the security context. Debugging in the cache system: Mistakes in a cached system must be observable. This is important to maintain consistency between the cache and external memory. Using CP 15 can disable the cache, or can force the cache to write to all areas. In any case, allowing modification of cache behavior in debugging may be a weakness of security and should be controlled. Byte Order (Endianness): Non-female or female users with access to debug should not be allowed to change the byte order. Changing the order of this byte may cause a security core failure. Depending on the granularity, byte order access is disabled in the debug. At the beginning of the monitoring function, the access to the monitoring function of the core part can be controlled. Debugging and tracing can be initiated in many ways. Embodiments of the present technology control access to monitoring functions of certain security portions of the core by allowing initialization only under certain conditions. Embodiments of the present technology seek to limit access monitoring functions with the following granularities: by controlling intrusive and non-intrusive (tracing) debugging separately; by allowing only in the security user mode or throughout security Debug items in context; by allowing debugging only in the security user mode and taking thread IDs into account (application execution). To control the initialization of a monitoring function, it is important to understand how the function can be initiated. Figure 60 shows a table illustrating the possibility of initial monitoring function. 116 200422849 Method ′ The initial monitoring function type and such initialization instructions can be designed. Usually, these monitoring fingers can be accessed by software or hardware, that is, by the JTAG controller, a control value for controlling the initialization of the monitoring function. The above includes the position-dependent start bit and therefore if the special bit is set, it is only allowed to start the control when the start bit is set. The CP 14 stores these bits (error detection and status control). Login, DSCR), which is located in ICE 53 (refer to Figure 67. In the preferred embodiment, there are four bits to enable intrusion and disable intrusion and debug. The above includes a security debug startup Bits, global tracking enable bits, a security user mode enable bit, and global thread sense enable bits. These control values are used to provide a certain degree of controllable granularity for monitoring functions and can therefore help Prevent the leakage of a special domain. Figure 61 provides a summary of the bits and how they can be stored. The control bits are stored in a registry in the security domain, and access to the registry is limited to Three possibilities. Software access is provided by the auxiliary MRC / MCR command, and the above only allows those from the sexual supervision mode. Optionally, software access can be provided from any other mode using a code. A further option and hard Body access It also involves using the input port of the JTAG to write instructions. In addition to inputting control values related to the effectiveness of the monitoring function, the input ports can be used to input control values related to other functions of the processor. Related to scan chains and JTAG Further details are as follows. Program order, which makes the monitoring and control state appear) ° Non-intrusive, one security, one security can determine network access and processing security-granted for this round 117 200422849 Register logic grid (Register logic cell) Each integrated circuit (1C) contains two types of logic: • Combined logic cells; for example, AND, OR, INV gates. Based on one or more input signals, a Boolean representation is calculated using such a gate or a combination of such gates. • Log in to a logic cell; for example, LATCH, FLIP-FLOP. Use this grid to record any signal value. Figure 62 shows a positive-edge triggered FLIP-FLOP: When a positive-edge event occurs on a clock signal (CK), the output (Q) receives the value of the input (D); otherwise the output (Q ) Keep its value in memory. Scan key grid For testing or debugging purposes, it is necessary to skip the functional access of the registration logic grid and directly access the contents of the registration logic grid. Therefore, the registration grid is integrated into a scan chain shown in FIG. 63. In functional mode, Scan Enable (SE, Scan Enable) is clear and the login box functions as a single login box. In quiz or debug mode, set SE and input data can come from Scan In (SI) input instead of d input. Scan chains As shown in Figure 64, all scan chains are chained into scan chains. In the functional mode, the SE is clear and usually has access to all 118 200422849 log-in grids and interacts with the circuit's complex storage temperature and logic. In Test or Debug mode, se is produced today by ^ Broken and placed and linked all logins in a scan chain with each other. The data can be refreshed — from the scan chain and can be transformed by any straight girl at any rhythm of the clock cycle. Ability to convert data to understand login content. Use 4 贞 # TAP controller to control some scan chains. The τΑρ controller can select specific scan keys: it connects the “scan in” and “scan out” signals; to a specific scan chain. Funding can then be scanned, converted, or scanned out of the crossbar key. The TAP controller is controlled externally through a JTAG port interface. Figure 65 illustrates a TAP controller. Choosing the last name is invalid. For security reasons, some logins cannot be accessed by the scan chain, even in debug or quiz mode. A new input called jaDI (JTag Access Invalidation) allows dynamic or static removal of a scan chain from an entire scan chain without having to modify the scan chain architecture in the integrated circuit. Figures 66A and 66B should not be entered. If JADI is not enabled (jadI = 〇), the scan chain works as usual whether in functional or test or debug mode. If JADI is enabled (JAD 1 = 1), and we are in test or debug mode, some scan key grids (selected by the designer) can be removed from the scan key framework r ". To maintain the same number of scan chains, the JTAG selective fail scan chain enables 119 200422849 to use a bypass register. Please note that the scan out (SO, San out) and scan chain output (Q) are now different. Figure 67 illustrates a processor that includes portions of JTAG. In normal operation, the command memory 550 and the core communication can also communicate with the registered CP14 and reset the control value under certain conditions. Normally only self-safe supervision is allowed. When the debug is initialized, the instruction is input through the Debug TAP (Debug TAP) 580, and it is the control core. The core under debug is executed step by step. Debug TAP accesses CP14 through the core (according to the access control signal input to JSDAEN PIN, which is displayed by JADI PIN (JTAG ACCESS DISABLE INPUT in Figure 45)) and can also be reset by this method Set the control value. By the access control signal JSDAEN controls the access to the CP 14 registration by the Debug TAP 5 80. This arrangement is such that access, especially write access, must allow JSDAEN to be set high. When the entire processor has been confirmed, during the board stage, debt faults are enabled throughout the system and JSDAEN is set high. Once the system has been checked, the 1J JSDAEN PIN can be grounded, which means that debugging with the Debug TAP 5 80 cannot be enabled at this time. The general processor in production mode has a grounded JSDAEN. Therefore, the control value can only be accessed by software routed through the command memory 550. Access via this bypass is restricted to the security oversight mode or another mode that provides an authorization code (refer to Figure 68). It should be noted that by default, debugging (intrusion and non-intrusion-tracking) can only be used in non-security contexts. In order for them to be used in security situation 120 200422849, the control value enable bit needs to be set. The advantage is that debugging can only always be performed in context by the user. Therefore, although the user usually has a security context in debugging, it is not a problem in many cases' because access is limited and the security context is already in the board stage before it is available. It is therefore foreseeable that security is unnecessary in many cases. If necessary, a safety watchdog can still perform software debugging initialization for CP 14. Figures 6 and 8 illustrate the control of debug initialization. A part of the figure 1 includes a storage element 601 (which can be logged in as previously described) in which a status bit S indicating whether the system is in a security context is stored. The core 600 also includes a login 602, a mode executed by the processor (such as a user mode), and a login for a content identifier to confirm the application currently executing on the core. When a breakpoint is reached, a comparator will log in 6 1 1 compares the core address stored in the register 6 1 2 with the signal register 620. The control logic 620 looks at the security state S, the mode thread (content identifier) 603 and compares it with the control value and the conditional state at the time of deposit. If the system is not in a security context-the "Enter Debug" signal will be output at 630. However, if operating in a global context, the control logic 620 will look at the mode. If it is in user mode, it will check to see if the enable and debug enable bits are set. If they are initialized, then they will understand the thread consciousness bit (thread aware cannot be accessed in non-security. For the situation to be fully confirmed, the debugging of the situation can be written to I7, and the core 600 is a CP15 A security method includes instructing the recording or execution of instructions 603. The stored breakpoints are sent to the control logic 602 and executed in the CP14 storage operation, then the system is in An602, and the user mode has been detected. ) Has not yet been initialized. The hierarchical nature of control values is described above. Only the level energy model in Figure 68 also illustrates the thread detection part of the monitoring control and how the self-safety supervision mode (in this embodiment, the processor is in the production section and JSDAEN is grounded) is converted in the login CP14. Six μ ^ 1 TT stored control value. It is enough to use an authorization code to enter the security supervision mode from a security user mode, and then set the control value in CP14. When the address comparator 610 indicates that the breakpoint has been reached, the control logic 62 outputs-"enter debugging" signal, and understands that the thread comparator "0 shows that debugging is allowed for this thread. Assume that in Cp 丨 4 The thread-aware initialization bit is set. If the thread-aware initialization bit is set after a breakpoint, 'If the address and content identification match those indicated in the breakpoint and in the allowed thread indicators, then Only debug or trace can be entered. After the monitoring function is initialized, only when the comparator 640 detects that the detected content identifier is an allowed thread, the diagnostic data extraction can be continued. When a content identifier is displayed When the executed application is not a permissive, the extraction of diagnostic data is prevented. It should be noted that in the preferred embodiment, there is a certain level of granularity. Actually, the security debug or trace enable bit is in At the top, the bit is enabled for security user mode next, and finally the security thread detection enable bit is 70 ° as shown in Figures 69A and 69B (see below for details). control (Debug and Status Control) "log (CP 14) to retain the control value based on domain model and control security thread debugging granularity. It is on top of the security oversight model. Once the "error detection and status control" is set to log in to CP 1, 4 and the corresponding 2004 200422849 breakpoints, monitoring points, etc. are designed by the safety supervision mode, so that the core enters the debugging state. Figure 69A outlines the security debug granularity of intrusive debugging. Reset presets are shown in gray. The same applies to the granularity of debugging that is not invasive. Figure 69B outlines the security debug granularity in this case. This section also resets the preset values in gray. Note that the security user mode debug enable bit and the security thread debug enable bit are generally used for invasive and non-intrusive debugging. A thread detection initialization bit is stored in the login c p 1 4 and indicates whether the granularity is required according to the application. If the thread awareness bit has been initialized, the control logic will further check that the application identifier or thread 603 is the one indicated in the thread detection control value, and if so, the debug will be initialized. If either the user mode or the debug enable bit is not set or the thread detection bit is set and the application being executed is not the one indicated in the thread debt control value, the breakpoint will be ignored and the core will Continuing with its original performer will not be initialized. In addition to controlling the initialization of the monitoring function, the acquisition of diagnostic data during a monitoring function can also be controlled by a similar method. In order to achieve the above purpose, the core must continue to consider the two control values' during the operation of the monitoring function, i.e. the enable bits stored in the registered CP 1 4 and their related conditions. Figure 70 illustrates the granularity of a monitoring function when it is performed. In this case, the area A is related to the area where diagnostic data is allowed to be retrieved, and the area β is about the area where the control value is stored in CP 1 4, which means that it is impossible to intercept the diagnostic data. 123 200422849 Because the data field B is interrupted, and the program is intercepted, but the order is always retrieved. In this case, it is related to the detection and recovery of its failure situation. But therefore ETM should be contextual.此 When this is the case, diagnostics are output in a step-by-step manner during debugging when a debug is performed and a program is operating in area A. When the operation is converted to:, it is a place where diagnostic data is not allowed to be retrieved, and debugging is carried out automatically in a stepwise manner without any data being retrieved. Continue straight operation in this way to enter area A again, and the debugging of the diagnostic data is resumed in a stepwise manner. In the above embodiment, if the security domain is not enabled, a smi refers to as an atomic event to prevent diagnostic data. In addition, if the thread detection initialization bit is set, the application also operates. The granularity of the monitoring function during the period. In terms of non-intrusive debugging or tracking, it is achieved by the ETM and has nothing to do with error. When • Tracking is enabled, ETM functions as usual, and at that time, ETM hides tracking in a security context or partially securely depending on the granularity chosen. One method to avoid ETM from capturing diagnostic data in the security domain when it is not enabled is to reduce the etm when the s bit is high by combining the S bit with the ETMPWRDOWN signal to achieve this. When the core enters the security context, Keep the last value of ETM. Therefore, it is necessary to track an S MI instruction and then decelerate until the core returns to non-security. Therefore, ETM will only monitor non-security activities. These different monitoring functions and their granularity are summarized below. The gain stage of the board stage is incorrect. At the beginning of the board stage when the JSDAEN PIN is not grounded, it may be initially wrong at any place. Similarly, if I am in a security surveillance mode, I have similar authority. If I initiate debugging in halt debug mode, 'all logins are accessible (non-security and secure login blocks), and the entire memory can be dumped except for the bits dedicated to control body. Ability to enter debug shutdown mode from any mode and any domain. Ability to set breakpoints and watchpoints in secure or non-secure memory. In the debug state, it is possible to enter the security situation by changing only the S bit by using an MCR instruction. When a security exception occurs, the debug mode can be entered. The new bits used to expand the vector trap register are as follows; SMI vector capture is enabled; security data abort vector capture is enabled; security prefetch abort abort vector capture Enabled; and female-wide unambiguous vector capture enabled. In the monitoring and debugging mode, if we allow debugging anywhere, even when calling an SMI in a non-security situation, we may enter the security situation with step-by-step debugging. When a breakpoint occurs in the security domain, the security abort manager is operable to dump the security login block and security memory. Both abort managers in security and non-security situations give their information to the debugger application so that the debugger window (on the relevant debug control PC) is in both the security and non-security situations You can display the login status in. , 125 200422849 Figure 7 1A shows what happens when the core is set in the monitoring debug mode to be enabled in the security context. Figure 71B shows the time when δ is in the error mode and the debugger is disabled in the security context. The subsequent procedures will be detailed as follows. Intrusive Debugging in the Production Phase In the production phase, when JSDAEN has grounding and debugging limits, unless the safety supervision decides otherwise, it is showing what happened. In this case, the SMI should always be an atomic instruction, so the security function should be completed before entering the debug state. Entry into debug shutdown mode has the following limitations: External debug requests or internal requests are considered only in non-security situations. If EDBGRQ (External Debug Request) has been declared in the security situation, once the security function is terminated, the system enters the debug shutdown mode, and the core returns to the non-security situation. Designing for breakpoints or watchpoints in security memory does not produce and the kernel does not stop when the programming address matches. Vector Trap Register (see the first and non-safety exceptions for details. All extended capture enable bit effects as described above. Once in shutdown debug mode, the following restrictions apply: S bit cannot be changed to force entry The security situation, time and error detection during monitoring and detection are non-safety. Figure 71B is regarded as a ground state before the headquarters error detection request, then the core impact will be 7) Enabling An 126 200422849 comprehensive debugging. It is not possible to change the mode bits if only error detection is allowed in the sexual supervision mode < The exclusive bits that control security debugging cannot be changed. If an SMI is loaded and executed (accessed at system speed), the core enters the debug state again only when the security function is fully executed. In the monitoring and debugging mode, since monitoring cannot occur in a security context, the security suspension manager does not need to support the debugging monitoring program. In non-safety / whole-sense scenarios, step-by-step steps are possible, but as soon as one SMI is executed, the security function is fully performed, in other words, when "step-in" and "step-over" When all other instructions are possible, an XWSI allows only "step_over". Therefore xwsi is considered an atomic instruction. Once security debugging is disabled, we have the following restrictions: Before entering monitoring mode: Only consider breakpoints and monitoring points in non-security situations. If bit S is set, breakpoints / watchpoints are skipped. Please note that the watchpoint unit is accessed with MCR / MRC (CP14). This will not cause a security issue, as the breakpoints / watchpoints will not affect the security memory. BKPT is usually used to replace the instruction set by the breakpoint. It is assumed to be overwritten in memory. The above instructions are based on the BKPT instruction, which is only possible in non-safe mode. Vector capture login involves only non-security exceptions. As mentioned earlier, all extended capture enable bits have no effect. Data suspension and prefetch suspension enable 127 200422849 bits s bit in security mode It goes back into one mode Anyone's security code retention should be disabled to avoid forcing the processor into an unrecoverable state. With JTAG ’, we have the same restrictions on the shutdown mode (it cannot be modified, etc.). Once in monitoring mode (non-security abort mode) Non-Anwang | ± abort manager can dump non-security contexts and invisible full block logins and security memory. Perform security functions with basic SMI instructions. Change the s bit to force entry into the security context. If / is not allowed to debug in the security supervision mode, the bit cannot be changed. " Month / Idea 'If an external debug request (EDBGRQ) occurs, in a non-safety context, the core terminates the existing instruction and immediately enters the price state (in shutdown mode). In the security context, terminate the existing function and enter the debug state when it comes to the non-security context. New debugging requirements imply some fixes in the core hardware. The S bit must be carefully controlled, and based on security, this security bit cannot be inserted into the scan chain. ’In debugging, bits are changed only when debugging is enabled in the security oversight mode. This will prevent any access to debugging in the security domain. It will be possible to access all global situations by changing the system (modifying TBL items, etc.). In this method, each thread can debug its own program and can only debug its own code. Security must be at the core of their female sex. Therefore, when the core is executed in a non-safety situation, it will enter the detection 128 200422849 error, and only the mode bits can be changed as described above. Embodiments of the present technology use a new vector capture login register. If one of the bits in the registration is set to the corresponding vector trigger, the processor enters a debug state such as an instruction that the same breakpoint has been retrieved from the autocorrelation exception vector. The rows of these bits differ according to the bit value of "Debug in Secure world Enable" in the debug control registration. The new vector capture entry includes the following bits: D_s — abort, P — s — abort, S — undef, SMI, FIQ,

Unaligned、D — abort、P abort、SWI 和 Undef。 D一s — abort位元:只能在當在安全性情境中啟 時以及當在停機偵錯模式中設定偵錯時設置。在監 模式中,該位元絕不設置。如果在安全性情境中的 效’無論該位元之值為何不會有任何影響。 P — s — abort位元:與d一s —abort位元相同。 S一undef位元:僅能在當在安全性情境中啟用 议置。如果在安全性情境中偵錯失效,無論該位元 何不會有任何影響。 SMI位元:僅能在當在安全性情境中啟用偵 置如果在安全性情境中偵錯失效,無論該位元之 不會有任何影響。 FIQ、IRQ、D一abort、P一abort、SWI、undef 位 葬安全性異常對應,所以即使在安全性情境中偵錯 仍然有效’请注意D — abort和P abort不應該 (vector 高和對 經設置 為可能 的偵錯 IRQ、 用偵錯 控偵錯 偵錯失 偵錯時 之值為 錯時設 值為何 元:與 失效, 在監控 129 200422849 模式中宣告高。Unaligned, D — abort, P abort, SWI, and Undef. D_s — abort bit: can only be set when enabled in the security context and when debugging is set in the shutdown debug mode. In monitoring mode, this bit is never set. If it is effective in a security context, it will have no effect regardless of the value of the bit. P — s — abort bit: same as d — s —abort bit. S-undef bit: Negotiation can only be enabled when in a security context. If debugging fails in a security context, this bit has no effect whatsoever. SMI bit: Detection can only be enabled when in a security context. If debugging fails in a security context, this bit has no effect. FIQ, IRQ, D_abort, P_abort, SWI, undef correspond to security exceptions, so debugging is still effective even in a security context. 'Please note that D — abort and P abort should not (vector high and Set to possible IRQ for debugging, use debug control to debug, and set the value when the error is wrong. The value is set to Yuan: and invalid, declared high in the mode of monitoring 129 200422849.

Reset位元:當重設發生時,吾人進入安全性情境, 僅當在安全性情境中啟用偵錯時該位元有效,否則其不會 產生影響。 雖然本文中已經描述了本發明的一特定實施例,但是 明顯地本發明並未侷限於上述内容,亦可能在本發明的範 缚中進行許多修正和增加。例如,在不悖離本發明之範鳴 情況下,能夠以申請專利範圍之獨立項進行下列附屬項特 徵的各種結合。 【圖式簡單說明】 本發明將進一步參照以附圖圖示之僅為例示的較佳實 施例解說,其中: 第1圖係一方塊圖,依據本發明之較佳實施例圖示一 資料處理設備; 第2圖圖示在一非安全性網域和一安全性網域操作之 不同程式; 第3圖圖示相關於不同安全模式之處理模式·之一矩 陣; 第4和5圖圖示在處理模式和安全網或間不同的關係; 第6圖圖示一程式設計師的模組,與處理模式相關之 一處理器的登錄區塊; 第7圖圖示一示例,為一安全性網域和一非安全性網 域提供個別的登錄區塊; 第8圖圖示多種處理模式,在安全性網域之間藉由一 130 200422849 個別的監控模式所進行之轉換; 第9圖之示圖,使用一模式轉換軟體中斷指令之安全 性網域之轉換; 第1 0圖圖示一示例,系統如何處理非安全性中斷請求 和安全性中斷請求; 第11A和11B圖依據第10圖,圖示一非安全性中斷 請求處理之示例,和一安全性中斷請求處理之示例; 第12圖圖示一可選擇性的機制,比較第10圖所圖示 者,用以控制非安全性中斷請求信號和安全性中斷請求信 號; 第1 3 A和1 3B之示例性示圖,依據第1 2圖用以處理 一非安全性中斷請求和一安全性中斷請求; 第1 4圖係一向量中斷表之示例; 表 斷 中 量 向 數 多 之 相 ; 域錄 網登 全制 安控 同常圖 不異程 與一流 示示 1 圖圖係 圖圖圖 5 6 7 11 1Χ 11 第第第 以 圖 意 示 圖 域 網 性 全 安 告 警 種 變常 改異 法換 方轉 之式 定模 設的 指一 之 錄 登 態 狀 處 #3^ 各 生 產 何 如 令禾 丨式 控 監 入 進 發 觸 序 依 其 視 模 控 監 行 執 執 1 之 制 控 器 ; y··- 理的 處斷 一中 之係 作務 操任 式一 模之 種中 多式 以模 示控 圖監 圖在 8 中 1其 第, 緒 行 不一 之 制 控 器 S 處 1 之 作 操 式 模 種 多 以 示 圖 圖 ·, 9 緒 11- 行 第執 的 同 進 1 之 制 控 器 ; 理式 處模 一控 之監 作於 操用 式啟 模係 種斷 多 中 以中 示其 lilt , 圖緒 ο 行 2執 第的 步 131 200422849 第2 1圖至2 3圖依據另一示例性實施例圖示不同的處 理模式和過程,用以在安全性和非安全性網域間轉換; 第24圖圖示增加一安全性處理選擇至一習知ARM核 心之觀念; 第 2 5圖圖示具有安全性和非安全性網域及重設之一 處理器; 第 26圖圖示使用一軟體偽造之中斷傳遞處理請求至 一虛懸之作業系統; 第27圖圖示另一示例,使用一軟體偽造之中斷傳遞處 理請求至一虛懸之作業系統; 第28圖係一流程圖,圖示接收到在第26和27圖所產 生型態之一軟體偽造中斷時,所執行之處理; 第29和3 0圖圖示在一安全性作業系統之後所進行之 任務,用以追蹤由一非安全性作業系統所進行之可能的任 務轉換; 第3 1圖係一流程圖,圖示在第29和30圖之安全性作 業系統中接收到呼叫時,所執行之處理; 第32圖圖示可能在具有多數作業系統之一系統中發 生之中斷優先權反向的問題,其中不同的中斷可以由不同 的作業系統所控制; 第33圖圖示使用存根中斷管理器以避免第32圖所示 之問題;和 第34圖圖示不論是否它們可以被一作業系統所服務 之中斷所中斷,以何為依據控制不同型態和優先權的中斷 132 200422849 第35圖圖示監控模式專屬的處理器設定資料如何優 先於處理器設定資料,當該處理器係在監控模式下操作時; 第3 6圖之一流程圖依據本發明之一實施例,圖示當在 安全性網域和非安全性網域間轉換時,處理器設定資料如 何轉換; 第3 7圖圖示·在本發明之一實施例所用以控制對記憶 體的存取的記憶體管理邏輯; 第3 8圖係一方塊圖,圖示在本發明之一第二實施例所 用以控制對記憶體的存取的記憶體管理邏輯; 第3 9圖係一流程圖,圖示在本發明之實施例所執行之 過程,在記憶體管理邏輯中用以處理專屬於一虛擬位址的 一記憶體存取請求; 第40圖係一流程圖,圖示在本發明之實施例所執行之 過程,在記憶體管理邏輯中用以處理專屬於一虛擬位址的 一實體存取請求; 第41圖圖示本發明之較佳實施例之分割檢測器如何 操作以防止存取安全性記憶體中之一實體位址,當發出該 記憶體存取請求的裝置係操作於一非安全性模式; 第42圖圖示在本發明之一較佳實施例中,一非安全性 分頁表和一安全性分頁表之使用; 第43圖圖示較佳實施例之主要轉譯參考緩衝(tlb translation lookaside buffer)中使用之兩種型式之旗標; 第44圖圖示本發明之一實施例中,在開機程序之後, 記憶體如何被分割; 133 200422849 第45圖圖示依據本發明之一實施例,在開機分割執行 之後,由記憶體管理單元(MMU)所映射之非安全性記憶體; 第46圖圖示依據本發明之一實施例,如何警告右列部 分之記憶體,以允許一安全性應用與一非安全性應用共用 記憶體; 第47圖圖示依據本發明之一實施例,裝置如何被連接 至資料處理設備之外部匯流排; 第4 8圖係一方塊圖,圖示依據本發明之第二實施例, 裝置如何被連接至外部匯流排; 第49圖圖示使用一單一組分頁表之實施例的實體記 憶體之安排; 第 50A圖圖示一安排,其中經由一中介位址使用兩 MMUs以執行虛擬至實體位址的轉譯; 第5 0B圖圖示一選擇性安排,其中經由一中介位址使 用兩MMUs以執行虛擬至實體位址的轉譯; 第5 1圖僅為示例,圖示對於安全性網域和非安全性網 域,在實體位址空間和中介位址空間之間的對應; 第5 2圖圖示經由相關於第二MMU之分頁表之控制在 安全性和非安全性網域之間的記憶體區域的調換(swap); 第5 3圖之實施例圖示使用一單一 MMU之實施,及其 中在主要TLB的不符者導致請求一異常以決定虛擬至實 體的位址轉譯; 第 5 4圖係一流程圖,圖示由處理器核心所執行之程 序,用以在第53圖之MMU的主要TLB不符的同時,對所 134 200422849 發出之異常採取行動; 第5 5圖係一方塊圖,圖示一實施例中一資料處理設備 中所提供之元件,其中對快取提供資訊,以決定儲存在個 別的快取線上的資料是安全性資料或非安全性資料; 第56圖圖示如第55圖所示之記憶體管理單元之結構; 第57圖係^一流程圖圖示第55圖所示之資料處理設備 中所執行的處理,以處理一非安全性記憶體存取請求; 第5 8圖係一流程圖圖示第5 5圖所示之資料處理設備 中所執行的處理,以處理一安全性記憶體存取請求; 第59圖圖示對於在一處理器上執行之不同模式和應 用,監控功能可能的粒度(granularity); 第60圖圖示初始不同的監控功能之可能的方法; 第61圖圖示一控制值表,用以控制可使用之不同監控 功能; 第 62 圖圖示一正緣觸發正反器(p0Sitive_edge triggered Flip-Flop); 第63圖圖示一掃描串鍵單元(scan chain cell); 第64圖圖不在一掃描串鍵中之多數掃描串鍵單元; 第65圖圖示一偵錯TAP控制器; 第66A圖圖示一具有JADI之偵錯TAP控制器; 第66B圖圖示一具有一旁路登錄(bypass register)之 一掃描串鏈單元 第67圖圖示一處理器,包含一核心、掃描串鏈和一偵 錯狀態及控制登錄(Debug Status and Control Register); 135 200422849 第68圖圖示因子(factor)控制偵錯或追蹤的初始化; 第69 A和69B圖圖示偵錯粒度之摘要; 第70圖圖示執行時之偵錯粒度;及 第71A和71B圖圖示在安全情境中啟用偵錯且當其並 非個別啟用之監控偵錯。 【元件代表符號簡單說明】 10 核心 12 掃描鏈 14 登錄區塊 16 ALU 18 JTAG控制器Reset bit: When a reset occurs, we enter the security context. This bit is valid only when debugging is enabled in the security context, otherwise it will not have an impact. Although a specific embodiment of the present invention has been described herein, it is obvious that the present invention is not limited to the above, and many modifications and additions may be made within the scope of the present invention. For example, without departing from the scope of the present invention, it is possible to perform various combinations of the following subsidiary features with independent items in the scope of patent application. [Brief description of the drawings] The present invention will be further explained with reference to the preferred embodiment illustrated by the drawings, wherein: FIG. 1 is a block diagram illustrating a data processing according to a preferred embodiment of the present invention Equipment; Figure 2 illustrates different procedures for operating in a non-secure domain and a security domain; Figure 3 illustrates a matrix of processing modes related to different security modes; Figures 4 and 5 illustrate The relationship between the processing mode and the safety net is different; Figure 6 illustrates a programmer's module and a processor's login block related to the processing mode; Figure 7 illustrates an example for security A domain and a non-secure network domain provide separate login blocks. Figure 8 illustrates multiple processing modes, which are converted between the security domains by a single 2004 200422849 individual monitoring mode. Figure 9 of Figure 10 shows the conversion of a security domain using a mode switch software interrupt instruction. Figure 10 shows an example of how the system handles non-security interrupt requests and security interrupt requests. Figures 11A and 11B are based on Figure 10. , Iconic An example of an interrupt request processing and an example of a security interrupt request processing; Figure 12 illustrates an optional mechanism, compared to the one shown in Figure 10, to control the non-security interrupt request signal and security Interrupt request signal; Exemplary diagrams of Figures 13 A and 1 3B for processing a non-security interrupt request and a security interrupt request according to Figure 12; Figure 14 is an example of a vector interrupt table; The number of directions in the table is large; the domain recording network login full-time security control is the same as the normal map and the first-class display is shown in Figure 1 Figure 5 Figure 7 6 Figure 1 Figure 11 The general security alarm type is often changed, the method is changed, the method is changed, the mode is set, and the mode is set. # 3 ^ Herulinghe in each production Execute the control device of 1; y ··-Reasonable execution of the first operation system, one operation mode, one mode, and multiple modes. The model is used to control the chart. There are many types of operation modes of the control unit S at 1. Tutu ·, 9 11 11- The first controller of Tongjin 1 that executes the line; the supervisor of the logical processing mode and the control is shown in the operation mode of the system, and its lilt is shown in the line. Step 2 131 200422849 Figures 21 to 23 illustrate different processing modes and procedures for switching between secure and non-secure network domains according to another exemplary embodiment; Figure 24 illustrates Add a security processing option to the concept of a familiar ARM core; Figures 2 and 5 illustrate a processor with security and non-security domains and reset; Figure 26 illustrates the use of a software-forged interrupt transfer Processing request to a virtual operating system; Figure 27 illustrates another example, using a software-forged interrupt to pass a processing request to a virtual operating system; Figure 28 is a flowchart illustrating the receiving One of the patterns generated in Figure 27 is the processing performed when a software forgery is interrupted; Figures 29 and 30 illustrate tasks performed after a secure operating system for tracking performed by a non-secure operating system Possible task transitions; part 3 1 A flowchart showing the processing performed when a call is received in the security operating system of Figures 29 and 30; Figure 32 illustrates the interrupt priority countermeasures that may occur in one of the systems with most operating systems Problem, where different interrupts can be controlled by different operating systems; Figure 33 illustrates the use of a stub interrupt manager to avoid the problem shown in Figure 32; and Figure 34 illustrates whether they can be operated on by one or not The interrupts serviced by the system are interrupted. What is the basis for controlling interrupts of different types and priorities? 132 200422849 Figure 35 shows how the processor-specific configuration data exclusive to the monitoring mode has priority over the processor configuration data. When operating in the monitoring mode; FIG. 36 is a flowchart according to an embodiment of the present invention, illustrating how the processor setting data is converted when switching between a secure network domain and a non-secure network domain; The figure shows the memory management logic used to control the access to the memory in one embodiment of the present invention; FIG. 38 is a block diagram showing the second embodiment of the present invention Memory management logic for controlling access to memory; Figures 39 and 9 are flowcharts illustrating the processes performed in the embodiments of the present invention, and are used in the memory management logic to process a virtual memory. A memory access request for an address; FIG. 40 is a flowchart illustrating a process performed in an embodiment of the present invention and used in the memory management logic to process a physical memory dedicated to a virtual address Figure 41 illustrates how the segmentation detector of a preferred embodiment of the present invention operates to prevent access to a physical address in the security memory. When the device that issues the memory access request operates on a Non-security mode; Figure 42 illustrates the use of a non-security paging table and a security paging table in a preferred embodiment of the present invention; Figure 43 illustrates the main translation reference buffer of the preferred embodiment Two types of flags used in tlb translation lookaside buffer; Figure 44 illustrates how the memory is divided after the boot process in one embodiment of the present invention; 133 200422849 Figure 45 illustrates a method according to the present invention In one embodiment, the non-secure memory mapped by the memory management unit (MMU) after the boot partition is executed; FIG. 46 illustrates how to warn the memory in the right column according to an embodiment of the present invention. FIG. 47 illustrates how a device is connected to an external bus of a data processing device according to an embodiment of the present invention. FIG. 48 is a block diagram. FIG. 49 illustrates how a device is connected to an external bus according to a second embodiment of the present invention; FIG. 49 illustrates an arrangement of the physical memory of the embodiment using a single-component page table; FIG. 50A illustrates an arrangement, Which uses two MMUs via an intermediary address to perform virtual-to-physical address translation; Figure 50B illustrates an alternative arrangement in which two MMUs are used via an intermediary address to perform virtual-to-physical address translation; Figure 51 is only an example, showing the correspondence between the physical address space and the intermediary address space for the secure and non-secure domains. Figure 5 2 Page table control swaps memory areas between secure and non-secure network domains; the embodiment of Figure 53 illustrates the implementation using a single MMU, and the non-compliance with the main TLB results in An exception is requested to determine the virtual-to-physical address translation; Figure 54 is a flowchart illustrating the procedure executed by the processor core for the purpose of correcting the problem when the main TLB of the MMU in Figure 53 does not match. 134 200422849 Take action when abnormal; Figure 5 5 is a block diagram showing the components provided in a data processing device in an embodiment, in which information is provided to the cache to determine which ones are stored on individual cache lines The data is security data or non-security data; Fig. 56 shows the structure of the memory management unit shown in Fig. 55; Fig. 57 is a flowchart showing the data processing equipment shown in Fig. 55 The processing performed to process a non-secure memory access request; FIG. 58 is a flowchart illustrating the processing performed in the data processing device shown in FIG. 55 to process a secure memory Access request; Figure 59 For different modes and applications executed on a processor, the possible granularity of the monitoring functions; Figure 60 illustrates the possible methods of initially different monitoring functions; Figure 61 illustrates a control value table for controlling Different monitoring functions that can be used; Figure 62 shows a positive edge triggered flip-flop; Figure 63 shows a scan chain cell; Figure 64 is not in one scan Most of the serial keys scan the serial key unit; Figure 65 shows a debug TAP controller; Figure 66A shows a debug TAP controller with JADI; Figure 66B shows a bypass register (bypass register) Fig. 67 illustrates a processor, including a core, a scan chain, and a debug status and control register; 135 200422849 Fig. 68 illustrates a factor Initialization to control debugging or tracing; Figures 69 A and 69B show a summary of the granularity of debugging; Figure 70 shows the granularity of debugging during execution; and Figures 71A and 71B show debugging enabled in a security context and When it is not a Do not enable monitoring and debugging. [Simple description of component representative symbols] 10 core 12 scan chain 14 login block 16 ALU 18 JTAG controller

20 ICE20 ICE

21 VIC 22 ETM 24 登錄 2 6 控制登錄 30 記憶體管理邏輯 34 控制登錄 36 TCM 38 快取 40 系統匯流排 42 EBI 44 開機ROM 46 螢幕21 VIC 22 ETM 24 Login 2 6 Control Login 30 Memory Management Logic 34 Control Login 36 TCM 38 Cache 40 System Bus 42 EBI 44 Boot ROM 46 Screen

48 登錄或緩衝器 50 DSP 52 DMA 54 判優器/解碼器邏輯 56 外部記憶體 58 分頁表 60 輸入/輸出界面 62 登錄或緩衝器 64 金鑰儲存單元 66 登錄或緩衝器 70 外部匯流排 72 監控程式 200422849 4 6 8 0 2 4 6 02468002460246802468024680 2 4 6 8 0 2 4 00000122223333344444000001 1 1 1 1 2 2 2 先 緩 系1 2 輯 可} } 業用用 12 輯輯 邏 輯輯 ,址址 作應應心用用 邏邏B走器邏邏}1位位 性性性核應應式 可性TLLB行 測可性止快擬體 全全全性性性模許屬0-T表檢許屬(t(^r(>t(t 安安安全全全控Mu取域lcr要譯PU割取域徑徑徑徑徑徑徑徑徑徑式詢詢頁要m子查反取取詢詢頁 非非非安安安監厘存區1111主轉厘分存區路路路路路路路路路路程查查分主在的檢違存存查查分 符 述 描 者 用 使 // 有 私 /IV ...... # 虛性性走包TL允 生全全行LBro-分取 產安安表Ticr部存 ic要 m主 址符符 位述述 擬描描 B ^LB -TTL ο Ί ❿48 Registration or buffer 50 DSP 52 DMA 54 Arbiter / decoder logic 56 External memory 58 Paging table 60 Input / output interface 62 Registration or buffer 64 Key storage unit 66 Registration or buffer 70 External bus 72 Monitoring Program 200422849 4 6 8 0 2 4 6 02468002460246802468024680 2 4 6 8 0 2 4 00000122223333344444000001 1 1 1 1 2 2 2 Early release 1 2 OK}} 12 logic for business use, address should be used as intended Using logic logic B to logic logic 1-bit sexual nuclear response type TLLB to test the feasibility of anomalism, the completeness of sexuality, the model of sexuality, 0-T table, check of the property (t (^ r (> t (t security security full control Mu domain lcr to translate PU cut domain diameter diameter diameter diameter diameter diameter type inquiry page to m sub-inquiry query page non-non-security The 1111 main transfer to the security inspection area, the main transfer to the sub-storage area, Lulu Road, Lulu Road, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lulu, Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu, Lu. Sexual walking package TL Yunsheng full line LBro-separate production safety table Ticr department storage ic main m symbol description description ^ LB -TTL ο ❿ ❿

符 述 描 BW xy 相 符的 述分 描部 性址 全位 安體 的實 加有 附含 效入 有載 含B B rLB -TL 0T icr要 m主 符符 止述述 中描描 誤 性性 錯體全全走 許憶安安行 允記非非表 137 200422849 6 8 0 2 4 6 8 0 2 4680246800570575050500246024^6 22 3 3 3 3 3 5 5 5557777789990002334ι4ι5ι6ί6ι6ι6ι7ππ17 33 3 3 3 3 3 3 3 33333333333344444444444444444 主要TLB包含f产附加的非安全性描述符 分割檢測器檢查疋否非安全性實體位址是非 的 尺非文全性 違反 安全性/非安全性錯誤中止 在micro-TLB載入含有實體位址部分的相關描述 的子部分 檢查存取允許(私有/使用者…) 違反? 核心產生實體位址 MPU檢查許可,及是否非安全性實體位址在非 性記憶體 β t $ 違反? 存取允許錯誤中止 在安全性或非安.全性記憶體的存取 非安全性區域 非安全性區域 非安全性區域 安全性區域 安全性區域 安全性區域 非安全性記憶體 非安全性分頁表 基礎位址 安全性記憶體 安全性分頁表 女全性分頁表基礎位址 網域旗標 程序ID旗標 描述符 描述符 描述符 項目 Ϊ S ί性應用的記憶體 記憶體 安全性分頁 裝置 裝置 外部記憶體 判優器 138 200422849 器面器 衝界衝器 體 器 緩出緩徑測式 式 ,1 憶AP件 較 輯式換令模 器 或輸或路 檢模線線線 模 鏈鏈記 T 元 比 邏模轉指控 碼幕錄入錄號徑割控隔隔隔用用用督用用E描描令心錯心存錄錄址錄錄制徑控工徑M[I監 解螢登輸登信路分監分分分應應應監應應1C掃掃指核偵核儲登登位登登控路監多路SM在 0 0 5 0 0 8 0246802012324602401400001230120001123 7 8888899000011122234457800001112300000 44444444555555555555555566666666622222 料 資 定 設 器 m,l 理 處 屬 專器 a 處 屬 專 式 模 控 監 用 使 /IV 式 程 控 ?監 出入 發進 已式 記 之 態 狀 域 態網 狀點 存終 儲有 域含 網向 的指 令為 }指標 料MI指 資S態 定出狀 設發換 器自轉 ο ο 4 5 ο ο 2 2 139 200422849 2060載入終點網域之狀態 2070離開監控程式。離開監控模式並轉換至終點網域之 模式 2100實體位址空間 2 11 0非安全性記憶體 2120安全性記憶體Descriptive description BW xy Descriptive description of the full position of the partial site of the body is added with the effect of containing the load BB rLB -TL 0T icr to m main character stop description in the description of the description of sexual errors Walk Xu Yi An An Bank allows non-non-table 137 200422849 6 8 0 2 4 6 8 0 2 4680246800570575050500246024 ^ 6 22 3 3 3 3 3 5 5 5557777789990002334ι4ι5ι6 66 66 6π7ππ17 33 3 3 3 3 3 3 3 33333333333344444444444444444 Main TLB contains additional non-products Security Descriptor Detector Detector Checks whether non-secure entity address is non-compliant. Security violation / non-security error is aborted. Sub-section inspection of micro-TLB loading with relevant description of entity address part Access permission (private / user ...) violated? The core generates the physical address MPU check permission, and is the non-secure physical address in non-sex memory β t $ violated? Access allows errors to be aborted in security or non-security. Full memory access non-security zone non-security zone non-security zone security zone security zone security zone non-security memory non-security paging table Base Address Security Memory Security Paging Table Female General Paging Table Base Address Domain Flag Program ID Flag Descriptor Descriptor Descriptor Item Ϊ Memory Memory Security Paging Device for External Applications Device External Memory arbiter 138 200422849 Face device punching boundary punch body body slowly out of the slow-measuring type, 1 memory AP parts are compared to the order-type die changer or lose or road inspection die line line line die chain chain record T yuan Than the logic model transfer accusation code screen entry record number cut control control isolation use the supervisor to use the E description to make a wrong heart to record the address record to record the diameter of the control path Sub-supervision sub-sub-should should be supervised and should be supervised 1C sweeping finger nuclear detection nuclear storage ascended the boarding control road supervision multi-channel SM 0 0 5 0 0 8 0246802012324602401400001230120001123 7 8888899000011122234457800001112300000 44444444555555555555555555666666666222222 materials The setting device m, l is a special device, a is a special mode control supervisor / IV type program control? Monitor in, out, enter, and enter the state of the recorded state, the state of the mesh point, and the final storage of the domain with the network direction. The instruction is}. The indicator MI refers to the state of the device. Set the rotation of the converter ο ο 4 5 ο ο 2 2 139 200422849 2060 Load the status of the destination domain 2070 and leave the monitoring program. Mode to leave monitoring mode and switch to destination domain 2100 physical address space 2 11 0 non-secure memory 2120 secure memory

2150 MMU 2 1 5 3路徑2150 MMU 2 1 5 3 path

215 5 micro-TLB 2 1 5 7路徑215 5 micro-TLB 2 1 5 7 path

2160 主要 TLB 2165轉譯表行走邏輯 2 1 6 7路徑2160 Main TLB 2165 Translation table walking logic 2 1 6 7 path

2170 MMU 2 1 7 5路徑2170 MMU 2 1 7 5 path

2180 主要 TLB 2185轉譯表行走邏輯 2190資料匯流排 2192路徑 2194路徑2180 Main TLB 2185 Translation table Walking logic 2190 Data bus 2192 Path 2194 Path

2170 MMU 2200實體位址空間 2210安全性區域 2220非安全性記憶體 2230安全性區域 2240非安全性記憶體 2250分頁表 2265中間位址空間 2270中間位址空間 2275非安全性中間位址空間 23 00記憶體的一區域2170 MMU 2200 physical address space 2210 security area 2220 non-security memory 2230 security area 2240 non-security memory 2250 paging table 2265 intermediate address space 2270 intermediate address space 2275 non-security intermediate address space 23 00 A region of memory

2305中間位址空間中的區域 2310區域 2400 MMU 24 1 0 micro-TLB 2420 主要 TLB 2422路徑 2430路徑 2440路徑 2450路徑 2500偵測到一 TLB不符者異常? 140 200422849 2510 2520 2530 2540 2550 2560 2570 2580 2590 2595 2600 2610 2612 2620 2630 2632 2634 2636 2640 2650 2652 2654 2656 2700 2705 2710 2715 2720 向誤第一得第位以述轉 設錯關第以尋體符描址< 預的相替符找實述二位42( I常之以述以定描第體2 以異表表描表給二和實LB回 排排 排 器程ro-·性 常致一二一二址第一至T返 流流 流輯 測性lcr全 異導第第第第位該第址要常線線 匯匯 匯邏器器檢全In安詢 該取在取得考間回合位主異取數標址制徑徑徑料制優碼割安詢非查 為獲替預取參中取結擬在自快多旗位控路路路資控判解分非查在一 的 址址 位位 址間擬 位址中虛 間位的誤 式 中體址錯 模 定實位替 控 決取擬以 監址符獲虛符 入位述符誤述 進擬描述錯描 量虛一描到 址虛 位定 體給 實以 的符 址述 位描 擬的 虛新 誤生 錯產 得以 址獲符譯 符 述 描 的 新 該 存 儲 中 B L T 要 主 的 中 址其 位 於 擬存 虛 儲 生符 產B述 式TL描 行 執 藏 標 效 有 該 有 含 Β L 走Τ 行要 表主符 頁定述 分決描 性 全 安 非 的 505050505 233445566 777777777 2222222222305 Area in the middle address space 2310 Area 2400 MMU 24 1 0 micro-TLB 2420 Main TLB 2422 path 2430 path 2440 path 2450 path 2500 An abnormality detected by a TLB? 140 200422849 2510 2520 2530 2540 2550 2560 2570 2580 2590 2595 2600 2610 2612 2620 2630 2632 2634 2636 2640 2650 2650 2652 2654 2656 2700 2705 2710 2715 2720 Set the position to the wrong position in order to set the wrong position to the body sign. < Pre-alternatives to find the two places of the actual description 42 (I often use the description to describe the first body 2 to describe the table to the two and the real LB back to the scheduler ro- · Sexuality often cause one or two One or two sites, the first to the T return stream, the flow rate, the LCR, the first position, the first position, the first position, the first line, the first line, the first line, and the second line. Different access to the address, the diameter, the diameter, the material, the code, the code, the security, the inquiry, and the non-checking. Mistakes between virtual addresses in pseudo-addresses between addresses The virtual position fixation gives the real address description bit description, the false new mistakes and miscarriages can obtain the new address translation description description, the store in the BLT master's center address It is located in the TL descriptive TL profile of the virtual storage symbol to be stored. The effect is that it contains the Β L to be used. The main character of the page is page description. The descriptive safety is 505050505 233445566 777777777 222222222

Β B L L TT 止 中 誤 錯 許? < 允取 c C反取快 mlml違存可 述 描 的可 址許 位取 體存 實些 有該 含查 把檢 反 違 籤止取 標中存 線誤部 性錯外 全反充 詢安違填 查有性線 取否全取 快是安快 私 入 載·: 分者 β, 音用 的使 符/ 有 141 200422849 止 址 中 位 部 擬 外 虛 反誤 違錯 割反充 割式0-描 分違填取取分程lcr性 性性線存存性性m全 全全取料部全全詢安詢頁定符 安安快資外安安查在查分決述 050505050 50 778899001 12 777777888 88 反生B符 違產TL述 B L 走T 行要 表主 B L T 要 主 的 中 其 於 存 儲 行 執 籤 標 效 有 該 有 含 描 性 全 安 的 止 中 誤 錯 許? « 允取 clc(反取快 mlml違存可 5 0 5 0 5 2 3 3 4 4 8 8 8 8 8Β B L L TT Stop Error Wrong? < Allow c C to fetch fast mlml Violate the description of the addressable location to take the body to have some information including the check to check the violation of anti-signature check to obtain the wrong line in the bid to be full of errors Illegal filling and checking whether the sexual line is all taken quickly is safe and private. ·: Participant β, the ambassador for the sound / there is 141 200422849 The midpoint of the stop address is intended to be false and anti-error. -Describe the violations, fill in the process, and take the data. LCR Sexuality Sexuality Existence Sexuality Sexuality All the material collection Department Full information Enquiry page Delimiter An'an Quick funding Foreign security Ancha's check points 050505050 50 778899001 12 777777888 88 Anti Birth of a B-character violation, TL statement, BL, T-line, table, master, BLT, master, which should be executed in the storage bank. «Allow clc

B B L L T T 描 的可 址許 位取 體存 實些 有該 含查 把檢 述 私 入 載: W者 部用 的使 符/ 有 取 存 部 外 斷製同全全安 充充 中仿相安安的 詢填填取取回體緒續的新叫叫始使叫全新 查線線存存返軟行繼舊至呼呼開可呼安至 取取取料部始否執新存換收否新否絕的換 快快快資外開是性重儲轉接是重是拒舊轉 0 5 0 5 0 2 4 6802468024 5 6 8 8 9 0 0 0011111222 8 8 8 8 8 0 0 oooooooooo 2 2 2 2 2 4 4 4444444444 全 安 之 行 執 下 現 和 緒 行 執 回 返 器的 理斷 管中 容 内緒 緒緒行 行行執 執執性 性性全 緒緒 行行 執執 性性 全全 安安? 之之緒 中中行 用用執 作作的 有有新 現現用 存 儲 被 容緒 内行 的執 緒性 行全 執安 性的 142The addressable location described by BBLLTT is more accurate. The enquiries included in the investigation are privately included: The envoy used by the W / Ministry of the Ministry of Access / External Interruption System of the Access Department and the security-like imitation in the full security charge. Fill in and get back the new name, call, start, call, new check line, save, and return to the soft line. From the old to the whistle, you can call and resume to the fetching and picking department. Quick change, fast opening, external transfer, re-storage, transfer, re-transmission, re-rejection, re-transmission, 0 5 0 5 0 2 4 6802468024 5 6 8 8 9 0 0 0011111222 8 8 8 8 8 0 0 oooooooooo 2 2 2 2 2 4 4 4444444444 The trip to Quan'an is based on the current management of the line and the return of the line. The internal control of the line, the line, the line, the line, the line, the line, the line, the line, the line, the line. In the thread, the Bank of China uses the operating system to have new and existing storage, and is used by Rongxu.

Claims (1)

200422849 福、申請專利範園: 1. 一種資料處理設備,該設備包括: 一可在多數模式及多數網域之中操作之處理器,該 多數網域包括一安全性網域或一非安全性網域,該多數 模式包括: 在上述安全性網域中之至少一安全性模式;和 在上述非安全性網域中之至少一非安全性模 式; 其中 當上述處理器正在一安全性模式下執行一程式 時,上述程式存取安全性資料,其為當該處理器在一非 安全性模式下操作時所不能存取的; 該處理器回應一或多數異常狀況以使用一異常管 理器觸發異常處理,該處理器可操作依據是否該處理器 是操作於該安全性網域或該非安全性網域,以自多數可 能的異常管理器選擇該異常管理器。 2. 如申請專利範圍第1項所述之設備,其中該些異常之至 少一者是一可選擇性異常,其由在一非安全性模式操作 之一非安全性異常管理器或在一安全性模式操作之一 安全性異常管理器中之一選擇性者所管理;和 該些異常之至少一者係一專屬安全性異常,其由一在一 安全性模式操作之安全性異常管理器所管理。 143 200422849 3·如申請專利範圍第1項所述之設備,其中該一或多數的 異常條件可能是可程式設定為在需要時觸發在一非安 全性模式操作之一非安全性異常管理器或在一安全性 模式操作之一安全性異常管理器,以及亦觸發網域的任 何改變。 4·如申請專利範圍第1項所述之設備,其在一專屬的安全 性異常信號輸入和非安全性異常信號輸入上由信號之 一觸發一安全性異常。 5 ·如申請專利範圍第1項所述之設備,其在安全性和非安 全性異常之間共用一異常信號輸入,以及具有一與該異 常信號輸入共同作用之一進一步的輸入信號,以控制是 否觸發一安全性異常管理器或一非安全性異常管理器。 6. 如申請專利範圍第1項所述之設備,其中該安全性異常 管理器係可操作於該安全性模式中的一安全性作業系 統之部分。 7. 如申請專利範圍第1項所述之設備,其中該非安全性異 常管理器係可操作於該非安全性模式中的一非安全性 作業系統之部分。 144 ζυ〇422849 •如申請專利範圍第1項所述之設備,其中該處理器亦可 操作於一該監控模式以及任何藉由該監控模式所為之 在一安全性模式和一#安全性模式之間所需用以管理 異常的轉換,該處理器町至少部分操作於該監控模式 以執行一監控程式以管理在該安全性模式和該非安全 性模式間的轉換。 9·如申請專利範圍第8項所述之設備,其中當在一安全性 模式和一非安全性模式之間轉換時,該監控程式可操作 以儲存和還原定義處理器狀態的資料,以管理一異常。 1〇·如申請專利範圍第8項所述之設備,其中該處理器包 括一登錄區塊,以及當從該安全性模式轉換至該非安全 性模式時,該監控程式可操作以清除在該安全性模式和 該非安全性模式之間共用的該登錄區塊的至少一部 份’以使在該登錄區塊中保留的安全性資料不能從該安 全性模式傳遞至該非安全性模式,除非該監控程式允 許0 如申請專利範圍第丨項所述之設備,其中該些異常狀 況包括下列狀況之一或多數·· 一安全性中斷信號異常; 145 200422849 一模式轉換軟體中斷信號; 一重設異常; 一中斷信號異常; 一軟體中斷信號; 一未定義指令異常; 一預取中止異常; 一資料中止異常;和 一快速中斷信號異常。 12.如申請專利範圍第1項所述之設備,其中該處理器對 一異常條件作出回應,以依據與該些異常條件相關和儲 存在一啟用的異常向量表中的一異常向量值選擇一異 常管理器;和 該啟用的異常向量表是異常向量表的一或多數。 1 3 ·如申請專利範圍第1 2項所述之設備,其中該多數異常 向量表包含可在該安全性模式選擇的一安全性異常向 量表以及可在該非安全性模式中選擇的一非安全性異 常向量表。 1 4 ·如申請專利範圍第1 2項所述之設備,其中該處理器亦 可操作於一監控模式以及藉由該監控模式在一安全性 模式和一非安全性模式間進行的任何轉換,該多數異常 146 200422849 向量係藉由該監控模式執行。 1 5 ·如申請專利範圍第1 4項所述之設備,其中該多數異常 向量表包括一監控模式異常向量表。 1 6.如申請專利範圍第1 5項所述之設備,其中該處理器對 一或多數參數作出回應,其指定應由該監控模式異常向 量表所管理之該些異常。 1 7.如申請專利範圍第1 3項所述之設備,其中除非該一或 多數參數指定該監控模式向量表係該些異常狀況的該 啟用的向量表,否則該安全性向量表係在該安全性模式 中啟用的向量表,該非安全性向量表係在該非安全性模 式中啟用的向量表。200422849 Blessing, patent application park: 1. A data processing device, the device includes: a processor that can operate in most modes and most network domains, the majority network domains include a secure network domain or a non-security Network domain, the majority mode includes: at least one security mode in the security network domain; and at least one non-security mode in the non-security network domain; wherein when the processor is in a security mode When a program is executed, the program accesses security data that cannot be accessed when the processor is operating in a non-secure mode; the processor responds to one or more abnormal conditions to trigger using an exception manager Exception handling. The processor is operable to select the exception manager from most possible exception managers based on whether the processor is operating in the secure or non-secure domain. 2. The device according to item 1 of the scope of patent application, wherein at least one of the exceptions is a selective exception, which is operated by a non-safety exception manager operating in a non-safety mode or a safe One of the security exception managers operating in a security mode operation; and at least one of the exceptions is an exclusive security exception managed by a security exception manager operating in a security mode management. 143 200422849 3. The device described in item 1 of the scope of patent application, wherein the one or more abnormal conditions may be one of the non-safety exception managers or One of the security exception managers operating in a security mode and also triggering any changes to the domain. 4. The device according to item 1 of the scope of patent application, which triggers a safety exception by one of the signals on a dedicated safety exception signal input and a non-safety exception signal input. 5 · The device according to item 1 of the scope of patent application, which shares an abnormal signal input between safety and non-safety abnormalities, and has a further input signal which interacts with the abnormal signal input to control Whether to trigger a security exception manager or a non-security exception manager. 6. The device according to item 1 of the scope of patent application, wherein the security exception manager is part of a security operating system operable in the security mode. 7. The device as described in item 1 of the patent application scope, wherein the non-safety exception manager is part of a non-safety operating system operable in the non-safety mode. 144 ζυ〇422849 • The device described in item 1 of the scope of patent application, wherein the processor can also be operated in a monitoring mode and any security mode and a #security mode that are performed by the monitoring mode. The processor is required to manage abnormal transitions. The processor operates at least partially in the monitoring mode to execute a monitoring program to manage transitions between the security mode and the non-security mode. 9. The device according to item 8 of the scope of patent application, wherein when switching between a security mode and a non-security mode, the monitoring program is operable to store and restore data defining processor states for management An exception. 10. The device as described in item 8 of the scope of patent application, wherein the processor includes a login block, and when transitioning from the security mode to the non-security mode, the monitoring program is operable to clear the security At least a portion of the login block shared between the security mode and the non-security mode so that security data retained in the login block cannot be transferred from the security mode to the non-security mode, unless the monitoring The program allows 0 the device described in item 丨 of the scope of patent application, wherein the abnormal conditions include one or more of the following conditions: a security interrupt signal exception; 145 200422849 a mode switch software interrupt signal; a reset exception; a An interrupt signal exception; a software interrupt signal; an undefined instruction exception; a prefetch abort exception; a data abort exception; and a fast interrupt signal exception. 12. The device according to item 1 of the scope of patent application, wherein the processor responds to an abnormal condition to select one based on an abnormal vector value associated with the abnormal conditions and stored in an enabled exception vector table. Exception manager; and the enabled exception vector table is one or more of the exception vector table. 1 3 · The device as described in item 12 of the scope of the patent application, wherein the majority exception vector table includes a security exception vector table that can be selected in the security mode and a non-security device that can be selected in the non-security mode. Sex exception vector table. 14. The device as described in item 12 of the scope of patent application, wherein the processor can also operate in a monitoring mode and any conversion between a security mode and a non-security mode by the monitoring mode, The majority exception 146 200422849 vector is executed by the monitoring mode. 15. The device as described in item 14 of the scope of patent application, wherein the majority exception vector table includes a monitoring mode exception vector table. 16. The device as described in item 15 of the scope of patent application, wherein the processor responds to one or more parameters, and specifies the exceptions that should be managed by the monitoring mode abnormality scale. 1 7. The device as described in item 13 of the scope of patent application, wherein unless the one or more parameters specify that the monitoring mode vector table is the enabled vector table for the abnormal conditions, the security vector table is in the A vector table enabled in the security mode. The non-security vector table is a vector table enabled in the non-security mode. 1 8.如申請專利範圍第1 6項所述之設備,其中該些參數的 至少一者係健存在一異常捕捉遮罩。 1 9.如申請專利範圍第1 8項所述之設備,其中當該處理器 係在該監控模式中時,該異常控制登錄是可寫入的,以 及當該處理器係不在該非安全性網域中時,該異常捕捉 遮罩登錄係不可寫入的。 147 200422849 20.如申請專利範圍第13項所述之設備,其中當該處理器 在一安全性模式中時,該安全性異常向量表是可寫入 的,以及當該處理器在一非安全性模式中時,該安全性 異常向量表是不可寫入的。 2 1 ·如申請專利範圍第1 3項所述之設備,其中一安全性異 常管理器係使用該安全性模式之一安全性作業系統的 部分。 22.如申請專利範圍第1 3項所述之設備,其中一非安全性 異常管理器係使用該非安全性模式之一非安全性作業 系統的部分。 23 ·如申請專利範圍第1 2項所述之設備,包括多數向量表 基礎位址指標登錄,其每一儲存一各自的基礎位址值, 其符合該些多數異常向量表中之一者。 24. —種處理資料的方法,該方法包含下列步驟: 使用可在多數模式及一安全性網域或一非安全性 網域之一中操作之一處理器執行一程式,該多數模式包 括: 在上述安全性網域中之至少一安全性模式;和 在上述非安全性網域中之至少一非安全性模 148 200422849 式; 其中 當上述處理器正在一安全性模式下執行一程式 時,上述程式存取安全性資料,其為當該處理器在一非 安全性模式下操作時所不能存取的;和 回應一或多數異常狀況,使用一異常管理器觸發異 常處理;該處理器可操作以依據是否該處理器係操作於 該安全性網域或該非安全性網域,自多數可能的異常管 籲 理器選擇該異常管理器。 之操之 常式作 異模操 些性式 該全模 中安性 其非全 ,一 安 法在一 方由 之其 述, 所常 ¢/ 0L 項異理 4rl管 2 擇常 第選異 圍可性 範一全 利是安 專者非 請一 1 申少之 如至作 在 或 器 選 一 之 中 器 ?·ιa 管 常 異 性 全 安 之 常 異 些 該 係 者 在 性 全 安 之小V 式 模 性 全 安 擇專異 ?_ta 管 所 者 性 常 異 性 全 安 屬 所 器 理 管 常 由 其 。 和,理 管 t 26.如申請專利範圍第24項所述之方法,其中該一或多數 的異常條件可能是可程式設定為在需要時觸發在一非 安全性模式操作之一非安全性異常管理器或在一安全 性模式操作之一安全性異常管理器,以及亦觸發網域的 任何改變。 149 200422849 27·如申請專利範圍第24項所述之方法,其具有一安全性 異常信號輸入和一非安全性異常信號輸入。 28·如申請專利範圍第24項所述之方法,其在安全性和非 安全性異常之間共用一異常信號輸入,以及具有一與該 異常信號輸入共同作用之一進一步的輸入信號,以控制 是否觸發一安全性異常管理器或一非安全性異常管理 器。 29.如申請專利範圍第24項所述之方法,其中該安全性異 常管理器係可操作於該安全性模式中的一安全性作業 系統之部分。 3 0.如申請專利範圍第24項所述之方法,其中該非安全性 異常管理器係可操作於該非安全性模式中的一非安全 性作業系統之部分。 3 1 ·如申請專利範圍第24項所述之方法,其中該處理器亦 可操作於一該監控模式以及任何藉由該監控模式所為 之在一安全性模式和一非安全性模式之間所需用以管 理一異常的轉換,該處理器可至少部分操作於該監控模 式以執行一監控程式以管理在該安全性模式和該非安 全性模式間的轉換。 150 200422849 3 2.如申請專利範圍第31項所述之方法,其中當在一安全 性模式和一非安全性模式之間轉換時,該監控程式可操 作以儲存和還原定義處理器狀態的資料,以管理一異 常。 33.如申請專利範圍第31項所述之方法,其中該處理器包 括一登錄區塊,以及當從該安全性模式轉換至該非安全 性模式時,該監控程式可操作以清除在該安全性模式和 該非安全性模式之間共用的該登錄區塊的至少一部 份,以使在該登錄區塊中保留的安全性資料不能從該安 全性模式傳遞至該非安全性模式,除非該監控程式允 許0 34.如申請專利範圍第24項所述之方法,其中該些異常狀 況包括下列狀況之一或多數: 一安全性中斷信號異常; 一模式轉換軟體中斷信號; 一重設異常; 一中斷信號異常; 一軟體中斷信號; 一未定義指令異常; 一預取中止異常; 151 200422849 一資料中止異常;和 一快速中斷信號異常。 35.如申請專利範圍第24項所述之方法,其中該處理器對 一異常條件作出回應,以依據與該些異常條件相關和儲 存在一啟用的異常向量表中的一異常向量值選擇一異 常管理器;和 該啟用的異常向量表是異常向量表的一或多數。 3 6.如申請專利範圍第35項所述之方法,其中該多數異常 向量表包含可在該安全性模式選擇的一安全性異常向 量表以及可在該非安全性模式中選擇的一非安全性異 常向量表。 37.如申請專利範圍第35項所述之方法,其中該處理器亦 可操作於一監控模式以及在一安全性模式和一非安全 性模式間的任何轉換,藉由該監控模式執行該多數異常 向量。 38.如申請專利範圍第37項所述之方法,其中該多數異常 向量表包括一監控模式異常向量表。 39·如申請專利範圍第37項所述之方法,其中該處理器對 152 200422849 一或多數參數作出回應,其指定應由該監控模式異常向 量表所管理之該些異常。 40. 如申請專利範圍第36項所述之方法,其中除非該一或 多數參數指定該監控模式向量表係該些異常狀況的該 啟用的向量表,否則該安全性向量表係在該安全性模式 中啟用的向量表,該非安全性向量表係在該非安全性模 式中啟用的向量表,。 · 41. 如申請專利範圍第39項所述之方法,其中該些參數的 至少一者係儲存在一異常捕捉遮罩。1 8. The device according to item 16 of the scope of patent application, wherein at least one of the parameters is an abnormal capture mask. 19. The device according to item 18 of the scope of patent application, wherein when the processor is in the monitoring mode, the exception control login is writable, and when the processor is not in the non-security network When in the domain, this exception capture mask login is not writable. 147 200422849 20. The device according to item 13 of the patent application scope, wherein the security exception vector table is writable when the processor is in a security mode, and when the processor is in a non-secure mode When in sexual mode, the security exception vector table is not writable. 2 1 · The device as described in item 13 of the scope of patent application, wherein a security exception manager is part of a security operating system using one of the security modes. 22. The device as described in item 13 of the scope of patent application, wherein a non-safety exception manager is part of a non-safety operating system using one of the non-safety modes. 23 · The device as described in item 12 of the scope of patent application, including the majority vector table, the basic address index registration, each of which stores a respective basic address value, which conforms to one of the majority abnormal vector tables. 24. A method of processing data, the method comprising the steps of: executing a program using a processor operable in one of a plurality of modes and a secure domain or a non-secure domain, the majority mode comprising: At least one security mode in the security domain; and at least one non-security mode 148 200422849 in the non-security domain; wherein when the processor is executing a program in a security mode, The above program accesses security data that cannot be accessed when the processor is operating in a non-security mode; and responds to one or more abnormal conditions by using an exception manager to trigger exception handling; the processor can The operation is based on whether the processor is operating in the secure domain or the non-secure domain, and the exception manager is selected from most possible exception managers. The normal form of the operation is the different mode. Some of the behaviors are safe and incomplete in the full mode. One security method is described by one party. The usual ¢ / 0L term is different. 4rl tube 2 Fan Yiquan Li is a security expert, please ask for one. One should apply as much as possible or choose one of the devices? · Ιa It is often different from normal sexual safety. Some people in this department are in a small V-mode. Choosing something special? _Ta Often the sex is often different. 26. The method as described in item 24 of the scope of patent application, wherein the one or more abnormal conditions may be one of the non-safety exceptions that can be programmed to trigger operation in a non-safety mode when required. The manager or one of the security exception managers operating in a security mode, and also triggers any changes to the domain. 149 200422849 27. The method according to item 24 of the scope of patent application, which has a safety abnormal signal input and a non-safety abnormal signal input. 28. The method as described in item 24 of the scope of patent application, which shares an abnormal signal input between safety and non-safety exceptions, and has a further input signal which interacts with the abnormal signal input to control Whether to trigger a security exception manager or a non-security exception manager. 29. The method of claim 24, wherein the security exception manager is part of a security operating system operable in the security mode. 30. The method as described in claim 24, wherein the non-safety exception manager is part of a non-safety operating system operable in the non-safety mode. 3 1 · The method according to item 24 of the scope of patent application, wherein the processor is also operable in a monitoring mode and any operation performed between the security mode and a non-security mode by the monitoring mode. Needed to manage an abnormal transition, the processor may be at least partially operated in the monitoring mode to execute a monitoring program to manage the transition between the security mode and the non-security mode. 150 200422849 3 2. The method as described in claim 31, wherein when switching between a security mode and a non-security mode, the monitor is operable to store and restore data defining the state of the processor To manage an exception. 33. The method of claim 31, wherein the processor includes a login block, and when transitioning from the security mode to the non-security mode, the monitoring program is operable to clear the security At least a part of the login block shared between the mode and the non-security mode, so that the security data retained in the login block cannot be transferred from the security mode to the non-security mode unless the monitor program Allow 0 34. The method as described in item 24 of the scope of patent application, wherein the abnormal conditions include one or more of the following conditions:-a security interrupt signal is abnormal;-a mode switch software interrupt signal;-a reset exception;-an interrupt signal Exception; a software interrupt signal; an undefined instruction exception; a prefetch abort exception; 151 200422849 a data abort exception; and a fast interrupt signal exception. 35. The method of claim 24, wherein the processor responds to an abnormal condition to select an abnormal vector value associated with the abnormal conditions and stored in an enabled exception vector table. Exception manager; and the enabled exception vector table is one or more of the exception vector table. 3 6. The method according to item 35 of the scope of patent application, wherein the majority exception vector table includes a safety exception vector table selectable in the security mode and a non-safety selectable in the non-safety mode Exception Vector Table. 37. The method as described in claim 35, wherein the processor is also operable in a monitoring mode and any transition between a security mode and a non-security mode, and the majority is performed by the monitoring mode Exception vector. 38. The method as described in claim 37, wherein the majority exception vector table includes a monitoring mode exception vector table. 39. The method as described in item 37 of the scope of patent application, wherein the processor responds to one or more of 152 200422849, which specifies the exceptions that should be managed by the monitoring mode abnormality scale. 40. The method as described in item 36 of the scope of patent application, wherein unless the one or more parameters specify that the monitoring mode vector table is the enabled vector table for the abnormal conditions, the security vector table is in the security The vector table enabled in the mode. The non-security vector table is a vector table enabled in the non-security mode. 41. The method as described in claim 39, wherein at least one of the parameters is stored in an anomaly capture mask. 42·如申請專利範圍第4 1項所述之方法,其中當該處理器 在該監控模式中時,該異常控制登錄是可寫入的,以及 當該處理器不在該非安全性網域中時,該異常捕捉遮罩 登錄係不可寫入的。 43.如申請專利範圍第36項所述之方法,其中當該處理器 在一安全性模式中時,該安全性異常向量表是可寫入 的,以及當該處理器在一非安全性模式中時,該安全性 異常向量表是不可寫入的。 44·如申請專利範圍第36項所述之方法,其中一安全性異 153 200422849 常管理器係使用該安全性模式之一安全性作業系統的 部分。 45.如申請專利範圍第36項所述之方法,其中一非安全性 異常管理器係使用該非安全性模式之一非安全性作業 系統的部分。 46 ·如申請專利範圍第3 5項所述之方法,包括在多數向量 表基礎位址登錄中儲存各自基礎位址值,其符合該多數 異常向量表之一者。 47. —種具有一電腦程式之電腦程式產品,其係可操作以 依據如申請專利範圍第24項所述之方法,控制一資料 處理設備。 15442. The method according to item 41 of the scope of patent application, wherein the exception control login is writable when the processor is in the monitoring mode, and when the processor is not in the non-security domain This exception capture mask registration is not writable. 43. The method as described in claim 36, wherein when the processor is in a security mode, the security exception vector table is writable, and when the processor is in a non-security mode During security, the security exception vector table is not writable. 44. The method described in item 36 of the scope of patent application, wherein a security difference is 153 200422849. The regular manager is part of a secure operating system that uses one of the security modes. 45. The method as described in claim 36, wherein a non-safety exception manager is part of a non-safety operating system using one of the non-safety modes. 46. The method as described in item 35 of the scope of patent application, which includes storing the respective base address values in the majority address table base address registration, which meets one of the majority exception vector tables. 47. A computer program product having a computer program, which is operable to control a data processing device in accordance with the method described in item 24 of the scope of patent application. 154
TW92132189A 2002-11-18 2003-11-17 Apparatus, method and computer program product for processing data within a secure processing system TWI292099B (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
GB0226905A GB0226905D0 (en) 2002-11-18 2002-11-18 Exception tyres within a secure processing system
GB0226902A GB0226902D0 (en) 2002-11-18 2002-11-18 Exception vector tables in a secure system
GB0303449A GB0303449D0 (en) 2002-11-18 2003-02-14 Task following between multiple operating systems

Publications (2)

Publication Number Publication Date
TW200422849A true TW200422849A (en) 2004-11-01
TWI292099B TWI292099B (en) 2008-01-01

Family

ID=35873166

Family Applications (1)

Application Number Title Priority Date Filing Date
TW92132189A TWI292099B (en) 2002-11-18 2003-11-17 Apparatus, method and computer program product for processing data within a secure processing system

Country Status (4)

Country Link
IL (1) IL167188A (en)
MY (1) MY134724A (en)
RU (1) RU2005115082A (en)
TW (1) TWI292099B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI509516B (en) * 2007-04-19 2015-11-21 Ibm Apparatus and method for handling exception signals in a computing system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI676133B (en) * 2016-11-11 2019-11-01 美商賽諾西斯公司 Waveform based reconstruction for emulation

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI509516B (en) * 2007-04-19 2015-11-21 Ibm Apparatus and method for handling exception signals in a computing system

Also Published As

Publication number Publication date
IL167188A (en) 2010-04-29
MY134724A (en) 2007-12-31
TWI292099B (en) 2008-01-01
RU2005115082A (en) 2006-01-20

Similar Documents

Publication Publication Date Title
TWI275997B (en) Switching between secure and non-secure processing modes
JP4302641B2 (en) Controlling device access to memory
KR100941104B1 (en) Apparatus for processing data, method for processing data and computer-readable storage medium storing a computer program
JP4220476B2 (en) Virtual-physical memory address mapping in systems with secure and non-secure domains
US7171539B2 (en) Apparatus and method for controlling access to a memory
US7185159B2 (en) Technique for accessing memory in a data processing apparatus
US7340573B2 (en) Apparatus and method for controlling access to a memory unit
US7487367B2 (en) Apparatus and method for managing access to a memory
US7305712B2 (en) Security mode switching via an exception vector
US7325083B2 (en) Delivering data processing requests to a suspended operating system
US20040105298A1 (en) Apparatus and method for managing processor configuration data
IL168336A (en) Control of access to a memory by a device
GB2395313A (en) Thread switching between multiple operating systems running on the same processor
TW200422849A (en) Exception types within a secure processing system
TW200417215A (en) Security mode switching via an exception vector

Legal Events

Date Code Title Description
MK4A Expiration of patent term of an invention patent