TW200417216A - Control of access to a memory by a device - Google Patents

Control of access to a memory by a device Download PDF

Info

Publication number
TW200417216A
TW200417216A TW92132190A TW92132190A TW200417216A TW 200417216 A TW200417216 A TW 200417216A TW 92132190 A TW92132190 A TW 92132190A TW 92132190 A TW92132190 A TW 92132190A TW 200417216 A TW200417216 A TW 200417216A
Authority
TW
Taiwan
Prior art keywords
security
memory
secure
mode
processor
Prior art date
Application number
TW92132190A
Other languages
Chinese (zh)
Other versions
TWI312253B (en
Inventor
Simon Charles Watt
Lionel Belnet
David Hennah Mansell
Nicolas Chaussade
Peter Guy Middleton
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 GB0226875A external-priority patent/GB0226875D0/en
Priority claimed from GB0226879A external-priority patent/GB0226879D0/en
Priority claimed from GB0303446A external-priority patent/GB0303446D0/en
Application filed by Advanced Risc Mach Ltd filed Critical Advanced Risc Mach Ltd
Publication of TW200417216A publication Critical patent/TW200417216A/en
Application granted granted Critical
Publication of TWI312253B publication Critical patent/TWI312253B/en

Links

Abstract

The present invention provides a data processing apparatus and method for controlling access to a memory. The data processing apparatus has a secure domain and a non-secure domain, in the secure domain the data processing apparatus having access to secure data which is not accessible in the non-secure domain. The data processing apparatus comprises a device coupled to a memory via a device bus, and operable, when an item of data in the memory is required by the device, to issue onto the device bus a memory access request pertaining to either the secure domain or the non-secure domain. The memory is operable to store data required by the device, and contains secure memory for storing secure data and non-secure memory for storing non-secure data. In accordance with the present invention, the data processing apparatus further comprises partition checking logic coupled to the device bus and operable whenever the memory access request as issued by the device pertains to the non-secure domain, to detect if the memory access request is seeking to access the secure memory and upon such detection to prevent the access specified by that memory request. This approach significantly improves the security of data contained within a secure portion of memory.

Description

200417216 玖、 【發 【先 處理 器。 理設 應用 行期 敏感 用所 些應 金錄 吾人 被可 企圖 確保 應用 如果 複雜 發明説明: 明所屬之技術領域】 本發明相關於用以控制一裝置對一記憶體之存取。 前技術】 為執行在資訊處理設備所載入的應用’一典型的資 設備包括處理器。在一作業系統的控制下操作該處 被要求以執行任何特定應用的資料通常儲存在資訊 備的一記憶體之内。人們將了解,資料可以包含在 之内所含有的指令和/或在關於處理器那些指令的 間所使用的實際資料值。 此處有許多例子,當該些應用所使用之至少一資料 資料時,其不應該由能夠在該處理器上執行的其他 存取。舉一示例,當資訊處理設備是智慧卡時,而 用之一是使用敏感資料的一安全性應用,例如,安 ,用以執行驗證、認證、解密等等。在此類的情況下 很清楚確保此類敏感資料的安全之重要性,使其不 能在該資料處理設備中栽a的其他應用所存取,例 存取上述安全性資料之已被載入的骇客應用。 在%知系統中’確保作業系統能提供足夠的安全性 在該作業系統的控制中所執行的其他應用不能存取 的安全性資料通常是作業系統開發者的工作。然而 系統變得更複雜,一般倾向是作業系統變得更大和 而此類的情況下,讓作業系統本身確保足夠安全 訊 理 處 該 執 是 應 該 全 能 如 以 更 性 3 200417216 變得愈益困難。 尋求針對敏感資料提供安全性儲存和針對惡意程式碼 提供保護之系統示例係論述於美國專利申請案 US 2002/0007456 Α1 和美國專利 US 6,292,874 Β 和 US 6,282,657 Β。 因此,為尋求維護在資料處理設備的記憶體之内所含 有的此類安全性資料的安全性,亟需提供一改進的技術。200417216 玖, [send first processor. Organizing applications Sensitive use of all application records We can try to ensure the application if it is complicated Invention Description: The technical field of the invention] The present invention relates to controlling the access of a device to a memory. [Previous Technology] A typical device for executing an application loaded on an information processing device includes a processor. Operating under the control of an operating system The data required to perform any particular application is usually stored in a memory of the information device. It will be understood that the data may contain instructions contained therein and / or actual data values used between those instructions regarding the processor. There are many examples here, when at least one piece of data is used by the applications, it should not be accessed by others that can execute on the processor. As an example, when the information processing device is a smart card, one use is a security application using sensitive data, such as security, to perform authentication, authentication, decryption, and so on. In such cases, it is clear that the importance of ensuring the security of such sensitive data prevents it from being accessed by other applications in the data processing equipment, such as access to the security data that has been loaded. Hacking application. In the system, it is the job of the developer of the operating system to ensure that the operating system can provide sufficient security. Security data that cannot be accessed by other applications executed under the control of the operating system. However, the system becomes more complicated, and the general tendency is that the operating system becomes larger, and in such cases, it is more difficult for the operating system itself to ensure sufficient security. Examples of systems seeking to provide secure storage against sensitive data and protection against malicious code are discussed in US patent applications US 2002/0007456 A1 and US patents US 6,292,874 Β and US 6,282,657 Β. 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]

本發明之一第一態樣提供具有一安全性網域和一非安 全性網域之資料處理設備,在該安全性網域中,該資料處 理設備所存取的安全性資料係不可在該非安全性網域存取 者,該資料處理設備包含:一裝置匯流排;一裝置,其連 接至該裝置匯流排並操作以以發出相關於該安全性網域或 該非安全性網域之一記憶體存取請求;一記憶體,其連接 至該裝置匯流排並操作以儲存該裝置所請求之資料,該記 憶體包含用以儲存安全性資料的安全性記憶體和用以儲存 非安全性資料的非安全性記憶體。當該裝置請求該記憶體 中的一資料項目時,該裝置可操作以發出一記憶體存取請 求至至該裝置匯流排;以及分割檢測邏輯,其連接至裝置 匯流排,以及只要在裝置所發出的記憶體存取請求相關於 該非安全性資料時,可操作以偵測是否該記憶體存取請求 尋求存取該安全性記憶體,以及藉由此類偵測以防止此類 記憶體請求的存取。 4 200417216 依據本發明,一裝置藉由一裝 體,& π 展置匯机排連結一記憶 和可操作以發出與一安全性網域或一 關之記恃舻少 ^ 一 全性網域相 的資M j铞作以儲存裝置所需要 用以儲二包含用以儲存安全性資料的安全性記憶體以及 取記憶ΓΓ全1 資料的转全性記憶體。當裝置想要存 至穿:P1的一貝料項時,安排其發出一記憶體存取請求 至2匯流排。依據本發明’提供分割檢測邏輯,其連接 相關=流排’以及只要在裝置所發出的記憶體存取請求 取請求=安全性資料時’可操作以偵測是否該記憶體存 X . . 〜菔u及藉由此類偵測以防 止此類冗憶體請求的存取。 因此’安排分割檢測邏輯監督對記憶體的存取,以在 ==發出記憶體存取請求相關於非安全性網域時,確保 曰存取該安全性記憶體。 在一實施例中,該裝詈可太夕& , “ 瑕置了在多數模式下操作,包含在 非女全性網域之至少一非安全 生模式和在非安全性網域中 的至少一安全性模式。 分割檢測邏輯存取關於在 文主性把憶體和非安全性記 憶體之間的为割之資訊。吾人 字了解,在實施例中能夠硬 接(hardwire)該分割資訊,其中 /、守不斯改變在安全性記憶體和 非安全性記憶體之間的實體分秋 ^ ^ ^ ^ …、而,在較佳實施例中, ^ μ 模式中#作時,裝置可設定在安 全性記憶體和非安全性記憶體之 ,^ ^ ^ ^ ]的刀割,在此類實施例 中,备以預疋的女全性模式操作 ^ 由裝置安排分割檢測 5 邏輯。因此,如果被安裝至該裝置之一惡意應用其目的在 於存取該安全性資料,則該應用不能在該安全性網域中執 行,以及它因此不能改變該分割資訊。因此,即使該應用 能夠輸出一記憶體存取請求,其企圖存取該安全性記憶體 中的一位置,該分割檢測邏輯將偵測到在該裝置的非安全 性模式中執行的該應用企圖存取一安全性記憶體位置,以 及將防止該存取發生。 吾人將了解’有一些不同的方法,其中分割檢測邏輯 可以從裝置接收關於該記憶體存取請求所相關之網域之資 讯。然而,在較佳實施例中,裝置所發出之記憶體存取請 求包含一網域信號,其確定是否該記憶體存取請求相關於 該安全性網域或該非安全性網域。 在本發明之一實施例中,該網域信號因此能確定是否 該裝置在安全性網域或非安全性網域中操作,以及因此當 該網域信號指示該裝置係在非安全性網域中操作時,能夠 觸發分割檢測邏輯檢查記憶體存取請求。在較佳實施例 中’當裝置在安全性網域中操作時,該分割檢測邏輯不執 行任何分割檢查,因為在較佳實施例中,當在一安全性模 式中操作時,裝置都能夠存取安全性記憶體和非安全性記 憶體。 吾人將了解,在記憶體存 法讓網域信號共同作用。較佳 告該網域信號和因此只可由裝 中執行的應用來宣告。因此對 取請求中能夠使用許多種方 的實施例為,在硬體層級宣 置本身確認能在安全性網域 在裝置上執行的惡意應用而 200417216 口不可此竄改網域信號的設定。尤其是,在較佳實施例中, 裝置具有一預定腳位(pin)用以輸出網域信號至裝置匯流 排,以及在預定的狀態下設置該網域信號以指示裝置係在 一非安全性模式中操作。因此,在一實施例中,只有當裝 置在安全性網域中執行安全性應用時,將設置該網域信號 :指:該裝置係在安全性網域中操作,亦只有當該網域發 仏號《又置時’ &割檢測邏輯允許存取在記憶體中的安全性 資料。 測邏輯。然 判優器中提 的衝突記憶 使分割檢測 測邏輯決定A first aspect of the present invention provides a data processing device having a security network domain and a non-security network domain. In the security network domain, the security data accessed by the data processing device cannot be stored in the non-security domain. A security domain accessor, the data processing device includes: a device bus; a device connected to the device bus and operating to issue a memory related to the security domain or the non-security domain A body access request; a memory connected to the device bus and operating to store data requested by the device, the memory including security memory for storing security data and non-security data Of non-secure memory. When the device requests a data item in the memory, the device is operable to issue a memory access request to the device bus; and segment detection logic, which is connected to the device bus, When the memory access request issued is related to the non-secure data, it is operable to detect whether the memory access request seeks to access the secure memory, and to prevent such memory requests by such detection Access. 4 200417216 According to the present invention, a device is connected to a memory by a body, and the π spread exchange bank is operable to issue a record with a security domain or a connection ^ a global domain The corresponding data Mj is used as a storage device to store two security memories including the security data used to store the security data and the transmutable memory that fetches all the data. When the device wants to save one item of wear: P1, it arranges for it to send a memory access request to 2 buses. According to the present invention, 'provide segmentation detection logic, its connection correlation = streaming' and as long as the memory access request issued by the device fetch request = security data 'is operable to detect whether the memory is stored X.. ~菔 u and use such detection to prevent access to such redundant memory requests. Therefore, the 'segmentation detection logic is arranged to supervise the access to the memory to ensure that the secure memory is accessed when a memory access request is sent to a non-secure domain. In one embodiment, the device may be operated in a majority mode, including at least one non-secure birth mode in a non-female full-scale domain and at least one non-secure domain in a non-secure domain. A security mode. Segmentation detection logic accesses the information about the division between memory and non-secure memory. I understand that in the embodiment, the segmentation information can be hardwired. Among them, Sumbus changes the entity between security memory and non-security memory. ^ ^ ^ ^, And in a preferred embodiment, when the ^ μ mode is set to work, the device can be set ^ ^ ^ ^] Of the secure memory and the non-secure memory, in such an embodiment, it is prepared to operate in a pre-defined female holistic mode ^ The device arranges the segmentation detection 5 logic. Therefore, If a malicious application installed on the device is intended to access the security data, the application cannot be executed in the security domain, and therefore it cannot change the segmentation information. Therefore, even if the application can output a Memory access request, which Attempting to access a location in the secure memory, the partition detection logic will detect that the application executing in a non-secure mode of the device attempts to access a secure memory location, and will prevent the access I will understand that there are a few different ways in which segmentation detection logic can receive information from the device about the domain to which the memory access request is related. However, in the preferred embodiment, the memory sent by the device The body access request includes a network domain signal that determines whether the memory access request is related to the secure network domain or the non-secure network domain. In one embodiment of the present invention, the network domain signal can therefore determine whether The device operates in a secure or non-secure domain, and therefore when the domain signal indicates that the device is operating in a non-secure domain, it can trigger the partition detection logic to check the memory access request. In the preferred embodiment, 'the segmentation detection logic does not perform any segmentation checks when the device is operating in a security domain, because in the preferred embodiment, when the When operating in sexual mode, the device can access both secure memory and non-secure memory. We will understand that in the memory storage method, the domain signal works together. It is better to report that the domain signal and therefore can only be installed by the device. The application that is executed in the request is declared. Therefore, an embodiment that can use many kinds of parties in the fetch request is to declare at the hardware level a malicious application that confirms that it can be executed on the device in the security domain. The 200417216 port cannot tamper with the network. Setting of the domain signal. In particular, in the preferred embodiment, the device has a predetermined pin for outputting a network domain signal to the device bus, and the network domain signal is set to indicate the device system in a predetermined state. Operate in a non-security mode. Therefore, in one embodiment, the network domain signal will be set only when the device is executing a security application in the security network domain: means: the device is in the security network domain The operation can only be performed when the domain sends the "Reset" & cut detection logic to allow access to the security data in the memory. Test logic. However, the conflict memory provided in the arbiter makes the segmentation detection and logic determination.

σ人將了解’此夠以許多方法實施分割檢 而,在較佳實施例中,在連接至裝置匯流排的 供該分割檢測邏輯,以在發出至該裝置匯流排 體存取請求之間進行判斷。吾人已經發現易於 邏輯與判優器結合,和事實上亦允許由分割檢 是否判優器同意記憶體存取請求。 1 Α ρ π w Τ,裝置 4 一非安全性作業系統的控制中操作,以及在上述安全十σ people will understand that this is enough to implement segmentation inspection in many ways. In the preferred embodiment, the segmentation detection logic connected to the device bus is performed between requests for access to the device bus body. Judge. We have found it easy to combine logic with an arbiter, and in fact also allow partitioning to check whether the arbiter agrees to a memory access request. 1 Α ρ π w Τ, device 4 operates in the control of a non-safety operating system, and

域中,裝置係在一安全性作業系統的控制中操作。 性作業系統通常遠比非安全性作業系統來得小並能夠q 一安全性核心用以控制某些安全性功能。藉由該方法< 安全性網域能夠視為提供一安全性情境以令在i控制 境中實施某些敏感的操作。而後其它應用可以保留在 安全性網域中,其能夠視為一非安全性情境。 吾人將了解,該裝置能夠有許多形式,以及的確 數的此類裝置與匯流排連結。在多數裝置連接至匯流 7 200417216 情況下,當裝置在一安全性模式中操作時,可在安全性與 #安全性模式二者中操作之每一裝置能夠獨立控制該分割 檢測邏輯,在此類情況下,該分割檢測邏輯存取專屬於每 一各別裝置的分割資訊。然而,較佳的實施例為,該些裝 置之一負責分割檢測邏輯的管理。 在較佳實施例中,至少一裝置是與一處理器共同作用 的一晶片(chip),當處理器產生記憶體存取請求時,該晶 片更包含一記憶體管理單元可操作以執行一或多數的預定 的存取控制功能,以控制對裝置匯流排所發出的記憶體存 取請求。可以在相同的晶片上或在晶片外(off-chip)提供資 料處理設備的一或多數其它部分。 人們將了解連接至該裝置的記憶體能夠有許多形式, 例如隨機存取記憶體(RAM)、唯讀記憶體(R〇M)、一硬碟、 在對某些週邊裝置中的登錄、等等。除了此類記憶體之外, 人們將了解當該裝置使用一連接於其中之系統匯流排與處 理器共同作用的晶片時,也可能有連接至該系統匯流排的 某種記憶體,例如,快取記憶體、緊接記憶體(TCM)、等 等。 因此,在某些實施例,該晶片更包含··經由一系統匯 流排連接至處理器之特別記憶體,該特別記憶體可操作以 貯存該處理器所需要的資料,該特別記憶包含安全性特別 5己憶體用以儲存安全性資料’和非安全性特別記憶體用以 儲存非安全性資料;以及連接至該系統匯流排的特別分割 檢測邏輯,以及當在該非安全性網域之非安全性模式中操 8 200417216 作時 記憶 記憶 流排 此類 一非 的任 體的 分。 包含 全性 式中 例如 全性 下。 相對 些安 提供 作。 安全 理器 ’只要處理器產生記憶體存取請求,便摘測是否 體存取請求意圖存取該安全性記憶體或該安全性 ’以藉由此類偵測防止此類記憶體存取請求的存 因為對於連接至系統匯流排的記憶體而言,與裝 連結的分割檢測邏輯不能執行任何分割檢測功能 實施例中,提供特別分割檢測邏輯以確保當處理 安全性模式中操作時,其不能存取安全性記憶體 何部分,不論是否是與裝置匯流排連結的安全性 特定部分,或含有安全性資料的特別記憶體的特 依據本發明的一實施例,處理器操作於多數模式 在非安全性網域中的至少一非安全性模式,以及 網域中的至少一安全性模式。當操作於一非安全 時’處理器係操作於一非安全性作業系統的控制 一標準的預先存在的作業系統。然而,當操作於 模式中時,處理器係操作於一安全性作業系統的 比較起非安全性作業系統,該安全性作業系統最 來得小,以及具有一安全性核心的形式,用以執 全性功能。藉由上述方法,該安全性網域能夠被 一女全性情境以在一控制的環境中執行某些敏感 其匕應用仍保留在非安全性網域中,其能夠視為 性情境。 在一可操作之實施例中提供一記憶體管理單元, 想要存取記憶體中之一資料項時,藉由接收由處 該該 特別 取0 置匯 ,在 器在 系統 記憶 定部 中, 在安 性模 下, 一安 控制 好能 行某 視為 的操 一非 當處 理器 9 200417216 發出的記憶體存取請求執行一或多數的預定存取控制功能 以控制對S己憶體發出的記憶體存取請求。舉一示例,此類 預定的存取控制功能可能涉及虛擬位址至實體位址的轉 譯,檢視存取許可權限以確保在現有作業模式下操作之處 理器是允許存取所需的資料項的、區域屬性的分析,例如 決定資料項是可快取的、可緩衝的、#等,一如那些熟知 本項技藝者所了解者。In the domain, the device operates under the control of a secure operating system. Sexual operating systems are usually much smaller than non-secure operating systems and are capable of controlling a security core with a security core. By this method < a security domain can be seen as providing a security context to enable certain sensitive operations to be performed in the i control context. Other applications can then remain in the security domain, which can be considered a non-security context. I will understand that the device can take many forms and that the exact number of such devices is connected to the bus. In the case where most devices are connected to Bus 7 200417216, when the device is operating in a security mode, each device that can operate in both security and #security modes can independently control the partition detection logic, in which In this case, the partition detection logic accesses partition information specific to each individual device. However, a preferred embodiment is that one of the devices is responsible for the management of the partition detection logic. In a preferred embodiment, at least one device is a chip cooperating with a processor. When the processor generates a memory access request, the chip further includes a memory management unit operable to execute one or Most of the predetermined access control functions are used to control the memory access requests issued to the device bus. One or most other parts of the data processing equipment may be provided on the same wafer or off-chip. People will understand that the memory connected to the device can take many forms, such as random access memory (RAM), read-only memory (ROM), a hard disk, registration in certain peripheral devices, etc. Wait. In addition to this type of memory, one will understand that when the device uses a chip connected to the system bus and processor to interact with it, there may also be some kind of memory connected to the system bus, for example, fast Fetch memory, TCM, and so on. Therefore, in some embodiments, the chip further includes a special memory connected to the processor via a system bus, the special memory is operable to store data required by the processor, and the special memory includes security Special 5 memory is used to store security data 'and non-secure special memory is used to store non-security data; and special segmentation detection logic connected to the system's bus, and when it is in the non-security domain The operating mode in the security mode is 200417216, and the memory and memory are streamlined. Include in the general form, such as under the general. Relative to some security. The security processor 'as long as the processor generates a memory access request, it checks whether the memory access request intends to access the secure memory or the security' to prevent such a memory access request by such detection For the memory connected to the system bus, the segmentation detection logic connected to the system cannot perform any segmentation detection function. In the embodiment, special segmentation detection logic is provided to ensure that when operating in the security mode, it cannot Access to any part of the security memory, whether or not it is a security-specific part connected to the device bus, or special memory containing security data. According to an embodiment of the present invention, the processor operates in most modes in non- At least one non-security mode in the security domain and at least one security mode in the domain. When operating on a non-secure operating system, the processor is a control operating on a non-secure operating system, a standard pre-existing operating system. However, when operating in a mode, the processor operates on a secure operating system rather than a non-secure operating system. The secure operating system is the smallest in size and has a form of a security core to perform full operation. Sexual function. With the above method, the safety domain can be used by a female full-sexual context to perform certain sensitive tasks in a controlled environment. Its application remains in the non-safety domain, which can be regarded as a sexual context. In an operable embodiment, a memory management unit is provided. When one of the data items in the memory is to be accessed, it should receive a special 0 to set the sink, and the device is in the system memory setting section. In the security mode, a security control can perform a certain operation. A memory access request issued by the processor 9 200417216 performs one or most of the predetermined access control functions to control the S memory. Memory access request. As an example, such predetermined access control functions may involve the translation of a virtual address to a physical address. Check the access permissions to ensure that the processor operating in the existing operating mode is allowed to access the required data items. Analysis of regional attributes, such as determining whether data items are cacheable, bufferable, #, etc., as those who are familiar with this art know.

尤有甚者,依據本實施例,由安全性作業系統管理特 別分割檢測邏輯。因為由安全性作業系統管理該特別分割 檢測邏輯’該特別分割檢測邏輯不會被非安全性應用所改 變,因此防止對安全性資料之未經授權的存取。 &特別分割檢測邏輯將存取有關於安全性記憶體和非 安全性記憶體間分割的資訊。吾人將了解,在實施例中, 能硬接(hardwire)該分割:身訊,其中在安全性記憶體和非安 全性記憶體之間的實體分割不能被改變 '然而,在較佳實 施例中’當處理器在—預定的安全性模式中操作時,該處 理器能設定在安全性記憶體和非安全性記憶體之間的分In particular, according to this embodiment, the special partition detection logic is managed by the security operating system. Because the special partition detection logic is managed by a security operating system, the special partition detection logic is not changed by non-security applications, so unauthorized access to security data is prevented. & Special partition detection logic will access information about the partition between secure and non-secure memory. I will understand that in the embodiment, the segmentation can be hardwired: a physical message in which the physical segmentation between the secure memory and the non-secure memory cannot be changed. 'When the processor is operating in a predetermined security mode, the processor can set the division between secure memory and non-secure memory.

割, 時, 以及在此類實施例當在預定的安全性模式中操作 由處理器管理該特別分割檢測邏輯。目此,如果安裝 在處理器上的一惡 能在安全性網域中執行 訊。因此,即使該應用 取安全性記憶體中的位 在處理器的非安全性模 思應用企圖存取安全性資料,該應用不 ’以及因此其不能改變該分割資 能夠輸出記憶體存取請求,企圖存 置’該特別分割檢測邏輯將偵測到 式中執行的應用企圖存取一安全性 10 200417216 記憶體位置’以> 那些熟知本 構,記憶體存取 中,可以指定實 操作於一非安全 址,和該記憶體 制,在此類實施 較佳的存取控制 果由由該記憶體 記憶之内的話’ 體存取請求所指 尤有甚者’ 模式中操作時, 中由安全性作業 管理單元所執行 位址至實體位址 割檢測邏輯。 在一實施例 取請求使用虛擬 分割檢測邏輯, 時便可操作。因 理單元以執行必 取控制功能,但 理器操作於一非 憶體管理單元 位址至實體位 生之實體位址 測邏輯可操作 中,當處理器 求可以指定一 體管理單元, 存取控制功能 一安全性模式 所有操作模式 °己憶體管理單 器在一非安全 的模式為何, ,以及任何其 割檢測邏輯最 時,當它存取 L將防止該存取發生。 胃技藝者將了解’依據資料處理系統的架 月求可以指定虛擬位址,或在某些實施例 豐位址。然而,在較佳實施例,當處理器 也模式時,記憶體存取請求指定一虛擬位 管理單元係藉由非安全性作業系統所控 例中,由該記 功能包含虛擬 管理單元所產 該特別分割檢 定的存取。 在較佳實施例 記憶體存取請 系統控制記憶 的上述預定的 的轉換,至少 中,處理器的 位址,以及在 以及只要處理 此,不論操作 要的位址轉譯 是,該特別分 安全性模式中 所執行之一該 址之轉變,如 係在該安全性 以防止由記憶 係在一安全性 虛擬位址,其 以及由記憶體 之一包含虛擬 不使用特別分 因為記憶體存 元中提供特別 性模式中操作 使用記憶體管 它所需要的存 好只用於當處 s己憶體中的資 11 200417216 料時將沒有限制、然而,吾人將了解,在選擇性的實施例 中,肯定可以提供某種程度的分割檢查供操作的某 入 性模式之用。 、一文王 在本發明的-選擇性實施例中,至少有操作的 安全性模式’其中由—實體位址直接指定記憶體存取妹 求,以及因此在一特定安全性模式中,不需要執行任^ 擬至實體位址的轉譯、然而直接指定實體位址的方 : 擬位址的方法來付不靈;舌,因為在虛擬位址和實體位址: 間的不用執行映射,其本身就較具安全性。因此,在一進 -步的較佳實施例+,直接指定記憶體存取請求的實體位 址之安全性模 < 是㈣㈣中最具安全性纟,在較佳實施 例中,該模式稱作操作之一監控模式,以及負責管理在非 女全性和安全性網域中資料處理設備的轉換。 在此類較佳的實施例,該資料處理設備更包含一記憶 體保護單元,其中提供該特別分割檢測邏輯,該記憶體保 護單元管理係藉安全性作業系統管理,其中當該處理器操 作於一特殊的安全性模式,該記憶體存取請求一記憶體位 置之 實體位址,未使用該記憶體管理單元,以及該*己匕 體保瘦單元操作以執行至少記憶體存取許可處理,以確令 是否由該實體位址指定之該記憶體位置在該特殊安全性模 式係可存取者。因此,當處理器在一特殊安全性模式中操 作時’僅由安全性作業系統管理的記憶體保護單元管理該 存取。 在較佳實施例,該記憶體包含至少一表格其包含一此 12 200417216 記 含 記 取 至 該 資 有 其 述 說 實 使 該 及 對 測 性 實 址 器 憶體區域之每一的一相關描述符, 如各 ^ # 这把憶體管理單元包 一内部儲存爭元,用以儲存推導自該此 & ^ &為敘符以及由該 憶體管理單元所使用之存取控制資 ^ 4, ^ y 5 ,以為該記憶體存 吞月求執行預疋的存取控制功能,當該 ,卜_ Χ.Λ. Mi: _b 冬理器係操作於該 V 一非女全性模式,該特別分割檢測邏 内部儲存單元儲存允許存取該 w呆以防止 訊。 性圮憶體之存取控制 那些熟知本項技藝者將了解,描 ^ , θ 士 田迷4的此類表格能夠 繂夕形式,但疋,在較佳實施例中 匕類表格伟分頁表, 在描述相關於記憶體之該頁的存 %佐制資訊的一對應描 符中定義記憶體的一些分頁中之I … 刀只Τ之每一者。因此,舉 ,描述符可以為該頁定義一虛擬位 ^ ^ |刀以及一對應的 體位址部分、存取許可資訊(例如 、丨』撕疋否該頁在監督模式、 用者模式等等中可存取)、以及祕想 )以及區域屬性例如是否包含在 頁中的資料是可快取的、可緩衝的、等等。 在該些實施例中,記憶體存 π玥本知疋一虛擬位址以 因此在該表格中的插述斿白入 疋符包含至少一虛擬位址部分以 應的記憶體區域之一對庙杳 强#〃 對應實體位址部分,該特別分割檢 邏輯係可操作的,當兮疮 , w该處理器係操作於該至少一非安全 模式,以防止該内部儲 。一 触, 喵存早兀把存取控制資訊儲存至該 體位址部分,如果之後 更為該虛擬位址所產生之該實體位 係在該安全性記憶中。 吾人將於下文中了觫 ^ 在一正確執行的系統中,虛理 在一非安全性模式中執杆夕^ 處理 钒仃之一非安全性應用通常不知道 13 200417216 安全性記憶體,而當處理器在些一非6 并女全性模式中時,被 處理器參考以使虛擬位址轉換成實許^ 耳體位址之表袼不應該參 考與安全性記憶體共同作用之任何却八 #分的記憶體區域。缺 而,在非安全性應用係一設計為企_ ” 止圖存取安全性資訊之駭 客應用的示例中,吾人將了解,當在—& 非安全性模式中時, 亦有可能破壞處理器所參考表格中的知 叩福述符,以產生指向 安全性記憶體的一些部分的映射。鍊 茆而,和因為由一安全 性作業系統在安全性網域中管理該特 符別分割檢測邏輯,其 不會因此類活動而受到破壞,和因 /' 口此可以偵測從一描述符 所截取的實體位址部分的此類情況, 从使之後為一特定虛 擬位址所產生的實體位址係在安全 &冗憶體中。因此,如 果已欺騙性地改變了記憶體中的表权 双裕’如果將導致對安全 性記憶體的存取,該特別分割檢測 <科將防止記憶體管理 早兀的内部儲存單元儲存已改變 J 1于取控制資訊,以及因 此將防止該存取的發生。 在記憶體管理單元中的内部儲 守缺而 > a 早疋可以有许多形 式。然而,在較佳實施例中,内 续庵,TT # 丨保存早几是一轉譯參考 緩衝(TLB)可操作以儲 虺 仿r邺八,甘1 一龎擬位址部分之對應的實體 位址口P刀,其截取自至一 六一夸 ^表袼之對應描述符所獲得。 TLB,以及:例中,在記憶體管理單元中將含有單-體中的表分割檢測邏輯將可操作以確保截取自記憶 二中二2之任何插述符將不會儲存在TLBt,如果處 理益在非文全性握丄· ^操作的話,以及依據在該描述符中 的存取控制資訊路立, 的實體位址將指向在安全性記憶體 14 200417216 中的一位置。在安全性和非安全性模式間轉換的操作中, 將清除TLB «確保在非安全性模式中不可獲得相關於安 全性模式之該描述符,反之亦然。The special partition detection logic is managed by the processor when, and in such embodiments, when operating in a predetermined security mode. For this reason, if a processor installed on the processor can execute messages in the security domain. Therefore, even if the application attempts to access the security data from a non-secure imaginary application located in the processor in the security memory, the application does not 'and therefore it cannot change the partitioned data to output a memory access request, Attempt to store 'The special partition detection logic will detect that an application executing in the formula attempts to access a security 10 200417216 memory location' with those who are familiar with this construct, and can specify the actual operation during a memory access. The security address, and the memory system, implement better access control in this type of operation if the operation is performed in the mode of “the memory access request refers to, especially,” if the operation is performed by the memory. The address-to-physical address cut detection logic executed by the management unit. In one embodiment, the fetch request can be operated by using virtual partition detection logic. The physical unit performs the necessary control function, but the controller operates in the physical address detection logic of a non-memory management unit to the physical location. When the processor requests to designate an integrated management unit, the access control Function one security mode, all operation modes, the memory management unit is in a non-secure mode, and any of its cut detection logics, when it accesses L will prevent that access from happening. Stomach artisans will understand that depending on the framework of the data processing system, a virtual address can be specified, or in some embodiments a rich address. However, in the preferred embodiment, when the processor is also in the mode, the memory access request specifies a virtual bit management unit controlled by a non-secure operating system. The memory function includes the virtual management unit. Special split access check. In the preferred embodiment, the memory access requests the system to control the above-mentioned predetermined conversion of the memory, at least, the address of the processor, and at and as long as this is handled, regardless of the address translation of the operation, the special sub-security One of the transformations performed in the mode, such as the security in order to prevent the memory from being tied to a secure virtual address, which is also provided by one of the memory containing the virtual non-use because the memory bin is provided The special mode operation uses the memory tube. It needs to be saved only when it is used in the memory 11 200417216. There will be no restrictions. However, I will understand that in the alternative embodiment, surely Some degree of segmentation check can be provided for a certain mode of operation. In the optional embodiment of the present invention, there is at least a security mode of operation, in which the memory access request is directly specified by the physical address, and therefore, in a specific security mode, no execution is required. Any ^ translation to the physical address, but the party directly specifies the physical address: The method of the pseudo-address is ineffective; tongue, because there is no need to perform mapping between the virtual address and the physical address: More secure. Therefore, in a step-by-step preferred embodiment +, the security mode of directly specifying the physical address of the memory access request is < the most secure in ㈣㈣. In the preferred embodiment, this mode is called One of the operational monitoring modes, and responsible for managing the conversion of data processing equipment in non-female holistic and secure domains. In such a preferred embodiment, the data processing device further includes a memory protection unit, which provides the special partition detection logic. The memory protection unit management is managed by a security operating system, and when the processor is operated in A special security mode, the memory access requests a physical address of a memory location, the memory management unit is not used, and the thin body thin unit operation is performed to perform at least memory access permission processing, To determine whether the memory location specified by the physical address is accessible in the special security mode. Therefore, when the processor is operating in a special security mode ', the access is only managed by the memory protection unit managed by the secure operating system. In a preferred embodiment, the memory includes at least one table containing a 12200417216 record containing a relevant descriptor for each of the memory regions of the narrative real-world device, Such as each ^ # This memory management unit contains an internal storage element for storing the & ^ & descriptive symbols and the access control data used by the memory management unit ^ 4, ^ y 5, thinking that the memory needs to perform the pre-access control function when the memory is swallowed. When the _ χ.Λ. Mi: _b Dongli device is operated in the V-non-female holistic mode, the special partition The internal storage unit of the detection logic stores the access to prevent wandering. The access control of sexual memory will be understood by those skilled in the art. Such a form of 描, θ Shi Tian Mi 4 can be in the form of a ball, but alas, in the preferred embodiment, the table is a pagination table. In a corresponding descriptor describing the stored% information of the page related to the memory, I in each of the pages of the memory is defined ... Therefore, for example, the descriptor can define a virtual bit for the page ^ ^ | knife and a corresponding body address part, access permission information (for example, whether the page is in supervising mode, user mode, etc. Accessible), and mysterious), and area attributes such as whether the data contained in the page is cacheable, bufferable, and so on. In these embodiments, the memory stores a known virtual address so that the interpolated characters in the table contain at least one virtual address portion corresponding to one of the memory regions.杳 强 # 〃 Corresponds to the physical address part. The special partition detection logic is operable. When the ulcer occurs, the processor operates in the at least one non-secure mode to prevent the internal storage. At a touch, Meow Store stores the access control information to the physical address part. If the physical address generated by the virtual address is later in the security memory. I will explain below ^ In a properly implemented system, virtual logic is executed in a non-safety mode ^ One of the non-safety applications that deal with vanadium is generally unknown 13 200417216 security memory, and when dealing with When the device is in a non-common female full-sex mode, it is referred by the processor to convert the virtual address into a real ^ ear body address table. You should not refer to any but eight # points that work with security memory. Memory area. By the way, in the example of a non-security application designed as a hacker application that only accesses security information, I will understand that when in & non-security mode, it may also break The knowledge descriptor in the table referenced by the processor to generate mappings to parts of the security memory. In addition, and because the particular operating system is managed by a security operating system in the security domain Detection logic, which will not be damaged by this kind of activity, and because of this situation, the physical address part intercepted from a descriptor can be detected, and then generated for a specific virtual address. The physical address is in the Security & Redundant Body. Therefore, if the table duality in the memory has been fraudulently changed, the special segmentation detection < The internal storage unit that prevents the memory management from being stored will have changed the J 1 to fetch control information, and therefore will prevent this access from occurring. The internal storage in the memory management unit is lacking and> a morning may have Many forms. However, in the preferred embodiment, TT # is saved earlier as a translation reference buffer (TLB) which is operable to store the correspondence of the imitation r 邺 8, and the corresponding part of the pseudo-address. The physical address port P knife, which is obtained from the corresponding descriptors up to 161 quarts ^ table T. TLB, and: In the example, the memory management unit will contain the single-body table partition detection logic It will be operable to ensure that any intervening characters taken from memory 2 and 2 2 will not be stored in TLBt, if the processing is performed in a non-comprehensive manner, and the operation is based on the access control in the descriptor Information Lu Li, the physical address of will point to a location in security memory 14 200417216. In the operation of switching between security and non-security mode, the TLB will be cleared «ensure that the relevant is not available in non-security mode The descriptor in security mode and vice versa.

然而,在—選擇性實施例中,内部儲存單元包含 miCr〇-TLB和主要TLB,$主要TLB被用來儲存由記憶體 管理單元自記憶體中至少一表格所戴取之描述符,以及在 使用該存取控制資訊之前,由記憶體管理單元把存取控制 資訊自主要TLB傳送至mi⑽_則以執行記憶體存取請求 之預定之存取控制功能。在此類實施例中,#處理器操作 於該至少-非安全性模式中日夺,該特別分割檢測邏輯可操 作X防止自主要TLb傳送任何存取控制資訊至 micro-TLB ,其允許存取該安全性記憶體。 因此,在此類實施例中,能夠複製描述符到主要tlb, 仁疋,*處理器在非安全性模式中操作時,特別分割檢測 邏輯可操作以監督在主|則和micr〇_TLB之間的介面,However, in an alternative embodiment, the internal storage unit includes miCrO-TLB and the main TLB, and the $ main TLB is used to store the descriptors worn by the memory management unit from at least one table in the memory, and in Before using the access control information, the memory management unit transmits the access control information from the main TLB to mi⑽_ to perform the predetermined access control function of the memory access request. In such embodiments, the #processor operates in the at least-non-security mode, and the special partition detection logic is operable to prevent any access control information from being transmitted from the main TLb to the micro-TLB, which allows access The security memory. Therefore, in such an embodiment, the descriptor can be copied to the main tlb, kernel, and * When the processor is operating in a non-security mode, the special segmentation detection logic is operable to supervise the Interface,

以確保沒有存取控制f訊被傳遞i mi__TLB,其允許存 取安全性記憶體。 ,, 股τ个r、提供一表格,心 依據刼作模式使用不同表格’因此允許替不同操作模式 義:同的存取控制資訊。尤有甚纟,在較佳實施例,^ 表格包含一非安全性表#,用在處理器操作於該至 一^安全性模式時並包含由非安全性作業系統所產生之 敘符,當在該非安全性表格中的描述符係相關於至少部 與該安全性記憶體之-部分共同作用之—記憶體區域二 15 200417216 = Π於非安全性模式4,該特別分割檢測邏輯 :分儲存料w訊,w之後料該虛擬位址= 女全〖生5己憶體中產生該實體位址。 此外,在此類較佳實施例中,在虛擬至實體位址 轉譯發生在至少―安全性模式中,該至少―表格更包含在 安全性記憶體中的—安全性表格,其包含由安全性作業系 統所產生的描述符,該主要TLB具有一旗標其相關於儲存 在主要TLB中的每一描述符,用以確認是否該描述符來自 上述非安全性表格或上述安全性表格, 當處理胃在安全性網域和非安全性網域_之間操作時, 藉:與主要TLB中的一旗標共同作用’以指示一對應描述 符是否來自非安全性表格或安全性表&,而不需要清除主 要⑽,反之亦然。當存取控制資訊自主要TLB的描述符 傳遞至mi⑽_TLB時,僅考慮那些在處理器所操作之現有 網域適當給定的描述符。因此,如果處 〜上益任一非安全性 模式中操作,和因此在非安全性網域中,則在主要m中 只有相關的旗標標示係來自非安全性表格之那些描述符被 視為候選描述符 從中獲仵存取控制資訊,以傳遞至 micro-TLB ° 在此類較佳實施例中,在一安全姓描々 丨犋式和一非安全性 模式間無論何時轉換處理器的操作模式,士 、八 在安全性模式 中,存取控制資訊只能自主要TLB中的—〜 抱述符轉換至 micro-TLB…該相關的旗標標示係來自安全性表格, 16 200417216 以及在非安全性模式中,存取控制資訊只能自主要 的—描述符轉換至micro-TLB,其中該相關的旗標 來自非安全性表格。該micro-TLB通常遠小於主要 以及因此無論何時處理器在安全性網域和非安全性 移動時’清除micro-TLB不會嚴重衝擊效能。既然 體管理單元所執行之預定的存取控制功能只彳 micro-TLB中的存取控制資訊執行。上述機制確保 器的任特疋模式之操作而言,該micro-TLB所包 取控制資訊將只有導自從適當記憶體表格獲得之描 即’當處理器操作於一非安全性模式時,從一非安 格,或當該處理器操作於一安全性模式時,從一安 格。 在實施例中,當操作之所有安全性模式直接在 記憶體存取請求中指定實體位址,吾人將了解,不 在主要TLB中的此類旗標,主要TLB只儲存非安 述符。 吾人將了解,記憶體能夠有許多形式以及能夠 資料處理設備中的許多地方。例如,記憶體可以包 元件中的一或多數,例如,隨機存取記憶體(ram) 記憶體(ROM)、一硬碟機、一緊接記憶體(tcm)、 數快取、在週邊裝置提供之多種登錄 '以及記憶體 圍允許記憶體的各種元件被分別定址。因此,當在 施例中,如前所述,可以使記憶體的至少部分可以 置匯流排連結,可以使記憶體的其他部分與一不同 TLB中 標示係 TLB, 網域間 由記憶 叶對在 對處理 含之存 敘符, 全性表 全性表 它們的 會需要 全性描 位於在 含多種 、唯讀 一或多 位址範 一些實 與一裝 匯流排 17 200417216 連結。 例如,在一實施例,處理器係連接至一系統匯流排, 和一部分該記憶包含連接至系統匯流排之一緊接記憶 (TCM) 〇那些熟知該項技藝者將了解,此類TCM時常用作 儲存通常被處理器使用的資料,因為經由系統匯流排對 TCM的存取遠快於對外部記憶體的存取,例如在裝置匯流 排上的記憶體。通常,TCM的實體位址係可設定於資料處 理設備的一控制登錄。然而,它可能引起某些安全性問題, 如下列示例所述。 當處理器在一非安全性模式中操作時,非安全性作業 系統允許設計控制登錄,以定義重疊部分安全性記憶體的 實體位址空間為TCM記憶體。當處理器之後在安全性網域 中操作時,安全性作業系統可以使安全性資料儲存於安全 性記憶體部分,其中通常在TCM而非外部記憶體將中健存 安全性資料,因為TCM通常具有一較高的優先權。然而, 如果之後非安全性作業系統再次改變TCM的實體位址範 圍設定,以使先前的安全性記憶部分現下映射至記憶體的 非安全性實體區域,吾人將了解此時非安全性作業系統能 夠存取安全性資料,因為特別分割檢測邏輯將把該區域視 為非安全性並且將不宣告一中止。因此,簡而言之,如果 TCM被設定為如同一般的本地端ram作用而非智慧型快 取(SmartCache),如果能夠移動TCM基礎登錄至非安全性 實體位址’則非安全性作業系統亦可能讀取安全性情境資 料。 、 18 200417216 供可 中操 式中 全性 統所 全性 操作 中,^ 一未 能夠 性應 性資 查詢 實施 用, 可被 網域 制記‘ 存取' 理設Ί 操作a 為了避免上述狀況’在輕估每^ ^ Λ 权佳實施例之資料處理設備提 由處理器設定之-控制旗標’當在一權限安全性模式 作時,用以指示是否緊結記憶體僅在—權限安全性模 執行時可由_器控帝】,或|可在執行於至少一非安 模式時可由處理器控制。控制旗標係由安全性作業系 設定’以及實際上定義是否由安全性權限模式或非安 模式控制TCM。因此,能夠定義的設定是只在… 於權限安全性模式時能夠…CM。在此類實施例 "CM控制登錄之任何非安全性存取意圖將導致進入 定義指令異常。 在-選擇性之設定+ ’當操作於一非安全杜模式中時 由處理器控制蘭。在此類實施例中,只能由非安全 用使用TCM。不能夠從TCM载入或儲存入任何安全 料。因此,當執行一安全性存取時,在取中不執行 ’以了解位址是否與該TCM位址範圍符合。在一較佳 例中,…CM以使其只能由非安全性作業系統使 優點是…改變非安全性作業系統,因為愈 非安全性作業系統使用之TCM以正常的模式進行/、 自本發明之一第二態樣觀之’本發明在具有_安全性 二:安全性網域之-資料處理設備中,提供一種控 隐體存取之方法’在安全性網域中,資料處理 f月&在非安全性網祕士 + 接包八Γ 取之安全㈣料,該資料處 :發:―裝置匯流排、-裝置連接至該裝置匯流排並 憶體存取請求其相關於的該安全性網域或 19 200417216 該非安全性網域之任一、以及一記憶體連接至該裝置匯流 排並可操作以儲存資料該裝置所需要之資訊,該記憶體包 含用以儲存安全性資料之安全性記憶體,以及用以儲存非 安全性資料之非安全性記憶體,該方法包含下列步驟:(i) 當需要在該記憶體存取一資料項時,自裝置發出一記憶體 存取請求至裝置匯流排;以及(ii)只要裝置所發出之記憶體 存取請求相關於該非安全性網域,使用連接至裝置匯流排 之分割檢測邏輯偵測是否該記憶體存取請求係企圖存取該 安全性記憶體;以及(iii)依據此類偵測,防止該該記憶體 存取請求所指定之存取。 自本發明之另一態樣觀之,本發明提供一資料處理設 備包含:一裝置匯流排、一裝置連接至該裝置匯流排並以 多種模式或在安全性網域或非安全性網域中操作,包含在 非安全性網域之至少一非安全性模式以及在安全性網域之 至少一安全性模式;一記憶體連接至裝置匯流排並可操作 儲存裝置所需要之資料,該記憶體包含用以儲存安全性資 料之安全性記憶體以及用以儲存非安全性資料之非安全性 記憶體,當需要在該記憶體存取一資料項時,該裝置可操 作以發出一記憶體存取請求至裝置匯流排;以及分割檢測 邏輯連接至裝置匯流排和當操作於該至少一非安全性模式 時,只要裝置發出記憶體存取請求,偵測是否該記憶體存 取請求係企圖存取該安全性記憶體;以及依據此類偵測, 防止該該記憶體存取請求所指定之存取。 自本發明之另一態樣觀之,本發明提供在一資料處理 20 200417216 設備中控制對一記憶體之存取的方法,該資料處理設備包 含一裝置匯流排、一裝置連接至該裝置匯流排並以多種模 式或在安全性網域或非安全性網域中操作,包含在非安全 性網域之至少一非安全性模式以及在安全性網域之至少一 安全性模式,·一記憶體連接至裝置匯流排並可操作儲存裝 置所需要之資料,該記憶體包含用以儲存安全性資料之安 全性記憶體以及用以儲存非安全性資料之非安全性記憶 體,該方法包含下列步驟:(i)當需要在該記憶體存取一資 料項時,自裝置發出一記憶體存取請求至裝置匯流排;以 及(π)當操作於該至少一非安全性模式時,只要裝置發出記 隐體存取明求,使用連接至裝置匯流排之分割檢測邏輯偵 測是否該記憶體存取請求係企圖存取該安全性記憶體;以 及(ill)依據此類偵測,防止該該記憶體存取請求所指定之 存取。 【實施方式】 第一圖為依據本發明之較佳實施例描述一資料處理設 備之方塊圖。該資料處理設備與一處理器核心1 〇共同作 用,其中提供一安排以執行一系列指令之算術邏輯單元 (ALU,arithmetic logic unit)16。該 ALU 16 所需要的資料 係在一登錄區塊1 4之内儲存。為核心1 〇提供各種監控功 能以截取指示處理器核心活動的診斷資料。舉一示例,提 供一叙入式追縱模組(ETM,Embedded Trace Module)22, 依據定義欲追蹤之活動的ETM 22之内的某些控制登錄26 21 200417216 内容,產生該處理器核心某些活動的即時追蹤。該些追蹤 信號通常被輸出至一追縱緩衝器,此處能夠在其後分析它 們。提供一向量中斷控制器21以管理可以由各種週邊提供 的多數中斷服務(本文不予贅述)。 尤有甚者,如第一圖所示,能夠在核心丨〇之内提供的 另一監控功能性是一偵錯功能’在資料存取設備之外的一 摘錯應用能藉由連結一或多數掃描鏈1 2的連接測試存取 群組(JTAG,Joint Test Acces Group)控制器 ι8 與核心 1〇 通訊。關於處理器核心10各部分的狀態資訊可以藉由該些 掃描鏈12和JTAG控制器1 8輸出至外部偵錯應用。一在 線模擬器(ICE,In Circuit Emnlato〇20係用作在登錄24之 内,儲存確認何時起始和停止偵錯功能之情況,和因此, 例如,被用來儲存斷點(breakpoint)、監視點 (watchpoints)、等等。 核心10係藉由記憶體管理邏輯30與一系統匯流排4〇 連結,該記憶體管理邏輯3 0係被安排為管理核心丨〇所發 出的記憶體存取請求,用以存取在資料處理設備的記憶體 位置。可以藉由直接連接至系統匯流排4〇之記憶體單元, 例如,第一圖所示之快取38和緊接記憶體(TCM,TighUy Coupled Memory)36部署某些部分的記憶體。也可以為存 取此類記憶體提供額外的裝置,例如,直接記憶體存取 (DMA)控制器32。通常,將提供各種控制登錄34以定義 晶片各種元件的某些控制參數,此處,這些控制登錄也稱 作辅助處理器15(CP15)登錄。 22 200417216 可以藉由一外部匯流排界面42使含有核心1 〇的晶片 與一外部匯流排70(例如依據由arm Limited所發展之「先 進+政控制單元匯流排架構(Advanced Microcontroller BusTo ensure that no access control message is passed to mi__TLB, which allows access to secure memory. In order to provide a table, different tables are used according to the operation mode, so it allows different operation modes. Meaning: the same access control information. In particular, in the preferred embodiment, the ^ table includes a non-security table #, which is used when the processor is operating in the to ^ security mode and contains descriptors generated by the non-security operating system. The descriptors in the non-security table are related to at least part of the security memory that-partly interacts with-memory area 2 15 200417216 = Π in non-security mode 4, the special segmentation detection logic: sub-storage It is expected that the virtual address after w will be equal to the physical address generated by the women's full health body. In addition, in such a preferred embodiment, when the virtual-to-physical address translation occurs in at least-security mode, the at least-table is more contained in the security memory-the security table, which contains the The descriptor generated by the operating system. The primary TLB has a flag that is associated with each descriptor stored in the primary TLB to confirm whether the descriptor comes from the non-security form or the security form. When the stomach is operating between the security domain and the non-security domain_, by: working with a flag in the main TLB 'to indicate whether a corresponding descriptor comes from the non-security table or the security table &, There is no need to clear the main puppet and vice versa. When the access control information is passed from the descriptors of the main TLB to mi⑽_TLB, only those descriptors given appropriately in the existing domains operated by the processor are considered. Therefore, if you operate in any of the non-security modes, and therefore in non-security domains, then only the relevant flags in the main m are those descriptors from the non-security form are considered Candidate descriptors get access control information from them to pass to the micro-TLB ° In this preferred embodiment, whenever the operation of the processor is switched between a secure surname description and a non-secure mode In security mode, access control information can only be converted from the main TLB— ~ brackets to micro-TLB ... The relevant flags are from the security table, 16 200417216, and In the security mode, the access control information can only be converted from the primary-descriptor to the micro-TLB, where the relevant flag comes from the non-security table. The micro-TLB is usually much smaller than the primary and therefore whenever the processor is moving in a secure domain and insecurely, 'clearing the micro-TLB will not severely impact performance. Since the predetermined access control function performed by the body management unit is performed only by the access control information in the micro-TLB. For the operation of the above-mentioned mechanism to ensure any special mode of the device, the control information contained in the micro-TLB will only be derived from the description obtained from the appropriate memory table, that is, when the processor is operating in a non-security mode, Non-Angle, or when the processor is operating in a security mode. In an embodiment, when all security modes of operation specify the physical address directly in the memory access request, we will understand that such flags are not in the main TLB, and the main TLB stores only non-specifiers. I will understand that memory can take many forms and can be used in many places in data processing equipment. For example, the memory may include one or more of the components, for example, random access memory (RAM), a hard drive, a back-to-back memory (tcm), a number of caches, a peripheral device The multiple registrations provided and the memory enclosures allow the various components of the memory to be individually addressed. Therefore, in the embodiment, as described above, at least a part of the memory can be connected to a bus, the other part of the memory can be marked as a TLB in a different TLB, and the memory domains are aligned by the memory leaves. For the processing of contained narratives, holistic tables, holistic tables, they will need holistic descriptions, which are located in multiple, read-only one or more address ranges, and some links to a single bus 17 200417216. For example, in one embodiment, the processor is connected to a system bus, and a portion of the memory includes one immediate memory (TCM) connected to the system bus. Those skilled in the art will understand that such TCMs are commonly used It is used to store data that is usually used by the processor, because access to the TCM via the system bus is much faster than access to external memory, such as the memory on the device bus. Generally, the physical address of the TCM can be set in a control register of a data processing device. However, it may cause some security issues, as described in the following example. When the processor is operating in a non-secure mode, the non-secure operating system allows design control login to define the physical address space of the overlapping portion of security memory as TCM memory. When the processor later operates in the security domain, the security operating system can enable the security data to be stored in the security memory section, where the security data is usually stored in the TCM instead of the external memory, because the TCM usually Has a higher priority. However, if the non-secure operating system changes the physical address range setting of the TCM again later, so that the previous secure memory part is now mapped to the non-secure entity area of the memory, we will understand that the non-secure operating system can Access to security data, as special partition detection logic will treat the area as non-secure and will not declare a suspension. Therefore, in short, if the TCM is set to behave like a normal local ram instead of SmartCache, if the TCM base can be moved to a non-secure entity address, then the non-secure operating system will also It is possible to read security situation data. , 18 200417216 For the full operation of the omnidirectional system of the comprehensive operation mode, ^ a failure to respond to the implementation of the query of information, can be registered by the domain 'access' management settings operation a in order to avoid the above situation' In underestimating every ^ ^ Λ, the data processing device of the preferred embodiment provides a control flag set by the processor when it is operating in a security mode, indicating whether the compact memory is only in the security mode. It can be controlled by the device during execution], or can be controlled by the processor when executed in at least one non-safe mode. The control flag is set by the security operation system 'and actually defines whether the TCM is controlled by the security authority mode or the non-security mode. Therefore, the settings that can be defined are ... CM only when in the permission security mode. In such embodiments " any non-secure access intent of the CM control login will result in an exception to the entry definition instruction. The -selective setting + 'is controlled by the processor when operating in a non-secure Du mode. In such embodiments, the TCM can only be used by non-secure applications. No safety material can be loaded or stored from TCM. Therefore, when performing a secure access, do not perform a fetch to know if the address matches the TCM address range. In a preferred example, CM makes it possible to use only non-safety operating systems. The advantage is to change the non-safety operating system, because the more non-safety operating systems use the TCM in a normal mode. One of the second aspects of the invention is that the present invention provides a method for controlling hidden body access in a data processing device with _security 2: security network domain. In the security network domain, data processing f Month & security information taken from the non-secure web clerk + receiver package Γ, the data is sent: ―device bus,-device is connected to the device bus and memory access request related to it Either the secure domain or 19 200417216 the non-secure domain, and a memory connected to the device bus and operable to store data the information required by the device, the memory containing the information used to store the security data Security memory and non-security memory for storing non-security data, the method includes the following steps: (i) when a data item needs to be accessed in the memory, a memory storage is issued from the device; Fetch request to Configure the bus; and (ii) as long as the memory access request issued by the device is related to the non-secure domain, use the segment detection logic connected to the device bus to detect whether the memory access request is an attempt to access the memory Secure memory; and (iii) prevent access specified by the memory access request based on such detection. From another aspect of the present invention, the present invention provides a data processing device including: a device bus, a device connected to the device bus, and in multiple modes or in a secure or non-secure domain Operation, including at least one non-security mode in a non-security domain and at least one security mode in a security domain; a memory connected to the device bus and operable to store data required by the device, the memory The device includes a security memory for storing security data and a non-security memory for storing non-security data. When a data item needs to be accessed in the memory, the device is operable to issue a memory storage. Fetching requests to the device bus; and split detection logic connected to the device bus and when operating in the at least one non-security mode, as long as the device issues a memory access request, it is detected whether the memory access request is an attempt to save Fetch the security memory; and prevent access specified by the memory access request based on such detection. From another aspect of the present invention, the present invention provides a method for controlling access to a memory in a data processing 20 200417216 device. The data processing device includes a device bus and a device connected to the device bus. Side by side operation in multiple modes or in a secure or non-secure domain, including at least one non-secure mode in a non-secure domain and at least one security mode in a secure domain, a memory It is connected to the device bus and can operate and store the data needed by the device. The memory includes the security memory for storing the security data and the non-security memory for storing the non-security data. The method includes the following Steps: (i) when a data item needs to be accessed in the memory, a memory access request is sent from the device to the device bus; and (π) when operating in the at least one non-security mode, as long as the device Issue a hidden memory access request and use the segment detection logic connected to the device bus to detect if the memory access request is an attempt to access the secure memory; (ILL) based on such detection, to prevent the memory access request of the designated access. [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 10, which provides an arithmetic logic unit (ALU) 16 arranged to execute a series of instructions. The information required by the ALU 16 is stored in a registration block 14. Provide various monitoring functions for core 10 to intercept diagnostic data indicating processor core activity. As an example, an embedded trace module (ETM) 22 is provided. According to certain controls within the ETM 22 that define the activities to be traced, the content of 26 21 200417216 is generated, and some of the processor cores are generated. Real-time tracking of events. These 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). In particular, as shown in the first figure, another monitoring functionality that can be provided within the core is an error detection function. An error-removing application outside the data access device can be linked by an or Most of the connection test access group (JTAG, Joint Test Acces Group) controllers 12 of the scan chain 12 communicate with the core 10. The status information about 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 simulator (ICE, In Circuit Emnlato 〇20 is used to store the confirmation of when to start and stop the debugging function within the login 24, and therefore, for example, is used to store breakpoints, monitor Watchpoints, etc. The core 10 is connected to a system bus 40 through the memory management logic 30. The memory management logic 30 is arranged to manage the memory access requests issued by the core. , Used to access the memory location of the data processing device. It can be directly connected to the memory unit 40 of the system bus, for example, the cache 38 shown in the first figure and the immediate memory (TCM, TighUy Coupled Memory) 36 deploys some parts of memory. Additional devices can also be provided for accessing such memory, such as a direct memory access (DMA) controller 32. Generally, various control entries 34 will be provided to define Certain control parameters of various components of the chip. Here, these control registrations are also referred to as auxiliary processor 15 (CP15) registration. 22 200417216 An external bus interface 42 can be used to connect the chip containing the core 10 with the An external bus 70 (e.g., based on the Advanced Microcontroller Bus

Architecture,AMBA)」規格所操作的一匯流排)連結並可以 把各種裝置連接至外部匯流排7 〇 ^這些裝置可以包括例如 數位#號處理器(DSP)的主控裝置,以及各種受控裝置,例 如開機唯讀記憶體44、螢幕驅動器46、外部記憶體5 6、 輸入/輪出(I/O)界面60或金鑰儲存單元64。在第一圖所示 體的共 處理設 尤有甚 儲存單 、66之 部記憶 部分, 關於記 提供判 由多數 例如, 用該解 何特定 部提供 之各種欠控裝置可視為是資料處理設備之全部記憶 同作用部分。例如,開機唯讀記憶體44將形成資料 備之可尋址δ己憶體的部分,外部記憶冑5 6亦然。 者,例如螢幕驅動ϋ 46、輪入輸出界面6〇和金鑰 兀64之裝置都分別包括例如登錄或緩衝器以、 獨立可尋址内部儲存元件,其作為資料處理設備全 體的一部分。如稍後將更詳細討論者,記憶體的-例如,外部記憶體56的一部分將被用來儲存定義相 憶體存取控制之一或多數的分頁表58。 …ι項技藝者將了解,通常替外部匯流排70 優器—Μ和解碼器邏輯54,該判優器被用來對 主控裝置所發出的多數記憶體存取請求進行判斷, 核心 10、DMA 32、 Ρ 5〇、DMA 52、等等,而將 碼器來決定外部匯法姑μ 丨匯机排上的受控裝置所該處理之任 記憶體存取請求。 在一實施例中,可以對含有核心丨〇的晶片外 23 200417216 外部匯流排,在其他實施例中,將整合晶片(on-chip)以對 該外部匯流排提供核心1 0。其比在外部匯流排是非整合晶 片(off-chip)時更有利於保持外部匯流排上的安全性資料 之安全性;當外部匯流排是非整合晶片時,可以用資料加 密技術來增進安全性資料的安全性。Architecture, AMBA) "specification to operate a bus) connection and can connect various devices to external buses 7 0 ^ These devices can include, for example, the main control device of the digital # processor (DSP), and various controlled devices For example, the boot-only read-only memory 44, the screen driver 46, the external memory 56, the input / roll-out (I / O) interface 60, or the key storage unit 64. In the co-processing facility shown in the first figure, there are especially a storage list and a memory part of the 66. Regarding the provision of judgments, for example, the various control devices provided by the specific department can be regarded as the data processing equipment All memories have the same effect. For example, the boot-only read-only memory 44 will form part of the data-addressable δ-memory body, as well as the external memory 胄 56. For example, devices such as a screen driver ϋ 46, a turn-on output interface 60, and a key 64 each include, for example, a login or a buffer, and independently addressable internal storage elements, which are part of the entire data processing device. As will be discussed in more detail later, a portion of memory-for example, external memory 56 will be used to store a paging table 58 that defines one or more of the memory access controls. … Artists will understand that, usually for the external bus 70 optimizer-M and decoder logic 54, the arbiter is used to judge the majority of memory access requests issued by the master device. Core 10, DMA 32, P 50, DMA 52, etc., and the encoder determines any memory access request that should be processed by the controlled device on the external sink. In one embodiment, an external bus may be provided to the chip containing the core 23, 200417216. In other embodiments, an on-chip will be integrated to provide the core 10 to the external bus. It is more conducive to maintaining the security of the security data on the external bus than when the external bus is off-chip; when the external bus is a non-integrated chip, data encryption technology can be used to improve the security data Security.

第2圖圖示在具有一安全性網域和一非安全性網域的 一處理系統上執行的各種程式。為系統提供至少部分在一 監控模式中執行的一監控程式7 2。在該示例性實施例中, 安全性狀態旗標僅在監控模式之内是可寫入的存取和可以 由該監控程式72寫入。該監控程式72負責管理在安全性 網域和非安全性網域之間任一方向之所有轉換。以核心外 的觀點來看,監控模式總是安全的而監控程式係在安全性 記憶體中。Fig. 2 illustrates various programs executed on a processing system having a secure domain and a non-secure domain. Provide a monitoring program 7 2 for the system to execute at least 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共同作用的多數非安全性應 用程式7 6、7 8。在安全性網域中,提供了一安全性核心程 式8 0。該安全性核心程式8 0能夠視為形成一安全性作業 系統。通常將設計此類安全性核心程式8 0為僅提供那些對 於處理活動所必須的功能,以使安全性核心8 0盡可能小而 簡單,因為如此才易於確保安全性。圖示與安全性核心8 0 共同執行之多數安全性應用82、84。 第3圖圖示與不同安全性網域相關的處理模式的一矩 陣。在該特定示例中,該處理模式就安全性網域而論是對 稱的,而因此模式1和模式2在安全性和非安全性形式中 24 200417216 皆存在。 在系統中監控模式具有安全性存取的最高的層級,和 在示例性實施例中是授權以在非安全性網域和安全性網域 之間的任一方向轉換的唯一模式。因此,所有網域轉換都 在監控模式之内,藉由監控模式和監控程式72的執行而進 行轉換。Within a non-secure domain, a non-secure operating system 74 is provided and most non-secure applications 7 6, 7 8 interacting with the non-secure operating system 74. In the security domain, a security kernel 80 is provided. The security kernel program 80 can be regarded as forming a security operating system. Such a security core program 80 will usually 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, the processing mode is symmetrical with respect to the security domain, and therefore mode 1 and mode 2 exist in both secure and non-secure forms 24 200417216. 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圖圖示程式設 計人員的一示例性登錄區塊之一模組檢視,其具有為某些 25 200417216 處理模式中的某些登錄數字所提供之專屬 卞,登錄。尤其是, 第6圖的示例是習知 ARM的登錄區挣从冰+ 尼的擴充(例如,在 ARM Limited(英國劍橋)的ARM 7處理考由仏上日 ° τ所徒供者)其被 處理模式的 錄和一專屬 控模式所供 被提供的額 ’不需要儲 可以在選擇 被提供以專 的處理速度 圖示另一實 提供登錄區 。這種方法 錄中,當對 可存取。然 的機制將其 錄中,上述 網域的可能 全性登錄區 情境前需要 可以使用沒 統,如第6 程式狀態登 Rl4 ’但是 如第6圖所 ’以使在進 他模式還原 中以一種類 登錄,用以 類轉換相關 以二種完全 別用於安全 料儲存在可 域進行轉換 許並為所欲 性網域和安 資料自非安 優點是避免 容。如果等 域情境的重 式負責從一 提供以每一 堆疊指標登 下,由一監 斷模式具有 中斷模式時 監控模式亦 模式的方法 性網域轉換 時間 第7圖 區塊的形式 安全性網域 域操作的登 止資料變為 快速而有效 可存取的登 遞至安全性 具有安 轉換至另一 特殊問題, 簡化硬體系 一專屬儲存 鏈結登錄 應者擴充。 外專屬登錄 存然後自其 性的實施例 屬的進一步 和減少與此 施例,其中 塊8 8,其分 將安全性資 非安全性網 而,如果允 放在非安全 安排阻礙將 性。 塊的一重要 清除登錄内 有安全性網 圖。監控模 錄、一專屬 在這種情況 示,快速中 入上述快速 登錄狀況。 似快速中斷 加快一安全 的系統等待 和分離登錄 性網域和非 在安全性網 時,能夠防 ’藉由使用 全性網域皆 全性網域傳 在從一情境 待時間不是 複登錄的一 網域轉換為Figure 5 illustrates another arrangement of processing modes in terms of a security domain. In 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 typically providing a microprocessor with a login block 88, in which operand values can be stored. Figure 6 illustrates a module view of an exemplary login block for a programmer, which has Log in for exclusive access to certain login numbers in certain 25 200417216 processing modes. In particular, the example in Figure 6 is an extension of the knowledge of ARM's login area from Bing + Ni (for example, the ARM 7 processing test at ARM Limited (Cambridge, UK) was performed by the donor of the last day ° τ). The recording mode of the processing mode and the amount provided by an exclusive control mode need not be stored, but can be provided at a selected processing speed to indicate another real-time login area. In this method, when access is available. The natural mechanism records it. Before the situation of the possible full registration area of the above domains, you need to be able to use it, as shown in the sixth program state Rl4 'but as shown in Figure 6', in order to restore the other mode to one Type registration, used for class conversion related, two completely different types are used for security materials stored in the domain for conversion permission, and the self-safety of the desired domain and security information is to avoid content. If the re-form of the isodomain scenario is responsible for logging off from a provision with each stacking index, the monitoring mode also has a monitoring mode when the monitoring mode has an interrupt mode. The mode transition time is shown in Figure 7. Domain operation registration data becomes fast and effective and accessible registration to security has another special problem, which simplifies the expansion of the hardware system and a dedicated storage link registration application. The external exclusive registration is then further reduced from the embodiment of this embodiment, which is divided into blocks 8 to 8 which divides the security information into the non-security network and if allowed to the non-security arrangement prevents the sexuality. An important block is clearing the security map within the login. Monitoring profile, an exclusive In this case, quickly enter the above quick login status. It seems that rapid interruption speeds up a secure system to wait for and separate login domains and non-secure networks, which can prevent 'through the use of global domains. Domain converted to

26 200417216 另一網域。由一監控程式至少部分在監控模式中執行還原 内容、儲存先前内容、以及清除登錄。該系統之行為因此 像是一虛擬化模組。這種類型的實施例將在下文中進一步 討論。在本文中論及安全特徵時,應該參考,例如,ARM 7的程式設計人員模組。 處理器模式(Processor Modes)26 200417216 Another domain. 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 for ARM 7. Processor Modes

相對於在安全性情境中的多數模式,相同的模式支援 安全性和非安全性網域兩者(請參考第8圖)人監控模式知 道核心的目前狀態,不論是安全性或非安全性(例如,當讀 取自所儲存的一 S位元時,其係一辅助處理器設定登錄)。 在第8圖,只要一 SMI(軟體監控中斷指令,Software Monitor Interrupt instruction)發生,核心進入監控模式’ 以適當地自一情境轉換到另一情境。 參考第9圖,其中SMIs在使用者模式是被允許的: 1. 排程發動執行緒1。Relative to most modes in the security context, the same mode supports both secure and non-secure domains (see Figure 8). The human monitoring mode knows the current state of the core, whether it is secure or non-secure ( For example, when reading from a stored S bit, it is an auxiliary processor setting register). In Figure 8, whenever an SMI (Software Monitor Interrupt Instruction) occurs, the core enters the monitoring mode 'to properly transition from one situation to another. Refer to Figure 9 where SMIs are allowed in user mode: 1. Schedule thread 1 to start.

2. 執行緒 1需要執行一安全性功能= = >SMI安全性呼 叫,核心進入監控模式。在硬體下控制現有 P C,而 CPSR(current processor status register)被儲存在 R14 — mon ’ 以及 SPSR一mon(saved processor status register for the monitor mode)和 IRQ/FIQ 中斷失效。 3. 監控程式進行下列任務: 鲁設置S位元(安全性狀態旗標)。 • 將至少R14—mon和SPSR—mon儲存在堆疊中,在 27 200417216 一安全性應用執行時,若異常發生才不致於失去非 安全性内容。 ♦ 檢查是否有一新執行緒要發動:安全性執行緒1。 一機制(在一些示例實施例中,藉由執行緒ID表) 指示執行緒1在該安全性情境中是啟用的。 • IRQ/FIQ中斷再次啟用。一安全性應用此時能夠以 安全性使用者模式起始。 4· 執行安全性執行緒1至完成,而後(將SMI)發展出監 控程式模式的「自安全性返回」功能(當核心進入監控 模式時,則IRQ/FIQ中斷失效)。 5· 「自安全性返回(return from secure)」功能進行下列任 務: * 指示完成安全性執行緒1 (例如,在一執行緒ID表 的情況下,從該表移除執行緒1)。 •從堆疊非安全性内容還原並清除需要的登錄,以使 一旦返回非安全性網域,則不能讀取任何安全性資 料。 *然後,以一 SUBS指令(它使程式計數還原為正確 的點和更新該些狀態旗標)回到非安全性網域,(從 還原的R14 一 mon)還原Pc和(從SPSR—m〇n)還原 CPSR❶所以,在非安全性網域中的返回點是在執 行緒1先前所執行的SMI指令之後。 6.執行執行緒1至結束’然後交回給排程。 一些上述功能性也許根據特定實施例分別在監控程式 28 200417216 和安全性作業系統間出間。 在其他實施例中,可以要求不允許SMIs出現在使用 者模式中。 安全性愔燴的進入 重設2. Thread 1 needs to execute a security function = = > SMI security call, and the core enters monitoring mode. The existing PC is controlled under the hardware, while the CPSR (current processor status register) is stored in R14 — mon ', and the SPSR_mon (saved processor status register for the monitor mode) and IRQ / FIQ interrupts are disabled. 3. The monitoring program performs the following tasks: Lu sets the S bit (security status flag). • Store at least R14-mon and SPSR-mon in the stack. When a security application is executed on 27 200417216, if the exception occurs, the non-security content will not be lost. ♦ Check if there is a new thread to launch: Security thread 1. A mechanism (in some example embodiments, by a thread ID table) indicates that thread 1 is enabled in the security context. • IRQ / FIQ interrupt is enabled again. A security application can now start in a security user mode. 4. Execute the 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 secure thread 1 (for example, in the case of a thread ID table, remove thread 1 from the table). • Restore and clear required logins from stacked non-secure content so that once you return to a non-secure domain, you cannot read any security data. * Then, return to the non-secure domain with a SUBS instruction (which restores the program count to the correct point and update the status flags), (from the restored R14-mon) to restore Pc and (from SPSR-m. n) Restore CPSR. Therefore, the return point in the non-security domain is after the SMI instruction previously executed by thread 1. 6. Execute thread 1 to end 'and return to the schedule. Some of the above-mentioned functionality may differ between the monitoring program 28 200417216 and the secure operating system, respectively, according to a particular embodiment. In other embodiments, SMIs may be required to be disallowed from appearing in the user mode. Entry for security stew

當一硬體重設發生,使MMU失效和ARM核心(處理 器)以S位元集發展出安全性監督模式。如為所欲,一旦安 全性開機終止’至監控模式之s ΜI可以被執行而監控可以 轉換至非女全性情i兄的〇 S (非安全性s ν c模式)。如果希望 以使用先前的O S,它能夠在安全性監督模式中只是開始而 忽略安全性狀態。 iMI指今 指令(轉換軟體中斷指令的 域中的任何非安全性模式呼 SMIs限制為權限模式),但 標進入點總是固定的並在監 決定發展出必須執行的適當 遞之運算元控制)。 一模式)能夠從非安全性網 叫(如上文所述,其可以希望將 I ’由相關的向量所決定的目 控模式之内。它由SMI管理器 文全性功能(例如,由以指令藉When a hard reset occurs, the MMU is disabled and the ARM core (processor) develops a safety oversight mode with S bits. As desired, once the safety boot is terminated, the sMI to the monitoring mode can be executed and the monitoring can be switched to the non-sexual brother's 0S (non-safety svc mode). If you want to use the previous OS, it can just start in the security supervision mode and ignore the security state. iMI directives (any non-security mode in the domain that translates software interrupt instructions calls SMIs restricted to permission mode), but the target entry point is always fixed and an appropriate operator control must be developed when the supervisor decides to implement it) . A mode) can be called from a non-secure network (as described above, it may wish to set I 'within the eye control mode determined by the relevant vector. It is fully functional by the SMI manager (for example, by the instruction borrow

從非 用在一第 安全性情境傳遞 6圖類型登錄區 參數至安全性情境, 意之内的登錄來執行 能夠藉由共 〇 當一 SMI發生在非安全 性情境 ’ ARM核心可能在硬體 29 200417216 進行下列動作: • 發展出 SMI向量(在安全性記憶體存取中是允許 的,因為你現下在監控模式中)至監控模式 •儲存 PC 至 R14_mon 和 CPSR 至 SPSR—mon • 在監控模式中開始執行安全性異常管理器(如果有 多執行緒,還原/儲存内容)From a non-secure security context to passing the parameters of the 6 type registration area to the security context, the intended registration can be performed by a total of 0 when an SMI occurs in a non-security context. The ARM core may be in hardware 29 200417216 performs the following actions: • Develops SMI vectors (allowed in secure memory access because you are currently in monitor mode) to monitor mode • Stores PC to R14_mon and CPSR to SPSR—mon • In monitor mode Start execution of Security Exception Manager (if multiple threads, restore / save content)

籲發展出安全性使用者模式(或另一模式,例如SVC 模式)以實施適當的功能 • 當該核心在監控模式下,IRQ和FIQ失效(等待時 間增加) 安全性情境出口 有二種退出安全性情境的可能: • 該安全性功能完成而吾人返回先前呼叫該功能的 非安全性模式。 • 由非安全性異常中斷了安全性功能(例如, IRQ/FIQ/SMI)。 _ 安全性功能的正常結束 安全性功能正常終止而我們需要還原正好在SMI以後 的指令,在非安全性情境重新繼續一應用。在安全性使用 者模式中,一 nSMI”指令被執行以返回具有與「自安全性 情境返回」例式相對應的適當參數的模式。在該階段,登 錄被清除以在非安全性和安全性情境之間避免資料的洩 30 200417216 漏,而後非安全性内容之一般目的登錄被還原以及以它們 在非安全性情境中所獲得的值更新非安全性區塊登錄。 R14_mon和 SPSR — mon 因此在 SMI之後,藉由執行一 "MOVS PC,R14”指令獲得適當值以重新繼續非安全性應 用〇Call for the development of a security user mode (or another mode, such as the SVC mode) to implement appropriate functions. • When the core is in the monitoring mode, IRQ and FIQ fail (increased waiting time). There are two types of exit security exit Possibility of sexual situations: • The security function is completed and we return to the non-security mode where the function was previously called. • A security function was interrupted by a non-security exception (for example, IRQ / FIQ / SMI). _ The normal end of the security function The security function terminates normally and we need to restore the instructions immediately after the SMI and resume the application in a non-safety situation. In the security user mode, an "nSMI" instruction is executed to return a mode with appropriate parameters corresponding to the "self-safety context return" routine. At this stage, the logins are cleared to avoid leakage of data between non-security and security contexts. 30 200417216 The general purpose registrations of non-security content are then restored and their values obtained in non-security contexts Update non-security block login. R14_mon and SPSR — mon Therefore after SMI, execute the "MOVS PC, R14" instruction to obtain the appropriate value to resume the non-security application.

起因於非安全性異常之安全性功能的退出 該狀況下,安全性功能未完成而必須在進入非安全性 異常管理器前儲存該安全性内容,無論如何需要處理該些 中斷。 安全性中斷 對於安全性中斷有幾種可能性 依據下列兩點,提出兩種可能的解決方案: • 其為何種中斷(安全性或非安全性)Exit of the security function due to a non-security exception In this case, the security function is not completed and the security content must be stored before entering the non-security exception manager, and the interrupts need to be handled anyway. Security Interruption There are several possibilities for security interruption. Two possible solutions are proposed based on the following two points: • What type of interruption is it (security or non-security)

• 當IRQ發生時,核心處於何種模式(在安全性或在 非安全性情境中) 解決方案一 在該解決方案中,需要以兩種不同的方式支援安全性 和非安全性中斷。 當在非安全性情境中,如果 • 一 IRQ發生,則當在ARM核心(例如ARM 7)時, 核心進入IRQ模式以處理該中斷。 31 200417216 一 S IRQ發生,則核心進入監控模式以儲存非安全 性内容,而後進入一安全性IRQ管理器以處理該 安全性中斷。 當在安全性情境中,如果 m 一 SIRQ發生,則核心進入安全性IRQ管理器。該 核心不退出該安全性情境。 # 一 IRQ發生,核心進入儲存安全性内容之監控模 式’而後進入一非安全性IRQ管理器,以處理該 非安全性中斷。 另€之’當不屬於目前情境的中斷發生時,核心直接 進入監控模式,否則其停留在目前情境中(請參考第1 0 圖)。 全性情境 請參考第11 Α圖: 1 ·排程發動執行緒1。 _ 2·執行緒1需要執行一安全性功能=>SMI安全性呼 叫’核心進入監控模式。目前PC和CPSR儲存在R14一mo η 和 SPSR —mon 中,使 IRQ/FIQ 失效。 3.監控管理器(程式)進行下列任務: • 設置該S位元。 •儲存至少R14 —mon和SPSR一mon於堆疊中(亦可月匕 輸入其他登錄),以使在安全性應用執行時’如果 32 200417216 異常發生才不會失去非安全性内容。 _檢查是否有一新執行緒要發動:安全性執行緒1。 一機制(藉由執行緒ID表)指示執行緒1在該安全 性情境中是啟用的。 •安全性應用此時能夠以安全性使用者模式起始。而 後IRQ/FIQ再次啟用。• When the IRQ occurs, what mode the core is in (in a security or non-security context) Solution 1 In this solution, security and non-security interrupts need to be supported in two different ways. When in an unsafe situation, if an IRQ occurs, when in an ARM core (for example, ARM 7), the core enters IRQ mode to handle the interrupt. 31 200417216 As soon as an SIRQ occurs, the core enters monitoring mode to store non-secure content, and then enters a security IRQ manager to handle the security interrupt. When in a security context, if m-SIRQ occurs, the kernel enters the security IRQ manager. The core does not exit the security context. # An IRQ occurs, the core enters the monitoring mode for storing security content ’and then enters a non-secure IRQ manager to handle the non-security interrupt. In addition, when the interruption that does not belong to the current situation occurs, the core directly enters the monitoring mode, otherwise it stays in the current situation (please refer to Figure 10). Full-sex 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_mo and SPSR_mon, making IRQ / FIQ invalid. 3. The monitoring manager (program) performs the following tasks: • Sets the S bit. • Store at least R14-mon and SPSR-mon in the stack (you can also enter other logins), so that when the security application is executed, ’32 200417216 will not lose the 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 be started in a secure user mode. IRQ / FIQ is then enabled again.

4·當安全性執行緒1執行時、一 IRQ發生。該核心直 接跳入監控模式(專屬向量)和在監控模式中的SPSR_ _mon 之R14一mon和CPSR儲存現有Pc,(而後使IRq/FIq失效)。 5 ·必須儲存安全性内容,還原先前的非安全性内容。 監控管理器必預進入IRQ模式,以適當值更新 R14一irq/SPSR—irq,而後將控制交給非安全性irq管理器。 6· IRQ管理器提供IRQ服務,而後將控制交回給在非 安全性情境中的執行緒1。藉由還原SPRS」rq和R14_irq 為CPSR和PC,現下執行緒1已經指向已被中斷的SMI 指令。4. When security thread 1 executes, an IRQ occurs. The core directly jumps into the monitoring mode (exclusive vector) and SP14_mon in the monitoring mode, R14-mon and CPSR store the existing Pc (then invalidate 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 the appropriate value, and then transfer 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 '' rq and R14_irq to CPSR and PC, thread 1 has now pointed to the interrupted SMI instruction.

7· SMI指令被再次執行(與2相同之指令)。 8·監控管理器察覺先前已中斷之執行緒,並將該執行 緒1内容還原,而後其在使用者模式中發展出安全性執行 緒1,指向該已經中斷的指令。 9 ·安全性執行緒1執行至其完成而止,而後在監控模 式(專屬於SMI)中發展出「自安全性返回」功能。 1 0 ·該「自安全性返回」功能進行下列任務:7. The SMI instruction is executed again (same instruction as 2). 8. The monitoring manager detects the previously interrupted thread and restores the content of this thread 1. Then it develops security thread 1 in the user mode to point to the interrupted instruction. 9 • Security thread 1 executes until its completion, and then develops the “self-return to security” function in monitoring mode (exclusive to SMI). 1 0 · The "Self-Return" function performs the following tasks:

•指不安全性執彳于緒1已元成(例如,在一執行緒ID 33 200417216 表的情況下,自該表移除執行緒1)。 φ自堆疊非安全性内容還原並清除需要的登錄,以使 一旦返回非安全性情境無法讀取任何安全性資料。 φ 以一 SUBS指令回到非安全性情境,(自被還原的 R14 —m〇n)還原 PC 和(從 SPSR_mon)還原 CPSR。那 麼’在非安全性情境中的返回點應該是在執行緒1 中先前執行的SMI之後的指令。• Refers to the unsafe execution of thread 1 (for example, in the case of a thread ID 33 200417216 table, thread 1 is removed from the table). φ Restores and clears the required logins from the stack of non-security content, so that once the non-security context is returned, no security data can be read. φ Return to the non-safety situation with a SUBS instruction, (from the restored R14 — mON) to restore the PC and (from SPSR_mon) to restore the CPSR. Then the return point in the non-safety context should be the instruction following the previously executed SMI in thread 1.

11 ·執行緒1執行至結束,而後交回控制給排程。11 · Thread 1 executes to the end, and then returns control to the schedule.

在―非安情培發4之SIRQ 凊參考第11B圖: 1 ·排程發動執行緒1。 2·當安全性執行緒1執行時,一 SIRQ發生。核心直 接跳至監控模式(專屬向量)並在監控模式中SPSR_mon的 R14一mon和CPSR儲存現有的Pc ’而後使irq/fiq失效。 3 ·非安全性内容必須被儲存,而後核心進入安全性 IRQ管理器。 4.該IRQ管理器提供sirq服務,而後以適當參數用 一 SMI將控制交回給監控模式管理器。 5·該監控管理器還原非安全性内容,因此一 suBS指 令使核心回到非安全性情境並重新繼續中斷的執行緒1。 6 ·執行執行緒1直到結束,而後將控制交回給排程。 第11 A圖的機制具有提供進入安全性情境的一種決定 性方法的優點。然而,有一些問題與中斷優先權相關:例 34 200417216 如,當一 SIRQ在安全性中斷管理器中執行時,可能發生 一具有較高優先權的一非安全性 IRQ。一旦該非安全性 IRQ完成,有需要再次產生S IRQ事件,該核心才能夠重 新繼續該安全性中斷。 解決方案二 在該機制中(請參考第12圖)兩種不同或僅一種的腳 位(pin)可以支援安全性以及非安全性中斷。使用兩種腳位 以減少中斷等待時間。 當在非安全性情境中,如果 • 一 IRQ發生,核心進入IRQ模式,以處理該中斷, 如同在ARM7系統中。 • 一 SIRQ發生,核心進入IRQ管理器,其中一 SMI 指令將使該核心發展出監控模式以儲存非安全性 内容,而後發展出一安全性IRQ管理器,以管理 該安全性中斷。 當在一安全性情境中,如果 • 一 SIRQ發生,核心進入安全性IRQ管理器。該核 心不退出該安全性情境。 • 一 IRQ發生,核心進入安全性IRQ管理器,其中 一 SMI指令將使該核心發展出監控模式(安全性内 容所儲存處),而後進入一非安全性IRQ管理器以 處理該非安全性中斷。 35 200417216 在安全性情境發生之IRQ 請參考第13A圖: 1 ·排程發動執行緒1。 2 ·執行緒1需要執行一安全性功能==〉μ I安全性呼· 叫,核心進入監控模式。目前PC和CPSR被儲存在R1 4一mo η 和 SPSR—mon,使 IRQ/FIQ 失效 3 ·監控管理器進行下列任務: • 設置S位元。 • 在一堆疊中儲存至少R1 4—mon和SPSR_mon(其他 登錄亦然),因此在安全性應用執行時,如果一異 常發生才不致於失去非安全性内容。 • 檢查是否有一新執行緒要發動:安全性執行緒1。 一機制(藉由執行緒ID表)指示執行緒1在該安全 性情境中是啟用的。 • 安全性應用此時能夠以安全性使用者模式起始。 IRQ/FIQ再次啟用。 4 ·當安全性執行緒1執行時、一 IR Q發生。核心直接 跳至安全性IRQ模式。 5.核心儲存現有PC在R14一irq和SPSR —irq在CPSR。 IRQ管理器偵測其為非安全性中斷並以適當參數執行一 SMI以進入監控模式。 6 ·必須倚存安全性内容,還原先前的非安全性内谷。 監控管理器藉由讀取該CPSR知道SMI來自何處。其也能 36 200417216 夠進入IRQ模式讀取R14一IRQ/SPSR一irq,以適當地儲存安 全性内容。其也能夠在這些相同的登錄中儲存一旦完成該 IRQ例式必須還原的非安全性内容。 7· IRQ g理器提供irq服務,而後在該非安全性情境 中將控制交回給執行緒1。藉由還原SPRS_irq和R14」rq 至CPSR和PC ’現下核心指向已經中斷的smi指令。 8·再次執行SMI指令(如2之相同指令)。Refer to Figure 11B for the SIRQ of “Non-safety training 4”: 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 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 thread1. 6 Execute thread 1 until the end, and then return control to the schedule. The mechanism of Figure 11 A has the advantage of providing a decisive approach to entering a security context. However, there are some issues related to interrupt priority: Example 34 200417216 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 complete, the S IRQ event needs to be generated again before 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 interrupt. 35 200417216 The IRQ occurred in the security situation, please refer to Figure 13A: 1 Schedule the execution of thread 1. 2 · Thread 1 needs to perform a security function ==> μ I security call · The core enters the monitoring mode. Currently, the PC and CPSR are stored in R1 4a and SPSR_mon to disable IRQ / FIQ. 3 · The monitoring manager performs the following tasks: • Sets the S bit. • Store at least R1 4-mon and SPSR_mon (and other logins) in a stack, so if an abnormality occurs during the execution of the 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 start in a security consumer mode. IRQ / FIQ is enabled again. 4 · When security thread 1 executes, an IR Q 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 · We must rely on security content to restore the previous non-security inner valley. The monitoring manager knows where the SMI comes from by reading the CPSR. It can also enter the IRQ mode to read R14-IRQ / SPSR-irq in order 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 processor provides the irq service and then returns control to thread 1 in this non-security context. By restoring SPRS_irq and R14 "rq to CPSR and PC ', the current core points to the smi instruction that has been interrupted. 8. Execute the SMI instruction again (such as the same instruction in 2).

9.監控管理器察覺先前中斷的該執行緒,並把該執行 緒1狀況還原。而後其在使用者模式中發展出安全性執行 緒1,指向已經中斷的指令。 10·安全性執行緒1執行到其完成,而後發展出「自 安全性返回」;在監控模式(屬專於SMI)中的功能。 11· 「自安全性返回」功能進行下列任務: #指示安全性執行緒1已完成(即,在一執行緒ID表 的情況下,自該表移除執行緒1)。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. 10. Security Thread 1 executes to completion, and then develops "Self-Return"; a function in the monitoring mode (specialized in SMI). 11. 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).

• 從堆疊非安全性内容還原和清除所需要的登錄,因 此一旦吾人返回非安全性情境,不能夠讀取任何安 全性資訊。 籲以一 SUBS指令發展回到非安全性情境,(從 SPSR一mon)還原 PC 和(從 SPSR一mon)還原 CPSR 〇 在非安全性情境中的返回點應該是在執行緒丨中 先前執行的SMI之後的指令。 1 2 ·執行緒1執行直到結束,而後交回給排程接手。 37 200417216 性情境發蜂的SIRO 請參考第13B圖: 1 ·排程發動執行緒1。 2·當安全性執行緒1執行時,—SIRq發生。 3·核心直接跳至irq模式,和儲存現有pc在R14 — irq 及儲存CPSR在SPSR — irq。之後使IRq失效。IRq管理器 偵測其係一 SIRQ並一以適當參數執行一 smi指令。• 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. Call for the development of 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 previously executed in the thread. Instructions after SMI. 1 2 · Thread 1 executes until the end, and then returns to the schedule to take over. 37 200417216 SIRO with bee situation Please refer to Figure 13B: 1 Schedule the thread 1 to start. 2. When security thread 1 executes, -SIRq occurs. 3. The core directly jumps to irq mode, and stores the current pc in R14 — irq and stores the CPSR in SPSR — irq. IRq is then disabled. The IRq manager detects that it is a SIRQ and executes an smi instruction with the appropriate parameters.

4 · 一旦在監控模式中,必須儲存非安全性内容,而後 核心進入安全性IRQ管理器。 5·安全性IRQ管理器提供SIRQ服務例式服務, 而後 以具有適當參數的SMI把控制交回給監控。 6·監控官理器還原非安全性内容,因此一 suBg# _ 使核心回到非安全性情境和重新繼續中斷的IRq管 9 7 '^器 此時IRQ管理器可藉由執行一 SUBS回到非〜 。 女全 執行緒 性 8·執行緒1執行到結束,而後把控制交回給排程4 · Once in monitoring mode, non-security content must be stored, and then the kernel enters the security IRQ manager. 5. Security IRQ manager provides SIRQ service example service, and then returns control to monitoring with SMI with appropriate parameters. 6. The monitoring manager restores the non-security content, so a suBg # _ returns the core to the non-safety situation and resumes the interrupted IRq tube 9 7 '^ At this time, the IRQ manager can return by executing a SUBS Not ~. Women's full thread Sex 8. Thread 1 executes to the end, then returns control to the schedule

參考第12圖的機制,不需要在許多中斷的情况 產生SIRQ事件,但是不保證一定執行安全性中斷< 異常向量 它們 情境 安全 至少保留兩實體向量表(雖然自一虛擬位址來看, 看似一單一向量表)一供非安全性記憶體的非安全性 之用,一供安全性記憶體的安全性情境之用(不可自作 38 200417216 性情境存取)。用於安全性 體記憶體映射,有:地二,全性情境之不同虛擬至實 實體纪伊體中J 同的虛擬記憶體位址存取在 匕愿脰τ儲存的不同向詈 表° Jli控模式總是使用純粹 的§己憶體映射以在管·體紀,障辦& 隹貫體0己隱體中提供一第三向量表。 如果該些中斷依照第12圖的機制,對每一表格就會有 如第14圖所*之下列向量。該向量集在安全性和非安全性 記憶體是重複的。 異常 向量偏移值 ----- 見見麥式 重設(Reset) 0x00 式(s位元組) 未定義(Undef) 0x04 裏式/未定義(Undef)模式 SWI 0x08 式/監控模式 預取中止 OxOC 中止模式(abort mode) (Prefetch Abort) 資料中止 0x10 中止模式(abort mode) (Data Abort) IRQ/SIRQ 0x18 IRQ模式 FIQ OxlX FIQ模式 SMI 0x20 未定義(Undef)模式/監控模式Referring to the mechanism in Figure 12, SIRQ events do not need to be generated in many interrupt situations, but security interrupts are not guaranteed to be executed. Exception vectors They are safe in the context and retain at least two entity vector tables (although from a virtual address, see (Like a single vector table)-one for the non-security of non-secure memory, and one for the security context of secure memory (not self-access 38 200417216 sexual context access). Used for security body memory mapping, there are: Second, different virtual-to-physical scenarios in the real-world scenario. The same virtual memory address is accessed in different directions stored in the memory. Jli control The model always uses pure § self-memory mapping to provide a third vector table in the management discipline, obstacles & If the interrupts follow the mechanism of Figure 12, for each table there will be the following vectors as shown in Figure 14. This vector set is duplicated in safety and non-security memory. Exception vector offset value-see Reset Type 0x00 (s-byte) Undef 0x04 Chinese / Undef mode SWI 0x08 Pre / fetch mode OxOC Abort mode (Prefetch Abort) Data abort 0x10 Abort mode (Data Abort) IRQ / SIRQ 0x18 IRQ mode FIQ OxlX FIQ mode SMI 0x20 Undef mode / monitor mode

Reset(重設)進入只存在於安全性向量表中。當一 Reset 在非安全性情境中執行時,核心硬體促使進入監督模式和 設定S位元,從而在安全性記憶體中才能存取該Reset向 量0 39 200417216 第1 5圖圖示分別應用於一 文生性槟式、一非安全性 式和監控模式的三個異常向量表。h、+、w # 庄相 .^ 迷異常向量表用里鳴 向1設計,以符合安全性和非安 、’ Η 非*全性作業系統的需要和半 性。母一異常向直表都可以在epi5中 'Reset entry exists only in the security vector table. When a Reset is executed in a non-safety context, the core hardware prompts it to enter the supervisor mode and set the S bit, so that the Reset vector can be accessed in the security memory. 0 39 200417216 Figure 15 Three anomalous vector tables for epistemic Penang, non-safety, and monitoring modes. h, +, w # Zhuang Xiang. ^ The fan anomaly vector table is designed with Li Ming to 1, in order to meet the requirements of security and non-safety, Η 、 non- * full-scale operating systems and semi-permanent. Both mother and anomaly can be listed in epi5 ''

* β “ 具有一相關的向J 表基礎位址登錄,又該CP 1 5在今掩触 ^ 在圯憶體之内儲存指向 的一基礎位址。當一異常發生蚌 秦 時硬體將參考與系統的目 别狀態對應之該向量表基礎位址登錄,以決定所 :* β "has a related registration to the base address of the J table, and the CP 1 5 is now hidden ^ stores a base address pointed to in the memory body. When an abnormality occurs, the hardware will refer to The base address of the vector table corresponding to the system's target state is registered to determine all:

量表基礎位址。選擇性地,應、用於不同模式之不同虛擬: 實體記憶體映射,可用以區別储存在不同實體記憶 之二個不同向量表。如第16圖所示,在與處理器核 的-系統(設冑控制)輔助處理器(CP15)中提供異常 罩。該異常捕捉遮罩登錄提供與各自異常類型相關的旗 標。該些旗標指示硬體是否應該為在其現有網域中相關的 異常而操作指導進行至向量,或應該促成轉換至監控模式 (其為一種安全性模式型態)而後依照在監控模式向量表中 的向量。異常捕捉遮罩登錄(異常控制登錄)只在監控模式 可寫入。在一非安全性模式中時,讀取存取亦可由異常捕Scale base address. Optionally, different virtual: physical memory mappings that should be used in different modes can be used to distinguish between two different vector tables stored in different physical memories. As shown in Fig. 16, an exception mask is provided in the -system (setting control) auxiliary processor (CP15) with the processor core. The exception capture mask registration provides flags related to the respective exception type. These flags indicate whether the hardware should proceed to the vector for anomalies related to its existing domain, or should facilitate a transition to monitoring mode (which is a security mode type) and then follow the table in the monitoring mode vector In vector. The error capture mask registration (error control registration) can be written only in the monitor mode. Read access can also be caught by exceptions in a non-secure mode

捉遮罩登錄所防止。由此可見,第1 6圖的異常捕捉遮罩登 錄不包括一重没向量的旗標,當該系統不被設定為總是如 同在安全性向量表所設定般,強迫其跳至安全性監督模式 中的該重a又向量,以保證一安全性開機和反向相容性。由 此可見’在第1 5圖中,為了完整性,重設向量已經出現於 該向量表,而非安全性監督模式安全性向量表。 第16圖亦_示異常捕捉遮罩登錄之中的不同異常類 40 200417216 型的旗標是可設計的,例如在安全性開機期間藉由監控程 式為之。選擇性地,一些或某些旗標若能在某些實施中由 實體輸入信號所提供,例如安全性中斷旗標S IRQ可以被 硬接為總是促使進入監控模式及執行對應的監控模式安全 性中斷請求向量,當接收到一安全性中斷信號時。第16 圖圖示,只有異常捕捉登錄的部分與非安全性網域異常相 關,可程式位元的一類似部分將被提供給安全性網域異常。 吾人可以自上文了解,在一層級中,硬體依據該些異 常控制登錄旗標,促使現有網域異常管理器或監控模式異 常管理器提供一中斷,其僅為所應用的第一層級控制。舉 一示例,亦可能有一異常發生在安全性模式中,而該安全 性模式異常向量係依照安全性模式異常管理器,但此時該 安全性模式異常管理器由該異常的本質決定其由非安全性 異常管理器來處理會比較好,及因此利用一 SMI指令以轉 換至非安全性模式並請求非安全性異常管理器。亦有可能 有一轉換,其中硬體可進行非安全性異常管理器的起始, 但之後它執行把程序導引至安全性異常管理器或監控模式 異常管理器的指令。 第1 7圖是一流程圖,圖示之系統操作能支援與一新類 型異常相關的另一可能類型轉換請求。在第9 8步驟中,硬 體偵測意圖改變至監控模式之指令,當其在一現有程式狀 態登錄(CPSR)中指示時。當偵測得此類意圖時,則觸發一 新類型異常,它在這裡稱作CPSR違反異常。在第100步 驟,該CPSR違反異常的產生,導致對在監控模式之内之 41 200417216 一適當異常向量進行參照’而監控程式係在第i 02步驟執 行,以處理該CPSR違反異常。 吾人將了解,除了支援先前所討論過的SMI指令外可 能提供如第1 7圖相關討論之在安全性網域和非安全性網 域之間起始一轉換的機制。可以提供異常機制以回應未經 授權之欲轉換模式的意圖,而所有經授權的意圖都應該藉 由一 SMI指令進行。選擇性地,此類機制也許是在安全性 網域和非安全性網域之間轉換的合法方法或可提供以賦予 反向相容性,其具有(例如,可能企圖清除處理狀態登錄的) 既除程式碼,即使並非真的在安全性網域和非安全性網域 之間從事未經授權之轉換意圖。 如上所述, 會令中斷失效。之所以如此’是為了增進系統的安全性。 當一中斷發生時,該時刻處理器的狀態被儲存在中斷異常 登錄中,因此當中斷功能完成時,可以在中斷點重新繼續 被中斷的功能之處理。#果在監控模式中允許該處理,其 可能降低監控模式的安全性,可能造成安全性資料茂漏2 路徑。因此,通常會令中斷在監控模式中失效。然而,在 監控模式期間令中斷失效的結果丨,増加了中斷等 間。 5 如果處理器執行功能的狀 模式中允許中斷。其只能在一 續時進行。因此,藉由在監控 啟動之功能的中斷,可以解決 態未儲存,亦有可能在監控 中斷之後,該功能未重新繼 模式中只允許能安全地重新 在監控模式下之中斷等待時 42 200417216 間的問題。在這種情況下,在監控模式中一中斷之後,一 旦完成該中斷,相關於該功能之處理的資料未被儲存,並 被拋棄且指示處理器自它的開始處開始處理它的起始功 能。在上述示例中,當處理器只是返回轉換至監控模式之 點時,它只是一件簡單的事情。應該注意的是,重新開始 一功能只對某些可以重新開始且仍然產生可重複性結果的 功能有可能。如果該功能改變該處理器之狀態,在重新開 始它時會產生一不同結果,則重新開始功能並不是個好主 意。因此,只有能安全地重新開始的那些功能能夠在監控 模式中中斷,對於其他功能而言,則使該些中斷失效。 第1 8圖圖示依據本發明的一實施例,處理發生在監控 模式的中斷的一種方法。在一非安全性模式中,一 SMI發 生在任務A的處理期間,而其將處理器轉換至監控模式。 該SMI指令使核心藉由專屬的非安全性SMI向量進入監控 模式。PC的現有狀態被儲存,S位元被設置且令中斷失效。 通常,用LR_mon和SPSR—mon來儲存非安全性模式的PC 和 CPSR 〇 而後在監控模式中起始一功能-功能C。功能C所進行 之第一件事,是啟用該些中斷,而後功能C被處理。如果 中斷在功能C的處理期間發生,則不使該些中斷失效,以 接受和執行該中斷。然而,監控模式指標對處理器指示, 在一中斷之後,不重新繼續該功能,亦不重新起動。選擇 性地,可藉由控制參數分別指示處理器。因此,在一中斷 之後,以LR-mon及SPSR_mon值更新該些中斷異常向量 43 200417216 而不儲存處理器的現有狀態。 如第18圖所示,在中斷任務-任務B完成之後,處 器讀取已經拷貝到中斷登錄的SMI指令的位址,及執行 sMl和再次開始處理功能C。 上述處理只作用於功能C是可以重新開始的時候, 即如果重新開始處理C將產生可重複的處理步驟。這並 是說,功能C改變了處理器的任何狀態,例如堆疊指標 能影響它將來的處理。在此,一稱作可重複的功能是因 具有冪等(idempotence)。處理一功能之該問題之一方法 重新安排定義該功能之程式碼,在該方法中,該程式碼 第—部分具有冪等,一旦不再有可能安排具有冪等的程 碼時’令中斷失效。例如,如果程式碼C牽涉到寫入堆曼 那麼至少一開始它有可能這麼做而無需更新該堆疊指標 旦決定該程式碼不再能夠安全地重新開始,則功能C 程式碼能夠指示該處理器令中斷失效,而後其能夠對正 的位置更新堆疊指標。如第1 8圖所示,其中經由於功能 的處理,以某種方法令中斷失效。 第1 9圖圖示一輕微地不同的示例。在該示例中,藉 任務C處理的某種方法,設定了一進一步的控制參數。 指不任務C的下列部分並非嚴格的冪等,但是,能夠被 全地重新開始’確保一改進的例式先被執行。該改進的 式使處理器的狀態還原為在任務C的一開始時的樣子, 任務結束時,如果它不被中斷,當它已經完成時,使任 c能夠安全地重新開始並產生安全的處理器狀態。在一 理 意 不 可 為 係 之 式 〇 的 確 C 由 它 安 例 在 務 些 44 200417216 實施例中,在進一步的控制參數被設定的點,當處理器 一些狀態被修正(例如,更新堆疊指標),可以令中斷失 一段短期的時間。如此允許該處理器稍後被還原至一冪 狀態。 當一中斷在進一步的控制參數被設定之後發生時, 有兩種可能的處理方法。不是能夠立即(在F 1)執行而後 處理中斷的改進例式,就是能夠立即處理中斷並在稍後 成中斷,執行SMI而後在重新開始任務C之前,執行該 進的例式(在F2)。如所示者,在上述二實施例中,在監 模式中執行該改進的例式,並因此在非安全性網域中的 行(其不知道安全性網域或監控模式)並不受到影響。 如第19圖所示,程式碼C之一第一部分具有冪等 能夠在一中斷之後重新開始。一第二部分可重新開始, 保首先執行一改進的例式。而其藉由設定一「進一步」 制參數來指示,而程式碼之一最後部分不能被重新開始 並因此在處理程式碼之前,中斷是失效的。 第20圖圖示一選擇性示例,在這種情況下,其相異 其他實施例,中斷在監控模式期間是啟用的。而後在監 模式中執行的功能令中斷失效,一旦它們不再能夠被安 地重新開始。其只在監控模式中所有被中斷的功能能被 新開始而非能重新繼續時有可能。 有一些方法,能夠確保所有在某一模式下執行之 能,而非在中斷時重新繼續。一種方法是藉由增加新的 理器狀態,其中中斷儲存指令序列的開始位址,而非中 的 效 等 則 可 完 改 控 執 且 確 控 , 於 控 全 重 功 處 斷 45 200417216 的指令的位址。在這種情況下,總是在該狀態下執行監控 模式。一選擇性的方法是藉由在每一功能開始時,預載入 在一功能的開始位址至中斷異常登錄,並在中斷之後使處 理器狀態其後的寫入失效,以中斷異常登錄。 如第20圖所示之實施例,如果要求功能可以安全地重 新開始,功能之重新開始可以在中斷功能結束之後立即完 成,或在一改進的例式之後完成。 雖然就一具有安全性、非安全性網域和一監控模式之 系統而論,上文已經描述了處理中斷等待時間的方法,但 可以明白,其能應用於有功能由於一特定原因而不應該重 新繼續的任何系統。通常此類功能可藉由使增加中斷等待 時間的中斷失效而作用。在一中斷之後,改正功能為可重 新開始和控制該處理器以重新起動他們,為了功能處理的 至少一部份,允許啟用該些中斷及幫助減少中斷等待時 間。例如一作業系統的一般内容轉換。 存取安全性和非安全性記憶體 如第一圖所示之資料處理設備具有記憶體,其當中包 括TCM 36、快取38、ROM 44、受控裝置的記憶體和外 部記憶體5 6。如第3 7圖所示,例如,記憶體被分割為安 全性和非安全性記憶體。吾人將了解,在製造時,在記憶 體的安全性記憶體區域和非安全性記憶體區域之間通常沒 有任何實際區別,但反而由資料處理設備的一安全性作業 系統定義該些區域,當在該安全性網域作業時。因此,記 46 200417216 憶體裝置的任何實體八 ^ ^ ^ 邛刀,可以被分配為安全性記憶體, 而任何實體部分可扯八 刀配為非安全性記憶體。 如第2圖至筮 圖所示,處理系統具有一安全性網域 和一非安全性網域。 在該安全性網域中,提供一安全性核 〜程式80,苴以—6人 Α _ 女性模式執行。提供一監控程式7 2, 其涵蓋安全性和 性、.周域,以及其至少一部分以一監 徑模式執竹"。:士欲 ,^ . v *月的實施例中,監控程式部分以監控 — 王性模式執行。如第1 0圖所示,有多種 女全性模式,盆中白杠 八甲包括、一監督模式SVC。Dreamcatcher mask is prevented. It can be seen that the exception capture mask registration in Fig. 16 does not include a flag of a no-vector. When the system is not set to always be the same as that set in the security vector table, it is forced to jump to the security supervision mode. The weight a in the vector is to ensure a secure boot and backward compatibility. It can be seen that 'in Figure 15 for the sake of completeness, the reset vector has appeared in the vector table instead of the security vector table of the security supervision mode. Figure 16 also shows the different types of exceptions in the exception capture mask registration. 40 200417216 type flags 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 S IRQ can be hard-wired to always cause the monitor mode to be entered and the corresponding monitor mode to be implemented. Interrupt request vector when a security interrupt signal is received. Figure 16 shows that only the part of the exception capture registration is related to the non-security domain exception, and a similar part of the programmable bit will be provided to the security 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. Figure 17 is a flowchart showing the operation of the system to support another possible type of conversion request related to a new type of exception. In step 98, the hardware detects an instruction to change to the monitoring mode when it is instructed in an existing program status register (CPSR). When such an intent is detected, a new type of exception is triggered, which is referred to herein as a CPSR violation exception. At step 100, the CPSR violation exception is generated, causing a reference to an appropriate exception vector within the monitoring mode 41 200417216, and the monitor program is executed at step 02 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 legitimate method of transitioning between a secure domain and a non-secure domain, or it may be provided to give backward compatibility, which has (for example, an attempt to clear a processing status login) Eliminate the code, even if it ’s not really an unauthorized conversion intent between a secure domain and a non-secure domain. As mentioned above, interrupts are disabled. 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 security data to leak 2 paths. Therefore, interrupts are usually disabled in monitor mode. However, as a result of invalidating the interrupt during the monitoring mode, the interrupt interval is increased. 5 If the processor is executing functions in interrupt mode, interrupts are enabled. It can only be done on a continuous basis. Therefore, by interrupting the function of monitoring startup, the state can not be resolved. It is also possible that after the monitoring interruption, the function does not resume in the mode. Only the interruption waiting in the monitoring mode can be safely resumed. The problem. 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 produces a different result when it is restarted, 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. Fig. 18 illustrates a method for handling an interrupt occurring in a monitor mode according to an embodiment of the present invention. In a non-security mode, an SMI occurs during the processing of task A, and it switches the processor to the monitoring mode. The SMI instruction enables the core to enter the monitoring mode through a dedicated non-safe SMI vector. The current state of the PC is stored, the S bit is set and the interrupt is disabled. Generally, LR_mon and SPSR_mon are used to store the PC and CPSR in non-security mode. Then a function-function C is started in the monitoring mode. The first thing 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 interrupt. However, the monitoring mode indicator indicates to the processor that after an interruption, the function is not resumed or restarted. Optionally, the processors can be individually instructed by control parameters. Therefore, after an interrupt, the interrupt exception vectors 43 200417216 are updated with the LR-mon and SPSR_mon values without storing the current state of the processor. As shown in Figure 18, after the interrupt task-task B is completed, the processor reads the address of the SMI instruction that has been copied to the interrupt registration, executes sMl, and starts processing function C again. The above processing only works when function C can be restarted, that is, if process C is restarted, repeatable processing steps will be generated. This does not mean that function C changes any state of the processor, for example, stacking indicators can affect future processing. Here, a function called repeatable is due to idempotence. One way to deal with the problem of a function is to rearrange the code that defines the function. In this method, the part of the code has idempotent. Once it is no longer possible to arrange a idempotent program code, the interrupt is invalidated . For example, if the code C involves writing to the heap, then it is possible to do so at least initially without updating the stack indicator. Once it is determined that the code can no longer be safely restarted, the function C code can instruct the processor Disable the interrupt, and then it can update the stacking index at the correct position. As shown in Figure 18, the interruption is disabled in some way by processing the function. Figure 19 illustrates a slightly different example. In this example, a further control parameter is set by some method of task C processing. The following part of the task C is not strictly idempotent, but can be completely restarted 'to ensure that an improved routine is executed first. This improved formula 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 allows any c to safely restart and generate secure processing. Device status. In a sense that ca n’t be solved, the formula is indeed C. In the example of 2004 200417216, at the point where further control parameters are set, when some state of the processor is modified (for example, updating the stack index), The interruption can be lost for a short period of time. This allows the processor to be restored to a power state later. When an interruption occurs after further control parameters are set, there are two possible processing methods. Either an improved routine that can execute immediately (at F 1) and then process the interrupt, or an interrupt that can be processed immediately and then interrupted later, execute SMI, and then execute this progress 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 line in the non-security domain (which does not know the security domain or monitoring mode) is not affected . As shown in Figure 19, the first part of one of the codes C has idempotence and can be restarted after an interruption. A second part can be restarted, ensuring that a modified example is performed first. And it is indicated by setting a "further" system parameter, and the last part of the code cannot be restarted and therefore the interrupt is invalidated before the code is processed. Figure 20 illustrates an alternative example, in which case it is different. In other embodiments, interrupts are enabled during monitor mode. Functions then executed in the supervisor mode disable the interrupts once they can no longer be safely restarted. It is possible only when all interrupted functions in the monitoring mode can be restarted rather than resumed. There are ways to ensure that everything works in a certain mode, rather than resume on interruption. One method is to add a new state of the processor, in which the start address of the interrupted storage instruction sequence, instead of the effect, can be completely changed and controlled, and the control of the full execution of 45 200417216 will be executed. Address. 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. 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 practical difference between the secure memory area and the non-secure memory area, but instead these areas are defined by a security operating system of the data processing equipment. When operating on this security domain. Therefore, any physical eight ^ ^ ^ knife of the memory device of 2004 4617216 can be allocated as secure memory, and any physical part can be detached as a non-secure memory. As shown in Figures 2 to 筮, the processing system has a secure domain and a non-secure domain. In the security domain, a security kernel ~ program 80 is provided and executed in a -6 female mode. A monitoring program 7 2 is provided, which covers security and safety, .periphery, and at least a part of which is implemented in a monitoring mode. : Shi Yu, ^. V * In the embodiment, the monitoring program part is executed in the monitoring-king mode. As shown in Figure 10, there are multiple female holistic models. The white bars in the basin and the eighth include the supervised mode SVC.

監控程式72負眚妈神产―人liL 、貝&理在女全性和非安全性網域之間 任一方向的所有改變。 參照第8圖和第9圖在章節「處理 器換式」中描述了 一此fAA丄Afc 二匕的功月b。該監控程式負責在非安 全性模式中所發屮Μ _ π i Μ … 、一模式轉換請求s ΜI,以初始化自上 :非文全&模式到上述安全性模式的一轉換,卩及負責在 女全1±模式中所發出的一模式轉換請纟讀,以初始化自 述女全|±孝果式到上述非安全性模式的一轉換。如章節「情 境間的轉換」所述,名#缺 在息控板式中,轉換的發生係自安全 性和非安全性網域中 — 之一轉換至少一些登錄至其他者。如 此涉及储存在一網域中存在的-登錄狀態和在其他網域寫 入-新狀態至登錄(或在登錄中還原以前儲存的狀態小本 文亦論及,當執行此一隸拖日车,姐甘tL ★ J 一 轉捵時,對某些登錄的存取可能會 失效。較佳的實施例是,令監 ^ 7廉授模式中所有中斷都失效。 因為監控程式所執杆的批 矾仃的皿控杈式涵蓋安全性以及非安The monitoring program 72 is responsible for all changes in either direction between the women's holistic and non-safe domains. Refer to Figure 8 and Figure 9 in the chapter "Processor Transformation" for the fAA 丄 Afc work month b. The monitoring program is responsible for transmitting Μ _ π i Μ in a non-security mode, a mode conversion request s MI to initialize a conversion from top: non-textual & mode to the above security mode, and is responsible Please read a mode transition issued in the women ’s 1 ± mode to initialize the self-reporting of women ’s || filial piety to the above non-safety mode. As described in the section "Conversions Between Contexts", the name #lack In the interest-control panel type, the conversion occurs from one of the secure and non-secure domains—the conversion of at least some of them to the other. This involves storing the existing login status in one domain and writing the new status to the login in other domains (or restoring the previously stored status in the login. This article also discusses that when this is implemented, Sister Gan tL ★ As soon as J is turned on, access to some logins may be invalidated. The preferred embodiment is to disable all interrupts in the supervisory mode of low-cost grants.仃 The control of the dish covers security and non-security

全性網域,所以證實為容今的A 1馮女王的監控程式是很重要的··即只 47 200417216 =署欲部署之功能。因此如果監控程式愈簡單愈有利。安 王性模式只允許在安全性網域中 τ钒仃転序。在本發明的實 歹1 ,權限文全性模式和監控模式允許存取相同的安全 ^和非安全性記憶體。藉由確保該權限安全性模式「看見」 相同的安全性和非安全性印掊 '己隐體,把僅能在監控模式中執 :的:能轉換至允許簡化的監控程式之安全性模式。此 至…",女王吐模式中操作的-處理直接轉換 至監控模纟’反之亦然。自一權限安全性模式至監… 的轉換是允料’而在監控模式中可以轉換至非安二 付佚主非女全性網 非權限安全性模式必須使用SMI,以進入監控 2重設之後’Λ统進入權限安全性模式。在網域之間移 ’,進盯在&控模式和權限安全性模式之間來回 有助於儲存狀態。 轉換 在其他實施例中,允許自安全性權限模式中以及“ =式中存取S旗標。如果允許安全性權限模 : 式流程的控制日夺,將處理器轉換到監控模式,則此類2 性權限模式已經具有轉換S旗標(位元)的有效妒 此’規定只能狗在監控模式中改變s旗標的額外‘雜性因 能證實為正確的。反之,能夠藉由與其他設定旗標相同: 方法儲存,又該些其他設定旗標可以由问的 安全性權限模式所改變。本技術包括在多數安全性2的 式之一中改變S旗標的此類實施例。 '^杈 回到先刚討論的示例性實施例,設備具有定義 定義模式的權限層級的—處理器核心10;即,任何棋2 48 200417216 許的功能集。因此,以習知方法安排處理 全性模式和監控模式存取安全性和非安全性核心以允許安 全性模式存取監控模式允許存取的所有 隐體,及安 任何權限安全性模式中所操作的處理 ' ϋ允_在 44 4Α 7Τ ΚΑ 式’反之亦然。處理器核心10之較佳 、皿控才莫 述。 *排所允許者如下所 在本設備的一示例中,記憶體被分苟、 以及非安全性記憶體,而安全性和非安全:、、、安全性纪憶體 僅能在監控和安全性模式中存取。較 14 5己憶體二者皆 卞人的實包 、 全性記憶體在監控模式、安全性模 列為,#安 存取。 、…非安全性模式中矸 …拒…性…非安全:二::::Π 非安全1*生模式中拒絕安全性和監控 供式存取非安 體。因此,僅允許在監控和安 女全丨生託 『生拉式中存取 體,以及僅能藉由增進安全性夕非h 文王性Θ 王ί·生之非安全性模式存 性記憶體。 、讦取非> 設或開機可以在視為需要 權限之監控模式中執行。 為允許在安全性模式和監 女王性模式中提供重設及 本設備的示例中,設備·的重 比一安全性模式、權限模式更古 然而,在設備的許多示例中,g 控模式之間直接轉換,安排t _ 開機是有可能的。 ”二|王網域、和在一安全 安全性核心80(或作業系統 月匕,和一或多數 49 200417216 應用程式82、84可以在安全性核心80中執行。允許該安 全性核心和/或安全性應用程式或在一安全性模式中執行 的任何其他程式碼存取安全性和非安全性記憶體兩者。 雖然以具有處理器的設備描述本發明之示例,本發明 可以由一電腦程式所部署,當在合適的處理器上執行時, 該電腦程式以如本章節所述之操作設定該處理器。The full network domain, so it is important to confirm that the monitoring program of Queen A 1 Feng of Rong Jin is only 47 200417216 = the function that the department wants to deploy. So it's more beneficial if the monitoring program is simpler. The security mode allows only the τ vanadium sequence in the security domain. In the implementation of the present invention, the authority full mode and monitoring mode allow access to the same secure and non-secure memory. By ensuring that the security mode of the permission "sees" the same security and non-security seals, "hidden", can only be performed in the monitoring mode: can be switched to a security mode that allows simplified monitoring programs. From now on, ", the processing in the queen spit mode is directly switched to the monitoring mode, and vice versa. The transition from a security mode of security to monitoring ... is allowed. 'In the monitoring mode, you can switch to non-secure two payers. The non-authority security mode must use SMI to enter the monitoring 2 reset. 'Λ system enters permission security mode. Moving between domains, and moving back and forth between & control mode and permission security mode can help save state. Conversion In other embodiments, the S flag is allowed to be accessed from the security permission mode and the "=" mode. If the security permission mode is allowed: the control of the process flow is taken, and the processor is switched to the monitoring mode, this class 2 The sexual permission mode already has the effective jealousy of converting the S flag (bit). This' provision that only dogs can change the s flag in the monitoring mode's extra 'heterogeneity factor' can be verified to be correct. Conversely, it can be set with other settings The flags are the same: the method is stored, but the other set flags can be changed by the security permission mode of the question. The present technology includes such an embodiment that the S flag is changed in one of the most security 2 formulas. Returning to the exemplary embodiment just discussed, the device has a level of authority that defines the mode—the processor core 10; that is, any set of functions that are allowed by chess 2 48 200417216. Therefore, the conventional mode is arranged to handle the global mode and Monitoring mode accesses security and non-security cores to allow security mode to access all hidden objects that monitoring mode allows access to, and to handle any operations that are performed in security mode. _In 44 4Α 7Τ ΚΑ style, and vice versa. The processor core 10 is better, and the controller is indescribable. * The allowed ones are as follows in an example of this device, memory is divided, and non-security Memory, while security and non-security: ,,, and security memory can only be accessed in the monitoring and security mode. Compared with the 14 5 memory, both of them are a real package, full memory in The monitoring mode and security mode are listed as: # 安 Access ... In the non-security mode: ... reject ... sex ... non-secure: two :::: Π non-secure 1 * production mode refuses security and monitoring mode Access to non-secure bodies. Therefore, access to the body is only allowed in the monitoring and security system, and it is only possible to increase security by improving the security. Mode memory. 讦 非 非 > Setting or booting can be performed in a monitoring mode that is deemed to require permissions. To allow resets in Security Mode and Supervisor Mode and examples of this device, the device · The weight is more ancient than a security mode and permission mode. However, many of the devices In the example, it is possible to switch directly between g-control modes, and it is possible to arrange t_ booting. "Two | Wang domain, and one security kernel 80 (or operating system month dagger, and one or most 49 200417216 applications 82, 84 may be implemented 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. A device with a processor describes an example of the present invention. The present 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.

下文中,參照第21圖至2 3圖,本發明之一選擇性實 施例論及出自一程式設計人員之模式觀點: 下文中’吾人所使用之術語必能以ARM處理器(由英 國劍橋的ARM Limited所設計)的技術背景了解。 • S位元··安全性狀態位元,包含在一專屬CP 1 5登錄中。 # 「女全性/非安全性狀態」。由S位元值定義這種狀態。 其指示是否核心可以存取安全性情境,(其當處於安全 性狀態中’即s=1)或僅限制非安全性情境(s = 〇)。請注 意監控模式(詳見下文)優先於該s位元狀態。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 term used by us must be based on an ARM processor (from Cambridge, England). Designed by ARM Limited). • S bit ... The security status bit is included in a dedicated CP 1 5 login. # "Women's Sexuality / Unsafe Sex". 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, i.e., s = 1) or restricts only non-security contexts (s = 0). Please note that the monitoring mode (see below) takes precedence over this s-bit state.

# 「非安全性情境」可供不需要安全性的非安全性應用所 存取的所有硬體/軟體群組。 • 「安全性情境」僅供吾人執行安全性程式碼時存取的所 有硬體/軟體(核心、記憶體…)群組。 #監控模式:一種新的模式,其負責在安全性和非安全性 狀態之間的轉換。 簡而言之 籲核心總是能夠存取非安全性情境。 #僅在核心處於安全性狀態或監控模式時,該核心能夠存 50 200417216 取安全性情境。 • smi :軟體監控中斷:一種新的指令,其令核心藉由一 專屬的sMI異常向量以進入監控模式。「執行緒lDj: 與每一執行緒相關的識別符(由—OS所控制)。對某些 類型的0S而言,當0S在非安全性情境中執行時每 次呼叫一安全性功能’就需要傳遞一現有執行緒ID參 數,以連接安全性功能與它所呼叫的非安全性應用。該 安全性情境因此能夠支援多執行緒。 籲安全性中斷定義由安全性週邊所產生的中斷。 裎式設計人員的模組# "Non-security contexts" are all hardware / software groups that can be 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, it is called on the core to always have access to non-security situations. #Only when the core is in the security state or monitoring mode, the core can save 50 200417216 to take the security situation. • smi: software monitoring interrupt: a new instruction that enables the core to enter monitoring mode through a dedicated sMI exception vector. "Thread lDj: an identifier associated with each thread (controlled by -OS). For some types of OS, a security function is called each time the OS is executed in a non-security context. An existing thread ID parameter needs to be passed to connect the security function with the non-security application it is calling. This security scenario can therefore support multiple threads. Call for security interrupts to define interrupts that are generated by security perimeters Designer's Module

Carbon核心概觀 本文中對於使用本技術的處理器所用的術語「Carb〇n 架構」的概念’分別包含兩種情境,一安全性和一非安全 性。該安全性情境不能洩漏任何資料至非安全性情境中。 本文所提出的解決方案中,安全性和非安全性狀態將 共用該相同的(存在的)登錄區塊。因此,在ARM核心中出 現的所有現有模式(Abort,Undef,Irq,User···)將在每一種 狀態中存在。 歸功於包含在專屬CP15登錄中的新狀態位元rs(安 全性)位7C」’核心將知道其操作於安全性或是非安全性狀 態。 控制所允許的指令或事件修改該s位元,即,自一種 狀態改變到另-狀態,{系統安全性的一重要特徵。本解 51 200417216 決方案提出增加一新模式「監控模式」,其「監督」在兩種 狀態之間的轉換。該監控模式(藉由寫入適當的cP15登錄 中)是唯一被允許改變該S位元者。 最後’本發明提出對異常處理添加某些彈性的方法。 除了 Reset(重設)外,所有的異常若不是在它們所發生處處 理’就是被導向監控模式。歸因於一專屬一 cpi5登錄, 這是可以設定的。 該解決方案的細節將在下列段落中討論。 處理器狀態和掇式 Carbon新特拎 安ϋ或」!L安全性狀熊(S ^Carbon Core Overview The concept of the term "Carbon architecture" used in this article for processors using this technology includes two scenarios, one for security and one for non-security. This security scenario must not leak any information into a non-security scenario. In the solution proposed in this article, the same (existing) login block will be shared by the security and non-security states. Therefore, all the existing patterns (Abort, Undef, Irq, User ...) in the ARM core will exist in each state. Thanks to the new status bit rs (security) bit 7C "'included in the dedicated CP15 registration, the core will know whether it is operating in a secure or non-secure state. An instruction or event allowed by the control modifies the s-bit, i.e., changes from one state to another, an important feature of system security. The 200417216 solution proposes to add a new mode "monitoring mode", whose "supervision" is switched between the two states. This monitoring mode (by writing in the appropriate cP15 login) is the only one allowed to change the S bit. Finally, the present invention proposes a method of adding some flexibility to exception handling. With the exception of Reset, all exceptions are either handled in their place or they 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. The processor status and the new carbon features are safe or "! L security traits bear (S ^

Carbon核心的一主要特徵是s位元的存在,其指示是 否核心是在一安全性(s = 1)或非安全性(s=:〇)狀態。當在安 王性狀態中時’核心能在安全性或非安全性情境態樣存取 任何資料。當在非安全性狀態時,核心僅限於該祚安全性 情境。 將執 -/ 一皿1工保式,其優先方 疋資訊。甚至…時,當它在監控模式中,核心 女全性權限存取。進-步的資訊請參考下一段落之監控 式0 八此夠在现控模式中讀取和寫入該$位元。不論該s 位70的值為何’如果任何其他的模式試著去存取它,若不 是被忽略^導致—Undefined(未定義)異常。 52 200417216 除了 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 state of security, 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 security context. Will perform-/ one dish 1 labor insurance type, its priority is 疋 information. Even ... when it is in the monitoring mode, the core women have full access to the rights. For further information, please refer to the monitoring formula in the next paragraph. This is enough to read and write the $ bit in the current control mode. Regardless of the value of the s-bit 70 'If any other mode attempts to access it, if it is not ignored ^ leads to an —Undefined (undefined) exception. 52 200417216 Except for Reset, all exceptions will not affect the safety status bits. On Reset, the s bit is set and the core will start in supervisor mode. For more information, please refer to the booting chapter. The security / non-security state is separate and its operation is independent of the ARM / Thumb / Java state. Monitoring mode

Carbon系統的一其他重要特徵是一新模式「監控模 式」的產生《它將用來在安全性和非安全性狀態之間控制 核心轉換。它總是被視為一安全性模式,即S位元值為何, 當在監控模式中時,核心總是對外部情境執行安全性權限 存取。 任何安全性權限模式(即,當S==1時之權限模式)能藉 由僅是寫入CPSR模式位元(MSR、m〇VS、或相當的指令 者)轉換為監控模式。然而,它在任何非安全性模式或安全 性使用者模式中是禁止的。如果這發生了,則忽略指令或 引起一異常。 可能有需要一專屬的CPSR違反異常。藉由從任何非 安全性模式或安全性使用者模式直接寫入該CPSR,可由 任何欲轉換為監控模式之意圖引起該異常。 當監控模式是啟用時,除了 Reset以外,所有異常實 際上失效了: *所有中斷經過遮罩處理(mask); φ所有記憶體異常不是被忽略就是引起一重大異常。 53 200417216 未疋義的/SWl/SMI被忽略或引起一重大異常。 當進入一監控模式時,該些中斷自動失效而系統監控 應被寫下’以使系統監控執行時,不會有其他類型的異常 發生了的。 監控模式需要有一些私有登錄。該解決方案提出人們 僅重複敢小組的登錄,即,r 1 3 (sp —mon)、R1 4(lr —mon)和 S P S R (s p s r 一 rn ο η) 〇 在監控模式中,MMU將失效(平面位址映射,flat address map)以及MPU或分割檢測器亦然(監控模式將總 是執行安全性權限外部存取)^然而,尤其是設計的MPU 區域屬性(快取能力(cacheability)…等等)仍然是啟用的。 可選擇性地,監控模式可以使用所有被安全性網域所使用 的映射。 新指令 本發明所提出者需要向既有ARM指令集中添加一新 的指令。 使用SMI(軟體監控中斷)指令以進入監控模式(在一固 定的SMI異常向量發展出來)。該指令主要用來對指示監 控在非安全性和安全性狀態之間的調換(swap)。 可選擇性地(或額外地),亦 < 能增加一新指令以允許 監控模式向/從監控堆疊儲存/還原任何其他模式的狀態, 以改進内容轉換的表現。 54 200417216Another important feature of the Carbon system is the creation of a new model, the "monitoring mode", which will be used to control core transitions between security and non-security states. It is always regarded as a security mode, that is, what is the value of the S bit. When in the monitoring mode, the core always performs security permission access to external situations. Any security permission mode (that is, the permission mode when S == 1) can be switched to the monitoring mode by only writing to the CPSR mode bits (MSR, mVS, or equivalent commander). However, it is prohibited in any non-security mode or security user mode. If this happens, the instruction is ignored or an exception is raised. There may be a need for a dedicated CPSR violation exception. By directly writing the CPSR from any non-security mode or security user mode, the exception can be caused by any intention to switch to the monitoring mode. When the monitoring mode is enabled, except for Reset, all exceptions are actually disabled: * All interrupts are masked; φAll memory exceptions are either ignored or cause a major exception. 53 200417216 The undefined / SWl / SMI was ignored or caused a major exception. When entering a monitoring mode, the interrupts are automatically disabled and the system monitoring should be written down 'so that no other types of exceptions will occur when the system monitoring is performed. The monitoring mode requires some private logins. This solution proposes that people only repeat the login of dare groups, that is, r 1 3 (sp —mon), R1 4 (lr —mon), and SPSR (spsr-rn ο η) 〇 In the monitoring mode, the MMU will fail (flat The same applies to flat address maps and MPUs or partition detectors (monitoring mode will always perform security access to external access) ^ However, especially the MPU area attributes (cacheability ... etc.) designed ) Is still enabled. Alternatively, the monitoring mode can use all mappings used by the security domain. New instructions The present inventors need to add a new instruction to an existing ARM instruction set. Use SMI (Software Monitor Interrupt) instruction to enter monitor mode (developed on a fixed SMI exception vector). This directive is mainly used to swap the indication monitoring between non-safety and safety status. Optionally (or additionally), < a new instruction can be added to allow the monitoring mode to store / restore the state of any other mode to / from the monitoring stack to improve the performance of content conversion. 54 200417216

如先前的段落中所述’僅有一新模式被加入 有既存模式持續可獲得,並在於安全性和非安全 都存在。 事實上,Carbon使用者將了解如第21圖所开 處遵錄 本發明之實施例提出安全性和非安全性情境 的登錄區塊。這意味著,當藉由監控模式從一情 另一者時,系統監控將需要儲存第一情境内容, 二情境中產生(或還原)一内容。 傳遞參數成為谷易的任務:一旦系統監控改 位元,在第一情境中的一登錄中所含有的任何資 於第二情境中之相同的登錄中。 然而,除了有限數量之登錄專用於傳遞參數 嚴格地控制,當從安全性傳遞至非安全性狀態時 他登錄都需要清除’以避免洩漏任何安全性資料 由監控核心確保。 亦可能部署一硬體機制或—新指令,在從安 至非安全性狀態時直接清除登錄。 所提出的另一解決方案涉及重複所有(或大^ 登錄區塊’因此具有在安全性和非安全性狀態之 實體上分離的登錄區塊《該解決方案主要具有清 核心。所 性狀態中 :之架構。 共用相同 境轉換為 以及在第 變了該 S 料將可用 ,其需要 ,所有其 。它需要 全性轉換 [數)既有 間具有雨 楚地分離 55 200417216 在登錄中所含有的安全性和非安全性資料的優點。在安全 性和非安全性狀態之間亦允許快速的内容轉換。然而,缺 點是藉由登錄的傳遞參數變得困難,除非吾人產生一些專 屬的指令,以允許該安全性情境存取非安全性登錄。 第22圖依據處理器模式圖示可用的登錄。請注意,處 理器狀態對本主題沒有影響。 異常 安全性中斷 現有解決方銮 本發明提出當在現有核心時’保持相同的中斷腳位 (pin),即,IRQ和FIQ。相關於異常捕捉遮罩登錄(Excepti〇n Trap Mask register,詳見下文),對於任何系統應該有足夠 彈性,以部署和處理不同種類中斷。 y I c加強 本發明藉由下列方法加強 VIC(向量中斷控制器, Vectored Interrupt Controller) : VIC 可以含有與每一白旦 位址相關的一安全性資訊位元。該位元僅能由監控或安全 性權限模式設計。其指示是否所考慮的中斷應該視為安全 性,以及因此應該在安全性中處理。 本發明亦增加兩新向量位址登錄,一供所有在非安全 性狀態中發生的安全性中斷,另一供所有在安全性狀雜中 發生的非安全性中斷。 56 200417216 包含在CP 15中的S位元資訊可讓VIC獲得,以作為 一新VIC輸入。 下表概述一些不同可能歷程,其依據引入的中斷之狀 態(安全性或非安全性,由相關於每一中斷線之S位元指示) 和核心的狀態(在VIC中,CP15 = S輸入信號之S位元)。As stated in the previous paragraph, 'Only a new mode is added. Existing modes are continuously available, and both security and non-security exist. In fact, Carbon users will understand the registration blocks provided by the embodiment of the present invention, as shown in Figure 21, which present security and non-security scenarios. This means that when monitoring one situation from the other through the monitoring mode, the system monitoring will need to store the content of the first scenario and generate (or restore) one content in the two scenarios. Passing parameters becomes Gu Yi's task: once the system monitors the reset, any information contained in one login in the first scenario is in the same login in the second scenario. However, in addition to a limited number of logins dedicated to strictly passing parameters, his login needs to be cleared when passing from security to non-secure state to avoid leaking any security data, which is ensured by the monitoring core. It is also possible to deploy a hardware mechanism or—new instructions—to clear the login directly when going from security to non-security. Another proposed solution involves repeating all (or large ^ login blocks' thus having separate login blocks on entities that are in a secure and non-secure state. "This solution has a clear core. In the state: The structure of the common environment is converted to and will be available at the time of the change. It needs to be all. It needs to be fully converted. [Several] There is a clear separation between the existing 55 200417216 security included in the login Of sexual and non-safety data. 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. Exception Security Interrupts Existing Solution 銮 The present invention proposes to keep the same interrupt pins, i.e., IRQ and FIQ, when in the existing core. Regarding the exception trap mask register (see below for details), there should be enough flexibility for any system to deploy and handle different types of interrupts. y I c Enhancement The present invention enhances VIC (Vectored Interrupt Controller) by the following methods: VIC may contain a security information bit associated with each white space 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 profile. 56 200417216 The S-bit information contained in CP 15 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).

57 20041721657 200417216

異常管理設定 為改進Carbon彈性,一新的登錄「異常捕捉遮罩」將 被加入CP 1 5内。該登錄包含下列位元: 位元 0: Undef異常(非安全性狀態) 位元 1: SWI異常(非安全性狀態) 位元 2 : Prefetch abort異常(非安全性狀態) 位元 3: Data abort異常(非安全性狀態) 位元4: IRQ異常(非安全性狀態) 位元 5: FIQ異常(非安全性狀態) 位元 6: SMI異常(非安全性/安全性狀態s) 位元 16: Undef異常(安全性狀態) 位元 17: SWI異常(安全性狀態) 58 200417216 位元 18: Prefetch abort異常(安全性狀態) 位元 19: Data abort異常(安全性狀態) 位元20: IRQ異常(安全性狀態) 位元21: FIQ異常(安全性狀態)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) bit 17: SWI exception (security state) 58 200417216 bit 18: Prefetch abort exception (security state) bit 19: Data abort exception (security state) bit 20: IRQ Exception (Security State) Bit 21: FIQ Exception (Security State)

Reset(重設)異常在登錄中不總是具有對應的位元。 Reset總是使核心藉由它專屬的向量進入安全性監督模式。 如果一位元設置了,所對應的異常使核心進入監控模 式。否則,在其發生的情境中在它所對應的管理器處理該 異常。 該登錄只可見於監控模式中。在任何其他模式中嘗試 存取它的任何指令都會被忽略。 該登錄應該被初始化為一系統專屬值,依據該系統是 否支援一監控。該功能能由VIC所控制。 異常向量表 分別有安全性和非安全性情境,所以也需要分別的安 全性以及非安全性異常向量表。 此外,如果監控也能夠捕捉一些異常,吾人也需要專 屬於監控的一第三異常向量表。 下表概述三種不同的異常向量表: 在非安全性記憶體中: 位址 異常 模式 自動存取的時機 59 200417216 0x00 _ • 0x04 Undef Undef 在核心處於非安全性狀態和異常 捕捉遮罩登錄時,所執行之未定 義指令[Non-secure Undef] = 0 0x08 SWI Supervisor (監督) 在核心處於非安全性狀態和異常 捕捉遮罩登錄時,所執行之SWI 指令[Non-secure SWI] = 0 0x0c :)refetch 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 exception does not always have a corresponding bit in the login. Reset always makes the core 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 login should be initialized to a system-specific value, depending on whether the system supports a monitoring. This function can be controlled by VIC. The exception vector table 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: The timing of automatic access to the address exception mode 59 200417216 0x00 _ • 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 (Supervision) 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: ) refetch Abort Abort (Abort) When the core is in a non-safe state and the exception capture mask is logged in, the abort instruction [Non-secure Pabort] = 0 0x10 Data Abort Abort is in a non-safe state and the exception capture mask is in the core When the mask is registered, the execution suspension data [Non-secure DAbort] = 0 0x14 Reserved 0x18 IRQ IRQ When the core is in a non-safe state and the exception capture mask is registered, the set IRQ pin (assert) [ Non-secure IRQ] = 0 Ox 1 c FIQ FIQ When the core is in a non-secure state and the exception capture mask is registered, the FIQ pin set (assert) [pin] [ Non-secure FIQ] = 〇

60 200417216 在安全性記憶體中: 位址 異常 模式 自動存取的時機 0x00 Reset* Supervisor (監督) 重設設定的腳位 0x04 Undef Undef 在核心處於安全性狀態和異常捕 捉遮罩登錄時,所執行之未定義 指令[Secure Undef] = 0 0x08 SWI Supervisor (監督) 在核心處於安全性狀態和異常捕 捉遮罩登錄時,所執行之SWI指 令[Secure SWI] = 0 Ox 0c 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] = 060 200417216 In the security memory: The timing of the automatic access of the address abnormality 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 Ox 0c Prefetch Abort Abort (Abort) in When the kernel is in the security state and the exception capture mask is logged in, the abort instruction executed [Secure Pabort] = 0 0x10 Data Abort Abort When the kernel is in the security state and the exception capture mask is logged in, the execution abort data [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 [assert] [Secure IRQ] = 0 Ox 1 c FIQ FIQ is in the core security When the status and exception capture mask are registered, the set FIQ pin [Secure FIQ] = 0

61 200417216 在監控記憶體中(平面映射flat mapping): 位址 異常 模式 自動存取的時機 0x00 - - 一 0x04 Undef Monitor(監 控) 在核心處於安全性狀態和異常 捕捉遮罩登錄時,所執行之未定 義指令[Secure Undef] = 1 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所執行之未 定義指令[Non-Secure Undef] = l 0x08 SWI Monitor(監 控) 在核心處於安全性狀態和異常 捕捉遮罩登錄時,所執行之SWI 指令[Secure SWI] = 1 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所執行之 SWI 指令[Non-Secure SWI] = 1 0x0c Prefetch Abort Monitor(監 控) 在核心處於安全性狀態和異常 捕捉遮罩登錄時,所執行之中止 指令[Secure Pabort] = l 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所執行之中 止指令[Non-Secure Pabort] = l 0x10 Data Abort Monitor (監 控) 在核心處於安全性狀態和異常 捕捉遮罩登錄時,所執行之中止 資料[Secure DAbort] = l 62 200417216 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所執行之中 止資料[Non-Secure DAbort] = l 0x14 SMI Monitor (監 控) 0x18 IRQ Monitor(監 控) 在核心處於安全性狀態和異常 捕捉遮罩登錄時,所設定(assert) 的 IRQ 腳位(pin)[Secure IRQ] = 0 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所設定 (assert) 的 IRQ 腳 位 (pin)[Non-Secure IRQ] = 0 Ox 1 c FIQ Monitor(監 控) 在核心處於安全性狀態和異常 捕捉遮罩登錄時,所設定(assert) 的 FIQ 腳位(pin) [Secure FIQ] = 〇 在核心處於非安全性狀態和異 常捕捉遮罩登錄時,所設定 (assert)的 FIQ 腳位(pin) [Non-Secure FIQ]=〇 在監控模式中,可以有兩份異常向量,因此每一異常 都將有二個不同的相關向量: 一供出現於非安全性狀態的異常 一供出現於安全性狀態的異常 63 /216 /216 因為監控核心不再需要 常,SMI是最合適的選 全性狀態之間的轉換。 如此可以降低異常等待時間, 偵測異常發生處的初始狀態。 請注意,該特徵僅限於一些異 擇之一,用以改進在安全性和非安 愴境間的韓^ 當在狀態間轉換時,龄批抬^ 存第 容〇 于 凰控模式必須在它的監控堆疊儲 一種狀態的内容,Γ & ^ ί從該監控堆疊還原第二個狀態内 監控模式因&需要存取任何其他模式之任何登錄,包 括私有登錄(r14、SPSR…)。 ▲為了處理它,本發明所提出的解決方案包含在安全性 和心中,給予任何權限模式藉由純粹寫入CPSR,直接轉 換為監控模式的權限。 在情境之間轉換之此類系統執行如下: •進入監控模式 φ設定S位元 Φ轉換至監督模式-儲存監控登錄於MONITOR(監控) 堆疊(當然,監督模式需要存取該監控堆疊指標, 但這是容易辦到的,例如藉由使用一普通登錄(R0 至 R8)) •轉換至System(系統)模式-儲存登錄(如同使用者 模式)於監控堆疊 64 200417216 fRQ登錄於監控堆疊61 200417216 In monitoring memory (flat mapping): The timing of automatic access to the address exception mode 0x00--0x04 Undef Monitor (monitoring) is executed when the core is in a security state and the exception capture mask is registered. Undefined instruction [Secure Undef] = 1 Undefined instruction executed when the core is in a non-secure state and the exception capture mask is logged in [Non-Secure Undef] = l 0x08 SWI Monitor (monitoring) is in the core security state When the exception capture mask is registered, the executed SWI instruction [Secure SWI] = 1 When the core is in a non-secure state and the exception capture mask is registered, the SWI instruction executed [Non-Secure SWI] = 1 0x0c Prefetch Abort Monitor (Monitoring) When the kernel is in a secure state and the exception capture mask is logged in, the abort instruction is executed [Secure Pabort] = l When the kernel is in a non-safe state and the exception capture mask is logged in, the abort instruction is executed [ Non-Secure Pabort] = l 0x10 Data Abort Monitor (monitoring) executed when the core is in a security state and the exception capture mask is logged in Suspend data [Secure DAbort] = l 62 200417216 Suspend data performed when the core is in a non-secure state and the exception capture mask is logged in [Non-Secure DAbort] = l 0x14 SMI Monitor (monitor) 0x18 IRQ Monitor (monitor) Set IRQ pin (assert) [Secure IRQ] = 0 when the core is in a security state and the exception capture mask is registered (set ( IRQ pin of assert) [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 of the assertion is set. ) [Secure FIQ] = 〇 When the core is in a non-secure state and the exception capture mask is registered, the set FIQ pin is [Non-Secure FIQ] = 〇 In the monitoring mode, there can be two An exception vector, so each exception will have two different correlation vectors: one for exceptions that appear in a non-security state, one for exceptions that appear in a security state 63/216/216 because the monitoring core no longer needs to SMI is the most suitable selected from the transition between the full state. This can reduce the abnormal waiting time and detect the initial state where the abnormality occurred. Please note that this feature is limited to one of some alternatives, to improve the security between security and non-security situations. ^ When changing between states, age approval ^ stored in the control mode must be in it The monitoring stack of one state stores the contents of one state, and Γ & ^ ί restores the monitoring mode in the second state from the monitoring stack because it needs to access any login of any other mode, including private login (r14, SPSR ...). ▲ In order to deal with it, the solution proposed by the present invention includes security and mind, and grants any permission mode to be directly converted to the monitoring mode by simply writing CPSR. Such systems that switch between contexts are implemented as follows: • Entering monitoring mode φ Set S bit Φ Switching to supervisory mode-Storage monitor is logged into the MONITOR stack (of course, supervisory mode requires access to the monitor 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 mode) on the monitoring stack 64 200417216 fRQ login on the monitoring stack

以一簡單 於 CPSR 一旦所有模式的所有私有登錄都储存了, MSR指令回到監控模式(只是寫入監控值 模式欄位) 另一些解決方案也被考慮: 己的堆疊儲存其他 #增加一新指令,其允許監控在 模式的私有登錄。 以—新的「狀態」部署監控,即,能夠在監控狀態 (具有該些適當存取權利)和在IRQ(或任何其I他的 模式,看見IRQ(或任何其他的)私有登錄。 基本歷程(請參照第23圖) I執行緒1在非安全性情境中(S位元==〇)執行,該執 行緒需要執行一安全性功能=>SMI指令。 2 · S ΜI指令使核心藉由一非安全性s ΜI向量進入監 控模式。使用LR一mon和SPSR—mon來儲存非安全 性模式之PC以及CPSR。在該階段落s位元保持 不變,雖然該系統現下在安全性狀態中。監控核心 儲存非安全性内容於監控中。其亦發送LR—mon和 S P S R —m ο η。此時監控核心藉由寫入c P 1 5登錄改變 S位元。在該實施例中,監控核心保持追蹤,一「安 全性執行緒1」在該安全性情境中開始(例如,藉 由更新一執行緒ID表)。最後,它退出監控模式並 65 200417216 轉換至安全性燊督模式。 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圖’在安全性♦非 f和非女全性網域之間,共用所 有登錄都。在監控模式中,鑪备 八中轉換發生在從安全性和非安全 性網域之一轉換登錄至s ^ 卞至另一者。其涉及儲存在一網域中存 在的一登錄之狀態,和在 在另網域中寫入新的狀態至該登 66 200417216 錄(或在該登錄還原先前儲存的狀態),亦如上文中「情境 間的轉換」章節所述者。 吾人希望降低執行該轉換所花費的時間。為了降低執 行該轉換所花費的時間,當在安全性和非安全性網域之間 轉換時,使共用的登錄失效,以使儲存於其中的資料值保 持不變。例如’考慮從亦安全性網域到安全性網域的一轉 換。舉例來說,假設顯示在第6圖之FIQ登錄在安全性情 境中不需要。因此,使那些登錄失效,且不需要把他們轉 換至安全性網域,且不需要儲存那些登錄的内容。 使登錄失效可以藉由幾個方法達成。一種方法是把使 用該些登錄的模式鎖住。在指示失效模式的一 CP15登錄 中寫入控制位元以達成。 t擇ϋ地’可以再次以指令為基礎,藉由寫入控制位 7G至一 CP15登錄中,使對登錄的存取失效。在CP15登錄 所寫入的位元只與該登錄相關,而非模式,所以模式並未 失效’但疋’對該模式的登錄所做的存取則失效。 FIQ登錄儲存與快速中斷相關的資料。如果該hq登 錄失效而快速中斷發生,處理器發出異常信號至監控。為 回應異承’監控模式可操作以儲存與一網域相關和在上述 失效的且錄中储存的任何資料值,並載人該登錄相關於其 他網域之新資料值’而後啟用該FIQ模式登錄。 、可以女排處理器,以使當處理器轉換網域時,在監控 、、、斤有區塊登錄都失效。選擇性地,當轉換網域以 及其他程式設計人員選擇失效時,登錄的失效可以利用在 67 200417216 共用的登錄中的一些預設者來選擇。 當在監控模式中轉換網域時,可以安排處理器, 一或多數共用登錄失效,以及一或多數其他共用登錄 們的資料在離開一網域時儲存,和將新資料載入另 域。該新資料可以是空值資料。 第24圖圖示向一傳統ARM核心中增加一安全性 選擇的概念。該圖圖示含有安全性處理選擇的處理器 能夠藉由向一既有核心增加安全性處理選擇而形成。 該系統想要具有與一既有作業系統之反向相容性,直 會認為該既有系統係操作於處理器的傳統非安全性部 然而,如該圖之下半部所示以及下文將進一步詳論者 實上,一既有系統係操作於系統的安全性部分。 第 2 5圖圖示具有一安全性和非安全性網域之一 器,並圖示重設,且與第2圖類似。第2圖圖示一處理 適用於執行一安全性敏感型態之操作,其以一安全性 系統在安全性網域中控制處理,和以一非安全性0 S 在非安全性網域中控制處理。然而,該處理器亦反向 於一傳統舊版作業系統,及因此該處理器可以使用一 作業系統,使用一非安全性敏感的方法操作。 如第2 5圖所示,在安全性網域中的重設,以及此 有S位元或安全性狀態旗標設定之無論什麼類型的操 發生的重設。在一非安全性敏感類型操作情況下,重 生在安全性網域,並之後繼續在安全性網域中處理。 舊版作業系統控制處理不知道系統的安全性態樣。 以使 將它 一網 處理 如何 如果 覺上 分。 ,事 處理 器, OS 系統 相容 舊版 處具 作所 設發 然而 68 200417216 如第2 5圖所示,執行重設以在安全性監督模式 置開始處理處的位址,而不論是否處理是安全性敏 事實上非安全性敏感。一旦執行了重設,則在之後 開機或重開機中所出現的額外任務。該開機機制詳沒 開機機制 開機機制必須顧及下列特徵: • 保持與舊版作業系統的相容性。 • 在最權限模式中開機以確保系統的安全性。 因此。Carbon核心將在安全性監督模式中開機 不同的系統將是: • 對於想要執行舊版作業系統的系統而言,不 S位元,而核心將僅知道其在監督模式中開 • 對於想要使用Carbon特徵的系統,核心在 權限模式中開機,又該安全性權限模式應能 系統中的所有安全性防護(有可能在交換至 式之後) 上述開機機制之細節而論,本發明實施例的處 設處理器,以在安全性監督模式中開始在所有情況 理。在一非安全性敏感類型操作的情況下,雖然安 此處不是問題,因為已設置了 S位元(儘管作業系 道),實際上作業系統是在安全性網域中操作。它 點,無法自非安全性網域存取的記憶體部分,在該 下,設 感或是 執行一 【如下。 考慮該 機。 安全性 設定在 監控模 理器重 下的處 全性在 統不知 有個優 情況下 69 200417216 是可存取的。 在所有情況下,在安全性監督模式中開機亦有利於 全性敏感系統,因為它有助於確保系統的安全性。在安 性敏感系統中,在開機時提供位址給在安全性監督模式 儲存開機程式之處,以及因此允許系統設定為一安全性 統,和轉換為監控模式。一般而言,自安全性監督模式 換為監控模式是允許的,和在一適當時間啟用安全性 統,以開始在監控模式中處理,以初始化監控模式架構 第26圖圖示,第1步驟,由一非安全性作業系統執 之一非安全性執行緒NSA。第2步驟,非安全性執行 NS A藉由在第3步驟執行一監控模式程式的監控模式, 叫安全性網域。監控模式程式改變S位元以轉換網域, 在第5步驟移動到安全性作業系統之前,執行任何必要 内容儲存和内容還原。而後在第6步驟受一中斷irq支 之前,執行對應的安全性執行緒SA。在第7步驟,中斷 理硬體觸發返回監控模式,此處決定是否由安全性作業 統或非安全性作業系統所處理。在這種情況下,在第9 驟開始,由非安全性作業系統處理該中斷。 當由非安全性作業系統處理該中斷時,在第11步驟 正常執行緒轉換操作之前,在非安全性作業系統中,非 全性執行緒NSA已作為現有任務重新繼續。該執行緒轉 可以是一時間事件或類似者的結果。在第1 2步驟中,由 安全性作業系統在非安全性網域中執行一不同的執行 NSB,以及此時在第14步驟藉由監控網域/程式對安全 安 全 中 系 轉 系 〇 行 緒 呼 和 的 配 處 系 步 安 換 非 緒 性 70 200417216 網 用 而 因 全 體 全 緒 參 的 體 緒 斷 已 系 返 安 該 理 性 定 域進行呼叫。在第7步驟, L ^ 皿控程式儲存了一旗標, 一些其他的機制,用以指 ^ ^ 文生14作業系統因為一中 在上一次暫停,而非因為一 屯 ^ ^ ^ ^ 女王眭執行緒已完成執 為正常的請求而離開,而就 ^ 丄 饜孜下。因此,因為一 性作業系統被一中斷暫停,& 在,从士你 在第15步驟,監控程式指 軟體仿製的中斷’以再次逸 — 丹人進入安全性作業系統,又 仿製的中斷設定了一返回執 w钒仃緒ID。(例如,在由与丨 性執行緒N S B請求時,由 ^ ^ 全性作業系統所開始的幸 之識別符,其他的參數眘袓介扯 数貝枓亦然)。軟體仿製中斷的索 數可以作為一登錄值傳遞。 ’ 在第15步驟,該仿製的齡 的軟體中斷觸發安全性作羋考 一返回中斷管理器例式。兮、沒 丨忭系ifIt is simpler than CPSR. Once all private logins of all modes are stored, the MSR instruction returns to the monitoring mode (only the monitoring value mode field is written). Other solutions are also considered: own stack storage, other # add a new instruction , Which allows to monitor private logins in mode. Deploy monitoring with the new "state", that is, see the IRQ (or any other) private login in the monitoring state (with the appropriate access rights) and in the IRQ (or any other mode). Basic process (Please refer to Figure 23) I Thread 1 is executed in a non-safety context (S bit == 〇), this thread needs to execute a security function => SMI instruction. 2 · S MI instruction makes the core borrow A non-secure s MI vector enters the monitoring mode. LR_mon and SPSR_mon are used to store the PC and CPSR in the non-secure mode. The s bits remain unchanged at this stage, although the system is now in a security state The monitoring core stores non-security content in the monitoring. It also sends LR_mon and SPSR_m ο η. At this time, the monitoring core changes the S bit by writing c P 1 5 login. In this embodiment, The monitoring core keeps track of a "security thread 1" in that security context (for example, by updating a thread ID table). Finally, it exits monitoring mode and transitions to security supervision mode. 3 · Security Core Sending Application To the correct security memory location, and then switch to user mode (for example, using MOVS). 4. Perform security functions in the security use mode. Once completed, perform the appropriate SWI call by " "EXit" function. 5. The SWI command causes the core to enter the security svc mode through a dedicated SWI to the cover and sequentially execute the "exit" function. The "exit" function ends with a " SMI, to switch Back to monitoring mode. 6. The SMI instruction enables the core to enter monitoring mode by using the exclusive security SMI vector. LR_mon and SPSR_mon are used to store the security PC and CPSR in svc mode. The S bit remains unchanged (such as security Status). The monitoring core logs in the fact that the security thread 1 is completed. After that, it logs in by writing CP15 and changes the s bit 'to return to the non-security state. The monitoring core self-monitors the stack to restore non-security content It also loads the LR_mon and CPSR_mon remaining in step 2 in advance. Finally, exit with a SUBS (this command will return the core in non-secure user mode). Control mode. 7 · Thread 1 can resume normally. Refer to Figure 6 'All logins are shared between the security and non-f and non-female holistic domains. In the monitoring mode, the switchover to the eighth furnace occurs. The transition from one of the secure and non-secure domains to s ^ 卞 to the other. It involves storing the state of a login that exists in one domain, and writing a new state in the other domain To this log 66 200417216 (or restore the previously saved state at this log), as described in the "Conversion Between Contexts" section above. I want to reduce the time it takes to perform the conversion. In order to reduce the time it takes to perform this conversion, when switching between secure and non-secure domains, the shared registry is disabled so that the value of the data stored in it remains unchanged. For example, consider a transition from a secure domain to a secure domain. For example, suppose the FIQ login shown in Figure 6 is not needed in a security context. As a result, those logins are disabled, they do not need to be transferred to a secure domain, and they do not need to be stored. Disabling the login can be achieved in several ways. One way is to lock the modes that use those logins. Control bits are written to achieve this in a CP15 login indicating the failure mode. t select the location 'can be based on the instruction again, and the access to the registration is disabled by writing the control bit 7G to a CP15 registration. The bits written in the CP15 login are only related to the login, not the mode, so the mode is not invalidated, but the access to the login of the mode is invalidated. The FIQ registry stores data related to rapid interruptions. If the hq login fails and a fast interrupt occurs, the processor sends an abnormal signal to the monitor. In response to different commitments, the "monitoring mode is operable to store any data value related to a domain and stored in the above-mentioned invalid records, and carry the new data value of the registration related to other domains", and then enable the FIQ mode log in. It is possible to have a women's volleyball processor, so that when the processor changes the domain, the block registration in monitoring, ,, and monitoring will be invalid. Optionally, when switching domains and other programmers choose to fail, the invalidation of the registry can be selected using some of the presets in the 67 200417216 shared registry. When switching domains in monitoring mode, processors can be arranged, one or most of the shared logins are disabled, and one or most of the other shared logins' data is stored when leaving a domain, and new data is loaded into another domain. The new data can be null data. Figure 24 illustrates the concept of adding a security option to a traditional ARM core. The figure illustrates that a processor containing security processing options can be formed by adding security processing options to an existing core. The system wants to have backward compatibility with an existing operating system, and it will be considered that the existing system is a traditional non-security part that operates on a processor. However, as shown in the lower half of the figure and will be described below In further detail, in fact, an existing system operates on the security part of the system. Figure 25 shows a device with a secure and non-secure domain, and the reset is similar to Figure 2. Figure 2 illustrates a process suitable for performing a security-sensitive operation, which controls the process in a security domain with a security system, and controls in a non-security domain with a non-security 0 S deal with. However, the processor is also an inverse of a traditional legacy operating system, and thus the processor can operate using an 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. In the case of a non-security-sensitive type of operation, it is reborn in the security domain and then continues processing in the security domain. The legacy operating system control process did not know the security aspect of the system. In order to make it a net to deal with how to feel points. The event processor, OS system is compatible with the previous version. However, as shown in Figure 25, a reset is performed to set the address of the start processing point in the security monitoring mode, regardless of whether the processing is performed. Security sensitive is in fact not security sensitive. Once a reset has been performed, additional tasks occur during subsequent power-on or power-on. The boot mechanism is not detailed. Boot mechanism 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. The Carbon core will boot in the safety oversight mode. The different systems will be: • For systems that want to execute an older operating system, there is no S bit, and the core will only know that it is in oversight mode. In the system using Carbon features, the core is booted in the permission mode, and the security permission mode should be able to protect all the security in the system (possibly after switching to the formula). As for the details of the above boot mechanism, the embodiments of the present invention A processor is provided to begin processing in all situations in a security oversight mode. In the case of a non-security-sensitive type of operation, although it is not a problem here, because the S bit is set (despite the operating system), the operating system is actually operating in the security domain. It points to the parts of memory that cannot be accessed from non-secure domains. Under this, you can configure or execute a [see below. Consider this machine. The security is set under the monitoring controller. The integrity is unknown. There is an excellent case. 69 200417216 is accessible. In all cases, booting in a safety oversight mode is also beneficial to a fully sensitive system, as it helps ensure system security. In security-sensitive systems, the address is provided at boot time to where the boot program is stored in the security monitoring mode, and therefore allows the system to be set to a security system and switched to monitoring mode. In general, switching from the self-safety monitoring mode to the monitoring mode is 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 illustrates the first step. A non-safety thread NSA is performed by a non-safety operating system. In the second step, non-security execution NS A monitors the mode by executing a monitoring mode program in the third step, 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 before step 6 is interrupted by an interrupted irq, the corresponding security thread SA is executed. In step 7, the interrupt 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 starting at step 9. When the interrupt is handled by the non-secure operating system, the non-secure thread NSA has resumed as an existing task in the non-secure operating system before the normal thread switching operation of step 11. This thread may be the result of a time event or the like. In the 12th step, the security operating system performs a different execution of the NSB in the non-secure domain. At this time, in the 14th step, the system is monitored by the monitoring domain / program. The coordination of harmony is step security for non-linearity. 70 200417216 For network use, due to the whole body of all the participants, the system has been returned to Anqiang rationality to call. In step 7, the L ^^ control program stores a flag. Some other mechanisms are used to indicate that the ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The operating system was suspended because a middle school was last suspended, rather than a ^^^^^ Intuition has been completed and left for a normal request, and just ^ 丄 餍. Therefore, because the sexual operating system was suspended by an interruption, & now, in step 15, the monitor program refers to the interruption of software imitation 'to escape again — Dan enters the security operating system and the imitation interruption setting is Upon return, the vanadium oxide thread ID is returned. (For example, when it is requested by the NS thread SB, the identifier started by the ^ ^ holistic operating system, other parameters are carefully introduced, and the same is true). The number of software imitation interrupts can be passed as a registered value. ′ In step 15, the fake software interrupt triggers a security test. Return to the interrupt manager routine. Xi, no 丨 忭 if

式5亥返回中斷管理器例式檢名 仿製中斷的返回執行緒ID 〇 A ^ U決疋是否符合安全性幸 SA的ID , _在上一次安全性 乍業系統暫停前執行痕 。在這種情況下,沒有符合 ^ u 士 的並因此在第10步驟,Formula 5 Hai Return Interrupt Manager routine check name The return thread ID of the imitation interrupt 〇 A ^ U determines whether the ID of the security SA is met, _ execution trace before the last security system suspension. In this case, there is no ^ u + and therefore in step 10,

渥儲存安全性執行緒SA 円谷以後,觸發安全性^ 統,以將執行緒轉換為如非 11 非女全性執行緒NSB所設其 回執行緒。而後能夠在被請求 β〜《于,由中斷處重新開炎 全性執行緒SA。 第27圖圖示在第26圖所示之行為類型的另—示命 示例中’當程序在非安全性作業系統的控制中進行以 該IRQ時,沒有非安全性執行緒轉換,#因此當由安 作業系統的返回中斷管理器收到軟體仿製中斷時,龙 不需要任何執行緒轉換和在第15步驟僅是重新繼續 使 斷 或 安 用 軟 安 行 些 統 軟 行 中 在 業 之 該 0 處 全 決 這 71 200417216 I全性執行緒SA. 第28圖是一流程圖,圖示由返回執行緒管理器所執行 的處理。在第4002步驟啟動返回執行緒管理器。在第4〇〇4 步驟,當暫停安全性作業系統時,對軟體仿製中斷的返回 執行緒識別符進行檢查和與現有執行安全性執行緒比較。 如果該些符合,則程序進行至第4006步驟,當中安全性執 行緒重新繼續。如果在第4004步驟的比較未符合,則程序 進行至第4008步驟,其中在第4010步驟轉換至新的安全 性執行緒之前,儲存舊的安全性執行緒的内容,(為爾後的 重新繼續)。新執行緒已經在進行中,所以第4〇1〇步驟重 新繼續。 使任務 性作業 協調它 器操作 行一非 安全性 一軟體 進入在 中,在 行任何 對應的 式將控 ^ _不I恿理,藉此一受控安全性作業系統可 轉換由主控非安全性作業系統執行。該主控非安 系統可以是不具月通訊機制的一舊版作業系統, 的動作以配合其他作業系統,及因此只作為一主After the security thread SA Kariya is stored, the security system is triggered to convert the thread into a non-female omnidirectional thread set by the NSB. After that, he can re-open the full thread SA at the request β ~ 《Yu from the interruption point. Figure 27 illustrates in another example of the behavior type shown in Figure 26. 'When the program is under the control of a non-safety operating system with this IRQ, there is no non-safety thread transition, and therefore # When the software imitation interrupt is received by the return interrupt manager of the security operating system, the dragon does not need any thread conversion and in step 15 it just resumes enabling or installing the security software. This decision 71 200417216 I omnidirectional thread SA. Figure 28 is a flowchart illustrating the processing performed by the return thread manager. The return thread manager is started in step 4002. In step 4004, when the security operating system is suspended, the return thread identifier of the software imitation interrupt is checked and compared with the existing execution security thread. If they match, the process proceeds to step 4006, where the security thread resumes. If the comparison in step 4004 does not match, the program proceeds to step 4008, where the content of the old security thread is stored before step 4010 transitions to the new security thread (for re-continuation later) . The new thread is already in progress, so step 4010 is resumed. Coordinate mission operations with other non-secure and software applications, and any corresponding formulas in the line will be controlled ^ _ irrelevant, whereby a controlled security operating system can be switched by the main control non-secure Sexual operating system execution. The main control non-security system can be an old operating system without a monthly communication mechanism, which acts to cooperate with other operating systems, and therefore only acts as a master

O Jjl^l ^oF rK Q 圖之一初始進入點,非安全性作業系統 子生拥 轨订緒NSA。該非安全性執行緒NSA呼叫 執行緒,兮 λ μ女全性執行緒欲由安全性作業系統利 中斷(― ΜΙ呼叫)執行。在第2步驟,該SMI呼 一監控楹+ + 德、 、八中執行的一監控程式,據以在第4步 傅遞呼叫推 入安全性作業系統之前,該監控程式 *要的内t ^ ^ 讀存和轉換。此時安全性作業系統起 文全性執扞泳 τ缚SA。該安全性執行緒可能藉由監控 制退回至非6 女全性作業系統,例如由於一定時事 72 200417216 或類似者。在第9步驟,當非安全性執行緒NSA再度將控 制再次傳遞至安全性作業系統時,它藉由再度發出原始軟 體中斷以達成。軟體包括辨識NSA的非安全性執行緒ID、 欲啟用之目標安全性執行緒ID的安全性執行緒ID,即辨 識安全性執行緒SA的執行緒ID,以及其他的參數。O Jjl ^ l ^ oF rK Q One of the initial entry points in the graph, the non-safety operating system has a subordination to the NSA. The non-safety thread NSA calls the thread, and the λ μ female general thread is intended to be executed by the security operating system (-MI call). In the second step, the SMI calls a monitoring program which is executed by 楹 +, German, and Ba. Based on this, the monitoring program * requires the internal t ^ before the 4th step of the call is pushed into the security operating system. ^ Load and convert. At this point, the safety operating system is fully committed to defending the τbound SA. The security thread may be returned to a non-6 female holistic operating system through a monitoring system, such as due to certain current events 72 200417216 or similar. At step 9, when the non-safety thread NSA re-transmits control to the secure operating system again, it does so by issuing the original software interrupt again. The software includes the non-safe thread ID identifying the NSA, the security thread ID identifying the target security thread ID to be enabled, the thread ID identifying the security thread SA, and other parameters.

當在第9步驟所產生的呼叫由監控程式所傳遞,和在 第1 2步驟藉由安全性作業系統在安全性網域中接收時,能 夠檢查該非安全性執行緒ID,以決定是否已被非安全性作 業系統轉換了内容。也可以檢查目標執行緒的安全性執行 緒ID,以了解安全性作業系統下的正確的執行緒是否已重 新起動或以一新的執行緒起動。在第2 9圖的示例中,在安 全性網域中不需要由安全性作業系統進行任何執行緒轉 換。When the call generated in step 9 is passed by the monitoring program and received in the secure domain by the secure operating system in step 12, the non-secure thread ID can be checked to determine whether it has been Non-secure operating systems converted content. You can also check the security thread ID of the target thread to see if the correct thread under the security operating system has been restarted or started with a new thread. In the example in Figure 29, no thread conversion is required by the security operating system in the security domain.

第30圖與第29圖類似,除了第9步驟,執行緒的轉 換在非安全性作業系統的控制下,在非安全性網域中發生 以外。因此,在第11步驟中,使軟體中斷呼叫橫跨至安全 性作業系統的,是一不同的非安全性執行緒NSB。在第1 4 步驟,安全性作業系統確認非安全性執行緒NSB的不同執 行緒ID,並因此執行涉及儲存安全性執行緒S A的内容和 開始該安全性執行緒SB的任務轉換。 第3 1圖是一流程圖,圖示當接收一軟體中斷以作為一 啟動或重新繼續安全性作業系統的執行緒之呼叫時,由安 全性作業系統所執行的處理。在第40 1 2步驟中,接收了該 呼叫。在第4014步驟中,檢查呼叫的參數,以決定他們是 73 200417216 否在安全性作業系統中,與現有啟用的安全性執行緒相符 合。如果符合,則在第 401 6步驟重新開始該安全性執行 緒。如果不符合,則程序進行至第401 8步驟,其中決定是 否可使用新近請求的執行緒。該新近請求的執行緒可能因 為它是或它需要一特有資源,又該資源已經被在一安全性 作業系統中的一些其他的執行緒所使用,所以無法獲得。 在這種情況下,在第4020步驟中,以一適當訊息傳回非安 全性作業系統,拒絕該呼叫。如果在第40 1 8步驟決定新執 行緒可用,則程序進行至第4022步驟,其中舊的安全性執 行緒的内容被儲存,以供之後可能重新開始之用。在第 4024步驟,如同對安全性作業系統所進行的軟體中斷呼叫 之設定,轉換至新的安全性執行緒。 第3 2圖圖示一操作,據以進行一優先權倒置,當在具 有多個作業系統之一系統中處理中斷時,由不同的作業系 統處理不同的中斷。 處理以安全性作業系統執行一安全性執行緒 SA開 始。而後由——第一中斷Int '1所中斷。其在監控模式中觸 發監控程式,以決定是否中斷要在安全性網域或非安全性 網域中處理。在這種情況下,該中斷欲在安全性網域處理, 而程序返回到安全性作業系統以及開始中斷Int 1的中斷 處理例式。中途藉由執行Int 1的中斷處理例式,具有較 高優先權的一進一步中斷Int 2被接收。因此,停止Int 1 的中斷管理器和用以在監控模式中決定中斷Int 2在何處 處理之監控程式。在這種情況下,中斷Int 2要由非安全 74 200417216 性作業系統處理,並因此把控制傳遞至非安全性作業系統 和啟始的Int 2之中斷管理器。當中斷Int 2的管理器完成 時,非安全性作業系統不具有指示在安全性網域中服務被 暫停的暫停中斷Int 1的資訊《因此,非安全性作業系統 可以執行一些進一步步驟,例如任務轉換或啟始不同的非 安全性執行緒NSB,當仍然未能對原始中斷Int 1提供服 務時。 第3 3圖圖示一技術,據以避免與第3 2圖的操作相關 的問題。當中斷Int 1發生時,監控程式把它傳遞至一存 根(STUB)中斷管理器啟動處之非安全性網域。該存根中斷 管理器是相對地小且快速藉由監控模式使程序返回安全性 網域,和在安全性網域中觸發中斷Int 1的中斷管理器。 該中斷Int 1主要在安全性網域中處理,而在非安全性網 域中存根中斷管理器的啟動能夠視為一種型態的位置保持 記錄,其指示非安全性網域,中斷在安全性網域中暫停。 在安全性網域中,中斷Int 1的中斷管理器再次受到 高優先權Int 2的支配。在非安全性網域中,仍舊觸發中 斷Int 2的中斷管理器的執行。然而,在這種情況下,當 Int 2的中斷管理器完成時,非安全性作業系統便擁有指示 存根中斷管理器的資料,因為中斷Int 1仍然是未完成的, 以及因此將重新繼續該存根中斷管理器。該存根中斷管理 器將出現,如同它暫停於其進行回到安全性網域的呼叫 處,據此該呼叫將再次執行並因此轉換至安全性網域。一 旦回到安全性網域,安全性網域在其中斷處能夠自己再次 75 200417216 開始中斷Int 1的中斷管理器。當中斷int i的中斷管理 在安全性網域中完成肖,進行回到非安全性網域的呼叫 以在原來的執行安全性執行緒SA重新繼續前在非安 性網域中關閉存根中斷管理器。 第34圖圖示與匕們的優先權相關之不同類型中斷, 及如何處理它們。可以使用純粹安全性網域中斷管理器 處理高優先權中斷,確保沒有較高優先權的中斷由非安 性網域處理。一旦有一中斷具有比後續中斷較高之優 權’並在非安全性網域中處理,則所有較低優先的中澌 不是純粹在非安全性網域中處理,就是利用在第3 3圖所 存根中斷管理器技術,據以使非安全性網域可以持續追 那些中斷,即使它們主要處理在安全性網域中發生者。 如先前所述者,使用監控模式來在安全性網域和非 全性網域之間執行轉換。在實施例中,在兩不同網域之 共用登錄,這涉及儲存該些登錄中的狀態到記憶體,而 自記憶體為終點網域載入這種新狀態至登錄中。對未在 網域之間共用的任何登錄而言,不須儲存狀態,因為該 登錄不會被其他網域所存取,而在該些狀態之間轉換係 為在安全性和非安全性網域之間轉換的一直接結果(即, 一 CP15登錄之一中儲存的S位元的值決定所使用之非 用登錄)。 當在監控模式中由處理器設定資料控制處理器對記 體的存取時,部分狀態需要被轉換。因為在每一網域中 不同的記憶體,例如,安全性網域存取安全性記憶體以 器 , 全 以 y 全 先 若 示 蹤 安 間 後 兩 些 作 在 共 憶 有 儲 76 200417216 存安全性資料,該安全性記憶體不能從非安全性網 取,很明顯地,處理器設定資料將需要在轉換網域時g 如第35圖所示,在CP15登錄34中儲存該處理 定資料,而在一實施例中,該些登錄在網域之間共用 此,當在安全性網域和非安全性網域之間轉換監控 時,現存於CP 1 5登錄3 4的處理器設定資料需要自 轉出至記憶體,而與終點網域有關的處理器設定資料 載入至CP15登錄34。 因為 CP 1 5登錄中的處理器設定資料通常在系統 記憶體的存取有立即的影響,則很明顯地,如果在監 式中操作時由處理器更新了它們,該些設定將立即生 然而,對在監控模式中欲設定處理器設定資料的一靜 定之監控模式而言,這是不希望發生的。 因此,如第3 5圖所示,在本發明監控模式一實施 提供特定的處理器設定資料2000,它能夠用來覆蓋 登錄3 4的處理器設定資料3 4,當處理器在監控模式 作時。如第35圖所示,在它輸入時,藉由多工轉換器 接收儲存在CP 1 5登錄的處理器設定資料和監控模式 處理器設定資料2000,可加以達成。此外,多工轉換器 經由路徑20 1 5,接收一控制信號,指示是否處理器現 監控模式中操作。如果處理器不是在監控模式中操作 在CP 1 5登錄3 4的處理器設定資料被輸出至系統,但 理器是在監控模式中操作的情況下,反之,該多工轉 2010輸出監控模式專屬處理器設定資料2000,以確保 域存 匕變。 器設 〇因 模式 CP15 需要 中對 控模 效。 態設 例中 CP15 中操 2010 專屬 2010 下在 ,則 在處 換器 所應 77 200417216 用的處 操作時 監 在系統 设计該 當在一 監控模 定資料 式專屬 的任何 組個別 通 模式中 上述實 記憶體 式中時 至實體 被安排 即,將 器能夠 址的映 當 設定資 態位元 處理器在監控模式中操作 料通常也允許處理器存取 形式的記憶體允許資料設 理器設定資料是一致的,當處理器是在監控模式中 控模式專屬處理器設定資料可以寫死(Hard-C(>ded) 中 從而確保其不能被彳呆縱。然而,亦有可能程式 監控模式專屬處理器設定資料’而不損害安全性, 安全性權限模式中操作時,確保只能由處理器修改 式專屬處理器設定資料。就監控模式專屬處理器設 的設定而言,這允許一些彈性。如果安排該監控模 處理器設定資料為可程式設計的,則能夠在系統中 適當地方儲存設定資料,如在CP 1 5登錄34中的一 的登錄3 4中。 常,設定監控模式專屬處理器設定資料,以在監控 為處理器的操作提供一非常安全的環境。因此,在 施例中,該監控模式專屬處理器設定資料可能設定 管理單元30為失效的,當該處理器係操作於監控模 ,據此,使可能被該記憶體管理單元所應用的虛擬 記憶體轉譯失效。在此類狀況下,該處理器將總是 為直接發出實體位址,當發出記憶體存取請求日^, 一 I/、、Τ輝忭旰,肩 可靠地存取記憶體,而不管是否任何虛擬至實覺 射是相配合的。 時’監控模式專屬處理器 2全性資料。其由網域狀 為佳,在安全性處理器 78 200417216 設定資料中,具有相同值的網域狀態位元會被設定給相同 值的網域狀態位元("S”位元)。因此,不管儲存在CP 15登 錄中的網域狀態之實際值為何,該值會被由監控模式專屬 處理器設定資料所設定的網域狀態位元所覆蓋,以確定監 控模式已存取安全性資料。 監控模式專屬處理器設定資料可以設定其他用來控制 對部分記憶體存取的資料。例如,當處理器在監控模式中 操作時,監控模式專屬處理器設定資料可以設定快取3'8 不要用來存取資料。 在上述的實施例中,已經假設所有含有處理器設定資 料的CP 1 5登錄都在網域間被共用。然而,在一選擇性的 實施例中,將一些CP15登錄予以「分塊(banked)」,例如, 有用以儲存處理器設定資料的一特定項目的兩登錄,一登 錄可以在非安全性網域中存取並含有非安全性網域的處理 器設定資料之項目值,和另一登錄在安全性網域可在安全 性網域中存取並含有安全性網域的處理器設定資料之項目 值° 不被分塊的一 CP15登錄是含有”S’1位元者,但原則上 如果希望的話,任何其他的CP 1 5登錄都可以被分塊。在 此類實施例中,由監控模式所做的處理器設定資料的轉 換,涉及將任何共用的CP 1 5登錄轉換至記憶體中,現在 該處理器設定資料在在該些共用登錄中,和在該些共用的 CP 1 5登錄中,載入與終點網域有關的處理器設定資料。對 任何分塊的登錄而言,不必儲存該處理器設定資料至記憶 79 200417216 體中,相反地,由於改變儲在相關的共用CP 1 5登錄中的s 位元值,轉換將自動地發生。 如先前所述,監控模式處理器設定資料將一網域狀態 位元,其覆蓋儲存在CP15登錄的資料,但是具有與用於 安全性網域之網域狀態位元相同之值(即,在上述實施例中 的S位元值1)。當一些CP 15登錄被分塊時,它意味著在 第35圖中至少部分監控模式專屬處理器設定資料2000能 夠從在被分塊的登錄中儲存的安全性處理器設定資料中導 出,因為在轉換處理期間未對記憶體寫入出該些登錄内容。 因此,舉一示例,因為監控模式專屬處理器將設定一 網域狀態位元,以覆蓋當不在監控模式中所使用者。而在 較佳實施例中,它有與在安全性網域中所使用者相同的 值,它意味著選擇可存取的分塊CP15登錄的邏輯是允許 存取安全性分塊CP 1 5。藉由允許監控模式將該安全性處理 器設定資料用作監控模式專屬處理器設定資料的相關部 分,能夠實施對資源的儲存,因為不再需要為監控模式專 屬處理器設定資料的該些項目提供一組個別的登錄。 第 3 6圖是一流程圖,圖示當需要在一網域之間轉換 時,用以執行處理器設定資料的轉換的步驟。如先前所述, 發出一 S ΜI指令,以促使進行網域之間的轉換。因此,在 第20 20步驟,等待一 SMI指令的發出。當接收一 SMI指 令時,處理器進行至第2030步驟,其中處理器在監控模式 中開始執行監控程式,它使該監控模式專屬處理器設定資 料被使作在前往多工轉換器2010的路徑2015上的控制信 80 200417216 號的結果,導致多工轉換器轉換監控模式專 資料。如先前所述,它可能是一組自我包含 以從在被分塊的登錄中儲存的安全性處理器 到某些部分。 ° 此後’在第2〇4〇步驟,自發出^⑷指 網域儲存現有的狀態,它包括從任何共用的 儲存與上述網域相關的處理器設定資料狀態 出部分記憶體,以供儲存此類狀態之用。而 步驟,轉換狀態指標為指向含有終點網域的 憶體。因此,通常,為了儲存狀態資訊配置兩 一配置為儲存非安全性網域的狀態,而一配 性網域的狀態。 一旦在第2050步驟轉換了狀態指標,現 才曰向的狀態在第2 0 6 0步驟中被載入相關的女 裡’其包含為終點網域所載入之相關處理器 後,在第2070步驟,當在監控模式中時,監 而之後處理器在終點網域中轉換至所需要的; 第3 7圖詳細圖示本發明一實施例之記 30的操作。該記憶體管理邏輯包含一記,丨 (MMU)200和一記憶體保護單元(MPU)220。 擬位址的核心1 0發出的任何存取請求將經由 至該MMU 2 00,該MMU 2 00負責執行預定 能,尤其是決定與虛擬位址對應的實體位址 許可權限和決定區域屬性。 屬處理器設定 的資料,或可 設定資料所得 令至記憶體的 CP15登錄, 。通常,會撥 後,在第2050 對應狀態之記 部分記憶體, 置為儲存安全 下狀態指標所 ^用CP15登錄 設定資料。此 控程式退出, 模式。 憶體管理邏輯 意體管理單元 由被設定一虛 路徑234傳遞 的存取控制功 ,和決定存取 81 200417216 資料處理設備%記憶㈣統包含安全性記憶體Fig. 30 is similar to Fig. 29, except that in the ninth step, the thread transition occurs under the control of the non-safety operating system and occurs in the non-safety domain. Therefore, in step 11, it is a different non-security thread NSB that makes the software interrupt call across the secure operating system. In step 14, the security operating system confirms the different thread IDs of the non-security thread NSB, and thus performs a task transition involving storing the content of the security thread SA and starting the security thread SB. FIG. 31 is a flowchart illustrating a process performed by the security operating system when a software interrupt is received as a call to start or resume the thread of the security operating system. In step 40 12 the call is received. In step 4014, the parameters of the call are checked to determine whether they are 73 200417216 in the security operating system and are consistent with the security threads currently enabled. If so, restart the security thread at step 4016. If not, the process proceeds to step 4018, where a decision is made as to whether the newly requested thread can be used. The newly requested thread may not be available because it is or it requires a unique resource, and the resource is already used by some other thread in a secure operating system. In this case, in step 4020, an appropriate message is returned to the non-secure operating system to reject the call. If it is determined in step 40 1 8 that a new thread is available, the process proceeds to step 4022, in which the contents of the old security thread are stored for possible restarting later. At step 4024, a switch to a new security thread is performed as in the case of a software interrupt call to the security operating system. Fig. 32 illustrates an operation according to which a priority inversion is performed. When interrupts are processed in one of the systems having a plurality of operating systems, different interruptions are handled by different operating systems. The process starts with the security operating system executing a security thread SA. Then interrupted by-the first interrupt Int '1. It triggers a monitoring program in monitoring mode to determine whether the interruption is to be handled in a secure or non-secure domain. In this case, the interrupt is intended to be processed in the security domain, and the program returns to the secure operating system and starts the interrupt processing routine of interrupting Int 1. By executing the interrupt processing routine of Int 1 midway, a further interrupt Int 2 with higher priority is received. Therefore, stop the interrupt manager of Int 1 and the monitor program used to determine where the interrupt Int 2 is handled in the monitoring mode. In this case, the interrupt Int 2 is handled by the non-safety operating system 74 200417216, and therefore passes control to the non-safety operating system and the interrupt manager of the original Int 2. When the manager of interrupt Int 2 is completed, the non-security operating system does not have the information indicating that the service is suspended in the security domain. The interruption Int 1 therefore, the non-security operating system can perform some further steps, such as tasks Switch or start a different non-safe thread NSB while still failing to service the original interrupt Int 1. Figure 33 illustrates a technique to avoid problems related to the operation of Figure 32. When interrupt Int 1 occurs, the monitor passes it to a non-secure domain at the start of the stub interrupt manager. The stub interrupt manager is a relatively small and fast interrupt manager that returns the process to the security domain through the monitoring mode and triggers the interrupt Int 1 in the security domain. The interrupt Int 1 is mainly processed in the security domain, and the startup of the stub interrupt manager in the non-security domain can be regarded as a type of location keeping record, which indicates the non-security domain, and the interrupt is in the security domain. Domain suspended. In the security domain, the interrupt manager for interrupt Int 1 is once again dominated by the high priority Int 2. In non-safety domains, the execution of the interrupt manager for Int 2 is still triggered. However, in this case, when the interrupt manager for Int 2 is complete, the non-secure operating system has the data to indicate the interrupt manager for the stub, because the interrupt Int 1 is still outstanding and the stub will therefore be resumed Interrupt manager. The stub interrupt manager will appear as if it were suspended at the point where it is making a call back to the secure domain, whereupon the call will be performed again and therefore transitioned to the secure domain. Once back to the security domain, the security domain is able to interrupt itself again at the location where it was interrupted. When the interrupt management of interrupt int i is completed in the security domain, make a call back to the non-security domain to close the stub interrupt management in the non-security domain before the original execution of the security thread SA resumes Device. Figure 34 illustrates the different types of interrupts related to the priorities of the daggers and how to deal with them. You can use a purely secure domain interrupt manager to handle high 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-secure domain, all lower-priority medians are either handled purely in the non-secure domain or are used in Figure 33. Stub interrupt manager technology, based on which non-secure domains can continue to chase those interrupts, even if they mainly deal with those who happen in the secure domain. As mentioned earlier, the monitoring mode is used to perform the transition between the security domain and the incomplete domain. In the embodiment, the common registration in two different domains involves storing the states in the registrations into memory, and loading the new state into the registration from the memory for the destination domain. For any login that is not shared between domains, there is no need to save the state, because the login will not be accessed by other domains, and the transition between these states is between secure and non-secure networks. A direct result of the conversion between domains (ie, the value of the S bit stored in one of the CP15 logins determines the unused logins used). When the processor sets data in the monitor mode to control the processor's access to the memory, some states need to be switched. Because the memory in each domain is different, for example, the security domain accesses the security memory device, all y are all traced first, then two are made in total memory 76 200417216 security Data, the secure memory cannot be fetched from a non-secure network. Obviously, the processor setting data will need to be stored in the CP15 registry 34 as shown in Figure 35 when the domain is switched. In an embodiment, the logins are shared between the domains. When the monitoring is switched between the secure domain and the non-secure domain, the processor setting data existing in the CP 1 5 login 3 4 needs to be rotated. Out to the 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 CP 1 5 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. For a static monitoring mode in which the processor setting data is to be set in the monitoring mode, this is undesirable. Therefore, as shown in FIG. 35, a specific processor setting data 2000 is provided in an implementation of the monitoring mode of the present invention, which can be used to overwrite the processor setting data 34 of the registration 3 4 when the processor is operating in the monitoring mode. . As shown in FIG. 35, when it is input, it can be achieved by receiving the processor setting data and monitoring mode registered in the CP 1 5 through the multiplexer. In addition, the multiplexer receives a control signal via path 20 1 5 to indicate whether the processor is operating in the monitor mode. If the processor is not operating in the monitoring mode, the processor setting data of CP 1 5 login 3 4 is output to the system, but if the processor is operating in the monitoring mode, otherwise, the multiplexing to 2010 output monitoring mode is exclusive The processor sets the data 2000 to ensure that the domain is protected from changes. Device setting 〇 Mode CP15 is required for mode control. In the state setting example, CP15 is used in 2010 and 2010 is dedicated to 2010. When operating at the place where the converter should use 77 200417216, the system design should be monitored in the system design. It should be in the above-mentioned real memory mode in any group of individual modes that are exclusive to the monitoring model The time to entity is arranged, that is, the address of the device can be set as the status of the bit processor. In the monitoring mode, the processor usually allows the processor to access the form of memory. The data manager sets the data to be consistent. When the processor is in the monitoring mode, the dedicated processor setting data can be written in Hard-C (> ded) to ensure that it cannot be stunned. However, it is also possible to program the dedicated processor setting data in the monitoring mode. 'Without prejudice to security, when operating in the security permission mode, ensure that the processor can only be modified by the processor-specific setting data. As far as the settings of the dedicated processor settings in the monitoring mode are concerned, this allows some flexibility. If this monitoring is scheduled The module processor setting data is programmable, so it can be stored in the system in an appropriate place. One of the records in 34 is registered in 3. 4. Often, the monitoring mode dedicated processor setting data is set to provide a very secure environment for the operation of the processor during monitoring. Therefore, in the embodiment, the monitoring mode dedicated processor The setting data may set the management unit 30 to be invalid. When the processor is operated in the monitoring mode, the virtual memory translation that may be applied by the memory management unit is invalidated. Under such conditions, the processor It will always send the physical address directly. When a memory access request is issued, I /, T and T will be able to reliably access the memory, regardless of whether any virtual to real telegraphy is compatible. The comprehensive data of the dedicated processor 2 of the 'Monitoring Mode'. It is better to have a network domain. In the security processor 78 200417216 setting data, the domain status bits with the same value will be set to the network with the same value. Domain status bit (" S "bit). Therefore, regardless of the actual value of the domain status stored in the CP 15 registry, the value will be set by the network set by the monitoring mode dedicated processor setting data The status bit overrides to determine that the security mode has accessed the security data. The monitoring mode-specific processor setting data can set other data to control access to part of the memory. For example, when the processor is operating in the monitoring mode In the monitoring mode, the dedicated processor setting data can be set to cache 3'8. Do not use it to access the data. In the above embodiment, it has been assumed that all CP 1 5 registrations containing processor setting data are shared between network domains. However, in an alternative embodiment, some CP15 entries are "banked". For example, there are two entries for a specific item used to store processor configuration data. One entry may be in a non-secure domain. The value of an item in the access and containing the processor configuration data of the non-secure domain, and another item registered in the security domain that can be accessed in the security domain and contains the processor configuration data of the secure domain A CP15 login that is not blocked is a "S'1 bit", but in principle any other CP 15 registration can be blocked if desired. In such embodiments, the conversion of the processor setting data by the monitoring mode involves the conversion of any shared CP 1 5 registrations into memory, and now the processor setting data is in the shared registrations, and In these shared CP 1 5 registrations, the processor setting data related to the destination domain is loaded. For any block registration, it is not necessary to store the processor setting data in the memory 79 200417216. On the contrary, due to the change of the s-bit value stored in the associated shared CP 15 registration, the conversion will occur automatically. 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 CP 15 logins are partitioned, it means that at least part of the monitoring mode-specific processor setting data 2000 in Figure 35 can be derived from the security processor setting data stored in the partitioned registration, because in These registrations are not written to the memory during the conversion process. 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. However, in the preferred embodiment, it has the same value as the user in the security domain, which means that the logic for selecting the accessible CP15 login is to allow access to the secure CP 15. By allowing the monitoring mode to use the security processor setting data as the relevant part of the monitoring mode-specific processor setting data, the storage of resources can be implemented because it is no longer necessary to provide these items for the monitoring mode-specific 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, an S MI command is issued to facilitate the transition between the domains. Therefore, in steps 20 to 20, an SMI instruction is issued. When receiving an SMI instruction, the processor proceeds to step 2030, where the processor starts executing a monitoring program in the monitoring mode, which causes the processor-specific data of the monitoring mode to be used as a path to the multiplexer 2010 2015 As a result of the control letter 80 200417216, the multiplexer converts the monitoring mode data. As mentioned earlier, it may be a set of self-contained to go from the security processor stored in the partitioned login to some parts. ° Thereafter 'in step 2040, the self-issued ^ ⑷ refers to the domain storage of the existing state, which includes a portion of the memory from any shared storage state of the processor setting data related to the above domain for storing this For class status. In the step, the conversion status indicator points to the memory containing the destination domain. Therefore, in general, in order to store the status information, two configurations are configured to store the state of the non-secure domain, and one configuration of the state of the adaptive domain. Once the status indicator has been converted in step 2050, the current status is loaded into the relevant female in step 2060. After it contains the relevant processor loaded in the destination domain, in 2070 Steps, when in the monitoring mode, and then the processor switches to the required one in the destination network domain; FIG. 37 illustrates in detail the operation of the record 30 of an embodiment of the present invention. The memory management logic includes a record (MMU) 200 and a memory protection unit (MPU) 220. Any access request issued by the core 10 of the intended address will pass through to the MMU 2000, which is responsible for performing reservations, especially determining the physical address permissions corresponding to the virtual address and determining the attributes of the area. The data belongs to the processor setting, or you can set the data acquisition order to register to CP15 in the memory. Usually, after dialing, part of the memory in the state corresponding to the 2050 will be stored as a status indicator under safe storage. ^ Use CP15 to register the setting data. This control program exits the mode. Memory management logic Memory management unit The access control function passed by a virtual path 234 is set and determines access 81 200417216 Data processing equipment% Memory system contains security memory

域中操作時。 安全性記憶體和非安 料的安全性記憶體只 其它主控裝置,當核 作和因此在安全性網 在第37 Η所*之本發明的實^列中,在非安全性模式When operating in a domain. Security memory and non-secure security memory only other master devices, when operating and therefore on the safety net in the implementation of the invention in the 37th place *, in the non-security mode

依據本發明之較佳實施例,在非安全性記憶體中提供 非安全性分頁表58,例如在外部記憶體56的一非安全 性記憶體部分, 並用以為在上述分頁表中所定義的每一非 女全性記憶體區域儲存對應的描述符(descriptor)。該描述 符所包含的資訊,可從中得到用以令MMU執行預定的存 取控制功能所需的存取控制資訊,並據以在參照第3 7圖所 述之實施例中,提供關於虛擬至實體位址映射的資訊、存 取許可權限、和任何區域屬性。 此外’依據本發明之較佳實施例,在記憶體系統的安 ’至少提供一安全性分頁表58,例如在外部 記憶體56的一安全性部分中,其再次為在該表中所定義的 一些記憶體區域提供一相關的描述符。當處理器在一非安 全性模式中操作時,將參考該非安全性分頁表,以獲得用 於管理記憶體存取的相關描述符,反之,當處理器在安全 82 200417216 性模式中操作時,將使用來自安全性分頁表的描述符。 自相關分頁表獲得描述符至MMU的過程如下。由核 心1 〇發出的記憶體存取請求設定一虛擬位址,一查詢執行 於micro-TLB 206(TLB係主要轉譯參考緩衝(translation lookaside buffer)),其為一些虛擬位址部分之一儲存獲自 相關分頁表的對應實體位址部分。因此,micro-TLB 206 將把虛擬位址的一某部分與在micro-TLB中儲存的對應虛 擬位址部分比較,以決定是否符合。比較的部分通常是虛 擬位址的多數重要位元的一些預定的數字,位元的數目依 據在分頁表58中的分頁粒度。在micro-TLB 206中執行的 查詢通常相對地快速,因為micro-TLB 206只包括相對地 少S的項目,例如八項。 當沒有在micro-TLB 206中找到符合者(hit)的時候, 則記憶體存取請求被經由路徑242傳遞到含有獲取自該些 分頁表的一些描述符之主要TLB 208。稍後將在下文中進 一步討論,來自非安全性分頁表和安全性分頁表的描述符 都能夠在主要TLB 208中共存,而在主要TLB中的每一項 1都具有一對應的旗標(本文中稱為網域旗標),其可設定 以指示是否在項目中對應的描述符已經從一安全性分頁表 或一非安全性分頁表獲得。吾人將了解,對於所有在它們 的記憶體存取請求中直接設定實體位址的安全性模式操作 而言,是不需要主要TLB中的此類旗標的,當主要TLB 只儲存非安全性描述符時。 在主要TLB 208中,執行一類似查詢程序,以決定是 83 200417216 否在^ it體存取明求中發出的虛擬位址的相關部分對應於 在主要TLB 208中與描述符相關的任何虛擬位址部分,又 該主要TLB相關於操作的特定模式。因此,如果核心i 〇 在非安全性模式中操作,主要TLB 2〇8中只有已經從非安 全性分頁表得到的該些描述符會被檢查,反之如果核心i 〇 在安全性模式中操作,則在主要TLB中只有已經從安全性 分頁表得到的描述符會被檢查。 如果在主要TLB中,檢查處理的結果有符合者,則自 相關描述符提取存取控制資訊並經由路徑242傳送。尤其 是’描述符的虛擬位址部分和對應的實體位址部分將經由 路徑上242被繞送到micro-TLB 206,以儲存在micr〇-TLB 的一項目中,載入存取許可權限至存取許可邏輯2〇2,而 載入區域屬性至區域屬性邏輯204。存取許可邏輯2〇2和 區域屬性邏輯204可以與micro-TLB分離,或可以合併於 micro-TLB 中。 此刻,MMU 200能夠處理記憶體存取請求,因為現下 在 micro-TLB 206 中有將一符合者。因此,micr〇-TL]B 2〇6 將產生實體位址,其可能經由路徑23 8輸出至系統匯流排 4〇,以繞送至相關的記憶體,這若不是藉由晶片整合 (on-chip)記憶體,如TCM 36、快取38等等,就是藉由可 經由外部匯流排界面42存取的外部記憶體單元之一。同 時,記憶體存取邏輯202將決定是否允許記憶體存取,和 如果不允許核心在現有模式的操作中存取該特定的記憶體 位址,則經由路徑2 3 0發出〆中止訊號回到核心1 〇。例如, 84 200417216 不論在安全性記憶體或非安全性記憶體中,當核心在監督 模式下操作時,核心設定記憶體的特定部分為只能被核心 所存取,而因此,當在例如使用者模式下時,如果核心企 圖存取此類記憶體位址,存取許可邏輯202將偵測到核心 10目前不具有適當的存取權限,並藉由路徑23 0發出中止 信號。這將使記憶體存取中止。最後,區域屬性邏輯204 將決定特定記憶體的區域屬性,例如是否存取是可快取 的、可緩衝的、等等,和經由路徑232發出此類信號,其 中將用它們來決定記憶體存取請求的資料是否能夠被快 取,例如在該快取3 8中,是否在寫入存取的情況下,所寫 入的資料能夠被緩衝,等等。 在主要TLB 208中沒有符合者的情況下,則轉譯表行 走邏輯(translation table walk logic)210被用來存取相關 分頁表5 8,以經由路徑2 4 8截取所需要的描述符,而後經 路徑246 安全性分 錄 CP15 安全性網 定,當轉 反之亦然 錄的内容 一轉譯表 執行之網 。而後該 令描述 頁表和 34中, 域或非 換在非 ,網域 在本文 行走程 域,和 虛擬位 付傳遞至主要TLB 208,以儲存取其中。 安全性分頁表兩者的基礎位址將儲存在 而處理器核心1〇所操作的現有網域, 安全性網域,亦將在CP 15的一登錄中 女全性網域和安全性網域之間發生時, 狀態登錄將由監控模式設置。網域狀態 中將稱作網域位元。因此,如果需要執 序’該轉譯表行走邏輯210將知道核心 因此知道所用以存取該相關表的基礎位 址被用作對該基礎位址的補償,以在適 85 200417216 當的分頁表中存取適當的項目,以獲得所需要的描述符β 一旦由轉譯表行走邏輯21〇戴取了該描述符,並置於 主要TLB 208中’則在該主要TLB中將獲得一符合者, 以及呼叫先前描述的程序’以戴取存取控制資訊,和將它 儲存在micro-TLB 206、存取許可邏輯中2〇2和區域屬性 邏輯204中’而後記憶體存取可由MMU2〇〇作動。 如先前所述,在較佳實施例中,主要TLB 208能夠儲 存來自安全性分頁表和非安全性分頁表兩者的描述符,但 是、一旦在micro-TLB 206中儲存了相關資訊,只能由mMU 2 00處理§己憶體存取清求。在較佳實施例中,在主要 208和micro-TLB 206間的資料傳輸是由位於Mpu 22〇的 分割檢測器222所監控,以確保當核心i 〇在一非安全性模 式中操作時,沒有存取控制資訊自主要TLB中的描敘符傳 輪至miCr〇-TLB 206中,如果這樣的話,將導致在安全性 記憶體中產生一實體位址。 —記憶體保護單元係由安全性作業系統所管理,其能 疋於在安全性δ己憶體和非安全性記憶體之間定義分割 、5 3 4刀割 > 訊的登錄中。而後分割檢測器2 2 2能參 刀資訊,以決定的是否存取控制資訊傳輸至micr〇-TI 胃〇6 ’其允許在一非安全性模式中由核心1 〇存取安全性 隱:。尤有甚者’在較佳實施例中,當核心、1 0係操作於 :安全性模式中,如同在cpi5網域狀態登錄中由監控 式所設定的網域位开6 _ 位疋所私不般,可操作分割檢測器222 …徑2“,監控企圖自…TLB2〇8榻取 86 200417216 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 〇在一非安全性模式和一安全性模式 藉由監控模式改變’監控模式將改變C p 1 5網域狀態 中網域位元值’以指示處理器的操作所變成的網域。 網域之間傳輸程序的一部分,將清除micr〇 TLB 206 因此在安全性網域以及非安全性網域之間轉換之後的 έ己憶體存取將在micro-TLB 206產生不符者(miss), 求自主要TLB208截取存取資訊,或直接自相關分頁 取相關的描述符。 藉由上述方法,吾人將了解,分割檢測器2 2 2將 當核心在非安全性網域中操作時,如果意圖截取允許 安全性5己憶體的micro-TLB 206存取控制資訊,將產 記憶體存取中止。 如果處理器核心1 0操作的任何模式中,安排記憶 取請求以直接設定〆實體位址,則在MMU 200的操 式中將失效’而實體位址將經由路徑236傳遞至According to a preferred embodiment of the present invention, a non-secure page table 58 is provided in the non-secure memory, such as a non-secure memory portion of the external memory 56, and is used for each of the definitions in the page table. A non-feminine memory area stores a corresponding descriptor. The information contained in the descriptor can be used to obtain the access control information required for the MMU to perform a predetermined access control function, and accordingly, in the embodiment described with reference to FIG. 37, the virtual to Information about physical address mappings, access permissions, and any locale attributes. In addition, according to a preferred embodiment of the present invention, the security of the memory system provides at least a security paging table 58, such as in a security section of the external memory 56, which is again defined in the table Some memory areas provide an associated descriptor. When the processor is operating in a non-secure mode, it will refer to the non-secure paging table to obtain relevant descriptors for managing memory accesses. Conversely, when the processor is operating in secure 82 200417216 sexual mode, 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 the micro-TLB 206 are generally relatively fast because the micro-TLB 206 includes only relatively few S 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 below, descriptors from both the non-security paging table and the security paging table can coexist in the main TLB 208, and each entry 1 in the main TLB has a corresponding flag (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. In the main TLB 208, execute a similar query procedure to determine whether it is 83 200417216 or not. The relevant part of the virtual address issued in the ^ it body access request corresponds to any virtual bit related to the descriptor in the main TLB 208 Address part, and this particular TLB is related to a specific mode of operation. Therefore, if the core i 〇 operates in non-security mode, only those descriptors in the main TLB 2008 that have been obtained from the non-security paging table will be checked, otherwise if the core i 〇 operates in security mode, Only the descriptors that have been obtained from the security paging table are checked in the main TLB. 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 in the micr0-TLB, loading the access permission to The access permission logic 202 is loaded, 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 process memory access requests, as there is now a match in the micro-TLB 206. Therefore, micr0-TL] B 2 06 will generate a physical address, which may be output to the system bus 4 0 via path 23 8 to be routed to the relevant memory, if not by chip integration (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 core is not allowed to access the specific memory address in the operation of the existing mode, it will send a 〆stop signal back to the core via path 2 30 1 〇. For example, 84 200417216, 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 used in, for example, In the user mode, 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 permissions, and issue a suspension signal via path 230. This will suspend memory access. Finally, the region attribute logic 204 will determine the region attributes of a particular memory, such as whether the access is cacheable, bufferable, etc., and issue such signals via path 232, which will be used to determine memory storage Whether the requested data 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 that there is no match in the main TLB 208, the translation table walk logic 210 is used to access the relevant paging table 5 8 to intercept the required descriptors through the path 2 4 8 and then The path 246 security entry CP15 security net is set, and when the content is reversed and vice versa, a translation table is executed on the net. Then in the order description page table and 34, the domain or non-switching is in non-, the domain is in this document, and the virtual bit is passed to the main TLB 208 for storage and retrieval. The base addresses of both the security paging tables will be stored in the existing domains operated by the processor core 10, the security domains, and the women ’s comprehensive domains and security domains in a login of CP 15 When this happens, the status registration will be set by the monitoring mode. The domain status will be called the domain bit. Therefore, if it is necessary to execute the order, the translation table walking logic 210 will know the core and therefore know that the base address used to access the related table is used as compensation for the base address, in order to store it in the appropriate paging table. Take the appropriate item to obtain the required descriptor β Once the descriptor is taken by the translation table walking logic 21, and placed in the main TLB 208 ', a match will be obtained in the main TLB, and the previous call will be made The procedure described is to retrieve access control information and store it in micro-TLB 206, access permission logic 202 and area attribute logic 204, and then memory access can be performed by MMU2000. As mentioned earlier, in the preferred embodiment, the main TLB 208 can store descriptors from both the secure and non-secure paging tables, but once the relevant information is stored in the micro-TLB 206, only Processed by mMU 2 00 § Memory access request. In the preferred embodiment, the data transmission between the main 208 and the micro-TLB 206 is monitored by a segmentation detector 222 located at the Mpu 22o to ensure that when the core io operates in a non-security mode, there is no The access control information is passed from the descriptor in the main TLB to miCr0-TLB 206. If so, it will cause a physical address to be generated in the security memory. —The memory protection unit is managed by the security operating system, which can be used to define the division between the safety δ memory and the non-safe memory, and the registration of 5 3 4 cuts. Then the segmentation detector 2 2 2 can refer to the tool information to determine whether the access control information is transmitted to micr0-TI stomach 0 6 ', which allows the core 1 0 to access the security hidden in a non-security mode. What's more 'In the preferred embodiment, when the core, 10 is operating in the security mode, as in the cpi5 domain status registration, the domain bit is set to 6 by the monitoring mode. Unusually, the segmentation detector 222 can be operated ... path 2 ", and the monitoring attempt is to take any physical part of the TLB208 from 86 200417216 micro-TLB 206, and based on the physical part, decide whether it will be the virtual bit later The physical address generated by the address in the security memory. In this case, the partition detector 222 sends a stop signal to the core 2 0 to prevent the memory access. I will understand and be able to arrange the partition The detector 2 2 2 is stored in the micro-TLB 206 to prevent the body address portion, or the selective address portion is still stored in the micro-TLB 206, but the discontinued portion will be incorrectly removed from the micro-TLB 206. The physical address is deleted, for example, by clearing the micro-TLB 206. As long as the core 10 is in a non-security mode and a security mode is changed by the monitoring mode, the monitoring mode will change the domain status of the C p 1 5 domain. Bit value 'to indicate the processor The domain that the operation becomes. Part of the transfer process between domains will clear micr0TLB 206. Therefore, the memory access after the transfer between the secure domain and the non-secure domain will be in the micro- The TLB 206 generates a miss, and intercepts the access information from the main TLB 208, or directly retrieves the relevant descriptors from the relevant paging pages. By the above method, we will understand that the segmentation detector 2 2 2 will act as the core in non-security When operating in the sex domain, if you intend to intercept the micro-TLB 206 access control information that allows security 5 memory, the memory access will be suspended. If the processor core 10 is in any mode of operation, arrange memory access Request to directly set the “physical address, it will be invalid in the operation of MMU 200” and the physical address will be passed to path 236

位址 是在 經由 务生。 止實 實體 理的 分移 之間 登錄 作為 ,和 第一 和請 表截 確保 存取 生一 體存 作模 MPU 87 200417216 220 〇 在 屬性邏 域所定 可和區 是在只 分中, 意圖的 可邏輯 202在 核心〇 緩衝的 擬位址 存取, 從此類 為 取請求 CP15 ^ 體位址 經由路 上 圖的流 的程式 監控模 位元, 操作的一安全性模式中,存取許可邏輯224和區域 輯226依據替在cpi5 34中分割資訊登錄的對應區 義的存取許可權限和區域屬性,執行必要的存取 域屬性分析。如果企圖被存取的安全性記憶體位置 能在一特定模式操作中存取之安全性記憶體的一部 例如安全性權限模式,則核心在一不同模式操作^ 存取,例如,一安全性使用者模式,將導致存取許 224產生一中止,以相同於MMU的存取許可邏輯 此類環境中產生一中止的方法,經由路徑23〇傳至 同樣地,區域屬性邏輯226將產生可快取的以及可 信號’以相同於MMU的區域屬性邏輯204替以虛 設定的記憶體存取請求產生此類信號。假定允許該 此時存取請求經由路徑240進行至系統匯流排4〇 , ’其繞送至適當的記憶體單元。 了存取請求指定一實體位址之一非安全性存取,存 將藉由路徑236被繞送到分割檢測器222,其參照 卜錄3 4的分割資訊以執行分割檢查,以決定是否實 在安全性記憶體中指定一位置,該情況下,將再次 徑230產生中止信號。 述記憶體管理邏輯的程序現下參照第3 9圖和第40 程圖進一步詳盡描述。第39圖圖示在核心10執行 產生一虛擬位址的情況,如第300步驟所示。依據 式所設定之在CP 1 5網域狀態登錄34中的相關網域 將指示核心是否現下在一安全性網域或非安全性網The address is via the student. The registration action between the substantiation of the physical entity, and the first and the last table, please ensure that the accessor is integrated as a module MPU 87 200417216 220 〇 The summation zone defined in the attribute logic domain is in the only division, the logic of the intention 202 In the core address buffered pseudo address access, from this kind of program monitoring module bit fetches the CP15 ^ body address via the flow of the road map. In a security mode of operation, the access permission logic 224 and the region series 226 The necessary access domain attribute analysis is performed according to the access permission authority and area attributes of the corresponding zones registered in the cpi5 34 segmentation information registration. If the location of the secure memory that is being accessed can be accessed in a particular mode operation, such as a security permission mode, then the core operates in a different mode ^ access, for example, a security The user mode will result in a suspension of the access permission 224, and a suspension method in such an environment with the same access permission logic as the MMU. Passing through path 23 to the same, the area attribute logic 226 will generate a fast The fetch and signal can generate such signals with the same area attribute logic 204 as the MMU in place of a dummy memory access request. It is assumed that the access request at this time is allowed to proceed to the system bus 40 via the path 240, which is routed to an appropriate memory unit. In order for the access request to specify a non-secure access to a physical address, the storage will be routed to the partition detector 222 via path 236, which refers to the partition information of Listing 34 to perform a partition check to determine whether it is real A position is specified in the security memory. In this case, a stop signal will be generated in 230 again. The procedures for describing the memory management logic are now described in further detail with reference to Figures 39 and 40. FIG. 39 illustrates a case where a virtual address is generated when the core 10 executes, as shown in step 300. The relevant domains set in the CP 1 5 domain status registration 34 according to the formula will indicate whether the core is now in a secure or non-secure network.

88 200417216 域中執行。該情況下,核心正在一安全性網域中執行,過 程發展至第302步驟,其中在micro-TLB 206中執行一查 詢以了解是否虛擬位址的相關部分符合在micro-TLB中的 虛擬位址部分之一。如果在第302步驟中符合,處理直接 發展至第312步驟,其中存取許可邏輯2〇2執行必要的存 取許可分析。在第3 14步驟,其決定是否有一存取許可違 反’而如果有’則程序進行至第316步驟,其中存取許可 邏輯202經由路徑230發出一中止。否則,如果沒有存取 許可違反’則處理從第314步驟進行至第3 1.8步驟,其中 進行記憶體存取。特別是區域屬性邏輯2〇4將經由路徑232 輸出必要的可快取和可緩衝屬性,以及micro-TLB 206將 如稍早所述經由路徑238發出實體位址。 如果在第302步驟在micr〇-Tlb有不符者,則在第3〇4 步驟在主要TLB 208中執行一查詢程序以決定是否所需要 的安全性描述符在主要TLB中存在。否則,則在第306步 驟執行一分頁表行走程序,據以轉譯表行走邏輯210自安 全性分頁表獲得需要的描述符,如第37圖稍早所述。此時 程序進行至第308步驟,或直接從第304步驟進行至第3〇8 步驟’如果安全性描述符已經存在於主要TLB 208。 在第308步驟’其決定主要tlb現下含有該有效標籤 (tagged)的安全性描述符,以及因此程序進行至第31〇步 驟,其中在micro-TLB載入含有實體位址部分的描述符的 子部分。因為核心10現下正在安全性模式中執行,分割檢 測器2 2 2不需要執行任何分割檢查功能。 89 200417216 此時程序進行至第3 1 2步驟,其中記憶體存取的 部分如稍早所述般進行。 如果非安全性記憶體存取,處理從第3 00步驟進 第3 20步驟’其中在micro-TLB 206執行一查詢程序 一非安全性描述符決定對應的實體位址部分是否存在 果有’則程序直接發展至第336步驟,其中由存取許 輯202檢查存取許可權限。在該點應注意到,如果相 體位址部分是在micro-TLB中,其假設沒有安全性違 因為在被儲存到micro-TLB中之前,分割檢測器22 地監督該資訊。一旦在第336步驟已經檢查了該存 可’則程序進行至第3 3 8步驟,其中決定是否有任何達 其中存取許可錯誤中止在第316步驟發出。否則,程 行至第3 1 8步驟’其中記憶體存取的其餘部分如稍早 論般執行。 如果在第320步驟未有符合者位於micro-TLB, 序進行至第322步驟,其中在主要tlb 208執行一查 序以決定相關的非安全性描述符是否存在。否則,由 表行走邏輯210在第3 24步驟執行一分頁表行走程序 自非安全性分頁表戴取必要的非安全性描述符至主要 8此時程序進行至第326步驟,或直接自第322步 行至第326步驟,如果在第322步驟在主要TLB 2〇8 見将合者。在第326步驟,其決定主要TLB現下含有 慮的虛擬位址的有效附加的非安全性描述符,而後 3 28步驟分割檢測器222檢查從(在描述符中給定實體 其餘 行至 以自 0如 可邏 關實 反, 有效 取許 :反, 序進 所討 則程 尋程 轉譯 ,以 TLB 驟進 中出 所考 在第 位址 90 200417216 部分 指向 指向 有安 檢測 反, 有實 驟, 存取 作癀 錄中 在第 220 可, 行, 模式 割檢 安全 反, 全性 中的 產生 的)記憶體存取过 非安全性記憶體V:虛擬位址所產生的實體位址將 安全性記憶體中的置…’即如果實體位址 全性一違反,的—位[則在第33〇步驟,其決定 « 222^,,而程序進行至第332步驟,其中由分割 器222發出一安 14 /非女全性錯誤中止。 然而,如果电丨上入 〇檢測器邏輯222決定沒有安全性違 則程序進行至第3 u止 弟334步驟’其中在miCro-TLB載入含 體位址部分的相 々曰關描述符的子部分,其後在第336步 以先前所述之方+ 万式進仃記憶體存取。 參照第4〇圖超| τ ^ 、 下描述直接發出一實體位址的記憶體 請求的處理。如I & ^ 尤刖所迷,在該歷程中,MMU 200將 ,其最:由登錄一 MMU啟用位元之⑽的一相關登 的β又疋所達成,該設定程序由監控模式所執行。因此, 350 V驟,核心10將產生將經由路徑236傳送到MPU 裡的一實體位址。而後,在第352步驟,Mpu檢查許 以綠〜被明求的記憶體存取能夠以現有的操作模式進 即使用者監督、等等。此外,如果核心在非安全性 中操作’不論是否實體位址在非安全性記憶體中,分 測器222在第352步驟也將檢查是否實體記憶體在非 性模式中。而後,在第354步驟,其決定是否有一違 即,是否存取許可程序揭露了 一違反,或如果在非安 模式中,分割檢查程序續認了一違反。如果該些違反 任一發生,則程序進行至第356步驟,其中由Μρυ 220 一存取許可錯誤令止。吾人將了解,在某些實施例中, 91 200417216 在一種類型的中止之間沒有差別,而在選擇性的實施例 中’該中止仏號可公指不是否其關聯於_存取許可錯誤或 一安全性錯誤。 如果在第3 5 4步驟沒偵測到任何違反,程序進行至第 3 5 8步驟,其中發生記憶體存取由實體位址確認的位置。 在較佳實施例中,僅安排監控模式直接產生實體位 址,以及因此在所有其它情況中,如稍早所述般,MMU 200 將啟用以及將發生從記憶體存取請求的虛擬位址產生實體 位址。 第3 8圖圖示記憶體管理邏輯的一選擇性實施例,其中 所有記憶體存取請求都指定一虛擬位址,以及因此未在操 作的任何模式中直接產生實體位址。在該歷程中,吾人將 了解,不需要一個別的MPU 220,和反之分割檢測器222 能夠合併於MMU 200之中。這改變悄悄地發生,程序以 完全相同於稍早參照第37圖至第39圖所討論之模式進行。 吾人將了解,各種其它選擇亦有可能。例如,假定可 以由指定虛擬位址的安全性和非安全性模式發出記憶體存 取請求,能提供二MMU,一供安全性存取請求,和一供非 安全性存取請求,即,在第37圖中的Mpu 22〇能用一完 全的MMU取代。在這種情況下,可能不需要與每一 mmu 之主要TLB使用之旗標,其用以定義安全性或非安全性, 當一 MMU在它的主要TLB中儲存非安全性描述符,以及 另一 MMU在它的主要TLB儲存安全性描述符。當然,仍 然需要分割檢測器以檢查當核心在非安全性網域中時,是 92 否意圖存:^ \ , 予取文全性記憶體。 如果,選擇性地,所古 位址,一 所有記憶體存取請求直接指定實體 ^釋性的勃杆I、 古主炎,$ 仃了从使用二MPU,一供安全性存取 β月求和—供非安全性卢 的MPU 性存取請求。用於非安全性存取請求 、J犯有由安令_祕 ^ 文生14分割檢測器所監督之它的存取請 μ 非安全性模式中允許存取安全性記憶體。 嫩 罘3 8圖之任一安排可以提供進一步的特 ,可以安排分 . ° 〆、】器222以執行一些分割檢查,以監 S行走邏輯2 1 0的活動。尤其是,#果核心現下在 杳安全f生網域中操作,則能安排分割檢測Ε 222進行檢 T八要轉譯表行走邏輯210企圖存取一分頁表,其存取 非安+ W八15* 士 s 刀頁表而非安全性分頁表。如果偵測到一違反, 最好忐產生中止信號。因為轉譯表行走邏輯210通常藉由 使一分頁表基礎位址與由記憶體存取請求發出的虛擬位址 的某些位70結合,以執行該分頁表查詢,該分割檢測可能 /步及,例如,檢查轉譯表行走邏輯2 i 〇係使用一非安全性 分頁表的一基礎位址而非一安全性分頁表的一基礎位址。 第4 1圖圖示當核心丨〇在一非安全性模式中操作時, 由分割檢測器222執行的程序。吾人將了解,在正常的操 作下,從非安全性分頁表獲得的插述符應該只描述在非安 全性記憶體中映射的一分頁。然而,在軟體攻擊令,描述 符可能被竄改,以使它現下描述含有記憶體的非安全性和 安全性區域的一部分。因此,考慮第4丨圖之一示例,受篡 改的非安全性描述符可以涵蓋一分頁,其包括非安全性區 93 200417216 域370、372、374和安全性區域376、378、38〇。如果作 為記憶體存取請求的一部分發出的虛擬位址此時符合在一 安全性記憶體區域的一實體位址,如第41圖所示之安全性 記憶體區域3 7 6 ,則安排分割檢測器2 2 2產生一中止以防 止存取發生。因此,即使意圖存取安全性記憶體之企圖篡 改了非女全性描述符,分割檢测器2 2 2防止該存取發生。 相對地,如果使用該描述符導出的實體位址與一非安全性 記憶體區域一致,例如,如第41圖所示的區域374,則載 入micro-TLB 206裡的存取控制資訊僅確認該非安全性區 域3 74。因此,在非安全性記憶體區域374中的存取能夠 發生,但是,對任何安全性區域376、3 78或38〇的存取 不能夠發生。因此,可以看到即使主要TLB 2〇8可能含來 自已被竄改的非安全性分頁表的描述符,micr〇 TLB將只 包含實體位址部》,其將啟用對非安全性記憶體區域的存 取0 如稍早所述,在實施例中,非安全性模式和安全性模 式可以產生指定虛擬位址的記憶體存取請求,而後記憶體 最好都包括非安全性記憶體中的一非安全性分頁表,和安 全性記憶體中的一安全性分頁表。在非安全性模式中時, 轉譯表行走邏輯21〇將參考該非安全性分頁表,而在安全 性模式中時,轉譯表行走邏輯2 1 〇將參考安全性分頁表。 第42圖示該兩分頁表。如在第42圖所示,可能在例如第 1圖所示之外部記憶體56中的非安全性記憶體39〇包括在 其中之一非安全性分頁表395,其參考一基礎位址397在 94 200417216 一 CP15登錄〜 其可以再次在第〗…同樣地,在安全性記憶體400中, 的安全性分頁所w卜部記憶體56中,提供一對應 在一複製# P 5其由一安全性分頁表基礎位址407 你腹表的CP15登 4 中的每一描 、 ^疋。在非安全性分頁表395 W Μ 都將指向在非安全性記㈣390中的一對 應非女全性分頁,而在安全性八 /的對 都蔣定刀頁表405中的母一描述符 、疋義女全性記憶體4〇〇中 將A雜播#、、 τ旳對應女全性分頁。此外, 、 坪述的,對某些區域的圮情俨而一θ 記憶體區域410, 非% 疋可能共用 ,、為非女全性模式和安全性模式所能存 取0 第43圖依據較佳實施例,詳述在主要tlb 2〇8中執 1的查詢程序。如先前所述,主要TLB 208包括—網域旗 標425 ’其確認是否對應的描述符435係來自安全性分頁 表或非安全性分頁《。它確保當執行—查尋程序時,僅相 關於核心1〇所操作之特定網域的描述符會被檢查。第β 圖圖示一示例,其中核心執行於也稱作安全性情境之一安 全性網域。可自第43圖看出,當執行一主要TLB 2〇8查 詢時,它將導致忽略描述符440,和僅描述符445被認定 為查尋程序的候選者。 依據本發明之較佳實施例,在本文中亦稱作asid旗 標之一額外程序ID旗標43〇使提供以從程序專屬分頁表 確認描述符。因此,程序P1、P2和P3每一具有在記憶體 中提供的對應分頁表,和進一步可以對非安全性操作和安 全性操作有不同的分頁表。尤有甚者,吾人將了解,在安 95 200417216 全性網域中的程序PI、P2、P3可以完全獨立於在非安全 性網域中的程序PI、P2、P3。因此,如第43圖所示,除 檢查網域之外,當需要主要TLB查詢208時,也檢查Asid 旗標。 因此’在第43圖的示例中,在安全性網域,執行程序 P1,該查尋程序確認在主要TLB 208中僅兩項目450,以 及依據是否在兩描述符中有虛擬位址部分符合由記惊體存 取請求所發出的虛擬位址部分,產生符合者(hit)或不符者 (miss) ^如果有’則把該相關的存取控制資訊截取並傳遞 至micro-TLB 206、存取許可邏輯2〇2和區域屬性邏輯 204 ^否則,一不符者發生,以及轉譯表行走邏輯21〇被 用於從提供給安全性程序P1的分頁表截取需要的描述符 至主要TLB 208裡。熟知本項技藝者將了解,有許多管理 TLB的内容的技術,並因此當截取一新的描述符以儲存在 主要TLB 208中,而主要TLB已經滿載,可以用多數習知 技術之任一來決定欲自主要TLB去除的描述符,以為新描 述符製造空間,例如最近使用的方法,等等。 以〜吾人將了解,用於操作的安全性模式的安全性核心可 :完:獨立於非安全性作業系而發展。然而,纟某些情況 接 〖生核“和非女全性作業系統發展可以密切地連 ^而在此情況下’適於允許安全性應用使用非安全性描 接存、2,這將允許安全性應用藉由僅知的虛擬位址直 M 非安全性資料(以共用)。其當然假設安全性虛擬映 戸女全性虛擬映射可供特定ASID執行。在此類歷 96 200417216 程中,不 非安全性 述符執行 在較 分離的安 控制登錄 只由安全 在實 擬位址, 可獲得。 性登錄值 非安全性 傳遞參數 如猶 部分,以 由核心控 中定義之 以及最好 可定義每 域的屬性 施例’提 性記憶體 的區域屬 部分。 需要預先導入標簽以(即,網域旗標)在安全 描述符之間識別。反之在TLB中以所有可用 查詢。 佳的實施例中’在主要TLB的架構和先前所 全性和非安全性描述符的架構,能夠由在 中所提供的特定位元所設置。在較佳實施例 性核心設置該位元。 施例中,允許安全性應用直接使用一非安全 其亦可能從安全性網域使非安全性堆疊指標 匕月b夠藉由複製確遇非安全性堆疊指標的非 至CP15登錄34中的一專屬登錄。此時它將 應用依據被女全性應用所理解的規劃藉由該 〇 早所述,記憶體可能被分割為非安全性和安 及使用專屬於分割檢測器222之cpi5登錄 制該分割。基本分割方法係基於在典型Mpu 區域存取許可。因此,把記憶體分成多數區 能用它的基礎位址、大小、記憶體屬性和存 一區域。尤有甚者,當設計重疊區域時,上 擁有最高的優先權。此外,依據本發明之較 供一新的區域屬性以定義是否對應的區域在 或在非安全性記憶體中。由安全性核心使用 性來定義欲被作為安全性記憶體來保護的記 性和 的描 述之 CP15 中, 性虛 變為 安全 促使 堆疊 全性 34, 裝置 域, 取許 方區 佳實 安全 該新 憶體 97 20041721688 200417216 in the domain. In this case, the core is being executed in a security domain, and the process proceeds to step 302, in which a query is performed in the micro-TLB 206 to find out whether the relevant part of the virtual address matches the virtual address in the micro-TLB Part one. 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 3 1.8, where memory access is performed. In particular, the area attribute logic 204 will output the necessary cacheable and bufferable attributes via path 232, and the micro-TLB 206 will issue the physical address via path 238 as described earlier. If there is a discrepancy in micr0-Tlb in step 302, a query procedure is performed in the main TLB 208 in step 304 to determine whether the required security descriptor exists in the main TLB. Otherwise, a paging table walking program is executed in step 306, and the translation table walking logic 210 obtains the required descriptors from the security paging table, as described earlier in FIG. 37. At this time, the program proceeds to step 308, or directly from step 304 to step 308 'if the security descriptor already exists in the main TLB 208. At step 308, it is determined that the main tlb now contains the security descriptor of the tag, and therefore the program proceeds to step 31, where the micro-TLB is loaded with the child containing the descriptor of the physical address portion. section. Since the core 10 is currently being executed in the security mode, the partition detector 2 2 2 does not need to perform any partition check function. 89 200417216 At this point, the process proceeds to step 3 12 where the memory access is performed as described earlier. If the non-secure memory is accessed, the process proceeds from step 3 00 to step 3 20. 'Where a query procedure is performed in micro-TLB 206-a non-security descriptor determines whether the corresponding physical address part exists.' The program proceeds directly to step 336, where the access permission 202 is checked by the access permission series 202. It should be noted at this point that if the body address portion is in a micro-TLB, it is assumed that there is no security violation because the segmentation detector 22 supervises the information before being stored in the micro-TLB. Once the deposit has been checked in step 336, the procedure proceeds to step 3 38, where it is determined whether there has been any access permission error aborted in step 316. Otherwise, the process proceeds to step 3 18 'where the rest of the memory access is performed as described earlier. If no conformant is located in the micro-TLB at step 320, the sequence proceeds to step 322, where a check is performed at the main tlb 208 to determine whether the relevant non-security descriptor exists. Otherwise, the table walking logic 210 executes a paging table walking procedure at step 3-24. Wear the necessary non-security descriptors from the non-security paging table to the main 8. At this time, the program proceeds to step 326, or directly from step 322. Walk to step 326. If at step 322 see the meeting partner at the main TLB 208. In step 326, it determines the effective additional non-security descriptor of the currently considered virtual address in the main TLB, and then the step 28 28 segmentation detector 222 checks from (the rest of the entities in the descriptor to 0 in the descriptor. If it can be logically countered, it can be effectively obtained: reverse, the sequence is discussed, the process is translated, and the TLB is entered. The examination is at the address 90 200417216. In the record, on line 220, the line, the mode cut, the security check, and the full-generation) memory have accessed the non-secure memory. V: The physical address generated by the virtual address will be the secure memory. Set in the '... that is, if the physical address is completely violated, a bit-then [in step 33, it decides «222 ^, and the procedure proceeds to step 332, in which an alarm 14 is issued by the divider 222 / Non-women's sexual error aborted. However, if the detector logic 222 decides that there are no security violations, the program proceeds to step 3, step 334, where the miCro-TLB is loaded with a sub-portion of the relative descriptor containing the body address portion. Then, in step 336, the memory access is performed in the same way as described above. Referring to Figure 40, super | τ ^, the following describes the processing of directly issuing a memory request for a physical address. As I & ^ You Yi was enchanted, in this process, MMU 200 will, most of all: be achieved by logging in to a related login β of an MMU enable bit, the setting procedure is executed by the monitoring mode . Therefore, at 350 V, the core 10 will generate a physical address that will be transmitted to the MPU via path 236. Then, in step 352, the Mpu checks that the requested memory access can be performed in the existing operation mode, that is, user supervision, and so on. In addition, if the core is operating in non-security ', whether or not the physical address is in non-security memory, in step 352, the analyzer 222 will also check whether the physical memory is in non-security mode. Then, in 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 partition check procedure has renewed a violation. If any of these violations occur, the program proceeds to step 356, where it is stopped by Mρυ 220 an access permission error. I will understand that in some embodiments, 91 200417216 makes no difference between a type of suspension, while in alternative embodiments, 'the suspension 仏 number can refer to whether it is associated with _ access permission error or A security error. If no violation is detected in step 35.4, the process proceeds to step 358, where memory access occurs to the location identified by the physical address. In the preferred embodiment, only the monitoring mode is arranged to generate the physical address directly, and therefore in all other cases, as described earlier, the MMU 200 will be enabled and the virtual address generation from the memory access request will occur The physical address. Figure 38 illustrates an alternative embodiment of the memory management logic, in which all memory access requests specify a virtual address, and therefore a physical address is not directly generated in any mode of operation. In this process, I will understand that there is no need for another MPU 220, and conversely, the segmentation detector 222 can be incorporated into the MMU 200. This change happened quietly, and the procedure was performed in exactly the same manner as discussed earlier with reference to Figures 37 to 39. I will understand that various other options are also possible. For example, assuming that a memory access request can be issued by the security and non-security modes of a specified virtual address, two MMUs can be provided, one for security access requests, and one for non-security access requests, that is, in Mpu 22 in Figure 37 can be replaced with a complete MMU. In this case, a flag used with each mmu's primary TLB may not be needed to define security or non-security. When an MMU stores non-security descriptors in its primary TLB, and another An MMU stores security descriptors in its main TLB. Of course, we still need to split the detector to check if the core is intent to store when the core is in a non-secure domain: ^ \, pre-fetching full memory. If, optionally, all ancient addresses, an all memory access request directly specifies the entity's interpretative bolus I, ancient main inflammation, $ 从 from using two MPUs, one for security access β month demand And—for non-security MPU sexual access requests. For non-secure access requests, J has committed other accesses that are supervised by the security_sec 14 partition detector. Μ Allow access to secure memory in non-secure mode. Any of the arrangements in Figure 3 8 can provide further features, and can be arranged to perform some segmentation checks to monitor the activities of S walking logic 2 10. In particular, # 果 Core is now operating in the security domain, and it can arrange segmentation detection E 222 for inspection T eight translation tables walking logic 210 attempts to access a page table, which access non-security + W eight 15 * Taxi page table instead of security paging table. If a violation is detected, it is best not to generate a stop signal. Because the translation table walk logic 210 usually performs a paging table query by combining a paging table base address with certain bits 70 of a virtual address issued by a memory access request, the segmentation detection may / step and For example, the check translation table walk logic 2 i 0 uses a base address of a non-secure paging table instead of a base address of a secure paging table. FIG. 41 illustrates a procedure executed by the partition detector 222 when the core is operating in a non-security mode. I will understand that under normal operation, the interpolations obtained from the non-secure page table should describe only one page mapped in non-secure memory. However, in a software attack order, the descriptor may be tampered with so that it now describes a portion of the non-secure and secure area containing memory. Therefore, considering one of the examples in Figure 4, the tampered non-security descriptor can cover a page, which includes the non-security area 93 200417216 domains 370, 372, 374, and security areas 376, 378, 38. If the virtual address issued as part of the memory access request now matches a physical address in a secure memory area, such as the secure memory area 3 7 6 shown in Figure 41, then a split detection is arranged The device 2 2 2 generates an abort to prevent access from occurring. Therefore, even if an attempt to access the secure memory has tampered with a non-feminine descriptor, the partition detector 2 2 2 prevents that access from occurring. In contrast, if the physical address derived using this descriptor is consistent with a non-secure memory area, for example, area 374 shown in Figure 41, the access control information loaded in the micro-TLB 206 is only confirmed The non-security zone 3 74. Therefore, access in the non-secure memory area 374 can occur, but access to any of the security areas 376, 37, or 38 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 part, which will enable the Access 0 As mentioned earlier, in an embodiment, the non-secure mode and the security mode can generate a memory access request for a specified virtual address, and then the memory preferably includes one of the non-secure memory. Non-security paging table, and a security paging table in security memory. When in the non-security mode, the translation table walking logic 21 will refer to the non-security paging table, and when 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 39, which may be in, for example, external memory 56 shown in FIG. 1, includes one of the unsafe paging tables 395, which refers to a base address 397 at 94 200417216 A CP15 login ~ It can be in the first time again ... Similarly, in the security memory 400, the security page of the memory page 56 provides a copy corresponding to a copy # P 5 which consists of a security Pagination table base address 407 CP15 of your abdominal table, every description, ^ 疋. In the non-secure page table 395 W Μ will all point to a corresponding non-female full page in the non-secure page 390, and the parent-descriptor, The righteous girl ’s holistic memory 400 has A miscellaneous pages # ,, τ 旳 corresponding to the female ’s holistic page. In addition, the description of the feelings for some areas, including the θ memory area 410, which may not be shared, can be accessed by non-female holistic mode and security mode. The preferred embodiment details the query procedure performed in the main tlb 208. As mentioned previously, 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 the look-up procedure is executed, only descriptors related to the specific domain where the core 10 operates are checked. Figure β illustrates an example in which 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. In accordance with a preferred embodiment of the present invention, an additional program ID flag 43, also referred to herein as the asid flag, is provided to confirm the descriptor from the program-specific paging table. Therefore, the programs P1, P2, and P3 each have a corresponding paging table provided in the memory, and further, there can be different paging tables for non-security operations and security operations. In particular, I will understand that programs PI, P2, and P3 in the security 95 domain can be completely independent of programs PI, P2, and P3 in the non-security domain. Therefore, as shown in Figure 43, in addition to checking the domain, when the primary TLB query 208 is required, the Asid flag is also checked. Therefore, in the example in FIG. 43, in the security domain, the program P1 is executed, and the search program confirms that only two items 450 are in the main TLB 208, and is based on whether there are virtual address parts in both descriptors. The virtual address part issued by the body access request generates a hit or a miss. ^ If there is, then the relevant access control information is intercepted and passed to the micro-TLB 206, access permission logic 20 and the region attribute logic 204. Otherwise, a discrepancy 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 this 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 known techniques Decide which descriptors to remove from the main TLB, to make room for new descriptors, such as the most recently used method, etc. So I will understand that the safety core of the safety mode for operation can be: End: It develops independently of the non-safety operation department. However, in some cases, the development of non-women's holistic operating systems can be closely linked, and in this case, it is' suitable to allow security applications to use non-security profiles, 2, which will allow security Sexual applications use only known virtual addresses to direct non-secure data (to share). Of course, it is assumed that security virtual mappings and holistic virtual mappings can be performed by specific ASIDs. The non-security descriptor is executed in the more separated security control registration, which can only be obtained by the security at the actual address. The non-security transmission value is as described in the parameters, which is defined by the core control and preferably can be defined for each Domain attribute examples' areas of memory are part of the domain. Pre-import tags are required (ie, domain flags) to identify between security descriptors. Conversely, all available queries in the TLB. In the preferred embodiment 'The architecture of the main TLB and the architecture of the previous global and non-security descriptors can be set by the specific bit provided in. This bit is set in the core of the preferred embodiment. In the security application, it is allowed to directly use a non-secure. It may also enable the non-secure stacking indicator from the security domain. It is enough to copy the non-secure stacking indicator to the CP15 registration 34. At this time, it will be applied according to the plan understood by women's holistic applications. As mentioned earlier, the memory may be partitioned into non-security and secure and the partition is registered using cpi5, which is dedicated to the partition detector 222. The basic partitioning method is based on access permissions in a typical Mpu area. Therefore, dividing the memory into most areas can use its base address, size, memory attributes, and storage area. In particular, when designing overlapping areas, Has the highest priority on the Internet. In addition, according to the present invention, a new area attribute is used to define whether the corresponding area is in or in non-secure memory. It is defined by the security core usability to be used as secure memory. In the CP15 description of the memory and protection of the body, sexual assault becomes safe and promotes the stacking of the whole nature. 16

在開機階段,如第44圖所示般執行一第一分割。該初 始分割將決定分發給非安全性情境、非安全性作業系統和 非安全性應用的記憶體460的數量。該數量與在分割中定 義的非安全性區域一致。而後由非安全性作業系統將該資 訊用於它的記憶體管理。其餘的記憶體462、464 (被定義 為安全性的)不被非安全性作業系統所知道。為了保護非安 全性情境的完整性,可設計非安全性記憶體為只允許安全 性權限模式存取。因此,安全性應用將不被該些非安全性 者所竄改。如第44圖所示,在該開機階段分割之後,記憶 體460可用於供非安全性作業系統使用、記憶體462可用 於供安全性核心使用,以及記憶體464可用於供安全性應 用使用。 一旦已經執行了該開機階段分割,由使用 MMU 200 的非安全性作業系統處理非安全性記憶體460的記憶體映 射,以及因此能夠以一並通模式定義一系列非安全性分 頁。如第45圖所述。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.

如果一安全性應用需要與一非安全性應用共用記憶 體,安全性核心能夠改變記憶體一部分的權限以從一網域 傳送偽造資料至其他者。因此,如第46圖所示,安全性核 心能夠在檢查非安全性分頁的完整性以後,改變該分頁的 權限,以使安全性分頁466變為可存取之共用記憶體。 當記憶體的分割改變時,mici*o-TLB 206需要被清除。 因此,在該歷程中,當其後發生一非安全性存取時,在 micro-TLB 206將發生一不符者,以及因此從主要TLB 208 98 200417216 載入一新的描述符。由MPU的分割檢測器222在其後檢查 該新的描述符,當意圖截取它至micr〇_TL]B 206時,所以 將與記憶體的新分割一致β 在較佳實施例中,該快取3 8是虛擬索引和實體附加 的。因此,當在該快取38中執行一存取時,首先在 micro-TLB 206已經執行一查詢,而因此存取許可(尤其是 安全性和非安全性許可)將被檢查。因此,在快取中不 月b由非安全性應用储存安全性f料,並因此在非安全性模 式中不能執行對安全性資料的存取。、 然而,在非安全性網域對―安全性應用而言,可 生一問題是能夠使用# 七 (invalidate)、清除或去除兮此府。甘泰 叮作廢 、〜I*、取八而要保證此 會影響系統的安全性。例& , . ^ ^ 貝才呆作不 1夕J如,如果非安全性 癆快取38而不用清除它, ,、系流欲作 在取代刖,任何外 寫入任何安全性受污染的蒈 思必須 貝料係在快取中附加,和阳 女全性 區別地處理。 夠進行有 在較佳實施例中,如栗士 一非a 果由一非文全性程式勃 據位址作癆快取線」操作, 轨仃一「依 从 由刀割檢測器222捨氺告 址,以及如果快取線是一忠入地a & 檢查實體位 女全性快取線,捶你山 在較佳實施例中,由一非安 尤有甚者 弓I作癆快取線」操作成為r依處帝 有依據意 由—非安全性程式執行的所有「作 廢」。同樣地 P」操作成為r、、』 和作癆」操作,從而確保系統的安全性”成為「请除 99 200417216 除和作癀全部」。 此外’參考第一圖,micro-TLB 206控制DMA 32對 TCM 36的任何存取。因此,當DMA 32在TLB執行查詢, 以把它的虛擬位址轉換成一實體者時,添加於主要TLb内 的先前所述之旗標允許執行需要的安全性檢查,猶如已由 核心1 0發出存取請求般。此外,將在稍後討論,一複製部 分被連接至外部匯流排70,最好位在判優器(arbiter)/解碼 區塊之中,以使在DMA 32藉由外部匯流排界面42直接存 取與外部匯流排70連結的記憶體時,使與外部匯流排連接 的複製分割檢測器檢查存取的有效性。尤有甚者,在某此 較佳實施例中,有可能向CP15登錄34中添加一位元以定 義是否DMA控制器32可用於非安全性網域,當在一權限 模式中操作時,該位元僅允許由安全性核心設置。 考慮TCM 36,如果安全性資料被置於TCM 36之中, 必須小心地處理它。舉一示例,可想見一歷程,其中非安 全性作業系統為TCM記憶體36設計實體位址範圍,以使 其重疊一外部安全性記憶體部分。如果操作的模式之後改 變至一安全性模式,安全性核心可能導致資料儲存在上述 重璺部分,而通常在TCM 36儲存該資料,因為TCM 36通 常具有比外部記憶體較高之優先權。如果非安全性作業系 統之後為TCM 3 6改變實體位址空間的設定,以使先前的 安全性區域現下映射至記憶體的非安全性實體區域,吾人 將了解,此時該非安全性作業系統能夠存取該安全性資 料,因為分割檢測器將視該區域為非安全性而將不宣告一 100 200417216 中止。因此,簡而言之,如果T CM被設定為以正常的本地 端RAM作用,而非SamrtCache,如果它可以移動TCM基 礎的登錄至非安全性實體位址,則可能讓非安全性作業系 統讀取安全性情境資料。 用以防止上述歷程,在較佳實施例中提供控制位元於 CP15登錄34其只能在安全性模式操作中存取,和提供兩 可能的架構。在一第一架構中,把控制位元設置成,,i ”,其 中TCM只能夠由安全性權限模式控制。因此,在cpi5 34 中思圖對TCM控制意圖進行的任何非安全性存取將導致 進入一未定義指令異常。因此,在該第一架構中,安全性 模式和非安全性模式都能夠使用TCM,但是,僅由安全性 權,限模式控制該TCM。在第二架構中,把該控制位元設置 成0 ,其中TCM能夠由非安全性作業系統控制。在這種 清況下,只能由非安全性應用使用該TCM。沒有任何安全 性資料可以從TCM處載入或存入TCM。因此,當執行安 全性存取時,不在TCM中執行查詢以了解位址是否與該 TCM位址範圍符合。 預設的情況下,想像僅能由非安全性作#系、统使用 TCM ’纟这種歷程中,+需要改變非安全性作業系統。 如先前所述,除了在MPU 22〇提供分割檢測器222之 夕卜’本發明之較佳實施例也提供一類似的分割檢測區塊其 連接至外部匯流排7〇,該額外的分割檢測器被用於監督其 :也主控裝置對記憶體的存取,命""數位信號處理器 DSP)5〇、直接連接至外部匯流排的DMA控制器、經由 101 200417216 外 等 分 作 可 的 置 器 元 記 的 金 能 單 如 則 體 裝 流 體 請 式 部匯流排界面42連接至外部匯流排的dma控制器32、 等在某些實施例中,如稍後將討論的有可能只有一 割檢測區塊連接至外部匯流排,而不提供一分㈣測器 為記憶體管®邏輯30的-部分。在一些此類實施例中, 以選擇性地提供-分割檢測器作為記憶體管理邏輯3 〇 -部分,在此類示例中,該分割檢測器被視為除了與裝 匯流排連結的那個以外,所提供之一進一步的分割檢測 〇 如先前所述,全部的記憶體系統能包含多數記憶體單 ,而上述之夕種可旎存在於外部匯流排7 〇,例如,外部 憶體56、開機ROM 44、或真正的緩衝或在週邊裝置中 登錄48、62、66 ’例如,螢幕驅動器46、1/〇界面6〇、 鑰貯藏單元6 4、等等。此外,記憶體系統的不同部分可 需要被定義為安全性記憶,例如,可能需要在金鑰貯藏 元64中的金鑰緩衝儲存器66被視為一安全性記憶體。 果與外部匯流排連結的一裝置意圖存取安全性記憶體, 很明顯地,在含有核心1 〇的晶片中提供先前所述的記憶 管理邏輯3 0將不能監督此類存取。 第47圖圖示如何使用連接至外部匯流排(本文中亦指 置匯流排)之額外的分割檢測器492。通常安排該外部匯 排,以使無論何時裝置(例如,裝置470、472)發出記憶 存取請求,都會進入上述外部匯流排。該些記憶體存取 求也包括在該外部匯流排上的某些信號其定義操作的模 ,例如權限的、使用者的、等等。依照本發明之較佳實 102 200417216 施例,記憶體存取請求亦涉及發出一網域信號至該外部匯 流排,以確認是否該設備係操作於安全性模式或非安全性 模式中。最好能在硬體層級發出該網域信號,以及在較佳 實施例中’能夠在安全性或非安全性網域中操作的一裝置 將包括一預設的腳位,用以輸出該網域信號至外部匯流排 中的路徑4 9 0。為了描述它,在外部匯流排上,在另一信 號路徑488之外,單獨顯示該路徑490。 網域信號(本文亦指"S位元”)將確認是否發出記憶體 存取請求的設備係操作於安全性網域或非安全性網域,和 由連接至外部匯流排的分割檢測器4 9 2接收該資訊。該分 割檢測器492將亦已經存取分割資訊其確認記憶體之區域 是安全性或非安全性的,和因此可以被安排為僅允許一裝 置存取記憶體的特定部分,如果該S位元係被宣告作確認 一安全性模式的操作。 在預設的情況下,想像不宣告該s位元,和因此一預 先存在的非安全性裝置(諸如第47圖所示之裝置472)將不 輪出一宣告的S位元,和因此絕不允許由分分割檢測器4 9 2 存取記憶體的任何安全性部分,不論是在螢幕驅動器 480、輪入輸出界面484之中的登錄或緩衝器482、M6中, 或在外部記憶體474中。 為供描述之故,用來在主控裝置(諸如,裝置470、47 2) 所發出的記憶體存取請求之間進行判優(arbiter之判優器 區塊,係獨立於用以決定服務記憶體存取請求的適當記憶 體裝置之解碼器478和獨立於分割檢測器492來解説。然 103 200417216 而,吾人將了解,上述元件之一或多數可以整合於相同的 單元中,如果希望的話。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, mici * o-TLB 206 needs to be cleared. Therefore, during this process, when a non-secure access occurs thereafter, a discrepancy will occur at the micro-TLB 206, and therefore a new descriptor is loaded from the main TLB 208 98 200417216. The new descriptor is checked by MPU's segmentation detector 222 afterwards. When it is intended to intercept it to micr0_TL] B 206, it will be consistent with the new segmentation of the memory. In the preferred embodiment, this fast Taking 3 8 is a virtual index and a physical addition. Therefore, when an access is performed in the cache 38, a query has been performed in the micro-TLB 206 first, and therefore access permissions (especially security and non-security permissions) will be checked. Therefore, the security data is stored by the non-security application in the cache, and therefore, access to the security data cannot be performed in the non-security mode. However, for non-secure domains, a problem that can arise for security applications is being able to use # 七 (invalidate), clear or remove the house. Gan Tai Ding Void, ~ I *, take eight and ensure that this will affect the security of the system. Example &,. ^ ^ Because staying awake for a long time. For example, if the non-security 痨 cache 38 without clearing it, the system wants to replace the 刖, any outside write any safety-contaminated The thought must be added to the cache, and treated differently from the male sex. It is enough to perform the operation in a preferred embodiment, such as Li Shi-a non-a result from a non-literate program address as a "cache line" operation, a track "compliance by the knife cutting detector 222 obituary" Address, and if the cache line is a loyal a & check physical female all-purpose cache line, in your preferred embodiment, a non-safety or even bower I will be used as the cache line "Operation becomes all" null "performed by the emperor on the basis of intentional-non-safety procedures. Similarly, the "P" operation becomes the "r ,,", and the operation "operation, so as to ensure the security of the system. 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 into 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 an arbiter / decoding block, so that the DMA 32 can be stored directly by the external bus interface 42 When the memory connected to the external bus 70 is fetched, the copy division detector connected to the external bus 70 checks the validity of the access. In particular, in a preferred embodiment, it is possible to add a bit to the CP15 login 34 to define whether the DMA controller 32 is available for non-secure network domains. When operating in a permission mode, the Bits are only allowed to be set by the security core. Considering TCM 36, if security data is placed in TCM 36, 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 important part, 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 later changes the physical address space setting for TCM 36, 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 The security data is accessed because the segmentation detector will treat the area as non-secure and will not announce a 100 200417216 suspension. So, in short, if T CM is set to function as normal local RAM instead of SamrtCache, if it can move the TCM-based login to the non-secure entity address, it may allow non-secure operating systems to read Get security situation information. To prevent the above process, in the preferred embodiment, a control bit is provided in the CP15 login 34, which can only be accessed during security mode operation, and two possible architectures are provided. In a first architecture, the control bits are set to ,, i ", where the TCM can only be controlled by the security permission mode. Therefore, any non-secure access to the TCM control intention in cpi5 34 will be Caused to enter an undefined instruction exception. Therefore, in the first architecture, both the security mode and the non-security mode can use the TCM, but the TCM is controlled only by the security right and limited mode. In the second architecture, Set the control bit to 0, where the TCM can be controlled by a non-safety operating system. In this case, the TCM can only be used by non-safety applications. No security data can be loaded from the TCM or Stored in the TCM. Therefore, when performing security access, do not perform a query in the TCM to find out whether the address matches the TCM address range. By default, the imagination can only be made by non-security providers. In the course of using TCM '纟, it is necessary to change the non-safety operating system. As mentioned previously, in addition to providing a segmentation detector 222 at the MPU 22, the preferred embodiment of the present invention also provides a similar segmentation. Check The block is connected to an external bus 70, and this additional segmentation detector is used to monitor it: it also controls the access of the device to the memory, and it is directly connected to the digital signal processor (DSP) 50. DMA controller to external bus, gold energy bill that can be used as a recorder for device placement via 101 200417216, etc. The body fluid interface bus interface 42 is connected to the dma controller 32 of the external bus, etc. In some embodiments, as will be discussed later, it is possible that only one cut detection block is connected to the external bus without providing a sub-detector as part of the Memory Tube® Logic 30. In some such cases In the embodiment, a selective provisioning-segmentation detector is used as the memory management logic 30-part. In such examples, the segmentation detector is regarded as one of the provided in addition to the one connected to the loading bus. Further segmentation detection. As mentioned earlier, all memory systems can contain most memory sheets, and the above mentioned types can exist on external buses 7 such as external memory 56, boot ROM 44, or real 48, 62, 66 in the buffer or register in the peripheral device, for example, screen driver 46, 1 / 〇 interface 60, key storage unit 64, etc. In addition, different parts of the memory system may need to be defined as secure Sexual memory, for example, may require the key buffer memory 66 in the key store 64 to be considered a security memory. If a device connected to an external bus intends to access the security memory, it is clear that Providing the previously described memory management logic 30 in a chip containing core 10 will not be able to supervise such access. Figure 47 illustrates how to use the additional connection to an external bus (also referred to herein as a bus) Segmentation detector 492. This external bus is usually arranged so that whenever a device (e.g., devices 470, 472) issues a memory access request, it will enter the above external bus. The memory access requests also include certain signals on the external bus that define the mode of operation, such as permissions, users, and so on. According to the preferred embodiment of the present invention, the 2004 200417216 memory access request also involves sending a domain signal to the external bus to confirm whether the device is operating in a security mode or a non-security mode. It is best to signal the network domain at the hardware level, and in the preferred embodiment a device capable of operating in a secure or non-secure network domain will include a preset pin for outputting the network Domain signal to the path in the external bus 490. To describe it, on the external bus, this path 490 is shown separately from the other signal path 488. The domain signal (also referred to as " S bit " in this article) will confirm whether the device that issued the memory access request is operating in a secure or non-secure domain, and a split detector connected to an external bus 4 9 2 receives the information. The segmentation detector 492 will also have access to the segmentation information, confirming that the area of the memory is secure or non-secure, and can therefore be arranged to allow only one device to access the particular memory. In part, if the S-bit is declared to confirm a security mode operation. By default, imagine that the s-bit is not declared, and therefore a pre-existing non-security device (such as that shown in Figure 47). The indicated device 472) will not rotate a declared S bit, and therefore it is never allowed to access any security part of the memory by the split detector 4 9 2, whether it is on the screen driver 480, the turn-in output interface Register in 484 or in buffer 482, M6, or in external memory 474. For the purpose of description, it is used for memory access request issued by a master device (such as device 470, 47 2). Arbitration The arbiter block of er is explained by decoder 478 independent of the appropriate memory device used to determine the service memory access request and independent of the segmentation detector 492. However, 103 200417216, I will understand One or more can be integrated in the same unit, if desired.

第48圖圖示一選擇性實施例,其中未提供分割檢測器 492,而反之安排每一記憶體裝置474、480、484依據S 位元的值監督自己的記憶體存取。因此,如果裝置470要 在非安全性模式下,對在被標示為安全性記憶體之螢幕驅 動器480中的一登錄482宣告記憶體存取請求,則該螢幕 驅動器4 8 0將決定S位元未被宣告,以及不處理該記憶體 存取請求。因此,可想見以各種記憶體裝置的適當設計, 可以避免需要在外部匯流排上分別提供一分割檢測器 492 ° 在第47圖和第48圖的上述内容中,”S位元"被用作 確認發出記憶體存取請求的裝置係在安全性網域或非安全 性網域中操作。以另一種角度觀之,該S位元可視為指示 記憶體存取請求屬於安全性網域或非安全性網域。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 the S bit Undeclared, and the memory access request is not processed. Therefore, it is conceivable that with the appropriate design of various memory devices, it is possible to avoid the need to provide a separate detector on the external bus 492 ° In the above content of Figure 47 and Figure 48, the "Sbit" 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 domain.

在第37圖和第38圖所述之實施例中,一單一 MMU(連 同單——組分頁表)被用來執行虛擬至實體位址轉譯。以此 類方法,實體位址空間通常以如第49圖所示之簡單模式在 非安全性記憶體和安全性記憶體之間分成區塊。對於記憶 體系統中之記憶體單元之一,本文之一實體位址空間2 1 00 所包含範圍開始於位址零並延伸至位址Y,例如,外部記 憶體56。為了每一記憶體單元,可尋址記憶體通常被切割 為兩部分,一第一部分2 11 0被分配為非安全性記憶體和一 第二部分2 1 20被分配為安全性記憶體。 104 200417216 以此類方法,吾人將了解,有某些實體位址不能被特 定網域所存取,以及此類差異對用使於該些網域的作業系 統將十分明顯。而用於安全性網域之作業系統將知道非安 全性網域的存在,也因此將不在意這點,在非安全性網域 中的作業系統最好應該不需要知道安全性網域的存在,但 是,反之應該操作地好似不在安全性網域般。 在一進一步的議題中,吾人將了解一#安全性作業系 統知道外部記憶體的位址空間為開始於位址零和延伸至位 址X,和該非安全性作業系統不需要知道任何關於該安全 性核心的事,以及尤其是從位址χ+1延伸至位址Y的安全 性記憶體的存在。机反地,該安全性核心將不知道它的位 址空間係開始於位址零其通常不為一作業系統所預期者。 一減輕上述顧慮的實施例,藉由允許安全性記憶體區 域完全不被具有它的實體位址空間的非安全性作業系統所 知,和藉由啟用安全性網域中的安全性核心和祚安全性網 域中的非安全性作業系統,以知道外部記憶體的位址空間 係開始於位址零,如第51圖所述。這裡,實體位址空間 2 2 0 0能在分頁層級被切割為安全性或非安全性區塊。在第 5 1圖所示之示例中,所示之外部記憶體的位址空間係被切 割為四個區塊2210、2220、2230和2240 ,包含兩安全性 記憶體區域和兩非安全性記憶體區域。 相反於藉由-單-分頁表轉換在虛擬位址空間和該實 體位址空間之間轉換,|照一第一分頁表和一第二分頁表 執行兩分離層的位址轉譯,從而導入一中間位址空間的概 105 200417216 心依據是否處理器在安全性網域或非安全性網域中,其 能作不同的 〃 J女排。尤有甚者,如第51圖所示,藉由使用在 ★組刀頁表2250中的一安全性分頁表中所提供的描述 付’實體饭址空間中的兩安全性記憶體區域2210和223〇 育色多句jh 中 pn $仇址空間映射至單一區域2265。對在處理器上 執订的作業系統而言,其將視中間位址空間為實體位址空 間,並將用 MMU來在該中間位址空間中使虛擬位址轉變 成中間位址。 同樣地| ’能夠為非安全性網域設定中間位址空間 2270,其中鼓丄、a τ错由在該組分頁表2250的一非安全性分頁表中 的ί應塊符’將在實體位址空間中的兩非安全性記憶體 區域2220和224〇映射至非安全性網域的非安全性區域 2275 〇 在一實施例中,如第5 〇 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,或者當處理器在安全性網域 中操作時’由安全性核心控制。然而,在較佳實施例中, 106 200417216 該第二MMU只能由安全性核心或監控程式所控制。 當處理器核心10發出記憶體存取請求時,其將藉 徑2153發出一虛擬位址至micr〇TLB 2155。茁卜⑺ 2 1 5 5將儲存一些虛擬位址部分,其對應於自儲存在 TLB 2 1 60中的描述符所截取的中間位址部分。在主要 2 160的描述符係截取自與第一 MMU 215〇相關的一第 分頁表的分頁表。如果在micr〇-TLB 2 155中偵測到一 者,則micro-TLB 2155能夠經由路徑2157發出與經 徑2 1 5 3所接收的虛擬位址對應的一中間位址。如 micro-TLB 2155中未有一符合者,則將參考主要 2160以了解是否在主要TLB中偵測到一符合者。而 有的話’將截取虛擬位址部分和對應的中間位址部 micro-TLB 2155,而後中間位址能夠經由路徑2157潑 如果在micro-TLB 2155和主要TLB 2160中未有 合者,則轉譯表行走邏輯2165被用於為所需的描述符 被第一 MMU 2150所存取之一第一組分頁表的一預定 表發出一請求。通常,可能有相關於安全性網域或非 性網域的個別程序的分頁表,以及該些分頁表的中間 位址將可被轉譯表行走邏輯2 1 6 5存取,例如從cp 1 5 34中的適當登錄。因此,轉譯表行走邏輯2165能夠 路徑2 1 67發出一中間位址,以自適當的分頁表請求一 符。 安排第二 MMU 2170為經由路徑 2157上 micro-TLB 2155或經由路徑2167接收轉譯表行走 由路 -TLB 主要 TLB 一組 符合 由路 果在 TLB 如果 分至 出。 一符 從可 分頁 安全 基礎 登錄 經由 描述 接收 邏輯 107 200417216 2165所輸出之任何中間位址,以及如果在micr〇-T]LB 2175 中偵測到一符合者,則之後miCr〇_TLB能夠經由路徑2丨92 發出所而的實體位址至§己憶體,以經由資料匯流排2 1 9 0 截取需要的資料。如果經由路徑2丨5 7發出一中間位址,將 使需要的資料傳回到核心1 〇,而對於經由路徑2 1 6 7所發 出的一中間位址,這將使需要的描述符傳回到第一 MMU 2150,以在主要TLB 2160中儲存。 如果micro-TLB 2175有一不符者,則將參考主要tlb 2180 ’以及如果在主要TLB中有一符合者,則傳回需要的 中間位址部分和對應的實體位址部分至micro-TLB 2 1 75, 以促使micro-TLB 2175經由路徑2 1 92發出需要的實體位 址。然而,如果在micro-TLB 2175或主要TLB 2180皆沒 有符合者,而後安排轉譯表行走邏輯2丨8 5從相關分頁表經 由路徑2 1 9 4輸出對需要的描述符的請求,又該相關分頁表 係在與一第二MMU 2 1 70相關的分頁表的一第二組分頁表 中。該第二組分頁表包括使中間位址部分與實體位址部分 相關的描述符,以及通常對於安全性網域有至少一分頁表 和對於非安全性網域有一分頁表。當一請求經由路徑2 1 9 4 發出時,它將導致相關描述符從第二組分頁表傳回至第二 MMU 2170,以儲存在主要TLB 2180中。 第5 0 A圖所述之實施例之操作現將藉由下文中之特例 進一步解說,其中縮寫VA指虛擬位址,ία指中間位址, 和PA指實體位址。 1)核心發出 VA = 300 [IA = 5000, PA = 7000] 108 200417216 2) 在MMU 1的micro-TLB發現不符者 3) 在MMU 1的主要TLB發現不符者 分頁表1基礎位址 = 8000 IA[PA =10000] 4) 在MMU 1的轉譯表行走邏輯執行分頁表查詢 -發出 IA = 8003 5) 在MMU 2的micro-TLB發現不符者In the embodiments described in Figures 37 and 38, a single MMU (combined order-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 and secure memory in a simple pattern as shown in Figure 49. For one of the memory units in a memory system, the physical address space 2 1 00 contained in this article starts at address zero and extends to address Y, for example, external memory 56. For each memory unit, the addressable memory is usually divided into two parts, a first part 2 110 is allocated as non-secure memory and a second part 2 120 is allocated as secure memory. 104 200417216 In this way, I will understand that there are certain physical addresses that cannot be accessed by specific domains, and that such differences will be very obvious to the operating systems used in those domains. The operating system used in the secure domain will know the existence of the non-secure domain, and therefore will not care about it. The operating system in the non-secure domain should preferably not need to know the existence of the secure domain. , However, the opposite should be done as if not in a secure domain. In a further issue, I will understand that #security operating system knows that the address space of external memory starts at address zero and extends to address X, and the non-secure operating system does not need to know anything about the security The core of sex, and especially the existence of security memory extending from address χ + 1 to address Y. Instead, 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. An embodiment that alleviates the above-mentioned concerns, by allowing a secure memory region to be completely unknown to a non-secure operating system having its physical address space, and by enabling a security kernel and a security domain A non-secure operating system in the security domain to know that the address space of external memory starts at address zero, as shown in Figure 51. Here, the physical address space 2 2 0 can be cut into secure or non-secure blocks 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 regions and two non-secure memories. Body area. Instead of converting between the virtual address space and the physical address space by -single-page table conversion, perform two separate layers of address translation according to a first page table and a second page table, thereby importing An overview of the intermediate address space is based on whether the processor is in a secure domain or a non-secure domain, which can be used for different women's volleyball teams. In particular, as shown in FIG. 51, the two security memory areas 2210 and 2210 in the physical address space are described by using the description provided in a security page table in the group page table 2250. In 223〇 Yuse multi-sentence jh maps the pn $ hate space to a single region 2265. For the operating system subscribed 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 | 'Able to set an intermediate address space 2270 for non-secure domains, where drumming, a τ error is caused by the "tilt block character" in a non-secure page table of the component page table 2250 will be in the physical bit The two non-secure memory regions 2220 and 2240 in the address space are mapped to the non-secure region 2275 of the non-secure network domain. In one embodiment, as shown in FIG. 5A, the virtual address is Address-to-physical address translation is controlled using two independent MMUs. The MMUs 2150 and MMUs 2170 in FIG. 50A can be regarded as constructed in a similar manner to the MMU 200 shown in FIG. 37, but some details have been omitted to simplify the description. 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-secure network domain, or is controlled by the security core when the processor is operating in a secure network domain. However, in the preferred embodiment, 106 200417216, 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 issue a virtual address to micr0TLB 2155 via path 2153.茁 ⑺ 2 1 5 5 will store some virtual address parts, which correspond to the middle address part intercepted from the descriptor stored in TLB 2 1 60. The descriptor at main 2 160 is a paging table taken from a paging table associated with the first MMU 215. If one is detected in micr0-TLB 2 155, micro-TLB 2155 is able to issue an intermediate address corresponding to the virtual address received by path 2 1 5 3 via path 2157. If there is no match in micro-TLB 2155, reference will be made to the main 2160 to see if a match is detected in the main TLB. And if any, 'the virtual address part and the corresponding intermediate address part micro-TLB 2155 will be intercepted, and then the intermediate address can be mapped via path 2157. If there is no match between micro-TLB 2155 and the main TLB 2160, the translation The table walk logic 2165 is used to issue a request for a predetermined table of a first set of page tables of one of the required descriptors accessed by the first MMU 2150. In general, there may be paging tables for individual programs related to the security domain or non-sex domain, and the intermediate addresses of these paging tables will be accessible by the translation table walking logic 2 1 6 5 such as from cp 1 5 Proper login in 34. Therefore, the translation table walking logic 2165 is able to issue an intermediate address at path 2 1 67 to request a token from the appropriate paging table. Arrange the second MMU 2170 to receive the translation table via micro-TLB 2155 on path 2157 or via path 2167. The path -TLB is the main TLB group. One sign from any pageable security base login via description receiving logic 107 200417216 2165 any intermediate address output, and if a match is detected in micr0-T] LB 2175, then miCr0_TLB can pass the path 2 丨 92 sends out the physical address to §memory body to intercept the required data through the data bus 2 190. If an intermediate address is sent via path 2 丨 5 7, the required data will be sent back to core 1 0, and for an intermediate address sent via path 2 1 7, this will return the required descriptors. Go to the first MMU 2150 for storage 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 micro-TLB 2 1 75, This causes micro-TLB 2175 to issue the required physical address via path 2 1 92. However, if there is no match in micro-TLB 2175 or main TLB 2180, then the translation table walk logic 2 丨 8 5 is output from the relevant paging table via path 2 1 9 4 to request the required descriptors, and the relevant paging The table is in a second component page table of a page table associated with a second MMU 2 1 70. The second set of page tables includes a descriptor that associates the middle address portion with the physical address portion, and usually has at least one page table for secure domains and one page table for non-secure domains. When a request is made via path 2 1 9 4 it will cause the relevant descriptors to be passed 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 Figure 50A will now be further explained by the following special cases, where the abbreviation VA refers to a virtual address, ία refers to an intermediate address, and PA refers to a physical address. 1) The core issues VA = 300 [IA = 5000, PA = 7000] 108 200417216 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 IA [PA = 10000] 4) Execute paging table query in translation logic of MMU 1 walking table-issue IA = 8003 5) find non-conformance 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) In the translation table of MMU 2 walk logic executes the paging table query-issue PA = 12008 π8000 IA = 10000 PA "is returned as the paging table data

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)-The micro-TLB stored in MMU 2 10) The micro-TLB in MMU 2 now has a hit (hit)-Issue PA = 10003 "3000 VA = 5000 ΙΑ" and return it as pagination table data

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

12) -儲存在 MMU 1 的 micro-TLB 13) 在MMU 1的micro-TLB現在有符合者(hit) 發出ΙΑ = 5 000以執行資料存取 14) 在MMU 2的micro-TLB發現不符者 15) 在MMU 2的主要TLB發現不符者 16) 在MMU 2的轉譯表行走邏輯執行分頁表查詢 -發出 PA = 1200512)-The micro-TLB stored in MMU 1 13) The micro-TLB in MMU 1 now has a hit (hit) Issued IA = 5 000 to perform data access 14) The non-conformance found in the micro-TLB of MMU 2 15 ) Inconsistency found in the main TLB of MMU 2 16) Performing pagination table query on the translation table walking logic of MMU 2-Issue PA = 12005

109 200417216 π5000 ΙΑ = 7000 ΡΑΠ傳回作分頁表資料109 200417216 π5000 ΙΑ = 7000 ΡΑΠ returned as pagination table data

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 3001 ·..) 1) 核心發出 VA = 3001 2) 在MMU 1的micro-TLB發現符合者,請求IA 500 1 發出至MMU2 3) 在MMU 2的micro-TLB發現符合者,請求pa 7001 發出至 memory 4) 在PA 7 001的資料被傳回至核心。 吾人將了解,上述示例中在MMU的micro-TLB和主 要TLB所發生的不符者,以及因此該示例代表示「最壞情 況下」的歷程。通常,預期在micro-TLBs或主要TLB中 之至少一個發現一符合者,從而大大地減少截取資料的時 回到第5 1圖,在一安全性區域的較佳實施例中,在實 體位址空間的某一特定區域中通常提供第二組分頁表 2250。第一組分頁表可以分成兩種類型,即安全性分頁表 和非安全性分頁表。較佳的實施例為,該些安全性分頁表 110 200417216 將連續出現在該中間位址空間22 6 5中,在非安全性中 址空間2 2 7 5中的非安全性分頁表亦然。然而,它們不 被連續置於實體位址空間中,而因此,例如,第一組 表的安全性分頁表可以遍及安全性區域2210、2230, 以類似方法非安全性分頁表可以遍及非安全性記憶體 2220 和 2240 〇 如先前所述,使用兩組分頁表的二層方法之主要 之一對安全性網域的作業系統和非安全性網域的作業 而言,能夠安排該實體位址空間在零點開始,其通常 作業系統所期望的。額外的安全性記憶體區域可以完 為具有自身的「實體位址」空間的非安全性作業系統所 因為它視它的實體位址空間為中間位址空間其能夠被 為具有中間位址的連續序列。 此外,使用此類方法可以大大地簡化在非安全性 體和安全性記憶體之間的記憶體轉換區域的處理。如: 圖所示。能夠從第5 2圖知道,記憶體的一區域2 3 0 0 如一單一分頁記憶體,可以存在於非安全性記憶體 2220中,以及同樣地記憶體區域2310可以存在於安 記憶體區域22 1 0中。然而,上述兩記憶體區域23 00和 可能藉由在第二組分頁表中改變相關描述符而易於 換,以使區域2300現下變成一安全性區域其映射至安 網域的中間位址空間中的區域2 3 0 5,而區域2 3 1 0現 成一非安全性區域其映射至非安全性網域的中間位址 的區域2 3 1 5。在安全性網域非安全性網域中,其可以 間位 需要 分頁 以及 區域 優點 系統 是一 全不 知, 安排 記憶 % 52 ,例 區域 全性 23 10 被調 全性 下變 空間 完全 111 200417216 清楚地發生在作業系統,因為從實體位址空間的觀點確實 分別是安全性網域或非安全性網域的中間位址空間。因 此,該方法在每一作業系統中避免實體位址空間的任何再 次定義。 現將參照第5 0 B圖描述本發明的一選擇性實施例,其 亦使用二MMU,但以不同於第50A圖之安排。比較第50A 圖和第5 0 B圖可以知道,安排幾乎相同,但是在該實施例 中,安排第一 MMU 2150以執行虛擬位址至實體位址的轉 譯,以及安排第二MMU執行中間位址至實體位址的轉譯。 因此’相反用於第50A圖之實施例,自第一 MMU 2150的 micro-TLB 2155 至第二 MMU 2170 的 micro-TLB2175 之路 徑,安排第一 MMU的micro-TLB 2155經由路徑2192直 接輸出一實體位址,如第5 〇B圖所示。在第5 0B圖所示之 實施例的操作現將藉由下文中的特例解說。其中,核心記 憶體存取請求的詳細程序係相同於先前在第5 〇 a圖所示 1) 核心發出 VA = 300 [IA = 5000, PA = 7000] 2) 在MMU 1的micro-TLB和主要TLB發現不符者 分頁表1基礎位址= 8000 IA[PA =10000] 3) 在MMU 1的轉譯表行走邏輯執行分頁表查詢 -發出 IA = 800318)-Micro-TLB stored in MMU 2 19) Hits found in micro-TLB of MMU 2-Hit PA = 7000 to perform data access 2) Data at physical address 7000 is returned to The next time the core issues a memory access request (called VA 3001 · ..) 1) The core issues VA = 3001 2) A matcher is found in the micro-TLB of MMU 1 and requests IA 500 1 to MMU2 3) at MMU 2's micro-TLB found a match and requested pa 7001 to send it to memory 4) The data in PA 7 001 was returned to the core. I will understand the discrepancy that occurred in the MMU's micro-TLB and the main TLB in the above example, and therefore this example represents the "worst case" journey. In general, it is expected that a conformer is found in at least one of the micro-TLBs or the main TLB, thereby greatly reducing the time to intercept the data and return to Figure 51. In a preferred embodiment of the security area, the physical address is A second set of page tables 2250 is usually provided in a particular area of space. The first group of page tables can be divided into two types, namely, security page tables and non-security page tables. In a preferred embodiment, the security paging tables 110 200417216 will continuously appear in the intermediate address space 22 6 5, as well as the non-security paging tables in the non-secure address space 2 2 7 5. However, they are not continuously placed in the physical address space, and therefore, for example, the security paging table of the first set of tables can be spread across the security areas 2210, 2230, and in a similar manner, non-secure paging tables can be spread across non-security Memory 2220 and 2240 〇As mentioned earlier, one of the main two-tier methods using two sets of page tables can arrange the physical address space for the operating system of the secure domain and the operation of the non-secure domain. Starting at zero, it is usually what the operating system expects. The additional secure memory area can be completed as a non-secure operating system with its own "physical address" space. Because it treats its physical address space as an intermediate address space, it can be regarded as a continuous with intermediate addresses. sequence. In addition, the use of such methods can greatly simplify the processing of memory switching regions between non-secure and secure memory. as the picture shows. As can be seen from Figure 52, a region of the memory 2 3 0 0, such as a single paged memory, can exist in the non-secure memory 2220, and the memory region 2310 can also exist in the security memory region 22 1 0 in. However, the above two memory areas 23 00 and may be easily changed by changing the related descriptors in the second set of page tables, so that area 2300 now becomes a security area which is mapped into the middle address space of the security domain. Area 2 3 0 5 and area 2 3 10 is a non-secure area that maps to the area 2 3 1 5 of the middle address of the non-secure network domain. In the security domain and the non-security domain, it can be paging and the regional advantages are unknown. The arrangement memory is 52%. For example, regional integrity 23 10 is adjusted to change the space completely. 111 200417216 clearly Occurs in the operating system, because from the point of view 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 Translation to a physical address. Therefore, 'contrary to the embodiment of 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, and the micro-TLB 2155 of the first MMU directly outputs an entity via the path 2192. Address, as shown in Figure 5B. The operation of the embodiment shown in Figure 50B will now be explained by a special case below. The detailed procedure of the core memory access request is the same as that shown in Figure 5a. 1) The core issues VA = 300 [IA = 5000, PA = 7000] 2) The micro-TLB and main TLB finds a discrepancy. Paging table 1 base address = 8000 IA [PA = 10000] 3) Performs paging table query on the translation table walking logic of MMU 1-issue IA = 8003

4) 在MMU 2的micro-TLB和主要TLB發現不符者iA 80034) iA 8003 is found to be inconsistent with the micro-TLB and main TLB of MMU 2.

分頁表2基礎位址=12000 PA 112 200417216 5) 在MMU 2的轉譯表行走邏輯執行分頁表查詢 -發出 PA =12008 ”8000 IA = 10000 PA”傳回作分頁表資料Base address of pagination table 2 = 12000 PA 112 200417216 5) Execute pagination table query in translation logic of MMU 2-Issue PA = 12008 ”8000 IA = 10000 PA” is returned as pagination table data

6) "8000 IA = loooo pa”映射儲存在MMU 2的主要 TLB 和 micro-TLB 7) 在MMU 2的micro-TLB現在自步驟(3)轉譯至PA 1 003並發出取回(fetch) ”3000 VA = 5000 ΙΑ"傳回作分頁表資料6) " 8000 IA = loooo pa "maps the main TLB and micro-TLB stored in MMU 2 7) The micro-TLB in MMU 2 is now translated from step (3) to PA 1 003 and issued a fetch" 3000 VA = 5000 ΙΑ " returns as pagination table data

請注意:該轉譯由MMU 1保留在暫存中,但不直接儲 存在任何TLB 8) MMU 1的轉譯表行走邏輯現在發出LA = 5000的 請求至MMU2 9) 在MMU 2的micro-TLB和主要TLB發現不符者 IA 5000 10) 在MMU 2的轉譯表行走邏輯執行分頁表查詢 -發出 PA =1200 5 ”5000 IA = 7000 PA”傳回作分頁表資料 11) MMU 2 儲存 ”500〇 ία = 7000 PA"在 micro-TLB 和主要TLB中。該轉譯亦連至MMU 1。 12a) MMU 2發出PA = 7000存取至記憶體Please note: This translation is retained in the temporary storage by MMU 1, but not directly stored in any TLB 8) The translation logic of MMU 1 walking logic now issues a request of LA = 5000 to MMU2 9) Micro-TLB and main in MMU 2 TLB finds a discrepancy IA 5000 10) Performs pagination table query in the translation logic of MMU 2-Issue PA = 1200 5 "5000 IA = 7000 PA" is returned as pagination table data 11) MMU 2 stores "500〇ία = 7000 PA " in micro-TLB and main TLB. The translation is also connected to MMU 1. 12a) MMU 2 issues PA = 7000 to access memory

12b) MMU 1 結合 ”3〇〇〇 VA = 5000 ΙΑ·,和,'5000 ΙΑ = 700 0 PA”描述符以給定一,,3〇〇〇 VA = 7000 PA”描述符,其 儲存在MMU 1的主要TLB和micro-TLB 13)在PA 7000的資料被傳回至核心 113 200417216 下一次核心發出一記憶體存取請求(稱為VA 3 〇〇丨) 1) 核心發出 VA = 3001 2) 在MMU 1的micro-TLB發現符合者,MMU i發出 PA=7001的請求 3) 在PA 7 001的資料被傳回至核心。 自第5 0 A圖所提供之上述示例的比較可以看出,這裡 的主要差別在第7步驟,其中MMU 1不直接儲存第一表 私述符’以及在第12b步驟(12a和12b能夠同時發生)其 中MMU 1亦接收IA-〉PA轉譯並進行結合以及在它的TLBs 中儲存結合的描述符。 因此,吾人可以了解,當選擇性實施例仍然使用兩組 分頁表來使虛擬位址轉換成實體位址,事實上是當一符合12b) MMU 1 combines "3000VA = 5000 IA", and, '5000 IA = 700 0 PA "descriptor to give one, and 3000VA = 7000 PA" descriptor, which is stored in the MMU 1 The main TLB and micro-TLB 13) The data in PA 7000 is returned to the core 113 200417216 The next time the core issues a memory access request (called VA 3 〇〇 丨) 1) The core issues VA = 3001 2) A match was found in the micro-TLB of MMU 1. MMU i issued a request for PA = 7001. 3) The data in PA 7 001 was returned 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 private descriptors' and in step 12b (12a and 12b can occur simultaneously) where MMU 1 also receives IA-> PA translation and combines and Its TLBs store the combined descriptors. Therefore, we can understand that when the alternative embodiment still uses two sets of page tables to convert the virtual address to the physical address, it is actually a match

者發生在 micro-TLB 2155 或主要 TLB 2160 時,micro-TLB 2155和主要TLB 2160儲存虛擬位址至實體位址的轉譯, 以避免需要在該兩MMU中執行查詢。在這種情況下,第 一 MMU可以直接自核心控制請求,而無需參照第二MMU。 吾人將了解,能夠安排第二 MMU 2 170 不包括 micro-TLB 2175和主要TLB 2180,其中分頁表行走邏輯 2185用於需要由第二MMU控制的每一請求。它可以為第 二MMU節省複雜度和消耗,和可以可接受只需要相對少 的第二MMU的假設。因為每一請求將需要使用第一 MMU,通常在第一 MMU 2150 包括 micro-TLB 2155 和主 114 200417216 要TLB 2160較為有利,以改進第一 MMU的作業速度。 應該注意的是分頁表中的分頁可以改變大小,以及因 此可能有兩半的轉譯之描述符與不同大小的分頁相關。通 常,MMU 1的分頁比MMU 2分頁小,但這並非必要的。 例如: 表 1 在 0x40003000 映射至 〇x〇〇〇81〇〇〇 之 4Kb 表 2 在 0x00000000 映射至 0x02000000 之 1Mb 此處,兩大小中的最小者必須用於結合轉譯,所以結 合描述符是 在 0x40003000 映射至 〇x〇2081000 之 4Kb 然而,資料在情境間的調換(如先前參照第52圖所述) 係可能反向的,例如: 表 1 在 OxcOOOOOOO 映射至 0x00000000 之 1Mb 表 2 在 0x00042000 映射至 0x02042000 之 4Kb 現下,在位址Oxc0042010之一查詢從核心給定映射: 在 0xc0042000 至 〇χ〇2042000 之 4Kb 即,該二大小中的最小者總是用於結合映射。 請注意,第二情況中,處理較不有效率,因為在存取 不同的4Kb區域時,表1中的描述符(1Mb)將反覆查尋和 放棄。然而’在一典型系統中,大多數的情況下,表2的 115 200417216 描述符將較大(如第一示例所述),其更有效(能夠使1 Mb 映射為指向ΙΑ空間的適當部分之其它4 Kb分頁再使用)。 如第50A、50B圖所示,使用二分離MMU的選擇性方 法,單一 MMU能夠使用於第53圖,其中當主要TLB 2420 出現一不符者時,由MMU產生一異常(其使軟體在核心1 〇 中執行以依據來自兩組不同分頁表的描述符之結合產生虛 擬至實體位址轉譯。尤其是,如第5 3圖所示,核心1 〇與When the micro-TLB 2155 or the main TLB 2160 occurs, the micro-TLB 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 2 170 does not include micro-TLB 2175 and main TLB 2180, of which 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 MMU, usually the first MMU 2150 includes the micro-TLB 2155 and the main 114 200417216 and the TLB 2160 is more advantageous 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 0x40003000 to 0x〇〇〇81〇〇〇 Table 2 Maps to 1Mb at 0x00000000 to 0x02000000 Here, the smallest of the two sizes must be used in conjunction with translation, so the binding descriptor is at 0x40003000 4Kb mapped to 0x〇2081000 However, the exchange of data between contexts (as described previously with reference to Figure 52) may be reversed, for example: 4Kb Now, query the given mapping from the core at one of the addresses Oxc0042010: 4Kb at 0xc0042000 to 0x2042042000 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 the descriptor (1Mb) in Table 1 will be searched and discarded repeatedly when accessing different 4Kb regions. However, 'in a typical system, in most cases, the 115 200417216 descriptor of Table 2 will be larger (as described in the first example), which is more efficient (capable of mapping 1 Mb to point to the appropriate portion of the IA space). The other 4 Kb pages are used again). As shown in Figures 50A and 50B, using the selective method of two separate MMUs, a single MMU can be used in Figure 53. When a discrepancy occurs in the main TLB 2420, an exception is generated by the MMU (which makes the software in core 1 〇 is performed to generate a 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, the core 1 〇 and

MMU 2400 連結(其包括一 micro-TLB 2410 和一主要 TLB 2 4 2 0。當核心1 0發出一記憶體存取請求時,經由路徑2 4 3 0 提供虛擬位址’以及如果在micro-TLB觀察到一符合者 時’則對應的實體位址經由路徑2440上直接輸出,使該資 料經由路徑2450傳回核心1 〇。然而,如果在micr〇 TLB 2410有不符者’則參考主要TLB 2420以及如果在主要TLB 中含有相關的描述符’則相關的虛擬位址部分以及到對應 實體位址部分被截取至micro_TLB 2410,之後,實體位址 能夠經由路徑2440發出。然而,如果主要TLB也產生不 符者,則產生一異常經由路徑2422送至核心。現下將參照 第54圖進一步描述在核心中自接收此類異常後的處理。 如在第54圖所示,如果在第25〇〇步驟由核心偵測到 一 TLB不符者異常,則核心在第25 1 〇步驟為該異常以一 預設向量進入監控模式。此時它將使分頁表與執行的程式 碼合併以執行在第54圖所示之步驟的其餘部分。 尤其是’在第2520步驟,經由路徑2430發出虛擬位 址和截取在micro-TLB 241 〇和主要TLB 2420所產生之不 116 200417216 付者(此後,猶主如·祕 # 為錯誤虛擬位址(faulting virtual address)),之後,佑嫱十铱 Λ ^ ^ 依:據在第一組表格的適當表格的中間基 礎位址,在第2 5 3 0半_α & — D j υ步驟決疋所需第一描述符之中間位址。 一旦決定了中間位址(通常用虛擬位址與中間基礎位址之 某種預。又的、、、Q合),而後參照在第二組表格中的相關表,以 為該第描述符獲得對應的實體位址。此後,在第2550 步驟,能夠從記憶體取得第一描述符決定錯誤虛擬位址的 中間位址。 而後,在第2560步驟,再次參考第二表以找尋第二描 述符以替錯誤虛擬位址的中間位址給定實體位址。此後在 第2570步驟’取回該第二描述符以獲得錯誤虛擬位址的實 體位址。 一旦已經獲得了上述資訊,則程式使第一和第二描述 符合併以產生給定需要的虛擬位址至實體位址轉譯的新描 述符,第2 5 8 0步驟執行該步驟。以先前參照第5 〇b圖所 述之類似方法,由軟體再次執行合併把最小的分頁·表大小 用於結合的轉譯。此後,在第2590步驟,在主要TLB 2420 中儲存該新的描述符,而後程序在第2595步驟自異常返 回。 此後,安排核心10經由路徑2430為記憶體存取請求 再次發出虛擬位址,其仍將在micr〇-TLB 241〇產生不符 者,但是現下將在炙要TLB 2420產生一符合者。因此’ 虛擬位址部分和對應實體位址部分能夠被截取至 micro-TLB 2410,之後,micro_TLB 2410 能夠經由路徑 117 200417216 2440, 4 選擇七 54圖 者。 MMU 作時 權限_ 處理 體, 的第 果, 管理 割檢 取。 供一 快取 一查 安全 用在 分割 能在 使所需的資料經由 乂由路fe 2450傳回核心1〇。 卜人將了解,在先舒 照第5 0 A圖和第5 0 B圖所述之 t實施例中,藉由救 _ 體使用上文中參照第5 3圖和第 所述之原則,管理在 牧上述實施例中的MMU之一或二 F論是否如第5ΠΔ si A圖或第50B圖所示般使用二 ,或如第53圖所;i a 汀不奴使用一 MMU,當在監控模式操 由處理器管理第-&八_ 弟一組分頁表的事實(或選擇性地在一 安全性模式中)禮仅# )確保該些分頁表為安全性者。結果,當 器在非安全性網域φ^ . 埤中時,其只旎夠看見非安全性記憶 因為當在非安全枝Ag| ijb 1 . 、 、、周域中時,只能由處理器所能看見 -組分頁表為非安全性網域產生中間位址空間。結 不需要提供一分割檢測器作為如第一圖所示之記憶體 、° 的 σ卩分。然而,在外部匯流排上仍然提供分 測器以監控由其它匯流排主控ϋ在系統中進行的存 在先前參照第37圖和第38圖所討論之實施例中,提 與MMU 2 00相關之分割檢測器222,和因此當要在該 38中執行存取時,在micro-TLB 2〇6中已經先執行了 旬以及因此已經檢查了存取許可(尤其是安全性和非 性奸可)。因此,在此類實施例中,不能由非安全性應 决取3 8中儲存安全性資料。對快取3 8的存取係在由 檢測器222所執行之分割檢測之控制下’以及因此不 非安全性模式中執行對安全性資料的存取。 118 200417216 然而在本發明之一選擇性實施例中,分割檢測器222 並非為绞由系統匯流排4〇所進行之監控存取所提供,反之 資料處理設備僅有與外部匯流排70連結的一單一分割檢 測器’用以现控連接至外部匯流排的記憶體單元的存取。 在此類實施例中,此時它意味著處理器核心丨〇能夠存取與 系統匯流排40直接連結的任何記憶體單元,例如tCM36 和快取3 8 ’而無需由外部分割檢測器監督該些存取,以及 因此需要某些機制以確保處理器核心丨〇在一非安全性模 式中操作時’不會存取在該快取3 8或TCM 3 6中非安全性 資料存取。 第5 5圖依據本發明的一實施例圖示一資料處理設 備’其中提供一機制以使快取38和/或TCM 36控制對其 進打之存取,而無需提供與MMU 2〇〇相關之任何分割檢 查邏輯。如第55圖所示,核心1〇係藉由MMu 2〇〇連接 至系統匯流排4〇,快取38和TCM 36亦與系統匯流排4〇 連結。核心、10、快取38和TCM 36係藉由外部匯流排界 面42連接至外部匯流排7〇,其包含一位址匯流排“Μ、 —控制匯流排2630和一資料匯流排264〇,如第55圖所示。 核心1〇、MMU 200、快取38、TCM36和外部匯流排 界面42可視為構成連接至外部匯流排7〇之一單—裝置, 亦作為一裝置匯流排,以及其它裝置亦可與上述裝置匯流 排連結,例如安全性週邊裝置47〇或非安全性週邊裝置 472。亦連接至裝置匯流排7〇的是一或多數的記憶體單 元,例如外部記憶體56。此外,一匯流排控制單元“Μ 119 200417216 係連接至裝置匯流排70,並通常包括一判優器2652、 碼器2654和一分割檢測器2656。為了對連接裝置匯 的元件之操作進行一般的討論,應參照先前描述的^ 圖’判優器、解碼器和分割檢測器係被顯示為一個別 塊’但疋當置於單一控制方塊2 6 5 0中時,該些元件以 的方法運作。 在第56圖中進一步詳述第55圖中的MMU 200。 將第56圖與第37圖進行比較,可以看到MMU 200 .與第37圖MMU完全相同的方法建構,唯一的差別是 檢測器222並非供作監視在主要TLB 208和micro 206之間經由路徑242的資料傳送。如果處理器核心 出指定一虛擬位址的記憶體存取請求,而後記憶體存 求將繞經MMU 200,和以稍早第37圖所述般處理 micro-TLB 206經由路徑238輸出一實體位址至系統 排4 0。反之,如果記憶體存取請求直接指定一實體伯 這將略過Μ M U 2 0 0,並經由路徑2 3 6直接繞送至系統 排40 ^在一實施例中,只有當處理器在監控模式中 時’產生直接指定實體位址之記憶體存取請求。 回顧先前對MMU 200之敘述,和尤其是第43圖 述,主要TLB 208將含有一些描述符435,以及對每 述符將提供一網域旗標4 2 5以確定是否對應的描述符 自一安全性分頁表或一非安全性分頁表。上述描述符 和相關的網域旗標425係在第55圖中的MMU 200中 地描述。 一解 流排 % 47 的區 相同 藉由 係以 分割 -TLB 10發 取請 ,從 匯流 L址, 匯流 操作 的描 一描 係來 435 概要 120 200417216 田核w ίο發出—記憶體存取請求時將 存取請求的—實體位址被輸出至系統匯流排… 此時快取38將執行—查詢程序, ^ 資料項係儲存在該快取中。只要在該快取否中= m μ屬於該存取請求的資料項未错存在該快取 邀取:取t始一線填充(Hnefiii)程4,以從外部記憶體 5' 一仃資料其包括屬於記憶體存取請求的資料項。尤 其是’該快取將藉自EBI42輸出—線填充請求至裝置匯 流排70的控制匯流排263〇,和一開始位址輸出至位址匯 流排2620。此外,一 HpR〇T信號將經由路徑^2輪出至 控制匯机排2 6 3 0,其將包括當發出記憶體存取請求時之指 疋核心操作模式的網域信號。因此,能夠將線填充程序視 為快取3 8對外部匯流排之原始記憶體存取請求的傳播。 由分割檢測器2656接收該HPROT信號,和因此確認 該分割檢測器當外部記憶體存取請求發出時,是否裝置自 外部記憶體5 6所請求的指定資料(在這種情況下,該裝置 與核心1 0和快取3 8共同作用)係在安全性網域或在非安全 性網域中操作。分割檢測器2656亦將存取確認記憶體區域 係安全性或非安全性之分割資訊,和因此能夠決定裝置是 否允許存取其所請求的資料。因此,如果在HPROT信號 中的網域信號(也如S位元本文中提到)宣告確認到對該資 料的存取係由該裝置所請求,則當在一安全性模式中操作 時’能夠安排分割檢測器僅允許一裝置存取記憶體之一安 全性部分。 121 417216 如果該分韌认 认久 〇檢測器決定不允許該核心1 0存取所請求 的資料,例如,陌4 u為hpr〇t信號已確認該核心並非在一 非安全性模式下 6人 部作,但是線填充請求企圖自記憶體之一 女全性區域中的 、卜部記憶體取回資料,則分割檢測器2 6 5 6 發"出一中止传势 °〜至控制匯流排2630(其將經由路徑2636傳 回至EBI 42,逡私 1 导致經由路徑2670向核心1〇發出中止信 現。然而,如果八 S標藏信號二:割檢測器2656決定允許存取,則輸出-料或非安…確定自外部記憶體截取的資料是安全性資 傳回至EBI 4貝料,以及該S標籤信號經由路徑2634至 填充處理/ 42,和設定相關於快取線2600之旗標屬於線 同時,括生丨 之線填充資料輯2650授權外部記憶體56所出所請求 取38,以儲存於藉由EBI 42經由路徑2680傳目資料至快 ;相關的快取線2 6 0 0。因此,該處理之結果, 用外部f己*障ι|Λ ^ " 6的資料項填充快取中所選擇的快取線將 填滿來自外部# @ 、 ^隐體56之負料項,該些資料項包括屬於來 ^。1 〇之原始記憶體存取請求的資料項。屬於來自該核 心記憶體存取諳免的咨 ”月衣的資枓項之後能夠被選擇性地自快取 38傳回核〜’或能夠選擇性地經由路徑2660從ΕΒΙ 42傳 回至核心1 〇以直接提供。 因此在較佳實施例中,由上述線填充處理將導致快 取線原始儲存資料之發生,與該快取線相關的旗標26〇2 將依據分割檢測器2656所提供的值進行設定,以及之後將 由快取38使用該面旗標以直接控制對快取線26〇〇中的資 122 200417216 料項的任何爾後之存取。因此,如果之後核心1 〇使在快取 3 8的一特定快取線26〇〇產生一符合者之記憶體存取請求 發出’該快取38將檢查相關的旗標2602之值,並將該值 與核心10現有操作模式之值比較。在較佳實施例中,由在 CP 15網域狀態登錄中的監控模式所設定之一網域位元指 示核心10所操作之現有模式。因此,當處理器核心1〇在 操作於一安全性操作模式中時,能夠安排快取38只允許在 一快取線中的資料項,其被對應的旗標2602指示為可由處 理器核心1 0所存取的安全性資料。當核心在一非安全性模 式中操作時,核心存取快取38中的安全性資料之任何意 圖’將導致經快取38經由路徑2670產生中止信號。 能夠以多種方法設立T C Μ 3 6。在一實施例中,其能 夠像快取般建立,和安排實施例為包括多數線2 6 1 〇,藉由 與該快取38相同的方法,其每一具有與之相關的一旗標 2612。使用與先前所述之快取38完全相同的方法管理對 T C Μ 3 6的存取,和導致一線填充處理執行之任何τ 〇 μ不 符者,其結果為資料將被截取至一特定線26丨〇,以及分割 檢測器2 6 5 6將產生需要的S標籤值,用以儲存與該線2 6 1 〇 相關的旗標2 6 1 2。 在一選擇性實施例中,可以使TCM 36設立為外部記 憶體56的延伸和用以儲存經常儲存被處理器使用的資 料,因為經由系統匯流排對TCM的存取通常比對外 δυ 1¾ 體的存取更快速。在此類實施例中,TCM 3 6不使用旗伊、 2612,反之使用一不同機制來控制對TCM的存取。 兀兵 123 200417216 是,如先前所述在此類實施 扼供可由處理器設 一控制旗標,當在一權限忠^ & 又 右… 權限女全性帛式中執行時指示是 記憶體,或當執行於至少一非由處理器控制 器控制。由安全性作"统性模式中時’可由 菜糸、、先5又置控制旗標,和實際定 否可由權限安全性模式或非 ^ ^ ^ 汗女全性模式控制TCM。因 所犯夠定義一架構係TCM只能在當 掩抬4W A 士 你田题理器在一權限 陡模式中#作時被控制。在此 ϋ頰貫施例中,對TCM控 錄之任何存取意圖將導致隹 工 等致進入—未定義的指令異常。 在選擇性的架構中,當在 田在一非安全性模式令操作 能夠由處理器控制TCM。在 ^頫貫施例中,只由非安 應用使用該TCM。不能夠性六y +此夠儲存任何安全性資料或從 载入。因此,當執行一安全性在 文主f生存取時,在TCM中不執 何查詢,以了解位址是否與該TCM位址範圍符合。 第57 Μ之流程圖說明當操作於處理器核心1〇之 安全性程式產生一虛擬位址時,由第55圖的設備所執 處理,首先,在第2705步驟,在micr〇 TLB2〇6中執 查詢,以及如果它產生一符合者,則micr〇TLB在第 步驟檢查存取許可。參照第56圖,該程序能夠視為由 許玎邏輯202執行。 如果在第2705步驟,在micro-TLB查詢發生一 者,則在非安全性描述符儲存於其中的主要T]LB 2〇8 一查詢(第2710步驟)。如果它產生一不符者,則在第 步驟執行一分頁表行走程序(如先前參照第37圖所 立之 否只 緊接 處理 義是 此, 安全 制登 時, 全性 TCM 行任 一非 行之 行一 2730 存取 不符 執行 2715 言寸言备 124 200417216 者),其中在第2720步驟以後,它決定主要TLB含有該有 效標籤(tagged)的非安全性描述符。如果在第271〇步驟產 生一符合者,則程序直接進行至第2 7 2 0步驟。 此後,在第2725步驟,micro-TLB把含有實體位址的 描述符的部分載入’其後在第273〇步驟micro-TLB檢查 該些存取許可。 如果在第2730步驟發現有一違反存取許可者,則程序 進行至第2740步驟,其中經由路徑230發出中止信號至處 理器核心(類似於在第5 5圖所示之路徑2 6 70)。然而,如 果未偵測到違反者,則在第2745步驟決定是否該程序與一 可快取的資料項相關。否則,則在第2790步驟初始一外部 存取,以企圖自外部記憶體56截取資料項。在第2795步 驟’分割檢測器2 6 5 6將決定是否有安全性分割違反,即, 如果處理器核心1 〇在一非安全性模式中操作時企圖存取 在安、全性記憶體中的一資料項,以及如果偵測到一違反 者’則分割檢測器2656將在第2775步驟產生中止信號。 “二而’假設沒有安全性分割違反,則程序進行至第2 7 8 5 步驟’其為資料存取所發生處。 如果在第2 7 4 5步驟決定所請求的資料項是可快取 的’則在第2750步驟在快取中執行一快取查詢,以及如果 债測到一符合者,則在第2755步驟快取決定是否有安全性 線標籤違反。因此,在該階段,快取將檢查與包含資料項 的快取線相關的旗標2602之值,和將把該旗標的值與核心 作業模式比較’以決定是否授權核心存取請求的資料 125 200417216 項。如果偵測到一安全性線標籤違反,則程序進行至第 2760步驟,其中由快取38產生一安全性違反錯誤中止俨 號和經由路徑2670發出至核心1〇。然而,假設在第275°5 步驟未偵測到安全性線標籤違反,則在第2785步驟執行資 料存取。 如果當快取查詢在第2750步驟執行時發生一快取不 符者,則在第2765步驟初始一快取線填充。在第277〇 + 驟,此時分割檢測器2656偵測是否有一安全性分割違反 若有則在第2775步驟發出一中止信號。然而,假設未偵硎 到安全性分割違反,則快取線填充在第278〇步驟進行,在 第2785步驟完成資料存取。 如第 57 圖所示,第 27〇5、271〇、2715、272〇、2725、 2730 和 2735 步驟在 MMU 中執行,第 2745、275〇、2755、 2765、2780和2790步驟由快取執行,以及由分割檢測器 執行第2770步驟和第2795步驟。 第58圖是一流程圖,圖示在核心中執行的一安全性程 式產生一虛擬位址時所執行的類似程序(第28〇〇步驟)。藉 由比較第57圖和第58圖,吾人將了解,在MMu中經由8 2835所執行之第2805步驟係相似於先前參照第刀圖所述 之經由2735的第2705步驟。唯—的差別在第281〇步驟, 其中在主| TLB中所執行之查詢係相關於在主要Μ中 儲存的任何安全性描述符,其結果為在第282〇步驟主要 TLB含有有效標籤的安全性描述符。 在快取中,該快取不再需要尋找任何安全性線標藏違 126 200417216 反’因為如第5 8圖所示,假設安全性程式能夠存取安全性 資料和非安全性資料。因此,如果在第285〇步驟快取查詢 期間發生一符合者,則程序直接進行至資料存取步驟第 2 8 8 5步驟。 同樣地,如果需要對外部記憶體的外部存取(即,在第 2 8 6 5或2 8 9 0步驟),分割檢測器不需要執行分割檢查,因MMU 2400 link (which includes a micro-TLB 2410 and a primary TLB 2 4 2 0. When core 10 issues a memory access request, the virtual address is provided via path 2 4 3 0 'and if the micro-TLB When a match is observed, the corresponding physical address is directly output via path 2440, so that the data is returned to core 1 via path 2450. However, if there is a discrepancy in micr0 TLB 2410, then refer to the main TLB 2420 and If the relevant TLB is included in the main TLB, the relevant virtual address part and the corresponding physical address part are intercepted to micro_TLB 2410. After that, the physical address can be issued via path 2440. However, if the main TLB also generates a discrepancy Otherwise, an exception is generated and sent to the core via the 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 the core If a TLB non-conformity is detected, the core enters the monitoring mode with a preset vector for the abnormality in step 25 10. At this time, it will bring the paging table into line with the executed code. And to perform the rest of the steps shown in Figure 54. In particular, in step 2520, the virtual address is issued via path 2430 and intercepted in the micro-TLB 241 〇 and the main TLB 2420. 116 200417216 payer (Hereinafter, Lord Zhu · Mi # is the faulting virtual address), and after that, you will find the following: according to the middle base address of the appropriate form in the first set of forms, in the second place 5 3 0 1 / 2_α & — D j υ The step determines the intermediate address of the first descriptor required. Once the intermediate address is determined (usually using some kind of prediction of the virtual address and the intermediate base address. Again ,,, Q combined), and then refer to the related table in the second set of tables to obtain the corresponding physical address for the first descriptor. Thereafter, in step 2550, the first descriptor can be obtained from the memory to determine the error virtual The middle address of the 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, retrieve the Second descriptor to get false virtual The physical address of the address. Once the above information has been obtained, the program merges the first and second descriptors to generate a new descriptor with the required virtual address-to-physical address translation, step 2585. Perform this step. In a similar way as previously described with reference to Figure 50b, the software performs the merge again, using the smallest page-table size for the combined translation. Thereafter, in step 2590, this is stored in the main TLB 2420 The new descriptor, and the program returns from the exception at step 2595. Thereafter, the core 10 is scheduled to issue a virtual address again for the memory access request via the path 2430, which will still generate a non-conformance in micr0-TLB 2410, but will now generate a conformant in TLB 2420. Therefore, the virtual address part and the corresponding physical address part can be intercepted to the micro-TLB 2410. After that, the micro_TLB 2410 can pass the path 117 200417216 2440. When the MMU works, the authority of the processor, the result of the management, management and retrieval. It is used for a cache and a search for security. It can be used for segmentation, so that the required information can be transmitted back to the core 10 via the route 2450. Bu will understand that in the embodiment described in Figure 50A and Figure 50B, by using the principle described above with reference to Figure 53 and Figure 5 It depends on whether one or two of the MMUs in the above embodiment use two as shown in Figure 5ΠΔ si A or 50B, or as shown in Figure 53; ia Tingbu slave uses an MMU when operating in monitoring mode The fact that the processor manages a group of page tables (or, optionally, in a security mode) only #) ensures that the page tables are secure. As a result, when the device is in the non-secure domain φ ^. 埤, it can only see the non-secure memory because when it is in the non-secure branch Ag | ijb 1. All you can see-the group page table creates an intermediate address space for non-secure domains. It is not necessary to provide a segmentation detector as the memory shown in the first figure, the σ 卩 of °. However, sub-testers are still provided on the external buses to monitor the presence of other bus masters in the system. In the embodiments previously discussed with reference to Figures 37 and 38, references to MMU 2000 are provided. The partition detector 222, and therefore when access is to be performed in the 38, the access permission has already been performed in micro-TLB 2006 and therefore the access permission has been checked (especially for security and non-sexual rape) . Therefore, in such an embodiment, the security data cannot be stored in the non-security response. Access to the cache 38 is performed under the control of the split detection performed by the detector 222 'and therefore in non-secure mode. 118 200417216 However, in an alternative embodiment of the present invention, the segmentation detector 222 is not provided for monitoring access by the system bus 40. On the contrary, the data processing equipment has only one connected to the external bus 70. 'Single Detector Detector' is used to control access to the memory unit connected to the external bus. In such embodiments, at this time it means that the processor core is able to access any memory unit directly connected to the system bus 40, such as tCM36 and cache 3 8 'without having to oversee the external partition detector These accesses, and therefore some mechanisms are needed to ensure that the processor core, when operating in a non-secure mode, 'does not access non-secure data accesses in the cache 38 or TCM 36. FIG. 55 illustrates a data processing device according to an embodiment of the present invention, in which a mechanism is provided to enable the cache 38 and / or the TCM 36 to control access to it without the need to provide a correlation with the MMU 200. Any split check logic. As shown in Figure 55, the core 10 is connected to the system bus 40 through MMU 200, and the cache 38 and TCM 36 are also connected to the system bus 40. The core, 10, cache 38 and TCM 36 are connected to the external bus 70 through the external bus interface 42, which includes a single address bus "M,-control bus 2630 and a data bus 2640, such as This is shown in Figure 55. The core 10, MMU 200, cache 38, TCM36, and external bus interface 42 can be considered as a single device connected to the external bus 70, as a device bus, and other devices. It can also be connected to the above-mentioned device bus, such as the safety peripheral device 47 or the non-security peripheral device 472. Also connected to the device bus 70 is one or most memory units, such as the external memory 56. In addition, A bus control unit "M 119 200417216" is connected to the device bus 70 and usually 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 ^ Figure 'The arbiter, decoder and segmentation detector are shown as a single block' but should be placed in a single control block 2 6 At 50 o'clock, these components work in the same way. The MMU 200 in FIG. 55 is further detailed in FIG. 56. Comparing Figure 56 with Figure 37, you can see MMU 200. It is constructed in exactly the same way as MMU in Figure 37, the only difference is that the detector 222 is not used for monitoring the path between the main TLB 208 and micro 206 242 data transmission. 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 a physical entity, this will bypass MU 2 0 0 and directly route to the system bank 40 via path 2 3 6 ^ In one embodiment, only when the processor is in the monitoring mode Intermediate time 'generates a memory access request that directly specifies the physical address. Recalling the previous description of MMU 200, and especially Figure 43, the main TLB 208 will contain some descriptors 435, and a domain flag 4 2 5 will be provided for each descriptor to determine whether the corresponding descriptor is self-contained. Security paging table or a non-security paging table. The above descriptor and associated domain flag 425 are described in MMU 200 in FIG. 55. The area of a streamline% 47 is the same by sending a request with a split-TLB 10, from the bus L address, the description of the bus operation to the 435 profile 120 200417216 Tian core w issued-when the memory access request The physical address of the access request is output to the system bus ... At this time, cache 38 will execute the query process, and ^ data items are stored in the cache. As long as the cache is not = m μ, the data item belonging to the access request is not in error. The cache invitation is taken: Take the first line filling (Hnefiii) process 4 to retrieve the data from the external memory 5 ′. Data items belonging to a memory access request. In particular, the cache will be borrowed from the EBI 42 output-line fill request to the control bus 2630 of the device bus 70, and the initial address will be output to the address bus 2620. In addition, a HpRot signal will be output to the control bank 2630 via a path ^ 2, which will include a domain signal indicating the core operation mode when a memory access request is issued. Therefore, the line fill procedure can be viewed as the propagation of cached raw memory access requests to the external buses. The HPROT signal is received by the segmentation detector 2656, and it is thus confirmed whether the segmentation detector, when an external memory access request is issued, installs the specified data requested from the external memory 56 (in this case, the device and Core 10 and cache 3 8 work together) to operate in a secure domain or in a non-secure domain. The split detector 2656 will also access split information that confirms whether the memory area is secure or non-secure, and can therefore determine whether the device will allow access to the data it requested. Therefore, if the domain signal in the HPROT signal (also referred to as the S bit in this article) declares that access to the data is requested by the device, then when operating in a security mode, it is capable of Arrange the partition detector to only allow a device to access a security portion of the memory. 121 417216 If the server has been identified for a long time, the detector decides not to allow the core 10 to access the requested data. For example, Mo 4 u is the hpr〇t signal and it has been confirmed that the core is not in a non-security mode. 6 people Work, but the line filling request attempts to retrieve data from the memory of the female general area in one of the female memory areas, then the segmentation detector 2 6 5 6 sends out a suspension of the power ° ~ to the control bus 2630 (It will be sent back to EBI 42 via path 2636, and Private 1 causes a suspension message to be sent to core 10 via path 2670. However, if the eight S mark signal 2: Cut detector 2656 decides to allow access, it outputs- Data or non-security ... Make sure that the data intercepted from the external memory is returned to the EBI 4 material, and that the S-tag signal passes the path 2634 to the filling process / 42, and sets the flag related to the cache line 2600. Belonging to the line at the same time, the line filling data series 2650 authorizing the external memory 56 to request 38 from the external storage 56 to store the data through the path 2680 via EBI 42 to the cache; the relevant cache line 2 6 0. Therefore, the result of this process is * Barrier | Λ ^ " 6 data item fill cache The selected cache line will be filled with negative material items from the external # @, ^ 隐 体 56, these data items include belonging to ^. 1 〇 The data items of the original memory access request. The items belonging to the "Yiyi" from the core memory access exemption can be selectively returned to the core from cache 38 ~ 'or can be selectively Passed from EBI 42 to core 10 via path 2660 for direct provisioning. Therefore, in the preferred embodiment, the above-mentioned line filling process will cause the original storage of the cache line to occur, and the flag 26 associated with the cache line 〇2 will be set based on the value provided by the split detector 2656, and this flag will then be used by cache 38 to directly control any subsequent access to the item 122 200417216 in cache line 2600. Therefore, if the core 10 then causes a particular cache line 2600 in cache 3 8 to generate a conformant memory access request, the cache 38 will check the value of the relevant flag 2602 and This value is compared with the value of the existing operating mode of the core 10. In the better In the embodiment, a domain bit set by a monitoring mode in the CP 15 domain status registration indicates an existing mode in which the core 10 operates. Therefore, when the processor core 10 is operating in a security operation mode Can be arranged to cache 38 data items that are only allowed in one cache line, which is indicated by the corresponding flag 2602 as security data that can be accessed by the processor core 10. When the core is in a non-security mode During operation, any intent by the core to access the security data in the cache 38 will cause an abort signal via the cache 38 via path 2670. TCM 36 can be set up in a variety of ways. In one embodiment, it can be created 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 TC Μ 3 6 and any τ 〇μ that causes the first-line fill processing to be performed, as a result of which the data will be intercepted to a specific line 26 丨〇, and the segmentation detector 2 6 5 6 will generate the required S-tag value to store the flag 2 6 1 2 associated with the line 2 6 1 〇. 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 the access to the TCM via the system bus is usually less than the external δυ 1¾ Faster access. In such embodiments, TCM 36 does not use flags, 2612, but instead uses a different mechanism to control access to the TCM.兵兵 123 200417216 Yes, as described earlier in this type of implementation, the processor can set a control flag. When executed in a permission loyalty ^ & right ... permission female generality mode indicates that it is memory, Or when executed on at least one non-controlled by the processor controller. From the security mode, the “common mode” can be controlled by the menu, and then set the control flag, and the actual control can be controlled by the permission security mode or non- ^ ^ ^ Khan women's holistic mode. Because it is enough to define an architecture, the TCM can only be controlled when the 4W A driver is used to operate the field processor in a steep mode. In this example, any intent to access the TCM record will result in entry by workers, etc.—undefined command exception. In an alternative architecture, the TCM can be controlled by the processor when the field is in a non-secure mode. In the ^ penetrating embodiment, the TCM is used only by non-safety applications. It is not possible to store any security data or load from. Therefore, when performing a secure access to the host, no query is performed in the TCM to find out whether the address matches the TCM address range. The flow chart of 57M illustrates that when a security program operating on processor core 10 generates a virtual address, it is executed by the device of FIG. 55. First, in step 2705, it is executed in micr0TLB206. The query, and if it generates a match, the micr0TLB checks the access permission at step. Referring to FIG. 56, the program can be regarded as being executed by the Xu logic 202. If one of the micro-TLB queries occurs at step 2705, the main T] LB 208 query at which the non-security descriptor is stored (step 2710). If it produces a discrepancy, then a paging table walking procedure is executed in the first step (as previously referred to in Figure 37, it is just the processing meaning that this is the case. When the security system is registered, the full-scale TCM will perform any non-executive action. A 2730 access does not match the execution of 2715 (124 200417216), where after step 2720, it decides that the main TLB contains a non-security descriptor that is tagged. If a match is generated at step 2710, the procedure proceeds directly to step 2720. Thereafter, at step 2725, the micro-TLB loads the portion containing the descriptor of the physical address', and then at step 273, the micro-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 230 (similar to path 2 6 70 shown in Fig. 55). However, if no violator is detected, then at 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 2790 in an attempt to intercept the data item from the external memory 56. At step 2795, the 'segmentation detector 2 6 5 6 will decide if there is a security segmentation violation, that is, if the processor core 10 attempts to access the secure and full memory while operating in a non-secure mode. A data item, and if a violator 'is detected, the segmentation detector 2656 will generate an abort signal at step 2775. "Two and 'assuming there is no security partition violation, the process proceeds to step 2 7 8 5' which is where the data access occurs. If it is determined at step 2 7 4 5 that the requested data item is cacheable 'Then perform a cache query in the cache at step 2750, and if a match is detected by the debt, the cache determines the security line label violation at step 2755. Therefore, at this stage, the cache will Check the value of the flag 2602 associated with the cache line containing the data item, and compare the value of this flag with the core operating mode 'to determine whether to authorize the core to access the requested data 125 200417216. If a security is detected Sex line label violation, the program proceeds to step 2760, where a security violation error suspension number generated by cache 38 and issued to core 1 via path 2670. However, it is assumed that it is not detected at step 275 ° 5 If the security line label is violated, data access is performed at step 2785. If a cache mismatch occurs when the cache query is executed at step 2750, an initial cache line fill is performed at step 2765. At step 277 + At this time, the segmentation detector 2656 detects whether there is a security segmentation violation and sends a stop signal at step 2775. However, assuming that no security segmentation violation is detected, the cache line is filled at 278. Steps are performed, and data access is completed at 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 Steps 2765, 2780, and 2790 are performed by the cache, and steps 2770 and 2795 are performed by the segmentation detector. Figure 58 is a flowchart illustrating a security program executed in the core to generate a virtual address A similar procedure (step 2800) is performed at the time. By comparing Fig. 57 and Fig. 58, we will understand that the 2805 step performed in MMU via 8 2835 is similar to the previous reference to the knife chart It is described through step 2705 of 2735. The only difference is in step 2810, where the query performed in the main | TLB is related to any security descriptor stored in the main M, and the result is in the 282 〇Step TLB contains A security descriptor with a valid label. In the cache, the cache no longer needs to look for any security lines. Hiding violations 126 200417216 Anti-because, as shown in Figure 5-8, it is assumed that the security program can access the security Data and non-security data. Therefore, if a match occurs during the cache query in step 285, the procedure proceeds directly to step 2 8 8 5 in the data access step. Similarly, if external memory External access (ie, in steps 2 8 5 or 2 89), the segmentation detector does not need to perform a segmentation check because

為再次假設安全性程式能夠存取安全性資料或非安全性資 料。 在快取中執行的第2845、2850、2865、2880和2890 步驟係類似於先前參照第57圖所述之第2745、2750、 2765、 2780 和 2790 步驟。 第59圖圖示在處理器上執行的不同模式和應用。依據 本發明的一實施例,虛線指示在處理器的監控期間不同模 式和/或應用如何能夠彼此分別和分開βSuppose again that a security program can access secure or non-secure data. Steps 2845, 2850, 2865, 2880, and 2890 performed in the cache are similar to steps 2745, 2750, 2765, 2780, and 2790 described earlier with reference to Figure 57. Figure 59 illustrates the different modes and applications executing on the processor. According to an embodiment of the invention, the dashed lines indicate how different modes and / or applications can be separated and separated from each other during the monitoring of the processor β

監控一處理器以找尋可能錯誤和發現應用為何不如預 期般執行的能力是非常有用的以及許多處理器提供此類功 能。能夠以包括偵錯和追蹤的功能之許多方法執行該監控。 依據本發明之技術,在處理器中偵錯能夠以幾種模式 操作,包括停機偵錯模式以及監控偵錯模式。該些模式侵 入和使程式在欲停止時執行。在停機偵錯模式中,當一斷 點(breakpoint)或一監視點(watchpoint)發生時,核心停止 並從其餘的系統分離以及核心進入偵錯狀態。一開始時核 心停止,管道(Pipeline)清除以及未有任何指令被預先取 回。使PC凍結以及忽略任何中斷(IRQ和FIQ)。而後可能 127 200417216 檢查核心内部狀態(藉由JTAG序列界面)以及記憶體系統 的狀態。該狀態對程式執行是侵入式的,因為它可能修改 現有模式、改變登錄狀況、等等。一旦偵錯終止,核心利 用Debug TAP藉由掃描Restart指令,從偵錯狀態退出。 而後程式重新繼續執行。 在監控偵錯模式中,一斷點或監視點使核心進入中止 模式,分別採用預取(prefetch)或資料中止向量(Data Abort v e c t o r s)。在這種情況下,如果核心處於停機(H a 11)偵錯模 式,核心仍然在一功能模式下且不停止。中止管理器與一 偵錯應用通訊,以存取處理器和辅助處理器狀態或傾印記 憶體。一偵錯監控程式處於偵錯硬體和軟體偵錯器之間。 如果已設定控制登錄D S CR以及偵錯狀態的位元11 (詳見 下文),能夠阻止中斷(FIQ和IRQ)。在監控偵錯模式,在 資料中止(Data Aborts)和預取中止(prefetch Aborts)中使 向量截取失效,以避免因為替監控偵錯模式產生的中止, 使處理器被迫進入不可恢復的狀態。應該注意的是監控债 錯模式是一種偵錯模式以及不相關於處理器的監控模式 (監督在安全性情境和非安全性情境之間轉換的模式)。 偵錯在某種時刻能夠提供處理器狀態的快照。其在接 收到偵錯初始請求時,藉由在各種登錄上註解該些值以達 成。在一掃描鏈上記錄了該些值(第67圖中的541、544 ) 以及而後它們使用JTAG控制器(第j圖的18)依序輪出。 監控核心的一種選擇方法是用追蹤(trace)。追蹤不是 侵入式的和如果核心繼續操作則記錄爾後的狀態。追蹤是 128 200417216 在第一圖中的22、26之嵌入式追蹤巨細胞(ETM,Embedded Trace Macrocell)上執行。ETM有一追蹤埠口,藉以輸出追 蹤資訊,而後可由外部追蹤璋口分析器分析。 本技術實施例的處理器在兩分離的網域中操作,在所 述之實施例中’該些網域包括安全性和非安全性網域。然 而’由於監控功能的目的,熟習該項技藝著將清楚該些網 域可能是彼此間資料不會洩漏的任何兩網域。本技術的實 施例關聯於防止在兩網域間資料的洩漏以及諸如偵錯和追 縱之監控功能’其允許對整個系統便利的存取,又該整個 系統係在網域間資料洩漏的潛在來源。 在上述之安全性和非安全性網域或情境的示例中,安 全性資料不能被非安全性情境獲得。此外,如果在安全性 情境中允許偵錯’它可能有助於限制或隱藏安全性情境中 的一些資料。第5 9圖的虛線顯示一些可能方法的示例,其 劃分資料存取和提供不同層級的粒度(granularity)。在第 59圖’方塊500顯示監控模式和其為所有模式中最安全 者,並控制在安全性和非安全性情境之間轉換。在監控模 式5 00之下有一監督模式52〇。而後具有應用522和524 之非安全使用者模式,以及具有應用512、514和516 之安全〖生使用者模式。只能控制監控模式㈠貞錯和追蹤)監 控非安全性模式(虛線5〇1左邊)。選擇性地,可以允許監 控非安全14網域或情境和安全性使用者模式(5 〇工的左邊 矛01右邊在502下面的部分)。在一進一步的實施例中, 可以允許在安全性使用者網域中執行非安全性情境和某些 129 200417216 應用,在這種情況下,由虛線503進一步劃分。此類劃分 有助於在可以執行不同應用的不同使用奢之間防止安全性 資料的洩漏。在某些控制情況下,可以允許監控整個系統。 依據所需的粒度,於監控功能期間,核心的下列部分需要 具有它們控制的存取。 在一偵錯情況下,可以設定四種登錄;指令錯誤狀態 登錄(如果SR)、資料錯誤狀態登錄(DFSr)、錯誤位址登錄 (FAR)、和指令錯誤位址(IFAR)。當從安全性情境到非安全 性情境時,在一些實施例中應清除上述登錄,以避免資料 的任何洩漏。 PC樣本登錄:DebUg TAP能夠藉由掃描鏈7存取該 PO當在安全性情境中偵錯時,可以依據在安全性情境中 選擇的偵錯粒度對該值進行遮罩(mask)。當核心在安全性 情境中執行時,讓非安全性情境、或加上安全性使用者應 用的非安全性情境不能得到PC的任何值是重要的。 TLB項目·可此使用CP15以讀取micr〇-TLB項目讀 寫主要TLB。吾人也能夠控制主要TLB和micr〇 TLB的載 入和配對(matching)。這種操作必須嚴格地控制,尤其是 如果安全性執行緒偵錯需要MMU/MPU的援助。 效能監控控制登錄··效能控制登錄針對該些快取不符 者、micro-TLB不符者、外部記憶體請求、執行的分支指 令、等等給予資訊。非安全性情境不應該存取該些資料, 即使在偵錯狀態中。即们貞錯在安全性情境中失效,該些 計數應可在安全性情境中操作。 130 200417216 非侵 持一 能夠 許對 非安 該位 錯中 存取 由僅 部分 限制 能是 方法 在快取系統中债錯:在一快取的系統中的偵錯一定是 入式(〇bservable)的。為了在快取和外部記憶體之間保 致性,這是重要的。使用CP15能夠使快取失效或 強迫該快取寫入一所有區域。無論如何,在偵錯中允 快取行為的修正可能是安全性的弱點而應該要控制。 位元組順序(Endianness):不應該允許能夠存取偵錯的 全性情境或安全性使用者應用改變位元組順序。改變 元組順序可能導致安全性核心故障。依據粒度,在偵 禁止位元組順序的存取。 在監控功能開始時,可以控制核心部分的監控功能之 。摘錯和追蹤可用許多方法初始。本技術的實施例藉 允許在某些條件下初始,以控制對核心的某些安全性 的監控功能的存取。 本技術的實施例藉由下列粒度尋求對進入監控功能的 藉由分別控制侵入式和非侵入式(追蹤)偵錯; 藉由只允許在安全性使用者模式中或在整個安 全性情境中偵錯項目; 藉由只允許在安全性使用者模式中和更考慮執 行緒ID進行偵錯(應用執行)。 為了控制一監控功能的初始化,了解能夠如何初始功 重要的。第όο圖顯示一表說明初始一監控功能之可月b ,初始的監控功能型態和此類初始化扣令叮以由矛、 131 200417216 設計。 通常,能夠藉由軟體或藉由硬體進入該4b於 即,藉一控制器。為了控制監控功能的一初:::使 用控制值。上述包含位置相依之啟動位元和因此如果出現 一特定位元,只充許在設定了該啟動位元的情況下啟動監 控。在一安全性登錄CP14儲存了該些位元㈠貞錯和狀態控 制登錄、DSCR),其位於在ICE 53〇中(.請參考第67圖卜 在一較佳的實施例中,有啟動侵入和停用侵入和弗侵 入偵錯的四位元,上述包含一安全性偵錯啟動位元、一 ^ 全性追蹤啟動位元、一安全性使用者模式啟動位元和一安 全性執行緒偵知啟動位元。該些控制值用於為監控功能提 供一定程度的可控制粒度以及因而能夠幫助防止一特定網 域的洩漏第6 1圖提供該些位元的概要以及如何能夠存取 它們。 在安全性網域中的一登錄中儲存該些控制位元,以及 對該登錄的存取限制於三種可能性。藉由arm輔助處理 器MRC/MCR指令提供軟體存取,而上述只允許來自安全 1*生皿督模式者。選擇性地,&夠從任何其它模式使用一授 權碼提供軟體存取。一進一步的選擇與硬體存取較為相 關,並涉及利用在JTAG的輸入埠來寫入指令。除了用來 輸入與監控功能的有效性相關的控制值以外,能夠用該輸 入淳來輸人與處理器的其它功能相關的控制值。 ⑴ 與掃描鏈和JTAG相關的進一步細節如下文所述。 132 200417216 登錄邏輯格(Register lo gic 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)輸入而非〇 輸入0 掃描鏈 如第64圖所示,所有掃描鏈格都被串鏈為掃描鏈。 在功能模式中,SE是清楚的以及通常都能夠存取所有 登錄格和與電路的其它邏輯相互作用。在測驗(Test)或 貞 133 200417216 錯(Debug)模式中,SE被設置以及在一掃描鏈彼此間串鏈 所有的登錄。資料能夠來自第一掃描鏈格和能夠依每一時 脈週期的節奏藉由任何其它掃描鏈格轉換。能夠轉換出資 料以了解登錄内容。 ΙΛΡ控則装 使用一偵錯TAP控制器以控制一些掃描鏈。該TAp 控制器能夠選擇特定的掃描鏈:其連接「掃描入」和「掃 描出」信號至特定掃描鏈。之後資助能夠被掃描入串鏈裡、 轉換、或掃描出。由一 JTAG埠界面由外部控制該TAp控 制器。第65圖圖示一 TAP控制器。 IXAG選jf性失效播描鍅捻 基於安全性原因,一些登錄不可以被掃描鏈存取,甚 至在偵錯或測驗模式亦然。一稱作JADI(JTAG存取失效) 的新輸入能夠允許從一整個掃描鏈動態或靜態地移除一掃 描鏈格,而不必修改積體電路中的掃描鏈架構。第ΜA和 第66B圖示該輸入。 如果JADI是未啟用的(JADI = 〇),不論是否在功能或 測驗或偵錯模式中,掃描鏈如往常一樣工作。如果JAM 是啟用的(JADI=1),以及吾人在測驗或偵錯模式中,一些 掃描鏈格(由設計者選擇)可以自掃描鏈架構「移除」。為了 保持相同數量的掃描鏈格,JTAG選擇性失效掃描鏈格使 用一略過登錄(bypass register)。請注意掃描出(s〇, 134 200417216 out)以及掃描鏈格輸出(Q)現下是不同的。 第67圖圖示包括JTAG之一些部分的處理器。在正常 的操作中,指令記憶體5 5 0與核心通訊亦可以在某些狀況 下與登錄CP14通訊和重設控制值。通常僅容許自安全性 監督模式進行。 當偵錯初始化,藉由Debug TAP(偵錯TAP) 5 80輸入 指令,且其即為控制核心者。偵錯下的核心以逐一步驟模 式執行。Debug TAP藉由核心存取 CP14(依據輸入於 JSDAEN PIN之存取控制信號,其以JADI PIN顯示(第45 圖之 JTAG 存取失效輸入,JTAG ACCESS DISABLE INPUT)) 以及也能夠藉由該方法重設控制值。 藉由存取控制信號JSDAEN控制了藉由 Debug TAP 580對CP 14登錄的存取。這麼安排係為使存取尤其是寫入 存取允許JSDAEN必須設為高。當已確認該整個處理器, 在機板階段(b 〇 a r d s t a g e )期間,在整個系統啟用4貞錯並設 JSDAEN為高。一旦已經檢查了系統,貝q JSDAEN PIN能 夠接地,它意味著現下不能藉由Debug TAP 5 80在安全性 模式啟用偵錯。在生產模式中的一般處理器具有接地之 J S D A E N。因此只能藉由經由指令記憶體5 5 0繞送之軟體 存取控制值。經由該繞送之存取係限制在安全性監督模式 或在提供一授權碼的另一模式(請參考第68圖)。 應該注意的是,在預設中,偵錯(侵入和非侵入-追蹤) 只能用於非安全性情境中。為使它們可用於安全性情境 中’需要設置控制值啟用位元。 135 200417216 它的優& 郝义偵錯只能總是由使用者初始以在非安全性 *險士竟中 。因此,雖然在偵錯中使用者通常不能夠存取 安全,f生情壇 是許多情況下它並不是問題,因為對該情境 的存取是受 旧的以及在可用之前的機板階段已經徹底確認 安全性情培 因此可預見在許多情況下安全性情境的偵錯 是不必要0¾ 。如果必要,一安全性監督仍然能夠藉由寫入 CP14的軟體 繞送初始化偵錯 〇 第 6 8 屬 圖_示偵錯初始化的控制。在該圖中,核心600 的一部伤"句4τ. 枯〜儲存元件601(如先前所述可以是一 CP 15 登錄)盆中紗 ' 爾存指示是否系統在安全性情境中的一安全性 元S°核心600也包括一登錄602,其包括指示處 理裔所執行之模式(例如使用者模式)以及一登錄603其提 供一内容識別符以確認現下執行於核心之應用或執行緒。 當到達一斷點時,一比較器將在登錄6 1 1儲存的斷點 與在登錄6 1 2中儲存的核心位址比較,把信號送到控制邏 輯620。控制邏輯620查看安全性狀態S、模式602和執 行緒(内容識別符)603並把其與控制值和在登錄CP14儲存 的條件狀態比較。如果系統不是在安全性情境中操作,則 一「進入偵錯」信號將在6 3 0輸出。然而如果系統是在安 全性情境中操作,則控制邏輯620將查看模式602,以及 如果它是在使用者模式,將檢查以了解是否使用者模式已 啟用和偵錯啟用位元已設定。如果它們是的話,則偵錯將 初始化,便了解執行緒偵知位元(thread aware bit)尚未初 始化。上文中描述控制值的階層性本質。 136 200417216 在第68圖亦圖示監控控制的執行緒偵知部分和如何 只能夠自安全性監督模式(在本實施例中,處理器係在生產 階段而JSDAEN接地)轉換在登錄CP14中儲存的控制值。 能夠使用一授權碼從一安全性使用者模式進入安全性監督 模式’而後能夠在C P 1 4設置控制值。 當位址比較器610指示斷點已經到達時,控制邏輯62〇 輸出一「進入偵錯」信號,便了解執行緒比較器64〇顯示 就該執行緒而言允許偵錯。假設在Cpi4設置了執行緒偵 知初始化位元。如果執行緒偵知初始化位元係設置一斷點 之後,如果位址和内容識別符合在斷點中和在允許的執行 緒指標中指示的該些,則只能進入偵錯或追蹤。在一監控 功能初始化之後’只能在比較器64〇债測到偵測内; 符為一允許的執行緒時,繼續診斷資料的擷取。當一内容 識別符顯示執行的應用不是一允許者時,%阻止诊斷資料 的掏取。 應該注意的是,在動;杜杳& Α丨士 隹争又佳實施例中,有粒度中的某種階 層。實際上安全性 貞錯每抬炉私田/ - 只荷次追蹤啟用位兀係在頂部,接下來 為安全性使用者模式啟用你开 知县么 、狄用位70,和最後是安全性執行緒偵 知啟用位元。如第69Α圖釦笛固化丄 八圃和第69Β圖所述(詳見下文)。 在「偵錯和狀態控制(Debug 錄(CP14)保留的控制值依據網域 a n d S t a t u s C ο n t r ο 1)」登 、模式和執行緒控制安全 性偵錯粒度。 其在安全性監督模式之頂部。一旦設定了「偵 錯和狀態控制」登錄 斷點、監視點、等等 CP 14,由安全性監督模式設計對應的 ,使核心進入偵錯狀態。 137 200417216 第69A圖概述侵入式偵錯的安全性偵錯 預設值係以灰色表示。 相關於非侵入式偵錯之偵錯粒度亦然。 在這種情況下的安全性偵錯粒度,此第也用 的預設值。 請注意安全性使用者模式偵錯啟用位元 緒偵知偵錯啟用位元一般用於侵入式和非侵 一執行緒偵知初始化位元係儲存在登錄 示是否依據應用需要粒度。如果執行緒偵知 化,控制邏輯將進一步檢查應用識別符或執 執行緒债知控制值中所指示者,如果是,則 化。如果使用者模式或偵錯啟用位元之任一 緒偵知位元已設置以及執行的應用不是在執 值中所指示者,則將忽略該斷點以及核心將 來所進行者而偵錯將不被初始化。 除控制監控功能的初始化以外,也能夠 法控制在一監控功能期間診斷資料的擷取。 目的,在監控功能的操作期間核心必須繼 值’即在登錄CP 1 4儲存之啟用位元和它們έ 第7 〇圖圖示一監控功能執行時的粒度 下’區域Α相關於被允許擷取診斷資料的區 關於控制值在CP14儲存的區域,意指它不 資料。 因此,當執行偵錯時以及一释式在區域 粒度。重設的 第69B圖概述 灰色表示重設 和安全性執行 入式彳貞錯。 CP14中並指 位元已經初始 行緒603是在 偵錯將被初始 未設置或執行 行緒偵知控制 繼續進行其原 藉由一類似方 為了達碜上述 續考慮兩控制 6相關條件。 。在這種情況 域’區域B相 可能截取診斷 A操作時,診 138 200417216 斷資料在偵錯期間是以逐步的方式輸出。當操作轉換為區 域B時,其為不允許診斷資料擷取處,偵錯以逐步方式進 行,反之其自動進行而沒有任何資料被擷取。如此繼續直 到程式的操作再次進入區域A,據以再次開始診斷資料的 截取而偵錯繼續以逐步方式執行。 在上述實施例中’如果未啟用安全性網域,一 SMI指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 operate in several modes, including a shutdown debug 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 detaches from the rest of the system and the core enters the debugging state. The core was stopped at the beginning, the pipeline was cleared and no instructions were retrieved in advance. Freezes the PC and ignores any interrupts (IRQ and FIQ). Then maybe 127 200417216 to check the internal status of the core (through the JTAG serial interface) and the status of the memory system. This state is intrusive to program execution because it may modify existing modes, change registration status, and so on. Once the debugging is terminated, the core uses the Debug TAP to exit the debugging state by scanning the Restart instruction. The program then resumes execution. In the monitoring and debugging mode, a breakpoint or a monitoring point causes the core to enter the abort mode, using prefetch or data abort vectors (Data Abort v e c t or r s), respectively. In this case, if the core is in shutdown (H a 11) debug mode, the core is still in a functional mode and does not stop. The suspension manager communicates with a debug application to access processor and auxiliary processor status or dump memory. A debug monitor is located between the debug hardware and the software debugger. Interrupts (FIQ and IRQ) can be prevented if bit 11 (see below for details) that controls register DSCR and debug status is set. In the monitoring and debugging mode, the vector interception is invalidated in the data aborts and prefetch aborts to avoid the interruption caused by the monitoring and debugging mode, causing the processor to be forced into an unrecoverable state. It should be noted that the monitoring debt mode is a debugging mode and a processor-independent monitoring mode (a mode for supervising the transition between a security context and a non-security context). Debugging can provide a snapshot of processor state at some point. When it receives the initial request for debugging, it does so by annotating these values on various logins. These values are recorded on a scan chain (541, 544 in Figure 67) and then they are sequentially rotated out using a JTAG controller (18 in Figure j). One option for monitoring the core is to use traces. Tracking is not intrusive and records subsequent status if the core continues to operate. The tracing is performed on the embedded trace macrocell (ETM) of 22 and 26 in the first picture. The ETM has a tracking port to output tracking information, which can then be analyzed by an external tracking port analyzer. The processor of the embodiment of the present technology operates in two separate network domains. In the described embodiment, these network domains include secure and non-secure network domains. However, ‘for the purpose of the monitoring function, familiarity with this skill will make it clear that these domains may be any two domains whose data will not leak to each other. Embodiments of the present technology are related to preventing data leakage between two network domains and monitoring functions such as error detection and tracing, which allows 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. Furthermore, if debugging is allowed in a security context, it may help limit or hide some of the information in the security context. The dotted lines in Figures 5 and 9 show examples of some possible methods that divide data access and provide granularity at different levels. Block 500 in Figure 59 shows the monitoring mode and it is the safest of all modes and controls the transition between security and non-security scenarios. Below the monitoring mode 500 there is a monitoring mode 52. Then there are non-secure user modes with applications 522 and 524, and a secure user mode with applications 512, 514 and 516. Only the monitoring mode can be controlled (error and tracking). Monitoring the non-security mode (left of the dotted line 501). Optionally, it may allow monitoring of non-secure 14 domains or context and security user modes (the left side of the 50 worker and the right side of the spear 01 below the 502). In a further embodiment, non-security contexts and certain 129 200417216 applications may be allowed to execute in the security user domain, in which case it is further divided by the dashed line 503. This type of division helps prevent the leakage of security data between different uses that can perform different applications. Under certain control conditions, the entire system can be monitored. Depending on the required granularity, the following parts of the core need to have the access they control during the monitoring function. In the case of an error detection, four types of registrations can be set; instruction error status registration (if SR), data error status registration (DFSr), error address registration (FAR), and instruction error address (IFAR). When changing from a security context to a non-security context, the above registration should be cleared in some embodiments to avoid any leakage of data. PC sample registration: DebUg TAP can access the PO through scan chain 7. When debugging in the security context, the value can be masked according to the debugging granularity selected in the security context. When the core executes in a security context, it is important that the non-security context, or the non-security context applied by the security user, cannot get any value of the PC. TLB project CP15 can be used to read the micr0-TLB project to read and write the main TLB. We can also control the loading and matching of the main TLB and micr0 TLB. This operation must be strictly controlled, especially if security thread debugging requires assistance from the MMU / MPU. Performance monitoring control registration · The performance control registration gives information on those cache mismatches, micro-TLB non-compliances, external memory requests, branch instructions executed, and so on. Non-security situations should not access this data, even in a debug state. That is, they are invalidated in a security context, and these counts should be operable in a security context. 130 200417216 Non-trespassing can enable access to non-safety and dislocations. Only partial restrictions can be a method. Cache faults in a cache system: Debugging in a cache system must be in-line. of. This is important for consistency between cache and external memory. Using CP15 can disable the cache or force the cache to write to all areas. However, corrections that allow caching in debugging may be a weakness in security and should be controlled. Byte Order: Endianness should not allow global context or security user applications with access to debug to change the byte order. Changing the tuple order may cause a core failure in security. Depending on the granularity, sequential access to bytes is prohibited during detection. At the beginning of the monitoring function, you can control one of the core monitoring functions. Extraction and tracking can be initiated in many ways. Embodiments of the present technology allow for initialization under certain conditions to control access to certain security monitoring functions of the core. The embodiments of the present technology seek to control intrusive and non-intrusive (tracking) debugging separately for access monitoring functions by the following granularity; by allowing detection only in the security user mode or throughout the security context Errors; By allowing debugging only in the security user mode and taking thread ID into account (application execution). To control the initialization of a monitoring function, it is important to understand how the function can be initiated. Figure 6 shows a table explaining the initial monitoring function b, the initial monitoring function type and such initialization deduction are designed by Spear, 131 200417216. Usually, the 4b can be accessed by software or by hardware, that is, borrow a controller. To control the monitoring function at the beginning ::: Use the control value. The above includes the position-dependent enable bit and therefore, if a specific bit appears, it is only allowed to start monitoring if the enable bit is set. The security log CP14 stores these bit errors and status control logs (DSCR), which are located in ICE 53〇 (Please refer to Figure 67. In a preferred embodiment, there is a boot intrusion. And disable intrusion and intrusion detection four bits, the above includes a security debug enable bit, a full trace enable bit, a security user mode enable bit, and a security thread detect These control values are used to provide a degree of controllable granularity for the monitoring function and thus can help prevent leakage from a specific network domain. Figure 61 provides a summary of the bits and how they can be accessed. 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 arm auxiliary processor MRC / MCR instructions, which are only allowed from Security 1 * Health Supervisor Mode. Optionally, & can provide software access from any other mode using an authorization code. A further option is more related to hardware access and involves the use of an input port on JTAG to write In addition to being used to enter control values related to the effectiveness of the monitoring function, this input can be used to enter control values related to other functions of the processor. 进一步 Further details related to scan chains and JTAG are as follows 132 200417216 Register logic cell Each integrated circuit (1C) contains two types of logic: • Combined logical cell; for example, AND, OR, INV gates. Use such gates based on one or most input signals. Or a combination of such gates to calculate the Boolean representation. • Log in to a logical grid; for example, LATCH, FLIP-FLOP. Use this grid to § record any signal value. Figure 62 shows a positive edge (positive? -edge) Triggered FLIP-FLOP: When a positive edge event occurs on the clock signal (CK), the output (Q) receives the value of the input (D); otherwise the output (Q) keeps its value in memory . For the purpose of testing or debugging, the scan key grid needs to bypass 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 shown in Figure 63. Key lattice In the formula, the scan enable (SE, Scan Enable) is clear and the login box functions as a single login box. In the test or debugging mode, the SE is set and the input data can come from the Scan In (SI) input instead of 〇 Enter 0 as shown in Figure 64. All scan chains are chained as scan chains. In the functional mode, SE is clear and usually has access to all login grids and interacts with other logic in the circuit. In the test or test mode, the SE is set up and all logins are chained to each other in a scan chain. Data can come from the first scan chain and can be converted by any other scan chain at the pace of each clock cycle. Ability to convert data to understand login content. The IΛP controller is equipped with a debug TAP controller to control some scan chains. The TAp controller can select a specific scan chain: it connects the "scan in" and "scan out" signals to a specific scan chain. Funding can then be scanned into the chain, converted, or scanned out. The TAp controller is controlled externally through a JTAG port interface. Figure 65 illustrates a TAP controller. For security reasons, some logins cannot be accessed by the scan chain, even in debug or test 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. The MA and 66B illustrate this input. If JADI is not enabled (JADI = 〇), the scan chain works as usual, whether in functional or test or debug mode. If JAM is enabled (JADI = 1) and we are in test or debug mode, some scan chains (selected by the designer) can be "removed" from the scan chain architecture. To maintain the same number of scan chains, the JTAG selective fail scan chain uses a bypass register. Note that the scan out (s〇, 134 200417216 out) and the 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 5 80, 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. The access control signal JSDAEN controls the access to the CP 14 registration by the Debug TAP 580. 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 phase (b0 a r d s t a g e), 4 errors are enabled and the JSDAEN is set high during the entire system. Once the system has been checked, the 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 J S D A E N. Therefore, the control value can only be accessed by software that is routed through the command memory 5 50. 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 a security context, a control value enable bit needs to be set. 135 200417216 Its superiority & Hao Yi's error detection can only always be initiated by the user in order to be insecure. Therefore, although the user is usually unable to access the security during debugging, in many cases it is not a problem, because the access to the context is old and the board stage is completely complete before it is available Confirming security temperament is therefore foreseeable. In many cases, debugging of security contexts is unnecessary. If necessary, a safety supervision can still initialize the debugging by software written in CP14. The 68th figure shows the control of the debugging initialization. In the figure, a wound of the core 600 " sentence 4τ. Withered ~ storage element 601 (can be a CP 15 login as previously described) yarn in the basin 'Ercun indicates whether the system is safe in a security context The sexual element S ° core 600 also includes a login 602, which includes a mode (eg, user mode) instructing the processor to execute and a login 603 that provides a content identifier to confirm the application or thread currently executing on the core. When a breakpoint is reached, a comparator compares the breakpoint stored in the register 6 1 1 with the core address stored in the register 6 1 2 and sends a signal to the control logic 620. The control logic 620 looks at the security state S, the mode 602, and the execution thread (content identifier) 603 and compares it with the control value and the condition state stored in the login CP14. If the system is not operating in a security context, an "enter debug" signal will be output at 630. However, if the system is operating in a security context, the control logic 620 will look at mode 602, and if it is in user mode, it will check to see if the user mode is enabled and the debug enable bit is set. If they are, then the debug will be initialized, knowing that the thread aware bit has not yet been initialized. The hierarchical nature of control values is described above. 136 200417216 Figure 68 also shows the thread detection part of the monitoring control and how it can only switch from the safety supervision mode (in this embodiment, the processor is in production and JSDAEN is grounded). Control value. It is possible to use an authorization code to enter the security supervision mode from a security user mode 'and then set the control value at C P 1 4. When the address comparator 610 indicates that the breakpoint has been reached, the control logic 62 outputs an "enter debugging" signal and understands that the thread comparator 64 indicates that debugging is allowed for the thread. It is assumed that the thread detection initialization bit is set in Cpi4. If the thread detection initialization bit system sets a breakpoint, if the address and content identification match those indicated in the breakpoint and the allowed thread index, only debug or trace can be entered. After the initialization of a monitoring function ', detection can only be performed within the detection of the comparator 64; when the symbol is an allowed thread, the acquisition of diagnostic data continues. When a content identifier indicates that the executed application is not an allower,% blocks the extraction of diagnostic data. It should be noted that in the best embodiment, there is a certain level of granularity. Actually, the security is wrong. Every time the tracking is enabled, only the tracking enable position is at the top. Next, enable the security user mode, Kaizhi County, Di Yong bit 70, and finally the security thread. Detect enable bit. As shown in Fig. 69A, solidification of the whistle 丄 Bapu and Fig. 69B (see below for details). The control value reserved in "Debugging and State Control (Debug Record (CP14) according to the domain a n d S t a t u s C ο n t r ο 1)" login, mode and thread control security debug granularity. It is on top of the security oversight model. Once the "error detection and status control" registration breakpoints, monitoring points, etc. CP 14 is set, the corresponding design is made by the security supervision mode, so that the core enters the debugging state. 137 200417216 Figure 69A outlines security debugging for intrusive debugging. The default values are shown in gray. The same applies to the granularity of debugging that is not invasive. In this case, the security debugging granularity is also used as the default value. Please note that the security user mode debug enable bit is generally used for both intrusive and non-intrusive. Thread detection initialization bit is stored in the registry to indicate whether the granularity is based on the application needs. If the thread is detected, the control logic will further check the application identifier or the thread indicates the value indicated in the control value of the thread, and if so, then. If any of the user-mode or debug-enabled bits detect that the bit has been set and the application being executed is not indicated in the execution value, the breakpoint and the future core performers will be ignored and debugging will not be performed. initialization. In addition to controlling the initialization of the monitoring function, it is also possible to control the acquisition of diagnostic data during a monitoring function. Purpose, the core must follow the value during the operation of the monitoring function 'that is, the registered bits stored in CP 1 4 and their enable bits. Figure 7 illustrates the granularity of the monitoring function during execution. The area A is related to the allowed capture The area of the diagnostic data regarding the area where the control value is stored in the CP14 means that it is not data. Therefore, when debugging is performed and the interpretation is granular in the area. Figure 69B overview of the reset. Gray indicates reset and security enforcement. The CP14 indicates that the bit has been initialized. Thread 603 is initially debugged and will not be set or executed. Thread detection control will continue to its original form. A similar party will continue to consider the two control 6 related conditions in order to achieve the above. . In this case, the phase B of the area ’area may be intercepted and diagnosed during operation A. The diagnostic data is output in a stepwise manner during the debugging process. When the operation is converted to area B, it is a place where diagnostic data is not allowed to be retrieved, and debugging is performed step by step, otherwise it is performed automatically without any data being retrieved. This continues until the operation of the program enters area A again, so that the interception of the diagnostic data is started again and the debugging continues to be performed step by step. In the above embodiment, 'if the security domain is not enabled, an SMI means

令總是被視為一基本事件(atomic event)而阻止診斷資料 的擷取。 此外’如果已設置執行緒偵知初始化位元,則就應用 而論,亦出現操作期間的監控功能的粒度。The order is always regarded as an atomic event and prevents the acquisition of diagnostic data. In addition, if the thread-aware initialization bit is set, the granularity of the monitoring function during operation also appears in terms of application.

就非侵入式偵錯或追蹤而論,其係由ETM所達成且完 全與偵錯無關。當啟用追蹤,ETM像往常一般作用,而當 其失效時’ ETM依據選擇的粒度在安全性情境或部分安全 性情境隱藏追蹤。避免在未啟用時ETM在安全性網域中擷 取和追蹤診斷資料之一種方法係在s位元為高時使ETM減 速。可由使該S位元與ETMPWRDOWN信號結合以達成, 因此當核心進入安全性情境時,保留ETM的最後值。因此 ETM應該追蹤一 SMI指令而後減速直到核心回到非安全性 費 情境。因此,ETM將只監督非安全性活動。 一些不同的監控功能和它們的粒度將摘要如下。 機板一階教(board stage)的侵入式偵錯 當JSDAEN PIN未接地時之機板階段,在任何開始時 段前有可能在任何地方初始偵錯。同樣地,如果吾人在安 139 200417216 全性監督模式中,吾人有類似權限。 :偵 塊) 〇 夠 錯 入 充 甚 安 止 的 制 狀 如果〇人在停機伯錯模式(hah debug mode)初始々 錯’所有登錄都是可存取的(非安全性和安全性登錄區 以及除了專屬於控制的位元以外,能夠傾印整個記憶體 能夠從任何模式和任何網域進入偵錯停機模式。能 在安全性或在非安全性記憶體設置斷點和監視點。在偵 狀態中’可以藉由利用一 MCr指令僅改變s位元以進 安全性情境。 在當安全性異常發生時能夠進入偵錯模式,用以擴 向量捕捉登錄(vector trap register)之新位元如下; SMI向量捕捉啟用; 安全性資料中止向量捕捉啟用; 安全性預取中止向量捕捉啟用;和 安全性未定義向量捕捉啟用。 在監控偵錯模式,如果吾人允許在任何地方偵錯, 至在非安全性情境呼叫一 SMI時,可能以逐步偵錯進入 全性情境。當一斷點在安全性網域中發生時,安全性中 管理器可操作以傾印安全性登錄區塊和安全性記憶體。 在安全性和在非安全性情境的兩中止管理器將它們 資訊給予偵錯器應用,以们貞錯器視窗(在相關的價錯控 PC上)在安全性和非安全性情境二者中都可顯示登= 200417216 第71A圖顯示當在監控偵錯模式中設定 、 x心時和彳貞錯 在安全性情境中啟用時所發生者。第7丨B圖題- 、 Μ .,、、貞不在監控偵 錯模式中設定核心時和偵錯在安全性情境中 、 ιτ用時所發生 者。之後之程序將詳述如下。 在生產J皆段的_侵入式偵錯 在生產階段中,當JSDAEN有接地和偵錯限制為非安 全性情境,除非安全性監督有其他的決定, 〜〜在第71B圖 顯示所發生者。在這種情況下,應該總是把smi視為一其 本指令(atomic inStruction),因此在進入偵錯狀態::^ 是先完成安全性功能。 ^ 進以偵錯停機模式有下列限制. 僅在非女全性情境中考慮外部彳貞錯請求 求❶如果在安全性情境中已宣告EDBGRQ(外 External Debug Request),一 旦安全性功倉t 入偵錯停機模式,而核心回到非安全性情境中 或内部偵錯請 部偵錯請求, 終止則核心進 在安全性記憶體為斷點或監視點 及當程式設計位址符合時核心不停止 設計不會產生影響以 向量捕捉登錄(Vector Trap Registei: 及非安全性異常。如前所述所有擴充捕捉 生影響。 詳見下文)僅涉 啟用位元不會產 一旦在停機偵錯模式中,則庙田 T ⑷應用下列限制: 不能改變S位元以強制進入 女金f生If境,除非啟用女 全性偵錯。 141 200417216 如果僅在安全性監督模式中允許偵錯不能夠改變模式 位元。 不能改變控制安全性偵錯的專屬位元。 如果一 SMI被載入和執行(以系統速度存取),僅在當 完全執行安全性功能時,核心再次進入偵錯狀態。For non-intrusive debugging or tracing, it is achieved by the ETM and has nothing to do with debugging. When tracing is enabled, ETM functions as usual, and when it fails ’ETM hides tracing in a security context or part of a security context based on the granularity chosen. One way to avoid ETM retrieving and tracking diagnostic data in the security domain when not enabled is to slow down the ETM when the s bit is high. This can be achieved by combining the S bit with the ETMPWRDOWN signal, so when the core enters the security context, the final value of the ETM is retained. Therefore, the ETM should track an SMI instruction and then decelerate until the core returns to the non-security cost situation. Therefore, ETM will only monitor non-safety activities. Some of the different monitoring functions and their granularity are summarized below. Intrusive Debugging of the Board Stage The board stage when the JSDAEN PIN is not grounded, it is possible to initially debug anywhere before any start period. Similarly, if I am in the full supervision mode of An 139 200417216, I have similar authority. : Detection block) 〇 Wrong enough to enter a very secure state. 〇 If the person makes an initial error in hah debug mode, all logins are accessible (non-secure and secure login areas and In addition to the bits dedicated to control, the entire memory can be dumped from any mode and any domain into the debug shutdown mode. Breakpoints and watchpoints can be set in secure or non-secure memory. In the detection state "You can use only one MCr instruction to change the s bit to enter the security context. When a security exception occurs, you can enter the debug mode. 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 vector capture is enabled; and security undefined vector capture is enabled. In monitoring debug mode, if we allow debugging anywhere, to non-secure When a sexual situation calls an SMI, it may enter the whole sexual situation with step-by-step debugging. When a breakpoint occurs in the security domain, the security manager can operate Register the block and secure memory with dumped security. The abort manager in security and in non-secure contexts gives their information to the debugger application, and the debugger window (in the relevant price error control) On PC) can be displayed in both security and non-security scenarios. 200417216 Figure 71A shows what happens when the settings are set in the monitoring debug mode, when x-heart, and when 彳 zheng error is enabled in the security scenario. Figure 7 丨 B--, Μ ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-,,,,,,,,-,,,,,,,-,,,,,,-,,,,,-,,,,,,,,, In the security situation, when the debug is used, the following procedures will be described in detail below. J Jie Duan's _Intrusive Debugging In the production stage, when JSDAEN has grounding and debugging restrictions as a non-safety situation, unless the safety supervision has other decisions, ~~ Figure 71B shows what happened. Here In this case, the smi should always be considered as an atomic inStruction, so when entering the debugging state: ^ is to complete the security function first. ^ The following restrictions apply to the debugging stop mode. Only in non- Consider outside in a female holistic situation Request for chastity request If EDBGRQ (External External Debug Request) has been declared in the security situation, once the security power t enters the debugging stop mode, and the core returns to the non-security situation or internal debugging, please ask the department to debug If the request is terminated, the kernel enters the security memory as a breakpoint or watchpoint and when the programming address matches, the kernel does not stop the design and will not affect the vector trap registration (Vector Trap Registei: and non-security exceptions. As before) All the expansions described above capture the impact of health. See below for details) Only the enabled bit will not be produced. Once in the shutdown debugging mode, Miaotian T ⑷ applies the following restrictions: The S bit cannot be changed to force entry into the female gold team. Environment, unless female holistic debugging is enabled. 141 200417216 The mode bits cannot be changed if debugging is allowed only in the security 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.

在監控偵錯模式中因為不能在安全性情境中發生監 控,安全性中止管理器不需要支援偵錯監控程式。在非安 全性情境中,逐步步驟是可能的,但是只要一 SMI執行, 則完全執行安全性功能,換言之,當「步驟開始(step-in)」 和「步驟結束(step-over)」在所有其它指令都可能時,一 XWSI只允許「步驟結束(step-over)」。因此XWSI被視為 一基本指令(atomic instruction)。 使一旦安全性偵錯失效,吾人有下列限制: 在進入監控模式之前: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 scenarios, step-by-step steps are possible, but as long as one SMI is performed, the security function is fully performed, in other words, when "step-in" and "step-over" are in all When other instructions are possible, an XWSI only allows "step-over". XWSI is therefore considered an atomic instruction. Once security debugging is disabled, we have the following restrictions: Before entering monitoring mode:

在非安全性情境中只考慮斷點和監視點。如果已設置 位兀S,略過斷點/監視點。請注意,監視點單元以 MCR/MRC(CP14)存取,這將不造成安全性問題,因為斷點 /監視點對安全性記憶體不會有影響。 通常用BKPT來代替斷點所設定之指♦。假定在記憶 體中覆寫上述指令係依據BKPT指令,其僅在非安全性: 式中有可能。 ' 向量捕捉登錄僅涉及非安全性異常。如前所述所有擴 充捕捉啟用位元不會產生料。資料中止和預取中止啟用 位元應該失效以避免強迫處理器進入一不可恢復狀態。 142 200417216 s位 於安 模式 錯狀 它回 心地 入一 總之 模式 何人 的安 式碼 保持 錯, 在安全性情境中,終 到非安全性情境時 由 J T A G,不.-a /·*· ° 士停機模式有相同的限制(不能 元、等等)。 > 叹 一 ^在監控模式(非安全性中止模式) 非女全^中止官理器能夠傾印非安全性情境和不可見 全〖生區塊登錄及安全性記憶體。 以基本SMI指令執行安全性功能 :旎改變S位元以強制進入安全性情境。 果’、在女全性監督模式中不允許偵錯,不能夠改變 位 7F.。 月意’如果外部偵錯請求(EDBGRQ)發生, 在非安全性愔土也士 a 兄中,核心終止現有指令並立即進入福 態(在停機模式中)。 ’終止現有功能並進入偵錯狀態,當 # 〇 新的偵錯需灰/ 在核心硬體中意味著一些修正。必須+主 控制s位亓,、 、不月 U及基於安全性,該安全性位元不能插 掃描鏈中。 烟 ’在偵錯中,保丄 僅在安全性監督模式中啟用偵錯時改變 位。如丨卜物 G將防止能夠在安全性網域中存取偵錯的任 月匕夠輪由改徵$ 又殳系統(修改TBL項目、等等)以存取所有 全性情境。拎搞 乂種方法中,每一執行緒能夠對自己的程 也只能對自p ^ 匕的程式碼進行偵錯。必須使安全性核心 其安全性。 u此在非安全性情境中執行核心時進入偵 、月b夠如别所述般改變模式位元。 143 200417216 本技術的實施例使用一新的向量捕捉登錄 trap register)。如果在該登錄中的位元之一設定為 應的向量觸發,處理器進入偵錯狀態如同一斷點已 於自相關的異常向量取回的一指令。該些位元的行 依在偵錯控制登錄中的「在安全性情境啟用中 (Debug in Secure world Enable)」之位元值而不同。 該新的向量捕捉登錄包括下列位元: D — s — abort、P一s abort、S—undef、SMI、FIQ、 Unaligned、D —abort、P一abort、SWI 和 Undef o D一s一abort位元:只能在當在安全性情境中啟 時以及當在停機偵錯模式中設定偵錯時設置。在監 模式中,該位元絕不設置。如果在安全性情境中的 效,無論該位元之值為何不會有任何影響。 P — s一abort位元:與D — s — ab〇rt位元相同。 S-Undef位疋··僅能在當在安全性情境中啟用 。又置如果在安全性情境中偵錯失效,無論該位元 何不會有任何影響。 SMI位元·僅能在當在安全性情境中啟用偵 置如果在安全性情境中偵錯失效,無論該位元之 不會有任何影響。 FIQ 、D — abort、P —abort、SWI、undef 位 非 丨生異吊對應’所以即使在安全性情境中偵錯 匕們仍然有效,請注意D一abort和P一abort不應該 模式中宣告高。 (vector 兩和對 經設置 為可能 的彳貞錯 IRQ、 用偵錯 控偵錯 偵錯失 偵錯時 之值為 錯時設 值為何 元:與 失效, 在監控 144 200417216Only consider breakpoints and watchpoints in non-security situations. If bit S is set, skip breakpoints / watchpoints. 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 breakpoint. It is assumed that the overwriting of the above instructions in memory is based on the BKPT instruction, which is only possible in the non-safety: formula. 'Vector capture login involves only non-security exceptions. As mentioned earlier, all extended capture enable bits do not generate material. The data abort and prefetch abort enable bits should be disabled to avoid forcing the processor into an unrecoverable state. 142 200417216 s is in the wrong mode. It goes back to a mode. Anyone's code is kept wrong. In the security situation, when the non-safety situation is reached by JTAG, no. -A / · * · ° taxi down Models have the same restrictions (no meta, etc.). > Sigh ^ In the monitoring mode (non-security abort mode) Non-female full ^ The abort server can dump non-secure contexts and invisible full block registration and security memory. Perform security functions with basic SMI instructions: 旎 Change the S bit to force entry into the security context. If you ’re not allowed to debug in the women ’s overall supervision mode, you cannot change bit 7F. “Yueyi” If an external debug request (EDBGRQ) occurs, in the non-safety Tuya Shia brother, the core terminates the existing instructions and immediately enters the blessed state (in the shutdown mode). ’Terminate existing features and enter debug status, when # 〇 new debug needs to be grayed out / means some fix in core hardware. Must be + master control s bits,,,, and U, and based on security, this security bit cannot be inserted into the scan chain. Smoke ′ In debugging, the security bit is changed only when debugging is enabled in the security supervision mode. For example, G will prevent any task that can access the debug in the security domain to change the system (modify the TBL item, etc.) to access all global situations. In this method, each thread can debug its own program and can only debug its own code. Security must be at the core of its security. u This enters the detection when the core is executed in a non-safety situation, and the month b is enough to change the mode bit as described above. 143 200417216 An embodiment of the present technology uses a new vector capture register (trap 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, and Undef o D — s — abort bits Meta: Can only be set when booting in security context and when debugging is set in shutdown debugging mode. In monitoring mode, this bit is never set. If 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 is only enabled in the context of security. It is also assumed that if debugging fails in a security context, this bit will have no effect whatsoever. The SMI bit can only be used when security detection is enabled in the security context. If debugging fails in the security context, this bit has no effect. FIQ, D—abort, P—abort, SWI, and undef are different. So even when debugging in a security situation, daggers are still valid. Please note that D_abort and P_abort should not be declared high in the mode. . (Vector two-way pair is set to the possible erroneous error IRQ, use debug control to debug, debug error, debug error value is set when the error value is Yuan: and invalid, in monitoring 144 200417216

Reset位元:當重設發生時,吾人進入安全性情境, 僅當在安全性情境中啟用偵錯時該位元有效,否則其不會 產生影響。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.

雖然本文中已經描述了本發明的一特定實施例,但是 明顯地本發明並未侷限於上述内容,亦可能在本發明的範 _中進行許多修正和增加。例如,在不悖離本發明之範轉 情況下,能夠以申請專利範圍之獨立項進行下列附屬項特 徵的各種結合。 【圖式簡單說明】 本發明將進一步參照以附圖圖示之僅為例示的較佳實 施例解說,其中: 第1圖係一方塊圖,依據本發明之較佳實施例圖示一 資料處理設備; 第2圖圖示在一非安全性網域和一安全性網域操作之 不同程式; 第3圖圖示相關於不同安全模式之處理模式之一矩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 in the scope of the present invention. For example, without departing from the scope of the present invention, various combinations of the following subsidiary features can be performed as 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 secure domain; Figure 3 illustrates a moment of processing modes related to different security modes

陣; 第4和5圖圖示在處理模式和安全網或間不同的關係; 第6圖圖示一程式設計師的模組,與處理模式相關之 一處理器的登錄區塊; 第7圖圖示一示例,為一安全性網域和一非安全性網 域提供個別的登錄區塊; 第8圖圖示多種處理模式,在安全性網域之間藉由一 145 200417216 個別的監控模式所進行之轉換; 第9圖之示圖,使用一模式轉換軟體中斷指令之安全 性網域之轉換; 第1 0圖圖示一示例,系統如何處理非安全性中斷請求 和安全性中斷請求; 第11A和11B圖依據第10圖,圖示一非安全性中斷 請求處理之示例,和一安全性中斷請求處理之示例; 第1 2圖圖示一可選擇性的機制,比較第1 0圖所圖示 者,用以控制非安全性中斷請求信號和安全性中斷請求信 號; 第1 3 A和1 3 B之示例性示圖,依據第1 2圖用以處理 一非安全性中斷請求和一安全性中斷請求; 第1 4圖係一向量中斷表之示例; 第15圖圖示與不同安全網域相關之多數向量中斷表; 第16圖圖示一異常控制登錄; 第1 7圖係一流程圖,圖示意圖以一種警告安全性網域 設定之方法改變一處理狀態登錄之一指令如何產生一各自 的模式轉換異常,其依序觸發進入監控式和執行監控模視; 第 1 8圖圖示以多種模式操作之一處理器控制之一執 行緒,其中在監控模式中之一任務係中斷的; 第 1 9圖圖示以多種模式操作之一處理器控制之一不 同的執行緒; 第20圖圖示以多種模式操作之一處理器控制之一進 一步的執行緒,其中中斷係啟用於監控模式; 146 200417216 第2 1圖至2 3圖依據另一示例性實施例圖示不同的處 理模式和過程,用以在安全性和非安全性網域間轉換; 第24圖圖示增加一安全性處理選擇至一習知ARM核 心之觀念; 第 2 5圖圖示具有安全性和非安全性網域及重設之一 處理器; 第 26圖圖示使用一軟體偽造之中斷傳遞處理請求至 一虛懸之作業系統; 第27圖圖示另一示例,使用一軟體偽造之中斷傳遞處 理請求至一虛懸之作業系統; 第2 8圖係一流程圖,圖示接收到在第2 6和2 7圖所產 生型態之一軟體偽造中斷時,所執行之處理; 第29和30圖圖示在一安全性作業系統之後所進行之 任務,用以追蹤由一非安全性作業系統所進行之可能的任 務轉換; 第3 1圖係一流程圖,圖示在第29和3 0圖之安全性作 業系統中接收到呼叫時,所執行之處理; 第 3 2圖圖示可能在具有多數作業系統之一系統中發 生之中斷優先權反向的問題,其中不同的中斷可以由不同 的作業系統所控制; 第33圖圖示使用存根中斷管理器以避免第32圖所示 之問題;和 第 34圖圖示不論是否它們可以被一作業系統所服務 之中斷所中斷,以何為依據控制不同型態和優先權的中斷 147 200417216 第3 5圖圖示監控模式專屬的處理器設定資料如何優 先於處理器設定資料,當該處理器係在監控模式下操作時; 第3 6圖之一流程圖依據本發明之一實施例,圖示當在 安全性網域和非安全性網域間轉換時,處理器設定資料如 何轉換; 第3 7圖圖示在本發明之一實施例所用以控制對記憶 體的存取的記憶體管理邏輯; 第38圖係一方塊圖,圖示在本發明之一第二實施例所 用以控制對記憶體的存取的記憶體管理邏輯; 第3 9圖係一流程圖,圖示在本發明之實施例所執行之 過程’在記憶體管理邏輯中用以處理專屬於一虛擬位址的 一記憶體存取請求; 第40圖係一流程圖,圖示在本發明之實施例所執行之 過程,在記憶體管理邏輯中用以處理專屬於一虛擬位址的 一實體存取請求; 第41圖圖示本發明之較佳實施例之分割檢測器如何 操作以防止存取安全性記憶體中之一實體位址,當發出該 記憶體存取請求的裝置係操作於一非安全性模式; 第42圖圖示在本發明之一較佳實施例中,一非安全性 分頁表和一安全性分頁表之使用; 第43圖圖示較佳實施例之主要轉譯參考緩衝(tlb, translation lookaside buffer)中使用之兩種型式之旗標; 第44圖圖示本發明之一實施例中,在開機程序之後, 記憶體如何被分割; 148 200417216 第45圖圖示依據本發明之一實施例,在開機分割執行 之後,由記憶體管理單元(MMU)所映射之非安全性記憶體; 第46圖圖示依據本發明之一實施例,如何警告右列部 分之記憶體,以允許一安全性應用與一非安全性應用共用 記憶體; 第47圖圖示依據本發明之一實施例,裝置如何被連接 至資料處理設備之外部匯流排; 第4 8圖係一方塊圖,圖示依據本發明之第二實施例, 裝置如何被連接至外部匯流排; 第 49圖圖示使用一單一組分頁表之實施例的實體記 憶體之安排; 第 50A圖圖示一安排,其中經由一中介位址使用兩 MMUs以執行虛擬至實體位址的轉譯; 第5 0B圖圖示一選擇性安排,其中經由一中介位址使 用兩MMUs以執行虛擬至實體位址的轉譯; 第5 1圖僅為示例,圖示對於安全性網域和非安全性網 域,在實體位址空間和中介位址空間之間的對應; 第52圖圖示經由相關於第二MMU之分頁表之控制在 安全性和非安全性網域之間的記憶體區域的調換(swap); 第5 3圖之實施例圖示使用一單一 MMU之實施,及其 中在主要TLB的不符者導致請求一異常以決定虛擬至實 體的位址轉譯; 第5 4圖係一流程圖,圖示由處理器核心所執行之程 序,用以在第53圖之MMU的主要TLB不符的同時,對所Figures 4 and 5 show different relationships between the processing mode and the safety net; Figure 6 shows a programmer's module, one of the processor's registration blocks related to the processing mode; Figure 7 Figure 1 shows an example, providing separate login blocks for a secure domain and a non-secure domain; Figure 8 illustrates multiple processing modes, with a single monitoring mode between the security domains by 145 200417216 Conversions performed; Figure 9 is a diagram of a security domain conversion using a mode switch software interrupt instruction; Figure 10 is an example of how the system handles non-security interrupt requests and security interrupt requests; 11A and 11B illustrate an example of a non-security interrupt request processing and an example of a security interrupt request processing according to FIG. 10; FIG. 12 illustrates an alternative mechanism, comparing FIG. 10 The figure is used to control the non-security interrupt request signal and the security interrupt request signal; the exemplary diagrams of FIGS. 13A and 13B are used to process a non-security interrupt request and A security interrupt request; An example of a vector interrupt table; Figure 15 shows a majority vector interrupt table related to different security domains; Figure 16 shows an abnormal control login; Figure 17 is a flowchart, the diagram is a warning The method of setting a sexual domain changes how a processing status and an instruction generate a respective mode conversion exception, which sequentially triggers entering a monitoring mode and executing a monitoring mode; FIG. 18 shows a processor operating in multiple modes. Control one thread, where a task is interrupted in the monitoring mode; Figure 19 illustrates one of the threads controlled by a processor operating in multiple modes; Figure 20 illustrates one of the threads operating in multiple modes A processor controls one of the further threads, wherein the interrupt is enabled in the monitor mode; 146 200417216 Figures 21 to 23 illustrate different processing modes and processes according to another exemplary embodiment, and are used for security And non-secure domains; Figure 24 illustrates the concept of adding a security processing option to a familiar ARM core; Figures 25 illustrate the domains with security and non-security and Reset a processor; Figure 26 illustrates the use of a software counterfeit interrupt to pass a processing request to a virtual operating system; Figure 27 illustrates another example that uses a software counterfeit interrupt to pass a processing request to a virtual suspension Operating system; Figure 28 is a flowchart showing the processing performed when a software forgery interrupt is received in one of the patterns generated in Figures 26 and 27; Figures 29 and 30 illustrate a security Tasks performed after the sexual operating system are used to track possible task transitions performed by a non-safety operating system; Figure 31 is a flowchart illustrating the secure operating system in Figures 29 and 30 The processing performed when a call is received in Figure 3; Figure 32 shows the problem of reverse priority of interrupts that may occur in one of the systems with most operating systems, 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 the basis for controlling whether or not they can be interrupted by an interrupt serviced by an operating system Type and Priority Interrupts 147 200417216 Figures 3 and 5 show how the processor-specific setting data exclusive to the monitoring mode takes precedence over the processor-setting data when the processor is operating in the monitoring mode; Figure 1 shows a flow FIG. 7 illustrates how the processor setting data is converted when switching between a secure network domain and a non-secure network domain. FIG. 37 illustrates the control used in one embodiment of the present invention. Memory management logic for accessing the memory; FIG. 38 is a block diagram illustrating the memory management logic for controlling access to the memory in a second embodiment of the present invention; FIG. 39 FIG. 40 is a flowchart illustrating a process performed in an embodiment of the present invention, which is used in the memory management logic to process a memory access request dedicated to a virtual address; FIG. 40 is a flowchart illustrating The process shown in the embodiment of the present invention is used in the memory management logic to process an entity access request dedicated to a virtual address; FIG. 41 illustrates a partition detector of the preferred embodiment of the present invention. How to fuck In order to prevent access to a physical address in the secure memory, when the device issuing the memory access request is operated in a non-secure mode; FIG. 42 illustrates a preferred embodiment of the present invention. The use of a non-security paging table and a security paging table; Figure 43 illustrates the two types of flags used in the main translation reference buffer (tlb, translation lookaside buffer) of the preferred embodiment; Figure 44 148 200417216 FIG. 45 illustrates an embodiment of the present invention, which is performed by a memory management unit (MMU) after a boot partition is performed according to an embodiment of the present invention. Mapped non-secure memory; Figure 46 illustrates how to warn the memory in the right column to allow a security application to share memory with a non-security application according to an embodiment of the present invention; Figure 47 Shows how the device is connected to an external bus of a data processing device according to an embodiment of the invention; Figures 4 to 8 are block diagrams showing how the device is connected according to a second embodiment of the invention Connect to external bus; Figure 49 illustrates the physical memory arrangement of an embodiment using a single component page table; Figure 50A illustrates an arrangement in which two MMUs are used via an intermediary address to perform virtual to physical bits Figure 50B illustrates an optional arrangement in which two MMUs are used to perform a virtual-to-physical address translation via an intermediary address; Figure 51 is only an example, illustrating the security domain and Non-secure domains, the correspondence between the physical address space and the intermediate address space; Figure 52 illustrates the memory between the secure and non-secure domains via the paging table related to the second MMU Swap of the body region; the embodiment of Figure 53 illustrates the implementation using a single MMU, and the non-compliance with the main TLB causes an exception to be requested to determine the virtual-to-physical address translation; Figure 5 4 A flow chart showing the program executed by the processor core to verify that the main TLB of the MMU in Figure 53 does not match.

149 200417216 發出之異常採取行動; 第5 5圖係一方塊圖,圖示一實施例中一資料處理讯備 中所提供之元件,其中對快取提供資訊,以決定儲存在個 別的快取線上的資料是安全性資料或非安全性資料; 第5 6圖圖示如第5 5圖所示之記憶體管理單元之、纟士構· 第5 7圖係一流程圖圖示第5 5圖所示之資料處理設備 中所執行的處理’以處理一非安全性記憶體存取請求· 第58圖係一流程圖圖示第55圖所示之資料處理設備 中所執行的處理,以處理一安全性記憶體存取請求; 第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); 150 200417216 第68圖圖示因子(factor)控制偵錯或追蹤的初始化; 第69 A和69B圖圖示偵錯粒度之摘要; 第70圖圖示執行時之偵錯粒度;及 第71A和71B圖圖示在安全情境中啟用偵錯且當其並 非個別啟用之監控偵錯。 【元件代表符號簡單說明】 10 核心 12 掃描鍵 14 登錄區塊149 200417216 Take action on exceptions; Figure 5 5 is a block diagram showing components provided in a data processing message 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; Figure 5 6 shows the memory management unit shown in Figure 5 5; The processing performed in the data processing device shown below is 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 Security memory access request; Figure 59 illustrates the possible granularity of the monitoring function for different modes and applications executed on a processor; Figure 60 illustrates the possible methods of initial different monitoring functions; Figure 61 shows a control value table to control the different monitoring functions that can be used; Figure 62 shows a positive-edge triggered flip-flop; Figure 63 shows a scan string 1. key unit ); Figure 64 shows most scanning chain units in a scanning chain; Figure 65 shows a debugging TAP controller; Figure 66A shows a debugging TAP controller with JADI; Figure 66B FIG. 67 illustrates a scanning chain unit having a bypass register. FIG. 67 illustrates a processor including a core, a scanning chain, and a debug status and control register. 150 200417216 Figure 68 shows the factor (factor) to control the initialization of debugging or tracking; 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 Illustration of monitoring debugging that is enabled in a security context and when it is not individually enabled. [Simple description of component representative symbols] 10 core 12 scan key 14 login block

16 ALU 18 JTAG控制器16 ALU 18 JTAG controller

20 ICE20 ICE

2 1 VIC2 1 VIC

22 ETM 2 4 登錄 26 控制登錄 30 記憶體管理邏輯 34 控制登錄22 ETM 2 4 login 26 control login 30 memory management logic 34 control login

36 TCM 38 快取 40 系統匯流排36 TCM 38 Cache 40 System Bus

42 EBI42 EBI

44 開機ROM 46 螢幕44 Boot ROM 46 Screen

48 登錄或緩衝器 50 DSP 5 2 DMA 54 判優器/解碼器邏輯 5 6 外部記憶體 58 分頁表 60 輸入/輸出界面 62 登錄或緩衝器 64 金鑰儲存單元 66 登錄或緩衝器 70 外部匯流排 72 監控程式 151 200417216 74 非安全性作業系統 7 6 非安全性應用1 7 8 非安全性應用248 Register or buffer 50 DSP 5 2 DMA 54 Arbiter / decoder logic 5 6 External memory 58 Paging table 60 Input / output interface 62 Register or buffer 64 Key storage unit 66 Register or buffer 70 External bus 72 Monitoring program 151 200417216 74 Non-safety operating system 7 6 Non-safety application 1 7 8 Non-safety application 2

8 0 安全性核心 82 安全性應用1 84 安全性應用2 86 監控模式 200 MMU 202 存取許可邏輯 204 區域屬性邏輯 206 micro-TLB 208 主要TLB 210轉譯表行走邏輯 220 MPU 222 分割檢測器 224 存取許可邏輯 226 區域屬性邏輯 230 路徑(中止) 2 3 2 路徑(可快取,可緩衝) 234 路徑(虛擬位址) 236 路徑(實體位址) 2 3 8 路徑 240 路徑 242 路徑 244 路徑 246 路徑(描述符) 2 4 8 路徑 3 0 0 程式產生虛擬位址 302 查詢安全性描述符micro-TLB 3 04 查詢安全性描述符主要TLB 3〇6 分頁表行走 3 08 主要TLB包含有效附加的安全性描述符 3 10在micro-TLB載入含有實體位址部分的相關描述符 的子部分 3 12 檢查存取允許(私有/使用者…) 314 違反? 316 存取允許錯誤中止 3 1 8存取記憶體 320 查詢非安全性描述符micro-TLB 3 22 查詢非安全性描述符主要TLB 324 分頁表行走 152 2004172168 0 Security core 82 Security application 1 84 Security application 2 86 Monitoring mode 200 MMU 202 access permission logic 204 area attribute logic 206 micro-TLB 208 main TLB 210 translation table walking logic 220 MPU 222 segmentation detector 224 access Permission logic 226 Area attribute logic 230 Path (Aborted) 2 3 2 Path (cacheable, bufferable) 234 Path (virtual address) 236 Path (physical address) 2 3 8 Path 240 Path 242 Path 244 Path 246 Path ( Descriptor) 2 4 8 path 3 0 0 program generated virtual address 302 query security descriptor micro-TLB 3 04 query security descriptor main TLB 3 06 paging table walk 3 08 main TLB contains valid additional security description The subscript 3 10 loads the sub-part of the relevant descriptor containing the physical address part in the micro-TLB. 3 12 Check the access permission (private / user ...) 314 Violation? 316 Access allowed error aborted 3 1 8 Access to memory 320 Query non-security descriptor micro-TLB 3 22 Query non-security descriptor main TLB 324 Paging table walk 152 200417216

2e3024365054587274789097052f3i4i=tGG 、〜s 主要TLB包含有效附加的非安全性 贫割檢測器檢查是否非安全性實體j址if 的 〜非女全性 違反 安全性/非安全性錯誤中止 在micro-TLB载入含有眘 的子部分 口P刀的相關描述符 檢查存取允許(私有/使用者…、 違反? 核心產生實體位址 查許可,及是否非安全性實體位 性記憶體 3 違反? 存取允許錯誤中止 在安全性,Ϊ安全性記憶體的存取 非安全性區域 非安全性區域 非安全性區域 安全性區域 安全性區域 安全性區域 非安全性記憶體 非安全性分頁表 基礎位址 安全性記憶體 安全性分頁表 安全性分頁表基礎位址 網域旗標 程序ID旗標 描述符 描述符 描述符 項目 非安全性應用的記憶 記憶體 〜 記憶體 安全性分頁 裝置 裝置 外部記憶體 判優器 153 200417216 478 480 482 484 486 488 490 492 500 501 502 503 512 514 516 520 522 524 530 541 544 550 570 580 600 601 602 603 610 611 612 620 630 2000 2010 2015 2020 2030 2040 2050 碼幕錄入錄號徑割控隔隔隔用用用督用用E描描令心錯心存錄錄址錄錄制 解螢登輸登信路分監分分分應應應監應應1C掃掃指核偵核儲登登位登登控 器面器 口^61 相福 口夕口 緩出緩徑 測式 器 或輸或路 檢模線線線 式 模 體 憶 鏈鏈記2e3024365054587274789097052f3i4i = tGG, ~ s The main TLB contains a valid additional non-safety poor cut detector to check if the non-safety entity j address if ~ non-female sex violation of safety / non-safety error abortion contained in the micro-TLB load contains The sub-portion of the sub-portion of the sub-portion carefully checks the access permission (private / user ..., violation? The kernel generates a physical address check permission, and is the non-secure physical bit memory 3 violated? The access permission is aborted incorrectly. Access to security, security memory, 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 Security Paging Table Base Address Domain Flag Program ID Flag Descriptor Descriptor Descriptor Item Memory Memory for Non-Security Applications ~ Memory Security Paging Device Device External Memory Arbiter 153 200417216 478 480 482 484 486 488 490 492 500 501 502 503 512 514 516 520 522 524 530 541 544 550 570 580 600 601 602 603 610 611 612 620 630 2000 2010 2015 2020 2030 2040 2050 Code screen entry number, path control, isolation, use for supervisor, use E-tracing, make mistakes, save, record, record, record, log out Dengxin Road sub-supervisor sub-should be sub-should be sub-should be sub-should be sub-should be sub-scored 1C sweeping finger scan nuclear inspection nuclear storage ascend the boarding control board surface ^ 61 Xiangfukou Xikou slow out slow-measuring device or road Inspecting line line line type phantom memory chain chain

P A T 件 元 器 較 比 輯 邏 料 資 定 設 器 Qul 51 處 屬 專器 式換 模轉 徑控工徑 路監多路 ίι 處 專 式 模 控 監 用 使 /IV 式 程 控 ?監 出入 發進 體 憶 記 之 態 狀 域 態網 狀點 存終 儲有 域含 網向 的指 令為 指標 已式料ΜΙ指 令模資S態 指控定出狀 154 200417216 2 060載入終點網域之狀態 2070離開監控程式。離開監控模式並轉換至終點網域之 模式 2100實體位址空間 2 11 0非安全性記憶體 2120安全性記憶體PAT device comparison device Qul 51 is a special tool for die change, diameter control, work path, and road monitoring. There are many special die control and monitoring tools / IV program control? The state of the memory state, the state of the state, the point of the network, the storage of the command with the direction of the network, the index has been formulated, the command of the model, the state of the S, the charge of the state of the state, the state of the state, the state of the load, the state of the loading domain, the state of 2070, and the exit of the monitor . 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路徑 2 1 9 4路徑2180 Main TLB 2185 Translation table Walking logic 2190 Data bus 2192 Path 2 1 9 4 Path

2170 MMU 22〇〇實體位址空間 2210安全性區域 2220非安全性記憶體 2230安全性區域 2240非安全性記憶體 2250分頁表 2265中間位址空間 2270中間位址空間 2 2 7 5非安全性中間位址空間 2300記憶體的一區域 2 3 0 5中間位址空間中的區域 2310區域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 2 2 7 5 non-security intermediate Address space 2300 A region of memory 2 3 0 5 Region in middle address space 2310 Region

2400 MMU2400 MMU

2410 micro-TLB2410 micro-TLB

2420 主要 TLB 2 4 2 2路徑 2430路徑 2440路徑 2450路徑 2500偵測到一 TLB不符者異常? 155 200417216 設錯關第以尋體符描址< 預的相替符找實述二位42( 一常之以述以定描第體2 以異表表描表給二和實LB回 排排 常致一二一二址第一至T返 流流 異導第第第第位該第址要常線線 匯匯 該取在取得考間回合位主異取數標址制 為獲替預取參中取結擬在自快多旗位控 οοοοοο ο ο 0 5 0 0 2 0 0 1 2 3 4 5 6 7 8 9 9 0 1 1 2 3 5 5 5 5 5 5 55 5 5 6 6 6 6 6 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 的 址虛 址址 位定 位位 體給 址 間擬實以 位址中虛 的符 間位的誤 址述 式 中體址錯 位描 模 定實位替 擬的 控 決取擬以 虛新 監址符獲虛符 誤生 入位述符誤述錯產 進擬描述錯描 得以 量虛I插到二址獲符譯 向誤第I得第位以述轉 符 述 描 的 新 該 存 儲 中 籤 標 效 有 該 有 含 B L 排 器程Γ0-性走T 流輯 測性lcr全 行要 匯邏器器檢全m安詢表主符 徑徑徑料制優碼割安詢非查頁定述 路路路資控判解分非查在一分決描 24600246050 50 33345555001 12 66666666777 77 22222222222 22 B L T 要 主 的 中 其 於 存 儲 符 產B述 式TL描 址 位 擬 虛 生 行 執 性 全 安 非 的2420 Main TLB 2 4 2 2 path 2430 path 2440 path 2450 path 2500 detected a TLB non-compliance abnormal? 155 200417216 Set the wrong position to find the body description < the pre-alternative sign to find the actual description of the two places 42 (often used to describe the description of the first body 2 used a different table to describe the table to Erhe Real LB It ’s usually the first to twelfth address, the first to the T return flow, the second position, the second position, the line to the regular line rendezvous, the fetch, the main different access number in the test room, and the address system is replaced. The selection of the parameters and the results are intended to be controlled in the multi-flag position οοοοοοο ο ο 0 5 0 0 2 0 0 1 2 3 4 5 6 7 8 9 9 0 1 1 2 3 5 5 5 5 5 5 5 5 5 6 6 6 6 6 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 The virtual address address position bit body is given to the virtual address between the address and the symbol in the address. The actual control of the fixed position is determined by the false new location address. The false symbol is incorrectly generated. The bit description is misrepresented. The incorrect description is entered. The false description is inserted into the second location to obtain the wrong translation. The new one that is described by the description and the description in the store is marked as having the BL scheduler Γ0-sexual T flow detection test lcr all lines must be checked by the logic device. Interpretation of roads, roads and capital control Non-line search performed in the green of a whole sub-amphetamine summary description 24600246050 50 33345555001 12 66666666777 77 22222222222 22 B L T to the main memory in which character B produced in said formula TL description proposed virtual address bits

入載; 分者 P 吾用 的使 符/述! 描Q 的可 址許 位取 體存 實些 有該 含查 把檢 B B L L T T 止 中 誤 錯 許? < < 允取 C C反取快 mlml違存可 5 0 5 0 5 2 3 3 4 4 7 7 7 7 7 反 違 籤止取 標中存 線誤部 性錯外 全反充 詢安違填 查有性線 取否全取 快是安快 0 5 0 5 5 5 6 6 7 7 7 7 156 200417216 止 址 中 位 部 擬 外 虛 反誤 違錯 割反充 割式ΓΟ-描 分違填取取分程icr性 性性線存存性性m全 全全取料部全全詢安詢頁定符 安安快資外安安查在查分決述 050505050 50 778899001 12 777777888 88 222222222 22 反生B符 違產TL述 B L 走T 行要 表主 許?詢填填取取回體緒續的新叫叫始使叫全新 ?允取查線線存存返軟行繼舊至呼呼開可呼安至 ί ί反取快取取取料部始否執新存換收否新否絕的換 mimi違存可快快快資外開是性重儲轉接是重是拒舊轉 505050505024 6802468024 233445688900 0011111222 888888888800 ^ 222222222244 4444444444 B L T 要 主 的 中 其 於 存 儲 行 執 籤 標 效 有 該 有 含 描 性 全 安 的 入 \17 載:K者 部用 的使 符/Λ 描Q 的可 址許 位取 體存 實些 有該 含查 把檢. Β Β L L τ Τ I 麵 ο ο 止 中 誤 錯 取 存 部 外 充充 斷製同全全安 中仿相安安的 全 安 之 行 執 下 現 和 緒 行 執 回 返 器的 理斷 容 内緒 緒緒行 行行執 執執性 性性全 緒緒 行行 執執 性性 全全 安安? 之之緒 中中行 用用執 作作的 有有新 現現用 存 儲 被 容緒 内行 的執 緒性 行全 執安 性的 157Included; Participant P My use Describe the addressable location of Q. Is there any way to check the B B L L T T error? < < Allow CC to fetch fast mlml violation can be 5 0 5 0 5 2 3 3 4 4 7 7 7 7 7 Check whether the sexual line is all fast or not is fast 0 5 0 5 5 5 6 6 7 7 7 7 156 200417216 The quasi-exceptional false counter-incorrect error cut anti-cut type in the middle of the stop address Take the points icr Sexuality Existence Sexuality Existence M Fully Fully Retrieving Department Fully Inquiry An Inquiry Page Delimiter An An Quick Investment Foreign Security An Inspecting Verification 050505050 50 778899001 12 777777888 88 222222222 22 Anti-B Symbol Violation Producing TL, BL, and T lines? Inquiry, fill in, get back the body, continue to call the new call, start to call the brand new? Allow to check the line, save, return to the soft line, continue to the old to the call, you can call to ί til anti-cache access Do you want to save the new deposit and exchange the new one? The newly rejected mimi is in violation. You can open it quickly and quickly. The external transfer is a re-storage transfer. It is a re-storage transfer. It is important to reject the old transfer. 505050505024 6802468024 233445688900 0011111222 888888888800 ^ 222222222244 4444444444 BLT The signing of the sign has the effect of descriptive security. Contains: The addressable allowance of the envoy used by the K Department / Λ Describe Q. Some of these include check and check. Β Β LL τ Τ I face ο ο Stop and mistakenly retrieve the charge and interruption system of the Ministry of Internal Security Perseverance, completeness and safety? In the thread of the Bank of China, there are new and existing storages used by the Bank of China, and they are used by Rongxu.

Claims (1)

200417216 拾、申請專利範圍: 1. 一種具有一安全性網域和一非安全性網域之資料處理 設備,其中在該安全性網域中該資料處理設備所存取之 安全性資料係不可在該非安全性網域所存取者,該資料 處理設備包含: 一裝置匯流排; 一裝置,其連接至該裝置匯流排和可操作以發出一 記憶體存取請求其相關於該安全性網域或該非安全性 網域之任一者; 一記憶體,其連接至該裝置匯流排和可操作以儲存 該裝置所需要之資料,該記憶體包含安全性記憶體用以 儲存安全性資料和非安全性記憶體用以儲存非安全性 資料,當需要存取在該記憶體中的一資料項時,該裝置 可操作以發出一記憶體存取請求至該裝置匯流排;以及 分割檢測邏輯,其連接至該裝置匯流排以及只要裝 置所發出之記憶體存取請求相關於該非安全性網域 時,可操作該分割檢測邏輯以偵測是否該記憶體存取請 求係企圖存取該安全性記憶體;以及依據此類偵測,防 止該該記憶體存取請求所指定之存取。 2. 如申請專利範圍第1項所述之一種資料處理設備,其中 該裝置可操作於多種模式,包含在非安全性網域之至少 一非安全性模式,以及在安全性網域之至少一安全性模 158 200417216 式0 3 ·如申請專利範圍第1項所述之一種資料處理設備,其中 當在上述安全性網域中之一預定的安全性模式中操作 時,由該裝置管理該分割檢測邏輯。 4.如申請專利範圍第1項所述之一種資料處理設備,其中 由裝置發出之記憶體存取請求包含一網域信號,其確認 是否該記憶體存取請求相關於上述安全性網域或上述 非安全性網域。 5 ·如申請專利範圍第4項所述之一種資料處理設備,其中 該裝置具有一預定的腳位,用以輸出網域信號至該裝置 匯流排。 6. 如申請專利範圍第1項所述之一種資料處理設備,其中 在與該裝置匯流排連結的一判優器中提供該分割檢測 邏輯以在被發出至該裝置匯流排之記憶體存取請求之 間進行判優。 7. 如申請專利範圍第1項所述之一種資料處理設備,其中 在該非安全性網域中,該裝置可在一非安全性作業系統 的控制下操作,以及在該安全性網域中,該裝置可在一 159 200417216 安全性作業系統的控制下操作。 8 ·如申請專利範圍第1項所述之一種資料處理設備,其中 該裝置係整合一處理器之一晶片,該晶片更包含一記憶 體管理單元,當處理器產生記憶體存取請求,其可操作 以執行一或多數預定的存取控制功能,以控制發出至裝 置匯流排之記憶體存取請求。 9.如申請專利範圍第8項所述之一種資料處理設備,其中 該晶片更包含: 特別記憶體,其經由一系統匯流排連接至該處理 器,該特別記憶體可操作以儲存該處理器所需要的資 料,該特別記憶體包含安全性特別記憶體用以儲存安全 性資料,以及非安全性特別記憶體用以儲存非安全性資 料;以及 特別分割檢測邏輯,其連接至該系統匯流排,以及 當操作於該非安全性網域中之一非安全性模式,只要該 處理器產生該記憶體存取請求,可操作該特別分割檢測 邏輯以偵測是否該記憶體存取請求係企圖存取該安全 性記憶體或該安全性特別記憶體之任一,以及依據此類 偵測防止該記憶體存取請求所指定之存取。 1 0.如申請專利範圍第9項所述之一種資料處理設備,其 160 200417216 中: 該處理器係可操作於多數模式,包含在該非安全 網域之至少一非安全性模式,以及在該安全性網域之 少一安全性模式,在該至少一非安全性模式中,該處 器可操作於一非安全性作業系統之控制下,以及在該 少一安全性模式中,該處理器可操作於一安全性作業 統之控制下;以及 該特別分割檢測邏輯係由該安全性作業系統所 理。 1 1 .如申請專利範圍第1 0項所述之一種資料處理設備, 中當該處理器係操作於至少一非安全性模式中,該記 體存取請求指定一虛擬位址,該記憶體管理單元係由 非安全性作業系統所控制,以及由該記憶體管理單元 執行之該預定的存取控制功能之一包含把該虛擬位 轉換成一實體位址,如果欲由該記憶體管理單元所產 之該實體位址係在該安全性記憶體之中時,可操作該 別分割檢測邏輯以防止該記憶體存取請求所指定之 取。 12.如申請專利範圍第10項所述之一種資料處理設備, 中當該處理器操作於該至少一安全性模式中之一時, 記憶體存取請求指定一虛擬位址,該記憶體管理單元 性 至 理 至 系 管 其 憶 該 所 址 生 特 存 其 該 係 161 200417216 由該安全性作業系統所控制, 所热 由該記憶體管理覃异 所執仃之該預定的存取控制功 11早疋 址轉換成一實體位址,該特别八幻把該虛擬位 至少-安全性模式。 “割檢測邏辑不使用於該 U.如申請專利範圍第12項所述_ _ 中斜认 ^ —種資料處理設備,1 中對於該處理器所操作之- 請求…虛擬位址,在記.…式而二該記憶體存取 分割檢測邏輯,以及口要 理早70中提供該特別 、要該處理器作蚩在妒仏 -非安全性模式便可操作。 …、“乍於該至少 如申請專利範圍第η項所述之—種 中更包含-記憶體保護單元,其提 理::備,其 輯,該記憶體保護單元係由該安全別刀割檢測邏 其中當該處理器係操作於一特定的安全性二统所管理, 憶體存取請求指定一記憶體位置之一實體、式時,該記 該記憶體管理單元,以;彡 位址’不使用 早兀以及可#^ 行至少記憶體存取許可處理,以確認是否早兀^執 所指定之該記憶體位置係可存取於 /實體位址 可疋女全性模式。 15.如申請專利範圍第1〇項所述之一種資 中該記憶體包含至少—表格,其包含—^理設備’其 每一者的相關描述符,該記憶體管理單元隱體區域之 匕含一内部儲 162 200417216 取 於 輯 記 其 的 位 記 少 該 分 部 其 以 獲 其 存單元,用以儲存導源自該些描敘符之存取控制資訊 以及由該記憶體管理單元所使用以執行該記憶體存 請求之該些預定的存取控制功能,當該處理器係操作 該至少一非安全性模式時,可操作該特別分割檢測邏 以防止該内部儲存單元儲存該可允許存取該安全性 憶體之存取控制資訊。 1 6.如申請專利範圍第1 5項所述之一種資料處理設備, 中該記憶體存取請求指定一虛擬位址,以及該些預定 存取控制功能之一包含轉換該虛擬位址至一實體 址,每一描述符包含至少一虛擬位址部分和對應於一 憶體區域之實體位址部分,當該處理器係操作於該至 一非安全性模式時,如果之後將為該虛擬位址產生之 實體位址係在該安全性記憶體之内時,可操作該特別 割檢測邏輯以防止該内部儲存單元儲存該實體位址 分為存取控制資訊。 1 7.如申請專利範圍第1 6項所述之一種資料處理設備, 中該内部儲存單元是一轉譯參考緩衝器(TLB)可操作 為一些虛擬位址部分儲存對應的實體位址部分,其係 自截取自該至少一表格之對應描述符。 1 8.如申請專利範圍第1 7項所述之一種資料處理設備, 163 200417216 t該TLB係一如㈣則,和該内部儲存單元更包令 主要TLB ’用以儲存由該記憶體管理單元從該至少一 格:截取之描敘符,·存取控制資訊,其在由該記憶體 理單兀使用該存取控制資訊為該記憶體存取請求執 該預定的存取控制功能之前,可從該主要TLB轉換 該micro-TLB ;搞κ,丨八金丨κ 、 刀口丨双测邏輯,當該處理器係操 於該至少一非安全性模式時, " 輯以防#打— 刼作該特別分割檢測 輯以防止任何存取控制 冗從該主要TLB轉換至 nucr〇-TLB,該存取控制 将、至 憶體。 貝訊係可允許存取該安全性 19·如申請專利範圍第1 中〇 dfc _ 項所迷之一種資料處理設伟 Α τ <扩田述符係相關於至少 邛分安全性記憶體共同作 " 一 之一記憶體區域時,絮 一表袼包含一非安全性表 表格用於當該處理器 該至少-非安全性模式時以及勺人η巧係相 系 匕3由該非安全伯 糸統所產生之描敘符;,卷好占 ^ 田該處理器係操作於非4 镇式時,可操作該特別分、 β〇 〇檢測邏輯以防止該内告 早元儲存由描述符所指定 制吹 疋之该實體位址部分為名 制貝訊,如果之後將為該卢 虛擬位址產生之該實體七 I該安全性記憶體中。 20·如申請專利範圍第18項所 貝所迷之一種資料處理設名 表 管 行 至 作 邏 該 記 其 與 少 於 業 性 存 控 係 其 164 200417216 中當在非安全性表格中之一描述符係相關於至少部分 與部分安全性記憶體共同作用之一記憶體區域時,該至 少一表格包含一非安全性表格用於在該處理器操作於 該至少一非安全性模式時,以及包含由該非安全性作業 系統所產生之描敘符;,當該處理器係操作於非安全性 模式,可操作該特別分割檢測邏輯以防止該内部儲存單 元儲存由該描述符所指定之該實體位址部分為存取控 制資訊,如果之後將為該虛擬位址產生之該實體位址係 在該安全性記憶體中;以及其中該至少一表格更包含位 在該安全性記憶體中的一安全性表格,其包含由該安全 性作業系統所產生之描敘符,該主要TLB包含一旗標 其相關於儲存在該主要TLB中的每一描述符,以確認 是否該描述符係來自該非安全性表格或該安全性表格。 2 1.如申請專利範圍第2 0項所述之一種資料處理設備,其 中只要在一安全性模式和一非安全性模式間該處理器 的操作模式改變,則清除該micro-TLB,在該安全性模 式中存取控制資訊只從該主要TLB中的一描述符轉換 至該micro-TLB,又該相關旗標所標示之該主要TLB係 來自該安全性表格,以及在該非安全性模式中存取控制 資訊只從該主要 TLB 中的一描述符轉換至該 micro-TLB,又該相關旗標所標示之該主要TLB係來自 該非安全性表格。 165 22·如申請專利範圍第10項所述之一種資料處理設備,其 中該°己憶體包含至少一表格其包含一些記憶體區域之 每者的相關描述符,該記憶體管理單元包含一内部儲 存單元,用、 x錯存導源自該描敘符之存取控制資訊以及 由該記憶體答畑w ^ s理早元用以執行該記憶體存取請求之該 預定的存取和也丨^ 二制功月b,當該處理器係操作於該至少〜 安全性模式時, ' β操作該特別分割檢測邏輯以防止該 部儲存單元#^ •子存取控制資訊,該存取控制資訊係可允 許存取該安夺μ ζ憶體’以及其中該至少一表格包含 少一分頁表格。 23.如申請專利範圍第1()項所述之-種資料處理設備,其 中該特別記憶體包含連接至該系統匯流排之一緊接吃 憶體,該緊接記憶體之該實體位址範圍被定義為一控制 登錄,以及當操作於一權限安全性模式時可由該處理器 設定一控制旗標以指示是否只在一權限安全性模式執 行時該緊接記憶體係可由該處理器控制,或在執行㈣ 至少一非安全性模式時可由該處理器控制。 24·如申請專利範圍第23項所述之-種f 料處理設備 中如杲執行於該 制該緊接記憶體 至少一非安全性模式 ,以防止將安全性資 ,其 時,該處理器可控 料健存在該緊接記 166 200417216 憶體中。 中性理 備全處 設安料 理 一 資 處有該 料具中 資備域 一 設網 在理性 種處全 一 料安 控網 設 存 所 域 網 性 全 安 非 該 在 可 不 資 該係含 該在料包 資備 性設 全理 安處 之料己 _ 取 Γ ¥存該 取一 t , 存及所者 制 域取 法域 方網 的性 體全 憶安L資 一裝置匯流排;一裝置,其連接至該裝置匯流排及可操 作以發出一記憶體存取請求其相關於該安全性網域或 該非安全性網域之任一;以及一記憶體,其連接至該裝 置匯流排及可操作以儲存該裝置所需要之資料,該記憶 體包含安全性記憶體用以儲存安全性資料及非安全性 記憶體用以儲存非安全性資料,該方法包含下列步驟: (i) 當存取在該記憶體中所需之資料項時,從該裝 置發出一記憶體存取請求至該裝置匯流排;及 (ii) 只要由該裝置所發出之該記憶體存取請求係相 關於該非安全性網域時,使用連接至該裝置匯流排之分 割檢測邏輯,以偵測是否該記憶體存取請求係企圖存取 該安全性記憶體;及 (iii) 依據此類偵測,防止該記憶體存取請求所指定 之存取。 26· 2 6.如申請專利範圍第25項所述之一種方法,其中該 裝置可操作於多種模式,包含在非安全性網域之至少一 167 200417216 非安全性模式,以及在安全性網域之至少一安全性模 式。 27. 如申請專利範圍第25項所述之一種方法,其中當在上 述安全性網域中之一預定的安全性模式中操作時,由該 裝置管理該分割檢測邏輯。 28. 如申請專利範圍第25項所述之一種方法,其中由裝置 發出之記憶體存取請求包含一網域信號,其確認是否該 記憶體存取請求相關於上述安全性網域或上述非安全 性網域^ 2 9.如申請專利範圍第28項所述之一種方法,其中該裝置 具有一預定的腳位,用以輸出網域信號至該裝置匯流 排。 30.如申請專利範圍第25項所述之一種方法,其中在與該 裝置匯流排連結的一判優器中提供該分割檢測邏輯以 在被發出至該裝置匯流排之記憶體存取請求之間進行 判優。 3 1.如申請專利範圍第2 5項所述之一種方法,其中在該非 安全性網域中,該裝置可在一非安全性作業系統的控制 168 200417216 下操作,以及在該安全性網域中,該裝置可在一安全 作業系統的控制下操作。 32·如申請專利範圍第25項所述之一種方法,其中該裝 係整合一處理器之一晶片,該晶片更包含一記憶體管 單元,當處理器產生記憶體存取請求,該方法包括下 步驟: 使用該記憶體管理單元執行一或多數預定的存 控制功能,以控制發出至裝置匯流排之記憶體存取 求。 33.如申請專利範圍第32項所述之一種方法,其中該晶 更包含特別記憶體,其經由一系統匯流排連接至該處 器,該特別記憶體可操作以儲存該處理器所需要的 料,該特別記憶體包含安全性特別記憶體用以儲存安 性資料,以及非安全性特別記憶體用以儲存非安全性 料;以及連接至該系統匯流排之特別分割檢測邏輯, 方法更包含下列步驟: 當操作於該非安全性網域中之一非安全性模式, 要該處理器產生該記憶體存取請求,即使用該特別分 檢測邏輯以偵測是否該記憶體存取請求係企圖存取 安全性記憶體或該安全性特別記憶體之任一者,以及 依據此類偵測防止該記憶體存取請求所指定之 性 置 理 列 取 請 片 理 資 全 資 該 只 割 該 存 169 200417216 取。 3 4 ·如申請專利範圍第3 3項所述之一種方法, 該處理器係可操作於多數模式,包含在 網域之至少一非安全性模式,以及在該安全 少一安全性模式,在該至少一非安全性模3 器可操作於一非安全性作業系統之控制下, 少一安全性模式中,該處理器可操作於一安 統之控制下;以及 該特別分割檢測邏輯係由該安全性作 理。 35.如申請專利範圍第34項所述之一種方法, 理器係操作於該至少一非安全性模式中,在 出之該記憶體存取請求指定一虛擬位址,使 管理單元以執行一或多數預定的存取控制 驟係由該非安全性作業系統所控制,以及所 定的存取控制功能之一包含把該虛擬位址 體位址,該特別分割檢測邏輯在步驟(iii)防 存取請求所指定之存取,如果由該記憶體管 生之該實體位址係在該安全性記憶體之中。 3 6.如申請專利範圍第3 4項所述之一種方法, 中: 該非安全性 性網域之至 ,中,該處理 以及在該至 全性作業系 業系統所管 其中當該處 步驟(i)所發 用該記憶體 功能之該步 執行之該預 轉換成一實 止該記憶體 理單元所產 其中當該處 170 200417216 理器操作於該至少一安全性模式中之一時,在該 所發出之該記憶體存取請求指定一虛擬位址,使 憶體管理單元以執行一或多數預定存取功能之 係由該安全性作業系統所控制,以及所執行之該 存取控制功能之一包含把該虛擬位址轉換成一 址,該特別分割檢測邏輯不使用於該至少一安 式0 3 7.如申請專利範圍第3 6項所述之一種方法,其中 處理器所操作之所有模式而言,在該步驟(i)發出 憶體存取請求指定一虛擬位址,在記憶體管理單 供該特別分割檢測邏輯,以及只要該處理器作業 於該至少一非安全性模式便可操作。 3 8.如申請專利範圍第3 5項所述之一種方法,其中 一記憶體保護單元,其中提供該特別分割檢測邏 記憶體保護單元係由該安全性作業系統所管理, 該處理器係操作於一特定的安全性模式,在該 所發出之該記憶體存取請求指定一記憶體位置 體位址,不執行使用該記憶體管理單元以執行一 預定的存取控制功能之該步驟,以及該記憶體保 執行至少記憶體存取許可處理,以確認是否由該 址所指定之該記憶體位置係可存取於該特定安 步驟(i) 用該記 該步驟 預定的 實體位 全性模 對於該 之該記 元中提 係操作 更包含 輯,該 其中當 步驟⑴ 之一實 或多數 護單元 實體位 全性模 171 200417216 式0 3 9 ·如申請專利範圍第3 4項所述之一種方法,其中該記憶 體包含至少一表格,其包含一些記憶體區域之每一者的 相關描述符,該方法包含下列步驟: 在一記憶體管理單元中提供一内部儲存單元,用以 儲存導源自該些描敘符之存取控制資訊,以及由該記憶 體管理單元所使用以執行該記憶體存取請求之該些預 定的存取控制功能;以及 當該處理器係操作於該至少一非安全性模式時,可 操作該特別分割檢測邏輯以防止該内部儲存單元儲存 存取控制資訊,該存取控制資訊係可允許存取該安全性 記憶體。 40.如申請專利範圍第39項所述之一種方法,其中在該步 驟(i)發出之該記憶體存取請求指定一虛擬位址,以及由 該記憶體管理單元所執行之該些預定的存取控制功能 包含轉換該虛擬位址至一實體位址,每一描述符包含至 少一虛擬位址部分和對應於一記憶體區域之實體位址 部分,該方法包括下列步驟: 當該處理器係操作於該至少一非安全性模式時,如 果之後將為該虛擬位址產生之該實體位址係在該安全 性記憶體之内,則使用該特別分割檢測邏輯以防止該内 172 417216 部健存單元錯存該實體位址部分為存取控制資訊 41.如申請專利範圍第4〇項所述之_種方法其Μ 儲存單元是-轉課參考緩衝器(T L Β )可操作以為一 擬位址部分儲存對應的實體位址部分,其係獲自截 該至少一表格的對應描述符。 Ο.如申請專利範圍第41項所述之一種方法其中該 係一 micro-TLB,和該内部儲存單元更包含一主要 用以儲存由該記憶體管理單元從該至少一表格所 之描敘符,該方法包含下列步驟: 在由該記憶體管理單元使用該存取控制資訊 §己憶體存取清求執行該預定的存取控制功能之前 主要TLB轉換存取控制資訊至該micr〇_TLB ;以石 當該處理器係操作於該至少一非安全性模式丨 用該特別分割檢測邏輯以防止任何存取控制資訊 主要TLB轉換至該micro-TLB,該存取控制資巧 允許存取該安全性憶體。 43·如申請專利範圍第40項所述之一種方法,其中 安全性表格中之描述符係相關於至少部分與部 性記憶體共同作用之一 §己憶體區域時’該至少一 含一非安全性表格用於當該處理器係操作於該 内部 些虛 取自 TLB TLB 截取 為該 從該 ^ ’使 從該 係可 在非 安全 袼包 少_ 173 200417216 非安全性模式時以及包h該非安全㈣業系統所產 生之描敘符,該方法包含下列步驟: 當該處自器係操作於非安全性模式,使用該特別分 割檢測邏輯以防止該内部儲存單元儲存由描述符所指 定之該實體位址部分為存取控制資訊,如果之後將為該 虛擬位址產生之該實體位址係在該安全性記憶體中:μ 44·如申請專利範圍第42項所述之一種方法,其中當在非 安全性表格中之描述符係相關於至少部分與部分安全 性記憶體共同作用之一記憶體區域時,該至少一表格包 含一非安全性表格用於在該處理器操作於該至少—非 安全性模式時,以及包含由該非安全性作業系統所產生 之描敘符,該方法包含下列步驟: 當該處理器係操作於非安全性模式,該特別分割檢 測邏輯可操作以防止該内部储存單元儲存由該描述: 所指定之該實體位址部分為存取控制資訊,如果之“ 為該虛擬&址產生之該實體位址係&該安&性記^ 中;以及 其中該至少一表格更包含位在該安全性記憶體中 的一女全性表格其包含由該安全性作業系統所產生< 描敘符It主要TLB包含一旗標其相關於健存在該主 要TLB中的每一描述符,以及該方法包含下列步驟: 田描述符係儲存於該主要TLB時,設置該相關 174 200417216 旗標以確認是否該描述符係來自該非安全性表格或該 安全性表格。 45 ·如申請專利範圍第44項所述之一種方法,更包含下列 步驟: 只要在一安全性模式和一非安全性模式間該處理 器的操作模式改變,則清除該micro-TLB ; 在該安全性模式中,存取控制資訊只從該主要TLB 中的一描述符轉換至該m i c r 〇 - T L B,又該相關旗標所標 示之該主要TLB係來自該安全性表格;以及 在該非安全性模式中存取控制資訊只從該主要 TLB中的一描述符轉換至該micro-TLB,又該相關旗標 所標示之該主要TLB係來自該非安全性表格。 46.如申請專利範圍第34項所述之一種方法,其中該記憶 體包含至少一表格其包含一些記憶體區域的每一者的 相關描述符,該方法包含下列步驟: 在一記憶體管理單元中提供一内部儲存單元,用以 儲存導源自該描敘符之存取控制資訊以及由該記憶體 管理單元用以執行該記憶體存取請求之該預定的存取 控制功能;以及 當該處理器係操作於該至少一非安全性模式,使用 該特別分割檢測邏輯以防止該内部儲存單元儲存存取 175 200417216 控制資訊其允許存取該安全性記憶體;以及 其中該至少一表格包含至少一分頁表格。 47.如申請專利範圍第34項所述之一種方法,其中該特別 記憶體包含連接至該系統匯流排之一緊接記憶體,該方 法包含下列步驟: 在一控制登錄定義該緊接記憶體之該實體位址範 圍;以及 當操作於一權限安全性模式時,由該處理器設定一 控制旗標以指示是否只在一權限安全性模式執行時該 緊接記憶體係可由該處理器控制,或在執行於該至少一 非安全性模式時可由該處理器控制。 4 8.如申請專利範圍第47項所述之一種方法,其中如果執 行於該至少一非安全性模式時,該處理器可控制該緊接 記憶體,以防止將安全性資料儲存在該緊接記憶體中。 49. 一種資料處理設備,包含: 一裝置匯流排; 一裝置,其連接至該裝置匯流排以及可操作於多數 模式和一安全性網域或一非安全性網域,包含在非安全 性網域之至少一非安全性模式及在安全性網域之至少 一安全性模式; 176 200417216 一記憶體,其連接至該裝置匯流排和可操作以儲 該裝置所需要之資料,該記憶體包含安全性記憶體用 儲存安全性資料和非安全性記憶體用以儲存非安全 資料,當需要存取在該記憶體中的一資料項時,可操 該裝置以發出一記憶體存取請求至該裝置匯流排;以 分割檢測邏輯,其連接至該裝置匯流排以及只要 操作於該至少一非安全性網域時,裝置發出記憶體存 請求,可操作以偵測是否該記憶體存取請求係企圖存 該安全性記憶體;以及依據此類偵測,防止該該記憶 存取請求所指定之存取。 5 0. —種在一資料處理設備中控制存取記憶體的方法,該 料處理設備包含一裝置匯流排;一裝置,其連接至該 置匯流排及可操作於多數模式及一安全性網域或一 安全性網域,包含在非安全性網域之至少一非安全性 式及在安全性網域之至少一安全性模式;以及一記 體,其連接至該裝置匯流排及可操作以儲存該裝置所 要之資料,該記憶體包含安全性記憶體用以儲存安全 資料及非安全性記憶體用以儲存非安全性資料,該方 包含下列步驟: (i) 當存取在該記憶體中所需之資料項時,從該 置發出一記憶體存取請求至該裝置匯流排;及 (ii) 當操作於該至少一非安全性網域時,只要該 存 以 性 作 及 當 取 取 體 資 裝 非 模 憶 需 性 法 裝 裝 177 200417216 置發出該記憶體存取請求,即使用連接至該裝置匯流排 之分割檢測邏輯,以偵測是否該記憶體存取請求係企圖 存取該安全性記憶體;及 (in)依據此類偵測,防止該記憶體存取請求所指定 之存取。 178200417216 Patent application scope: 1. A data processing device with a secure domain and a non-secure domain, where the security data accessed by the data processing device in the secure domain is not available in For accessers of the non-secure domain, the data processing device includes: a device bus; a device connected to the device bus and operable to issue a memory access request related to the secure domain Or any one of the non-secure domains; a memory connected to the device bus and operable to store data required by the device, the memory including security memory for storing security data and non- The security memory is used to store non-security data. When a data item in the memory needs to be accessed, the device is operable to issue a memory access request to the device bus; and the partition detection logic, When it is connected to the device bus and whenever the memory access request issued by the device is related to the non-secure domain, it can operate the partition detection logic to detect If the memory access request attempts to access the security system memory; and the basis of such detection, to prevent the memory access request of the designated access. 2. A data processing device as described in item 1 of the scope of patent application, wherein the device can operate in multiple modes, including at least one non-security mode in a non-secure network domain, and at least one in a secure network domain. Security mode 158 200417216 Formula 0 3 · A data processing device as described in item 1 of the scope of patent application, wherein when operating in one of the predetermined security modes in the security network domain, the device manages the segmentation Detection logic. 4. A data processing device as described in item 1 of the scope of patent application, wherein the memory access request issued by the device includes a domain signal, which confirms whether the memory access request is related to the above security domain or The above non-secure domain. 5. A data processing device as described in item 4 of the scope of patent application, wherein the device has a predetermined pin for outputting a network domain signal to the device bus. 6. A data processing device as described in item 1 of the scope of patent application, wherein the segmentation detection logic is provided in an arbiter connected to the device bus to access the memory issued to the device bus Arbitration between requests. 7. A data processing device as described in item 1 of the scope of patent application, wherein in the non-secure network domain, the device is operable under the control of a non-secure operating system, and in the secure network domain, The unit can be operated under the control of a 159 200417216 safe operating system. 8. A data processing device as described in item 1 of the scope of patent application, wherein the device is integrated with a chip of a processor, and the chip further includes a memory management unit. When the processor generates a memory access request, it Operable to perform one or more predetermined access control functions to control memory access requests issued to the device bus. 9. A data processing device as described in item 8 of the scope of patent application, wherein the chip further comprises: a special memory connected to the processor via a system bus, the special memory being operable to store the processor Required data, the special memory includes security special memory for storing security data, and non-security special memory for storing non-security data; and special segmentation detection logic connected to the system bus , And when operating in a non-security mode in the non-security domain, as long as the processor generates the memory access request, the special partition detection logic can be operated to detect whether the memory access request is an attempt to save Take any one of the security memory or the security special memory, and prevent access specified by the memory access request based on such detection. 10. A data processing device as described in item 9 of the scope of patent application, wherein 160 200417216: the processor is operable in a plurality of modes, including at least one non-security mode in the non-secure network domain, and in the One of the security network domains has a security mode. In the at least one non-security mode, the processor can be operated under the control of a non-security operating system, and in the one security mode, the processor. Operable under the control of a security operating system; and the special partition detection logic is handled by the security operating system. 11. A data processing device as described in item 10 of the scope of patent application, wherein when the processor is operating in at least one non-security mode, the memory access request specifies a virtual address and the memory The management unit is controlled by a non-security operating system, and one of the predetermined access control functions performed by the memory management unit includes converting the virtual bit into a physical address. When the physical address is generated in the security memory, the segmentation detection logic can be operated to prevent the memory access request from taking the specified address. 12. A data processing device according to item 10 of the scope of patent application, wherein when the processor operates in one of the at least one security mode, the memory access request specifies a virtual address, and the memory management unit Responsible for the management of the memory of the site, the special storage of the department 161 200417216 is controlled by the security operating system, and the heat is controlled by the memory management Qin Yi performed the predetermined access control function 11 early The address is converted into a physical address, and the special eight magic transforms the virtual bit into at least-security mode. "Cut detection logic is not used in this U. As described in item 12 of the scope of the patent application _ _ _ _ _ _ _ _ _ a kind of data processing equipment, in 1 for the processor to operate-request ... virtual address, in the record ... And the memory access and partition detection logic, as well as the provision of the special in the early 70, the processor can be operated in the jealous-non-security mode... "" As described in item η of the scope of the patent application-a memory protection unit is also included, the reasoning of which is: preparation, its compilation, the memory protection unit is logically detected by the security cutting-off detection when the processor It is operated by a specific security system. When a memory access request specifies an entity or a memory location, the memory management unit should be recorded in order to save the address. # ^ At least the memory access permission processing is performed to confirm whether the memory location specified by the executive is accessible at / physical address can be used in female holistic mode. 15. As described in item 10 of the scope of the patent application, the memory contains at least-a table, which contains-a descriptor of each of the management devices, a hidden area of the memory management unit. Contains an internal storage 162 200417216, which is taken from the record of the division, to obtain its storage unit, which is used to store the access control information derived from the descriptors and used by the memory management unit In order to execute the predetermined access control functions of the memory storage request, when the processor is operating the at least one non-security mode, the special partition detection logic can be operated to prevent the internal storage unit from storing the allowable storage. Get the access control information of the security memory. 16. A data processing device as described in item 15 of the scope of patent application, wherein the memory access request specifies a virtual address, and one of the predetermined access control functions includes converting the virtual address to a Physical address, each descriptor contains at least a virtual address part and a physical address part corresponding to a memory area, when the processor is operating in the to a non-security mode, if it will be the virtual bit When the physical address generated by the address is within the security memory, the special cut detection logic can be operated to prevent the internal storage unit from storing the physical address into access control information. 1 7. A data processing device as described in item 16 of the scope of patent application, wherein the internal storage unit is a translation reference buffer (TLB) operable to store corresponding physical address portions in some virtual address portions, which The corresponding descriptor is taken from the at least one table. 1 8. A data processing device as described in item 17 of the scope of the patent application, 163 200417216 t the TLB is as usual, and the internal storage unit includes the main TLB 'for storing the memory management unit From the at least one cell: the intercepted descriptor, access control information, before the memory management unit uses the access control information to perform the predetermined access control function for the memory access request, The micro-TLB can be converted from the main TLB; κ, 丨 eight gold 丨 κ, knife edge 丨 dual test logic, when the processor is operating in the at least one non-security mode, " 辑 以防 # 打 — This special partition detection sequence is performed to prevent any access control from being redundantly switched from the main TLB to nucr0-TLB, and the access control will reach the memory. Beixun System may allow access to this security. 19 · As a kind of data processing as described in the 0dfc _ item in the scope of the patent application, 伟 A τ < Expansion symbol is related to at least the security memory common When creating a memory area, the table contains a non-security table for the processor when the processor is in the at least-non-secure mode and the system is connected by the non-security device. Descriptive symbols generated by the system; when the processor is operating in a non-four town mode, the special point and β〇〇 detection logic can be operated to prevent the early warning from being stored by the descriptor. The part of the physical address of the designated system is the name system. If the entity's virtual address will be generated later in the security memory of the entity. 20 · If a kind of data processing is covered by item 18 in the scope of the application for patent, the name list shall be managed and the record shall be recorded. It shall be one of the descriptors in the non-security form in the 164 200417216. When the processor is operating in the at least one non-security mode, the at least one table includes a non-security table when the processor is operating in the at least one non-security mode. Descriptor generated by the non-security operating system; when the processor is operating in non-security mode, the special partition detection logic can be operated to prevent the internal storage unit from storing the physical address specified by the descriptor Part is access control information, if the physical address generated for the virtual address is later in the security memory; and wherein the at least one table further includes a security located in the security memory A table containing the descriptors generated by the security operating system, the primary TLB contains a flag related to each of the stored in the primary TLB Said operator to confirm whether or not the descriptor from the non-safety system or the security table form. 2 1. A data processing device as described in item 20 of the scope of patent application, wherein whenever the operation mode of the processor is changed between a security mode and a non-security mode, the micro-TLB is cleared, and The access control information in the security mode is only converted from a descriptor in the main TLB to the micro-TLB, and the main TLB indicated by the relevant flag is from the security table, and in the non-security mode The access control information is only converted from a descriptor in the primary TLB to the micro-TLB, and the primary TLB indicated by the relevant flag is from the non-security table. 165 22. A data processing device as described in item 10 of the scope of patent application, wherein the memory contains at least one table containing relevant descriptors for each of a number of memory areas, and the memory management unit includes an internal A storage unit that stores the access control information derived from the descriptor with x, and the predetermined access and also used by the memory to respond to the memory access request to execute the memory access request.丨 ^ Two system months b, when the processor is operating in the at least ~ security mode, 'β operates the special partition detection logic to prevent the storage unit # ^ • sub-access control information, the access control The information system may allow access to the security μ'memory body 'and wherein the at least one table includes one less paged table. 23. A data processing device as described in item 1 () of the patent application scope, wherein the special memory includes an immediate memory connected to one of the system buses, and the physical address of the immediate memory The scope is defined as a control login, and when operating in a permission security mode, the processor can set a control flag to indicate whether the immediate memory system can be controlled by the processor when only a permission security mode is executed, Or it can be controlled by the processor when executing at least one non-security mode. 24. As described in item 23 of the scope of the application for patent-a kind of f material processing equipment, such as if executed in the system immediately following the memory at least one non-safety mode to prevent security data, at Controllable materials are stored in the memory immediately following 166 200417216. Neutral equipment is located in the entire establishment, and the food and beverage department has the material. The equipment is provided in the domain. The equipment is installed in the rational species. The equipment is controlled and stored in the domain. In the material package, set up a full material security department _ take Γ ¥ storage should take a t, save and take the domain to take the body of the French side of the network Quan Yi'an L equipment a device bus; a device, It is connected to the device bus and is operable to issue a memory access request related to either the secure domain or the non-secure domain; and a memory connected to the device bus and can Operate to store the data required by the device. The memory includes secure memory to store security data and non-secure memory to store non-secure data. The method includes the following steps: (i) when accessing When a data item is required in the memory, a memory access request is issued from the device to the device bus; and (ii) as long as the memory access request issued by the device is related to the non-security Sex domain, Use segmentation detection logic connected to the device's bus to detect whether the memory access request is an attempt to access the secure memory; and (iii) prevent such memory access requests from being detected based on such detections Designated access. 26 · 2 6. A method as described in item 25 of the scope of patent application, wherein the device can operate in multiple modes, including at least one in a non-secure domain 167 200417216 non-secure mode, and in a secure domain One of at least one security mode. 27. A method as described in item 25 of the scope of patent application, wherein the segmentation detection logic is managed by the device when operating in a predetermined security mode in the security domain. 28. A method as described in item 25 of the scope of patent application, wherein the memory access request issued by the device includes a domain signal that confirms whether the memory access request is related to the security domain or the non- Security network domain ^ 2 9. A method as described in item 28 of the patent application scope, wherein the device has a predetermined pin for outputting a network domain signal to the device bus. 30. A method as described in item 25 of the scope of patent application, wherein the segmentation detection logic is provided in an arbiter connected to the device bus to perform memory access requests issued to the device bus. Arbitration. 3 1. A method as described in item 25 of the scope of patent application, wherein in the non-secure network domain, the device can operate under the control of a non-secure operating system 168 200417216 and in the secure network domain The device can be operated under the control of a safe operating system. 32. A method according to item 25 of the scope of patent application, wherein the package is integrated with a chip of a processor, and the chip further includes a memory tube unit. When the processor generates a memory access request, the method includes Next steps: Use the memory management unit to perform one or more predetermined memory control functions to control the memory access request sent to the device bus. 33. A method as described in claim 32, wherein the crystal further comprises a special memory connected to the processor via a system bus, and the special memory is operable to store the required memory of the processor. The special memory includes security special memory for storing security data, and non-security special memory for storing non-safety materials; and special segmentation detection logic connected to the system bus, the method further includes The following steps: When operating in a non-security mode in the non-security domain, if the processor generates the memory access request, the special sub-detection logic is used to detect whether the memory access request is an attempt Access any of the security memory or the security special memory, and prevent the memory access request specified by the memory access request based on such detections 169 200417216 to take. 3 4 · According to a method described in item 33 of the scope of patent application, the processor is operable in a plurality of modes, including at least one non-security mode in the network domain, and one less security mode in the security. The at least one non-safety module can be operated under the control of a non-safety operating system, and in one less security mode, the processor can be operated under the control of a security system; and the special partition detection logic is controlled by The security works. 35. A method as described in item 34 of the scope of patent application, the processor is operated in the at least one non-security mode, and a virtual address is specified in the memory access request, so that the management unit executes a Or most of the predetermined access control steps are controlled by the non-secure operating system, and one of the predetermined access control functions includes the virtual address body address, and the special partition detection logic prevents access requests in step (iii) The specified access, if the physical address generated by the memory is in the security memory. 3 6. A method as described in item 34 of the scope of the patent application, where: the non-safety domain is up to, and the processing is performed in the place where the whole operation system is managed (i ) The pre-transformation performed by the step performed with the memory function is issued to stop the memory unit produced. When the 170 17017216 processor is operated in one of the at least one security mode, the issued The memory access request specifies a virtual address, so that the memory management unit performs one or most predetermined access functions controlled by the security operating system, and one of the access control functions performed includes The virtual address is converted into an address, and the special segmentation detection logic is not used in the at least one safety formula. 0 7. A method as described in item 36 of the patent application scope, in which all modes operated by the processor are In step (i), a memory access request is issued to specify a virtual address, the special partition detection logic is provided in the memory management list, and as long as the processor operates in the at least one non-security mode You can operate. 38. A method according to item 35 of the scope of patent application, wherein a memory protection unit, wherein the special partition detection logic memory protection unit is provided is managed by the security operating system, and the processor is operated In a specific security mode, the memory access request sent out specifies a memory location body address, the step of using the memory management unit to perform a predetermined access control function is not performed, and the The memory guarantee performs at least a memory access permission process to confirm whether the memory location specified by the address is accessible to the specific security step (i) using the physical full mode predetermined by the step to record In this token, the lifting operation further includes a series, in which, when one of the steps 实 is one or more of the protection unit entity holistic module 171 200417216 formula 0 3 9 · A method as described in item 34 of the scope of patent application , Wherein the memory contains at least one table containing relevant descriptors for each of a number of memory regions, the method includes the following steps: in a memory An internal storage unit is provided in the management unit to store the access control information derived from the descriptors, and the predetermined accesses used by the memory management unit to perform the memory access request. Control function; and when the processor is operating in the at least one non-security mode, the special partition detection logic can be operated to prevent the internal storage unit from storing access control information, which can allow access to the Security memory. 40. A method as described in claim 39, wherein the memory access request issued in step (i) specifies a virtual address, and the predetermined ones executed by the memory management unit. The access control function includes converting the virtual address to a physical address. Each descriptor includes at least a virtual address portion and a physical address portion corresponding to a memory area. The method includes the following steps: when the processor When operating in the at least one non-security mode, if the physical address generated for the virtual address is later in the security memory, the special partition detection logic is used to prevent the internal 172 417 216 The storage unit mistakenly stores the physical address part as the access control information. 41. As described in item 40 of the scope of the patent application, the M storage unit is-the transfer reference buffer (TL Β) can be operated as a The pseudo-address portion stores a corresponding physical address portion, which is obtained from intercepting the corresponding descriptor of the at least one table. 〇. A method as described in item 41 of the scope of patent application, wherein the system is a micro-TLB, and the internal storage unit further includes a descriptor for storing the descriptors from the at least one table by the memory management unit. , The method includes the following steps: before the memory management unit uses the access control information § the memory access request to perform the predetermined access control function, the main TLB converts the access control information to the micr0_TLB When the processor is operating in the at least one non-security mode, the special segment detection logic is used to prevent any access control information from being converted from the main TLB to the micro-TLB, and the access control protocol allows access to the Security recall. 43. A method as described in item 40 of the scope of patent application, wherein the descriptors in the security table are related to at least one of the parts that interact with the memory. § When the memory area is' the at least one contains a non The security table is used when the processor is operating in the internal virtual fetched from TLB TLB intercepted as the slave ^ 'so that the slave can be used in non-secure packets _ 173 200417216 in non-security mode and include the non- The descriptor generated by the security industry system includes the following steps: When the local device is operating in a non-security mode, the special partition detection logic is used to prevent the internal storage unit from storing the specified by the descriptor. The physical address part is access control information. If the physical address generated for the virtual address is in the security memory later: μ 44 · A method as described in item 42 of the scope of patent application, where When the descriptor in the non-security table relates to a memory area that at least partially interacts with part of the security memory, the at least one table contains a non-security The grid is used when the processor is operating in the at least-non-safe mode, and includes a descriptor generated by the non-safe operating system. The method includes the following steps: When the processor is operating in the non-safe mode The special partition detection logic is operable to prevent the internal storage unit from storing the description: The specified physical address portion is access control information, if "the physical address generated for the virtual & address is & The security & sexual history ^; and wherein the at least one form further includes a female general form located in the security memory, which contains the < description descriptor It main TLB generated by the security operating system A flag is included which is related to each descriptor stored in the main TLB, and the method includes the following steps: When the field descriptor is stored in the main TLB, the relevant 174 200417216 flag is set to confirm whether the descriptor It is from the non-security form or the security form. 45 · A method as described in the 44th scope of the patent application, further comprising the following steps: If the operation mode of the processor is changed between the security mode and a non-security mode, the micro-TLB is cleared. In the security mode, the access control information is only transferred from a descriptor in the main TLB to the micr. -TLB, and the main TLB indicated by the relevant flag is from the security table; and the access control information in the non-security mode is only converted from a descriptor in the main TLB to the micro-TLB, and The main TLB indicated by the relevant flag is from the non-security form. 46. A method as described in item 34 of the patent application scope, wherein the memory contains at least one form which contains each of a number of memory areas The method includes the following steps: An internal storage unit is provided in a memory management unit for storing the access control information derived from the descriptor and used by the memory management unit to execute the The predetermined access control function of the memory access request; and when the processor is operating in the at least one non-security mode, the special partition detection logic is used to The stopper access internal storage unit to store the control information 175,200,417,216 which allow access to the security memory; and wherein the at least one table comprises at least one page table. 47. A method as described in item 34 of the patent application, wherein the special memory includes an immediate memory connected to one of the system buses, the method includes the following steps: defining the immediate memory in a control register The physical address range of the entity; and when operating in a permission security mode, the processor sets a control flag to indicate whether the immediate memory system can be controlled by the processor when only a permission security mode is executed, Or it can be controlled by the processor when executing in the at least one non-security mode. 4 8. A method according to item 47 of the scope of patent application, wherein if executed in the at least one non-security mode, the processor can control the immediate memory to prevent storing security data in the immediate memory Connect to memory. 49. A data processing device comprising: a device bus; a device connected to the device bus and operable in most modes and a secure or non-secure domain included in a non-secure network At least one non-security mode of the domain and at least one security mode of the security network domain; 176 200417216 a memory connected to the device bus and operable to store data required by the device, the memory containing Security memory is used to store security data and non-secure memory is used to store non-secure data. When a data item in the memory needs to be accessed, the device can be operated to issue a memory access request to The device bus; using segmentation detection logic connected to the device bus and whenever the device operates in the at least one non-secure network domain, the device issues a memory storage request, which is operable to detect whether the memory access request An attempt is made to store the secure memory; and based on such detection, the access specified by the memory access request is prevented. 50. — A method for controlling memory access in a data processing device, the material processing device includes a device bus; a device connected to the device bus and operable in most modes and a security network A domain or a secure domain, including at least one non-secure mode in a non-secure domain and at least one security mode in a secure domain; and a token connected to the device bus and operable To store the data required by the device, the memory includes secure memory to store secure data and non-secure memory to store non-secure data. The party includes the following steps: (i) When accessing the memory When required data items in the body, a memory access request is issued from the device to the device bus; and (ii) when operating on the at least one non-secure domain, as long as the Retrieve the physical memory and install the non-memory memory method to install the 177 200417216 device to issue the memory access request, that is, use the segment detection logic connected to the device's bus to detect whether the memory access request Attempting to access the security memory; and (in) based on such detection, to prevent the memory access request specified by the access. 178
TW92132190A 2002-11-18 2003-11-17 Data processing apparatus and method for controlling access to a memory in the same TWI312253B (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
GB0226875A GB0226875D0 (en) 2002-11-18 2002-11-18 Control of access to a memory by a device
GB0226879A GB0226879D0 (en) 2002-11-18 2002-11-18 Apparatus and method for controlling access to a memory
GB0303446A GB0303446D0 (en) 2002-11-18 2003-02-14 Apparatus and method for controlling access to a memory

Publications (2)

Publication Number Publication Date
TW200417216A true TW200417216A (en) 2004-09-01
TWI312253B TWI312253B (en) 2009-07-11

Family

ID=35873167

Family Applications (1)

Application Number Title Priority Date Filing Date
TW92132190A TWI312253B (en) 2002-11-18 2003-11-17 Data processing apparatus and method for controlling access to a memory in the same

Country Status (4)

Country Link
IL (1) IL168336A (en)
MY (1) MY137182A (en)
RU (1) RU2005115088A (en)
TW (1) TWI312253B (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8028341B2 (en) 2005-03-31 2011-09-27 Intel Corporation Providing extended memory protection
TWI410797B (en) * 2006-09-13 2013-10-01 Advanced Risc Mach Ltd Method and data processing apparatus for memory access security management
TWI463405B (en) * 2007-02-28 2014-12-01 Microsoft Corp System, method and computer storage device for spyware detection mechanism
TWI497294B (en) * 2012-01-04 2015-08-21 Intel Corp Computer-readable storage media, apparatuses, and computer-implemented methods for increasing virtual-memory efficiencies
US9141559B2 (en) 2012-01-04 2015-09-22 Intel Corporation Increasing virtual-memory efficiencies

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8861434B2 (en) * 2010-11-29 2014-10-14 Alcatel Lucent Method and system for improved multi-cell support on a single modem board

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8028341B2 (en) 2005-03-31 2011-09-27 Intel Corporation Providing extended memory protection
TWI410797B (en) * 2006-09-13 2013-10-01 Advanced Risc Mach Ltd Method and data processing apparatus for memory access security management
TWI463405B (en) * 2007-02-28 2014-12-01 Microsoft Corp System, method and computer storage device for spyware detection mechanism
TWI497294B (en) * 2012-01-04 2015-08-21 Intel Corp Computer-readable storage media, apparatuses, and computer-implemented methods for increasing virtual-memory efficiencies
US9141559B2 (en) 2012-01-04 2015-09-22 Intel Corporation Increasing virtual-memory efficiencies
US9965403B2 (en) 2012-01-04 2018-05-08 Intel Corporation Increasing virtual-memory efficiencies
US10169254B2 (en) 2012-01-04 2019-01-01 Intel Corporation Increasing virtual-memory efficiencies

Also Published As

Publication number Publication date
MY137182A (en) 2009-01-30
TWI312253B (en) 2009-07-11
RU2005115088A (en) 2006-01-20
IL168336A (en) 2010-04-29

Similar Documents

Publication Publication Date Title
TWI275997B (en) Switching between secure and non-secure processing modes
KR100941104B1 (en) Apparatus for processing data, method for processing data and computer-readable storage medium storing a computer program
JP4302641B2 (en) Controlling device access to memory
KR101099463B1 (en) Virtual to physical memory address mapping within a system having a secure domain and a non-secure domain
JP4302493B2 (en) Techniques for accessing memory in a data processing device
JP4302492B2 (en) Apparatus and method for managing access to memory
JP4302494B2 (en) Techniques for accessing memory in a data processing device
JP4299107B2 (en) How to send a data processing request to a suspended operating system
JP4424973B2 (en) Monitor control for multi-domain processors
JP4423012B2 (en) Diagnostic data acquisition control for multi-domain processors
WO2004046925A1 (en) Security mode switching via an exception vector
JP2004171568A (en) Treatment of multiple interrupts in data processing system using multiple operating systems
IL168336A (en) Control of access to a memory by a device
JP4299108B2 (en) Task tracking between multiple operating systems
TWI292099B (en) Apparatus, method and computer program product for processing data 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