[go: up one dir, main page]

TW202540862A - Selection of tag translation mode - Google Patents

Selection of tag translation mode

Info

Publication number
TW202540862A
TW202540862A TW114106533A TW114106533A TW202540862A TW 202540862 A TW202540862 A TW 202540862A TW 114106533 A TW114106533 A TW 114106533A TW 114106533 A TW114106533 A TW 114106533A TW 202540862 A TW202540862 A TW 202540862A
Authority
TW
Taiwan
Prior art keywords
address
translation
tag
label
data
Prior art date
Application number
TW114106533A
Other languages
Chinese (zh)
Inventor
格雷姆彼得 巴恩斯
Original Assignee
英商Arm股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 英商Arm股份有限公司 filed Critical 英商Arm股份有限公司
Publication of TW202540862A publication Critical patent/TW202540862A/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1416Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights
    • G06F12/1425Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights the protection being physical, e.g. cell, word, block
    • G06F12/1441Protection against unauthorised use of memory or access to memory by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights the protection being physical, e.g. cell, word, block for a range
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/10Address translation
    • G06F12/1027Address translation using associative or pseudo-associative address translation means, e.g. translation look-aside buffer [TLB]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/14Protection against unauthorised use of memory or access to memory
    • G06F12/1458Protection against unauthorised use of memory or access to memory by checking the subject access rights
    • G06F12/1466Key-lock mechanism
    • G06F12/1475Key-lock mechanism in a virtual system, e.g. with translation means
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1052Security improvement
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/65Details of virtual memory and virtual address translation
    • G06F2212/651Multi-level translation tables
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/65Details of virtual memory and virtual address translation
    • G06F2212/657Virtual address space management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Address translation circuitry determines whether a first or second tag translation mode is to be used for a given stage of address translation to be performed in response to a tag-accessing instruction specifying a given data address and requesting that an operation is performed using a given allocation tag associated with a given data item corresponding to the given data address. The given allocation tag comprises a tag for use in a tag check in response to a tag-checked memory access instruction specifying an address operand for defining a target address of a memory access operation. If the selected mode is the first mode, a data-locating second address is obtained identifying a location of both the given data item and the given allocation tag within the second address space. If the second mode is selected, a tag-locating second address is obtained identifying a location of the given allocation tag within the second address space separate from a location of the given data item identified by the data-locating second address.

Description

標籤轉譯模式的選擇Tag translation mode selection

本技術係關於資料處理領域。This technology relates to the field of data processing.

一些資料處理架構可基於在記憶體中儲存的給定資料項的分配標籤及與用以計算彼給定資料項的位址的位址指標相關聯的位址標籤,而對標籤檢查操作提供支援。此類標籤檢查可以有助於偵測記憶體安全錯誤(例如,以下錯誤:因為程式設計錯誤及/或程式碼的非預期結果(諸如緩衝器溢位),位址指標被使用以導致存取位址指標從未意欲指向的記憶體區域,而存在資料損壞的風險並且增加對於惡意方攻擊的易損性)。Some data processing architectures can support tag-checking operations based on allocation tags for given data items stored in memory and address tags associated with address pointers used to calculate the address of those given data items. Such tag-checking can help detect memory security errors (e.g., errors where address pointers are used to access memory regions that the address pointers never intended to point to due to programming errors and/or unexpected results in the code (such as buffer overflows), posing a risk of data corruption and increasing vulnerability to malicious attacks).

本技術之至少一些實例提供一種設備,其包含:標籤檢查電路系統,其用以回應於一經標籤檢查記憶體存取指令而執行一標籤檢查,該經標籤檢查記憶體存取指令指定用於定義對應於與在一記憶體系統中儲存的一分配標籤相關聯的一資料項的一目標資料位址的一位址運算元,該標籤檢查包含回應於偵測到在從該記憶體系統獲得的用於該目標資料位址的該分配標籤與同該位址運算元相關聯的一位址標籤之間的一標籤失配而觸發一錯誤處置回應;及位址轉譯電路系統,其用以根據與至少一個位址轉譯階段相關聯的位址映射資訊執行位址轉譯,該至少一個位址轉譯階段包括從一第一位址空間至一第二位址空間的一給定位址轉譯階段;其中:當回應於指定一給定資料位址且請求使用與對應於該給定資料位址的一給定資料項相關聯的一給定分配標籤來執行一操作的一標籤存取指令而執行該給定位址轉譯階段時,該位址轉譯電路系統經組態以:判定一第一標籤轉譯模式亦或一第二標籤轉譯模式係待用於回應於該標籤存取指令的該給定位址轉譯階段的一經選擇標籤轉譯模式;回應於判定該經選擇標籤轉譯模式係該第一標籤轉譯模式而獲得一資料定位第二位址,該資料定位第二位址識別該給定資料項及該給定分配標籤二者在該第二位址空間內的一位置;及回應於判定該經選擇標籤轉譯模式係該第二標籤轉譯模式而獲得一標籤定位第二位址,該標籤定位第二位址識別該給定分配標籤在該第二位址空間內的一位置,該位置與由該資料定位第二位址識別的該給定資料項在該第二位址空間中的一位置分開。At least some embodiments of the present technology provide an apparatus comprising: a tag checking circuit system for performing a tag checking in response to a tag-checked memory access instruction, the tag-checked memory access instruction specifying an address operation for defining a target data address corresponding to a data item associated with an allocation tag stored in a memory system, the tag checking including responding to the detection of the target data address obtained from the memory system. An error handling response is triggered when the allocation tag and an address tag associated with the address operand are mismatched; and an address translation circuit system is used to perform address translation based on address mapping information associated with at least one address translation stage, the at least one address translation stage including a given address translation stage from a first address space to a second address space; wherein: when the response specifies a given data address and requests use of the data corresponding to the given data... When executing a tag access instruction to perform an operation on a given data item at a given address and performing the given address translation stage, the address translation circuit system is configured to: determine whether a first tag translation mode or a second tag translation mode is a selected tag translation mode to be used in response to the given address translation stage of the tag access instruction; and, in response to determining that the selected tag translation mode is the first tag translation mode, obtain a data location... A second address is provided, wherein the data location second address identifies a position of the given data item and the given assignment label within the second address space; and a tag location second address is obtained in response to determining that the selected tag translation mode is the second tag translation mode, wherein the tag location second address identifies a position of the given assignment label within the second address space, which is separate from a position of the given data item in the second address space identified by the data location second address.

本技術的至少一些實例提供一種用於製造上述設備的電腦可讀取碼。該電腦可讀取碼可儲存在一儲存媒體上。該儲存媒體可係一非暫時性儲存媒體。At least some embodiments of this technology provide a computer-readable code for manufacturing the aforementioned device. The computer-readable code can be stored on a storage medium. This storage medium can be a non-temporary storage medium.

本技術之至少一些實例提供一種方法,其包含:判定一第一標籤轉譯模式亦或一第二標籤轉譯模式係待用於回應於一標籤存取指令而待執行的一給定位址轉譯階段的一經選擇標籤轉譯模式,該標籤存取指令指定一給定資料位址且請求使用與對應於該給定資料位址的一給定資料項相關聯的一給定分配標籤來執行一操作,該給定分配標籤包含用於回應於一經標籤檢查記憶體存取指令而待執行的一標籤檢查中的一標籤,該經標籤檢查記憶體存取指令指定用於定義一記憶體存取操作的一目標位址的一位址運算元,該標籤檢查包含回應於偵測到在從該記憶體系統獲得的用於該目標位址的該分配標籤與同該位址運算元相關聯的一位址標籤之間的一標籤失配而觸發一錯誤處置回應;回應於判定該經選擇標籤轉譯模式係該第一標籤轉譯模式而獲得一資料定位第二位址,該資料定位第二位址識別該給定資料項及該給定分配標籤二者在該第二位址空間內的一位置;及回應於判定該經選擇標籤轉譯模式係該第二標籤轉譯模式而獲得一標籤定位第二位址,該標籤定位第二位址識別該給定分配標籤在該第二位址空間內的一位置,該位置與由該資料定位第二位址識別的該給定資料項在該第二位址空間中的一位置分開。At least some embodiments of this technology provide a method comprising: determining whether a first label translation mode or a second label translation mode is a selected label translation mode to be used in response to a label access instruction to be executed in a given address translation stage, the label access instruction specifying a given data address and requesting to perform an operation using a given allocation label associated with a given data item corresponding to the given data address, the given allocation label including a label for responding to a label check to be executed in response to a label check memory access instruction, the label check memory access instruction specifying an address arithmetic bit for defining a target address of a memory access operation, the label check including responding to the detection of an access from the memory An error handling response is triggered when the system obtains a label mismatch between the allocation label for the target address and an address label associated with the address operand; the response is triggered when a data location second address is obtained by selecting the first label translation mode, the data location second address identifying a position of both the given data item and the given allocation label in the second address space; and when a label location second address is obtained by selecting the second label translation mode, the label location second address identifying a position of the given allocation label in the second address space, the position being separate from a position of the given data item in the second address space identified by the data location second address.

至少一些實例提供一種電腦程式,其用於控制一主機資料處理設備以提供用於執行目標程式碼的一指令執行環境,該電腦程式包含:標籤檢查程式邏輯,其用以回應於一經標籤檢查記憶體存取指令而執行一標籤檢查,該經標籤檢查記憶體存取指令指定用於定義對應於與在一模擬記憶體系統中儲存的一分配標籤相關聯的一資料項的一目標資料位址的一位址運算元,該標籤檢查包含回應於偵測到在從該模擬記憶體系統獲得的用於該目標資料位址的該分配標籤與同該位址運算元相關聯的一位址標籤之間的一標籤失配而觸發一錯誤處置回應;及位址轉譯程式邏輯,其用以根據與至少一個位址轉譯階段相關聯的位址映射資訊執行位址轉譯,該至少一個位址轉譯階段包括從一第一位址空間至一第二位址空間的一給定位址轉譯階段;其中:當回應於指定一給定資料位址且請求使用與對應於該給定資料位址的一給定資料項相關聯的一給定分配標籤來執行一操作的一標籤存取指令而執行該給定位址轉譯階段時,該位址轉譯程式邏輯經組態以:判定一第一標籤轉譯模式亦或一第二標籤轉譯模式係待用於回應於該標籤存取指令的該給定位址轉譯階段的一經選擇標籤轉譯模式;回應於判定該經選擇標籤轉譯模式係該第一標籤轉譯模式而獲得一資料定位第二位址,該資料定位第二位址識別該給定資料項及該給定分配標籤二者在該第二位址空間內的一位置;及回應於判定該經選擇標籤轉譯模式係該第二標籤轉譯模式而獲得一標籤定位第二位址,該標籤定位第二位址識別該給定分配標籤在該第二位址空間內的一位置,該位置與由該資料定位第二位址識別的該給定資料項在該第二位址空間中的一位置分開。At least some examples provide a computer program for controlling a host data processing device to provide an instruction execution environment for executing object program code. The computer program includes: a tag checking logic for responding to a tag-checked memory access instruction to perform a tag check, the tag-checked memory access instruction specifying an address operation for defining a bit corresponding to a target data address associated with an allocation tag stored in a simulated memory system. The query includes a response to triggering an error handling response upon detecting a label mismatch between the allocation label for the target data address obtained from the analog memory system and an address label associated with the address operand; and address translation logic for performing address translation based on address mapping information associated with at least one address translation stage, the at least one address translation stage including a given address translation stage from a first address space to a second address space; wherein: when the response is in the specified When a given data address is given and a tag access instruction requests the use of a given allocation label associated with a given data item corresponding to that given data address to perform an operation, and the given address translation stage is executed, the address translation logic is configured to: determine whether a first tag translation mode or a second tag translation mode is a selected tag translation mode to be used in response to the given address translation stage in response to the tag access instruction; and respond to the determination that the selected tag translation mode is the first tag translation mode. A second data location address is obtained by means of the method, the second data location address identifying a position of the given data item and the given allocation label in the second address space; and a second label location address is obtained by determining that the selected label translation mode is the second label translation mode, the second label location address identifying a position of the given allocation label in the second address space, the position being separate from a position of the given data item in the second address space identified by the second data location address.

該電腦程式可儲存在一儲存媒體上。該儲存媒體可係一非暫時性儲存媒體。The computer program can be stored on a storage medium. The storage medium can be a non-temporary storage medium.

該設備具有標籤檢查電路系統,其用以回應於一經標籤檢查記憶體存取指令而執行一標籤檢查,該經標籤檢查記憶體存取指令指定用於定義對應於與在一記憶體系統中儲存的一分配標籤相關聯的一資料項的一目標資料位址的一位址運算元。該標籤檢查包含回應於偵測到在從該記憶體系統獲得的用於該目標資料位址的該分配標籤與同該位址運算元相關聯的一位址標籤之間的一標籤失配而觸發一錯誤處置回應。錯誤處置回應可以包括例如拒絕記憶體存取(例如,回應於未通過標籤檢查的記憶體存取指令而傳訊錯誤),及/或記錄有關所偵測的標籤失配錯誤的資訊(例如,更新錯誤日誌以識別偵測到標籤失配的目標資料位址)。當偵測到標籤失配時,沒有必要阻止記憶體存取繼續進行(例如,在一些情況中,標籤檢查的目的可能僅僅係產生報告,用於向軟體開發人員標記可能的記憶體使用錯誤,而不一定要求阻止存取記憶體中的底層資料)。儘管如此,藉由提供用於向記憶體系統中儲存的資料項指派分配標籤,且向用以計算此類資料項的位址的位址運算元指派位址標籤的架構支援,且當執行經標籤檢查記憶體存取指令時比較分配標籤及位址標籤,此可以輔助軟體開發人員開發更強大的程式碼,該程式碼較不可能導致錯誤或由攻擊者破壞。The device has a tag checking circuitry system for performing a tag check in response to a tag-checked memory access instruction, which specifies an address operator for defining a target data address corresponding to a data item associated with an allocation tag stored in a memory system. The tag check includes a response to triggering an error handling response upon detecting a tag mismatch between the allocation tag obtained from the memory system for the target data address and the address tag associated with the address operator. Error handling responses may include, for example, denying memory access (e.g., responding to a memory access instruction that failed tag checking and signaling an error), and/or logging information about the detected tag mismatch error (e.g., updating the error log to identify the target data address where a tag mismatch was detected). When a tag mismatch is detected, it is not necessary to prevent memory access from continuing (e.g., in some cases, the purpose of tag checking may only be to generate a report to flag a possible memory usage error to software developers, and not necessarily to require blocking access to underlying data in memory). Nevertheless, by providing architectural support for assigning allocation tags to data items stored in the memory system and assigning address tags to address operators used to calculate the address of such data items, and by comparing allocation tags and address tags when executing tag-checked memory access instructions, this can help software developers develop more robust code that is less likely to lead to errors or be compromised by attackers.

位址轉譯電路系統根據與至少一個位址轉譯階段相關聯的位址映射資訊執行位址轉譯,該至少一個位址轉譯階段包括從一第一位址空間至一第二位址空間的一給定位址轉譯階段。在一些實例中,位址轉譯電路系統支援用於給定位址轉譯階段的不同標籤轉譯模式,以用於當處理標籤存取指令時使用,該標籤存取指令指定給定資料位址且請求使用與對應於給定資料位址的給定資料項相關聯的給定分配標籤來執行操作。標籤存取指令可以係經標籤檢查記憶體存取指令,對於該經標籤檢查記憶體存取指令,使用給定分配標籤執行的操作係由標籤檢查電路系統執行的標籤檢查,用以將給定分配標籤與同用以計算給定資料位址的位址運算元相關聯的位址標籤進行比較,且該經標籤檢查記憶體存取指令亦請求對給定資料項進行讀取或寫入記憶體存取。替代地,標籤存取指令可以係標籤讀取/寫入指令,用以讀取或寫入與對應於給定資料位址的某個資料項區塊相關聯的分配標籤的值(此一標籤讀取/寫入指令可能不需要存取給定資料項本身)。因此,標籤存取指令可以係需要待使用與給定資料位址處的給定資料項相關聯的分配標籤來執行操作的任何指令。給定資料項本身不必回應於標籤存取指令而存取。The address translation circuit system performs address translation based on address mapping information associated with at least one address translation stage, which includes a given address translation stage from a first address space to a second address space. In some embodiments, the address translation circuit system supports different label translation modes for the given address translation stage for use when processing label access instructions that specify a given data address and request to perform an operation using a given allocation label associated with a given data item corresponding to the given data address. Tag access instructions can be tag-checked memory access instructions. For such tag-checked memory access instructions, the operation performed using a given allocation tag is a tag check performed by the tag checking circuit system. This check compares the given allocation tag with the address tag associated with the address operand used to calculate the given data address. The tag-checked memory access instruction also requests a read or write access to the given data item. Alternatively, tag access instructions can be tag read/write instructions, used to read or write the value of the allocation tag associated with a data item block corresponding to a given data address (this tag read/write instruction may not require access to the given data item itself). Therefore, a tag access instruction can be any instruction that requires the use of an allocation tag associated with a given data item at a given data address to perform an operation. The given data item itself does not need to respond to a tag access instruction for access.

當回應於該標籤存取指令而執行該給定位址轉譯階段時,位址轉譯電路系統可判定一第一標籤轉譯模式亦或一第二標籤轉譯模式係待用於回應於該標籤存取指令的該給定位址轉譯階段的一經選擇標籤轉譯模式。該位址轉譯電路系統回應於判定該經選擇標籤轉譯模式係該第一標籤轉譯模式而獲得一資料定位第二位址,該資料定位第二位址識別該給定資料項及該給定分配標籤二者在該第二位址空間內的一位置。該位址轉譯電路系統回應於判定該經選擇標籤轉譯模式係該第二標籤轉譯模式而獲得一標籤定位第二位址,該標籤定位第二位址識別該給定分配標籤在該第二位址空間內的一位置,該位置與由該資料定位第二位址識別的該給定資料項在該第二位址空間中的一位置分開。在根據第二標籤轉譯模式獲得標籤定位第二位址的情況中,若標籤存取指令不需要存取給定資料項,則資料定位第二位址本身不必回應於標籤存取指令而獲得。When the given address translation stage is executed in response to the tag access instruction, the address translation circuit system can determine whether a first tag translation mode or a second tag translation mode is a selected tag translation mode to be used in the given address translation stage in response to the tag access instruction. The address translation circuit system, in response to determining that the selected tag translation mode is the first tag translation mode, obtains a data location second address, which identifies a position of both the given data item and the given allocation tag within the second address space. The address translation circuit system responds by determining that the selected label translation mode is the second label translation mode and obtaining a label positioning second address. This label positioning second address identifies a location within the second address space where the given allocation label is located, separate from a location within the second address space identified by the data positioning second address. In the case where the label positioning second address is obtained according to the second label translation mode, if the label access instruction does not require access to the given data item, the data positioning second address itself does not need to be obtained in response to the label access instruction.

利用此方法,位址轉譯電路系統在判定如何將分配標籤與其等對應的資料項相關聯方面支援更大的靈活性。若選擇第一標籤轉譯模式,則給定資料項及其相關聯的分配標籤二者皆映射至第二位址空間內的相同位址(基於對資料項的存取及對其相關聯的分配標籤的存取共同使用的位址映射資訊的項)。若對所有位址轉譯階段皆使用第一標籤轉譯模式,則相同的實體位址可用以識別給定資料項及給定分配標籤二者在實體位址空間中的位置,且其可留給記憶體系統來實施用於定位與由實體位址空間識別的給定資料項相關聯的分配標籤的技術。例如,記憶體系統可以提供實體儲存,用於在各資料位置旁邊儲存分配標籤──例如,使用原本用於錯誤校正碼或其他資訊的備用位元,或替代地記憶體系統可以劃分出其實體儲存的部分來用於保留與其實體儲存的另一部分中的資料項相關聯的分配標籤。用以管理在記憶體系統中的資料項與標籤之間的關聯的具體機制可係實施方案相關的,且與由位址轉譯電路系統提供的位址轉譯機制分開。雖然此方法可簡化軟體開發(因為不需要軟體來控制位址轉譯表結構以提供用於分別轉譯資料項及相關聯的分配標籤的位址的分開的位址映射資訊),但提供指定(designate)分配標籤儲存並且將彼等分配標籤的位置與對應項相關聯的方式可給記憶體系統硬體的設計人員帶來更大的負擔。Using this method, the address translation circuit system supports greater flexibility in determining how to associate allocation tags with their corresponding data items. If the first tag translation mode is selected, both the given data item and its associated allocation tag are mapped to the same address in the second address space (based on the address mapping information shared by access to the data item and access to its associated allocation tag). If the first tag translation mode is used for all address translation stages, the same physical address can be used to identify the location of both the given data item and the given allocation tag in the physical address space, and it can be left to the memory system to implement techniques for locating the allocation tag associated with the given data item identified by the physical address space. For example, a memory system can provide physical storage for storing allocation tags alongside each data location—for example, using spare bits originally used for error correction codes or other information, or alternatively, the memory system can partition off portions of its physical storage to hold allocation tags associated with data items in another portion of its physical storage. The specific mechanisms used to manage the association between data items and tags in the memory system may be implementation-specific and separate from the address translation mechanisms provided by the address translation circuit system. While this approach simplifies software development (because it eliminates the need for software to control the address translation table structure to provide separate address mapping information for translating data items and associated allocation tags), it places a greater burden on memory system hardware designers by providing a way to store designated allocation tags and associate the location of those allocation tags with corresponding items.

另一方面,若選擇第二轉譯模式用於給定的位址轉譯模式,則給定分配標籤可映射至第二位址空間中的位址,該位址與識別對應資料項的位置的位址分開。此允許將資料項及其相關聯的分配標籤映射至不同實體位址,使得從記憶體系統的角度來看,其不需要管理任何具體的標籤存取機制(例如,指定永久保留用於儲存分配標籤的實體儲存),因為當需要存取標籤及資料二者時,記憶體系統可以簡單地發送二個記憶體存取請求──一者用於標籤定位實體位址(取決於標籤定位第二位址),且另一者用於資料定位實體位址(取決於資料定位第二位址)。藉由支援用於識別標籤定位第二位址的標籤定位位址轉譯(與用以識別資料定位第二位址的資料定位位址轉譯分開)來虛擬化標籤的位置,亦可以有助於增加可用實體記憶體儲存的使用效率,因為並非映射至給定資料位址空間中的標籤位址的每一個分配標籤皆必要地需要係實體位址空間中的分配的實體記憶體,且虛擬化方法實現以下選項:將與待指派相同分配標籤值的不同資料項相關聯的分配標籤的標籤定位位址映射至相同的轉譯標籤定位位址上,以減少為給定數目的資料項提供標籤儲存所需的記憶體中的實體儲存位置的數目。On the other hand, if the second translation mode is selected for a given address translation mode, the given allocation tag can be mapped to an address in the second address space, which is separate from the address that identifies the location of the corresponding data item. This allows data items and their associated allocation tags to be mapped to different physical addresses, so that from the perspective of the memory system, it does not need to manage any specific tag access mechanism (e.g., specifying a permanent physical storage for storing allocation tags), because when both tags and data need to be accessed, the memory system can simply send two memory access requests—one for the tag-location physical address (depending on the tag-location second address) and the other for the data-location physical address (depending on the data-location second address). Virtualizing the location of tags by supporting tag location address translation for identifying the second address of the tag (separate from data location address translation for identifying the second address of the data) can also help increase the efficiency of available physical memory storage. This is because not every allocation tag mapped to a tag address in a given data address space necessarily needs to be allocated physical memory in the physical address space, and the virtualization method implements the following option: mapping the tag location addresses of allocation tags associated with different data items to be assigned the same allocation tag value to the same translated tag location address to reduce the number of physical storage locations in memory required to provide tag storage for a given number of data items.

因此,藉由提供支援在第一標籤轉譯模式與第二標籤轉譯模式之間進行選擇的能力的位址轉譯電路系統,此可以允許識別與特定資料項相關聯的分配標籤的位置的任務係在於軟體(在設定相關位址轉譯映射控制時)亦或在於記憶體系統的硬體(若軟體所選擇擇以將標籤/資料映射至相同實體位址)的組態,而允許平衡維持標籤位址轉譯映射的降低複雜性(在第一標籤轉譯模式下)相對於可用實體記憶體儲存的更高效使用(在第二標籤轉譯模式下)的不同權衡選項。因此,支援第一及第二標籤轉譯模式二者的處理器架構可以更好地平衡各種各樣的工作負載的需求。Therefore, by providing an address translation circuit system that supports selection between a first label translation mode and a second label translation mode, this allows for the identification of whether the task of identifying the location of an assigned label associated with a specific data item lies in the software (when setting the relevant address translation mapping controls) or in the hardware of the memory system (if the software chooses to map the label/data to the same physical address). This allows for a balance between the reduced complexity of maintaining label address translation mapping (in the first label translation mode) and the more efficient use of available physical memory storage (in the second label translation mode). Consequently, processor architectures supporting both the first and second label translation modes can better balance the demands of a wide variety of workloads.

每一次執行標籤存取指令時,給定位址轉譯階段不必基於第一或第二標籤轉譯模式執行。位址轉譯電路系統可具有至少一個轉譯後備緩衝器(translation lookaside buffer, TLB),該至少一個轉譯後備緩衝器可以快取衍生自針對給定目標位址執行給定位址轉譯階段的先前實例的資訊。若識別標籤定位第二位址(或衍生自標籤定位第二位址的實體位址,若標籤定位第二位址本身將需要進一步轉譯成實體位址)的資訊已經在轉譯後備緩衝器中可用,則將不必再次執行給定位址轉譯階段。再者,如下文描述,在一些實例中,至少當第二標籤轉譯模式將用於給定位址轉譯階段且標籤存取指令係亦需要存取給定資料項的經標籤檢查記憶體存取指令時,是否在架構上執行標籤轉譯以用於獲得標籤定位第二位址可以取決於在資料轉譯操作中獲得的屬性,該資料轉譯操作用於獲得對應於給定資料位址的資料定位第二位址。Each time a tag access instruction is executed, the assigned address translation stage does not need to be executed based on the first or second tag translation mode. The address translation circuit system may have at least one translation lookaside buffer (TLB) that caches information derived from a previous instance of executing the assigned address translation stage for a given target address. If information identifying a tag that positions a second address (or a physical address derived from a tag that positions a second address, if the tag that positions a second address itself will require further translation to a physical address) is already available in the translation lookaside buffer, the assigned address translation stage does not need to be executed again. Furthermore, as described below, in some instances, at least when a second label translation mode is to be used for a given address translation phase and the label access instruction is also a label-checked memory access instruction that needs to access a given data item, whether label translation is performed on the architecture to obtain the second address of the label location may depend on the attributes obtained in the data translation operation used to obtain the second address of the data location corresponding to the given data address.

在一些實例中,位址轉譯電路系統可支援二階段轉譯體系,其中位址轉譯基於從虛擬位址空間至中間位址空間的第一位址轉譯階段及從中間位址空間至實體位址空間的第二位址轉譯階段來執行。此可以有助於支援虛擬化,其中多個客戶作業系統(各自負責設定第一位址轉譯階段的位址映射)可能共存於相同的硬體平台上,且因此超管理器可控制第二位址轉譯階段的位址映射,以確保基於由不同客戶作業系統設定的映射獲得的中間位址空間中的衝突中間位址可以映射至實體位址空間中的不同實體位址。In some implementations, address translation circuitry can support a two-stage translation system, where address translation is performed based on a first address translation stage from the virtual address space to the intermediate address space and a second address translation stage from the intermediate address space to the physical address space. This can facilitate virtualization where multiple client operating systems (each responsible for setting the address mappings for the first address translation stage) may coexist on the same hardware platform, and thus the hypervisor can control the address mappings for the second address translation stage to ensure that conflicting intermediate addresses in the intermediate address space obtained based on mappings set by different client operating systems can be mapped to different physical addresses in the physical address space.

在支援二階段轉譯體系的情況下,可以為第一階段(而非第二階段)提供對第一及第二標籤轉譯模式二者的支援,或為第二階段(而非第一階段)提供對第一及第二標籤轉譯模式二者的支援,或為第一及第二位址轉譯階段二者提供第一及第二標籤轉譯模式二者的支援。In the case of supporting a two-stage translation system, support for both the first and second label translation modes can be provided for the first stage (but not the second stage), or support for both the first and second label translation modes can be provided for the second stage (but not the first stage), or support for both the first and second address translation modes can be provided for both the first and second address translation stages.

因此,在一些實例中,該位址轉譯電路系統可在該給定位址轉譯階段係該第一位址轉譯階段時支援使用該第二標籤轉譯模式。在此情況中,該第一位址空間係該虛擬位址空間,且該第二位址空間係該中間位址空間。資料定位第二位址及標籤定位第二位址可在此情況中經受第二位址轉譯階段中的進一步轉譯,以在實體位址空間中獲得對應的資料定位實體位址及標籤定位實體位址。因此,在第一與第二標籤轉譯模式之間進行選擇的模式控制影響給定資料項及給定分配標籤是否映射至中間位址空間中的分開的位址。彼等分開的中間位址可取決於在分開的第一階段位址轉譯表條目(entry)中分別為資料項(item)及其相關聯的分配標籤定義的分開的位址映射資訊。Therefore, in some embodiments, the address translation circuit system can support the use of the second label translation mode when the given address translation stage is the first address translation stage. In this case, the first address space is the virtual address space, and the second address space is the intermediate address space. The data location second address and the label location second address can undergo further translation in the second address translation stage in this case to obtain the corresponding data location physical address and label location physical address in the physical address space. Therefore, the mode control that selects between the first and second label translation modes affects whether a given data item and a given allocation label are mapped to separate addresses in the intermediate address space. The separate intermediate addresses may depend on the separate address mapping information defined in the separate first-stage address translation table entries as data items and their associated allocation tags.

在一些實例中,該位址轉譯電路系統可在該給定位址轉譯階段係該第二位址轉譯階段時支援使用該第二標籤轉譯模式,其中該第一位址空間係該中間位址空間,且該第二位址空間係該實體位址空間。在此情況中,資料定位第二位址係資料定位實體位址且標籤定位第二位址係標籤定位實體位址。因此,用於在第一與第二標籤轉譯模式之間進行選擇的模式控制影響給定資料項及給定分配標籤是否映射至實體位址空間中的分開的位址,其係在位址轉譯中基於在分開的第二階段位址轉譯條目中分別為資料及分配標籤定義的分開的位址映射資訊來判定的。彼等分開的第二階段位址轉譯條目可基於取決於資料定位第一位址的資訊來選擇,該資料定位第一位址識別給定資料項在第一(中間)位址空間內的位置,其中資料定位第一位址係藉由根據第一位址轉譯階段轉譯給定(虛擬)資料位址獲得的。In some instances, the address translation circuit system may support the use of the second label translation mode when the given address translation stage is the second address translation stage, wherein the first address space is the intermediate address space and the second address space is the physical address space. In this case, the data-located second address is the data-located physical address and the label-located second address is the label-located physical address. Therefore, the mode control used to select between the first and second label translation modes affects whether a given data item and a given allocation label are mapped to separate addresses in the physical address space, which is determined in the address translation based on the separate address mapping information defined for data and allocation labels respectively in the separate second-stage address translation entries. The separate second-stage address translation entries can be selected based on information from the first data location address, which identifies the position of the given data item in the first (intermediate) address space, wherein the first data location address is obtained by translating the given (virtual) data address based on the first address translation stage.

該位址轉譯電路系統可基於標籤轉譯控制資訊來選擇該經選擇之標籤轉譯模式,該標籤轉譯控制資訊可組態以控制哪種標籤轉譯模式係用於該給定位址轉譯階段的該經選擇標籤轉譯模式。因此,雖然位址轉譯電路系統的硬體支援兩種模式,但組態設定可選擇哪種模式待用於針對給定標籤存取指令執行給定階段位址轉譯的給定實例。The address translation circuit system can select the selected label translation mode based on label translation control information, which can be configured to control which label translation mode is used for the selected label translation mode in the given address translation stage. Therefore, although the hardware of the address translation circuit system supports two modes, the configuration settings can select which mode is used for a given instance of performing address translation for a given stage for a given label access instruction.

在一些實例中,標籤轉譯控制資訊可以係針對其中實施位址轉譯電路系統的給定處理系統固定的靜態組態輸入。例如,包含位址轉譯電路系統的處理器的相同設計可與各種不同的記憶體儲存硬體一起使用,且一些記憶體儲存單元可能不支援特定於標籤的存取機制(使得當位址轉譯電路系統與彼類型的記憶體儲存單元結合使用時,限制位址轉譯電路系統將第二標籤轉譯模式使用於至少一個位址轉譯階段可能係有益的)。In some instances, tag translation control information can be a static configuration input fixed to a given processing system that implements the address translation circuitry. For example, the same design of a processor containing the address translation circuitry can be used with a variety of different memory storage hardware, and some memory storage units may not support tag-specific access mechanisms (making it potentially beneficial to restrict the address translation circuitry to use a second tag translation mode for at least one address translation stage when the address translation circuitry is used in conjunction with that type of memory storage unit).

然而,在一些實例中,標籤轉譯控制資訊可以包括軟體可組態的組態輸入,其可以由在資料處理系統上運行的軟體設定。例如,標籤轉譯控制資訊可包含至少一些軟體可存取的控制暫存器中指定的資訊(例如,以給定特權等級執行的軟體──特權較低的軟體可能不能夠設定控制暫存器中指示的資訊)。此實現對特定軟體工作負載是否將利用根據第一或第二標籤轉譯模式控制的其標籤存取來執行的更大動態控制。However, in some instances, label translation control information may include software-configurable configuration inputs that can be set by software running on the data processing system. For example, label translation control information may contain information specified in at least some software-accessible control registers (e.g., software executing at a given privilege level—software with lower privileges may not be able to set the information indicated in the control registers). This implementation provides greater dynamic control over whether a particular software workload will utilize its label access controlled according to a first or second label translation mode.

該標籤轉譯控制資訊可包含一第一階段標籤轉譯模式指示符,該第一階段標籤轉譯模式指示符指示至少對於一第一類別標籤存取指令應使用該第一標籤轉譯模式亦或該第二標籤轉譯模式作為用於一第一位址轉譯階段的該經選擇標籤轉譯模式,對於該第一位址轉譯階段,該第一位址空間係一虛擬位址空間,且該第二位址空間係一中間位址空間。因此,當給定位址轉譯階段係第一位址轉譯階段時,第一階段標籤轉譯模式指示符可用以控制使用哪種標籤轉譯模式。The label translation control information may include a first-stage label translation mode indicator, which indicates whether either the first label translation mode or the second label translation mode should be used as the selected label translation mode for a first-address translation stage, at least for a first-class label access instruction. For the first-address translation stage, the first address space is a virtual address space, and the second address space is an intermediate address space. Therefore, when the given address translation stage is a first-address translation stage, the first-stage label translation mode indicator can be used to control which label translation mode is used.

給定對第一及第二標籤轉譯模式的支援,可以存在不同方式,其中給定輸入位址可以在給定位址轉譯階段中轉譯:在該第一標籤轉譯模式下,該位址轉譯電路系統基於根據一資料位址轉譯操作而處理一輸入位址來獲得該資料定位第二位址,且在該第二標籤轉譯模式下,該位址轉譯電路系統基於根據一標籤位址轉譯操作而處理一輸入位址來獲得該標籤定位第二位址。資料位址轉譯操作及標籤位址轉譯操作可以不同的方式處理輸入位址(例如,基於不同的轉譯表基底位址,或藉由在輸入位址與用以查找轉譯表結構的位址之間應用不同映射)。Support for the first and second label translation modes can exist in different ways, wherein a given input address can be translated in a given address translation stage: in the first label translation mode, the address translation circuit system processes an input address based on a data address translation operation to obtain the data address second address, and in the second label translation mode, the address translation circuit system processes an input address based on a label address translation operation to obtain the label address second address. The data address translation operation and the label address translation operation can process the input address in different ways (e.g., based on different translation table base addresses, or by applying different mappings between the input address and the address used to look up the translation table structure).

因此,當第一階段標籤轉譯模式指示符指示第二標籤轉譯模式應係從虛擬位址空間至中間位址空間的第一階段位址轉譯的經選擇標籤轉譯模式時,一種方法可以係對儲存的分配標籤的所有存取皆使用標籤位址轉譯操作來識別第二(中間)位址空間中儲存所需分配標籤的位址。Therefore, when the first-stage label translation mode indicator indicates that the second label translation mode should be the selected label translation mode of the first-stage address translation from the virtual address space to the intermediate address space, one approach is to use label address translation operations for all accesses to the stored allocation labels to identify the address in the second (intermediate) address space where the required allocation label is stored.

然而,提供一種類型的指令亦可以係有用的,該種類型的指令將資料位址轉譯操作應用於用以識別一或多個感興趣的分配標籤的位址,即使當標籤存取指令將在第二標籤轉譯模式下應用標籤位址轉譯操作時。因此,在一些實例中,當針對一主體標籤讀取/寫入指令執行該第一位址轉譯階段以請求讀取或寫入使用由該主體標籤讀取/寫入指令指定的一主體標籤目標位址識別的一或多個分配標籤時,該位址轉譯電路系統可基於取決於該主體標籤目標位址將該資料位址轉譯操作應用於一輸入位址來獲得該第二位址空間中的一標籤讀取/寫入目標第二位址,即使當該第一階段標籤轉譯模式指示符指示應使用該第二標籤轉譯模式作為用於回應於該標籤存取指令的該第一位址轉譯階段的該經選擇標籤轉譯模式。因此,主體標籤讀取/寫入指令直接指定識別一或多個分配標籤的位置的位址,而非藉由指定對應資料項的位址來間接指定,且出於位址轉譯的目的,行為類似於根本不需要存取任何分配標籤的非經標籤檢查資料存取指令。例如,如同其等係資料項一般存取分配標籤的此類主體標籤讀取/寫入指令可以用於超管理器以允許超管理器控制由客戶作業系統使用的分配標籤的值。However, it may also be useful to provide a type of instruction that applies data address translation operations to identify the addresses of one or more allocation tags of interest, even when the tag access instruction applies the tag address translation operation in a second tag translation mode. Therefore, in some instances, when the first address translation phase is executed in response to a subject tag read/write instruction to request the read or write of one or more assigned tags identified using a subject tag target address specified by the subject tag read/write instruction, the address translation circuit system may apply the data address translation operation to an input address based on the subject tag target address to obtain a tag read/write target second address in the second address space, even when the first-stage tag translation mode indicator indicates that the second tag translation mode should be used as the selected tag translation mode for the first address translation phase in response to the tag access instruction. Therefore, subject tag read/write instructions directly specify the address that identifies the location of one or more allocation tags, rather than indirectly specifying them by specifying the address of the corresponding data item. For address translation purposes, their behavior is similar to non-tag-checked data access instructions that do not require access to any allocation tags at all. For example, such subject tag read/write instructions that access allocation tags as if they were their equivalent data items can be used by the super manager to allow the super manager to control the values of allocation tags used by the client operating system.

可在將會允許執行該標籤存取指令的至少一個特權等級中禁止執行該主體標籤讀取/寫入指令。此可以降低由較低特權碼篡改分配標籤的可能性,且反映出主體標籤讀取/寫入指令的常見使用情況可能係藉由具有足夠特權以允許執行主體標籤讀取/寫入指令的超管理器。The execution of a subject label read/write command can be disabled at at least one privilege level that would otherwise allow the execution of such a command. This reduces the likelihood of the assigned label being tampered with by a lower privilege code and reflects the common use case of subject label read/write commands, which may be achieved by a supermanager with sufficient privileges to allow the execution of such commands.

對於支援將該第二標籤轉譯模式使用於該第二位址轉譯階段的一些實例(其中該第一位址空間係該中間位址空間,且該第二位址空間係該實體位址空間),該標籤轉譯控制資訊亦可包含一第二階段標籤轉譯模式指示符,該第二階段標籤轉譯模式指示符指示當該第一階段標籤轉譯模式指示符指示該經選擇標籤轉譯模式係用於該第一位址轉譯階段的該第一標籤轉譯模式時,應使用該標籤轉譯模式亦或該第二標籤轉譯模式作為用於該第二位址轉譯階段的該經選擇標籤轉譯模式。此允許超管理器選擇將虛擬化的記憶體標籤(其中不同的位址轉譯映射應用於資料及一相關聯的分配標籤)將應用於給定客戶作業系統的第二階段轉譯,即使彼客戶作業系統尚未經設計以支援第一位址轉譯階段處的虛擬化標籤。藉由避免記憶體系統必須劃分出永久的實體記憶體區域來儲存標籤,此可以再次幫助支援更高效地利用實體記憶體儲存。For some instances that support the use of the second label translation mode in the second address translation stage (where the first address space is the intermediate address space and the second address space is the physical address space), the label translation control information may also include a second-stage label translation mode indicator, which indicates that when the first-stage label translation mode indicator indicates that the selected label translation mode is used for the first address translation stage, either the first label translation mode or the second label translation mode should be used as the selected label translation mode for the second address translation stage. This allows the hypervisor to select which virtualized memory tags (where different address translation maps are applied to the data and an associated allocation tag) will be applied to the second-stage translation of a given client operating system, even if that client operating system is not yet designed to support virtualized tags at the first address translation stage. By avoiding the memory system having to allocate permanent physical memory regions to store the tags, this further helps to support more efficient use of physical memory storage.

當第一階段標籤轉譯模式指示符具有指示第一標籤轉譯模式將用於第一位址轉譯階段的值時,第二階段標籤轉譯模式指示符影響哪種標籤轉譯模式用於第二位址轉譯階段。然而,當第一階段標籤轉譯模式指示符指示第二標籤轉譯模式將用於第一位址轉譯階段時,亦將第二標籤轉譯模式應用於第二位址轉譯階段可能係非所欲的,因為此可能存在不可預測結果的風險,其中從第一位址轉譯階段出現的資料/標籤定位第二位址經分離地視為各自映射至第二位址轉譯階段處的分開的資料/標籤位址。因此,為了減少管理此類不可預測的位址轉譯映射的軟體負擔,以下情況可以係有用的:回應於判定該第一階段標籤轉譯模式指示符指示該經選擇標籤轉譯模式係用於該第一位址轉譯階段的該第二標籤轉譯模式,該位址轉譯電路系統判定應使用該第一標籤轉譯模式作為用於該第二位址轉譯階段的該經選擇標籤轉譯模式(與針對該第二階段標籤轉譯模式指示符設定的值無關)。When the first-stage label translation mode indicator has a value indicating that the first label translation mode will be used in the first address translation stage, the second-stage label translation mode indicator affects which label translation mode is used in the second address translation stage. However, when the first-stage label translation mode indicator indicates that the second label translation mode will be used in the first address translation stage, it may be undesirable to also apply the second label translation mode to the second address translation stage, as this may involve unpredictable results where the data/labels from the first address translation stage that locate the second address are treated separately as separate data/label addresses mapped to the second address translation stage. Therefore, to reduce the software burden of managing such unpredictable address translation mappings, the following can be useful: In response to the determination that the first-stage label translation mode indicator indicates that the selected label translation mode is used for the second label translation mode of the first address translation stage, the address translation circuit system determines that the first label translation mode should be used as the selected label translation mode for the second address translation stage (regardless of the value set for the second-stage label translation mode indicator).

當經選擇標籤轉譯模式係第二標籤轉譯模式時,可以存在數個不同的方式以可以產生標籤定位第二位址。When the selected label translation mode is the second label translation mode, there are several different ways to generate a label location second address.

在一些實例中,當回應於該標籤存取指令而執行該給定位址轉譯階段時,當該經選擇標籤轉譯模式係用於該給定位址轉譯階段的該第二標籤轉譯模式時,該位址轉譯電路系統可基於識別該給定資料項在該第一位址空間中的一位置的一資料定位第一位址,獲得識別該給定分配標籤在該第一位址空間中的一位置的一標籤定位第一位址,且接著藉由根據位址映射資訊轉譯該標籤定位第一位址來獲得該標籤定位第二位址,該位址映射資訊係基於該標籤定位第一位址從一給定階段轉譯表結構選擇的,該給定階段轉譯表結構係基於一給定轉譯表基底位址識別的。因此,前文提及的標籤位址轉譯操作可包含變換資料定位第一位址以產生表示給定分配標籤在第一位址空間中的位置的不同標籤定位第一位址,且接著使用經獲得的標籤定位第一位址來選擇給定階段轉譯表結構的條目,該條目提供至標籤定位第二位址的位址映射。此方法可以簡化維持轉譯表結構的軟體管理負擔,因為由軟體維持的單一轉譯表結構可以為資料位址轉譯操作及標籤位址轉譯操作二者共用。In some instances, when the given address translation phase is executed in response to a tag access instruction, and when the selected tag translation mode is the second tag translation mode used for the given address translation phase, the address translation circuit system can obtain the given allocation tag by identifying the first address of a data location in the first address space based on recognizing a location of the given data item. A label is assigned a first address at a location in the first address space, and then a second label is obtained by translating the first label address according to address mapping information selected from a given stage translation table structure based on the first label address, the given stage translation table structure being based on a given translation table base address identification. Therefore, the aforementioned label address translation operation may include transforming the first data address to generate different first label addresses representing the location of a given assigned label in the first address space, and then using the obtained first label address to select an entry in a given stage translation table structure that provides an address mapping to the second label address. This method simplifies the software management burden of maintaining the translation table structure because the single translation table structure maintained by the software can be used for both data address translation operations and label address translation operations.

利用此方法,當回應於該標籤存取指令而執行該給定位址轉譯階段時,當該經選擇標籤轉譯模式係用於該給定位址轉譯階段的該第一標籤轉譯模式時,該位址轉譯電路系統可藉由根據位址映射資訊轉譯該資料定位第一位址來獲得該資料定位第二位址,該位址映射資訊係基於該資料定位第一位址從該給定階段轉譯表結構選擇的,該給定階段轉譯表結構係基於該給定轉譯表基底位址識別的。因此,無論標籤位址轉譯操作在第二標籤轉譯模式下執行亦或資料位址轉譯操作在第一標籤轉譯模式下執行(或者在針對前文提及的主體標籤讀取/寫入指令執行資料位址轉譯操作的情況下),可以使用相同的轉譯表基底位址。Using this method, when the given address translation stage is executed in response to the tag access instruction, and when the selected tag translation mode is the first tag translation mode for the given address translation stage, the address translation circuit system can obtain the second address of the data location by translating the first address of the data location according to the address mapping information, wherein the address mapping information is selected from the given stage translation table structure based on the first address of the data location, and the given stage translation table structure is based on the base address identification of the given translation table. Therefore, the same translation table base address can be used regardless of whether the label address translation operation is performed in the second label translation mode or the data address translation operation is performed in the first label translation mode (or in the case of performing a data address translation operation for the subject label read/write command mentioned above).

在該第二標籤轉譯模式下,該位址轉譯電路系統可基於以下來獲得該標籤定位第一位址:一標籤表基底位址,其指示在該第一位址空間內指定用於儲存分配標籤的一標籤表區域的一位置;及一標籤表偏移,其衍生自該資料定位第一位址。儘管可以應用資料定位第一位址的其他更複雜的變換來產生標籤定位第一位址,使用資料定位第一位址的部分作為相對於標籤表基底位址應用的偏移可以更簡單地在硬體中實施。In the second tag translation mode, the address translation circuit system can obtain the first address of the tag location based on: a tag table base address indicating a location within the first address space that specifies a tag table region for storing allocated tags; and a tag table offset derived from the first address of the data location. Although other more complex transformations of the first address of the data location can be applied to generate the first address of the tag location, using a portion of the first address of the data location as an offset relative to the tag table base address can be more simply implemented in hardware.

在其他實例中,不同於變換資料定位第一位址以獲得標籤定位第一位址(使得資料及標籤位址轉譯成給定位址轉譯階段提供至表查找的不同第一位址輸入),另一方法可以係使用相同的資料定位第一位址作為用於給定位址轉譯階段的轉譯表查找的輸入位址,但使用彼資料定位第一位址來使用由不同基底位址定義的查找不同轉譯表結構,使得用於資料及標籤存取的分開的轉譯表條目可從各別轉譯表結構識別以將第一位址空間中的相同資料定位第一位址映射至資料定位第二位址並且分開第二位址空間中的標籤定位第二位址。In other examples, instead of transforming the first address of the data location to obtain the first address of the label location (so that the data and label addresses are translated into different first address inputs for the address translation stage to the table lookup), another approach is to use the same first address of the data location as the input address for the translation table lookup in the address translation stage, but use that first address of the data location to use different translation table structures defined by different base addresses, so that the separate translation table entries used for data and label access can be identified from the respective translation table structures to map the same first address of the data location in the first address space to the second address of the data location and separate the second address of the label location in the second address space.

因此,當回應於該標籤存取指令而執行該給定位址轉譯階段時,該位址轉譯電路系統可經組態以使得該位址轉譯電路系統回應於判定該經選擇標籤轉譯模式係該第一標籤轉譯模式而基於位址映射資訊轉譯識別該給定資料項在該第一位址空間中的一位置的一資料定位第一位址來獲得該資料定位第二位址,該位址映射資訊係基於該資料定位第一位址從一資料轉譯表結構選擇的,該資料轉譯表結構係基於一資料轉譯表基底位址識別的。該位址轉譯電路系統回應於判定該經選擇標籤轉譯模式係該第二標籤轉譯模式而藉由基於位址映射資訊轉譯該資料定位第一位址來獲得該標籤定位第二位址,該位址映射資訊係基於該資料定位第一位址從一標籤轉譯表結構選擇的,該標籤轉譯表結構係基於與該資料轉譯表基底位址分開的一標籤轉譯表基底位址識別的。Therefore, when the given address translation stage is executed in response to the tag access instruction, the address translation circuit system can be configured such that the address translation circuit system responds to determining that the selected tag translation mode is the first tag translation mode and, based on address mapping information, identifies a data location first address of the given data item at a location in the first address space to obtain the data location second address. The address mapping information is selected from a data translation table structure based on the data location first address, and the data translation table structure is identified based on a data translation table base address. The address translation circuit system responds by determining that the selected label translation mode is the second label translation mode and obtaining the second address of the label location by translating the first address of the data location based on address mapping information. The address mapping information is selected from a label translation table structure based on the first address of the data location. The label translation table structure is identified based on a label translation table base address that is separate from the base address of the data translation table.

雖然上文實例描述了位址轉譯電路系統選擇應用第一亦或第二標籤轉譯模式來獲得第二位址空間中的位址從而識別與給定資料項相關聯的分配標籤的位置的實施方案,其他實例可以支援第二標籤轉譯模式(虛擬化標籤轉譯模式)來獲得分配標籤的位址,但可能不支援第一標籤轉譯模式。在此情況中,可能不支援實體標籤(其中資料項及其相關聯的分配標籤二者在記憶體中的位置係基於相同的實體位址來識別的)。While the examples above describe an implementation where an address translation circuit system selects to apply either the first or second label translation mode to obtain an address in the second address space and thus identify the location of an allocation tag associated with a given data item, other examples may support the second label translation mode (virtualized label translation mode) to obtain the address of the allocation tag, but may not support the first label translation mode. In this case, entity tags (where the data item and its associated allocation tag are identified in memory based on the same entity address) may not be supported.

無論是否支援實體標籤方法(例如,使用第一標籤轉譯模式),在支援虛擬化標籤轉譯模式(例如,上文描述的第二標籤轉譯模式)的實施方案中,經標籤檢查記憶體存取指令的處理可涉及執行標籤定位位址轉譯操作以獲得標籤定位位址,而對於非經標籤檢查記憶體存取指令可能不需要執行該操作。此可能引入效能成本,因為執行標籤定位位址轉譯操作存在更頻繁的位址轉譯錯誤的風險,若提供所需標籤位址的位址轉譯映射的條目尚未由軟體組態或指示存取權限未通過,則發生對處理效能有害的該等位址轉譯錯誤(在虛擬化標籤轉譯模式的情況下,標籤轉譯可使用與用以獲得對應資料定位位址的條目不同的位址轉譯條目,且因此即使用於獲得資料定位位址的條目已經正確地組態,此不保證標籤轉譯不會產生轉譯錯誤)。因此,雖然在虛擬化標籤轉譯模式中引入此一標籤定位位址轉譯操作可以具有減少對記憶體系統管理與對應資料項相關聯的標籤的位置的依賴(例如,避免需要為標籤劃分出實體記憶體的一部分)的益處,與不執行與對應的資料定位位址轉譯操作分開的標籤定位位址轉譯操作的實施方案相比,虛擬化標籤轉譯模式可能存在損害效能的風險。Regardless of whether physical tagging methods are supported (e.g., using the first tag translation mode), in implementations that support virtualized tag translation modes (e.g., the second tag translation mode described above), processing of tag-checked memory access instructions may involve performing a tag location address translation operation to obtain the tag location address, while this operation may not be necessary for non-tag-checked memory access instructions. This may introduce performance costs because performing tag-location address translation operations carries a higher risk of address translation errors. If the entry providing the address translation mapping for the required tag address has not been configured by the software or indicates that access permissions have not been granted, such address translation errors that are detrimental to processing performance will occur. (In the case of virtualized tag translation mode, tag translation may use address translation entries that are different from those used to obtain the corresponding data location address, and therefore even if the entry used to obtain the data location address has been correctly configured, there is no guarantee that tag translation will not produce translation errors.) Therefore, while introducing this tag location address translation operation in the virtualized tag translation mode can have the benefit of reducing reliance on the location of tags associated with memory system management and corresponding data items (e.g., avoiding the need to partition a portion of physical memory for the tag), the virtualized tag translation mode may risk performance degradation compared to an implementation that does not perform a tag location address translation operation separate from the corresponding data location address translation operation.

在下文論述的實例中,記憶體管理電路系統可基於與該目標資料位址相關聯的記憶體屬性資訊來控制對一經標籤檢查記憶體存取指令的該目標資料位址的存取。該記憶體屬性資訊可指示該目標資料位址是否位於不會需要該標籤檢查的一無標籤記憶體區域中。該記憶體管理電路系統可至少基於與該經標籤檢查記憶體存取指令的該目標資料位址相關聯的該記憶體屬性資訊是否指示該目標資料位址位於該無標籤記憶體區域中,來判定是否在架構上執行一標籤定位位址轉譯操作以獲得在一實體位址空間內定位該相關聯的分配標籤的一標籤定位實體位址(該標籤定位實體位址與在該實體位址空間內定位該目標資料項的一資料定位實體位址分開)。In the examples discussed below, a memory management circuit system may control access to a target data address for a tagged memory access instruction based on memory attribute information associated with that target data address. This memory attribute information may indicate whether the target data address is located in an untagged memory region that would not require tagging. The memory management circuit system may determine whether to perform a tag location address translation operation on the architecture to obtain a tag location entity address that locates the associated allocation tag in a physical address space, based at least on whether the memory attribute information associated with the target data address of the tag-checked memory access instruction indicates that the target data address is located in the untagged memory region. (The tag location entity address is separate from the data location entity address that locates the target data item in the physical address space.)

利用此方法,軟體可以(藉由設定給定位址集合的記憶體屬性資訊)傳訊是否需要對彼等位址的存取進行標籤檢查,且對於不需要標籤檢查的位址區域,可以抑制標籤定位位址轉譯操作在架構上執行,以降低位址轉譯錯誤導致處理中斷的頻率。此可以幫助改進處理效能。Using this method, software can (by setting memory attribute information assigned to a set of addresses) communicate whether tag checks are required for accessing those addresses. Furthermore, for address regions that do not require tag checks, tag-based address translation operations can be suppressed on the architecture, reducing the frequency of processing interruptions caused by address translation errors. This can help improve processing performance.

該記憶體管理電路系統可回應於偵測到該目標資料位址位於該無標籤記憶體區域中而抑制在架構上執行該標籤定位位址轉譯操作。The memory management circuit system can respond by suppressing the tag location address translation operation on the architecture when the target data address is detected to be located in the unlabeled memory area.

當判定是否抑制在架構上執行標籤定位位址轉譯操作時,一些實例亦可以考慮其他因素。When determining whether to suppress tag location address translation operations on the architecture, some cases may also consider other factors.

例如,在一些實例中,記憶體管理電路系統可包含上文提及的位址轉譯電路系統,因此亦可支援如前文提及的第一及第二位址轉譯模式。在此情況中,判定啟用亦或禁用標籤定位位址轉譯操作的架構效能可與第二位址轉譯模式而非第一位址轉譯模式相關。For example, in some implementations, the memory management circuitry may include the address translation circuitry mentioned above, and therefore may also support the first and second address translation modes as described earlier. In this case, the architectural performance for determining whether to enable or disable tag-based address translation operations may be related to the second address translation mode rather than the first address translation mode.

因此,在一些實例中,該記憶體管理電路系統可回應於偵測到至少一個標籤轉譯模式指示符指示禁用一虛擬化標籤轉譯模式而抑制在架構上執行該標籤定位位址轉譯操作,該虛擬化標籤轉譯模式包含一模式,在該模式中,基於對應於該目標資料位址的資料轉譯位址映射資訊來將該目標資料項映射至該資料定位實體位址,且基於對應於該目標資料位址的標籤轉譯位址映射資訊來將該相關聯的分配標籤映射至該標籤定位實體位址,該標籤轉譯位址映射資訊與該資料轉譯位址映射資訊分開。例如,虛擬化標籤轉譯模式可以係前文提及的第二位址轉譯模式(且可以應用於第一位址轉譯階段或第二位址轉譯階段)。取決於實施方案,標籤轉譯位址映射資訊可以出於數個原因與資料轉譯位址映射資訊分開(例如,因為標籤轉譯位址映射資訊及資料轉譯位址映射資訊係從使用不同的轉譯表基底位址存取的轉譯表結構選擇的,或者因為標籤轉譯位址映射資訊及資料轉譯位址映射資訊係基於分別對應於相關聯的標籤及資料項的不同輸入位址從相同的轉譯表結構選擇的)。因此,即使記憶體屬性資訊不指示目標資料位址位於無標籤記憶體區域中,若目前禁用虛擬化標籤,則仍然可以防止在架構上執行標籤定位位址轉譯操作。Therefore, in some instances, the memory management circuit system may respond to detecting at least one tag translation mode indicator indicating that a virtualized tag translation mode is disabled, thereby suppressing the execution of the tag location address translation operation on the architecture. The virtualized tag translation mode includes a mode in which the target data item is mapped to the data location entity address based on data translation address mapping information corresponding to the target data address, and the associated allocation tag is mapped to the tag location entity address based on tag translation address mapping information corresponding to the target data address, wherein the tag translation address mapping information is separate from the data translation address mapping information. For example, the virtualized label translation pattern can be the second address translation pattern mentioned above (and can be applied in either the first or second address translation stage). Depending on the implementation, label translation address mapping information can be separated from data translation address mapping information for several reasons (e.g., because the label translation address mapping information and the data translation address mapping information are selected from translation table structures that use different translation table base address accesses, or because the label translation address mapping information and the data translation address mapping information are selected from the same translation table structure based on different input addresses corresponding to the associated labels and data items, respectively). Therefore, even if memory attribute information does not indicate that the target data address is located in an unlabeled memory region, label location address translation operations can still be prevented on the architecture if virtualization labels are currently disabled.

當禁用該虛擬化標籤轉譯模式時,該記憶體管理電路系統可將該目標資料項及該相關聯的分配標籤二者映射至該資料定位實體位址。此對應於上文描述的第一位址轉譯模式。When the virtualization tag translation mode is disabled, the memory management circuit system can map both the target data item and the associated allocation tag to the data location entity address. This corresponds to the first address translation mode described above.

記憶體屬性資訊亦可支援將目標資料位址指示為在有標籤的記憶體區域中的編碼。在此情況中,是否在架構上執行該標籤定位位址轉譯可取決於是否滿足至少一個進一步的條件(例如,取決於指令類型資訊、及/或取決於控制是否啟用虛擬化標籤轉譯模式的控制指示符)。Memory attribute information can also support indicating the target data address as encoding in a labeled memory region. In this case, whether the label location address translation is performed on the architecture may depend on whether at least one further condition is met (e.g., depending on instruction type information, and/or depending on a control indicator that controls whether virtualization label translation mode is enabled).

例如,滿足該進一步的條件可取決於至少一個標籤轉譯模式指示符,該至少一個標籤轉譯模式指示符指示啟用該虛擬化標籤轉譯模式。當將虛擬化標籤轉譯模式指示為禁用時,即使記憶體屬性資訊指示目標資料位址位於有標籤的記憶體區域中,可能不在架構上執行標籤定位位址轉譯。For example, satisfying this further condition may depend on at least one tag translation mode indicator that indicates the virtualization tag translation mode is enabled. When the virtualization tag translation mode is indicated as disabled, tag location address translation may not be performed on the architecture, even if memory attribute information indicates that the target data address is located in a tagged memory region.

當將在架構上抑制該標籤定位位址轉譯操作時,該記憶體管理電路系統可防止基於該標籤定位位址轉譯操作傳訊任何錯誤。錯誤對於效能而言係高成本的,因為其等可導致正執行的工作負載中斷以允許執行異常處置器。因此,藉由當存取無標籤記憶體區域時防止傳訊標籤定位位址轉譯操作的位址轉譯錯誤,此降低效能損失的可能性。When the tag-based address translation operation is suppressed at the architectural level, the memory management circuitry prevents any errors from being transmitted based on the tag-based address translation operation. Errors are costly in terms of performance because they can cause ongoing workloads to be interrupted to allow the execution of abnormal processors. Therefore, by preventing address translation errors in tag-based address translation operations when accessing untagged memory regions, the possibility of performance loss is reduced.

在一些情況中,當將在架構上抑制該標籤定位位址轉譯操作時,該記憶體管理電路系統可抑制實際上執行該標籤定位位址轉譯操作。因此,標籤定位位址轉譯操作可能根本不進行。此不僅降低虛假位址轉譯錯誤的風險,亦消除執行轉譯的頻寬成本,此可釋放位址轉譯頻寬用於其他轉譯操作。In some cases, when the tag-location address translation operation is suppressed at the architectural level, the memory management circuitry can prevent the actual execution of the tag-location address translation operation. Therefore, the tag-location address translation operation may not occur at all. This not only reduces the risk of spoofed address translation errors but also eliminates the bandwidth cost of performing the translation, freeing up address translation bandwidth for other translation operations.

然而,在一些實施方案中,即使當將在架構上抑制該標籤定位位址轉譯操作時,該記憶體管理電路系統仍然可以允許實際上執行該標籤定位位址轉譯操作,但防止由該標籤定位位址轉譯操作導致的架構狀態的改變,使得架構結果與猶如未執行該標籤定位位址轉譯操作時相同。例如,記憶體管理電路系統可以防止傳訊錯誤、更新在架構上可見的效能計數器、及/或基於已執行但應在架構上抑制的標籤定位位址轉譯操作的結果來觸發記憶體中的讀取/寫入操作。即使在架構上抑制,執行標籤定位位址轉譯可以在一些實施方案中係有用的,因為此可允許標籤定位位址轉譯操作更早開始(在等待與目標資料位址相關聯的記憶體屬性資訊時),而非推遲標籤定位位址轉譯直到檢查記憶體屬性資訊的結果實際上已知為止。再者,在一些情況中,若執行標籤定位位址轉譯導致轉譯表指標作為標籤定位位址轉譯的結果在轉譯後備緩衝器中快取,此可能幫助加速需要相同指標的稍後轉譯(例如,來自多級轉譯表結構中的較高級轉譯表的給定轉譯表指標可能在一些有標籤的記憶體區域與一些無標籤記憶體區域之間共用)。However, in some implementations, even when the tag address translation operation is suppressed at the architectural level, the memory management circuitry can still allow the tag address translation operation to actually be performed, but prevent changes in the architectural state caused by the tag address translation operation from resulting in an architectural outcome identical to that without the tag address translation operation. For example, the memory management circuitry can prevent transmission errors, updates to architecturally visible performance counters, and/or trigger read/write operations in memory based on the results of tag address translation operations that have been performed but should be suppressed at the architectural level. Even with architectural suppression, performing tag-location address translation can be useful in some implementations because it allows the tag-location address translation operation to begin earlier (while waiting for memory attribute information associated with the target data address), rather than delaying the tag-location address translation until the result of checking the memory attribute information is actually known. Furthermore, in some cases, if performing a label-based address translation results in the translation lookup buffer caching the translation table pointer as a result of the label-based address translation, this may help speed up later translations that require the same pointer (for example, a given translation table pointer from a higher-level translation table in a multi-level translation table structure may be shared between some labeled memory regions and some unlabeled memory regions).

在一些實例中,可定義對應於無標籤記憶體區域的專用記憶體屬性類型(或者可定義「無標籤(untagged)」的記憶體屬性的數個變體)。In some instances, a special memory property type corresponding to an untagged memory region can be defined (or several variants of the "untagged" memory property can be defined).

然而,在其他實例中,該記憶體管理電路系統可基於該記憶體屬性資訊的用於指示與該標籤檢查的執行無關的一或多個記憶體區域屬性的一或多個記憶體屬性指示符來推斷該目標資料位址是否位於該無標籤記憶體區域中。轉譯表條目中可用於編碼屬性類型的備用編碼空間可能極其有限,且因此有時可能無法將新的專用屬性類型添加至現有的位址轉譯架構。因此,在一些情況中,可以根據已經提供的其他屬性類型推斷該區域是否已有標籤/無標籤。However, in other instances, the memory management circuit system may infer whether the target data address is located in the unlabeled memory region based on one or more memory attribute indicators of one or more memory region attributes that are unrelated to the execution of the tag check. The spare encoding space available for encoding attribute types in the translation table entries may be extremely limited, and therefore it may sometimes be impossible to add new dedicated attribute types to the existing address translation framework. Therefore, in some cases, it may be possible to infer whether the region is tagged/unlabeled based on other attribute types already provided.

例如,有標籤記憶體區域可經限制為由記憶體屬性資訊指示為正常寫回可快取記憶體區域的區域。「正常(normal)」記憶體區域可能係非裝置記憶體區域,對其允許重複或重新排序對該記憶體區域的存取(與「裝置」記憶體區域不同,對其不允許重複或重新排序對該記憶體區域的存取,因為此可以導致副作用)。例如,裝置記憶體一般可用於緩衝器結構,該等緩衝器結構用以控制諸如輸入/輸出(input/output, I/O)裝置或硬體加速器的裝置,因此與用於隨機存取記憶體資料的記憶體儲存的讀取/寫入不同,多次執行相同的讀取或寫入或相對於發布讀取/寫入請求的次序重新排序執行讀取/寫入的序列可能導致此類裝置不適當地運作。記憶體標籤可能一般用於隨機存取記憶體資料,而非裝置控制結構,因此裝置記憶體中的位址可能藉由預設而被視為無標籤。類似地,非可快取記憶體區域(儲存不需要分配至快取記憶體的位址的區域)不太可能儲存由容易出現記憶體使用錯誤的軟體存取的通用隨機存取記憶體資料,因此非可快取記憶體區域亦可被假設為無標籤。由此,在一些實例中,該記憶體管理電路系統可回應於偵測到該目標資料位址位於除了一正常寫回可快取記憶體區域之外的一區域中而判定該目標資料位址位於該無標籤記憶體區域中。For example, a labeled memory region can be restricted to a region that is indicated by memory property information as a normal write-back cacheable memory region. A "normal" memory region may be a non-device memory region, to which repeated or reordered access to the memory region is permitted (unlike "device" memory regions, to which repeated or reordered access to the memory region is not permitted, as this can lead to side effects). For example, device memory is typically used in buffer structures that control devices such as input/output (I/O) devices or hardware accelerators. Therefore, unlike read/write operations for memory storage used for random access to memory data, repeatedly performing the same read or write operation, or reordering the read/write sequence relative to the order in which read/write requests were issued, can cause such devices to malfunction. Memory tags may generally be used for random access to memory data rather than device control structures; therefore, addresses in device memory may be considered untagged by default. Similarly, non-cacheable memory regions (regions that store addresses that do not need to be allocated to cached memory) are unlikely to store general random access memory data that is accessed by software prone to memory usage errors, and therefore non-cacheable memory regions can also be assumed to be unlabeled. Thus, in some instances, the memory management circuitry system may respond by detecting that the target data address is located in a region other than a normally write-back cacheable memory region and determining that the target data address is located in the unlabeled memory region.

將理解,此僅僅係一個實例,且其他實例可具有使用與經標籤檢查記憶體存取指令的目標資料位址相關聯的記憶體屬性資訊來編碼記憶體區域有標籤亦或無標籤不同方式。It will be understood that this is only one example, and other examples may have different ways of encoding memory regions as tagged or untagged, using memory attribute information associated with the target data address of the tagged memory access instruction.

該記憶體管理電路系統可基於衍生自一資料定位位址轉譯操作中存取的至少一個轉譯表條目的該記憶體屬性資訊,來判定是否在架構上執行該標籤定位位址轉譯操作以用於將該目標資料位址轉譯成該資料定位實體位址。出於識別目標資料項的實體位址的目的,可針對經標籤檢查記憶體存取指令執行資料定位位址轉譯操作,無論標籤定位位址轉譯操作係在架構上執行亦或抑制。因此,藉由使用可從資料定位位址轉譯操作獲得的記憶體屬性資訊來啟用/禁用是否在架構上執行標籤定位位址轉譯操作,此提供了一種易於實施的技術,用於防止可由不必要地執行標籤定位位址轉譯操作產生的不必要錯誤。人們可能認為,基於來自資料定位位址轉譯操作的屬性資訊來啟用/禁用標籤定位位址轉譯操作將係非所欲的,因為在資料定位位址轉譯操作之後執行標籤定位位址轉譯操作可能存在經標籤檢查記憶體存取指令出現不可接受的長延時的風險,尤其係若資料及標籤轉譯二者皆需要轉譯表走訪。然而,在實踐中,由於在架構上抑制執行但不必實際上防止執行標籤定位位址轉譯操作,可能在記憶體屬性資訊可用之前推測性地開始執行標籤定位位址轉譯操作,且若發現標籤定位位址轉譯操作應被抑制,則防止觀察到由推測性地執行的標籤定位位址轉譯操作導致的任何錯誤或其他架構後果。若稍後發現標籤定位位址轉譯操作將在架構上禁用(抑制),則標籤定位位址轉譯操作的任何剩餘部分皆無需完成。The memory management circuit system can determine whether to perform the tag-location address translation operation on the architecture to translate the target data address into the data location entity address based on the memory attribute information derived from at least one translation table entry accessed in a data location address translation operation. For the purpose of identifying the entity address of the target data item, the data location address translation operation can be performed on a tag-checked memory access instruction, whether the tag-location address translation operation is performed on the architecture or suppressed. Therefore, by using memory attribute information obtainable from data location address translation operations (DRCOs) to enable/disable whether tag address translation operations are performed on the architecture, this provides an easy-to-implement technique to prevent unnecessary errors that can result from unnecessarily performing tag address translation operations. One might argue that enabling/disabling tag address translation operations based on attribute information from data address translation operations would be undesirable, as performing tag address translation operations after data address translation operations could result in unacceptably long latency in tag-checked memory access instructions, especially if both data and tag translations require translation table visits. However, in practice, because tag-location-to-address (TAN-TO) operations are suppressed architecturally but not actually prevented from being executed, they may be speculatively initiated before memory attribute information becomes available. This prevents the observation of any errors or other architectural consequences resulting from speculatively executed TAN-TO operations if it is later determined that the TAN-TO operation will be disabled (suppressed) architecturally. Any remaining portion of the TAN-TO operation then does not need to be completed if it is later found that the TAN-TO operation will be disabled (suppressed) architecturally.

在一些實例中,對於一給定位址轉譯階段,該記憶體管理電路系統能夠基於來自一標籤轉譯轉譯表條目的位址映射資訊來執行該標籤定位位址轉譯操作,該標籤轉譯轉譯表條目不同於一資料轉譯轉譯表條目,該資料轉譯轉譯表條目提供用於一資料定位位址轉譯操作中的該給定位址轉譯階段的位址映射資訊,以用於將該目標資料位址轉譯成該資料定位實體位址。如上所述,可以存在導致標籤/資料定位位址轉譯操作使用來自不同轉譯表條目的映射的不同方式(例如,使用對應於分開的標籤/資料轉譯表結構的不同轉譯表基底位址存取此等條目,或者將不同的標籤/資料輸入位址提供至在標籤與資料之間共用的共用轉譯表結構)。給定位址轉譯階段可以係從虛擬位址空間轉譯至中間位址空間的第一位址轉譯階段或從中間位址空間轉譯至實體位址空間的第二位址轉譯階段。In some instances, for a given address translation stage, the memory management circuit system can perform the tag-location address translation operation based on address mapping information from a tag-translation table entry, which is different from a data-translation table entry that provides address mapping information for the given address translation stage in a data-location address translation operation, for translating the target data address into the data-location entity address. As described above, there can be different ways that cause label/data location address translation operations to use mappings from different translation table entries (e.g., accessing these entries using different translation table base addresses corresponding to separate label/data translation table structures, or providing different label/data input addresses to a shared translation table structure shared between labels and data). The given address translation stage can be a first address translation stage translating from virtual address space to intermediate address space, or a second address translation stage translating from intermediate address space to physical address space.

在一些實例中,一種設備包含上文提及的標籤檢查電路系統;標籤定位位址判定電路系統,其用以基於識別一給定資料項在一第一位址空間內的一位置的一資料定位位址來判定識別對應於該給定資料項的該分配標籤在該第一位址空間內的一位置的一標籤定位位址;及位址轉譯電路系統,其用以執行從該第一位址空間至一實體位址空間的至少一個位址轉譯階段。該標籤定位位址判定電路系統可基於相對於一標籤表基底位址的一偏移來判定該標籤定位位址,該標籤表基底位址指示在該第一位址空間內指定用於儲存分配標籤的一標籤表位址區域的一位置,該偏移取決於該資料定位位址的一偏移部分。In some embodiments, an apparatus includes the tag inspection circuit system mentioned above; a tag location address determination circuit system for determining a tag location address corresponding to a given data item in a location within a first address space based on a data location address identifying a location of a given data item in a first address space; and an address translation circuit system for performing at least one address translation stage from the first address space to a physical address space. The tag location address determination circuit system may determine the tag location address based on an offset relative to a tag table base address, the tag table base address indicating a location within the first address space that specifies a tag table address region for storing the assigned tag, the offset depending on an offset portion of the data location address.

因此,在第一位址空間(其將使用一或二個位址轉譯階段來轉譯成實體位址空間)內,識別給定資料項在第一位址空間中的位置的資料定位位址經變換以產生對應的標籤定位位址,該標籤定位位址識別相關聯的分配標籤在第一位址空間中的位置。此變換係在相同位址空間內的二個位址之間(而非從第一位址空間中的位址至第二位址空間中的位址的映射)。Therefore, within the first address space (which will be translated into a physical address space using one or two address translation stages), the data location address that identifies the position of a given data item in the first address space is transformed to produce a corresponding tag location address that identifies the position of the associated allocation tag in the first address space. This transformation is between two addresses within the same address space (rather than a mapping from an address in the first address space to an address in the second address space).

與替代方案(諸如,在與資料位址轉譯表結構分開的標籤位址轉譯表結構中查找資料定位位址)相比,此方法可以簡化用於支援虛擬化標籤的系統的軟體開發,由此此意指資料及標籤轉譯可以共用相同的轉譯表結構。標籤定位位址判定電路系統可以修改資料定位位址以識別標籤定位位址,該標籤定位位址可以接著輸入以用於使用亦用於資料的相同轉譯結構的位址轉譯。Compared to alternatives (such as looking up the data address in a separate tag address translation table structure), this method simplifies software development for systems supporting virtualized tags, meaning that data and tag translations can share the same translation table structure. The tag address determination circuitry can modify the data address to identify the tag address, which can then be input for address translation using the same translation structure also used for data.

再者,與諸如定義資料到標籤位址映射表以提供從第一位址空間的資料定位位址至第一位址空間的對應標籤定位位址的更多任意映射的替代方案相比,基於相對於標籤表基底位址的偏移產生標籤定位位址(其中該偏移取決於資料定位位址的偏移部分)可以降低實施標籤定位位址判定電路系統的硬體成本,且降低用於設定控制資訊以用於控制標籤定位位址產生的軟體的軟體開發成本。Furthermore, compared to alternatives such as defining a data-to-tag address mapping table to provide more arbitrary mappings from data location addresses in the first address space to corresponding tag location addresses in the first address space, generating tag location addresses based on offsets relative to the tag table base address (where the offset depends on the offset portion of the data location address) can reduce the hardware cost of implementing the tag location address determination circuit system and reduce the software development cost of setting control information to control the generation of tag location addresses.

在一些實例中,該標籤定位位址判定電路系統經組態以基於該資料定位位址的與該偏移部分相比較低有效但與該偏移部分相鄰的一或多個位元來判定標籤選擇資訊,該標籤選擇資訊指示在該標籤表位址區域的一相同位址處儲存的複數個分配標籤中之何者係對應於該資料定位位址的該分配標籤。此可以用於各分配標籤包含與對應於記憶體中的單一位址的所儲存資訊的位元數目相比較少的位元的實施方案。例如,對於其中各唯一位址值對應於記憶體中的資料的各別位元組(8位元)的位元組可定址記憶體,分配標籤可包含少於8位元(例如,4位元)。在此情況中,將多個分配標籤包裝到對應於單一位址的記憶體位置中可以係有用的,使得分配標籤可以更緊湊地儲存在記憶體位址空間中。因此,若由記憶體讀取回傳的資料的最小大小對應於單一可定址位置的內容(例如,一個位元組),則從記憶體讀取的分配標籤實際上可回傳多個標籤。為了實現在從記憶體回傳的分配標籤之間進行選擇(且識別哪個標籤實際上與感興趣的資料項相關),標籤定位位址判定電路系統可基於用以衍生偏移的部分的一或多個較低有效(但相鄰)的位元,判定來自資料定位位址的標籤選擇資訊。例如,在分配標籤係4位元寬且各位址指涉1位元組(8位元)記憶體的實例中,在用以衍生偏移的部分之後的下一最低有效位元可以用以在給定位元組的記憶體位址空間中存在的二個分配標籤之間進行選擇。In some embodiments, the tag location address determination circuit system is configured to determine tag selection information based on one or more bits of the data location address that are less significant than the offset portion but adjacent to the offset portion. This tag selection information indicates which of a plurality of allocation tags stored at the same address in the tag table address region corresponds to the allocation tag for the data location address. This can be used in embodiments where each allocation tag contains fewer bits than the number of bits corresponding to the stored information at a single address in memory. For example, for memory addressable where each unique address value corresponds to a separate byte (8 bits) of data in memory, the allocation tag may contain fewer than 8 bits (e.g., 4 bits). In this case, it can be useful to package multiple allocation tags into memory locations corresponding to a single address, allowing the allocation tags to be stored more compactly in the memory address space. Therefore, if the smallest size of the data read back from memory corresponds to the content of a single addressable location (e.g., a byte), then multiple tags can actually be returned from memory. To enable selection among the allocation tags returned from memory (and to identify which tag is actually associated with the data item of interest), the tag location address determination circuitry can determine tag selection information from the data location address based on one or more less significant (but adjacent) bits used to derive the offset. For example, in an instance where the allocation label is 4 bits wide and each address refers to 1 byte (8-bit) of memory, the next least significant bit after the portion used to derive the offset can be used to select between two allocation labels existing in the memory address space of the allocated byte.

其他實例可使用不同的標籤大小。若標籤大小等於一個可定址記憶體位置的大小,則不需要由標籤定位位址判定電路系統衍生標籤選擇資訊,因為對記憶體中的給定位址的讀取可回傳單一分配標籤。Other examples can use different label sizes. If the label size is equal to the size of an addressable memory location, then it is not necessary to derive label selection information from the label location address in the circuit system, because a read of the given address in memory can return a single assigned label.

在一些實例中,該標籤表基底位址包含一對準位址。對準位址可能係與記憶體中的對準邊界自然對準的位址。例如,標籤表基底位址可以顯式或隱式地定義為數個最低有效位元皆係0的位址。藉由使用對準的標籤表基底位址,此可以降低標籤定位位址判定電路系統的複雜性。例如,此意指不需要加法器來組合基底位址與偏移,因為偏移位元可以簡單地藉由插入將對應於對準基底位址中的0的位置中。由於與用於將來自不同來源的位元多工至適當位元位置中的電路系統相比,加法器相對較慢,消除查找標籤位址的位址轉譯的各週期中加法器的成本可以有助於改進效能,且可以使電路設計人員更容易設計出滿足時序要求的電路系統。再者,使用對準基底位址意指需要較少的儲存資訊來定義基底位址,因為較低位元0不需要顯式地儲存。例如,可以從暫存器中儲存的資訊中省略彼等0位元以定義基底位址。替代地,若暫存器確實定義了位址的較低位元,則可以忽略定義基底位址的暫存器的較低位元,使得即使其等經設定為非零值,基底位址仍然係對準位址,其中將數個較低位元設定為0。In some instances, the tag table base address includes a quasi-address. The quasi-address may be an address that naturally aligns with the alignment boundary in memory. For example, the tag table base address can be explicitly or implicitly defined as an address where several least significant bits are all 0. By using a quasi-address base address, the complexity of the tag location address determination circuitry can be reduced. For example, this means that an adder is not needed to combine the base address and the offset, because the offset bits can be simply inserted into the positions that correspond to 0s in the quasi-base address. Since adders are relatively slow compared to circuit systems that multiplex bits from different sources to the appropriate bit locations, eliminating the cost of adders in each cycle of address translation for lookup tag addresses can help improve performance and make it easier for circuit designers to design circuit systems that meet timing requirements. Furthermore, using a locating base address means that less information needs to be stored to define the base address because the lower-order 0 bits do not need to be explicitly stored. For example, those 0 bits can be omitted from the information stored in a register to define the base address. Alternatively, if the register does define the lower bits of the address, the lower bits of the register defining the base address can be ignored, so that the base address is still the reference address even if it is set to a non-zero value, where several lower bits are set to 0.

在一些實例中,標籤表基底位址可以由設計固定(例如,在指令集架構中限制為在第一位址空間內的特定位置處)。In some instances, the base address of the label table can be fixed by design (e.g., restricted to a specific location within the first address space in an instruction set architecture).

然而,為了增加軟體開發人員的靈活性,該標籤表基底位址基於標籤表基底位址資訊可變可係有用的。標籤表基底位址資訊可能係可由軟體組態的(例如,在一些情況中,限制為由具有至少給定特權等級的軟體修改)。例如,可在控制暫存器中指定標籤表基底位址資訊。在一些實例中,可指定對應於不同轉譯體系的標籤表基底位址資訊的多個片段,其中將用於產生標籤定位位址的標籤表基底位址由標籤定位位址判定電路系統基於哪個轉譯體系係目前轉譯體系的指示來選擇。However, to increase the flexibility of software developers, it can be useful for the label table base address to be variable based on the label table base address information. The label table base address information may be software-configurable (e.g., in some cases, limited to software with at least a given privilege level). For example, the label table base address information can be specified in a control register. In some instances, multiple segments of the label table base address information corresponding to different translation systems can be specified, wherein the label table base address used to generate the label location address is selected by the label location address determination circuit system based on an indication of which translation system is currently being used.

該第一位址空間可包含至少一個可轉譯位址區域,各可轉譯位址區域具有在該第一位址空間內指定的一對應標籤表位址區域。可轉譯位址區域可能係其中允許有效資料位址轉譯的位址空間的區域。因此,回應於存取可轉譯位址區域之外的位址處的資料項的資料記憶體存取請求,位址轉譯電路系統可觸發錯誤。將有效位址轉譯限制至一或多個可轉譯位址區域可以係有幫助的,因為此在位址值中留下可用的編碼空間來對其他資訊(例如,用於標籤檢查的位址標籤)進行編碼。再者,限制位址空間內的可轉譯位址區域的大小減少了軟體開發人員的管理負擔,因為其等不需要維持覆蓋如此大的位址空間區域的轉譯表結構。The first address space may contain at least one translatable address region, each translatable address region having a corresponding label table address region specified within the first address space. A translatable address region may be an area of the address space that allows valid data address translation. Therefore, in response to a data memory access request for a data item at an address outside of a translatable address region, the address translation circuit system may trigger an error. Restricting valid address translation to one or more translatable address regions can be helpful because this leaves available encoding space in the address value for encoding other information (e.g., address labels used for label checking). Furthermore, limiting the size of the translatable address region within the address space reduces the management burden on software developers, as they do not need to maintain a translation table structure that covers such a large address space region.

在一些實例中,一給定可轉譯位址區域的該標籤表位址區域可位於該給定可轉譯位址區域內。對於硬體/軟體設計人員而言,此可以更簡單地實施,因為標籤表位址區域的引入可能不需要關於第一位址空間的位址係可轉譯亦或不可轉譯的任何改變。In some instances, the label table address region may be located within a given translatable address region. This can be simpler for hardware/software designers because the introduction of the label table address region may not require any changes to whether the address space of the first address is translatable or not.

然而,一給定可轉譯位址區域的該標籤表位址區域亦可能位於該給定可轉譯位址區域之外。例如,標籤表位址區域可以位於可轉譯位址區域的相鄰區域中,此處儲存對應於標籤表位址區域中的標籤的資料。若標籤表位址區域位於對應的可轉譯位址區域之外,則存取標籤表位址區域中的分配標籤的標籤記憶體存取可能從存取僅在可轉譯區域中的位址的要求中排除(與存取資料項的資料存取不同),因此對標籤表位址區域中的位址的標籤存取可能不觸發錯誤。對彼標籤表位址區域的資料存取可能觸發錯誤。對在除了標籤表位址區域之外的不可轉譯位址區域的部分中的位址的標籤存取可能觸發錯誤。However, the label table address region of a given translatable address region may also be located outside of that given translatable address region. For example, the label table address region may be located in an adjacent region of a translatable address region where data corresponding to the labels in the label table address region is stored. If the label table address region is located outside the corresponding translatable address region, label memory access to an allocated label in the label table address region may be excluded from the requirement of accessing addresses only in translatable regions (unlike data access to data items), and therefore label access to addresses in the label table address region may not trigger an error. Data access to that label table address region may trigger an error. Tag access to a address in a portion of an untranslatable address region other than the tag table address region may trigger an error.

在一些實例中,對於具有基於區域大小資訊而可變的一區域大小的一給定可轉譯位址區域,該對應標籤表位址區域的一大小係可變的,以隨著該給定可轉譯位址區域的一大小而縮放。例如,可轉譯區域大小資訊可由軟體設定以定義給定可轉譯位址區域的大小。由於為給定記憶體區域中的資料項定義分配標籤的粒度可係固定的(取決於分配標籤寬度與共用一個分配標籤的資料區塊的大小之比率),標籤表儲存區域大小隨著對應可轉譯位址區域的大小縮放可以係有用的,使得可轉譯區域大小資訊亦隱式地定義了給定標籤表位址區域的大小(且因此定義了用以形成標籤定位位址的偏移部分的大小及將偏移應用於標籤表基底位址的位元位置)。因此,此方法可以避免需要定義分開的組態資訊(例如,控制暫存器狀態),該分開的組態資訊定義了與可轉譯位址區域大小分開的標籤表大小的大小。In some instances, for a given translatable address region having a variable size based on region size information, the size of the corresponding label table address region is variable, scaling as the given translatable address region is sized. For example, the translatable region size information can be software-configured to define the size of the given translatable address region. Since the granularity of defining assignment labels for data items in a given memory region can be fixed (depending on the ratio of the assignment label width to the size of the data block sharing a single assignment label), it can be useful to scale the label table storage area size with the size of the corresponding translatable address region, so that the translatable region size information also implicitly defines the size of the given label table address region (and thus defines the size of the offset portion used to form the label location address and the bit position where the offset is applied to the label table base address). Therefore, this method avoids the need to define separate configuration information (e.g., control register states) that defines the size of the label table, separate from the size of the translatable address region.

例如,該給定可轉譯位址區域的該大小與該對應標籤表位址區域的該大小之間的一比率可以係2 n,其中2 n係對應於該對應標籤表位址區域的一個位元組中儲存的該一或多個分配標籤的一資料位元組數目。 For example, a ratio between the size of the given translatable address region and the size of the corresponding label table address region can be 2^ n , where 2^ n is the number of data bytes of the one or more allocation tags stored in a byte corresponding to the corresponding label table address region.

在一些實例中,第一位址空間可支援單一可轉譯位址區域。In some cases, the first address space can support a single translatable address region.

然而,其他實例可(至少對於一些轉譯體系或處理電路系統的一些操作狀態)支援該第一位址空間包含複數個可轉譯位址區域,該複數個可轉譯位址區域具有識別該複數個可轉譯區域的各別標籤表位址區域的位置的分開的標籤表基底位址。提供多個可轉譯位址區域對於區分用於不同目的的位址空間可以係有用的(例如,一個可轉譯區域由使用者/應用程式層級軟體使用,且另一可轉譯區域由核心/作業系統層級軟體使用)。因此,當使用多個可轉譯位址區域時,當判定該標籤定位位址時,該標籤定位位址判定電路系統可應用相對於該標籤表基底位址的該偏移,該標籤表基底位址對應於包含該資料定位位址的該可轉譯位址區域。該複數個可轉譯位址區域的該等標籤表基底位址可係基於該複數個可轉譯位址區域的標籤表基底位址資訊的分開項可變的(例如,各可轉譯位址區域的該標籤表基底位址資訊可儲存在一或多個控制暫存器中)。However, other examples (at least for some translation systems or certain operating states of processing circuit systems) may support the first address space comprising a plurality of translatable address regions, each having a separate label table base address that identifies the location of its respective label table address region. Providing multiple translatable address regions can be useful for distinguishing address spaces used for different purposes (e.g., one translatable region used by user/application level software, and another translatable region used by kernel/operating system level software). Therefore, when using multiple translatable address regions, when determining the tag location address, the tag location address determination circuit system can apply the offset relative to the tag table base address, which corresponds to the translatable address region containing the data location address. The tag table base addresses of the plurality of translatable address regions may be variable based on the separate entries of the tag table base address information of the plurality of translatable address regions (e.g., the tag table base address information of each translatable address region may be stored in one or more control registers).

類似地,該等可轉譯位址區域可具有各別區域大小,該等各別區域大小係基於該複數個可轉譯區域的區域大小資訊的分開項可變的。同樣地,給定標籤表位址區域的大小可隨著對應可轉譯區域的大小而縮放,因此一個可轉譯位址區域的標籤表位址區域的大小可能與另一可轉譯位址區域的標籤表位址區域的大小不同。Similarly, these translatable address regions may have individual region sizes, which are variable based on separate entries of the region size information of the plurality of translatable regions. Likewise, the size of a given label table address region may scale with the size of the corresponding translatable region, so the size of the label table address region of one translatable address region may differ from the size of the label table address region of another translatable address region.

一些實例可支援單一可轉譯區域及多個可轉譯區域轉譯體系二者,其中儲存在控制暫存器中的控制狀態定義目前使用的可轉譯位址區域的組態。Some examples support both single translatable regions and multiple translatable regions translation systems, where the control state stored in the control register defines the configuration of the currently used translatable address region.

在一些實例中,該資料定位位址的該偏移部分排除該資料定位位址的最低有效n個位元,其中2 n係對應於該對應標籤表位址區域的一個位元組中儲存的該一或多個分配標籤的一資料位元組數目。因此,偏移部分可對應於資料定位位址的部分,該部分將從標籤表位址區域中選擇唯一分配標籤(當判定偏移部分時忽略僅僅區分共用相同分配標籤的不同位址的位址位元)。 In some instances, the offset portion of the data location address excludes the least significant n bits of the data location address, where 2^ n corresponds to the number of data bytes of the one or more allocation tags stored in a byte of the corresponding label table address region. Therefore, the offset portion may correspond to a portion of the data location address that will select a unique allocation tag from the label table address region (address bits that only distinguish different addresses sharing the same allocation tag are ignored when determining the offset portion).

在一些實例中,對於大小為2 t位元組的一給定可轉譯位址區域內的一資料定位位址,該標籤定位位址判定電路系統可將該標籤定位位址判定為該給定可轉譯位址區域內的一位址,其中該標籤定位位址的位元[t-1:0]包含: 該標籤定位位址的位元[t-n-1:0],該等位元指定從該資料定位位址的位元[t-1:n]獲得的該偏移部分;及 基於標籤表基底位址資訊設定的該標籤定位位址的位元[t-1:t-n],該標籤表基底位址資訊指示對應於該給定可轉譯位址區域的該標籤表基底位址; 其中2 n係對應於該對應標籤表位址區域的一個位元組中儲存的該一或多個分配標籤的一資料位元組數目。此方法可以相對簡單地在硬體電路邏輯中實施,且可以為軟體提供足夠的靈活性,以取決於第一位址空間的哪些部分需要用於其他目的來使第一位址空間內的標籤表位址區域的位置變化。 In some examples, for a data location address within a given translatable address region of size 2t bytes, the tag location address determination circuit system can determine the tag location address as an address within the given translatable address region, wherein the bits [t-1:0] of the tag location address include: bits [tn-1:0] of the tag location address, which specify the offset portion obtained from the bits [t-1:n] of the data location address; and bits [t-1:tn] of the tag location address set based on tag table base address information, which indicates the tag table base address corresponding to the given translatable address region; wherein 2t bytes n is the number of data bytes of the one or more allocation tags stored in a byte corresponding to the corresponding tag table address region. This method can be implemented relatively simply in hardware circuit logic and can provide sufficient flexibility in software to determine which parts of the first address space need to be used for other purposes to change the location of the tag table address region within the first address space.

該標籤定位位址判定電路系統可以有助於支援一虛擬化標籤存取模式,其中對於由該位址轉譯電路系統回應於指定該資料定位位址所取決於的一資料位址的一標籤存取指令而執行的一位址轉譯,當針對一給定位址轉譯階段啟用一虛擬化標籤存取模式以將位址從該第一位址空間(例如,虛擬位址空間或中間位址空間)轉譯至一第二位址空間(例如,中間位址空間或實體位址空間)時:該位址轉譯電路系統基於由該標籤定位位址判定電路系統基於該資料定位位址所判定的該標籤定位位址的轉譯,來獲得該實體位址空間中的一標籤定位實體位址。此一虛擬化標籤存取模式可以有助於減少記憶體系統為標籤分配實體記憶體的要求或提供特定於標籤的存取機制。This tag location address determination circuit system can help support a virtualized tag access mode, wherein for a bit address translation performed by the address translation circuit system in response to a tag access instruction that specifies the data location address, when a virtualized tag access mode is enabled for a given address translation stage to remove the address from the first address null... When translating from one address space (e.g., a virtual address space or an intermediate address space) to a second address space (e.g., an intermediate address space or a physical address space): the address translation circuit system obtains a tag location physical address in the physical address space based on the translation of the tag location address determined by the tag location address determination circuit system based on the data location address. This virtualized tag access mode can help reduce the requirement for the memory system to allocate physical memory for tags or provide tag-specific access mechanisms.

在一些實例中,虛擬化標籤存取模式可能係存取標籤的唯一支援模式(例如,對應於前文提及的第二標籤轉譯模式)。其他實例亦可支援實體標籤存取模式(例如,前文提及的第一標籤轉譯模式)。In some instances, virtualized tag access mode may be the only supported mode for accessing tags (e.g., corresponding to the second tag translation mode mentioned above). Other instances may also support entity tag access mode (e.g., the first tag translation mode mentioned above).

在一些實例中,該位址轉譯電路系統經組態以針對以下二者支援該虛擬化標籤存取模式:一第一位址轉譯階段,對於該第一位址轉譯階段,該第一位址空間係一虛擬位址空間,且該第二位址空間係一中間位址空間;及一第二位址轉譯階段,對於該第二位址轉譯階段,該第一位址空間係該中間位址空間,且該第二位址空間係該實體位址空間。其他實例可支援僅第一位址轉譯階段及第二位址轉譯階段之一者的虛擬化標籤存取模式。In some instances, the address translation circuit system is configured to support the virtualized tag access mode for both of the following: a first address translation stage, in which the first address space is a virtual address space and the second address space is an intermediate address space; and a second address translation stage, in which the first address space is the intermediate address space and the second address space is the physical address space. Other instances may support virtualized tag access modes for only one of the first and second address translation stages.

在針對該第一位址轉譯階段及該第二位址轉譯階段二者支援該虛擬化標籤存取模式的實例中,該標籤定位位址判定電路系統可包含共用硬體電路系統,其經組態以使用於以下二者:當針對該第一位址轉譯階段啟用該虛擬化標籤存取模式時,基於該虛擬位址空間中的該資料定位位址來判定該虛擬位址空間中的該標籤定位位址;當針對該第二位址轉譯階段啟用該虛擬化標籤存取模式時,基於該中間位址空間中的該資料定位位址來判定該中間位址空間中的該標籤定位位址。除了讀入定義標籤表基底位址的不同資訊之外,用於將資料定位位址映射至標籤定位位址的映射函數可係相同的,無論應用彼映射函數以在虛擬位址空間中的對應資料/標籤虛擬位址之間進行變換亦或在中間位址空間中的對應資料/標籤中間位址之間進行變換。因此,可能為二個位址轉譯階段共用相同的硬體,以降低總電路面積成本。In an example where the virtualized tag access mode is supported for both the first address translation stage and the second address translation stage, the tag location address determination circuit system may include a shared hardware circuit system configured for use in both of the following: when the virtualized tag access mode is enabled for the first address translation stage, the tag location address in the virtual address space is determined based on the data location address in the virtual address space; when the virtualized tag access mode is enabled for the second address translation stage, the tag location address in the intermediate address space is determined based on the data location address in the intermediate address space. Aside from reading in different information about the base address of the label table, the mapping function used to map data location addresses to label location addresses can be the same, whether that mapping function is applied to transform corresponding data/label virtual addresses in the virtual address space or to transform corresponding data/label intermediate addresses in the intermediate address space. Therefore, it is possible to share the same hardware for the two address translation stages to reduce the total pad surface area cost.

如上所述,在一些實施方案中可支援虛擬化標籤(例如,如在本文中指涉的虛擬或中間標籤)。因此,分配標籤可連同資料項一起儲存在位址空間(虛擬或中間位址空間)中,且因此可利用資料記憶體存取請求存取分配標籤。例如,可利用指定彼給定定址位置的資料存取操作來存取在位址空間中的給定定址位置處儲存的分配標籤。As described above, some implementations may support virtualized tags (e.g., virtual or intermediate tags as referred to herein). Therefore, allocation tags can be stored together with data items in an address space (virtual or intermediate address space), and thus can be accessed using data memory access requests. For example, an allocation tag stored at a given address location in the address space can be accessed using a data access operation that specifies that given address location.

對具有資料記憶體存取請求的分配標籤的存取可能係無意的或有意的(且在一些情況中係合法的,如下文進一步論述)。例如,由於程式設計錯誤,儲存分配標籤的記憶體中的定址位置可由資料記憶體存取操作無意地存取。另一方面,攻擊者可嘗試讀取分配標籤的值或寫入分配標籤的值,作為嘗試利用向具有資料記憶體存取請求的分配標籤提供的存取的部分。Access to an allocation tag with a data memory access request can be unintentional or intentional (and in some cases legal, as discussed further below). For example, due to a programming error, the address location in the memory storing the allocation tag can be unintentionally accessed by a data memory access operation. On the other hand, an attacker can attempt to read or write the value of the allocation tag as part of an attempt to exploit the access provided to the allocation tag with a data memory access request.

如本文所述,分配標籤可用作標籤檢查的部分,且因此其值可影響標籤檢查的結果,亦即是否執行錯誤處置回應。因此,允許利用資料記憶體存取操作無意或有意地存取分配標籤可能係非所欲的。例如,攻擊者可嘗試利用標籤檢查對分配標籤的使用,以基於分配標籤的值來有意地觸發或不觸發錯誤處置回應(例如,作為拒絕服務攻擊的部分,若修改分配標籤導致拒絕記憶體存取,使得存在對受害軟體的功能的中斷)。即使觸發對標籤儲存區域的資料存取的攻擊者沒有中斷受害者碼的記憶體存取,由攻擊者讀取標籤值可給出有關受害者程序的記憶體使用的側通道資訊。因此,攻擊者可嘗試讀取分配標籤的目前值或嘗試修改分配標籤的值,以便影響標籤檢查的結果。再者,即使不存在對分配標籤的無意資料存取的惡意嘗試,但此存取僅僅由程式設計錯誤導致,由影響一個資料存取操作的錯誤導致的對分配標籤值的無意更新可導致另一資料存取操作(其本身不經受任何程式設計錯誤)的標籤失配錯誤的虛假報告,此可能導致軟體開發人員不必要地花費開發時間來審查據稱導致錯誤的碼錯誤部分,而事實上問題出在其他地方。As described herein, the assignment tag can be used as part of tag checking, and therefore its value can affect the result of tag checking, i.e., whether an error handling response is executed. Therefore, allowing unintentional or intentional access to the assignment tag via data memory access operations may be undesirable. For example, an attacker could attempt to exploit tag checking's use of the assignment tag to intentionally trigger or not trigger an error handling response based on the assignment tag's value (e.g., as part of a denial-of-service attack, modifying the assignment tag to deny memory access could result in a disruption of the victim software's functionality). Even if an attacker triggers data access to the tag storage area without interrupting the victim's memory access, reading the tag value can provide side-channel information about the victim's program's memory usage. Therefore, an attacker can attempt to read the current value of the assigned tag or attempt to modify the assigned tag value to affect the tag check results. Furthermore, even if there is no malicious attempt to access the assigned label, but this access is solely due to a programming error, the unintentional update of the assigned label value caused by an error affecting one data access operation can lead to false reports of label mismatch errors in another data access operation (which itself is not subject to any programming error). This can cause software developers to unnecessarily spend development time reviewing the code that is allegedly causing the error when the problem is actually elsewhere.

由此,提供架構支援以識別資料存取請求指定對應於儲存分配標籤的記憶體位址的目標位址的情況可以係有利的。Therefore, it can be advantageous to provide architectural support to identify data access requests that specify the target address corresponding to the memory address of the storage allocation tag.

因此,在一些實例中,一種設備包含上文提及的標籤檢查電路系統及用以執行一標籤資料存取檢查的標籤資料存取檢查電路系統。該標籤資料存取檢查包含:基於定義經指定用於儲存分配標籤的一分配標籤記憶體位址區域的記憶體位址區域定義訊息,判定一資料記憶體存取請求是否指定對應於該分配標籤記憶體位址區域中的一記憶體位址的一目標位址;及回應於判定該資料記憶體存取請求指定對應於該分配標籤記憶體位址區域中的一記憶體位址的一目標位址,拒絕對儲存在該分配標籤記憶體位址區域中的該記憶體位址處的一資料值的讀取或寫入存取。Therefore, in some examples, an apparatus includes the tag inspection circuit system mentioned above and a tag data access inspection circuit system for performing a tag data access inspection. The tag data access check includes: determining, based on memory address region definition information defining an allocation tag memory address region designated for storing allocation tags, whether a data memory access request specifies a target address corresponding to a memory address in the allocation tag memory address region; and, in response to determining that the data memory access request specifies a target address corresponding to a memory address in the allocation tag memory address region, refusing read or write access to a data value stored at that memory address in the allocation tag memory address region.

因此,可基於對應於指定用於儲存分配標籤的記憶體區域中的位址的資料記憶體存取請求的目標位址來拒絕對資料值的讀取或寫入存取。此提供了在架構內用於控制對儲存分配標籤的記憶體區域的存取的機制,此可防止對分配標籤的無意或未授權的存取。Therefore, read or write access to a data value can be denied based on the target address of a data memory access request corresponding to an address specified in the memory region for the storage allocation tag. This provides a mechanism within the architecture for controlling access to the memory region of the storage allocation tag, which prevents unintentional or unauthorized access to the allocation tag.

如上文所論述,本方法可藉由防止請求方能夠使用直接指定分配標籤位址的資料記憶體存取請求來存取分配標籤,而防止來自可能惡意攻擊者的利用。與替代方案(諸如基於指定記憶體區域中的位址的資料記憶體存取請求而不拒絕讀取或寫入權限,該記憶體區域中的位址指定用於儲存分配標籤)相比,此方法可以提供增加的安全性,以防止攻擊者試圖利用實施方案對標籤檢查的回應。As discussed above, this method prevents exploitation by potentially malicious attackers by preventing requesters from accessing allocation tags using data memory access requests that directly specify the address of the allocation tag. Compared to alternatives such as data memory access requests based on an address in a specified memory region designated for storing allocation tags, this method provides increased security to prevent attackers from attempting to exploit implementation responses to tag checks.

另外,可防止對分配標籤的不必要或無意的存取。例如,資料記憶體存取請求的請求方可能不知道分配標籤儲存在記憶體中的位置(虛擬或實體),或者請求方可無意地指定對應於指定用於儲存分配標籤的分配標籤記憶體位址區域中的記憶體位址的目標位址。例如,如本文中論述的,當在虛擬化標籤模式(諸如虛擬標籤或中間標籤)下操作時,以下情況係可能的:記憶體存取指令可以指定虛擬或中間實體位址作為其意欲用於定義給定資料項的位置的目標位址,該虛擬或中間實體位址實際上對應於指定為儲存分配標籤的記憶體區域中的虛擬位址或中間實體位址。由此,可防止對分配標籤的此類不必要或無意的存取。Additionally, it prevents unnecessary or unintentional access to allocation tags. For example, the requester of a data memory access request may not know the location (virtual or physical) of the allocation tag in memory, or the requester may unintentionally specify a target address corresponding to the memory address in the allocation tag memory address region specified for storing the allocation tag. For example, as discussed herein, when operating in a virtualization tagging mode (such as a virtual tag or intermediate tag), it is possible for memory access instructions to specify a virtual or intermediate entity address as the target address they intend to use to define the location of a given data item, which actually corresponds to a virtual or intermediate entity address within the memory region designated as the storage allocation tag. This prevents such unnecessary or unintentional access to the allocation tag.

在一些實例中,拒絕讀取或寫入存取可包含觸發錯誤、將資料值讀取為零、及忽略對資料值的寫入請求中的一或多者。例如,若要拒絕讀取存取,則在一些實例中,資料值可經讀取為零(在一些情況中,可能不觸發讀取操作且可回傳零值)。在一些情況中,若要拒絕寫入存取,則可忽略寫入存取。在一些情況中,對於拒絕讀取或寫入存取,可觸發錯誤。例如,可能產生錯誤指示。In some instances, denying read or write access may include triggering an error, reading the data value as zero, and ignoring one or more of the following: a write request for the data value. For example, to deny read access, in some instances, the data value may be read as zero (in some cases, the read operation may not be triggered and a zero value may be returned). In some cases, to deny write access, the write access may be ignored. In some cases, denying read or write access may trigger an error. For example, an error message may be generated.

在一些實例中,經指定用於儲存分配標籤的該分配標籤記憶體位址區域經指定位於除了一實體位址空間之外的一位址空間中。例如,在一些情況中,經指定用於儲存分配標籤的該分配標籤記憶體位址區域經指定位於一虛擬或中間實體位址空間中。因此,本存取控制方法可應用於非實體(例如,虛擬化)記憶體標籤實施方案中,諸如本文中論述的彼等實施方案。另外,如本文中論述的,在一些實例中,可使用虛擬化標籤實施方案(虛擬或中間標籤),且因此本存取控制方法可支援虛擬化標籤。In some instances, the memory address region designated for storing the allocation tag is specified to be located in an address space other than a physical address space. For example, in some cases, the memory address region designated for storing the allocation tag is specified to be located in a virtual or intermediate physical address space. Therefore, this access control method can be applied to non-physical (e.g., virtualized) memory tag implementations, such as those discussed herein. Additionally, as discussed herein, in some instances, virtualized tag implementations (virtual or intermediate tags) can be used, and therefore this access control method can support virtualized tags.

在一些實例中,該記憶體位址區域定義資訊包含記憶體位址區域定義組態資訊,該記憶體位址區域定義組態資訊定義該分配標籤記憶體位址區域在一位址空間中的一可變位置。也就是說,在一些實例中,分配標籤記憶體位址區域在給定位址空間中的位置可能在給定位址空間中不固定。由此,分配標籤記憶體位址區域可取決於具體實施方案來定義,而允許軟體開發人員在可如何定義及使用該區域以儲存分配標籤方面的靈活性。In some instances, the memory address region definition information includes memory address region definition configuration information, which defines a variable location of the allocation tag memory address region within an address space. That is, in some instances, the location of the allocation tag memory address region within a given address space may not be fixed. Therefore, the allocation tag memory address region can be defined depending on the specific implementation, allowing software developers flexibility in how the region can be defined and used to store allocation tags.

分配標籤記憶體位址區域定義組態資訊可包含下列中之至少一者:指示一標籤表基底位址的資訊;及指示一表大小的資訊。因此,組態資訊可包括用於判定分配標籤記憶體位址區域中包括的位址範圍的資訊,而非定義分配標籤記憶體位址區域中的各個別位址。在一些實例(例如,下文關於圖20進一步論述的雙可轉譯區域實例)中,位址空間可包含多於一個分配標籤記憶體位址區域,且因此若資料記憶體存取請求的目標位址對應於由分配標籤記憶體位址區域定義組態資訊定義的分配標籤記憶體位址區域中之任一者,則可在標籤資料存取檢查中拒絕讀取/寫入存取。The configuration information for allocating a tag memory address region may include at least one of the following: information indicating the base address of a tag table; and information indicating the size of a table. Therefore, the configuration information may include information used to determine the range of addresses included in the allocating tag memory address region, rather than defining individual addresses in the allocating tag memory address region. In some instances (e.g., the dual-translatable region example discussed further below with respect to Figure 20), the address space may contain more than one allocation tag memory address region, and therefore, if the target address of a data memory access request corresponds to any of the allocation tag memory address regions defined by the allocation tag memory address region definition configuration information, read/write access may be denied during tag data access checks.

在一些實例中,對於該標籤資料存取檢查,該標籤資料存取檢查電路系統經組態以:回應於下列而拒絕對儲存在該分配標籤記憶體位址區域中的該記憶體位址處的一資料值的讀取或寫入存取:判定該資料記憶體存取請求指定對應於該分配標籤記憶體位址區域中的一記憶體位址的該目標位址;及判定標籤資料存取檢查啟用資訊指示針對該資料記憶體存取請求啟用該標籤資料存取檢查。In some instances, for the tag data access check, the tag data access check circuit system is configured to: refuse read or write access to a data value stored at a memory address in the allocated tag memory address region in response to: determining that the data memory access request specifies the target address corresponding to a memory address in the allocated tag memory address region; and determining that the tag data access check enable message indicates that the tag data access check is enabled for the data memory access request.

因此,可亦基於標籤資料存取檢查啟用資訊來判定是否拒絕讀取或寫入存取,該標籤資料存取檢查啟用資訊指示針對資料記憶體存取請求啟用標籤資料存取檢查(及資料記憶體存取請求是否指定分配標籤記憶體位址區域中的目標位址)。由此,可基於標籤資料存取檢查目前是否啟用來拒絕讀取或寫入存取。標籤資料存取檢查的此選擇性啟用支援以下實施方案:在一些情況中可執行標籤資料存取檢查但在其他情況中不執行,例如,對於某些資料記憶體存取請求執行而對於其他資料記憶體存取請求不執行,或者在某些時間執行且在其他時間不執行。例如,可能存在允許資料存取記憶體操作對分配標籤進行讀取或寫入存取的合法原因,諸如當執行垃圾收集操作時。在此情況中,標籤資料存取檢查可基於標籤資料存取檢查啟用資訊來禁用,該標籤資料存取檢查啟用資訊指示為資料記憶體存取請求禁用標籤資料存取檢查。因此,提供架構支援以提供對具有資料記憶體存取請求的分配標籤的可組態存取可能係有利的。Therefore, it is also possible to determine whether to deny read or write access based on the tag data access check enabled information, which indicates whether the tag data access check is enabled for the data memory access request (and whether the data memory access request specifies the target address in the allocated tag memory address region). Thus, it is possible to deny read or write access based on whether the tag data access check is currently enabled. This selective enabling of tag data access checks supports the following implementation scenarios: tag data access checks may be performed in some cases but not in others, for example, performed for some data memory access requests but not for others, or performed at some times and not at others. For example, there may be legitimate reasons to allow data access memory operations to read or write to allocated tags, such as when performing a garbage collection operation. In this case, tag data access checks can be disabled based on tag data access check enable information that indicates that tag data access checks are disabled for data memory access requests. Therefore, providing architectural support to enable configurable access to allocation tags that have data memory access requests may be advantageous.

在一些實例中,該標籤資料存取檢查啟用資訊識別是否針對係為讀取請求的資料記憶體存取請求啟用該標籤資料存取檢查,且獨立於是否針對係為讀取請求的資料記憶體存取請求啟用該標籤資料存取檢查,識別是否針對係為寫入請求的資料記憶體存取請求啟用該標籤資料存取檢查。因此,可針對讀取及寫入請求提供分開的控制。因此,在一些情況中,可拒絕讀取存取,同時可允許寫入存取;且在其他情況中,可允許讀取存取,且可拒絕寫入存取。因此,可支援唯讀及唯寫控制。唯讀控制可提供對攻擊者篡改(亦即,修改分配標籤的值)的保護,同時仍然允許軟體檢查分配標籤的值。唯寫控制可允許軟體寫入分配標籤,但可防止檢查分配標籤值。In some implementations, the tag data access check enable information identifies whether the tag data access check is enabled for read-only data memory access requests, and independently identifies whether the tag data access check is enabled for write-only data memory access requests. Therefore, separate control can be provided for read and write requests. Thus, in some cases, read access can be denied while write access can be allowed; and in other cases, read access can be allowed while write access can be denied. Therefore, read-only and write-only control can be supported. Read-only control provides protection against attackers tampering with (i.e., modifying) the value of the allocation tag, while still allowing software to inspect the value of the allocation tag. Write-only control allows software to write to the allocation tag, but prevents the software from inspecting the value of the allocation tag.

在一些實例中,該標籤資料存取檢查電路系統經組態以:對於寫入資料記憶體存取請求,判定獨立於該標籤資料存取檢查啟用資訊而啟用該標籤資料存取檢查。因此,在一些實例中,可對寫入資料記憶體存取執行標籤資料存取檢查,而與標籤資料存取檢查啟用資訊是否指示標籤資料存取檢查已啟用無關。在一些情況中,對於作為寫入資料記憶體存取的任何資料記憶體存取請求執行標籤資料存取檢查可能係有利的。例如,寫入資料記憶體存取請求可由試圖影響如本文中論述的標籤檢查結果的可能攻擊者執行。In some instances, the tag data access check circuitry is configured to enable tag data access checks for write memory access requests, independent of the tag data access check enable message. Therefore, in some instances, tag data access checks can be performed on write memory access requests, regardless of whether the tag data access check enable message indicates that tag data access checks are enabled. In some cases, it may be advantageous to perform tag data access checks on any data memory access request that is a write memory access request. For example, a write memory access request could be executed by a potential attacker attempting to influence the results of tag checks as discussed herein.

在一些實例中,該標籤資料存取檢查啟用資訊識別是否針對特權資料記憶體存取請求啟用該標籤資料存取檢查。因此,在一些實例中,可針對特權資料記憶體存取請求啟用或禁用標籤資料存取檢查。垃圾收集操作或對分配標籤的其他授權資料存取可更有可能由特權碼執行,且因此能夠禁用此類特權碼的標籤資料存取檢查可能係有利的。In some instances, the tag data access check enable information identifies whether the tag data access check is enabled for privileged data memory access requests. Therefore, in some instances, tag data access checks can be enabled or disabled for privileged data memory access requests. Garbage collection operations or other authorized data access to assigned tags are more likely to be performed by privilege codes, and therefore, it may be advantageous to be able to disable tag data access checks for such privilege codes.

在一些實例中,該標籤資料存取檢查電路系統經組態以:對於非特權資料記憶體存取請求,判定獨立於該標籤資料存取檢查啟用資訊而啟用該標籤資料存取檢查。因此,在一些實例中,可對非特權資料記憶體存取執行標籤資料存取檢查,而與標籤資料存取檢查啟用資訊是否指示標籤資料存取檢查已啟用無關。在一些情況中,對於作為非特權資料記憶體存取的任何資料記憶體存取請求執行標籤資料存取檢查可能係有利的。例如,非特權資料記憶體存取請求可由非特權碼執行,該非特權碼可能不被信任來存取分配標籤。In some instances, the tag data access check circuitry is configured to enable tag data access checks for non-privileged memory access requests, independent of the tag data access check enable message. Therefore, in some instances, tag data access checks can be performed on non-privileged memory accesses, regardless of whether the tag data access check enable message indicates that tag data access checks are enabled. In some cases, it may be advantageous to perform tag data access checks on any memory access request that is a non-privileged memory access. For example, a non-privileged memory access request might be executed by a non-privileged code that may not be trusted to access and allocate tags.

在一些實例中,該標籤資料存取檢查啟用資訊獨立於是否針對特權資料記憶體存取請求啟用該標籤資料存取檢查而識別是否針對非特權資料記憶體存取請求啟用該標籤資料存取檢查。In some instances, the tag data access check enable information is independent of whether the tag data access check is enabled for privileged data memory access requests, and identifies whether the tag data access check is enabled for non-privileged data memory access requests.

由此,可針對特權及非特權資料記憶體存取請求支援分開的讀取/寫入存取控制。在一些實施方案中,可為非特權資料記憶體存取請求啟用標籤資料存取檢查,但針對特權資料記憶體存取請求禁用標籤資料存取檢查(亦即,碼在高於預定特權等級的特權等級下執行)。因此,在此實施方案中,可拒絕嘗試讀取或寫入儲存在分配標籤記憶體位址區域中的資料的非特權資料記憶體存取請求,而可允許特權資料記憶體存取請求讀取或寫入儲存在分配標籤記憶體位址區域中的資料。由此,可基於請求對分配標籤進行資料記憶體存取的碼的特權等級來允許或拒絕對儲存在分配標籤記憶體位址區域中的分配標籤進行讀取或寫入存取。This allows for separate read/write access control for privileged and non-privileged data memory access requests. In some implementations, tag data access checks can be enabled for non-privileged data memory access requests, but disabled for privileged data memory access requests (i.e., the code executes at a privilege level higher than a predetermined privilege level). Therefore, in this implementation, non-privileged data memory access requests attempting to read or write data stored in the allocated tag memory address area can be rejected, while privileged data memory access requests can be allowed to read or write data stored in the allocated tag memory address area. Therefore, reading or writing access to the allocation tag stored in the allocation tag memory address area can be allowed or denied based on the privilege level of the code requesting data memory access to the allocation tag.

在一些實例中,禁止藉由以不足特權執行的指令來更新該標籤資料存取檢查啟用資訊。因此,在一些實例中,以足夠特權執行的碼可能夠更新標籤資料存取檢查啟用資訊以啟用或禁用標籤資料存取檢查,而以不足特權執行的碼則不能。可能攻擊者可嘗試使用碼來更新標籤資料存取檢查資訊,且因此防止非特權碼能夠如此做可增加針對可能攻擊者的安全性。另外,超管理器或安全性管理程序能夠選擇性地啟用標籤資料存取檢查可能係有利的。In some instances, updating tag data access check enable information is prohibited by instructions executed with insufficient privileges. Therefore, in some instances, code executed with sufficient privileges might be able to update tag data access check enable information to enable or disable tag data access checks, while code executed with insufficient privileges might not. An attacker could potentially attempt to use code to update tag data access check information, and preventing unprivileged code from doing so increases security against potential attackers. Additionally, it may be advantageous for a super administrator or security manager to selectively enable tag data access checks.

在一些實例中,該標籤資料存取檢查啟用資訊包含一控制暫存器中的一欄位。因此,控制暫存器可經檢查以高效地判定是否針對給定的資料記憶體存取請求啟用標籤資料存取檢查。另外,在一些實例中,該標籤資料存取檢查啟用資訊可包含在一控制暫存器中的用於針對讀取操作啟用該標籤資料存取檢查的一第一欄位、及(在相同控制暫存器中或在與儲存該第一欄位的該控制暫存器不同的一控制暫存器中)用於針對寫入操作啟用該標籤資料存取檢查的分開的一第二欄位。由此,可針對讀取及寫入操作提供對標籤資料存取檢查的分開控制。In some examples, the tag data access check enable information includes a field in a control register. Therefore, the control register can be checked to efficiently determine whether to enable tag data access check for a given data memory access request. Alternatively, in some examples, the tag data access check enable information may include a first field in a control register for enabling the tag data access check for read operations, and a separate second field (in the same control register or in a different control register) for enabling the tag data access check for write operations. This provides separate control over tag data access checks for read and write operations.

在一些實例中,該標籤資料存取檢查啟用資訊可包含在一控制暫存器中的用於針對特權資料記憶體存取操作啟用該標籤資料存取檢查的一第一欄位、及(在相同控制暫存器中或在與儲存該第一欄位的該控制暫存器不同的一控制暫存器中)用於針對非特權資料記憶體存取操作啟用該標籤資料存取檢查的分開的一第二欄位。由此,可為特權及非特權資料記憶體存取操作提供對標籤資料存取檢查的分開控制。In some examples, the tag data access check enable information may be included in a first field in a control register for enabling the tag data access check for privileged data memory access operations, and a separate second field (in the same control register or in a different control register) for enabling the tag data access check for non-privileged data memory access operations. This provides separate control over tag data access checks for privileged and non-privileged data memory access operations.

在一些實例中,該標籤資料存取檢查啟用資訊包含範圍資訊,該範圍資訊定義啟用該標籤資料存取檢查的至少一個位址空間範圍。在一些實例中,可檢查該標籤資料存取檢查啟用資訊以判定該資料記憶體存取請求的該目標位址是否包括在由該範圍資訊定義的該位址空間範圍內。因此,可將複數個位址高效地指示為具有為彼複數個位址內的目標位址的資料記憶體存取請求啟用的標籤資料存取檢查。In some instances, the tag data access check enable information includes range information that defines at least one address space range that enables the tag data access check. In some instances, the tag data access check enable information can be checked to determine whether the target address of the data memory access request is included within the address space range defined by the range information. Therefore, a plurality of addresses can be efficiently indicated as having tag data access checks enabled for data memory access requests with target addresses within that plurality of addresses.

在一些實例中,該標籤資料存取檢查啟用資訊可包含讀取及寫入操作的分開的範圍資訊。因此,在一些實例中,該標籤資料存取檢查資訊包含用於定義針對讀取操作啟用該標籤資料存取檢查的至少一個位址空間範圍的範圍資訊、及用於定義針對寫入操作啟用該標籤資料存取檢查的至少一個位址空間範圍的範圍資訊。在一些實例中,該標籤資料存取檢查啟用資訊可包含特權及非特權資料記憶體存取請求的分開的範圍資訊。因此,在一些實例中,該標籤資料存取檢查啟用資訊包含用於定義針對特權資料記憶體存取請求啟用該標籤資料存取檢查的至少一個位址空間範圍的範圍資訊、及用於定義針對非特權資料記憶體存取請求啟用該標籤資料存取檢查的至少一個位址空間範圍的範圍資訊。在一些實例中,該標籤資料存取檢查啟用資訊包含針對讀取資料存取操作的該範圍資訊、針對寫入資料存取操作的該範圍資訊、針對特權資料記憶體存取請求的該範圍資訊、及針對非特權資料記憶體存取請求的該範圍資訊中之一或多者。In some instances, the label data access check enable information may include separate scope information for read and write operations. Therefore, in some instances, the label data access check information includes scope information for defining at least one address space range for enabling the label data access check for read operations, and scope information for defining at least one address space range for enabling the label data access check for write operations. In some instances, the label data access check enable information may include separate scope information for privileged and non-privileged data memory access requests. Therefore, in some embodiments, the tag data access check enable information includes range information for defining at least one address space range for enabling the tag data access check for privileged data memory access requests, and range information for defining at least one address space range for enabling the tag data access check for non-privileged data memory access requests. In some embodiments, the tag data access check enable information includes one or more of the range information for read data access operations, the range information for write data access operations, the range information for privileged data memory access requests, and the range information for non-privileged data memory access requests.

在一些實例中,在對應於該資料記憶體存取請求的該目標位址的一轉譯表條目中指定該標籤資料存取檢查啟用資訊。此可提供關於是否啟用標籤資料存取檢查的高效指示。在一些實例中,由於已經需要對轉譯表條目的存取以便執行目標位址的轉譯,使用對應於資料記憶體存取請求的目標位址的轉譯表條目資訊可提供用於判定是否啟用標籤資料存取檢查的特別高效的機制。In some instances, the label data access check enable information is specified in a translation table entry corresponding to the target address of the data access request. This provides an efficient indication of whether label data access checks are enabled. In some instances, since access to the translation table entry is already required to perform the translation of the target address, using the translation table entry information corresponding to the target address of the data access request provides a particularly efficient mechanism for determining whether to enable label data access checks.

在一些實例中,對於該標籤資料存取檢查,該標籤資料存取檢查電路系統經組態以:回應於下列而拒絕對儲存在該分配標籤記憶體位址區域中的該記憶體位址處的一資料值的讀取或寫入存取:判定該資料記憶體存取請求指定對應於該分配標籤記憶體位址區域中的一記憶體位址的該目標位址;及該記憶體存取請求由除了經允許存取該分配標籤記憶體位址區域中的分配標籤的至少一類別資料存取指令之外的一指令觸發。In some instances, for the tag data access check, the tag data access check circuit system is configured to: refuse read or write access to a data value stored at a memory address in the allocation tag memory address region in response to: determining that the data memory access request specifies the target address corresponding to a memory address in the allocation tag memory address region; and the memory access request is triggered by an instruction other than at least one type of data access instruction that allows access to the allocation tag in the allocation tag memory address region.

因此,在一些實例中,亦可基於觸發資料記憶體存取請求的指令類別不係經允許存取分配標籤記憶體位址區域中的分配標籤的資料存取指令類別而拒絕讀取或寫入存取。在一些實例中,可將資料存取指令的類別指定為允許存取分配標籤,而可拒絕除了允許類別之外的類別的指令存取分配標籤。由此,資料記憶體存取的類型可用以選擇性地拒絕或允許對分配標籤的讀取或寫入存取。Therefore, in some instances, read or write access can be denied because the class of the instruction triggering the data memory access request is not a data access instruction class that allows access to the allocation label in the allocated label memory address region. In some instances, the class of the data access instruction can be specified as allowing access to the allocation label, while instruction classes other than the allowed classes can be denied access to the allocation label. Thus, the type of data memory access can be used to selectively deny or allow read or write access to the allocation label.

在一些實例中,對於該標籤資料存取檢查,該標籤資料存取檢查電路系統經組態以:回應於下列而拒絕對儲存在該分配標籤記憶體位址區域中的該記憶體位址處的一資料值的讀取或寫入存取:判定該資料記憶體存取請求指定對應於該分配標籤記憶體位址區域中的一記憶體位址的該目標位址;及判定該資料記憶體存取請求係一非特權記憶體存取請求。因此,可亦基於資料記憶體存取請求係非特權記憶體存取來拒絕讀取或寫入存取。如上文所論述,防止非特權記憶體存取來存取分配標籤可能係有利的,因為攻擊者可能使用非特權記憶體存取來嘗試讀取或修改分配標籤以影響標籤檢查的結果。In some instances, for the tag data access check, the tag data access check circuit system is configured to refuse read or write access to a data value stored at a memory address in the allocated tag memory address region in response to: determining that the data memory access request specifies the target address corresponding to a memory address in the allocated tag memory address region; and determining that the data memory access request is a non-privileged memory access request. Therefore, read or write access can also be refused based on the data memory access request being a non-privileged memory access. As discussed above, preventing non-privileged memory access from accessing allocation tags may be advantageous, as attackers may use non-privileged memory access to attempt to read or modify allocation tags to affect the results of tag checks.

在一些實例中,提供標籤定位位址判定電路系統,其用以當在一虛擬化標籤模式下操作時,基於識別一給定資料項在除了一實體位址空間之外的一第一位址空間內的一位置的一資料定位位址來判定識別對應於該給定資料項的該分配標籤在該第一位址空間內的一位置的一標籤定位位址;其中該標籤資料存取檢查電路系統經組態以回應於下列而拒絕對儲存在該分配標籤記憶體位址區域中的該記憶體位址處的一資料值的讀取或寫入存取:判定該資料記憶體存取請求指定對應於該分配標籤記憶體位址區域中的一記憶體位址的該目標位址;及判定該標籤定位位址判定電路系統正在該虛擬化標籤模式下操作。In some embodiments, a tag location address determination circuit system is provided for determining, when operating in a virtualized tag mode, a tag location address corresponding to an assigned tag in a first address space other than a physical address space, based on identifying a data location address of a given data item at a location in a first address space; wherein the tag data The access check circuit system is configured to refuse read or write access to a data value stored at a memory address in the allocation tag memory address region in response to the following: determining that the data memory access request specifies the target address corresponding to a memory address in the allocation tag memory address region; and determining that the tag location address determination circuit system is operating in the virtualized tag mode.

因此,本方法可支援一虛擬化標籤模式下的一標籤資料存取檢查,其中位址經指定用於在一第一位址空間中儲存標籤,該第一位址空間將經由一或多個位址轉譯階段轉譯成一實體位址空間,且可亦基於判定該標籤定位位址判定電路系統在一虛擬化標籤模式下操作來拒絕讀取或寫入存取。由此,本方法可支援虛擬化標籤(亦即,本文中論述的虛擬標籤或中間標籤)。Therefore, this method supports tag data access checks in a virtualized tag mode, where an address is designated for storing the tag in a first address space, which is translated into a physical address space through one or more address translation stages. Furthermore, it can also refuse read or write access based on the tag location address determination circuit system operating in a virtualized tag mode. Thus, this method supports virtualized tags (i.e., virtual tags or intermediate tags discussed herein).

上文所論述的技術可在資料處理設備內實施,該資料處理設備具有提供用於實施上文所論述的標籤檢查電路系統、位址轉譯(記憶體管理)電路系統、標籤定位位址判定電路系統、及/或標籤資料存取檢查電路系統的硬體電路系統。然而,相同技術亦可實施在電腦程式內,該電腦程式係在主機資料處理設備上執行以提供用於目標碼之執行的指令執行環境。即使主機資料處理設備本身不支援該架構,此一電腦程式可控制主機資料處理設備以模擬其將提供在實際支援根據某個指令集架構之目標碼的硬體設備上的架構環境。電腦程式可具有標籤檢查程式邏輯、位址轉譯(記憶體管理)程式邏輯、標籤定位位址判定程式邏輯、及/或標籤資料存取檢查程式邏輯,其仿真上文所論述的對應電路系統的功能,包括上文所論述的對虛擬化標籤模式的支援、標籤位址轉譯操作的架構抑制、標籤定位位址判定及/或標籤資料存取檢查。對於以軟體模擬對應硬體實施方案的功能的實施例,在對應硬體實施例的描述中引用「實體位址空間(physical address space)」可以理解為在模擬中指涉模擬的實體位址空間,由於當模擬目標指令執行環境的功能時,彼環境的實體位址空間實際上不指涉主機的硬體記憶體儲存中的位置,但可以進一步映射至由主機資料處理設備使用的虛擬位址空間上。The techniques described above can be implemented within a data processing device having a hardware circuit system that provides for implementing the tag checking circuit system, address translation (memory management) circuit system, tag location address determination circuit system, and/or tag data access checking circuit system described above. However, the same techniques can also be implemented within a computer program that runs on a host data processing device to provide an instruction execution environment for executing object code. Even if the host data processing device itself does not support the architecture, this computer program can control the host data processing device to simulate the architectural environment it will provide on hardware that actually supports object code based on a certain instruction set architecture. The computer program may have tag checking program logic, address translation (memory management) program logic, tag location address determination program logic, and/or tag data access checking program logic, which simulates the functions of the corresponding circuit system discussed above, including support for virtualized tag modes, architectural suppression of tag address translation operations, tag location address determination, and/or tag data access checking. For implementations that use software to simulate the functionality of a hardware implementation scheme, the reference to "physical address space" in the description of the corresponding hardware implementation can be understood as referring to the simulated physical address space in the simulation. Since the physical address space of the simulated target instruction does not actually refer to the location in the host's hardware memory storage when the simulated target instruction executes the function of the environment, it can be further mapped to the virtual address space used by the host data processing device.

例如,當針對一個指令集架構所編寫之舊有碼係在支援不同指令集架構的主機處理器上執行時,此類模擬程式可係有用的。再者,由於軟體在模擬執行環境上的執行可使軟體測試得以與支援新架構之硬體裝置的進行中開發平行,模擬可允許針對一較新版本的指令集架構的軟體開發在支援該新架構版本的處理硬體就緒之前開始。模擬程式可儲存在儲存媒體上,該儲存媒體可係非暫時性儲存媒體。For example, such simulators can be useful when legacy code written for an instruction set architecture is executed on a host processor that supports a different instruction set architecture. Furthermore, because software execution in a simulator allows software testing to run in parallel with ongoing development on hardware that supports the new architecture, simulation can allow software development for a newer version of the instruction set architecture to begin before the processing hardware supporting that new architecture is ready. Simulators can be stored on a storage medium, which can be a non-transitory storage medium.

下文參考圖式描述具體實例。The following diagrams illustrate specific examples.

圖1繪示資料處理設備2的實例,該資料處理設備例如可以係處理器,例如,中央處理單元(central processing unit, CPU)。設備2包括指令提取/解碼電路系統4,其用於從指令快取記憶體或記憶體提取程式指令以供執行電路系統16執行,且用於解碼該等指令以產生控制信號來控制執行電路系統16執行由該等指令表示的操作。執行電路系統包括數個執行單元20、22、28,用於參考暫存器14中儲存的暫存器狀態來執行各種類別的指令。例如,執行電路系統16可包括:算術/邏輯單元(arithmetic/logic unit, ALU) 20,其用於執行算術運算及邏輯運算(例如,布林運算);分支單元22,其用於執行觸發程式流中的非連續跳轉的分支指令;及加載/儲存單元28,其用於執行加載/儲存操作以將資料從記憶體系統加載至暫存器14或將來自暫存器14的資料儲存至記憶體系統。記憶體系統可包含一或多級快取記憶體及隨機存取記憶體儲存。Figure 1 illustrates an example of a data processing device 2, which may be a processor, such as a central processing unit (CPU). Device 2 includes an instruction fetch/decode circuit system 4, which fetches program instructions from an instruction cache or memory for execution by an execution circuit system 16, and decodes the instructions to generate control signals to control the execution circuit system 16 to execute the operations represented by the instructions. The execution circuit system includes several execution units 20, 22, and 28 for executing various types of instructions by referring to register states stored in register 14. For example, the execution circuit system 16 may include: an arithmetic/logic unit (ALU) 20 for performing arithmetic and logical operations (e.g., Boolean operations); a branch unit 22 for executing branch instructions that trigger discontinuous jumps in the program flow; and a load/store unit 28 for performing load/store operations to load data from the memory system to register 14 or store data from register 14 to the memory system. The memory system may include one or more levels of cache memory and random access memory storage.

記憶體管理單元(memory management unit, MMU) 6係位址轉譯電路系統的實例,經提供以支援加載/儲存單元28執行記憶體存取操作(加載/儲存操作)並且支援指令提取電路系統4從記憶體系統提取指令。雖然圖1顯示了用於指令提取及由執行的指令觸發的加載/儲存操作二者的單一MMU 6,但將理解,在一些實例中,可提供二個不同的MMU單元,一者用於處置指令提取的記憶體管理功能,且另一者用於處置由加載/儲存單元28執行的加載/儲存操作的記憶體測量功能。The memory management unit (MMU) 6 is an example of an address translation circuit system provided to support the load/store unit 28 in performing memory access operations (load/store operations) and to support the instruction fetch circuit system 4 in fetching instructions from the memory system. Although Figure 1 shows a single MMU 6 for both instruction fetching and load/store operations triggered by executed instructions, it will be understood that in some examples, two different MMU units may be provided, one for handling the memory management functions of instruction fetching and the other for handling the memory measurement functions of the load/store operations performed by the load/store unit 28.

MMU 6基於使用在記憶體系統中儲存的轉譯表結構指定的位址映射資訊及記憶體屬性資訊來控制對記憶體系統的存取。位址映射資訊用以在虛擬位址空間中的虛擬位址(用以識別待提取的可執行指令及/或待由加載/儲存操作存取的目標資料)與實體位址空間中的實體位址(由底層記憶體系統用以識別所需指令及/或資料的儲存位置)之間進行轉譯。記憶體屬性資訊可以指定權限或記憶體區域屬性,該等權限或記憶體區域屬性用以控制是否允許給定的記憶體存取請求存取對應記憶體位址處的資訊及/或控制如何在CPU 2內或在記憶體系統本身中處理對彼位址的記憶體存取操作。轉譯表結構由在設備2上執行的軟體設定。軟體可將轉譯表結構的轉譯表條目寫入記憶體系統,且設定在MMU 6的基址暫存器中儲存的基底位址以指示可以存取轉譯表結構的位置。對基底位址暫存器的更新可能限於以給定特權等級或更高特權等級執行的軟體(例如,可能不允許應用程式層級軟體更新基底位址暫存器,但可允許作業系統層級或超管理器層級軟體更新基底位址暫存器)。MMU 6 controls access to the memory system based on address mapping information and memory attribute information specified by a translation table structure stored in the memory system. The address mapping information is used to translate between virtual addresses in the virtual address space (used to identify executable instructions to be fetched and/or target data to be accessed by load/store operations) and physical addresses in the physical address space (used by the underlying memory system to identify the storage location of the required instructions and/or data). Memory attribute information can specify permissions or memory region attributes that control whether a given memory access request is allowed to access information at the corresponding memory address and/or control how memory access operations to that address are processed within CPU 2 or in the memory system itself. The translation table structure is set by software running on device 2. The software can write translation table entries of the translation table structure into the memory system and set the base address stored in the base address register of MMU 6 to indicate the location where the translation table structure can be accessed. Updates to the base address register may be limited to software running at a given privilege level or higher (e.g., application-level software may not be allowed to update the base address register, but operating system-level or super-manager-level software may be allowed to update the base address register).

MMU 6包括一或多個轉譯後備緩衝器(TLB) 8,其用於快取衍生自記憶體系統中儲存的轉譯表結構的資訊,使得與必須再次從記憶體獲得相同資訊的情況相比,可以更快地處理可以再利用已經從記憶體系統獲得的用於先前存取的轉譯表資訊的未來記憶體存取。若對於給定記憶體存取,所需資訊在TLB 8中不可用,則表走訪電路系統12可以執行轉譯表走訪操作以向記憶體系統發布一或多個記憶體存取請求,用於定位所需的轉譯表資訊。在一些實例中,此一轉譯表走訪操作可能涉及一系列相關記憶體存取以遍歷多個層級的轉譯表,其中轉譯表結構的較高層級的表包括引用較低層級的表中的條目的指標。MMU 6 includes one or more Translation Backup Buffers (TLBs) 8 for caching information derived from a translation table structure stored in the memory system. This allows future memory accesses to be processed more quickly than if the same information had to be retrieved from memory again, as the translation table information already retrieved from the memory system for previous accesses can be reused. If the required information is not available in TLB 8 for a given memory access, the table walk circuit system 12 can perform a translation table walk operation to issue one or more memory access requests to the memory system to locate the required translation table information. In some instances, this translation table walkthrough may involve a series of related memory accesses to traverse multiple levels of translation tables, where higher-level tables in the translation table structure include pointers that reference entries in lower-level tables.

如圖2所顯示,在一些實例中,MMU 6可支援二階段位址轉譯體系,其中在虛擬位址空間40與實體位址空間52之間的轉譯包括第一位址轉譯階段及第二位址轉譯階段。給定記憶體存取操作的目標位址由指令提取電路系統4或執行電路系統16指定為虛擬位址空間40中的目標虛擬位址42。在第一位址轉譯階段中,基於階段1轉譯表結構44(如上文提及,其可包含多個層級的表)中定義的位址映射資訊,將目標虛擬位址42映射至中間位址空間46中的目標中間位址48。在第二位址轉譯階段中,基於階段二轉譯表結構50(其亦可包含多個層級的表)中定義的位址映射資訊,將目標中間位址48映射至實體位址空間52中的目標實體位址54。階段一轉譯表結構44可由作業系統控制,且階段二轉譯表結構50可由超管理器控制(亦即,用以提供階段1及階段2轉譯表44、50的基底位址的基底位址暫存器的更新可限制為由以作業系統層級特權或更高特權執行的指令(對於階段1轉譯表基底位址)或由超管理器層級特權或更高特權執行的指令(對於階段2轉譯表基底位址)進行。As shown in Figure 2, in some implementations, MMU 6 can support a two-stage address translation system, where the translation between virtual address space 40 and physical address space 52 includes a first address translation stage and a second address translation stage. The target address for a given memory access operation is specified by instruction fetch circuit system 4 or execution circuit system 16 as the target virtual address 42 in virtual address space 40. In the first address translation stage, the target virtual address 42 is mapped to the target intermediate address 48 in intermediate address space 46 based on the address mapping information defined in the stage 1 translation table structure 44 (as mentioned above, which may contain multiple levels of tables). In the second address translation stage, based on the address mapping information defined in the stage two translation table structure 50 (which may also contain tables at multiple levels), the target intermediate address 48 is mapped to the target physical address 54 in the physical address space 52. The Phase 1 translation table structure 44 can be controlled by the operating system, and the Phase 2 translation table structure 50 can be controlled by the super administrator (that is, the update of the base address register used to provide the base addresses of the Phase 1 and Phase 2 translation tables 44 and 50 can be restricted to instructions executed by operating system level privileges or higher (for the Phase 1 translation table base address) or instructions executed by super administrator level privileges or higher (for the Phase 2 translation table base address).

二階段位址轉譯有助於支援虛擬化,其中數個不同的客戶作業系統(各自管理由作業系統管理的應用程式的階段1轉譯表44的對應集合)共存於相同硬體平台上。各客戶作業系統可以表現得如同其係唯一存在的作業系統,且從作業系統的角度來看,階段1轉譯中產生的中間位址可能看起來係引用記憶體系統位置的實體位址。然而,由於不同的客戶作業系統可能為由各別作業系統使用的不同資料項或由作業系統管理的應用程式指定了相同的中間位址,超管理器可以設定用於各客戶作業系統的階段2轉譯表50,以確保為不同客戶作業系統指定的相同中間位址值可以取決於哪個客戶作業系統在作用中而映射至實體位址空間52中的不同實體位址。超管理器可更新階段2基底位址暫存器,該階段2基底位址暫存器識別在客戶作業系統之間的上下文切換中階段2轉譯表50的位置(類似地,作業系統可更新階段1基底位址暫存器,該階段1基底位址暫存器識別在應用程式之間的上下文切換中階段1轉譯表44的位置,以管理數個不同轉譯表結構之間的切換)。Two-stage address translation facilitates virtualization, where several different client operating systems (each managing a corresponding set of Stage 1 translation tables 44 for applications managed by the operating system) coexist on the same hardware platform. Each client operating system can behave as if it were a unique operating system, and from the operating system's perspective, the intermediate addresses generated in Stage 1 translation may appear to be physical addresses referencing memory system locations. However, since different client operating systems may specify the same intermediate address for different data items used by the respective operating systems or for applications managed by the operating system, the super manager can set up a Stage 2 translation table 50 for each client operating system to ensure that the same intermediate address value specified for different client operating systems can be mapped to different physical addresses in the physical address space 52 depending on which client operating system is in operation. The super manager can update the stage 2 base address register, which identifies the location of stage 2 translation table 50 in context switching between client operating systems (similarly, the operating system can update the stage 1 base address register, which identifies the location of stage 1 translation table 44 in context switching between applications, to manage switching between several different translation table structures).

提供用以產生階段1中的中間位址或階段2中的實體位址54的階段1或階段2位址映射的轉譯表條目稱為頁描述符(區別於表的較高層級處的表描述符,該等表描述符不提供位址映射,而是提供指向表結構的後續層級的指標)。如圖3所顯示,除了經轉譯的位址映射(例如,階段1轉譯的中間位址映射或階段2轉譯的實體位址映射的指示)之外,頁描述符60亦可指定記憶體屬性資訊及/或權限,該記憶體屬性資訊指示對應於此頁描述符60的位址空間區域的性質,該等權限指示用於定義規則的資訊,該等規則用於控制是否允許各種類別的記憶體存取操作存取對應於頁描述符60的位址空間區域。如圖3所顯示,雖然一些記憶體屬性資訊可直接在頁描述符60中指定,頁描述符60亦可能指定對提供記憶體屬性資訊的間接表62(例如,儲存在處理器2的暫存器14中)的引用。在屬性資訊的編碼空間受限於頁描述符60本身內的情況中,此可以係有幫助的。直接在頁描述符60中編碼的間接表條目識別符可以指示間接表62的哪個條目指定了相關聯的位址空間區域(頁)的屬性資訊。間接表62的給定條目可具有比頁描述符60本身能夠儲存的容量更大的容量來儲存額外屬性資訊。使用間接亦可以係有幫助的,因為其意指若需要對位址空間的多個不同頁進行對記憶體屬性資訊的相同更新,則可以藉由簡單地更新由許多頁描述符引用的單一間接表條目來更高效地進行此更新,而非個別地更新各頁描述符。因此,將理解,當下文指涉記憶體屬性資訊時,彼資訊可以在用以識別記憶體屬性資訊的轉譯表條目60中直接或間接地指定(間接指定指涉轉譯表條目60含有索引值的情況,該索引值識別提供所需記憶體屬性資訊的間接表62的條目)。The translation table entry that provides the address mapping for either the intermediate address in stage 1 or the physical address 54 in stage 2 is called a page descriptor (distinguished from table descriptors at higher levels of the table, which do not provide address mappings but instead provide pointers to subsequent levels of the table structure). As shown in Figure 3, in addition to the translated address mapping (e.g., an indication of an intermediate address mapping translated in stage 1 or a physical address mapping translated in stage 2), page descriptor 60 may also specify memory attribute information and/or permissions. The memory attribute information indicates the nature of the address space region corresponding to this page descriptor 60, and the permissions indicate information used to define rules used to control whether various types of memory access operations are allowed to access the address space region corresponding to page descriptor 60. As shown in Figure 3, while some memory attribute information can be specified directly in page descriptor 60, page descriptor 60 may also specify references to indirect tables 62 that provide memory attribute information (e.g., stored in register 14 of processor 2). This can be helpful when the encoding space for attribute information is limited within page descriptor 60 itself. Indirect table entry identifiers encoded directly in page descriptor 60 can indicate which entry in indirect table 62 specifies the attribute information of the associated address space region (page). A given entry in indirect table 62 can have a larger capacity than page descriptor 60 itself can store for additional attribute information. Using indirection can also be helpful because it means that if the same update to memory attribute information is required for multiple different pages in the address space, this update can be performed more efficiently by simply updating a single indirect table entry referenced by many page descriptors, rather than updating each page descriptor individually. Therefore, it will be understood that when referring to memory attribute information below, that information can be specified directly or indirectly in the translation table entry 60 used to identify the memory attribute information (indirect specification refers to the case where the translation table entry 60 contains an index value that identifies an entry in the indirect table 62 that provides the required memory attribute information).

除了支援如圖2所顯示的二階段位址轉譯體系之外,MMU 6亦可支援涉及單一位址轉譯階段的其他轉譯體系(直接從虛擬位址到實體位址,使用類似於圖2所顯示的階段1及階段2轉譯表44、50的(可能係多層級)轉譯表的集合。當支援多種轉譯體系時,在給定時間使用哪種特定轉譯體系可能取決於例如處理器的目前操作狀態。例如,在暫存器14中儲存的目前操作模式、異常/特權等級及/或其他控制資訊可用以判定目前使用的轉譯體系。In addition to supporting the two-stage address translation system shown in Figure 2, MMU 6 can also support other translation systems involving single address translation stages (directly from virtual address to physical address, using a set of translation tables similar to stage 1 and stage 2 translation tables 44 and 50 shown in Figure 2, which may be multi-level). When multiple translation systems are supported, which particular translation system is used at a given time may depend on, for example, the current operating state of the processor. For example, the current operating mode, exception/privilege level, and/or other control information stored in register 14 can be used to determine the currently used translation system.

再次參見圖1,設備2包括標籤檢查電路系統34,其用於支援對加載/儲存單元28進行的記憶體存取操作執行的標籤檢查操作。此類標籤檢查操作對於偵測記憶體安全性錯誤可以係有用的。如稍後所論述的,設備2亦可具有標籤定位位址判定電路系統10及標籤資料存取檢查電路系統32。雖然圖1顯示了標籤檢查電路系統34及標籤資料存取檢查電路系統32與加載/儲存單元28及MMU 6分開的實例,其他實例可以將此等元件作為加載/儲存單元28或MMU 6的部分提供。類似地,雖然在圖1的實例中顯示了標籤定位位址判定電路系統10在MMU 6內,標籤定位位址判定電路系統10亦可以與MMU 6分開地提供。Referring again to Figure 1, device 2 includes a tag checking circuit system 34, which supports tag checking operations performed on memory access operations to the load/store unit 28. Such tag checking operations can be useful for detecting memory security errors. As discussed later, device 2 may also have a tag location address determination circuit system 10 and a tag data access checking circuit system 32. Although Figure 1 shows an example where the tag checking circuit system 34 and the tag data access checking circuit system 32 are separate from the load/store unit 28 and the MMU 6, other examples may provide these components as part of the load/store unit 28 or the MMU 6. Similarly, although the tag location address determination circuit system 10 is shown in the example of Figure 1 within the MMU 6, the tag location address determination circuit system 10 can also be provided separately from the MMU 6.

欲由資料處理設備執行的軟體一般可以高階程式語言寫入,並接著根據由欲在其上執行軟體之設備所支援的指令集架構編譯成碼。例如,軟體最初可以較高階語言(諸如Java、C、或C++)寫入,並接著編譯成原生支援指令集架構(諸如x86或Arm ®)。 Software intended to be executed by a data processing device is typically written in a high-level programming language and then compiled into code according to the instruction set architecture supported by the device on which the software will be executed. For example, the software may initially be written in a higher-level language (such as Java, C, or C++) and then compiled into a natively supported instruction set architecture (such as x86 or Arm® ).

由於一些較高階程式語言(諸如Java)包括運行時間錯誤偵測檢查以用於針對某些與記憶體存取相關的錯誤進行檢查,其等係視為記憶體安全語言。反之,記憶體不安全語言(諸如C及C++)不包括此類運行時間錯誤檢查。持續流行使用記憶體不安全語言意指,在根據給定指令集架構的編譯程式碼中,可存在大量記憶體相關的錯誤,其可能有被攻擊者或其他惡意方利用的弱點。此類錯誤可包括: •     邊界違反,其中由碼供應的陣列索引在陣列的合法邊界外; •     釋放後使用(use-after-free)錯誤,其中在記憶體位置已經解除分配或釋放之後對該記憶體位置進行存取; •     回傳後使用(use-after-return),其中在已從函數回傳之後,對與在函數內所用的變數(諸如堆疊上的值)相關聯之位址進行記憶體存取; •     超出範圍使用(use-out-of-scope)錯誤,其中在變數經宣告的範圍外存取變數;及 •     初始化前使用(use-before-initialisation)錯誤,其中在變數已經初始化之前存取與變數相關聯的記憶體位址。 Because some higher-level programming languages (such as Java) include runtime error detection checks to check for certain memory access-related errors, they are considered memory-safe languages. Conversely, memory-unsafe languages (such as C and C++) do not include such runtime error checks. The continued use of the term "memory-unsafe language" implies that a large number of memory-related errors may exist in compiled code based on a given instruction set architecture, potentially creating vulnerabilities that can be exploited by attackers or other malicious parties. Such errors may include: • Boundary violation, where an array index supplied by the code is outside the legal boundaries of the array; • Use-after-free error, where memory is accessed after the memory location has been deallocated or freed; • Use-after-return, where memory is accessed for an address associated with a variable (such as a value on the heap) used within the function after a return from the function; • Use-out-of-scope error, where a variable is accessed outside its declared scope; and • Use-before-initialisation error, where the memory address associated with a variable is accessed before the variable has been initialized.

這些僅是記憶體相關之錯誤的一些實例,該等錯誤可能導致不可預測的行為,且潛在地提供攻擊者利用的途徑。因此,在由給定處理設備所支援的指令集架構中提供建築支援可係所欲的,以用於輔助在運行時間偵測某些類別之記憶體安全性錯誤。These are just some examples of memory-related errors that can lead to unpredictable behavior and potentially provide avenues for attackers to exploit. Therefore, providing architectural support within the instruction set architecture supported by a given processing device is desirable to assist in the detection of certain classes of memory security errors at runtime.

用於防止上文所論述之類型的某些記憶體使用錯誤的一種方法可係提供儲存在記憶體系統中的分配標籤,該等分配標籤與一或多個記憶體位置之區塊相關聯。當基於從給定位址運算元(例如,在暫存器14之一中儲存的暫存器運算元)計算的目標位址來請求標籤檢查記憶體存取操作時,記憶體存取電路系統可將與給定位址運算元相關聯的位址標籤與分配標籤進行比較,該分配標籤與在基於目標位址識別的記憶體系統中的位置處儲存的資料項相關聯。記憶體存取電路系統可產生是否在分配標籤與位址標籤之間偵測到匹配的指示。此指示可用以控制是否允許記憶體存取成功,或是否後續操作可成功,或可僅當允許記憶體存取照常繼續時予以報告(例如,在錯誤日誌中或藉由在暫存器中設定指示)。分配標籤亦可以稱為「守衛標籤(guard tag)」、「記憶體上色標籤(memory colouring tag)」或「記憶體安全性檢查標籤(memory safety check tag)」。One method to prevent certain types of memory misuse as described above is to provide allocation tags stored in the memory system, which are associated with blocks of one or more memory locations. When a memory access operation is requested to check the tags based on a target address calculated from a given addressing operand (e.g., a register operand stored in one of registers 14), the memory access circuit system can compare the address tag associated with the given addressing operand with the allocation tag, which is associated with a data item stored at a location in the memory system identified based on the target address. The memory access circuitry system can generate an indication of whether a match has been detected between the allocation tag and the address tag. This indication can be used to control whether memory access is allowed to proceed successfully, or whether subsequent operations can succeed, or it can be reported only when memory access is allowed to continue normally (e.g., in an error log or by setting an indication in a register). The allocation tag may also be called a "guard tag," "memory colouring tag," or "memory safety check tag."

此類標籤檢查可係有用的,因為例如基於記憶體不安全語言(諸如C或C++)的軟體可在初始化記憶體區域時設定預期碼對特定值進行存取之與資料項區塊相關聯的分配標籤,且可將對應的位址標籤值與用以產生目標位址以存取彼等區塊的位址指標運算元相關聯。可向意欲用於不同目的的相鄰記憶體區域指派不同的分配標籤值,使得若意欲用於存取彼等區域之一者的位址指標經意外地設定為導致其存取另一區域的值,則可以基於標籤失配來偵測錯誤。因此,若記憶體使用錯誤發生,且例如位址指標超出範圍地使用或延伸超出經初始化之有效範圍的邊界,則與經存取的資料項相關聯的分配標籤有可能可不與用以存取資料項的位址運算元相關聯的位址標籤匹配,且之後在此情況中,是否偵測到匹配的指示可用以觸發錯誤處置回應或錯誤報告機制。所採取之特定回應於可取決於所執行之軟體的特定需求或架構之特定微架構實施方案。因此,即使高階語言不具有用於執行運行時間錯誤檢查以防止記憶體存取錯誤的手段,用於經編譯程式碼的ISA仍可包括用於執行此類檢查的架構特徵。Such tag checks can be useful because software based on memory-unsafe languages (such as C or C++) can set allocation tags associated with data item blocks when initializing memory regions, allowing access to specific values via expected codes. The corresponding address tag values can be associated with the address pointer operands used to generate the target address to access those blocks. Different allocation tag values can be assigned to adjacent memory regions intended for different purposes, so that if the address pointer intended for one region is accidentally set to a value that causes it to access another region, an error can be detected based on tag mismatch. Therefore, if a memory usage error occurs, such as an address pointer being used out of bounds or extending beyond its initialized valid range, the allocation label associated with the accessed data item may not match the address label associated with the address operand used to access the data item. In this case, it remains to be seen whether a matching indication can be detected to trigger an error handling response or error reporting mechanism. The specific response taken may depend on the specific requirements of the software being implemented or the specific microarchitecture implementation of the architecture. Therefore, even if high-level languages do not have means for performing runtime error checks to prevent memory access errors, an ISA for compiled code can still include architectural features for performing such checks.

圖4示意性地繪示由標籤檢查電路系統34回應於標籤檢查記憶體存取而執行的標籤檢查操作的概念。用以提及記憶體系統內之記憶體位置的位址空間可邏輯地分割成數個區塊70,其各自經指派對應分配標籤72。例如,對應於一個標籤72的位址空間區塊可以係16個位元組,舉例而言。如下文進一步所述,可以存在數個方式,其中可以管理在資料項區塊70與其對應標籤72之間的關聯,或基於虛擬化標籤方案,其中MMU 6的位址轉譯功能性用以識別給定區塊70中的資料項及其對應分配標籤72的分開實體位址,或基於實體標籤方案,其中資料項70及其對應分配標籤72二者使用相同的實體位址識別,且記憶體系統負責管理分配標籤72的儲存並且提供用於檢索與給定實體位址相關聯的資料項及/或標籤的機制。因此,存在以各種方式實施資料項70與對應的分配標籤72之間的關聯的靈活性,但通常來說,記憶體位址空間的各區塊70中的資料項能夠與對應的分配標籤值52相關聯。向位址空間的給定區塊50的給定分配標籤指派的特定數值係任意的(例如,由軟體選擇),且可以基於由處理器2支援的指令集架構(instruction set architecture, ISA)中支援的標籤設定指令的執行來控制。類似地,可在ISA中支援為給定位址指標運算元設定位址標籤的指令。Figure 4 schematically illustrates the concept of a tag checking operation performed by the tag checking circuit system 34 in response to a tag checking memory access. The address space used to refer to the memory location within the memory system can be logically divided into several blocks 70, each of which is assigned a corresponding tag 72. For example, the address space block corresponding to a tag 72 can be 16 bytes, for instance. As further described below, there are several ways to manage the association between data item block 70 and its corresponding tag 72, or based on a virtualized tagging scheme, wherein the address translation function of MMU 6 is used to identify the separate physical address of the data item in the given block 70 and its corresponding allocation tag 72, or based on a physical tagging scheme, wherein the data item 70 and its corresponding allocation tag 72 are identified using the same physical address, and the memory system is responsible for managing the storage of allocation tag 72 and providing a mechanism for retrieving data items and/or tags associated with a given physical address. Therefore, there is flexibility in implementing the association between data item 70 and corresponding allocation label 72 in various ways, but generally, data items in each block 70 of the memory address space can be associated with corresponding allocation label values 52. The specific value assigned to a given allocation label of a given block 50 of the address space is arbitrary (e.g., selected by software) and can be controlled based on the execution of label setting instructions supported by the instruction set architecture (ISA) supported by the processor 2. Similarly, instructions for setting address labels for address pointer operands can be supported in the ISA.

因此,當需要經標籤檢查記憶體存取時,位址標籤80(其與用於衍生待存取的資料項的目標位址的位址運算元82相關聯)與分配標籤72作比較,該分配標籤與包括對應於目標位址的資料項84的資料項70的區塊相關聯。例如,在圖4中,目標位址指向資料項B1,在圖4中標記為84。因此,與包括資料項B1之資料項B的區塊相關聯的分配標籤B係從記憶體系統獲得並且針對與目標位址62相關聯的位址標籤60作比較。如圖4之頂部所顯示,位址標籤80可依據用以計算目標位址的位址運算元的所選位元而變動地判定。特定而言,位址標籤80衍生自位址運算元82的一部分,該部分未用以指示用於計算所需資料項84的目標位址的位址位元。例如,在一些ISA中,位址值之位元的頂部部分可總是具有特定的固定值(諸如符號延伸)(全0或全1),且因此可藉由以任意標籤值覆寫此等未經使用位元而以位址標籤80加標位址運算元。特定位址標籤值可由例如程式設計人員或編譯器選擇。位址標籤80及分配標籤72可係相對小的位元數(例如,4位元),且因此在記憶體內及在目標位址內不需佔據太多空間。提供4個位元的標籤空間(即,標籤的16個可能值)常可足以偵測許多共同類型的記憶體存取錯誤。Therefore, when a memory access needs to be checked via a tag, address tag 80 (which is associated with address operand 82 used to derive the target address of the data item to be accessed) is compared with allocation tag 72, which is associated with the block containing data item 70 corresponding to data item 84 at the target address. For example, in Figure 4, the target address points to data item B1, which is labeled 84 in Figure 4. Therefore, allocation tag B associated with the block containing data item B1 is obtained from the memory system and compared with address tag 60 associated with target address 62. As shown at the top of Figure 4, address tag 80 can be dynamically determined based on the selected bits of the address operand used to calculate the target address. Specifically, address label 80 is derived from a portion of address operand 82 that is not used to indicate the address bits used to calculate the target address of the required data item 84. For example, in some ISAs, the top portion of the address value's bits may always have a specific fixed value (such as sign extension) (all 0s or all 1s), and thus the address operand can be labeled with address label 80 by overwriting these unused bits with any label value. The specific address label value may be selected by, for example, a programmer or compiler. Address label 80 and allocation label 72 may be relatively small in number of bits (e.g., 4 bits), and therefore do not need to occupy much space in memory or at the target address. Providing a 4-bit label space (i.e., 16 possible values for the label) is often sufficient to detect many common types of memory access errors.

因此,當執行標籤檢查記憶體存取時,標籤檢查電路系統34比較從位元運算元獲得的位址標籤80與從記憶體系統獲得的分配標籤72,且判定其等是否匹配。標籤檢查電路系統34產生指示位址標籤80與分配標籤72是否匹配的匹配指示。例如,此匹配指示可係錯誤信號,其在位址標籤80與分配標籤72之間存在失配時產生;或可係經放置在狀態暫存器中的指示,其指示是否存在標籤匹配;或可係經添加至錯誤報告的條目,其用以指示偵測到錯誤的位址及/或觸發錯誤之指令的指令位址。是否在分配標籤與位址標籤之間偵測到匹配而產生的指示之特定形式在不同實施方案之間可變化。Therefore, when performing a tag check memory access, the tag check circuit system 34 compares the address tag 80 obtained from the bit arithmetic units with the allocation tag 72 obtained from the memory system and determines whether they match. The tag check circuit system 34 generates a match indication indicating whether the address tag 80 and the allocation tag 72 match. For example, this match indication may be an error signal generated when there is a mismatch between the address tag 80 and the allocation tag 72; or it may be an indication placed in a status register indicating whether a tag match exists; or it may be an entry added to an error report to indicate the address where an error was detected and/or the instruction address that triggered the error instruction. Whether a match is detected between the assignment label and the address label, and the specific form of the resulting indication, can vary between different implementation schemes.

在一些情況中,標籤檢查操作可包含取決於是否在分配標籤與位址標籤之間偵測到匹配而控制是否允許記憶體存取與目標位址相關聯的資料項。In some cases, tag checking operations may include controlling whether memory access is allowed for data items associated with a target address, depending on whether a match is detected between the allocation tag and the address tag.

然而,在其他實例中,標籤檢查記憶體存取可包含無論是否在分配標籤72與位址標籤80之間偵測到匹配,均執行對與目標位址相關聯的資料項的記憶體存取。例如,在一些情況中,存取分配標籤有時可能需要向記憶體發送分開的讀取請求,與對應資料項的請求分開。由此,若對資料項的記憶體存取經延遲直到已經比較分配標籤及位址標籤為止,則可能延遲實際記憶體存取的處理,因此可能期望在分配標籤可用之前執行對資料項的記憶體存取,且接著在分配標籤可用後檢查分配標籤。However, in other instances, tag-based memory access checks may involve performing a memory access to the data item associated with the target address regardless of whether a match is detected between allocation tag 72 and address tag 80. For example, in some cases, accessing the allocation tag may sometimes require sending separate read requests to memory, separate from the requests for the corresponding data item. Thus, if a memory access to the data item is delayed until the allocation tag and address tag have been compared, the actual memory access processing may be delayed. Therefore, it may be desirable to perform a memory access to the data item before the allocation tag becomes available, and then check the allocation tag after it becomes available.

在一個實例中,是否偵測到匹配的指示可係表示錯誤狀況的信號,其在分配標籤與位址標籤之間偵測到失配時產生。例如,若違反存取權限或存取未經映射的位址,則記憶體存取電路系統可傳訊類似的記憶體錯誤至所產生的錯誤,或者可指示不同種類的錯誤狀況。錯誤信號可以觸發處理電路系統執行異常處置例程來回應於所偵測的錯誤,且可以防止記憶體存取成功(或者若直到已經發起記憶體存取之後的某個時間為止才偵測到標籤失配,則阻止程式碼前進超過偵測到標籤失配時的點)。In one example, the indication of whether a match was detected could be a signal indicating an error condition, generated when a mismatch is detected between the allocation tag and the address tag. For example, if an access permission is violated or an unmapped address is accessed, the memory access circuitry system could signal a similar memory error to the resulting error, or it could indicate a different type of error condition. Error signals can trigger the processing circuit system to execute exception handling routines in response to the detected error, and can prevent successful memory access (or prevent code from advancing beyond the point where the label mismatch is detected if the label mismatch is not detected until some time after the memory access has been initiated).

替代地,狀態指示可記錄在設備之處理電路系統可存取的控制暫存器內,以指示比較分配標籤與位址標籤時偵測到匹配或失配。狀態資訊接著可由後續指令讀取以檢查記憶體存取是否有效。Alternatively, a status indication can be recorded in a control register accessible by the device's processing circuitry to indicate whether a match or mismatch was detected when comparing the assignment tag and the address tag. The status information can then be read by subsequent instructions to check if the memory access is valid.

用於報告位址標籤與分配標籤為匹配或失配的另一選項可係在與所執行的碼片段相關聯的錯誤日誌中記錄資訊,其追蹤在整個碼片段中所偵測的任何分配標籤錯誤。例如,回應於失配的分配標籤與位址標籤,可將觸發失配的目標位址或觸發失配記憶體存取之指令的指令位址記錄在錯誤記錄中,例如該錯誤記錄可儲存在記憶體中。在此情況下,與其執行任何特定行動來阻礙代碼操作,可單純將錯誤記錄在錯誤記錄中。接著可使錯誤日誌可為碼的軟體提供者所用,以協助提供者審查碼的錯誤並且識別開發區域,用於在後續的軟體版本中排除錯誤。Another option for reporting matching or mismatched address and allocation tags is to log information in an error log associated with the executed code segment, tracking any allocation tag errors detected throughout the code segment. For example, in response to a mismatched allocation and address tag, the target address that triggered the mismatch or the instruction address that triggered the mismatched memory access could be logged in the error log, which could be stored in memory. In this case, instead of performing any specific action to block code operation, the error could simply be logged in the error log. The error log can then be used by the software provider to help them review the code for errors and identify development areas for bug fixing in subsequent software versions.

因此,將理解有各種各樣的方法,其中可由記憶體存取電路系統產生標籤匹配/失配指示(且因此有可以採取的各種各樣的可能的錯誤處置回應)。Therefore, it will be understood that there are various methods in which the memory access circuitry system can generate tag match/mismatch indications (and thus there are various possible error handling responses that can be taken).

在一些實例中,各可定址資料項可以具有其自己的分配標籤(例如,圖4所顯示的各區塊70可以包含單一位元組的記憶體)。In some instances, each addressable data item may have its own allocation label (e.g., each block 70 shown in Figure 4 may contain memory of a single byte).

然而,實際上,針對各可定址資料項(例如,記憶體位址空間的各位元組)設定個別分配標籤的管理負擔可太高,且使各分配標籤與多個位元組的位址空間的區塊相關聯可係更高效的。在此情況中,包含記憶體中的幾個相鄰位元組(各位元組可由對應於區塊70內的資料項的不同位址個別地定址)的區塊70可共用相同的分配標籤,此可以足以偵測常見形式的記憶體相關錯誤。However, in practice, the management burden of setting individual allocation labels for each addressable data item (e.g., each byte of memory address space) can be too high, and associating each allocation label with a block of address space containing multiple bytes can be more efficient. In this case, a block 70 containing several adjacent bytes in memory (each byte can be individually addressed by a different address corresponding to a data item within block 70) can share the same allocation label, which is sufficient to detect common forms of memory-related errors.

位址標籤可以不同方式與目標位址相關聯。在一些情況中,位址標籤可例如使用由觸發標籤檢查記憶體存取操作之標籤檢查記憶體存取指令指定之分開的暫存器而與標籤位址分離地指定。然而,在其他實例(如圖4所顯示)中,位址標籤可根據目標位址之一或多個經選擇擇位元而判定。也就是說,位址標籤可包含衍生自目標位址本身之一部分的資訊。在很多情況中,雖然指令集架構可支援具有某一位址位元數(例如,64位元)的位址,給定的硬體裝置實際上可不需要如此多的記憶體容量,以至於其將使用可使用該位址位元數表示的所有可行位址。例如,隨著裝置使用的當前趨勢,尚未有任何提供2 64個別可定址位置的需求。因此,在很多情況下,記憶體位址的一些位元可有效地未經使用,並可總是具有相同值或經設定為最高有效「實(real)」位址位元的符號延伸(使得未經使用部分經設定為全0或全1)。此未經使用部分因而可再利用以表示位址標籤或用於衍生位址標籤的值,以避免需要存取分開的暫存器以便得到位址標籤,且亦使其更容易追蹤位址與對應位址標籤之間的對應性,因為每當位址經操縱或在暫存器之間移動時,位址標籤按照定義可與位址一同傳輸。 Address tags can be associated with target addresses in different ways. In some cases, the address tag can be specified separately from the tag address, for example, using a separate register specified by a tag-check memory access instruction that triggers a tag-check memory access operation. However, in other instances (as shown in Figure 4), the address tag can be determined based on one or more select bits of the target address. That is, the address tag can contain information derived from a portion of the target address itself. In many cases, although the instruction set architecture may support addresses with a certain number of address bits (e.g., 64 bits), a given hardware device may not actually need so much memory capacity that it will use all feasible addresses that can be represented using that number of address bits. For example, given the current trend in device usage, there is no current need to provide 264 individually addressable locations. Therefore, in many cases, some bits of a memory address can be effectively unused and can always have the same value or be a sign extension of the most significant "real" address bit (so that the unused portion is set to all 0s or all 1s). This unused portion can thus be reused to represent address tags or to derive values from address tags, avoiding the need to access separate registers to obtain address tags and making it easier to track the correspondence between addresses and corresponding address tags, since the address tag, by definition, can be transmitted along with the address whenever it is manipulated or moved between registers.

在使用目標位址的一部分以判定位址標籤的實例中,須注意此位址標籤不同於目標位址的標籤部分,該標籤部分可由快取記憶體使用以衍生用以判定與目標位址相關聯的資訊是否儲存在快取記憶體內的快取標籤。許多快取方案可將經快取資料片段的位址之一標籤部分儲存在快取記憶體內之該資料旁邊,使得在快取記憶體內搜尋給定位址方面,可比較該位址之部分與儲存在經快取資料旁邊的快取標籤,以判定該經快取資料是否實際對應於該所需位址。然而,在此情況中,與快取記憶體中儲存的標籤相比之位址的標籤部分將衍生自實際上識別請求存取的特定資料項的位址部分的部分,亦即,改變位址的快取標籤部分按照定義將得出指向記憶體系統內之不同經定址位置的位址且導致讀取/寫入操作對不同的資料項進行操作。反之,在位址標籤80用於標籤檢查記憶體操作的情況中,記憶體存取電路系統可獨立於位址標籤80選擇儲存所需資料項的位置。亦即,即使位址運算元內的位址標籤80具有不同的值,目標位址所引用的記憶體中的位置仍然可能相同。在記憶體中存取所需資料項的位置的選擇僅取決於目標位址的除了位址標籤80之外的其他部分。此給出編譯器將與特定位址相關聯的位址標籤設定為任何值以匹配於已分配給記憶體系統中的相關資料區塊之對應分配標籤值的自由度。In instances where a portion of a target address is used to determine an address label, it's important to note that this address label is distinct from the label portion of the target address. This label portion can be used by the cache to derive a cache label used to determine whether information associated with the target address is stored in the cache. Many caching schemes store a label portion of one address of a cached data segment next to that data in the cache, allowing for comparison of that address portion with the cache label stored next to the cached data when searching for a given address in the cache, to determine whether the cached data actually corresponds to the desired address. However, in this case, the tag portion of the address, compared to the tag stored in the cache, will be derived from the portion of the address that actually identifies the specific data item requested for access. That is, changing the address of the cache tag portion, by definition, will result in addresses pointing to different locating locations within the memory system, causing read/write operations to operate on different data items. Conversely, when address tag 80 is used for tag-checking memory operations, the memory access circuitry can independently select the location to store the required data item based on address tag 80. In other words, even if the address tag 80 within the address operand has different values, the location in memory referenced by the target address may still be the same. The choice of location for accessing the required data item in memory depends only on the portion of the target address other than address label 80. This output compiler has the freedom to set the address label associated with a specific address to any value to match the corresponding allocation label value of the relevant data block allocated in the memory system.

在一些實施方案中,指令解碼器可支援記憶體存取指令之分開的非標籤檢查及標籤檢查變體。在此情況中,標籤檢查記憶體存取操作可回應於記憶體存取指令之標籤檢查變體而觸發。反之,非標籤檢查記憶體存取指令可單純觸發對由該指令所指定之目標位址識別之經定址位置的存取,而不需得到分配標籤或執行位址標籤與分配標籤之間的任何比較。In some implementations, the instruction decoder may support separate unlabeled and labeled variants of memory access instructions. In this case, a labeled memory access operation can be triggered in response to a labeled variant of the memory access instruction. Conversely, an unlabeled memory access instruction can simply trigger an access to the addressed location identified by the target address specified by the instruction, without requiring an allocation tag or performing any comparison between the address tag and the allocation tag.

然而,在其他實施方案中,可將所有記憶體存取視為標籤檢查記憶體存取。因此,在一些情況中,可將任何記憶體存取指令視為觸發記憶體存取電路系統以如上文所論述般執行標籤檢查記憶體存取操作。However, in other implementations, all memory accesses can be viewed as tag-check memory accesses. Therefore, in some cases, any memory access instruction can be considered as triggering the memory access circuitry to perform a tag-check memory access operation as described above.

然而,即使所有記憶體存取指令均解譯為標籤檢查記憶體存取指令,指令集架構仍可以其他方式支援針對某些操作選擇性地禁用分配標籤比較。例如,處理設備之控制暫存器內的控制參數可選擇性地禁用標籤比較。However, even if all memory access instructions are interpreted as tag-check memory access instructions, the instruction set architecture can still support selectively disabling assignment tag comparisons for certain operations in other ways. For example, control parameters in the control registers of a processing device can be selectively disabled for tag comparisons.

另外,如下所述,直接或間接地在與目標位址相關聯的轉譯表條目中編碼的記憶體屬性資訊可以指定所存取的記憶體區域係需要執行標籤檢查的有標籤記憶體區域,亦或不需要執行標籤檢查的無標籤記憶體區域。因此,即使對於相同的指令編碼,是否執行標籤檢查可取決於由MMU 6存取的轉譯表條目中為目標位址設定的記憶體屬性資訊。Furthermore, as described below, the memory attribute information encoded directly or indirectly in the translation table entry associated with the target address can specify whether the accessed memory region is a tagged memory region that requires tag checking or an untagged memory region that does not require tag checking. Therefore, even for the same instruction encoding, whether tag checking is performed depends on the memory attribute information set for the target address in the translation table entry accessed by MMU 6.

另一選項係將位址標籤或分配標籤的特定值解譯為「匹配所有(match all)」值,使得針對相對標籤的任何可行值、再次有效地禁用標籤比較的效應將「匹配所有」標籤值視為匹配,使得無論位址標籤是否匹配分配標籤均無報告錯誤。因此,在一些情況中,標籤檢查中的比較可係偵測在分配標籤72與位址標籤80之間是否存在失配,但並非所有分配/位址標籤72、80的值不同的情況皆需要偵測為觸發錯誤處置回應的失配,由於若分配標籤72及位址標籤80中的一者或二者係「匹配所有」標籤,則不需要觸發錯誤處置回應。Another option is to interpret a specific value of the address label or assignment label as a "match all" value. This effectively disables the effect of label comparison for any feasible value of the relative label, treating "match all" label values as matches, so that no error is reported regardless of whether the address label matches the assignment label. Therefore, in some cases, the comparison in label checking can detect whether there is a mismatch between assignment label 72 and address label 80. However, not all cases where the values of assignment/address labels 72 and 80 are different need to be detected as mismatches that trigger an error handling response. Since if one or both of assignment label 72 and address label 80 are "match all" labels, no error handling response needs to be triggered.

圖5、圖6及圖7繪示一些實例使用情況,顯示了對此類標籤檢查的支援可以如何幫助捕獲記憶體安全性使用錯誤,諸如超出範圍使用或釋放後使用錯誤。圖5繪示由負責出於特定目的分配記憶體區域的軟體(例如,作業系統)執行的步驟,以設定與分配的記憶體區域相關聯的分配標籤值。如圖5的左側部分所顯示,最初存在目前未出於任何特定目的分配的空閒記憶體區域,其初始指派的分配標籤值為4(在此實例中,各16位元組資料顆粒具有分開的分配標籤值)。在記憶體分配操作之後,其中空閒記憶體區域的一部分經分配用於儲存特定資料,記憶體分配軟體執行標籤設定指令以將與新分配的資料區域相關聯的分配標籤值設定為不同的值6,以區別於周圍記憶體區域的分配標籤值4。當記憶體分配軟體稍後解除分配相同區域時,其將經解除分配的區域的分配標籤值更新為與解除分配之前的值(標籤=6)不同的值(標籤=7)。圖5所顯示的特定分配標籤值係任意選擇的(例如,經解除分配的記憶體區域的新分配標籤值7係任意的,且可以替換為2或3或不同於4或6的任何其他值、為相鄰區域中的分配標籤設定的值及在解除分配之前為經解除分配的區域的分配標籤設定的值)。然而,通常,分配軟體將旨在確保在分配或解除分配記憶體時更新與給定記憶體區域相關聯的分配標籤值,使得當在空閒區域及經分配區域之間轉變時或在出於不同目的分配的經分配區域之間轉變時,分配標籤值發生改變。Figures 5, 6, and 7 illustrate some example use cases, showing how support for this type of tagging can help catch memory security usage errors, such as out-of-scope use or use after release errors. Figure 5 illustrates the steps performed by software (e.g., an operating system) responsible for allocating memory regions for a specific purpose to set allocation tag values associated with the allocated memory regions. As shown in the left portion of Figure 5, there is initially a free memory region that has not yet been allocated for any specific purpose, and its initial assigned allocation tag value is 4 (in this example, each 16-byte data grain has a separate allocation tag value). After a memory allocation operation, a portion of the free memory area is allocated to store specific data. The memory allocation software executes a tag setting instruction to set the allocation tag value associated with the newly allocated data area to a different value of 6, distinguishing it from the allocation tag value of 4 for surrounding memory areas. When the memory allocation software subsequently dealslocates the same area, it updates the allocation tag value of the deallocated area to a different value (tag=7) than the value before deallocation (tag=6). The specific allocation tag values shown in Figure 5 are arbitrarily chosen (for example, the new allocation tag value 7 for the deallocated memory region is arbitrary and can be replaced by 2 or 3 or any other value different from 4 or 6, the value set for the allocation tag in adjacent regions, and the value set for the allocation tag of the deallocated region before deallocation). However, typically, allocation software will be designed to ensure that the allocation tag values associated with a given memory region are updated when allocating or deallocating memory, such that the allocation tag values change when transferring between free and allocated regions or when transferring between allocated regions allocated for different purposes.

圖6繪示可以如何使用標籤檢查來偵測指標的越界使用,根據圖5的中間部分設定記憶體區域的分配標籤值(在分配有分配標籤值6的記憶體區域的解除分配之前)。從記憶體加載的給定位址指標「ptr」用作位址運算元來產生記憶體的目標位址。產生執行中的軟體的軟體開發人員或編譯器希望使用此指標來引用指派了分配標籤值6的資料區域86,且因此在分配點處,指標「ptr」類似地經指派了位址標籤值6。因此,為了在界限內正確使用指標「ptr」,基於指標計算的位址落在資料區域86內,從記憶體系統獲得的分配標籤72具有值6,且從用以計算目標記憶體位址的位址運算元(指標)獲得的位址標籤80亦具有值6,因此產生標籤匹配指示,且不需要觸發任何錯誤回應。Figure 6 illustrates how tag checking can be used to detect out-of-bounds use of a pointer, setting the allocation tag value of a memory region according to the middle portion of Figure 5 (before the deallocation of the memory region assigned the allocation tag value 6). The assigned address pointer "ptr" loaded from memory is used as an address operand to generate the target address of the memory. The software developer or compiler that generates the executing software wants to use this pointer to reference the data region 86 assigned the allocation tag value 6, and therefore at the allocation point, the pointer "ptr" is similarly assigned the address tag value 6. Therefore, in order to use the pointer "ptr" correctly within the limits, the address calculated based on the pointer falls within the data area 86. The allocation tag 72 obtained from the memory system has a value of 6, and the address tag 80 obtained from the address operand (pointer) used to calculate the target memory address also has a value of 6. Thus, a tag matching indication is generated, and no error response needs to be triggered.

然而,有時相同的指標「ptr」可越界使用,以在與意欲使用該指標存取的區域86不同的記憶體位址區域88中產生目標位址。例如,資料區域86可以已經分配為緩衝器資料結構,資料項可以被推送到該緩衝器資料結構以供另一軟體程序處理。緩衝器資料結構可能已經分配為具有對應於經分配的資料區域86的範圍的某個最大大小,且對於強大的記憶體安全軟體而言,軟體開發人員或編譯器最好確保軟體包括一或多個指令,以在將進一步的資料推送到緩衝器上之前檢查緩衝器溢位。然而,一些軟體開發人員可能忘記在軟體碼中包括此類安全性檢查,因此若碼執行了太多將資料推送到緩衝器上的函數實例,則用以追蹤應插入資料的緩衝器的下一點的位址指標可能延伸越界,超出為緩衝器分配的區域86。此可能存在損壞超出為緩衝器分配的區域86的記憶體區域中的其他資料的風險(在此實例中,超出緩衝器的區域係空閒區域,因此錯誤可能不一定導致功能不正確,但亦可能已經分配用於其他資料,該資料可能因指標「ptr」的越界使用而損壞)。此導致風險,由於(雖然緩衝器溢位本身可能不總係問題,但)可能被攻擊者利用,旨在中斷受害軟體的操作或導致分支到有害的小工具碼,使攻擊者能夠存取他們本來可以存取的資訊。然而,藉由支援記憶體標籤,可以使用標籤檢查來偵測指標「ptr」的此類越界使用,因為對於使用指標存取的位址空間區域92,位址標籤值6將與分配標籤值4不匹配。因此,可以產生標籤失配的指示且該指示用以防止記憶體存取繼續進行及/或產生錯誤報告,該錯誤報告可以回傳到軟體開發人員,以幫助他們修補其碼中的漏洞或可能錯誤。However, sometimes the same pointer "ptr" can be used out of bounds to generate a target address in a memory address region 88 that is different from the region 86 to which the pointer is intended to be accessed. For example, data region 86 may have been allocated as a buffer data structure, to which data items can be pushed for processing by another software program. The buffer data structure may have been allocated with a maximum size corresponding to the range of the allocated data region 86, and for robust memory security software, software developers or compilers should ideally ensure that the software includes one or more instructions to check for buffer overflow before pushing further data onto the buffer. However, some software developers may forget to include such security checks in their software code. Therefore, if too many function instances that push data to the buffer are executed, the address pointer used to track the next point in the buffer where data should be inserted may extend out of bounds, beyond the region 86 allocated to the buffer. This could potentially corrupt other data in the memory region beyond the region 86 allocated to the buffer (in this example, the region beyond the buffer is an empty region, so the error may not necessarily lead to incorrect functionality, but it may have already been allocated for other data, which could be corrupted due to the out-of-bounds use of the pointer "ptr"). This poses a risk because (although buffer overflow itself may not always be a problem,) it can be exploited by attackers to interrupt the operation of the victim software or to branch into harmful utility code, allowing attackers to access information they would otherwise have access to. However, by supporting memory tags, tag checking can be used to detect such out-of-bounds use of the pointer "ptr," because for address space region 92 accessed using the pointer, the address tag value 6 will not match the allocated tag value 4. Therefore, a label mismatch indication can be generated to prevent memory access from continuing and/or an error report can be generated that can be sent back to the software developer to help them fix vulnerabilities or potential errors in their code.

類似地,圖7顯示即使指標在預期的位址界限內使用,可能存在基於指標用以控制對給定位址空間區域的記憶體存取的時序的時間錯誤。當資料儲存在給定記憶體區域86中時,可能已經建立了給定位址指標「ptr」以供在有限的週期內使用,但在彼記憶體區域已經解除分配之後,指標可能仍然存在於記憶體中,且可能意外地用以計算另一記憶體存取的目標位址,此可能存在破壞現在儲存在不應使用指標「ptr」存取的相同記憶體區域中的資料的風險。由於在解除分配給定資料區域6時,分配標籤值從6更新為9,在解除分配之前產生的指標(其將與位址標籤6相關聯)的使用可以基於在位址標籤6與分配標籤9之間的失配來偵測,且再次用以觸發錯誤報告。Similarly, Figure 7 illustrates that even when a pointer is used within its intended address bounds, there may be timing errors in the timing of memory accesses to a given address space region based on the pointer. When data is stored in a given memory region 86, a given address pointer "ptr" may have been created for use within a finite number of cycles, but after that memory region has been deallocated, the pointer may still remain in memory and may be accidentally used to calculate the target address for another memory access. This could potentially corrupt data now stored in the same memory region that should not be accessed using the pointer "ptr". Since the allocation label value is updated from 6 to 9 when the allocated data area 6 is deallocated, the use of the pointer generated before deallocation (which will be associated with address label 6) can be detected based on the mismatch between address label 6 and allocation label 9, and used again to trigger an error report.

將理解,圖6及圖7僅顯示可以使用此類標籤檢查偵測的一些種類的記憶體使用錯誤,但通常,對將位址標籤指派給在與對應資料項相關聯的記憶體中儲存的位址指標及分配標籤的支援可以幫助捕獲記憶體安全性錯誤,此可以幫助軟體開發人員開發出更強大且安全的程式碼。It will be understood that Figures 6 and 7 only show some types of memory usage errors that can be detected using these tags. However, in general, support for assigning address tags to address pointers stored in memory associated with the corresponding data items and for allocating tags can help catch memory security errors, which can help software developers develop more robust and secure code.

圖8繪示由標籤檢查電路系統34執行的用於標籤檢查操作的步驟。在步驟800,回應於經標籤檢查記憶體存取指令,標籤檢查電路系統34從位址運算元82獲得位址標籤80,該位址運算元用以計算回應於經標籤檢查記憶體存取指令而存取的資料項的目標位址。再者,標籤檢查電路系統34從與由記憶體存取指令的目標位址識別的資料項相關聯的記憶體系統獲得分配標籤72。在步驟802,標籤檢查電路系統34比較位址標籤80及分配標籤72,且在步驟804偵測是否偵測到標籤失配。通常,當位址運算元不等於分配標籤時,可能偵測到標籤失配。然而,在一些實例中,可支援「匹配所有」值,因此若位址運算元或分配標籤之一具有「匹配所有」值,則無論其他標籤的值如何,皆可偵測到標籤匹配。若偵測到標籤匹配(例如,因為位址標籤80及分配標籤72相等,或者因為標籤之一具有匹配所有值),則在步驟806不需要傳訊標籤失配錯誤。若偵測到標籤失配,則在步驟808觸發錯誤處置回應。錯誤處置回應可以包括傳訊錯誤及/或更新錯誤日誌資訊。Figure 8 illustrates the steps performed by the tag checking circuit system 34 for the tag checking operation. In step 800, in response to a tag-checked memory access instruction, the tag checking circuit system 34 obtains an address tag 80 from an address operator 82, which is used to calculate the target address of the data item accessed in response to the tag-checked memory access instruction. Furthermore, the tag checking circuit system 34 obtains an allocation tag 72 from the memory system associated with the data item identified by the target address of the memory access instruction. In step 802, the tag checking circuit system 34 compares address tag 80 and allocation tag 72, and in step 804 detects whether a tag mismatch is detected. Typically, a tag mismatch may be detected when the address operand is not equal to the allocation tag. However, in some implementations, "match all" values are supported, so if either the address operand or the allocation tag has a "match all" value, a tag match can be detected regardless of the values of the other tags. If a tag match is detected (e.g., because address tag 80 and allocation tag 72 are equal, or because one of the tags has a "match all" value), a tag mismatch error is not required to be transmitted in step 806. If a tag mismatch is detected, an error handling response is triggered in step 808. Error handling responses may include reporting errors and/or updating error log information.

為了支援上述標籤檢查,提供了一種機制來支援在記憶體系統內儲存與記憶體系統中儲存的給定資料項相關聯的分配標籤72。存在可以管理彼關聯的各種不同的方式,或者使用由MMU 6提供的位址轉譯功能性,或者使用記憶體系統中的硬體來識別儲存對應於給定資料項的分配標籤的位置。To support the aforementioned tag checking, a mechanism is provided to support the storage of allocation tags 72 associated with given data items stored in the memory system. Various different methods exist for managing this association, either using address translation functionality provided by MMU 6, or using hardware in the memory system to identify the location of the allocation tag corresponding to the given data item.

圖9顯示使用實體標籤將分配標籤與其對應的資料項相關聯的實例。在此實例中,當定位與給定資料項相關聯的分配標籤時,基於用以識別對應資料項的相同實體位址來識別分配標籤。因此,由MMU 6執行的位址轉譯不需要執行任何特殊的轉譯功能來產生分配標籤72的位址。相反,將進行以獲得資料項的實體位址的從虛擬位址到實體位址的位址轉譯足以用於需要相關聯的分配標籤72的任何操作(例如,彼操作可以係與對資料項的經標籤檢查記憶體存取相關聯的標籤檢查,或者可以係寫入或讀取分配標籤72而不必亦存取對應資料項的獨立標籤設定指令或標籤讀取指令)。利用此方法,記憶體系統支援一種機制,用於基於資料項/標籤對的實體位址來識別儲存資料項及相關聯的分配標籤的位置,使得在標籤存取時可以在記憶體系統中讀取/寫入所需的分配標籤。Figure 9 shows an example of associating an allocation label with its corresponding data item using entity labels. In this example, when locating the allocation label associated with a given data item, the allocation label is identified based on the same entity address used to identify the corresponding data item. Therefore, the address translation performed by MMU 6 does not require any special translation function to generate the address of allocation label 72. Instead, an address translation from virtual address to physical address to obtain the physical address of the data item will be performed sufficient for any operation requiring the associated allocation tag 72 (e.g., the operation could be a tag check associated with a tag-checked memory access to the data item, or it could be writing to or reading the allocation tag 72 without also accessing the separate tag set instruction or tag read instruction for the corresponding data item). Using this method, the memory system supports a mechanism for identifying the location of stored data items and associated allocation tags based on the physical address of the data item/tag pair, so that the required allocation tag can be read/written to the memory system during tag access.

各種機制可以由記憶體系統使用以指定標籤儲存。如圖9所顯示,一個選項係實施分別用於儲存資料及標籤的分開實體記憶體單元,其中將在位址轉譯中獲得的相同實體位址發送到資料實體記憶體(用於資料存取)及標籤實體記憶體(用於標籤存取),並且用於識別對應資料項或分配標籤的位置。另一選項可以係將分配標籤值與對應的資料項一起儲存在共用記憶體儲存單元中。例如,一些記憶體儲存單元可包括與儲存的資料項相關聯的錯誤校正碼的備用容量。錯誤校正功能性可能不總是在使用中,因此錯誤校正碼儲存可以再利用於儲存分配標籤值。另一選項可以係,在用於儲存資料項的給定資料實體記憶體單元內,彼實體儲存的一部分經劃分出並且保留用於儲存與彼記憶體單元中儲存的資料項相關聯的分配標籤。劃分出的區域可以係固定或可變的。若指定了變數區域,則可在記憶體中維持一些儲存的狀態資訊(例如,基底位址或與由MMU 6使用的基底位址及轉譯表結構分開的表結構)以識別資料儲存的哪個區域提供與特定資料項相關聯的標籤。利用劃分出方法,由於標籤儲存係可以基於實體位址定址的實體記憶體系統的內部位址空間的部分,亦可能使用轉譯表44、50中的映射資訊將儲存標籤的實體儲存位置映射至虛擬位址。然而,與下文論述的虛擬化標籤方法不同,在此情況中,映射至標籤儲存的虛擬位址將轉譯成實體位址,就像任何其他資料位址一樣,其中MMU 6不支援與資料位址轉譯分開的特定於標籤的位址轉譯功能性。若使用實體標籤,則由記憶體系統用於維持資料項與標籤之間的關聯的特定機制可能係特定於實施方案的,且對於在設備2上執行的軟體而言可能係不可見的。Various mechanisms can be used by the memory system to specify tag storage. As shown in Figure 9, one option is to implement separate physical memory units for storing data and tags, where the same physical address obtained in address translation is sent to the data physical memory (for data access) and the tag physical memory (for tag access), and used to identify the location of the corresponding data item or assign a tag. Another option is to store the assigned tag value together with the corresponding data item in a shared memory storage unit. For example, some memory storage units may include spare capacity for error correction codes associated with the stored data items. Error correction functionality may not always be in use, so error correction code storage can be reused for storing allocation tag values. Another option is to partition a portion of a given data entity memory unit used to store data items and reserve allocation tags associated with the data items stored in that memory unit. The partitioned region can be fixed or variable. If a variable region is specified, some storage status information (e.g., base address or a table structure separate from the base address and translation table structure used by MMU 6) can be maintained in memory to identify which region of data storage provides a tag associated with a specific data item. Using the partitioning method, since the tag storage system can be based on a portion of the internal address space of the physical memory system, it is also possible to use the mapping information in translation tables 44 and 50 to map the physical storage location of the storage tag to a virtual address. However, unlike the virtualization tagging method discussed below, in this case, the virtual address mapped to the tag storage will be translated into a physical address, just like any other data address, where MMU 6 does not support tag-specific address translation functionality separate from data address translation. If entity tags are used, the specific mechanisms by which the memory system maintains the association between data items and tags may be implementation-specific and may be invisible to the software running on device 2.

圖10及圖11繪示使用虛擬化標籤將分配標籤72與其對應資料項相關聯的實例。在此等實例中,由MMU 6提供的位址轉譯功能性用以將識別給定資料項的資料定位虛擬位址(virtual address, VA)轉譯成分別識別資料項及其相關聯的分配標籤的分開實體位址PA1、PA2。藉由支援虛擬化標籤轉譯模式,其中分配標籤72經指派與其對應資料項不同的實體位址(基於階段1及階段2位址轉譯中的至少一者處的分開位址轉譯映射),此使得實體記憶體的實施方案變得更加簡單,因為記憶體系統不需要實施用於管理標籤儲存的任何特殊機制。從記憶體系統的角度來看,分配標籤似乎係資料項,且因此對於將存取給定資料項及其相關聯的標籤值二者的經標籤檢查記憶體存取,可以向記憶體系統發布二個分開的記憶體存取請求:一者指定識別儲存資料項的位置的資料定位實體位址PA1,且另一者指定識別儲存分配標籤的位置的標籤定位實體位址PA2。MMU(位址轉譯電路系統)可支援使得軟體能夠定義轉譯表結構的機制,以便控制資料定位VA到分開的資料定位及標籤定位實體位址PA1、PA2的轉譯。Figures 10 and 11 illustrate examples of using virtual tags to associate assignment tags 72 with their corresponding data items. In these examples, the address translation functionality provided by MMU 6 is used to translate the data location virtual address (VA) that identifies a given data item into separate physical addresses PA1 and PA2 that identify the data item and its associated assignment tag. By supporting a virtualized tag translation mode, in which the assigned tag 72 is assigned a physical address different from its corresponding data item (based on separate address translation mapping at least one of the phase 1 and phase 2 address translations), the implementation of physical memory becomes simpler because the memory system does not need to implement any special mechanisms for managing tag storage. From the memory system's perspective, allocation tags appear to be data items. Therefore, for tag-checked memory access that accesses a given data item and its associated tag value, two separate memory access requests can be issued to the memory system: one specifying the data location entity address PA1 that identifies the location of the stored data item, and the other specifying the tag location entity address PA2 that identifies the location of the stored allocation tag. The MMU (Address Translation System) can support mechanisms that allow software to define translation table structures to control the translation from data location VA to the separate data location and tag location entity addresses PA1 and PA2.

在圖10的實例中,使用虛擬標籤,使得資料項的目標位址分別映射至資料項及標籤的分開位址的位址轉譯階段係階段1位址轉譯。在此實例中,二個獨立的階段1位址轉譯映射用以獲得對應於指定的資料項虛擬位址VA的各別資料定位及標籤定位中間位址IPA1、IPA2。彼等中間位址IPA1、IPA2之各者可以接著在階段2中進一步轉譯成用以存取記憶體系統中儲存的對應資料及分配標籤的對應實體位址PA1、PA2。如圖10中的虛線所顯示,一種控制分別使用分開的階段1轉譯映射進行資料及標籤轉譯的方式可以係,對於標籤轉譯,對資料定位VA應用修改以產生識別虛擬位址空間中的分配標籤的位置的經修改VA,且接著使用彼經修改VA作為查找轉譯表結構的輸入,使得與來自相同的階段1轉譯表44的用於資料位址轉譯的條目相比,階段1轉譯表44的分開條目用於標籤位址轉譯。其他實例可能不應用彼位址修改,而是取決於階段1位址轉譯係針對資料項存取亦或標籤存取執行來選擇轉譯表44的不同集合(基於不同的基址暫存器)。In the example of Figure 10, virtual labels are used so that the address translation stage that maps the target address of a data item to separate addresses of the data item and the label is Stage 1 address translation. In this example, two independent Stage 1 address translation mappings are used to obtain the respective data location and label location intermediate addresses IPA1 and IPA2 corresponding to the specified data item virtual address VA. Each of these intermediate addresses IPA1 and IPA2 can then be further translated in Stage 2 into the corresponding physical addresses PA1 and PA2 for accessing the corresponding data stored in the memory system and allocating the label. As shown by the dashed lines in Figure 10, one way to control the use of separate Stage 1 translation mappings for data and label translation is as follows: For label translation, a modification is applied to the data location VA to generate a modified VA that identifies the location of the assigned label in the virtual address space, and then this modified VA is used as the input to look up the translation table structure, such that the separate entries of Stage 1 translation table 44 are used for label address translation compared to the entries from the same Stage 1 translation table 44 used for data address translation. Other embodiments may not apply the address modification, but instead select different sets of translation tables 44 (based on different base address registers) depending on whether the Stage 1 address translation is performed for data item access or label access.

另一方面,在圖11的實例中,使用中間標籤,使得識別資料項的位址分別映射至資料項及標籤的分開位址的位址轉譯階段係階段2位址轉譯。在此實例中,階段1位址轉譯將資料項的VA轉譯成對應的中間位址IPA1(其中相同的階段1位址轉譯映射由資料項及標籤二者共用),但階段2轉譯接著選擇分開的階段2位址轉譯映射來分別產生資料定位實體位址PA1及標籤定位實體位址PA2。同樣地,如圖11中的虛線所顯示,對於標籤位址轉譯,一些實例可應用位址修改操作來基於資料定位中間位址IPA1判定中間位址空間內的標籤定位中間位址IPA2,使得與來自相同的階段1轉譯表44的用於資料位址轉譯的條目相比,階段2轉譯表50的分開條目用於標籤位址轉譯。其他實例可能不應用彼位址修改,而是取決於階段2位址轉譯係針對資料項存取亦或標籤存取執行來選擇階段2轉譯表50的不同集合(基於不同的基址暫存器)。On the other hand, in the example of Figure 11, using intermediate labels, the address translation stage that maps the address of the identified data item to separate addresses of the data item and the label is a stage 2 address translation. In this example, stage 1 address translation translates the VA of the data item into the corresponding intermediate address IPA1 (where the same stage 1 address translation mapping is shared by both the data item and the label), but stage 2 translation then selects separate stage 2 address translation mappings to generate the data location entity address PA1 and the label location entity address PA2, respectively. Similarly, as shown by the dashed lines in Figure 11, for label address translation, some instances may apply an address modification operation to determine the label location intermediate address IPA2 within the intermediate address space based on the data location intermediate address IPA1, such that the separate entries in the stage 2 translation table 50 are used for label address translation compared to the entries from the same stage 1 translation table 44 used for data address translation. Other instances may not apply that address modification, but instead select different sets of stage 2 translation tables 50 (based on different base registers) depending on whether the stage 2 address translation is performed for data item access or label access.

如圖10所顯示(為簡潔起見,此在圖11中亦未顯示,但亦可以應用於中間標籤),例如在一個分配標籤中的位元數目小於一個可定址記憶體位置(例如,一個位元組)中的位元數目的情況中,二或更多個分配標籤可儲存在相同的標籤定位實體位址PA2處,且因此資料定位位址VA或IPA1的部分可用以在相同的標籤定位實體位址PA2處儲存的標籤之間進行選擇。As shown in Figure 10 (which is not shown in Figure 11 for simplicity, but can also be applied to intermediate labels), for example, when the number of bits in an allocation label is less than the number of bits in an addressable memory location (e.g., a byte), two or more allocation labels can be stored at the same label location entity address PA2, and therefore a portion of the data location address VA or IPA1 can be used to select among the labels stored at the same label location entity address PA2.

因此,通常,可支援虛擬化標籤轉譯模式,其中對於將位址從第一位址空間映射至第二位址空間的給定位址轉譯階段,將第一位址空間中的資料定位第一位址轉譯成第二位址空間中的分開資料定位及標籤定位第二位址。資料定位第一位址取決於用以識別虛擬位址空間中的資料項的資料虛擬位址,且資料項及相關聯分配標籤的實體位址分別取決於分開的資料定位及標籤定位第二位址。對於如圖10所顯示的具有虛擬標籤的實例,給定位址轉譯階段係階段1轉譯,第一位址空間係虛擬位址空間40,第二位址空間係中間位址空間46,資料定位第一位址係資料定位虛擬位址,且資料定位及標籤定位第二位址係中間位址,該等中間位址在第二位址轉譯階段中進一步轉譯成對應的實體位址。對於如圖11所顯示的具有中間標籤的實例,第一位址空間係中間位址空間46,第二位址空間係實體位址空間52,資料定位第一位址係對應於資料定位虛擬位址的階段1轉譯中產生的中間位址IPA1,且階段2轉譯中分別為資料項及標籤產生的分開資料定位及標籤定位第二位址係用以識別記憶體中的資料及分配標籤的對應儲存位置的實體位址PA1、PA2。Therefore, virtualized tag translation mode is typically supported. In the given address translation stage that maps addresses from a first address space to a second address space, the first address of the data location in the first address space is translated into separate data locations and tag locations in the second address space. The first address of the data location depends on the data virtual address used to identify the data item in the virtual address space, and the physical addresses of the data item and the associated allocation tag depend on the separate data location and tag location second addresses, respectively. For the example with virtual labels shown in Figure 10, the address translation stage is stage 1 translation, the first address space is the virtual address space 40, the second address space is the intermediate address space 46, the first address of the data location is the data location virtual address, and the second address of the data location and the label location are intermediate addresses. These intermediate addresses are further translated into corresponding physical addresses in the second address translation stage. For the example with intermediate labels shown in Figure 11, the first address space is the intermediate address space 46, the second address space is the physical address space 52, the first address of data positioning is the intermediate address IPA1 generated in stage 1 translation corresponding to the virtual address of data positioning, and the second addresses of separate data positioning and label positioning generated in stage 2 translation are the physical addresses PA1 and PA2 used to identify the data in memory and allocate the corresponding storage location of the label.

一些實例可支援至少一種虛擬化標籤轉譯模式,例如,基於圖10所顯示的虛擬標籤模式及/或圖11所顯示的中間標籤模式。一些實例可支援虛擬標籤及中間標籤二者,使得可選擇應用哪種模式,例如,基於由軟體設定的控制狀態。支援至少一種虛擬化標籤轉譯模式的優點在於,此消除了對實體記憶體實施用於管理分配標籤72的儲存的機制的需要。此使得記憶體系統實施方案更加簡單。Some examples support at least one virtualization tag translation mode, such as the virtualization tag mode shown in Figure 10 and/or the intermediate tag mode shown in Figure 11. Some examples support both virtualization tags and intermediate tags, allowing selection of which mode to apply, for example, based on a control state set by software. The advantage of supporting at least one virtualization tag translation mode is that it eliminates the need for a mechanism to be implemented in physical memory for managing the storage of allocation tags 72. This simplifies the memory system implementation.

即使記憶體系統確實支援用於管理分配標籤72的儲存的機制,使用位址轉譯功能性來識別某些資料項的標籤儲存位置可以幫助支援更高效地利用可用的實體記憶體儲存容量。設定位址轉譯表的軟體可能更好地知道特定資料項區塊是否可能需要標籤檢查,且因此可以避免為對應於不太可能需要標籤存取的資料項位址區域設定將分配標籤映射至實體記憶體的轉譯表條目。因此,與實體記憶體系統不同,實體記憶體系統可能保守地需要假設任何資料項可能需要對應標籤的實體儲存,或者可能已經靜態地定義為保留其實體儲存的某一塊用於儲存分配標籤,管理位址轉譯映射的軟體對哪些分配標籤將被需要以及哪些不太可能被存取具有更多的可見性。由此,彼軟體可以基於對應的有效轉譯表條目來識別哪些分配標籤應被分配實體儲存,以及哪些分配標籤可能僅名義上與對應的資料項相關聯,但在給定時間未被分配實體記憶體(例如,使用頁機制以頁進/出外部儲存,使得分配標籤僅在實際需要時/當實際需要時被分配實體記憶體,以更高效地使用實體記憶體系統的有限記憶體容量)。此外,軟體可以選擇位址映射,使得在從第一位址空間至第二位址空間的給定位址轉譯階段中,在二或更多個資料項區塊將共用相同的分配標籤值的情況中,針對二或更多個不同資料項區塊的標籤位址轉譯而存取的轉譯條目可以將對應的標籤定位位址映射至第二位址空間中的相同第二位址上。此意指需要為標籤儲存分配更少的實體記憶體,由於與標籤/資料共用相同實體位址且記憶體系統不能受益於任何軟體提供的關於不同實體資料位址區塊的標籤是否具有相同的分配標籤值的提示的方法相比,多個資料項區塊可以共用實體記憶體中的相同標籤儲存位置,因此將為各不同的資料項「顆粒(granule)」分配記憶體中的分開實體儲存(其中「顆粒」係共用單一分配標籤的資料項區塊)。Even though the memory system does support mechanisms for managing the storage of allocation tags 72, using address translation functionality to identify the tag storage location for certain data items can help enable more efficient use of available physical memory storage capacity. Software that sets up address translation tables may be better able to know whether a particular data item block might require tag checking, and thus can avoid setting up translation table entries that map allocation tags to physical memory for data item address areas that are unlikely to require tag access. Therefore, unlike physical memory systems, which may conservatively require the assumption that any data item might need physical storage for a corresponding tag, or may have been statically defined as reserving a block of physical storage for the allocation tag, the software that manages address translation mappings has more visibility into which allocation tags will be needed and which are unlikely to be accessed. Thus, the software can identify which allocation tags should be allocated to physical storage based on the corresponding valid translation table entries, and which allocation tags may only be nominally associated with the corresponding data items but are not allocated to physical memory for a given time (e.g., using a page mechanism to page in/out external storage, so that allocation tags are allocated to physical memory only when actually needed/when actually needed, to make more efficient use of the limited memory capacity of the physical memory system). Furthermore, the software can select address mappings such that, during the given address translation phase from the first address space to the second address space, in cases where two or more data item blocks will share the same allocation tag value, the translated entries accessed for tag address translation of two or more different data item blocks can map the corresponding tag address to the same second address in the second address space. This means that less physical memory needs to be allocated for tag storage. Since multiple data item blocks can share the same tag storage location in physical memory, separate physical storage in memory will be allocated for each different data item "granule" (where "granule" is a data item block that shares a single allocation tag). This is because, compared to the method where tags/data share the same physical address and the memory system cannot benefit from any software-provided hints about whether tags for different physical data address blocks have the same allocation tag value, multiple data item blocks can share the same tag storage location in physical memory.

可能提供僅支援虛擬化標籤轉譯模式(例如,圖10及圖11所顯示的虛擬/中間標籤模式中之一者或二者),但不支援如圖9所顯示的實體標籤的MMU 6。然而,其他實例亦可支援使用實體標籤的選項,如圖9所顯示。支援靈活性以改變所使用的方法可以係有用的,由於對於記憶體系統確實支援基於用以識別資料項及標籤的相同實體位址來定位與給定資料項相關聯的分配標籤的機制的實施方案,此可以藉由減少分別管理資料及標籤的分開轉譯表映射的管理負擔來簡化軟體實施方案。因此,對於從第一位址空間至第二位址空間的給定位址轉譯階段,MMU 6可以在第一標籤轉譯模式與第二標籤轉譯模式之間進行選擇。在第一標籤轉譯模式中,針對標籤存取執行的任何轉譯單純再利用與對應資料項存取相同的轉譯。在第二標籤轉譯模式中,針對標籤存取執行的轉譯涉及與資料位址轉譯操作分開的分開標籤位址轉譯操作,其中標籤位址轉譯操作及資料位址轉譯操作使用不同的轉譯表條目來為給定位址轉譯階段提供位址映射。對於圖10的實例,階段1轉譯使用第二標籤轉譯模式,且階段2轉譯使用第一標籤轉譯模式。對於圖11的實例,階段1轉譯使用第一標籤轉譯模式,且階段2轉譯使用第二標籤轉譯模式。對於圖9的實例,階段1及階段2轉譯皆使用第一標籤轉譯模式。第一標籤轉譯模式可以被視為根據資料定位位址轉譯操作來轉譯給定輸入位址,且第二標籤轉譯模式可以被視為根據標籤定位位址轉譯操作來轉譯給定輸入位址。在第一及第二標籤轉譯模式之間的選擇可以基於由軟體設定的控制資訊,例如,控制暫存器中的組態值。It is possible to provide an MMU 6 that only supports virtualized label translation modes (e.g., one or both of the virtual/intermediate label modes shown in Figures 10 and 11), but not physical labels as shown in Figure 9. However, other implementations may also support the option of using physical labels, as shown in Figure 9. Supporting flexibility to change the method used can be useful, since the memory system does support an implementation that locates the assigned label associated with a given data item based on the same physical address used to identify the data item and the label. This can simplify the software implementation by reducing the management burden of separately managing separate translation table mappings for data and labels. Therefore, for a given address translation stage from the first address space to the second address space, MMU 6 can choose between a first label translation mode and a second label translation mode. In the first label translation mode, any translation performed for a label access simply reuses the same translation as the corresponding data item access. In the second label translation mode, the translation performed for a label access involves separate label address translation operations, which are separate from the data address translation operations. The label address translation operations and the data address translation operations use different translation table entries to provide address mapping for the given address translation stage. For the example in Figure 10, stage 1 translation uses the second label translation mode, and stage 2 translation uses the first label translation mode. For the example in Figure 11, stage 1 translation uses the first label translation mode, and stage 2 translation uses the second label translation mode. For the example in Figure 9, both stage 1 and stage 2 translations use the first label translation mode. The first label translation mode can be viewed as translating a given input address based on a data location address translation operation, and the second label translation mode can be viewed as translating a given input address based on a label location address translation operation. The selection between the first and second label translation modes can be based on control information set by the software, such as configuration values in the control register.

當支援虛擬化標籤轉譯模式時,與用以獲得對應資料項的實體位址PA1的資料定位位址轉譯操作相比,用以獲得分配標籤的實體位址PA2的標籤定位位址轉譯操作需要分開的轉譯表條目。利用虛擬標籤方法圖10,階段1及階段2均可使用為將經修改的VA轉譯成IPA2及將IPA2轉譯成PA2而建立的標籤轉譯轉譯表條目,該等條目與將VA轉譯成IPA1及將IPA1轉譯成PA1的條目分開。利用圖11所顯示的中間標籤方法,階段2可使用分開的轉譯表條目來將IPA2轉譯成PA2以進行標籤存取,此與用以將IPA1轉譯成PA1以進行資料存取的條目分開。因此,執行標籤定位位址轉譯可能存在非標籤檢查資料存取不會出現的額外錯誤的風險,由於若作業系統或超管理器尚未為標籤定位位址轉譯組態適當的轉譯表條目,或者在標籤定位位址轉譯中存取的轉譯表條目指定記憶體存取操作不滿足的權限,則可能發生記憶體錯誤,導致處理中斷。為了降低效能成本,若對不需要標籤檢查的記憶體區域進行存取,則承擔與執行標籤定位位址轉譯相關聯的錯誤風險增加可能係非所欲的。When virtualized tag translation mode is supported, the tag location address translation operation to obtain the physical address PA2 of the assigned tag requires separate translation table entries compared to the data location address translation operation used to obtain the physical address PA1 of the corresponding data item. Using the virtual tagging method shown in Figure 10, both stages 1 and 2 can use tag translation table entries created to translate the modified VA to IPA2 and IPA2 to PA2, which are separate from the entries for translating VA to IPA1 and IPA1 to PA1. Using the intermediate labeling method shown in Figure 11, stage 2 can use separate translation table entries to translate IPA2 into PA2 for label access, separate from the entries used to translate IPA1 into PA1 for data access. Therefore, performing label-based address translation may carry the risk of additional errors that would not occur with non-label-based data access checks. Memory errors may occur, causing processing interruptions, if the operating system or hypervisor has not configured appropriate translation table entries for label-based address translation, or if the translation table entries accessed in label-based address translation have insufficient memory access permissions. In order to reduce performance costs, it may be undesirable to increase the risk of errors associated with performing tag-based address translation by accessing memory areas that do not require tag checking.

為了解決此問題,轉譯表可在用於提供給定資料項的位址空間區域的轉譯表條目60內直接地或間接地編碼的屬性/權限資訊中定義屬性資訊,該屬性資訊指示彼區域係有標籤區域(對此對該區域的存取應被視為需要標籤檢查的經標籤檢查記憶體存取)亦或無標籤區域(對此不需要標籤檢查)。在一些實例中,專用的屬性類型可以指示該區域有標籤亦或無標籤。然而,亦可能從一或多個其他屬性類型推斷有標籤/無標籤狀態。例如,屬性資訊可以指示該區域係正常記憶體類型亦或裝置記憶體類型(裝置記憶體類型經受額外限制,而防止對裝置記憶體區域的記憶體存取操作例如重複多於一次、在部分動作之後中斷切稍後重新啟動及/或與請求記憶體存取操作的次序相比重新排序,其中正常記憶體類型不經受此等限制中之任何限制)。再者,屬性資訊可以指示可快取性屬性資訊,該屬性資訊指示一旦從主記憶體存取,來自對應位址空間區域的資料是否應在快取記憶體中快取。例如,可快取性屬性資訊可以指示該區域是否為寫回式可快取區域(對此允許快取記憶體保存已經更新但尚未寫回記憶體中的後備儲存的髒資料)、直寫式可快取區域(對此對經快取資料的任何更新皆立即傳播到記憶體中的後備儲存)或不可快取區域(對此資料不應在任何快取記憶體中快取)。在一些實例中,當位址空間區域的屬性資訊指示該區域係寫回式可快取的正常記憶體區域時,可判定該區域的有標籤狀態。具有指示該區域不係正常寫回式可快取區域的屬性資訊的任何區域可被視為無標籤。To address this issue, translation tables can define attribute information, directly or indirectly encoded in attribute/authorization information within translation table entries 60 that provide address space regions for given data items. This attribute information indicates whether the region is a tagged region (where access to the region should be considered a tagged memory access requiring tag checking) or an untagged region (where tag checking is not required). In some instances, dedicated attribute types can indicate whether the region is tagged or untagged. However, it is also possible to infer the tagged/untagged status from one or more other attribute types. For example, attribute information can indicate whether the region is a normal memory type or a device memory type (device memory types are subject to additional restrictions that prevent memory access operations to device memory regions from being repeated more than once, interrupted after partial operation and then restarted, and/or reordered compared to the order in which memory access operations were requested, while normal memory types are not subject to any of these restrictions). Furthermore, attribute information can indicate caching capability attribute information, which indicates whether data from the corresponding address space region should be cached in cache memory once accessed from main memory. For example, caching property information can indicate whether a region is a write-back cacheable region (allowing cached memory to store dirty data that has been updated but not yet written back to memory), a write-through cacheable region (where any update to cached data is immediately propagated to memory's backup storage), or a non-cacheable region (where data should not be cached in any cached memory). In some instances, a region's tagged status can be determined when its property information indicates that the region is a normal write-back cacheable memory region. Any region with property information indicating that it is not a normal write-back cacheable region can be considered untagged.

因此,基於與包含經存取的資料項的位址空間頁相關聯的屬性資訊,MMU 6可以判定是否需要在架構上執行標籤定位位址轉譯以獲得相關聯的分配標籤的標籤定位實體位址。若記憶體存取指令以記憶體的無標籤區域為目標,則在架構上不執行標籤定位位址轉譯。例如,或者根本不執行標籤定位位址轉譯,或者執行但抑制轉譯的任何架構效應──系統的架構狀態保持相同,如同從未執行過轉譯一般。例如,若在架構上(但不一定實際上)抑制轉譯,則可能不基於轉譯觸發錯誤,可能不基於轉譯更新架構可見的效能計數器(若提供),且可能不基於由標籤定位位址轉譯獲得的位址觸發記憶體存取。Therefore, based on the attribute information associated with the address space page containing the accessed data item, MMU 6 can determine whether a label-location address translation needs to be performed on the architecture to obtain the label-location entity address of the associated allocation label. If the memory access instruction targets an unlabeled region of memory, then a label-location address translation is not performed on the architecture. For example, either no label-location address translation is performed at all, or any architectural effects of the translation are performed but suppressed—the system's architectural state remains the same as if the translation had never been performed. For example, if translation is suppressed at the architectural level (but not necessarily in practice), errors may not be triggered based on translation, performance counters visible to the architecture may not be updated based on translation, and memory access may not be triggered based on addresses obtained from tag-located address translations.

圖12係繪示如何基於與待存取的資料項的位址相關聯的記憶體區域屬性資訊來啟用/禁用標籤定位位址轉譯的流程圖。Figure 12 is a flowchart illustrating how to enable/disable tag location address translation based on memory region attribute information associated with the address of the data item to be accessed.

在步驟1200,偵測到指定目標資料位址的經標籤檢查記憶體存取指令。經標籤檢查記憶體存取指令可係任何指令,該指令請求對由目標資料位址識別的目標資料項的讀取或寫入存取,且至少當針對由目標資料位址識別的資料項指定的記憶體屬性資訊指定目標資料位址對應於有標籤記憶體區域時,該指令導致標籤檢查電路系統34在與用以完成目標資料位址的位址運算元相關聯的位址標籤與同目標資料項相關聯的記憶體系統中儲存的分配標籤之間執行標籤檢查。在一些實例中,可提供專用類別的經標籤檢查記憶體存取指令類別,與未經標籤檢查記憶體存取指令類別分開,使得可針對經標籤檢查指令類別執行圖12的步驟,而非針對未經標籤檢查記憶體存取指令執行。在其他實例中,指令編碼可能不區分記憶體存取指令係經標籤檢查亦或未經標籤檢查,且所有資料項存取的記憶體存取指令可能在原則上能夠充當經標籤檢查記憶體存取指令,但是否實際上執行了標籤檢查可能取決於如下所述的記憶體屬性資訊。再者,在一些情況中,給定的記憶體存取指令是否為經標籤檢查記憶體存取指令可能取決於模式指示符或其他標籤檢查啟用/禁用控制值,該值可用以控制是否啟用或禁用標籤檢查。In step 1200, a tag-checked memory access instruction for a specified target data address is detected. The tag-checked memory access instruction can be any instruction that requests a read or write access to a target data item identified by the target data address, and at least when the target data address corresponds to a tagged memory region for the memory attribute information specified by the data item identified by the target data address, the instruction causes the tag checking circuit system 34 to perform a tag check between the address tag associated with the address operand used to complete the address operation of the target data address and the allocation tag stored in the memory system associated with the target data item. In some instances, a dedicated category for tagged memory access instructions can be provided, separate from the category for untagged memory access instructions. This allows the steps in Figure 12 to be executed for tagged memory access instructions, rather than for untagged memory access instructions. In other instances, instruction encoding may not distinguish between tagged and untagged memory access instructions, and all memory access instructions that access data items may, in principle, function as tagged memory access instructions. However, whether a tag check is actually performed may depend on the memory attribute information described below. Furthermore, in some cases, whether a given memory access instruction is a tag-checked memory access instruction may depend on the mode indicator or other tag-check enable/disable control values, which can be used to control whether tag checking is enabled or disabled.

在步驟1200,回應於經標籤檢查記憶體存取指令,MMU 6獲得與目標資料位址相關聯的轉譯表條目所指定的記憶體區域屬性資訊。可以藉由表走訪電路系統12執行表走訪操作來觸發記憶體存取操作,以遍歷階段1及/或階段2轉譯表結構44、50(追蹤轉譯表結構44、50中的多層級表之間的任何指標踪跡)並且定位對應於目標資料位址的頁描述符60,來獲得此類屬性資訊。替代地,若對應於目標資料位址的屬性資訊已經在TLB 8中快取,則可以從TLB 8中獲得由與目標資料位址相關聯的轉譯表條目指定的記憶體區域屬性,而非執行表走訪操作。In step 1200, in response to a tag-checked memory access instruction, MMU 6 obtains the memory region attribute information specified by the translation table entry associated with the target data address. Memory access operations can be triggered by performing a table walk operation via table walk circuit system 12 to traverse the stage 1 and/or stage 2 translation table structures 44, 50 (tracing any pointer traces between multi-level tables in translation table structures 44, 50) and locate the page descriptor 60 corresponding to the target data address to obtain this type of attribute information. Alternatively, if the attribute information corresponding to the target data address is already cached in TLB 8, the memory region attribute specified by the translation table entry associated with the target data address can be obtained from TLB 8 instead of performing a table walkthrough.

在步驟1202,MMU 6判定由與目標資料位址相關聯的記憶體區域屬性指定哪種記憶體區域類型。若目標資料位址位於無標籤記憶體區域(例如,除了正常寫回式可快取區域之外的任何區域)中,則在步驟1204,MMU 6判定不需要在架構上執行標籤定位位址轉譯。因此,或者完全不執行標籤定位位址轉譯操作,或者若其經推測性執行,則不基於標籤定位位址轉譯來觸發記憶體錯誤,即使標籤定位位址轉譯在架構上執行時將導致偵測到錯誤(例如,若不存在為虛擬化轉譯模式的圖10及圖11所顯示的映射「經修改的VA->IPA2」或「IPA2->PA2」定義的有效位址轉譯條目,則可能發生錯誤偵測)。因此,藉由抑制當存取無標籤記憶體區域時標籤定位位址轉譯的錯誤,此降低軟體開發人員的管理負擔,由於當虛擬化轉譯模式在操作中時,不必針對對應於各資料項位址的分配標籤組態映射分配標籤的位址的轉譯表條目。軟體僅需要針對實際上需要標籤檢查的彼等資料位址組態分配標籤映射轉譯表條目。對於對無標籤記憶體區域的存取,在步驟1206,MMU 6或標籤檢查電路系統34判定不需要標籤檢查。In step 1202, MMU 6 determines which memory region type is specified by the memory region attribute associated with the target data address. If the target data address is located in an unlabeled memory region (e.g., any region other than a normal write-back cache region), then in step 1204, MMU 6 determines that label location address translation does not need to be performed on the architecture. Therefore, either the label-based address translation operation is not performed at all, or if it is performed speculatively, a memory error is not triggered based on the label-based address translation, even though the label-based address translation would lead to an error detection when performed on the architecture (e.g., an error detection might occur if there is no valid address translation entry defined for the mapping "Modified VA->IPA2" or "IPA2->PA2" shown in Figures 10 and 11 for the virtualization translation mode). Therefore, by suppressing errors in tag-based address translation when accessing unlabeled memory regions, the management burden on software developers is reduced. Since, when virtualization translation mode is in operation, it is not necessary to configure and map the address translation table entries for the corresponding data item addresses. The software only needs to configure and map the tag mapping translation table entries for the data addresses that actually require tag checking. For access to unlabeled memory regions, in step 1206, MMU 6 or the tag checking circuit system 34 determines that tag checking is not required.

若判定目標資料位址在有標籤記憶體區域(例如,正常寫回式可快取區域)中,則在步驟1208,MMU 6判定目前是否啟用虛擬化標籤(例如,圖10及圖11所顯示的虛擬及中間標籤方法之一)。如下文關於圖18及圖19進一步論述的,可以使用在控制暫存器中儲存的標籤轉譯控制資訊VTE、IPMTE來判定虛擬化標籤模式是否作用中。If the target data address is determined to be in a tagged memory region (e.g., a normal write-back cacheable region), then in step 1208, MMU 6 determines whether virtualization tagging is currently enabled (e.g., one of the virtual and intermediate tagging methods shown in Figures 10 and 11). As further discussed below with reference to Figures 18 and 19, the tag translation control information VTE and IPMTE stored in the control register can be used to determine whether the virtualization tagging mode is active.

若啟用虛擬化標籤且存取有標籤記憶體區域,則在步驟1210,MMU 6在架構上執行標籤定位位址轉譯操作來獲得經轉譯的標籤定位實體位址PA2,該位址識別對應於由經標籤檢查記憶體存取指令指定的目標資料位址識別的資料項的分配標籤的位置。用於執行標籤定位位址轉譯的步驟在下文的圖14至圖17及圖24的實例中更詳細地描述。若當執行標籤定位位址轉譯操作時偵測到任何錯誤情況,則傳訊記憶體錯誤,此可能導致目前處理中斷,且導致處理器2切換至執行來自異常處置器的指令,該異常處置器可能調查錯誤並且判定如何繼續進行(例如,若先前尚未提供此類映射,則觸發負責偵測到錯誤的位址轉譯階段的作業系統或超管理器針對所需位址映射組態轉譯表條目)。If virtualization tags are enabled and tagged memory regions are accessed, then in step 1210, MMU 6 performs a tag location address translation operation on the architecture to obtain the translated tag location entity address PA2, which identifies the location of the allocation tag of the data item identified by the target data address specified by the tag-checked memory access instruction. The steps used to perform the tag location address translation are described in more detail in the examples of Figures 14 to 17 and Figure 24 below. If any error is detected during the label location address translation operation, a communication memory error occurs, which may cause the current processing to be interrupted and cause processor 2 to switch to execute instructions from an error handler, which may investigate the error and determine how to continue (e.g., if such a mapping has not been provided before, the operating system or super manager responsible for detecting the error in the address translation phase is triggered to configure the translation table entries for the required address mapping).

假設在標籤定位位址轉譯操作中未偵測到記憶體錯誤,則在步驟1212,加載/儲存單元28向記憶體系統發布記憶體存取請求,指定在標籤定位位址轉譯操作中由MMU 6獲得的標籤定位實體位址PA2。指定PA2的標籤存取記憶體存取請求請求存取分配標籤,與指定實體位址PA1的資料存取記憶體存取請求分開,後者向記憶體系統發布以請求存取對應資料項。在步驟1214,當記憶體系統回傳對應於標籤定位實體位址PA2的資料字時,加載/儲存單元28或標籤檢查電路系統34基於由識別所需目標資料項的目標資料定位位址判定的標籤選擇資訊,在回傳的資料字中含有的分配標籤之間(例如,在圖10所顯示的實例中,在二個分配標籤之間)進行選擇。例如,標籤選擇資訊可以係下文參考圖22及圖23解釋的半位元組選擇資訊。在步驟1216,標籤檢查電路系統34使用在步驟1214選擇的分配標籤及與記憶體存取指令的位址運算元相關聯的位址標籤80(例如,位址標籤80可從位址運算元的高位元中提取,如圖4所顯示)來執行圖8的標籤檢查操作。If no memory error is detected during the label address translation operation, then in step 1212, the load/store unit 28 publishes a memory access request to the memory system, specifying the label physical address PA2 obtained by MMU 6 during the label address translation operation. The label access memory access request for PA2 requests access to the allocated label, which is separate from the data access memory access request for the specified physical address PA1, the latter of which is published to the memory system to request access to the corresponding data item. In step 1214, when the memory system returns the data word corresponding to the tag location entity address PA2, the load/store unit 28 or the tag checking circuit system 34 selects between the allocation tags contained in the returned data word (e.g., between two allocation tags in the example shown in FIG10) based on tag selection information determined by identifying the target data location address of the desired target data item. For example, the tag selection information may be half-byte selection information explained below with reference to FIG22 and FIG23. In step 1216, the tag checking circuit system 34 performs the tag checking operation of FIG8 using the assigned tag selected in step 1214 and the address tag 80 associated with the address operand of the memory access instruction (e.g., the address tag 80 can be extracted from the high-order bits of the address operand, as shown in FIG4).

另一方面,若記憶體存取係針對記憶體的有標籤區域中的資料項,但虛擬化標籤目前被禁用,則在步驟1218不在架構上執行標籤定位位址轉譯,由於在此情況中標籤轉譯係基於如圖9所顯示的實體標籤體系,且因此與目標資料項相關聯的分配標籤72可以基於與資料項本身的實體位址相同的實體位址PA1來定位。分配標籤及資料項皆與相同的資料定位實體位址PA1相關聯。在步驟1220,若尚未針對資料存取發布,則向記憶體系統發布指定資料定位實體位址的記憶體存取請求,以請求對與彼位址相關聯的分配標籤(及資料項)的存取。當分配標籤從記憶體系統回傳時,在步驟1222使用經獲得的分配標籤及與記憶體存取指令的位址操作相關聯的位址標籤執行標籤檢查(如在圖8中)。On the other hand, if memory access is for data items in a tagged region of memory, but virtualization tags are currently disabled, then in step 1218, tag location address translation is not performed on the architecture. Since tag translation in this case is based on the entity tagging system shown in Figure 9, the allocation tag 72 associated with the target data item can therefore be located based on the same entity address PA1 as the data item itself. Both the allocation tag and the data item are associated with the same data location entity address PA1. In step 1220, if no data access has been published, a memory access request for the specified data location entity address is published to the memory system to request access to the allocation tag (and data item) associated with that address. When the allocation tag is returned from the memory system, a tag check is performed in step 1222 using the acquired allocation tag and the address tag associated with the address operation of the memory access instruction (as shown in Figure 8).

圖13繪示針對用於存取對應於經指定的資料位址的一或多個分配標籤的標籤存取指令執行標籤定位位址轉譯操作的步驟。標籤存取指令可以係經標籤檢查記憶體存取指令,其亦觸發對應資料項的存取(如在圖12的實例中),或者可以係標籤讀取/寫入指令,其請求對對應於經指定的資料位址的某一資料項區塊的(多個)分配標籤進行讀取/寫入存取,而不亦存取對應的資料項。在此實例中,從第一位址空間轉譯至第二位址空間的給定位址轉譯階段(以下稱為階段n轉譯)包括在第一標籤轉譯模式與第二標籤轉譯模式之間進行選擇。當使用一階段位址轉譯體系時,階段n轉譯可以係彼體系中使用的單一位址轉譯階段(其中第一位址空間係虛擬位址空間40,且第二位址空間係實體位址空間52,單一轉譯表階段將位址從虛擬位址空間40直接映射至實體位址空間52)。當使用二階段位址轉譯體系時,階段n轉譯可以係階段1轉譯(其中第一位址空間係虛擬位址空間40,且第二位址空間係中間位址空間46,其中轉譯的位址映射基於階段1轉譯表44判定的)或階段2轉譯(其中第一位址空間係中間位址空間46且第二位址空間係實體位址空間52,其中轉譯的位址映射係基於階段2轉譯表50判定的)。Figure 13 illustrates the steps of performing a tag-based address translation operation for a tag access instruction used to access one or more allocation tags corresponding to a specified data address. The tag access instruction can be a tag-check memory access instruction, which also triggers access to the corresponding data item (as in the example of Figure 12), or it can be a tag read/write instruction that requests read/write access to (multiple) allocation tags corresponding to a data item block at a specified data address, without accessing the corresponding data item. In this example, the allocated address translation stage (hereinafter referred to as stage n translation) from the first address space to the second address space involves selecting between a first tag translation mode and a second tag translation mode. When using a single-stage address translation system, stage n translation can be a single address translation stage used in that system (where the first address space is the virtual address space 40 and the second address space is the physical address space 52, and the single translation table stage directly maps the address from the virtual address space 40 to the physical address space 52). When using a two-stage address translation system, stage n translation can be stage 1 translation (where the first address space is the virtual address space 40 and the second address space is the intermediate address space 46, and the translated address mapping is determined based on stage 1 translation table 44) or stage 2 translation (where the first address space is the intermediate address space 46 and the second address space is the physical address space 52, and the translated address mapping is determined based on stage 2 translation table 50).

在步驟1300,MMU 6判定待執行標籤定位位址轉譯以獲得對應於使用標籤存取指令的位址運算元指定的資料位址的標籤定位實體位址。資料位址可經指定為虛擬位址空間40中的虛擬位址。In step 1300, MMU 6 determines the tag location address translation to be performed to obtain the tag location entity address corresponding to the data address specified by the address operand of the tag access instruction. The data address can be specified as a virtual address in virtual address space 40.

在步驟1302,取決於由標籤存取指令指定的資料位址來判定第一位址空間40、46中的資料定位第一位址。若階段n轉譯係單階段轉譯體系中的轉譯或係二階段轉譯體系的階段1轉譯,則資料定位第一位址可以單純係由指令指定的資料位址。若階段n轉譯係二階段轉譯體系中的階段2轉譯,則資料定位第一位址可以係藉由轉譯階段1轉譯中的資料位址VA獲得的中間位址(例如,圖11中的IPA1)。In step 1302, the first address of the data location in the first address space 40, 46 is determined based on the data address specified by the tag access instruction. If the stage n translation is a translation in a single-stage translation system or a stage 1 translation in a two-stage translation system, then the first address of the data location can simply be the data address specified by the instruction. If the stage n translation is a stage 2 translation in a two-stage translation system, then the first address of the data location can be an intermediate address obtained by translating the data address VA in the stage 1 translation (e.g., IPA1 in Figure 11).

在步驟1304,MMU 6判定哪種標籤轉譯模式係待用於從第一位址空間至第二位址空間的階段n位址轉譯的經選擇標籤轉譯模式。例如,經選擇標籤轉譯模式的判定可基於在控制暫存器14中儲存的標籤轉譯控制資訊啊,該標籤轉譯控制資訊由以至少給定特權等級操作的軟體設定(例如,若階段n轉譯係單階段轉譯或二階段體系中的階段1轉譯,則為作業系統層級特權,或若階段n轉譯係階段2轉譯,則為超管理器層級特權)。In step 1304, MMU 6 determines which label translation mode is the selected label translation mode to be used for stage n address translation from the first address space to the second address space. For example, the determination of the selected label translation mode may be based on label translation control information stored in control register 14, which is set by software to operate at least a certain privilege level (e.g., if stage n translation is a single-stage translation or a stage 1 translation in a two-stage architecture, it is an operating system level privilege, or if stage n translation is a stage 2 translation, it is a super administrator level privilege).

若MMU 6判定選擇了第一標籤轉譯模式(針對階段n轉譯禁用虛擬化標籤的轉譯模式),則在步驟1306,MMU 6獲得資料定位第二位址,該資料定位第二位址識別對應於資料位址的資料項及其相關聯的分配標籤二者在第二位址空間內的位置。例如,在步驟1302獲得的資料定位第一位址可用以查找TLB 8及/或轉譯表44、50,以獲得用於將資料定位第一位址轉譯成資料定位第二位址的位址映射資訊。在此情況中,資料轉譯及標籤轉譯二者將基於相同的轉譯表條目進行控制,該轉譯表條目提供從資料定位第一位址(例如,VA或IPA1)到資料定位第二位址(例如,IPA1或PA1)的位址映射。在步驟1308,MMU 6取決於資料定位第二位址來判定標籤定位實體位址。If MMU 6 determines that the first label translation mode (the translation mode that disables virtualized labels for stage n translation) has been selected, then in step 1306, MMU 6 obtains the second data location address. This second data location address identifies the position of the data item corresponding to the data address and its associated allocation label within the second address space. For example, the first data location address obtained in step 1302 can be used to look up TLB 8 and/or translation tables 44 and 50 to obtain the address mapping information used to translate the first data location address into the second data location address. In this case, both data translation and label translation are controlled based on the same translation table entry, which provides an address mapping from the first data location address (e.g., VA or IPA1) to the second data location address (e.g., IPA1 or PA1). In step 1308, MMU 6 determines the label location entity address based on the second data location address.

若MMU 6判定選擇了第二標籤轉譯模式(針對階段n轉譯啟用虛擬化標籤的轉譯模式),則在步驟1310,MMU 6獲得標籤定位第二位址(例如,IPA2或PA2),該標籤定位第二位址識別第二位址空間中的分配標籤的位置,該位置與由資料定位第二位址(例如,IPA1或PA1)識別的資料項的位置分開。與用以獲得資料定位第二位址的位址映射的條目相比,分開的轉譯表條目識別到標籤定位第二位址的映射。下文關於圖14至圖17解釋了可以如何定位此類分開的轉譯表條目的二個實例。在步驟1312,MMU 6取決在步驟1310處判定的標籤定位第二位址來判定標籤定位實體位址。If MMU 6 determines that the second label translation mode (the translation mode for enabling virtualized labels for stage n translation) has been selected, then in step 1310, MMU 6 obtains the label-located second address (e.g., IPA2 or PA2), which identifies the location of the allocation label in the second address space, separate from the location of the data item identified by the data-located second address (e.g., IPA1 or PA1). Separate translation table entries are identified to the label-located second address mapping compared to the entries used to obtain the address mapping for the data-located second address. Two examples of how such separate translation table entries can be located are explained below with reference to Figures 14 through 17. In step 1312, MMU 6 determines the physical address of the tag location based on the second address of the tag location determined in step 1310.

在步驟1308及1312二者,若階段n轉譯係單階段轉譯體系中的轉譯或係二階段轉譯體系中的階段2轉譯,則標籤定位實體位址可以單純等在步驟1306或1310處判定的資料定位第二位址,由於資料定位第二位址已經係實體位址空間中的實體位址。若階段n轉譯係二階段轉譯體系的階段1轉譯,則資料定位第二位址(亦用作標籤定位第二位址)可以進一步轉譯成標籤定位實體位址,例如,基於進一步的階段2轉譯。在選擇第一標籤轉譯模式用於二階段位址轉譯體系中的階段1轉譯的情況中,則在步驟1308,針對獲得標籤定位實體位址而執行的階段2轉譯可使用第一或第二標籤轉譯模式,取決於為階段2轉譯指定的任何模式選擇組態值。在第二標籤轉譯模式用於二階段轉譯的階段1轉譯的情況中,則在步驟1312,階段2轉譯可基於第一標籤轉譯模式執行(以防止藉由將第二標籤轉譯模式用於階段1轉譯及階段2轉譯二者中導致的不確定結果)。In steps 1308 and 1312, if stage n translation is a translation in a single-stage translation system or a stage 2 translation in a two-stage translation system, then the tag-located entity address can be simply equivalent to the data location second address determined in steps 1306 or 1310, since the data location second address is already an entity address in the entity address space. If stage n translation is a stage 1 translation in a two-stage translation system, then the data location second address (also used as the tag location second address) can be further translated into the tag-located entity address, for example, based on a further stage 2 translation. When the first label translation mode is selected for stage 1 translation in a two-stage address translation system, in step 1308, either the first or second label translation mode can be used for stage 2 translation performed to obtain the tag-located entity address, depending on the configuration value selected for any mode specified for stage 2 translation. When the second label translation mode is used for stage 1 translation in a two-stage translation system, in step 1312, stage 2 translation can be performed based on the first label translation mode (to prevent uncertainties arising from using the second label translation mode for both stage 1 and stage 2 translations).

將理解,每次執行標籤存取指令時可能不需要執行圖13所顯示的步驟。雖然在第一次存取不具有在TLB 8中快取的相關資訊的給定位址空間區域時可完全執行目前轉譯體系所需的任何轉譯階段,對於對相同位址空間區域的後續存取,可使用來自先前存取的在TLB 8中快取的資訊以避免需要再次執行完整的轉譯程序。例如,一些TLB 8可單純快取定義在虛擬位址空間中的給定資料位址與對應的標籤定位實體位址(其先前已經根據圖13中定義的程序判定)之間的關聯的資訊,以避免每次都需要考慮哪種標籤轉譯模式係所選的標籤轉譯模式。因此,雖然MMU 6可能具有支援針對標籤存取指令執行圖13中所顯示的操作的組態,其並不總是需要對各標籤存取指令使用彼組態。例如,可在頁表走訪中檢查用以選擇哪種標籤轉譯模式係經選擇標籤轉譯模式的控制資訊,但當標籤存取的位址在TLB 8中命中時可能不需要該控制資訊。It will be understood that the steps shown in Figure 13 may not need to be performed each time a tag access instruction is executed. Although any translation stage required by the current translation system can be performed on the first access to a given address space region that does not have relevant information cached in TLB 8, for subsequent accesses to the same address space region, information cached in TLB 8 from the previously accessed address space region can be used to avoid the need to perform the full translation procedure again. For example, some TLB 8 may simply cache information defining the association between a given data address in the virtual address space and the corresponding tag location entity address (which has been previously determined according to the procedure defined in Figure 13) to avoid having to consider which tag translation mode is selected each time. Therefore, although MMU 6 may have a configuration that supports the operation shown in Figure 13 for tag access instructions, it is not always necessary to use that configuration for each tag access instruction. For example, the control information used to select which tag translation mode is selected can be checked in the page table walkthrough, but this control information may not be needed when the address of the tag access is hit in TLB 8.

因此,若選擇第二標籤轉譯模式用於給定位址轉譯階段,則不同的轉譯表條目可用以識別經轉譯的第二位址空間中的分別對應於資料項及標籤的第二位址。圖14至圖17顯示用於識別用以獲得資料定位第二位址及標籤定位第二位址的映射的不同轉譯表條目的兩種實例技術。Therefore, if the second label translation mode is selected for the given address translation stage, different translation table entries can be used to identify the second addresses in the translated second address space corresponding to the data item and the label, respectively. Figures 14 to 17 show two example techniques for identifying different translation table entries used to obtain the mappings for the data location second address and the label location second address.

如圖14所顯示,一個選項係提供不同的轉譯表基底位址暫存器,用於分別儲存用以存取資料定位位址轉譯及標籤定位位址轉譯的轉譯表的基底位址。此意指相同的輸入位址可以用以從二個不同的轉譯表結構中選擇對應條目,一者用於資料存取且一者用於標籤存取,使得第一位址空間中的相同輸入位址可以映射至第二位址空間中的二個不同位址。負責控制給定位址轉譯階段的軟體可以負責將各不同的轉譯表結構所需的轉譯表條目儲存至記憶體並且設定轉譯表基底位址暫存器以指向各別轉譯表結構。從MMU 6中的硬體角度來看,轉譯程序對於資料及標籤存取二者可以係相同的,不同之處在於取決於目前轉譯係用於資料存取亦或分配標籤存取,在第一轉譯表基底位址暫存器與第二轉譯表基底位址暫存器之間進行選擇。As shown in Figure 14, one option is to provide different translation table base address registers to store the base addresses of the translation tables used for accessing data location address translation and label location address translation, respectively. This means that the same input address can be used to select the corresponding entry from two different translation table structures, one for data access and the other for label access, so that the same input address in the first address space can be mapped to two different addresses in the second address space. The software responsible for controlling the address translation stage can store the translation table entries required for each different translation table structure into memory and set the translation table base address registers to point to the respective translation table structures. From the hardware perspective of MMU 6, the translation procedure can be the same for both data and tag access. The difference lies in whether the translation is currently used for data access or to allocate tag access, and whether it is selected between the first translation table base address register and the second translation table base address register.

因此,如圖14所顯示,對於從第一位址空間90(虛擬或中間位址空間)至第二位址空間92(中間或實體位址空間)的階段n轉譯,對於資料定位位址轉譯操作,第一位址空間90中的給定資料定位第一位址94用以從用於資料存取的階段n資料轉譯表結構96中選擇對應的轉譯條目98。基於在第一轉譯表基底位址暫存器中儲存的第一轉譯表基底位址TTBR_data來識別階段n資料轉譯表結構96。基於對所選資料位址映射轉譯表條目98的存取,判定第二位址空間92中的對應資料定位第二位址104。雖然圖14為簡潔起見顯示了所選轉譯表條目98直接指定到資料定位第二位址104的映射,但將理解,通常階段n資料轉譯表結構96可係多層級表,且因此基於資料定位第一位址94選擇的條目98可實際上指定識別進一步轉譯表的表指標,且資料定位第二位址104可從遍歷此類表指標的一或多個步驟之後獲得的轉譯表條目獲得。Therefore, as shown in Figure 14, for stage n translation from the first address space 90 (virtual or intermediate address space) to the second address space 92 (intermediate or physical address space), for the data location address translation operation, the given data location first address 94 in the first address space 90 is used to select the corresponding translation entry 98 from the stage n data translation table structure 96 used for data access. The stage n data translation table structure 96 is identified based on the first translation table base address TTBR_data stored in the first translation table base address register. Based on the access to the selected data address mapping translation table entry 98, the corresponding data location second address 104 in the second address space 92 is determined. Although Figure 14 shows for simplicity the mapping of the selected translation table entry 98 directly to the data location second address 104, it will be understood that the stage n data translation table structure 96 can typically be a multi-level table, and therefore the entry 98 selected based on the data location first address 94 can actually specify the table pointer that identifies further translation tables, and the data location second address 104 can be obtained from the translation table entries obtained after traversing one or more steps of such table pointers.

另一方面,對於標籤定位位址轉譯操作,資料定位第一位址94將用以從與階段n資料轉譯表結構96分開的階段n標籤轉譯表結構100中選擇對應條目102。階段n標籤轉譯表結構100係基於與第一轉譯表基底位址TTBR_data分開的第二轉譯表基底位址TTBR_tag來識別。第二轉譯表基底位址儲存在與第一轉譯表基底位址暫存器分開的第二轉譯表基底位址暫存器中。基於對來自階段n標籤轉譯表結構的經選擇標籤位址映射轉譯表條目102的存取,判定第二位址空間92中的對應標籤定位第二位址106(同樣地,雖然圖14中顯示了用於標籤轉譯的表100的單一層級,將理解,一些實例可在獲得到標籤定位第二位址106的映射之前遍歷轉譯表的二或更多個層級)。On the other hand, for the tag location address translation operation, the first data location address 94 is used to select the corresponding entry 102 from the stage n tag translation table structure 100, which is separate from the stage n data translation table structure 96. The stage n tag translation table structure 100 is identified based on the second translation table base address TTBR_tag, which is separate from the first translation table base address TTBR_data. The second translation table base address is stored in a second translation table base address register, which is separate from the first translation table base address register. Based on access to the selected label address mapping translation table entry 102 from the stage n label translation table structure, the corresponding label is located at the second address 106 in the second address space 92 (similarly, although a single level of table 100 for label translation is shown in Figure 14, it will be understood that some instances may traverse two or more levels of the translation table before obtaining the mapping of the label to the second address 106).

因此,在圖14的實例中,在執行TLB或轉譯表查找之前,不需要對資料定位第一位址應用任何特殊的「資料至標籤(data-to-tag)」位址操縱或變換。相同的資料定位第一位址用作TLB或轉譯表查找程序的輸入,但用以分別從由不同基底位址存取的不同轉譯表結構中選擇,以進行資料及標籤存取。Therefore, in the example of Figure 14, no special "data-to-tag" address manipulation or transformation needs to be applied to the first address of the data location before performing a TLB or translation table lookup. The same first address of the data location is used as input to the TLB or translation table lookup procedure, but is used to select from different translation table structures accessed by different base addresses for data and tag access.

圖15繪示用於基於圖14的實例來執行標籤存取指令的標籤轉譯的步驟。步驟1500至1504與圖13的步驟1300至1304相同。Figure 15 illustrates the steps for performing tag translation of tag access instructions based on the example in Figure 14. Steps 1500 to 1504 are the same as steps 1300 to 1304 in Figure 13.

若第一標籤轉譯模式係針對階段n轉譯選擇的轉譯模式,則在步驟1506,MMU 6從基於資料轉譯表基底位址TTBR_data識別的資料轉譯表結構96獲得對應於資料定位第一位址94的階段n轉譯表條目98。在步驟1508,MMU 6使用來自在步驟1506獲得的階段n轉譯表條目的位址映射資訊,將第一位址空間90的資料定位第一位址94轉譯成第二位址空間92的資料定位第二位址104。用於獲得標籤定位實體位址的步驟1510與圖13的步驟1308相同。If the first label translation mode is the translation mode selected for stage n translation, then in step 1506, MMU 6 obtains the stage n translation table entry 98 corresponding to the first address 94 of the data location from the data translation table structure 96 identified based on the data translation table base address TTBR_data. In step 1508, MMU 6 uses the address mapping information from the stage n translation table entry obtained in step 1506 to translate the first address 94 of the data location in the first address space 90 into the second address 104 of the data location in the second address space 92. Step 1510 for obtaining the label location entity address is the same as step 1308 in Figure 13.

若第二標籤轉譯模式係針對階段n轉譯選擇的轉譯模式,則在步驟1512,MMU 6從基於標籤轉譯表基底位址TTBR_tag識別的標籤轉譯表結構100獲得對應於資料定位第一位址94的階段n轉譯表條目102。在步驟1514,MMU 6使用來自在步驟1512獲得的階段n轉譯表條目的位址映射資訊,將第一位址空間90的資料定位第一位址94轉譯成第二位址空間92的標籤定位第二位址106。用於獲得標籤定位實體位址的步驟1516與圖13的步驟1312相同。If the second label translation mode is the translation mode selected for stage n translation, then in step 1512, MMU 6 obtains the stage n translation table entry 102 corresponding to the first address 94 of the data location from the label translation table structure 100 identified based on the base address TTBR_tag of the label translation table. In step 1514, MMU 6 uses the address mapping information from the stage n translation table entry obtained in step 1512 to translate the first address 94 of the data location in the first address space 90 into the second address 106 of the label location in the second address space 92. Step 1516 for obtaining the entity address of the label location is the same as step 1312 in Figure 13.

圖16繪示分別針對資料存取及標籤存取轉譯應用的相同位址轉譯階段定位不同轉譯表條目的第二實例。在此實例中,相同的轉譯表結構112(經由在資料及標籤存取之間共用的基底位址TTBR存取)用以為資料定位位址轉譯及標籤定位位址轉譯二者提供位址映射。對於從第一位址空間90至第二位址空間92的給定位址轉譯階段(階段n)的資料定位位址轉譯,第一位址空間90中的資料定位第一位址110用以查找階段n轉譯表結構112,以獲得資料映射轉譯表條目116,其用以識別第二位址空間92中的資料定位第二位址120。同樣地,雖然為簡潔起見未在圖16中顯示,基於資料定位第一位址110選擇的經存取的資料映射轉譯表條目116中的資訊可能係用以在定位指定資料定位第二位址120的映射資訊之前遍歷一或多個進一步的表層級的表指標。Figure 16 illustrates a second example of locating different translation table entries for the same address translation stage in both data access and tag access translation applications. In this example, the same translation table structure 112 (accessed via the base address TTBR shared between data and tag access) is used to provide address mapping for both data location address translation and tag location address translation. For the data location address translation of a given address translation stage (stage n) from the first address space 90 to the second address space 92, the data location first address 110 in the first address space 90 is used to look up the stage n translation table structure 112 to obtain the data mapping translation table entry 116, which is used to identify the data location second address 120 in the second address space 92. Similarly, although not shown in Figure 16 for simplicity, the information in the accessed data mapping translation table entry 116 selected based on the first address 110 of the data location may be used to traverse one or more further table-level table indicators before locating the mapping information of the second address 120 of the specified data location.

另一方面,對於標籤定位位址轉譯,在查找與資料定位位址轉譯共用的共用轉譯表結構112之前,標籤定位位址判定電路系統10將變換函數應用於資料定位第一位址110以獲得標籤定位第一位址108。注意到,此變換係在相同(第一)位址空間90內的變換(不同於從一個位址空間轉譯至另一位址空間的位址轉譯階段)。稍後將關於圖22及圖23描述變換函數的實例。經變換的標籤定位第一位址108用以查找TLB 8或用作頁表走訪程序的輸入,用於遍歷階段n轉譯表結構112,使得經轉譯的標籤定位第二位址118取決於階段n轉譯表結構的標籤映射條目114,該條目可以與用於資料定位位址轉譯的資料映射條目116不同。注意到,雖然圖16顯示了不同的標籤映射條目114及資料映射條目116係在分別基於標籤定位第一位址108及資料定位第一位址110查找的第一轉譯表層級中分開的,在將階段n轉譯表結構112實施為多層級結構的情況中,其中基於來自輸入位址108、110的位元的不同部分來查找表的各層級,在一些情況中,第一層級轉譯表的相同條目可能用於標籤及資料轉譯二者,且其可以係在轉譯表的後續層級處的條目,其經不同地選擇用於標籤及資料轉譯,以最終提供分別用於分配標籤及資料項的不同轉譯的第二位址118、120。On the other hand, for tag location address translation, before looking up the shared translation table structure 112 shared with data location address translation, the tag location address determination circuit system 10 applies a transformation function to the first data location address 110 to obtain the first tag location address 108. Note that this transformation is within the same (first) address space 90 (different from the address translation stage from one address space to another). Examples of the transformation function will be described later with reference to Figures 22 and 23. The transformed label location first address 108 is used to look up TLB 8 or as input for a page table traversal procedure to traverse stage n translation table structure 112, such that the transformed label location second address 118 depends on the label mapping entry 114 of the stage n translation table structure, which may be different from the data mapping entry 116 used for data location address translation. Note that although Figure 16 shows different label mapping entries 114 and data mapping entries 116 separated in the first translation table level based on the first address 108 of the label location and the first address 110 of the data location, in the case where the stage n translation table structure 112 is implemented as a multi-level structure, where the different levels of the table are looked up based on different parts of the bits from the input addresses 108 and 110, in some cases, the same entry in the first-level translation table may be used for both label and data translation, and it may be an entry at a subsequent level of the translation table, which is selected differently for label and data translation, to ultimately provide second addresses 118 and 120 for different translations for allocating label and data items, respectively.

圖17繪示用於基於圖16的實例來執行標籤存取指令的標籤轉譯的步驟。步驟1700至1704與圖13的步驟1300至1304相同。Figure 17 illustrates the steps for performing tag translation of tag access instructions based on the example in Figure 16. Steps 1700 to 1704 are the same as steps 1300 to 1304 in Figure 13.

若第一標籤轉譯模式係針對階段n轉譯選擇的轉譯模式,則在步驟1706,MMU 6使用來自基於資料定位第一位址110從階段n轉譯表結構112選擇的階段n轉譯表條目116的位址映射資訊,將第一位址空間90的資料定位第一位址110轉譯成第二位址空間92的資料定位第二位址120。用於取決於資料定位第二位址而獲得標籤定位實體位址的步驟1708與圖13的步驟1308相同。If the first label translation mode is the translation mode selected for stage n translation, then in step 1706, MMU 6 uses the address mapping information from the stage n translation table entry 116 selected from the stage n translation table structure 112 based on the data location first address 110 to translate the data location first address 110 of the first address space 90 into the data location second address 120 of the second address space 92. Step 1708, which is used to obtain the label location entity address depending on the data location second address, is the same as step 1308 in Figure 13.

若第二標籤轉譯模式係針對階段n轉譯選擇的轉譯模式,則在步驟1710,標籤定位位址判定電路系統10獲得對應於第一位址空間90的資料定位第一位址110的第一位址空間90的標籤定位第一位址108。例如,從資料定位第一位址110到標籤定位第一位址108的變換可以基於將基於資料定位第一位址110選擇的偏移應用於定義第一位址空間90內的標籤儲存位址區域的位置的標籤儲存區域基底位址。在步驟1712,MMU 6使用來自基於標籤定位第一位址108從階段n轉譯表結構112選擇的階段n轉譯表條目114的位址映射資訊,將第一位址空間90的標籤定位第一位址108轉譯成第二位址空間92的資料定位第二位址118。用於取決於標籤定位第二位址而獲得標籤定位實體位址的步驟1714與圖13的步驟1312相同。If the second label translation mode is the translation mode selected for stage n translation, then in step 1710, the label location address determination circuit system 10 obtains the label location first address 108 of the first address space 90 corresponding to the data location first address 110 of the first address space 90. For example, the transformation from the data location first address 110 to the label location first address 108 can be based on applying the offset selected based on the data location first address 110 to the label storage area base address that defines the location of the label storage address area within the first address space 90. In step 1712, MMU 6 uses address mapping information from stage n translation table entry 114 selected from stage n translation table structure 112 based on label-located first address 108 to translate the label-located first address 108 of the first address space 90 into the data-located second address 118 of the second address space 92. Step 1714 for obtaining the label-located entity address depending on the label-located second address is the same as step 1312 in Figure 13.

圖18繪示在暫存器14中儲存的控制暫存器狀態的子集的實例,其與控制由MMU 6執行的標籤位址定位轉譯操作以及由標籤資料存取檢查電路系統32執行的標籤資料存取檢查相關。暫存器14包括與用以為指令提供通用運算元的通用暫存器分開的一組控制暫存器,該等控制暫存器定義在指令集架構中具有具體定義的含義的架構狀態。例如,控制暫存器狀態可用以控制處理器2的操作模式/狀態。控制暫存器狀態可影響處理器2如何處理指令。Figure 18 illustrates an example of a subset of control register states stored in register 14, which relate to the tag address location translation operation performed by MMU 6 and the tag data access check performed by tag data access check circuitry system 32. Register 14 includes a set of control registers separate from the general-purpose registers used to provide general-purpose operands for instructions, which define architectural states with specific meanings in the instruction set architecture. For example, control register states can be used to control the operating mode/state of processor 2. Control register states can affect how processor 2 processes instructions.

例如,執行電路系統16可支援與不同特權等級相關聯的多個異常等級中的處理指令。例如,所支援的異常等級可包括異常等級EL0至EL3,其中EL0係最低特權的且EL3係最高特權的,其中異常等級EL0用於應用程式層級程式碼,異常等級EL1用於作業系統層級程式碼,異常等級EL2用於超管理器層級程式碼,且異常等級EL3用於進行某些安全性管理操作的安全監管碼。將理解,此僅係可能特權方案的一個實例,且其他實例可具有不同的方法來指定在不同操作狀態下可用的不同特權等級,但後續實例參考此特定方案描述。For example, the executing circuit system 16 may support processing instructions in multiple exception levels associated with different privilege levels. For instance, the supported exception levels may include exception levels EL0 to EL3, where EL0 is the lowest privilege and EL3 is the highest privilege. Exception level EL0 is used for application-level code, exception level EL1 for operating system-level code, exception level EL2 for super administrator-level code, and exception level EL3 for security monitoring code performing certain security management operations. It will be understood that this is only one example of a possible privilege scheme, and other examples may use different methods to specify different privilege levels available in different operating states, but subsequent examples refer to this particular scheme description.

在圖18所顯示的暫存器名稱中,具有後綴_ELy(其中y=1、2或3)的暫存器名稱表示允許更新彼暫存器中的架構狀態的最低特權異常等級係異常等級ELy,因此嘗試從低於ELy的特權異常等級寫入該暫存器將導致傳訊錯誤(例如,具有後綴_EL2的暫存器可以從EL2或EL3而非從EL1寫入)。顯示為具有後綴_ELx的暫存器係分庫暫存器,對此可以提供對應於不同異常等級的暫存器的多個版本(例如,一個版本_EL2與超管理器層級異常等級EL2相關聯,且另一版本_EL1與作業系統層級異常等級相關聯)。In the register names shown in Figure 18, a register name with the suffix _ELy (where y = 1, 2, or 3) indicates that the lowest privilege exception level allowed to update the architecture state in that register is exception level ELy. Therefore, attempting to write to that register from a privilege exception level lower than ELy will result in a transmission error (for example, a register with the suffix _EL2 can be written from EL2 or EL3 instead of EL1). The registers displayed with the suffix _ELx are database registers, for which multiple versions of the registers corresponding to different exception levels can be provided (for example, one version _EL2 is associated with the super manager level exception level EL2, and another version _EL1 is associated with the operating system level exception level).

因此,在此實例中,提供了以下一組控制暫存器,指定以下控制狀態資訊項: SCTLR2_ELx(系統控制暫存器,經分庫以分別為EL1、EL2及EL3提供分開版本的暫存器──在給定時間使用哪個暫存器取決於目前異常等級係EL1、EL2亦或EL3),其指定: •     VTE:第一階段標籤轉譯模式指示符的實例,用於指定應啟用亦或禁用虛擬標籤(使用第二標籤轉譯模式進行階段1位址轉譯).例如,VTE可以編碼如下: ○    0:虛擬標籤已禁用; ○    1:虛擬標籤已啟用。 (此編碼可以有助於與舊碼向後相容,該舊碼可假設已經再利用以提供VTE指示符的暫存器SCTLR2的保留位元具有值0)。 •     nDGA:標籤資料存取檢查啟用指示,用於指定是否啟用標籤資料存取檢查(下文進一步描述)。例如,nDGA可以編碼如下: ○    0:標籤資料存取檢查已啟用 ○    1:標籤資料存取檢查已禁用 (利用負編碼實施nDGA,其中當nDGA的值為1時禁用檢查)可以有助於與舊碼向後相容,該舊碼可假設已經再利用以提供nDGA指示符的暫存器SCTLR2的保留位元將具有值0,因此認為啟用標籤資料存取檢查可能更安全,除非意識到標籤資料存取檢查的軟體已經藉由將nDGA設定為1來顯式地選擇禁用該標籤資料存取檢查)。 Therefore, in this example, the following set of control registers is provided, specifying the following control status information items: SCTLR2_ELx (System control register, partitioned to provide separate versions of registers for EL1, EL2, and EL3—which register is used at a given time depends on whether the current exception level is EL1, EL2, or EL3), specifying: • VTE: An instance of the first-stage label translation mode indicator, used to specify whether virtual labels should be enabled or disabled (using the second-stage label translation mode for stage 1 address translation). For example, VTE can be encoded as follows: ○ 0: Virtual label is disabled; ○ 1: Virtual label is enabled. (This encoding helps ensure backward compatibility with older codes that assume reserved bits in the SCTLR2 register, which has been reused to provide the VTE indicator, have a value of 0.) • nDGA: Tag data access check enable indicator, used to specify whether tag data access checks are enabled (described further below). For example, nDGA can be encoded as follows: ○ 0: Tag data access checks are enabled ○ 1: Tag data access checks are disabled (Implementing nDGA using negative encoding, where checks are disabled when nDGA is 1) can help with backward compatibility with legacy code that assumes reserved bits in the register SCTLR2, which has been reused to provide the nDGA indicator, will have a value of 0, thus assuming that enabling tag data access checks might be safer, unless the software aware of the tag data access checks has explicitly opted to disable them by setting nDGA to 1.)

TCR2_ELx(轉譯控制暫存器,其經分庫以提供與取決於目前異常等級在其間選擇的異常等級EL1、EL2及EL3相關聯的分開版本),其指定用於定義位址空間的標籤區域的基底位址的數項標籤表基底位址資訊VTB、VTB0、VTB1、VGB,其用於從資料定位第一位址110到標籤定位第一位址108的變換,如圖16所顯示。項VGB僅在與EL2相關聯的TCR2_EL2版本中提供,且未提供給EL1或EL3。哪項標籤表基底位址資訊用於給定轉譯操作取決於使用哪種轉譯體系及哪個位址轉譯階段係已經啟用第二標籤轉譯模式的給定位址轉譯階段: •     對於階段2轉譯,若已經啟用中間標籤(使用第二標籤轉譯模式進行階段2轉譯),則標籤表基底位址由暫存器TCR2_EL2中的VGB判定; •     對於支援單一可轉譯位址區域的轉譯體系中的階段1轉譯(有關可轉譯位址區域的更多描述,參見下文的圖20),若已經啟用虛擬標籤(使用第二標籤轉譯模式進行階段1轉譯),則標籤表基底位址由暫存器TCR2_ELx中的VTB判定,其中ELx係目前異常等級;及 •     對於支援二個可轉譯位址區域的轉譯體系中的階段1轉譯(同樣地,參見下文論述的圖20),若已經啟用虛擬標籤,則標籤表基底位址由暫存器TCR2_ELx中的VTB0或VTB1判定,其中ELx係目前異常等級,其中若資料定位第一位址的最高有效位元係0(亦即,位址位於可轉譯區域0中),則使用VTB0,且若資料定位第一位址的最高有效位元係1(亦即,位址位於可轉譯區域1中),則使用VTB1。 TCR2_ELx (Translation Control Register, which is partitioned to provide separate versions associated with exception levels EL1, EL2, and EL3 depending on the current exception level) specifies several tag table base address information VTB, VTB0, VTB1, and VGB used to define the base address of the tag region in the address space for the translation from the first address of the data location 110 to the first address of the tag location 108, as shown in Figure 16. The VGB item is only provided in the TCR2_EL2 version associated with EL2 and is not provided for EL1 or EL3. Which label table base address information is used for a given translation operation depends on the translation system used and which address translation stage has enabled the second label translation mode: • For stage 2 translation, if intermediate labels are enabled (stage 2 translation is performed using the second label translation mode), the label table base address is determined by VGB in register TCR2_EL2; • For Stage 1 translation in a translation system that supports a single translatable address region (see Figure 20 below for a more detailed description of translatable address regions), if virtual tags are enabled (Stage 1 translation using the second tag translation mode), the tag table base address is determined by the VTB in register TCR2_ELx, where ELx is the current exception level; and • For Stage 1 translation in a translation system that supports two translatable address regions (again, see Figure 20 discussed below), if virtual tags are enabled, the base address of the tag table is determined by either VTB0 or VTB1 in register TCR2_ELx, where ELx is the current exception level. If the most significant bit of the first address of the data location is 0 (i.e., the address is in translatable region 0), VTB0 is used; and if the most significant bit of the first address of the data location is 1 (i.e., the address is in translatable region 1), VTB1 is used.

無論使用哪項標籤表基底位址資訊VTB、VTB0、VTB1、VGB,皆可以對標籤表基底位址進行編碼,使得標籤表基底位址資訊僅指定對準基底位址的數個高位元(使得可以從儲存的暫存器狀態中省略對於對準的基底位址全部隱式地設定為0的較低有效位元)。Regardless of which label table base address information VTB, VTB0, VTB1, or VGB is used, the label table base address can be encoded so that the label table base address information only specifies a few high bits of the corresponding base address (so that the lower significant bits that are implicitly set to 0 for the corresponding base address can be omitted from the stored register state).

HCR2_EL2(或替代地,VTCR_EL2):用於儲存超管理器控制資訊(或由超管理器設定的用於控制位址轉譯虛擬化的資訊)的暫存器。HCR2_EL2或VTCR_EL2指定第二階段標籤轉譯控制指示符IPMTE,其指示啟用亦或禁用中間標籤(使用第二標籤轉譯模式進行階段2轉譯)。IPMTE具有以下編碼: ○    0:中間標籤已禁用; ○    1:中間標籤已啟用。 (同樣地,此編碼可以有助於向後相容,由於舊碼可假設再利用以提供IPMTE控制的保留位元可具有值0)。 HCR2_EL2 (or alternatively, VTCR_EL2): A register used to store supermanager control information (or information set by the supermanager for controlling address translation virtualization). HCR2_EL2 or VTCR_EL2 specifies the second-stage label translation control indicator IPMTE, which indicates whether the intermediate label is enabled or disabled (stage 2 translation is performed using the second label translation mode). IPMTE has the following codes: ○ 0: Intermediate label is disabled; ○ 1: Intermediate label is enabled. (Similarly, this coding can help with backward compatibility, as older codes can be assumed to be reused to provide reserved bits for IPMTE control that can have a value of 0).

TCR1_ELx(轉譯控制暫存器,經分庫以分別為EL1、EL2、EL3提供分開版本)──另一個暫存器提供與異常等級ELx相關聯的轉譯控制資訊。TCR1_ELx指定定義各可轉譯位址區域的大小的資訊: •     T0SZ:定義單一區域轉譯體系中的單一可轉譯位址區域的大小或雙區域轉譯體系中的可轉譯位址區域0的大小; •     T1SZ:定義雙區域可轉譯區域中的第二可轉譯位址區域1的大小。 TCR1_ELx (Translation Control Register, partitioned to provide separate versions for EL1, EL2, and EL3) – Another register provides translation control information associated with the exception level ELx. TCR1_ELx specifies information defining the size of each translatable address region: • T0SZ: Defines the size of a single translatable address region in a single-region translation system or the size of translatable address region 0 in a two-region translation system; • T1SZ: Defines the size of the second translatable address region 1 in a two-region translatable system.

例如,T0SZ及T1SZ可指定值x,使得對應的可轉譯位址區域的大小係2 (64-x)位元組。 For example, T0SZ and T1SZ can specify a value x such that the size of the corresponding translatable address region is 2 (64-x) bytes.

TTBR:數個轉譯表基底位址暫存器(translation table base address register, TTBR),其用於提供轉譯表結構的基底位址。對於資料存取,TTBR可指定多個轉譯表基底位址暫存器,包括例如: -      TTBR0_ELx(分別為EL1、EL2、EL3的分開版本):待用於單區域轉譯體系中的資料存取或雙區域轉譯體系的可轉譯區域0中的資料存取的轉譯表的基底位址; -      TTBR1_ELx(分別為EL1及EL2的分開版本):待用於雙區域轉譯體系的可轉譯區域1中的資料存取的轉譯表的基底位址。 TTBR: Several translation table base address registers (TTBRs) are used to provide the base addresses of translation table structures. For data access, TTBRs can specify multiple translation table base address registers, including, for example: - TTBR0_ELx (separate versions of EL1, EL2, and EL3): The base address of the translation table to be used for data access in a single-area translation system or for data access in the translateable area 0 of a two-area translation system; - TTBR1_ELx (separate versions of EL1 and EL2): The base address of the translation table to be used for data access in the translateable area 1 of a two-area translation system.

例如,圖14中的TTBR_data及圖16中的TTBR可係基於下列選擇的TTBR0_ELx及TTBR1_ELx中之相關一者中指定的位址:(i)目前異常等級,以及(ii)單或雙可轉譯區域轉譯體系是否在操作中(圖18中未顯示的其他控制狀態可指定哪個轉譯體系係目前體系)。對於標籤轉譯,若使用圖16所顯示的方法,則標籤轉譯使用與用於資料轉譯的轉譯表基底位址相同的轉譯表基底位址。然而,若使用圖14所顯示的方法,則如圖18中的虛線所顯示,TTBR亦可包括數個進一步TTBR,用於為對應於由用於資料存取的對應TTBR引用的資料轉譯表結構96的標籤轉譯表結構100提供額外的基底位址TTBR_tag。因此,各TTBR可在此情況中具有二個版本:一者用於資料存取且一者用於標籤。For example, TTBR_data in Figure 14 and TTBR in Figure 16 may be based on an address specified by one of the following selected TTBR0_ELx and TTBR1_ELx: (i) the current exception level, and (ii) whether a single or dual translatable region translation system is in operation (other control states not shown in Figure 18 may specify which translation system is currently in operation). For label translation, if the method shown in Figure 16 is used, label translation uses the same translation table base address as the translation table base address used for data translation. However, if the method shown in Figure 14 is used, as indicated by the dashed lines in Figure 18, the TTBR may also include several further TTBRs to provide additional base addresses TTBR_tag for the tag translation table structure 100 corresponding to the data translation table structure 96 referenced by the corresponding TTBR used for data access. Thus, each TTBR may have two versions in this case: one for data access and one for tagging.

將理解,所提供的具體控制暫存器及彼等暫存器內的控制狀態的特定佈局可能從一個ISA到另一者明顯變化。因此,控制狀態項到特定暫存器的特定分配或指定給定控制狀態組在單一暫存器中亦或分佈在分開的暫存器中的特徵並不是特別重要,且可以以其他方式實施。類似地,沒有必要提供與不同異常等級相關聯的相同暫存器的分庫版本,且其他實例可以提供各架構狀態項的單一版本(當在一個異常等級與另一異常等級之間切換時,軟體切換狀態的值)。然而,不同異常等級的分庫狀態項可以用於減少軟體在處理異常及從異常返回時的管理負擔。It will be understood that the specific control registers provided and the particular layout of the control states within those registers may vary significantly from one ISA to another. Therefore, the specific allocation of control state items to specific registers, or the characteristic of assigning a given group of control states to a single register or distributed across separate registers, is not particularly important and can be implemented in other ways. Similarly, it is not necessary to provide separate versions of the same registers associated with different exception levels, and other instances can provide a single version of each architectural state item (the software switches the state value when switching between one exception level and another). However, separate state items for different exception levels can be used to reduce the software's administrative burden when handling exceptions and returning from exceptions.

儘管如此,對於控制與虛擬化標籤支援相關的操作而言,通常提供以下內容可以係有用的: -      標籤轉譯控制資訊(例如,第一階段標籤轉譯模式指示符VTE及第二階段標籤轉譯模式指示符IPMTE),其用以控制在給定位址轉譯階段,使用第一亦或第二標籤轉譯模式來執行標籤定位位址轉譯; -      標籤資料存取檢查啟用資訊(例如,nDGA),其控制啟用亦或禁用標籤資料存取檢查; -      用於定義第一位址空間90中的分配標籤儲存區域的位置及大小的資訊,此對於標籤轉譯涉及應用於資料定位第一位址110的位址變換以產生標籤定位第一位址108的實例係有用的,如圖16所顯示,且對於在標籤資料存取檢查中判定資料存取是否已在第一位址空間的標籤儲存區域中的位址中指定係有用的;及/或 -      在標籤轉譯使用與用於資料轉譯的轉譯表分開的另一組轉譯表的實例中(如圖14所顯示),彼等轉譯表結構有一或多個額外基底位址待用於標籤轉譯。 Nevertheless, for operations related to control and virtualization tag support, the following information is typically useful: - Tag translation control information (e.g., the first-stage tag translation mode indicator VTE and the second-stage tag translation mode indicator IPMTE), which controls whether the first or second tag translation mode is used to perform tag address translation during the given address translation stage; - Tag data access check enable information (e.g., nDGA), which controls whether tag data access checks are enabled or disabled; - Information used to define the location and size of the allocation tag storage area in the first address space 90 is useful for tag translation involving address transformation applied to data location first address 110 to generate tag location first address 108, as shown in Figure 16, and is useful in determining whether data access has been specified in the address within the tag storage area of the first address space during tag data access checks; and/or - In instances where tag translation uses a separate set of translation tables from the translation tables used for data translation (as shown in Figure 14), those translation table structures have one or more additional base addresses to be used for tag translation.

此資訊可以以與圖18中所顯示的格式不同的格式提供,但出於實例的緣故,後續描述引用圖18所顯示的特定指示符。This information may be provided in a different format than that shown in Figure 18, but for the sake of example, the following description refers to the specific indicator shown in Figure 18.

圖19繪示用於當在二階段位址轉譯體系中待執行轉譯操作以獲得待由標籤存取指令存取的(多個)分配標籤的位址時,控制是否執行標籤位址轉譯操作(對應於前文提及的第二標籤轉譯模式)或資料位址轉譯操作(對應於第一標籤轉譯模式)以獲得給定位址轉譯階段中的標籤定位第二位址的操作。圖19顯示了針對階段1及階段2位址轉譯二者的此判定。Figure 19 illustrates the control used in a two-stage address translation system to determine whether to perform a label address translation operation (corresponding to the second label translation mode mentioned above) or a data address translation operation (corresponding to the first label translation mode) to obtain the operation of locating a second address for the label in the address translation stage when a translation operation is pending to be performed to obtain the address of (multiple) allocation labels to be accessed by a label access instruction. Figure 19 shows this determination for both stage 1 and stage 2 address translations.

在步驟1900,MMU 6判定執行哪類別的指令以導致執行標籤定位位址轉譯。例如,正執行的標籤存取指令可以係: -      經標籤檢查記憶體存取指令,其指定識別給定資料項的目標資料位址,且請求對給定資料項本身進行讀取/寫入記憶體存取,且亦請求(若目標資料位址對應於有標籤記憶體區域,如參考圖12所論述的)使用記憶體系統中儲存的對應分配標籤及與指令的位址運算元相關聯的位址標籤執行標籤檢查; -      (非主體)標籤讀取/寫入指令,其指定識別特定大小的一或多個資料項的區塊(僅單一標籤顆粒或對應於多個標籤顆粒的資料項)的目標資料位址,但不需要存取資料項本身,而是請求在儲存對應於彼等資料項的(多個)分配標籤的(多個)位置上執行讀取/寫入操作。此類指令可以用以在分配或解除分配記憶體區域時設定標籤值,如圖5所顯示。非主體標籤讀取/寫入指令藉由指定對應的資料項位址來間接指定需要讀取或寫入的(多個)標籤的位址。在圖16的實例中,比如說,非主體標籤讀取/寫入指令可將對應於第一位址空間90中的資料定位第一位址110的虛擬位址指定為其目標資料位址,但可導致對對應於標籤定位第二位址118的實體位址而非對應於資料定位第二位址120的實體位址執行記憶體存取。 -      主體標籤讀取/寫入指令,其係特殊類別的標籤讀取/寫入指令,其直接指定標籤本身的位址,而非藉由指定對應資料項的位址來間接指定標籤的位置。例如,參考圖16,比如說,主體標籤讀取/寫入指令可將對應於標籤定位第一位址108的虛擬位址指定為其目標位址(例如,若圖16所顯示的位址轉譯階段係階段1,則主體標籤讀取/寫入指令的位址運算元將標籤定位第一位址108指定為虛擬位址,或者若圖16所述的階段係階段2,則標籤定位第一位址108係由指令指定的虛擬位址的階段1轉譯的結果)。將標籤定位第一位址108轉譯成如同其係資料位址,接著導致對對應於基於階段n轉譯中的標籤映射條目114轉譯的標籤定位第二位址118的實體位址進行讀取/寫入存取。提供此類主體標籤讀取/寫入指令可以係有用的,該等指令直接指定標籤位址而非經由資料位址間接地指定標籤位址,以簡化超管理器對客戶作業系統的階段1轉譯表的管理。 In step 1900, MMU 6 determines which type of instruction to execute to cause a tag-location address translation. For example, the tag access instruction being executed could be: - A tag-check memory access instruction that identifies the target data address of a given data item and requests a read/write memory access to the given data item itself. It also requests (if the target data address corresponds to a tagged memory region, as discussed in Figure 12) to perform a tag check using the corresponding allocation tag stored in the memory system and the address tag associated with the instruction's address operands; - Non-subject tag read/write instructions specify the target data address that identifies a block of one or more data items of a specific size (a single tag grain or data items corresponding to multiple tag grains), but do not require access to the data items themselves. Instead, they request read/write operations to be performed at (multiple) locations of (multiple) allocation tags corresponding to those data items. These instructions can be used to set tag values when allocating or deallocating memory regions, as shown in Figure 5. Non-subject tag read/write instructions indirectly specify the addresses of (multiple) tags to be read or written by specifying the corresponding data item addresses. In the example of Figure 16, for instance, a non-subject tag read/write instruction can specify the virtual address corresponding to the first data location address 110 in the first address space 90 as its target data address, but may result in memory access being performed at the physical address corresponding to the second tag location address 118 instead of the physical address corresponding to the second data location address 120. - Subject tag read/write instructions, which are a special type of tag read/write instruction, directly specify the address of the tag itself, rather than indirectly specifying the tag's location by specifying the address of the corresponding data item. For example, referring to Figure 16, the subject tag read/write instruction can specify the virtual address corresponding to the first address 108 of the tag location as its target address (for example, if the address translation stage shown in Figure 16 is stage 1, then the address operand of the subject tag read/write instruction specifies the first address 108 of the tag location as the virtual address, or if the stage shown in Figure 16 is stage 2, then the first address 108 of the tag location is the result of the translation of the virtual address specified by the instruction in stage 1). The first address of the label location, 108, is translated as if it were a data address, which then results in a read/write access to the physical address of the second address of the label location, 118, corresponding to the label mapping entry 114 translated based on stage n translation. Providing such main label read/write instructions that directly specify the label address instead of indirectly specifying it via a data address can be useful, simplifying the super manager's management of the stage 1 translation table for the client operating system.

若需要標籤定位位址轉譯的目前指令係藉由指定資料位址來指定標籤位置的指令(例如,係經標籤檢查記憶體存取指令或係非主體標籤讀取/寫入指令),則於圖19的步驟1902,MMU 6判定對應於目前轉譯體系的第一階段標籤轉譯模式指示符VTE指示針對階段1位址轉譯啟用虛擬標籤(例如,若支援不同異常等級的VTE的多個分庫版本,則VTE可以從與目前異常等級ELx相關聯的暫存器的相關版本SCTLR2_ELx讀取)。若針對目前轉譯體系的階段1轉譯啟用虛擬標籤,則在步驟1904,MMU 6將標籤位址轉譯操作(例如,根據圖13、圖15或圖17所顯示的第二標籤轉譯模式)應用於由標籤存取指令指定的資料位址的階段1轉譯。在步驟1906,階段2轉譯接著根據資料位址轉譯操作(例如,根據圖13、圖15或圖17所顯示的第一標籤轉譯模式)執行。步驟1904、1906的組合意指整體二階段位址轉譯如圖10所顯示的虛擬標籤方法中一般執行,其中階段1轉譯係將虛擬資料位址映射至中間位址空間中的分開資料及標籤位址的轉譯,該等位址可以接著在階段2轉譯中各自進一步轉譯成分開的實體位址。If the current instruction requiring tag-based address translation is an instruction that specifies the tag location by specifying a data address (e.g., a tag-check memory access instruction or a non-subject tag read/write instruction), then in step 1902 of Figure 19, MMU 6 determines that the first-stage tag translation mode indicator VTE corresponding to the current translation system indicates that virtual tags are enabled for stage 1 address translation (e.g., if multiple library versions of VTE with different exception levels are supported, then VTE can be read from the version SCTLR2_ELx associated with the register associated with the current exception level ELx). If virtual tags are enabled for Stage 1 translation of the current translation system, then in step 1904, MMU 6 applies a tag address translation operation (e.g., according to the second tag translation mode shown in Figures 13, 15, or 17) to the Stage 1 translation of the data address specified by the tag access instruction. In step 1906, Stage 2 translation is then performed according to the data address translation operation (e.g., according to the first tag translation mode shown in Figures 13, 15, or 17). The combination of steps 1904 and 1906 means that the overall two-stage address translation is generally performed in the virtual tagging method shown in Figure 10. The stage 1 translation maps the virtual data address to the separate data and tag addresses in the intermediate address space. These addresses can then be further translated into separate physical addresses in the stage 2 translation.

若判定第一階段標籤轉譯模式指示符指示針對階段1轉譯(在步驟1902為N)禁用虛擬標籤,或經執行以導致標籤存取的指令係指定標籤位址(而非資料位址)的主體標籤讀取/寫入指令,則在步驟1908將資料位址轉譯操作(亦即,圖13、圖15或圖17所顯示的第一標籤轉譯模式)應用於階段1位址轉譯,因此針對階段1禁用虛擬標籤。在步驟1910,MMU 6判定在對應於目前轉譯體系的控制暫存器HCR2_EL2或VTCR_EL2中儲存的第二階段標籤轉譯模式指示符IPMTE是否指示啟用中間標籤。若啟用,則在步驟1912,MMU 6在執行從中間位址空間至實體位址空間的階段2轉譯時應用標籤位址轉譯操作(圖13、圖15或圖17所顯示的第二標籤轉譯模式),且因此應用中間標籤,如圖11所顯示,其中階段1轉譯將資料及標籤存取共同地從虛擬位址空間轉譯至中間位址空間,但將識別中間位址空間中的資料的位置的給定中間位址IPA1映射至識別分配標籤位置的標籤定位實體PA2,該分配標籤位置與識別對應資料項的實體位址PA1分開。If the first-stage label translation mode indicator indicates that virtual labels are disabled for stage 1 translation (N in step 1902), or if the instruction executed to cause label access is a subject label read/write instruction specifying a label address (not a data address), then in step 1908, a data address translation operation (i.e., the first label translation mode shown in Figures 13, 15, or 17) is applied to the stage 1 address translation, thus disabling virtual labels for stage 1. In step 1910, MMU 6 determines whether the second-stage label translation mode indicator IPMTE stored in the control register HCR2_EL2 or VTCR_EL2 corresponding to the current translation system indicates that the intermediate label is enabled. If enabled, in step 1912, MMU 6 applies a label address translation operation (the second label translation mode shown in Figures 13, 15, or 17) when performing stage 2 translation from the intermediate address space to the physical address space, and thus applies intermediate labels, as shown in Figure 11, where stage 1 translation translates data and label access together from the virtual address space to the intermediate address space, but maps the given intermediate address IPA1 that identifies the location of data in the intermediate address space to the label location entity PA2 that identifies the assigned label location, which is separate from the physical address PA1 that identifies the corresponding data item.

另一方面,若在步驟1910檢查的第二階段標籤轉譯模式指示符識別出於階段2禁用中間標籤,則在步驟1906亦將資料位址轉譯操作(第一標籤轉譯模式)應用於階段2,且因此在此情況中,步驟1908及1906的組合將係階段1及2二者使用資料位址轉譯操作(第一標籤轉譯模式),且因此將使用實體標籤方法,諸如圖9所顯示的方法,其中兩種資料及其相關聯的分配標籤使用相同的實體位址識別,且留給記憶體系統基於資料定位實體位址來定位標籤的儲存位置。On the other hand, if the second-stage label translation mode indicator checked in step 1910 identifies that intermediate labels are disabled in stage 2, then the data address translation operation (first label translation mode) is also applied to stage 2 in step 1906. Therefore, in this case, the combination of steps 1908 and 1906 will be that both stages 1 and 2 use the data address translation operation (first label translation mode), and thus the entity labeling method will be used, as shown in Figure 9, in which the two types of data and their associated allocation labels use the same entity address for identification, and the memory system is left to locate the storage location of the label based on the data location entity address.

如上文關於圖16所述,標籤定位位址轉譯操作(第二標籤轉譯模式)的一些實施方案可包括以下步驟:標籤定位位址判定電路系統10基於識別第一位址空間90中的給定資料項的位置的資料定位第一位址110來判定識別第一位址空間90中的對應分配標籤的位置的標籤定位第一位址108,接著應用給定位址轉譯階段來將標籤定位第一位址108轉譯成第二位址空間92中的標籤定位第二位址118。任何映射函數可用以從資料定位第一位址110衍生標籤定位第一位址108。例如,可藉由軟體在記憶體中維持資料到標籤位址映射表,以指定在資料定位第一位址110與對應的標籤定位第一位址108之間的映射。例如,可在ISA的控制暫存器中提供進一步的基址暫存器,以儲存用以存取資料到標籤位址映射表的基底位址。此方法可在第一位址空間90中為儲存標籤指定的位置方面提供更大的靈活性,但可能增加軟體設定資料到標籤位址映射的管理負擔及硬體的管理負擔,而導致存取資料到標籤位址映射表的額外延時。另一方法可以係各資料定位第一位址可與對應的標籤定位第一位址具有一一固定映射(具有限制彼映射的固定映射函數,諸如各標籤定位第一位址與對應的資料定位第一個位址具有某一偏移)。然而,在軟體無法改變在資料定位第一位址110與標籤定位第一位址108之間的映射的情況中,此可能不可接受地限制資料項在第一位址空間90內可以放置的位置,而在調整出於其他目的由資料使用的位址空間區域時導致更大的負擔。As described above with respect to Figure 16, some embodiments of the tag location address translation operation (second tag translation mode) may include the following steps: The tag location address determination circuit system 10 determines the tag location first address 108 in the first address space 90 based on the data location first address 110 that identifies the location of a given data item in the first address space 90, and then applies a given address translation stage to translate the tag location first address 108 into the tag location second address 118 in the second address space 92. Any mapping function can be used to derive the tag location first address 108 from the data location first address 110. For example, a data-to-tag address mapping table can be maintained in memory by software to specify the mapping between the data location first address 110 and the corresponding tag location first address 108. For example, a further base address register can be provided in the ISA's control register to store the base address used to access the data to the tag address mapping table. This method provides greater flexibility in storing the location specified by the tag in the first address space 90, but may increase the management burden of software setting the data to tag address mapping and the management burden of hardware, resulting in additional latency in accessing the data to the tag address mapping table. Another method could be that each data location's first address has a one-to-one fixed mapping with the corresponding tag location's first address (with a fixed mapping function that restricts the mapping, such as each tag location's first address and the corresponding data location's first address having a certain offset). However, in cases where the software cannot change the mapping between the first address 110 of the data location and the first address 108 of the label location, this may unacceptably limit where data items can be placed within the first address space 90, leading to a greater burden when adjusting address space areas used by the data for other purposes.

圖20至圖23繪示用於執行標籤定位位址判定操作的方法,該方法平衡了軟體改變在第一位址空間90中分配用於儲存分配標籤的位址的靈活性與在硬體中執行的更簡單且更效能高效的操作。Figures 20 to 23 illustrate a method for performing a tag location address determination operation that balances the flexibility of software changes in allocating addresses in the first address space 90 for storing allocated tags with a simpler and more efficient operation performed in hardware.

如圖20所顯示,給定轉譯體系可將有效資料位址限制為位於有限數目的可轉譯位址區域之一中。圖20顯示具有單一可轉譯位址區域的實例(圖20的左側)及具有二個可轉譯位址區域的實例(圖20的右側)。嘗試使用不可轉譯位址區域(在可轉譯位址區域中的任一者之外)中的位址來存取資料可導致傳訊記憶體錯誤。此方法可以係有用的,因為雖然64位元指令集架構中的位址運算元可理論上能夠定址2 64個不同位元組的位址空間,實際上目前的使用要求不需要那麼多的可定址記憶體容量,且因此實際上較小數目的位元可能足以支援所需的可定址位置的數目。例如,可轉譯區域的大小可能被限制為2 48、2 53或2 56個位元組的位址空間,挑選一些任意的實例。藉由留下不支援在彼區域中指定的任何有效位址的一些不可轉譯區域,此具有幾個優點。首先,此意指設定位址轉譯映射的軟體不需要提供對應於不可轉譯區域的任何有效位址映射,此減小了維持轉譯表結構的負擔。再者,在較大(例如,64位元)位址運算元的頂部具有一些未使用的位元留下一些空間用於編碼位址運算元中的其他資訊,諸如圖4所顯示的位址標籤80。 As shown in Figure 20, a given translation system can restrict valid data addresses to one of a finite number of translatable address regions. Figure 20 shows an example with a single translatable address region (left side of Figure 20) and an example with two translatable address regions (right side of Figure 20). Attempting to access data using an address in a non-translatable address region (other than any of the translatable address regions) can result in a transmission memory error. This approach can be useful because, although address operands in a 64-bit instruction set architecture can theoretically address 2 ^64 different bytes of address space, current usage requirements do not necessitate that much addressable memory capacity, and therefore a smaller number of bits may be sufficient to support the required number of addressable locations. For example, the size of a translatable region might be limited to an address space of 2 ^48 , 2 ^53 , or 2 ^56 bytes, choosing some arbitrary examples. This has several advantages by leaving some non-translatable regions that do not support any valid addresses specified in those regions. First, this means that the software assuming address translation mappings does not need to provide any valid address mappings corresponding to the non-translatable regions, thus reducing the burden of maintaining the translation table structure. Furthermore, some unused bits are placed at the top of larger (e.g., 64-bit) address operands to leave some space for encoding other information in the address operand, such as the address label 80 shown in Figure 4.

如圖20的左側實例所顯示,對於使用單一可轉譯區域200用於第一位址空間90的轉譯體系,彼區域可覆蓋2 t個位元組的位址空間,而從位址0延伸至位址2 t-1,其中t係根據如上所述的暫存器TCR1_ELx中的區域大小指示值T0SZ判定的可轉譯區域大小(同樣地,T0SZ參數可能存在對應於不同異常級別的多於一個版本,其中目前轉譯體系的特定區域大小取決於目前異常級別)。 As shown in the example on the left of Figure 20, for a translation system that uses a single translatable region 200 for the first address space 90, that region can cover an address space of 2t bytes, extending from address 0 to address 2t -1, where t is the size of the translatable region determined according to the region size indicator value TOSZ in the register TCR1_ELx as described above (again, the TOSZ parameter may have more than one version corresponding to different exception levels, where the specific region size of the current translation system depends on the current exception level).

為了容納用於在第一位址空間內定位分配標籤的標籤定位位址,在可轉譯位址區域200內定義了標籤表位址區域202。標籤表位址區域202的大小隨著可轉譯區域200的大小而縮放,取決於分配標籤的大小與同彼分配標籤相關聯的對應資料區塊的大小的比較。通常,若2 n個位元組的資料項共用單一位元組的位址空間中儲存的一或多個分配標籤,則標籤表位址區域係可轉譯區域200的大小的1/2 n倍。例如,若向各16個位元組資料區塊指派分配標籤,且二個4位元分配標籤適合一個位元組的位址空間,則32個位元組的資料共用1個位元組的分配標籤,因此n=5。此意指標籤表位址區域202的大小將係轉譯區域200的大小的1/32 th。為了支援高效的標籤位址判定操作,最簡單的可以係將識別標籤表位址區域的起始的標籤表基底位址係自然對準的位址邊界,與標籤表位址區域的大小間隔處的邊界對準(亦即,間隔2 (t-n),其中2 t係可轉譯位址區域的大小,且2 n係在標籤表位址區域大小與可轉譯位址區域大小之間的比率)。此意指存在標籤表位址區域202可以位於可轉譯區域200內的最多2 n個不同的對準位置,因此標籤表位址區域202的位置可以由n位元標籤表基底位址值VTB、VGB來表達,如圖18所顯示。在圖22的實例中,n=5。藉由使用對準的標籤表基底位址,用於組合基底位址與偏移的操作不需要加法,但可以單純藉由將基底位址與偏移級聯來進行,此對於硬體而言進行起來比加法要快得多且消耗更少的功率。 To accommodate the label location addresses used to locate allocation tags within the first address space, a label table address region 202 is defined within the translatable address region 200. The size of the label table address region 202 scales with the size of the translatable region 200, depending on the comparison between the size of the allocation tag and the size of the corresponding data block associated with that allocation tag. Typically, if 2 ^n bytes of data items share one or more allocation tags stored in a single-byte address space, the label table address region is 1/2 ^n times the size of the translatable region 200. For example, if allocation tags are assigned to each 16-byte data block, and two 4-bit allocation tags fit into a byte address space, then 32 bytes of data share a byte allocation tag, so n=5. This means that the size of the label table address region 202 will be 1/ 32th the size of the translation region 200. To support efficient label address determination operations, the simplest approach is to align the address boundary of the label table base address that identifies the starting label table address region with the boundary at the interval between the label table address regions (i.e., interval 2 (tn) , where 2t is the size of the translatable address region and 2n is the ratio between the label table address region size and the translatable address region size). This means that there are up to 2 ^n distinct alignment locations within the translatable region 200 for the label table address region 202. Therefore, the location of the label table address region 202 can be represented by n-bit label table base address values VTB and VGB, as shown in Figure 18. In the example of Figure 22, n=5. By using the aligned label table base address, operations combining base addresses and offsets do not require addition, but can be performed simply by concatenating the base address and offset. This is much faster and consumes less power for the hardware than addition.

如圖20的右側實例所顯示,對於使用二個可轉譯位址區域206、204的轉譯體系而言,存在大小為2 t0的下部可轉譯區域(區域0)206,其中t0係可轉譯區域0的區域大小,如使用基於目前異常等級ELx選擇的暫存器TCR1_ELx中的區域大小指示值T0SZ來定義。可轉譯區域0 (206)從位址0延伸至位址2 t0-1,且在具有64個位元[63:0]的位址中,對於可轉譯區域206中的有效位址,位元[63:t0]經限制為全0。亦存在大小2 t1的上部可轉譯區域(區域1)204,其中t1係可轉譯區域1的區域大小,如使用基於目前異常等級ELx選擇的暫存器TCR1_ELx中的區域大小指示值T1SZ來定義。可轉譯區域1 (204)從位址2 64-2 t1延伸至位址2 64-1,且在具有64個位元[63:0]的位址中,對於可轉譯區域206中的有效位址,位元[63:t1]經限制為全1。此留下從位址2 t0延伸至位址2 64-2 t1-1的大的不可轉譯位址區域作為出於其他目的使用的編碼空間,包括支援定義位址標籤80,該等位址標籤具有除了不用以區分可轉譯位址區域206、204之一中的有效位址的高位元[63:t0]中的全0或全1之外的值。可轉譯區域大小t0、t1可以彼此不同──例如,上部可轉譯區域204可以小於或大於下部可轉譯區域206。對二個可轉譯區域的支援可以用於幫助將由作業系統使用的位址空間的核心區域中的資料(其可使用上部可轉譯區域204)與由應用程式碼使用的位址空間的使用者區域中的資料(其可使用下部可轉譯區域206)隔離,由於此使得由使用者碼計算的位址指標較不可能意外地指向位址空間204的核心區域中的位置。 As shown in the example on the right side of Figure 20, for a translation system using two translatable address regions 206 and 204, there exists a lower translatable region (region 0) 206 of size 2 t0 , where t0 is the region size of translatable region 0, defined using the region size indicator value T0SZ in the register TCR1_ELx selected based on the current exception level ELx. Transducible region 0 (206) extends from address 0 to address 2 t0 -1, and in the address space of 64 bits [63:0], bits [63:t0] are restricted to all 0s for valid addresses in translatable region 206. There is also an upper translatable region (region 1) 204 of size 2 t1 , where t1 is the region size of translatable region 1, defined by the region size indicator value T1SZ in the register TCR1_ELx selected based on the current exception level ELx. Transducible region 1 (204) extends from address 2 64 -2 t1 to address 2 64 -1, and in the address with 64 bits [63:0], bits [63:t1] are restricted to all 1s for valid addresses in translatable region 206. This leaves a large, non-transferable address region extending from address 2 t0 to address 2 64 -2 t1 -1 as a coding space for other purposes, including support for defining address labels 80, which have values other than all 0s or all 1s in the high bits [63:t0] of the valid address in one of the transferable address regions 206, 204. The transferable region sizes t0, t1 can be different from each other—for example, the upper transferable region 204 can be smaller or larger than the lower transferable region 206. Support for two translatable regions can help isolate data in the core region of the address space used by the operating system (which can use the upper translatable region 204) from data in the user region of the address space used by the application code (which can use the lower translatable region 206). This makes it less likely that address pointers calculated by the user code will accidentally point to a location in the core region of address space 204.

當支援二個可轉譯位址區域204、206時,則彼等區域之各者可具有其自己的對應標籤表位址區域208、210,其經指定用於儲存彼可轉譯位址區域204、206中的對應資料項的分配標籤。如利用單一可轉譯區域的方法中一般,在給定可轉譯區域204、206的大小與對應標籤表位址區域208、210的大小之間的比率可係固定的,取決於分配標籤的大小及共用一個分配標籤的資料的位元組數目,且因此標籤表位址區域208、210的大小隨著由T0SZ或T1SZ定義的對應可轉譯位址區域204、206的大小而縮放。給定可轉譯位址區域204、206中的標籤表位址區域208、210的位置取決於暫存器TCR2_ELx中儲存的針對目前異常等級ELx的對應項標籤表基底位址資訊VTB1(對於可轉譯區域1 204)或VTB0(對於可轉譯區域0 206)。標籤表基底位址VTB0、VTB1針對二個可轉譯區域204、206獨立地定義,因此標籤表位址區域在可轉譯區域內的相對位置對於二個可轉譯區域204、206可以係不同的。When two translatable address regions 204 and 206 are supported, each of these regions may have its own corresponding label table address regions 208 and 210, which are designated with allocation tags for storing the corresponding data items in the translatable address regions 204 and 206. As is generally the case with a single translatable region, the ratio between the size of the given translatable regions 204 and 206 and the size of the corresponding label table address regions 208 and 210 may be fixed, depending on the size of the allocation tags and the number of bytes of data sharing a single allocation tag, and therefore the size of the label table address regions 208 and 210 is scaled according to the size of the corresponding translatable address regions 204 and 206 as defined by T0SZ or T1SZ. The location of label table address regions 208 and 210 within the given translatable address regions 204 and 206 depends on the label table base address information VTB1 (for translatable region 1, 204) or VTB0 (for translatable region 0, 206) stored in register TCR2_ELx for the corresponding entry of the current exception level ELx. The label table base addresses VTB0 and VTB1 are defined independently for the two translatable regions 204 and 206; therefore, the relative positions of the label table address regions within the translatable regions can be different for the two translatable regions 204 and 206.

圖21繪示標籤定位位址判定電路系統10針對需要執行標籤定位位址轉譯操作的標籤存取指令執行標籤定位位址判定操作的實例。標籤定位位址判定操作作用於給定的資料定位第一位址110,該位址等於或取決於由標籤存取指令指定的虛擬位址(例如,已經在應用於彼虛擬位址的位址轉譯的前文階段中獲得)。Figure 21 illustrates an example of a tag location address determination circuit system 10 performing a tag location address determination operation for a tag access instruction that requires a tag location address translation operation. The tag location address determination operation acts on the first address 110 of a given data location, which is equal to or depends on the virtual address specified by the tag access instruction (e.g., already obtained in a previous stage of address translation applied to that virtual address).

在步驟2100,基於標籤存取指令的執行,判定需要標籤存取。作為回應,在步驟2102,MMU 6判定虛擬化標籤轉譯模式(例如,上述第二標籤轉譯模式)目前是否啟用(例如,基於與目前轉譯體系的目前位址轉譯階段相關聯的控制狀態VTE或IPMTE)。若針對目前位址轉譯階段目前禁用虛擬化標籤轉譯模式,則不需要將資料定位位址映射至第一位址空間內的標籤定位位址,且因此在步驟2110,基於轉譯資料定位第一位址110來執行第二位址空間92內的標籤的位址。若針對目前位址轉譯階段啟用虛擬化標籤轉譯,則在步驟2104,MMU 6判定資料定位第一位址110是否係目前轉譯體系中支援的任何可轉譯位址區域200、204、206的範圍內的有效位址。若否,則在步驟2106傳訊錯誤,以防止藉由觸發對應於不可轉譯位址的標籤存取而導致的不確定結果。若資料定位第一位址110位於可轉譯位址區域200、204、206中,則在步驟2108,藉由將基於資料定位第一位址的預定部分判定的偏移應用於由標籤表基底位址資訊VTB、VTB0、VTB1、VGB表示的標籤表基底位址來判定標籤定位第一位址108。對於單一可轉譯區域階段1轉譯,標籤表基底位址係基於VTB判定,對於階段2轉譯,標籤表基底位址係基於VGB判定,對於其中資料定位位址位於可轉譯區域0 (206)中的雙可轉譯區域階段1轉譯,標籤表基底位址係基於VTB0判定,且對於其中資料定位位址位於可轉譯區域1 (204)中的雙可轉譯區階段1轉譯,標籤表基底位址係基於VTB1判定。再者,在步驟2108,標籤定位位址判定電路系統10基於資料定位第一位址110的一或多個位元(其與用以衍生偏移的部分相比為較低有效的(但相鄰))來識別半位元組選擇資訊,該半位元組選擇資訊可以用於在相同位元組的位址空間中的二或更多個分配標籤之間進行選擇。In step 2100, based on the execution of the tag access instruction, it is determined that tag access is required. In response, in step 2102, MMU 6 determines whether the virtualized tag translation mode (e.g., the second tag translation mode mentioned above) is currently enabled (e.g., based on the control state VTE or IPMTE associated with the current address translation phase of the current translation system). If the virtualized tag translation mode is currently disabled for the current address translation phase, it is not necessary to map the data location address to the tag location address in the first address space, and therefore in step 2110, the address of the tag in the second address space 92 is executed based on the translated data location first address 110. If virtualized label translation is enabled for the current address translation stage, in step 2104, MMU 6 determines whether the first address 110 of the data location is a valid address within any of the translatable address regions 200, 204, and 206 supported by the current translation system. If not, an error is sent in step 2106 to prevent uncertain results caused by triggering label access corresponding to an untranslatable address. If the first address of the data location 110 is located in the translatable address regions 200, 204, and 206, then in step 2108, the first address of the label location 108 is determined by applying the offset determined based on the predetermined portion of the first address of the data location to the label table base address represented by the label table base address information VTB, VTB0, VTB1, and VGB. For single-transferable area stage 1 translation, the label table base address is determined based on VTB. For stage 2 translation, the label table base address is determined based on VGB. For dual-transferable area stage 1 translation where the data location address is located in translatable area 0 (206), the label table base address is determined based on VTB0. For dual-transferable area stage 1 translation where the data location address is located in translatable area 1 (204), the label table base address is determined based on VTB1. Furthermore, in step 2108, the tag location address determination circuit system 10 identifies half-byte selection information based on one or more bits of the first address 110 of the data location (which is less significant (but adjacent) compared to the portion used to derive the offset), which can be used to select among two or more allocation tags in the address space of the same byte.

圖22繪示在步驟2108針對單區域轉譯體系(針對階段1或階段2轉譯)的標籤定位位址判定操作。此處,2 t係由T0SZ定義的可組態轉譯區域大小,且此實例假設標籤表基底位址「表基底(table base)」由系統暫存器中的5位元欄位VTB(對於階段1)或VGB(對於階段2)定義,且因此此實例假設在可轉譯區域大小與標籤表區域大小之間的比率係32 (2 5)。為了便於解釋,圖22經顯示為應用於虛擬位址作為資料定位第一位址110,但可以對階段2轉譯執行相同操作,其中資料定位第一位址110將係中間位址,且除了採用不同的標籤表基底位址值VGB而非VTB(且在一些實例中,定義圖22的可轉譯位址區域的大小2 t的不同大小參數)之外,標籤定位位址判定操作可以與階段1相同。 Figure 22 illustrates the label location address determination operation in step 2108 for a single-area translation system (for stage 1 or stage 2 translation). Here, 2t is the configurable translation area size defined by TOSZ, and this example assumes that the label table base address "table base" is defined by the 5-bit field VTB (for stage 1) or VGB (for stage 2) in the system register, and therefore this example assumes that the ratio between the translation area size and the label table area size is 32 (2 5 ). For ease of explanation, Figure 22 is shown as being applied to the virtual address as the first address 110 of the data location, but the same operation can be performed on the translation of stage 2, where the first address 110 of the data location will be the intermediate address, and the label location address determination operation can be the same as in stage 1, except that a different label table base address value VGB is used instead of VTB (and in some instances, different size parameters of the size 2t of the translatable address region of Figure 22 are defined).

如圖22所顯示,對於大小2 t的單一可轉譯區域,資料定位第一位址110可以視為包含等於給定位址值的有意義的位址位元[t-1:0],及對於有效位址經限制為0的高位元[55:t](此實例假設位元[55]以上的位址沒有有意義的位元,由於位元[56]以前的位元可能出於其他目的保留,諸如儲存位址標籤80)。 As shown in Figure 22, for a single translatable region of size 2t , the first address 110 of the data location can be considered as including meaningful address bits [t-1:0] equal to the address value given, and high bits [55:t] that are restricted to 0 for the valid address (this example assumes that there are no meaningful bits above bit [55], since bits before bit [56] may be reserved for other purposes, such as storing address tags 80).

如圖22中標記為110'的部分所顯示,出於產生標籤定位第一位址108的目的,可以將相同位址110解譯為含有位元[t-1:5]處的標籤索引值,該標籤索引值表示相對於標籤表基底位址的偏移(該偏移係標籤表位址區域202內的哪個特定位址應係此特定存取的標籤定位第一位址108的指示)。偏移對應於位址的部分,該部分識別位址110落入數個不同標籤顆粒中之何者,其中標籤顆粒係位址空間區塊,該區塊中的所有位址共用記憶體系統中儲存的相同分配標籤72。As shown in the portion marked 110' in Figure 22, for the purpose of generating the first address 108 of the tag location, the same address 110 can be interpreted as containing a tag index value at bits [t-1:5], which represents an offset relative to the base address of the tag table (this offset is an indication of which specific address within the tag table address region 202 should be the first address 108 of the tag location for this particular access). The offset-corresponding address portion identifies which of several different tag granules the address 110 falls into, where the tag granules are address space blocks in which all addresses share the same allocation tag 72 stored in the memory system.

因此,當產生對應的標籤定位第一位址108時,基於資料定位第一位址110的位元[t-1:5]中的標籤索引值來設定位元[t-6:0]。事實上,執行了算術右移(在此實例中為5位元),儘管實際上不需要移位邏輯,由於標籤定位第一位址108可以單純藉由級聯適當位元位置中的位元值來形成。將標籤定位第一位址108的位元[t-1:t-5]設定為等於5位元表基底位址識別值VTB(對於階段1)或VGB(對於階段2)的對應位元。因此,藉由將基底位址定義為自然對準至2 t位址邊界的位址,此消除了當計算標籤定位第一位址108時向基底位址添加偏移(「標籤索引(tag index)」)的任何需要。標籤定位第一位址108中的高位元[55:t]保持為全0,使得標籤表完全在可轉譯位址區域200內。 Therefore, when the corresponding tag location first address 108 is generated, the location bits [t-6:0] are set based on the tag index values in bits [t-1:5] of the data location first address 110. In fact, an arithmetic right shift (5 bits in this example) is performed, although no shift logic is actually needed, since the tag location first address 108 can be formed simply by concatenating the bit values in the appropriate bit locations. The bits [t-1:t-5] of the tag location first address 108 are set to the corresponding bits of the 5-bit table base address identifier VTB (for stage 1) or VGB (for stage 2). Therefore, by defining the base address as an address naturally aligned to the 2t address boundary, this eliminates any need to add an offset ("tag index") to the base address when calculating the first address 108 of the tag location. The high bits [55:t] in the first address 108 of the tag location are kept all 0, so that the tag table is entirely within the translatable address region 200.

所產生的半位元組(nibble)選擇資訊220等於資料定位第一位址110的位元[4]。此反映出,在此特定實例中,如圖10所顯示,使用4位元標籤及8位元可定址位置,各位元組可定址位置儲存二個標籤,僅需要單一狀態位元來選擇從給定位元組記憶體回傳的二個分配標籤中之何者係與由資料定位第一位址110識別的資料項相關聯的標籤。然而,其他實例在標籤位址儲存區域的每個位元組中可以具有不同數目的分配標籤,且因此若每個位元組存在多於二個分配標籤,則可以使用多於一個半位元組選擇位元,其將係用於標籤索引(偏移)的最低有效位元之後的下一最低有效的一或多個位元。The generated nibble selection information 220 is equal to the bit of the first address 110 of the data location [4]. This reflects that, in this particular example, as shown in Figure 10, using 4-bit labels and 8-bit addressable locations, each byte addressable location stores two labels, requiring only a single state bit to select which of the two allocation labels returned from the given byte memory is associated with the data item identified by the first address 110 of the data location. However, other examples may have a different number of allocation labels in each byte of the label address storage area, and therefore if there are more than two allocation labels in each byte, more than one nibble selection bit can be used, which will be the next least significant bit after the least significant bit of the label index (offset).

圖23顯示了在具有二個可轉譯位址區域204、206的轉譯體系中執行的階段1轉譯的類似操作。原理與圖22中相同,其中將標籤定位第一位址108判定為相對於基底位址的偏移,該偏移量由資料定位第一位址110的位元[t-1:5]判定。然而,在圖23中,可轉譯區域大小t及標籤表基底位址(「表基底[s]」)取決於資料定位第一位址110位於上部可轉譯位址區域204中亦或位於下部可轉譯位址區域206中而不同。若資料定位第一位址110具有等於s=0的最高有效位元[55],則位址110位於下部可轉譯位址區域206中,可轉譯區域大小t=t0由控制狀態T0SZ判定,且標籤表基底位址(標籤定位第一位址108的位元[t0-1:t0-5]中指定的值)由VTB0判定。若資料定位第一位址110具有等於s=1的最高有效位元[55],則位址110位於上部可轉譯位址區域204中,可轉譯區域大小t=t1由控制狀態T1SZ判定,且標籤表基底位址(標籤定位第一位址108的位元[t1-1:t1-5]中指定的值)由VTB1判定。除了取決於高位元[55]係0亦或1來考慮不同區域大小及標籤表基底位址之外,標籤定位第一位址108及半位元組選擇資訊220以類似於圖22的方式判定。Figure 23 illustrates a similar operation of Phase 1 translation performed in a translation system with two translatable address regions 204 and 206. The principle is the same as in Figure 22, where the tag location first address 108 is determined as an offset relative to the base address, the amount of which is determined by bits [t-1:5] of the data location first address 110. However, in Figure 23, the translatable region size t and the tag table base address ("table base [s]") depend on whether the data location first address 110 is located in the upper translatable address region 204 or the lower translatable address region 206. If the first address of data location 110 has a most significant bit equal to s=0 [55], then address 110 is located in the lower translatable address area 206, the size of the translatable area t=t0 is determined by the control state T0SZ, and the base address of the label table (the value specified in the bits [t0-1:t0-5] of the first address of label location 108) is determined by VTB0. If the first address of data location 110 has a most significant bit equal to s=1 [55], then address 110 is located in the upper translatable address area 204, the size of the translatable area t=t1 is determined by the control state T1SZ, and the base address of the label table (the value specified in the bits [t1-1:t1-5] of the first address of label location 108) is determined by VTB1. In addition to considering whether the high bit[55] is 0 or 1 to take into account different area sizes and the base address of the label table, the first address 108 of the label location and the half-byte selection information 220 are determined in a manner similar to that in Figure 22.

雖然圖22及圖23的實例係基於在標籤表位址區域202、208、210的大小與對應的可轉譯位址區域200、204、206的大小之間的固定比率1/32,且因此基於在標籤定位第一位址108的位元[t-1:t-5]處注入的標籤表基底位址值的固定的5位元大小,其他實例可能支援可變分配標籤大小或共用一個分配標籤的資料項顆粒的可變大小,在此情況中,標記圖22及圖23所顯示的表基底位址及標籤表索引的邊界的位元位置可以變化。Although the examples in Figures 22 and 23 are based on a fixed ratio of 1/32 between the size of the label table address regions 202, 208, and 210 and the corresponding sizes of the translatable address regions 200, 204, and 206, and therefore based on a fixed 5-bit size of the label table base address value injected at bits [t-1:t-5] of the first address 108 of the label location, other examples may support variable allocation of label sizes or variable sizes of data item granules sharing a single allocation label. In this case, the bit positions marking the boundaries of the table base address and the label table index shown in Figures 22 and 23 can vary.

在支援階段1及階段2轉譯二者的標籤定位位址判定的實例中,相同硬體可以在二個位址轉譯階段之間共用,由於除了對可轉譯區域大小t及表基底位址「表基底」採用不同的值之外,無論將標籤定位位址判定應用於位址轉譯的哪個階段,映射函數皆係相同的。因此,標籤定位位址判定電路系統10可以在數個不同的轉譯體系之間共用。In the example supporting both Stage 1 and Stage 2 translation of label location address determination, the same hardware can be shared between the two address translation stages. Since the mapping function remains the same regardless of which stage of address translation the label location address determination is applied to, except for using different values for the translatable region size t and the table-based address "table-based". Therefore, the label location address determination circuit system 10 can be shared among several different translation systems.

圖24係闡述用於在支援可變標籤轉譯模式(在第一位址轉譯階段及第二位址轉譯階段啟用/禁用虛擬化標籤)的情況下實施標籤位址轉譯的步驟的特定實例的流程圖。將理解,圖24係上文更大致地描述的一些特徵的具體實施方案,且因此亦存在實施類似功能性的其他方式。Figure 24 is a flowchart illustrating a specific example of the steps for implementing label address translation when supporting a variable label translation mode (enabling/disabling virtualized labels in the first address translation stage and the second address translation stage). It will be understood that Figure 24 is a specific implementation of some of the features described more generally above, and therefore other ways of implementing similar functionality exist.

在步驟2400,執行標籤存取指令。標籤存取指令可係任何指令,其可以(至少對於轉譯表位址中的控制狀態資訊及/或記憶體屬性資訊的一些設定)觸發使用記憶體中儲存的一或多個分配標籤執行的操作。標籤存取指令指定目標位址。In step 2400, a tag access instruction is executed. A tag access instruction can be any instruction that can (at least for some settings of control status information and/or memory attribute information in the translation table address) trigger an operation using one or more allocation tags stored in memory. The tag access instruction specifies the target address.

在步驟2402,MMU 6判定目前是否啟用階段1位址轉譯。可存在一些位址轉譯體系,其中可能禁用階段1轉譯且僅使用階段2執行轉譯,以將使用標籤存取指令的運算元指定的中間位址轉譯成實體位址(如下所述,亦可以存在禁用階段2轉譯的體系,使得僅使用階段1,或者對於在超管理器異常等級或更具特權異常等級中操作的某些最安全的碼,可允許該碼直接指定實體位址,而無需任何位址轉譯階段)。例如,控制狀態(限於可由具有超管理器層級特權或更高特權的軟體更新)可用以指示目前是否啟用階段1轉譯及/或階段2轉譯。In step 2402, MMU 6 determines whether stage 1 address translation is currently enabled. There may be address translation systems where stage 1 translation is disabled and only stage 2 translation is used to translate intermediate addresses specified by operands using tag access instructions into physical addresses (as described below, there may also be systems that disable stage 2 translation, allowing only stage 1 to be used, or for certain most secure codes operating at supermanager exception levels or higher privilege exception levels, allowing the code to directly specify physical addresses without any address translation stage). For example, control status (limited to software updates that can be performed by software with super-manager level privileges or higher) can be used to indicate whether stage 1 translation and/or stage 2 translation are currently enabled.

若判定將啟用階段1位址轉譯,則在步驟2404,MMU 6判定是否針對階段1轉譯啟用虛擬標籤(為簡潔起見,表示為VMTE)(例如,此可基於上述第一階段標籤轉譯控制指示符VTE來判定)。再者,MMU 6判定目前標籤存取指令是否係主體標籤讀取/寫入指令。若目前禁用虛擬標籤或目前標籤存取指令係主體標籤讀取/寫入指令,則不需要應用不同於階段1轉譯的資料位址轉譯操作的任何特殊標籤位址轉譯操作。相反,在步驟2406,將資料位址轉譯操作應用於階段1,以將指定為標籤存取指令的目標位址的虛擬位址(資料定位第一位址VA)轉譯成中間位址空間46中的對應資料定位中間位址。此資料位址轉譯操作與定位對應於(多個)所需分配標籤的資料項的中間位址所執行的操作相同。If it is determined that Phase 1 address translation will be enabled, then in step 2404, MMU 6 determines whether to enable virtual tags (referred to as VMTE for simplicity) for Phase 1 translation (for example, this can be determined based on the Phase 1 tag translation control indicator VTE mentioned above). Furthermore, MMU 6 determines whether the current tag access instruction is a body tag read/write instruction. If virtual tags are currently disabled or the current tag access instruction is a body tag read/write instruction, then no special tag address translation operation different from the data address translation operation of Phase 1 translation is required. Conversely, in step 2406, a data address translation operation is applied to stage 1 to translate the virtual address (data location first address VA) designated as the target address of the tag access instruction into the corresponding data location intermediate address in intermediate address space 46. This data address translation operation is the same as the operation performed to locate the intermediate address corresponding to the data item (multiple) to be allocated tags.

除了獲得資料定位中間位址之外,階段1位址轉譯亦識別使用來自階段1位址轉譯表的頁描述符60直接或間接地定義的記憶體屬性資訊,此提供與資料定位第一位址相關聯的記憶體區域是否位於如前文描述的記憶體的有標籤或無標籤區域中的指示。可以從其他記憶體權限資訊中推斷有標籤/無標籤狀態,諸如位址是否位於記憶體的正常寫回式可快取區域中。在一些實例中,可支援針對記憶體區域的進一步選項,以將該區域視為「有規範標籤(canonical tagged)」區域,該「有規範標籤」區域係以下區域:儘管在彼位址空間區域中沒有顯式地儲存用於資料項的分配標籤,但在雙可轉譯區域轉譯體系中,可以執行標籤檢查,假設分配標籤72將所有位元設定為0以存取下部可轉譯區域206中的位址,且該分配標籤將所有位元設定為1以存取上部可轉譯區域204中的位址。此一規範標籤可以用於與分別針對下部/上部可轉譯區域206、204「規範地」設定的位址中的上部位址位元的預期值匹配。在一些實例中,規範標籤選項可以係分開的屬性類型,不同於記憶體的有標籤及無標籤區域。然而,在其他實例中,屬性資訊本身可能僅僅區分有標籤區域與無標籤區域,其中控制暫存器中儲存的控制值指示在目前操作模式下,無標籤記憶體區域是否應視為真正的「無標籤」(完全沒有標籤值)或「有規範標籤」(隱含的分配標籤將所有位元設定為對應於目標位址的最高有效位元)。若在步驟2402目前禁用階段1轉譯,則階段1不提供記憶體屬性資訊,且因此可藉由預設處理標籤存取,如同階段1記憶體屬性資訊指定了有標籤的記憶體區域一般。In addition to obtaining the intermediate address of the data location, the Stage 1 address translation also identifies memory attribute information directly or indirectly defined using page descriptor 60 from the Stage 1 address translation table. This provides an indication of whether the memory region associated with the first address of the data location is located in a tagged or untagged region of memory as described above. The tagged/untagged status can be inferred from other memory permission information, such as whether the address is located in a normal write-back cache region of the memory. In some implementations, further options may be supported for memory regions to be treated as "canonical tagged" regions. A "canonical tagged" region is one where, although no allocation tag for data items is explicitly stored in that address space region, a tag check can be performed in a dual-translatable region translation system. This assumes allocation tag 72 sets all bits to 0 to access addresses in lower translatable region 206 and sets all bits to 1 to access addresses in upper translatable region 204. This canonical tag can be used to match the expected value of the upper address bits in the addresses "canonically" set for lower/upper translatable regions 206 and 204, respectively. In some instances, specification label options can be separate attribute types, distinct from labeled and unlabeled memory regions. However, in other instances, the attribute information itself may only distinguish between labeled and unlabeled regions, where the control value stored in the control register indicates whether, in the current operating mode, an unlabeled memory region should be considered truly "unlabeled" (without any label value) or "with a specification label" (an implicit allocation label sets all bits to the most significant bit corresponding to the target address). If stage 1 translation is currently disabled in step 2402, stage 1 does not provide memory attribute information and is therefore accessible via default processing labels, just as stage 1 memory attribute information would specify labeled memory regions.

若在步驟2402禁用階段1轉譯,則可以省略步驟2404及2406,且方法直接繼續進行至步驟2408。If the translation of step 1 is disabled in step 2402, steps 2404 and 2406 can be omitted, and the method will proceed directly to step 2408.

在步驟2406,針對主體標籤讀取/寫入指令或針對禁用虛擬標籤的另一標籤存取指令,禁用階段1轉譯或執行階段1轉譯的情況中,在步驟2408,MMU 6判定是否啟用階段2轉譯。In step 2406, if Stage 1 translation is disabled or executed for a read/write instruction for the main label or for an access instruction for another label with a disabled virtual label, in step 2408, MMU 6 determines whether to enable Stage 2 translation.

若啟用階段2轉譯,則在步驟2430,MMU 6判定從階段1判定的記憶體區域類型是否為有標籤區域(基於階段1記憶體屬性資訊,或者若禁用階段1轉譯,則基於「有標籤(tagged)」區域類型的預設判定)以及是否針對階段2轉譯啟用中間標籤(例如,此可基於上述第二階段標籤轉譯控制指示符IPMTE來判定)。If stage 2 translation is enabled, in step 2430, MMU 6 determines whether the memory region type determined from stage 1 is a tagged region (based on stage 1 memory attribute information, or if stage 1 translation is disabled, based on the default determination of the "tagged" region type) and whether to enable intermediate tags for stage 2 translation (for example, this can be determined based on the second stage tag translation control indicator IPMTE mentioned above).

若存取記憶體區域不係有標籤區域或禁用中間標籤,則在步驟2412,MMU 6基於階段2位址轉譯表50的對應條目,執行目標中間位址(若禁用階段1轉譯,則為標籤存取指令本身的目標位址,或在步驟2406由階段1轉譯獲得的位址)至對應實體位址的階段2位址轉譯。在此情況中,由於階段1及階段2皆沒有使用虛擬化標籤方法(啟用VMTE或IPMTE),因此使用圖9所顯示的實體標籤方法。If the memory region being accessed is not a labeled region or intermediate labels are disabled, then in step 2412, MMU 6 performs a Stage 2 address translation from the target intermediate address (or the target address of the label access instruction itself if Stage 1 translation is disabled, or the address obtained from Stage 1 translation in step 2406) to the corresponding physical address based on the corresponding entry in Stage 2 address translation table 50. In this case, since neither Stage 1 nor Stage 2 uses virtualization labeling methods (VMTE or IPMTE is enabled), the physical labeling method shown in Figure 9 is used.

若針對目前轉譯體系禁用階段2轉譯,則省略步驟2430及2412。If Stage 2 translation is disabled for the current translation system, steps 2430 and 2412 are omitted.

在步驟2414、2416,取決於所存取的記憶體區域類型,不同的結果係可能的。若所存取的記憶體區域類型係規範位址區域(在步驟214為否,在步驟2416為是),則在步驟2418,規範標籤值由MMU 6回傳(基於若存取下部可轉譯位址區域206中的位址則將分配標籤位元隱式地設定為全0,且若存取上部可轉譯位址區域204中的位址,則設定為全1),而不需要將任何顯式請求發送至記憶體系統以獲得規範分配標籤值。另一方面,若區域無標籤(在步驟2414、2416二者均為否),則標籤存取可能實際上不執行,因為在步驟2420,對分配標籤的任何讀取請求回傳預設值0(讀取為零(read as zero, RAZ)),且忽略對分配標籤的任何寫入請求(寫入忽略(write ignore, WI)),而不產生任何錯誤。然而,若存取識別為有標籤區域的位址(例如,基於與資料定位第一位址相關聯的記憶體屬性),則在步驟2422,將請求發送至記憶體系統,該請求指定從階段1及/或階段2轉譯獲得的資料定位實體位址(或者若階段1及階段2二者皆禁用,則基於由標籤存取指令本身指定的實體位址),且請求回傳對應於彼位址的分配標籤。假設彼標籤存取請求不發生錯誤,則在步驟2424,由記憶體系統回傳「實體標籤(physical tag)」,該實體標籤基於由記憶體系統根據如上文參考圖9解釋的實體標籤方法實施的特定於實施方案的機制定位。若指定資料定位實體位址的標籤存取請求發生錯誤(例如,記憶體系統無法定位對應於此實體位址的分配標籤),則在步驟2426傳訊錯誤。In steps 2414 and 2416, different results are possible depending on the type of memory region being accessed. If the type of memory region being accessed is a canonical address region (no in step 214, yes in step 2416), then in step 2418, the canonical tag value is returned by MMU 6 (based on the fact that if an address in the lower translatable address region 206 is accessed, the allocation tag bits are implicitly set to all 0s, and if an address in the upper translatable address region 204 is accessed, they are set to all 1s), without needing to send any explicit request to the memory system to obtain the canonical allocation tag value. On the other hand, if the region is unlabeled (both steps 2414 and 2416 are no), label access may not actually be performed because in step 2420, any read request for the allocated label returns the default value 0 (read as zero, RAZ) and any write request for the allocated label is ignored (write ignore, WI) without generating any error. However, if the access is identified as an address with a label (e.g., based on memory attributes associated with the first address of the data location), then in step 2422, a request is sent to the memory system specifying the data location entity address translated from stage 1 and/or stage 2 (or, if both stage 1 and stage 2 are disabled, based on the entity address specified by the label access instruction itself), and the request returns the allocation label corresponding to that address. Assuming no error occurs in the tag access request, in step 2424, the memory system returns a "physical tag" based on an implementation-specific mechanism implemented by the memory system according to the physical tagging method explained above with reference to Figure 9. If an error occurs in the tag access request specifying the data location of the physical address (e.g., the memory system cannot locate the allocation tag corresponding to this physical address), an error is transmitted in step 2426.

若在步驟2430判定標籤存取指令的目標位址對應於有標籤的記憶體區域且使用前文描述的IPMTE控制啟用中間標籤,則在步驟2432,應用參考圖16至圖17及圖20至圖23描述的標籤定位位址判定操作以將在階段1轉譯2406中獲得(若禁用階段1轉譯,則由標籤存取指令直接指定)的資料定位中間位址變換成對應的標籤定位中間位址,且接著藉由在步驟2434執行階段2位址轉譯將標籤定位中間位址轉譯成標籤定位實體位址。If in step 2430 it is determined that the target address of the tag access instruction corresponds to a tagged memory region and the intermediate tag is enabled using the IPMTE control described above, then in step 2432, the tag location address determination operation described in Figures 16 to 17 and Figures 20 to 23 is applied to transform the data location intermediate address obtained in step 1 translation 2406 (or directly specified by the tag access instruction if step 1 translation is disabled) into the corresponding tag location intermediate address, and then the tag location intermediate address is translated into the tag location physical address by performing step 2 address translation in step 2434.

在步驟2436,使用直接或間接地使用相關階段2轉譯表條目定義的階段2記憶體屬性資訊執行額外檢查,該相關階段2轉譯表條目用以提供在步驟2434執行的階段2轉譯中的位址映射。由於標籤定位中間位址已經相對於對應的資料定位中間位址修改,與對應的資料定位中間位址相比,標籤定位中間位址可能與不同的階段2記憶體屬性相關聯,因此執行標籤定位中間位址是否對應於「正常」位址區域的額外檢查,以避免藉由請求對裝置類型記憶體區域的分配標籤存取而可能產生的副作用。因此,若標籤定位中間位址的階段2屬性指定此位址位於記憶體的正常區域中,則在步驟2438,將指定標籤定位實體位址的記憶體請求發送至記憶體系統,以請求對(多個)對應分配標籤的讀取/寫入存取,由於不需要實體記憶體系統知道支援分配標籤(基於中間標籤,如圖11所顯示),該(等)分配標籤實施為虛擬化標籤。若階段2記憶體屬性指示標籤定位中間位址對應於裝置類型記憶體區域,則在步驟2440,不將標籤存取記憶體系統請求發送至記憶體系統,以避免對裝置記憶體區域造成副作用,且在步驟2440,若標籤存取係讀取操作,則標籤存取操作回傳分配標籤值0(讀取為零,RAZ),且若標籤存取寫入操作,則忽略(寫入忽略,WI)。In step 2436, additional checks are performed using the Stage 2 memory attribute information defined by the relevant Stage 2 translation table entries, which provide address mappings in the Stage 2 translations performed in step 2434, either directly or indirectly. Since the tag-location intermediate address has been modified relative to the corresponding data-location intermediate address, and may be associated with different Stage 2 memory attributes than the corresponding data-location intermediate address, additional checks are performed to determine whether the tag-location intermediate address corresponds to a "normal" address region. This avoids potential side effects from requesting allocation tag access to device-type memory regions. Therefore, if the Stage 2 attribute of the tag-located intermediate address specifies that this address is located in the normal area of memory, then in step 2438, a memory request specifying the tag-located physical address is sent to the memory system to request read/write access to (multiple) corresponding allocation tags. Since the physical memory system does not need to know about the supporting allocation tags (based on intermediate tags, as shown in Figure 11), the allocation tags(e) are implemented as virtualized tags. If the intermediate address of the memory attribute indicator tag in stage 2 corresponds to the device type memory area, then in step 2440, the tag access memory system request is not sent to the memory system to avoid side effects on the device memory area. In step 2440, if the tag access is a read operation, the tag access operation returns an allocated tag value of 0 (read is zero, RAZ), and if the tag access is a write operation, it is ignored (write ignore, WI).

返回至步驟2404,若判定針對階段1轉譯啟用虛擬標籤(virtual tagging, VMTE),則在步驟2440,將標籤定位位址判定操作應用於指定為標籤存取指令的目標位址的資料定位虛擬位址,以獲得在步驟2442在階段1轉譯中轉譯的對應標籤定位虛擬位址,且若啟用階段2轉譯(在步驟2444為是),則藉由在步驟2446執行的階段2轉譯將由階段1轉譯產生的標籤定位中間位址進一步轉譯成標籤定位實體位址。若禁用階段2轉譯(在步驟2444為否),則省略步驟2446,且階段1轉譯的結果已經係標籤定位實體位址。無論哪種方式,在步驟2448,對在階段2轉譯中獲得的任何階段2記憶體區域屬性進行與步驟2436處描述的檢查類似的檢查,且若階段2屬性指示標籤定位中間位址位於裝置記憶體區域中(在步驟2448為否),則標籤讀取/寫入請求被視為RAZ/WI,而若標籤定位中間位址位於正常記憶體區域中(在步驟2448為是),則將記憶體系統請求發布至指定在步驟2442或2446獲得的標籤定位實體位址的記憶體系統以請求對與實體位址相關聯的分配標籤執行讀取/寫入操作(若在步驟2444禁用階段2轉譯,則步驟2450與階段2權限已指示正常位址區域的情況類似地執行)。因此,若執行步驟2450,則分配標籤實施為基於虛擬標籤的虛擬化標籤,如圖10所顯示,在虛擬位址空間中為分配標籤分配與對應資料項的虛擬位址分開的分開位址。Returning to step 2404, if it is determined that virtual tagging (VMTE) is enabled for stage 1 translation, then in step 2440, the tag location address determination operation is applied to the data location virtual address specified as the target address of the tag access instruction to obtain the corresponding tag location virtual address translated in stage 1 translation in step 2442. If stage 2 translation is enabled (yes in step 2444), then the stage 2 translation performed in step 2446 will further translate the tag location intermediate address generated by stage 1 translation into the tag location physical address. If Stage 2 translation is disabled (No in step 2444), step 2446 is omitted, and the result of Stage 1 translation is already the tag location entity address. In either case, in step 2448, any Stage 2 memory region attributes obtained in the Stage 2 translation are checked in a manner similar to the checks described in step 2436. If the Stage 2 attribute indicates that the tag location intermediate address is located in the device memory region (No in step 2448), then the tag read/write request is treated as RAZ/WI; otherwise, if the tag location intermediate address is located in normal memory... In the memory region (yes in step 2448), a memory system request is published to the memory system that specifies the tag location of the physical address obtained in step 2442 or 2446 to request a read/write operation on the allocation tag associated with the physical address (if step 2 translation is disabled in step 2444, step 250 is performed similarly to the case where the step 2 permissions have indicated a normal address region). Therefore, if step 2450 is executed, the allocation label is implemented as a virtualized label based on the virtual label, as shown in Figure 10, in which a separate address is allocated for the allocation label in the virtual address space, separate from the virtual address of the corresponding data item.

如圖24所顯示的有關讀取權限檢查的註解所顯示,對於標籤存取指令係經標籤檢查記憶體存取指令的情況,標籤讀取操作是否需要進行任何讀取權限檢查可能取決於是否針對階段1或階段2轉譯啟用虛擬化標籤而變化。若採取實體標籤方法(且因此在步驟2404及2430二者判定禁用虛擬化標籤),則不需要對標籤讀取進行任何具體的讀取權限檢查,因為可假設當對與對應分配標籤共用相同實體位址的資料項進行對應存取時,將偵測到任何讀取權限違規。若採取中間標籤方法(在步驟2430為是),則在階段1轉譯不針對標籤存取執行具體的額外讀取權限檢查,因為彼轉譯與針對對應資料項存取執行的對應階段1轉譯係共同的,但對在步驟2434的階段2轉譯,執行進一步的讀取權限檢查以檢查由在步驟2432獲得的對應於標籤定位中間位址的階段2轉譯表條目直接或間接地指示的階段2記憶體權限是否指示存在讀取對應中間位址處的標籤的權限(由於此階段2轉譯表條目可能與對應於資料定位中間位址的階段2轉譯表條目不同,以下情況係可能的:可能存在讀取資料項而不讀取對應標籤的權限)。類似地,若採取虛擬標籤方法(在步驟2404為是),則對於經標籤檢查記憶體存取指令的標籤讀取,在步驟2442基於從對應於標籤定位虛擬位址(圖10的經修改的VA)的階段1轉譯表條目直接或間接地獲得的階段1讀取權限資訊來執行讀取權限檢查,且在步驟2446基於由對應於標籤定位中間位址(圖10中的IPA2)的階段2轉譯表條目直接或間接地指定的階段2屬性執行階段2讀取權限檢查。若針對在步驟2434、2442、2446執行的標籤讀取的任何額外讀取權限檢查指示不存在對標籤的讀取權限,則傳訊錯誤。As shown in the annotations for read permission checks in Figure 24, whether any read permission checks are required for tag read operations when the tag access instruction is a tag-checked memory access instruction may vary depending on whether virtualization tags are enabled for either Phase 1 or Phase 2 translation. If a physical tagging method is used (and therefore virtualization tags are disabled in both steps 2404 and 2430), no specific read permission checks are required for tag reads, because it can be assumed that any read permission violations will be detected when a corresponding access is made to a data item that shares the same physical address as the corresponding allocated tag. If an intermediate labeling method is used (yes in step 2430), then the Stage 1 translation does not perform specific additional read permission checks for label access, because that translation is common to the corresponding Stage 1 translation performed for access to the corresponding data item. However, for the Stage 2 translation in step 2434, further read permission checks are performed to examine the data obtained in step 2432 corresponding to the data item access. The Stage 2 translation table entry for the tag-location intermediate address directly or indirectly indicates whether the Stage 2 memory permissions indicate the existence of permissions to read the tag at the corresponding intermediate address (since this Stage 2 translation table entry may differ from the Stage 2 translation table entry for the data-location intermediate address, the following is possible: there may be permissions to read data items without reading the corresponding tag). Similarly, if a virtual tagging method is adopted (yes in step 2404), then for a tag read of a memory access instruction that has been tag-checked, in step 2442 a read permission check is performed based on the Stage 1 read permission information obtained directly or indirectly from the Stage 1 translation table entry corresponding to the tag location virtual address (modified VA in FIG10), and in step 2446 a Stage 2 read permission check is performed based on the Stage 2 attribute specified directly or indirectly by the Stage 2 translation table entry corresponding to the tag location intermediate address (IPA2 in FIG10). If no read permission is granted for the label when any additional read permission check is performed for the label in steps 2434, 2442, or 2446, an error message is sent.

另一方面,對於標籤讀取/寫入指令(其中沒有對應的資料項存取),位址轉譯步驟2406、2412、2434、2442、2446中之各者可包括對來自用於轉譯的對應轉譯表條目的讀取/寫入權限進行對應檢查,以檢查是否存在對讀取或寫入標籤的權限,且若標籤存取請求違反讀取/寫入權限,則可傳訊錯誤。On the other hand, for label read/write instructions (where there is no corresponding data item access), each of the address translation steps 2406, 2412, 2434, 2442, and 2446 may include a corresponding check on the read/write permissions from the corresponding translation table entries used for translation, to check for the existence of permissions for reading or writing the label, and if the label access request violates the read/write permissions, an error may be transmitted.

圖25至圖28提供了支援資料及標籤轉譯的不同選項的概述。Figures 25 to 28 provide an overview of the different options for supporting data and label translation.

圖25顯示了使用實體標籤的實例,使得資料存取及標籤存取二者在二階段位址轉譯的階段1及階段2二者皆使用相同的轉譯映射,以獲得在實體位址空間52內定位資料項及其對應分配標籤二者的實體位址。若第一階段標籤轉譯控制資訊VTE指示禁用虛擬標籤且第二階段標籤轉譯控制資訊IPMTE指示亦禁用中間標籤,則選擇此方法。Figure 25 illustrates an example of using entity tags, where both data access and tag access use the same translation mapping in both stages 1 and 2 of the two-stage address translation to obtain the entity addresses of the data item and its corresponding allocation tag within the entity address space 52. This method is selected if the first-stage tag translation control information (VTE) indicates that virtual tags are disabled and the second-stage tag translation control information (IPMTE) indicates that intermediate tags are also disabled.

圖26顯示了一實例,其中第一階段標籤轉譯控制資訊VTE指示禁用虛擬標籤且第二階段標籤轉譯控制資訊IPMTE指示啟用中間標籤。此對應於圖11所顯示的中間標籤方法。在此情況中,對於基於指定給定資料虛擬位址VA的指令的標籤或資料存取,階段1轉譯對於標籤及資料存取二者係相同的,且將資料虛擬位址VA轉譯成用於標籤及資料存取二者的相同資料定位中間位址IPA,但對於資料存取,階段2轉譯將資料定位中間位址映射至資料定位資料位址,而對於標籤存取,在MMU 6執行標籤定位中間位址至與資料定位實體位址分開的標籤定位實體位址的階段2轉譯之前,標籤定位位址判定電路系統10將資料定位中間位址變換成標籤定位中間位址。Figure 26 shows an example where the first-stage Label Translation Control Information (VTE) indicates that virtual labels are disabled and the second-stage Label Translation Control Information (IPMTE) indicates that intermediate labels are enabled. This corresponds to the intermediate labeling method shown in Figure 11. In this case, for label or data access based on instructions specifying a given data virtual address VA, the first stage translation is the same for both label and data access, and the data virtual address VA is translated into the same data location intermediate address IPA used for both label and data access. However, for data access, the second stage translation maps the data location intermediate address to the data location data address. For label access, before the MMU 6 performs the second stage translation from the label location intermediate address to the label location entity address which is separate from the data location entity address, the label location address determination circuit system 10 converts the data location intermediate address into the label location intermediate address.

圖27顯示了一實例,其中第一階段標籤轉譯控制資訊VTE指示啟用虛擬標籤,且第二階段標籤轉譯控制資訊IPMTE指示禁用中間標籤。在此情況中,對於由主體標籤讀取/寫入指令(btag)觸發的資料存取或標籤存取,將以與圖25相同的方式執行階段1及階段2轉譯,以將btag指令的資料位址或目標位址轉譯成實體位址。注意到,對於btag指令,預期該指令將指定與用於資料存取的虛擬位址不同的虛擬位址(由於btag指令的虛擬位址將在標籤表位址區域202、208、210內,而非像資料存取一般在可轉譯位址區域200、204、206的其餘部分內),但從MMU 6的位址轉譯的角度來看,用於btag指令的轉譯使用與資料存取相同的轉譯程序處理(儘管預期應用於不同的輸入位址)。另一方面,對於非主體標籤讀取/寫入指令且對於經標籤檢查記憶體存取指令的標籤檢查而執行的標籤讀取,在階段1位址轉譯之前,標籤定位位址判定電路系統10在執行階段1及階段2位址轉譯以將標籤定位虛擬位址IPA2轉譯成標籤定位實體位址PA2 (nbtag PA)之前將由指令指定的資料定位虛擬位址變換成標籤定位虛擬位址。Figure 27 shows an example where the first-stage Label Translation Control Message (VTE) indicates that virtual tags are enabled, and the second-stage Label Translation Control Message (IPMTE) indicates that intermediate tags are disabled. In this case, for data access or tag access triggered by a Subject Tag Read/Write instruction (btag), stage 1 and stage 2 translations will be performed in the same manner as in Figure 25 to translate the data address or target address of the btag instruction into a physical address. Note that for the btag instruction, it is expected that the instruction will specify a different virtual address than the virtual address used for data access (since the virtual address of the btag instruction will be within the label table address ranges 202, 208, and 210, rather than the rest of the translatable address ranges 200, 204, and 206 as is the case for data access). However, from the perspective of address translation in MMU 6, the translation used for the btag instruction is handled using the same translation procedure as for data access (although it is expected to be applied to a different input address). On the other hand, for non-subject tag read/write instructions and tag reads performed by tag checking of tag-checked memory access instructions, before the stage 1 address translation, the tag location address determination circuit system 10 converts the data location virtual address specified by the instruction into the tag location virtual address before performing stage 1 and stage 2 address translation to translate the tag location virtual address IPA2 into the tag location physical address PA2 (nbtag PA).

圖28顯示了一實例,其中第一階段標籤轉譯控制資訊VTE指示啟用虛擬標籤,且第二階段標籤轉譯控制資訊IPMTE指示啟用中間標籤。在此情況中,資料存取及非主體標籤存取的轉譯與圖27相同(由於即使IPMTE指示啟用中間標籤,若第二位址轉譯模式已經針對第一位址轉譯階段啟用,則第二位址轉譯階段仍然使用第一位址轉譯模式──參見圖19的步驟1902至1906)。然而,對於btag指令,在預設情況下,其等被視為針對階段1轉譯禁用虛擬標籤,接著若IPMTE指示啟用中間標籤,則btag指令的轉譯如圖26而非圖27所顯示執行。因此,圖28對應於來自圖27的資料存取及非主體標籤存取的功能性,以及圖26的btag存取的功能性。Figure 28 shows an example where the first-stage Label Translation Control Message (VTE) indicates that a virtual label is enabled, and the second-stage Label Translation Control Message (IPMTE) indicates that an intermediate label is enabled. In this case, the translation of data access and non-subject label access is the same as in Figure 27 (since even if the IPMTE indicates that an intermediate label is enabled, the second address translation stage still uses the first address translation mode if the second address translation mode has already been enabled for the first address translation stage – see steps 1902 to 1906 in Figure 19). However, for the btag instruction, by default, it is considered to disable virtual tags for stage 1 translation. Then, if the IPMTE instruction enables intermediate tags, the translation of the btag instruction is executed as shown in Figure 26 instead of Figure 27. Therefore, Figure 28 corresponds to the functionality of data access and non-subject tag access from Figure 27, and the functionality of btag access from Figure 26.

如圖26至圖28所顯示,當在階段1或階段2啟用虛擬化標籤時,以下情況係可能的:(除了主體或非主體標籤讀取/寫入指令之外的)記憶體存取指令可以指定虛擬位址作為其意欲用於定義待由記憶體存取指令存取的給定資料項的位置的目標位址,該虛擬位址實際上對應於經指定用於儲存分配標籤的標籤表位址區域202、208、210中的虛擬位址或中間位址。此在圖26至圖28中表示為「資料2」,且對應於標籤資料存取操作。As shown in Figures 26 to 28, when virtualization tags are enabled in Phase 1 or Phase 2, the following is possible: (In addition to subject or non-subject tag read/write instructions) memory access instructions can specify a virtual address as the target address they intend to use to define the location of a given data item to be accessed by the memory access instruction. This virtual address actually corresponds to a virtual address or intermediate address in the tag table address areas 202, 208, and 210 designated for storing the allocated tags. This is represented as "Data 2" in Figures 26 to 28 and corresponds to a tag data access operation.

此標籤資料存取操作將參考圖29進一步詳細解釋。如圖所顯示,將位址空間區域指定為分配標籤記憶體位址區域240(其可對應於標籤表位址區域202、208、210)。該位址空間可係虛擬位址空間或中間虛擬位址空間(亦即,取決於轉譯階段,階段1或階段2)。標籤Z 242儲存在分配標籤記憶體位址區域240內。資料Z 244(亦即,資料項)亦儲存在位址空間內但在分配標籤記憶體位址區域240外部。標籤Z 242對應於與資料Z相關聯的分配標籤,且當請求對資料Z 242進行資料存取時在需要時執行的標籤檢查中使用。This tag data access operation will be explained in further detail with reference to Figure 29. As shown in the figure, the address space region is designated as the allocated tag memory address region 240 (which may correspond to the tag table address regions 202, 208, 210). This address space may be a virtual address space or an intermediate virtual address space (i.e., depending on the translation stage, stage 1 or stage 2). Tag Z 242 is stored within the allocated tag memory address region 240. Data Z 244 (i.e., the data item) is also stored within the address space but outside the allocated tag memory address region 240. Tag Z 242 corresponds to the allocation tag associated with data Z and is used in the tag check performed when data access to data Z 242 is requested.

可請求經標籤檢查加載或儲存操作(load or store operation, LDR/STR),且使用上述技術,可判定基於LDR/STR的位址運算元的目標資料位址。目標標籤位址亦可衍生自LDR/STR的目標資料位址。如圖29所顯示,目標資料位址對應於儲存資料Z 244的位址空間中的位置,且目標標籤位址對應於儲存標籤Z 242的位址空間中的位置。使用標籤Z 242及衍生自經標籤檢查加載或儲存操作的位址運算元的位址標籤,可對加載或儲存操作執行標籤檢查。參考圖4描述了標籤檢查操作的實例。A load or store operation (LDR/STR) can be requested, and using the aforementioned techniques, the target data address of the address operand based on the LDR/STR can be determined. The target tag address can also be derived from the target data address of the LDR/STR. As shown in Figure 29, the target data address corresponds to a position in the address space of the stored data Z 244, and the target tag address corresponds to a position in the address space of the storage tag Z 242. Using tag Z 242 and the address tag derived from the address operand of the load or store operation, a tag check can be performed on the load or store operation. An example of a tag check operation is described with reference to Figure 4.

替代地,可請求標籤存取指令(LDG(M)/STG(M,其中LDG及STG分別表示非主體標籤讀取及寫入指令,且LDGM及STGM分別表示主體標籤讀取及寫入指令)),而非經標籤檢查加載或儲存操作。在此情況中,將不對資料Z 244進行資料存取。相反,目標標籤位址將衍生自標籤存取指令的目標資料位址,且可使用此目標標籤位址存取標籤Z 242。Alternatively, a tag access command (LDG(M)/STG(M, where LDG and STG represent non-body tag read and write commands respectively, and LDGM and STGM represent body tag read and write commands respectively)) can be requested instead of a tag-checked load or store operation. In this case, data access to data Z 244 will not be performed. Instead, the target tag address will be derived from the target data address of the tag access command, and tag Z 242 can be accessed using this target tag address.

然而,分離地,加載或儲存操作LDR/STR可指定對應於標籤區域中的資料位址的位址運算元。如圖所顯示,加載或儲存操作可指定對應於儲存標籤Z 242的分配標籤記憶體位址區域240中的資料位址的位址運算元。此加載或儲存操作的位址運算元可能已經意欲定義待由加載或儲存指令存取的給定資料項在位址空間中的位置。也就是說,加載或儲存操作可能係意欲存取位於位址空間中的資料項而非分配標籤的記憶體存取操作。然而,由於將分配標籤儲存在虛擬/中間實體位址空間的分開的區域(亦即,分配標籤記憶體位址區域240)中,以下情況係可能的:加載或儲存操作可能無意地(或者若由攻擊者用作可能漏洞的部分,則有意地)相反指定分配標籤記憶體位址區域240中的虛擬位址或中間位址。此係所謂的標籤資料存取操作。However, separately, the load or store operation LDR/STR can specify the address operand corresponding to the data address in the tag region. As shown in the figure, the load or store operation can specify the address operand corresponding to the data address in the allocation tag memory address region 240 of the store tag Z 242. This load or store operation's address operand may be intended to define the location in the address space of a given data item to be accessed by the load or store instruction. That is, the load or store operation may be intended to access a data item located in the address space rather than a memory access operation of the allocation tag. However, because allocation tags are stored in a separate region of the virtual/intermediate physical address space (i.e., allocation tag memory address region 240), it is possible that a load or store operation may unintentionally (or intentionally, if used by an attacker as part of a potential vulnerability) specify a virtual address or an intermediate address in the allocation tag memory address region 240 instead. This is known as a tag data access operation.

藉由提供架構支援,以回應於判定資料記憶體存取(亦即,標籤資料存取操作)請求指定對應於分配標籤記憶體位址區域中的記憶體位址的目標位址而拒絕對分配標籤記憶體位址區域240中的記憶體位址處儲存的資料值(亦即,標籤Z 242)進行讀取或寫入存取,可防止對使用資料記憶體存取請求的分配標籤進行無意或有意存取(亦即,加載或儲存)。By providing architectural support to respond to a data memory access (i.e., tag data access operation) request that specifies a target address corresponding to a memory address in the allocation tag memory address region 240 and refuses to read or write access to the data value (i.e., tag Z 242) stored at the memory address in the allocation tag memory address region 240, unintentional or intentional access (i.e., loading or storing) to the allocation tag that makes a data memory access request can be prevented.

再次參見圖1,設備2包括標籤資料存取檢查電路系統32,其用於執行標籤資料存取檢查,諸如圖30及圖31所顯示的彼標籤資料存取檢查。標籤資料存取檢查將參考圖30進一步詳細解釋。Referring again to Figure 1, device 2 includes a tag data access check circuit system 32, which performs tag data access checks, such as those shown in Figures 30 and 31. The tag data access check will be explained in further detail with reference to Figure 30.

在步驟3000,執行指定目標位址的資料記憶體存取請求。資料記憶體存取請求可係加載或儲存請求,例如(例如,由通用加載/儲存指令LDR/STR觸發的加載/儲存請求,具有與前文描述的特殊標籤讀取/寫入指令LDG、STG、LDGM、STGM不同的編碼(例如,不同的操作碼))。如參考圖29所解釋的,資料記憶體存取請求可係標籤資料存取記憶體存取操作,亦即,資料記憶體存取請求可係指定對應於經指定為儲存分配標籤的記憶體區域中的位址的位址運算元的加載或儲存操作。In step 3000, a data memory access request for the specified target address is executed. The data memory access request can be a load or store request, for example (e.g., a load/store request triggered by the general load/store instruction LDR/STR, having a different encoding (e.g., a different opcode) than the special tag read/write instructions LDG, STG, LDGM, STGM described above). As explained with reference to Figure 29, a data memory access request can be a tag data access memory access operation; that is, a data memory access request can be a load or store operation specifying an address operand corresponding to an address in a memory region designated as a memory allocation tag.

在步驟3002,判定資料記憶體存取請求是否指定對應於經指定用於儲存分配標籤的分配標籤記憶體位址區域中的記憶體位址的目標位址。此判定係基於記憶體位址區域定義資訊,該記憶體位址區域定義資訊定義經指定用於儲存分配標籤的分配標籤記憶體位址區域。如圖29所顯示,分配標籤記憶體位址區域可在除了實體位址空間以外的位址空間中,諸如虛擬位址空間或中間實體位址空間。In step 3002, it is determined whether the data memory access request specifies a target address corresponding to a memory address in an allocation tag memory address region designated for storing allocation tags. This determination is based on memory address region definition information, which defines the allocation tag memory address region designated for storing allocation tags. As shown in Figure 29, the allocation tag memory address region can be in an address space other than the physical address space, such as a virtual address space or an intermediate physical address space.

記憶體位址區域定義資訊可包括記憶體位址區域定義組態資訊,該記憶體位址區域定義組態資訊定義分配標籤記憶體位址區域在位址空間中的可變位置。在一些實例中,記憶體位址區域定義組態資訊包括下列中之至少一者:指示一標籤表基底位址的資訊;及指示一表大小的資訊。在一些實例中,標籤表基底位址指示在位址空間內指定用於儲存分配標籤的標籤表區域的位置,且可對應於上文所論述的標籤表區域。例如,記憶體位址區域定義資訊可以係前文關於圖18描述的標籤表基底位址資訊VTB、VTB0、VTB1、或VGB。Memory address region definition information may include memory address region definition configuration information that defines the variable location of the allocated tag memory address region in the address space. In some instances, the memory address region definition configuration information includes at least one of the following: information indicating a tag table base address; and information indicating a table size. In some instances, the tag table base address indicates the location within the address space that specifies the tag table region used to store the allocated tag, and may correspond to the tag table region discussed above. For example, the memory address region definition information may be the tag table base address information VTB, VTB0, VTB1, or VGB described above with respect to Figure 18.

在步驟3004,若判定資料記憶體存取請求指定對應於經指定用於儲存分配標籤的分配標籤記憶體位址區域中的記憶體位址的目標位址,則拒絕對分配標籤記憶體位址區域中的記憶體位址處儲存的資料值進行讀取或寫入存取。In step 3004, if it is determined that the data memory access request specifies a target address corresponding to a memory address in the allocation tag memory address region designated for storage allocation tag, then reading or writing access to the data value stored at the memory address in the allocation tag memory address region is refused.

拒絕讀取或寫入存取可包括觸發錯誤,例如產生指示已經拒絕讀取或寫入存取的錯誤信號。拒絕讀取存取可包括將記憶體位址處儲存的資料值讀取為零。在一些實例中,當請求讀取存取時,不讀取資料值,而是回傳零。拒絕寫入存取可包括忽略寫入存取請求,亦即,不執行所請求的寫入存取。Denying read or write access may include triggering an error, such as generating an error signal indicating that read or write access has been denied. Denying read access may include reading the data value stored at the memory address as zero. In some instances, when a read access request is made, the data value is not read, but zero is returned instead. Denying write access may include ignoring the write access request, that is, not performing the requested write access.

在步驟3006,若判定資料記憶體存取請求不指定對應於經指定用於儲存分配標籤的分配標籤記憶體位址區域中的記憶體位址的目標位址,則允許對分配標籤記憶體位址區域中的記憶體位址處儲存的資料值進行讀取或寫入存取。在一些實例中,允許讀取或寫入存取可包括對資料值執行讀取或寫入存取。在其他實例中,允許讀取或寫入存取包括不拒絕由標籤資料存取檢查電路系統進行讀取或寫入存取。然而,在此等實例中,出於一或多個其他原因,可能不執行讀取或寫入存取。也就是說,在一些實例中,僅僅因為讀取或寫入存取沒有被標籤資料存取檢查電路系統拒絕並不一定意指實際上執行讀取或寫入存取(例如,讀取/寫入存取可能未通過由MMU 6應用的其他種類的權限檢查)。In step 3006, if it is determined that the data memory access request does not specify a target address corresponding to a memory address in the allocation tag memory address region designated for storing the allocation tag, then read or write access to the data value stored at the memory address in the allocation tag memory address region is permitted. In some embodiments, permitting read or write access may include performing a read or write access on the data value. In other embodiments, permitting read or write access includes not denying read or write access by the tag data access check circuitry system. However, in such embodiments, read or write access may not be performed for one or more other reasons. In other words, in some cases, the fact that a read or write access was not rejected by the labeled data access check circuit system does not necessarily mean that the read or write access was actually performed (for example, the read/write access may not pass other types of permission checks by the MMU 6 application).

另一實例標籤資料存取檢查現在將參考圖31描述。在步驟3100,資料記憶體存取請求指定目標位址。步驟3100可對應於圖30的步驟3000。在步驟3102,判定資料記憶體存取請求是否指定對應於經指定用於儲存分配標籤的分配標籤記憶體位址區域中的記憶體位址的目標位址。步驟3102可對應於圖30的步驟3002。Another example of tag data access checking will now be described with reference to Figure 31. In step 3100, the data memory access request specifies a target address. Step 3100 corresponds to step 3000 in Figure 30. In step 3102, it is determined whether the data memory access request specifies a target address corresponding to a memory address in the allocation tag memory address region designated for storing the allocation tag. Step 3102 corresponds to step 3002 in Figure 30.

在步驟3104,判定標籤資料存取檢查啟用資訊是否指示為資料記憶體存取請求啟用標籤資料存取檢查。標籤資料存取檢查啟用資訊可識別是否針對特權資料記憶體存取請求啟用檢查。In step 3104, it is determined whether the tag data access check enable message indicates that the tag data access check is enabled for a data memory access request. The tag data access check enable message can identify whether the check is enabled for a privileged data memory access request.

在一些實例中,標籤資料存取檢查啟用資訊獨立於是否針對特權資料記憶體存取請求啟用檢查來識別是否針對非特權資料記憶體存取請求啟用標籤資料存取檢查。In some cases, the tag data access check enable information is independent of whether the check is enabled for privileged data memory access requests to identify whether the tag data access check is enabled for non-privileged data memory access requests.

在一些實例中,標籤資料存取檢查啟用資訊可識別是否針對讀取記憶體存取請求啟用檢查,且獨立地識別是否針對寫入記憶體存取請求啟用檢查。In some cases, the tag data access check enable information can identify whether the check is enabled for read memory access requests and independently identify whether the check is enabled for write memory access requests.

可禁止藉由以不足特權執行的指令來更新標籤資料存取檢查啟用資訊。例如,非特權碼可能無法更新標籤資料存取檢查啟用資訊,而特權碼可能能夠如此做。You can prevent the update of tag data access check enable information by instructions executed with insufficient privileges. For example, a non-privileged code might not be able to update the tag data access check enable information, while a privileged code might be able to.

標籤資料存取檢查啟用資訊可包含控制暫存器中的欄位。例如,參見圖18,系統控制暫存器(諸如SCTLR2_ELx)可指定標籤資料存取檢查啟用指示nDGA,以指定是否啟用標籤資料存取檢查。可支援分開的讀取及寫入控制,用於指定是否針對讀取操作啟用標籤資料存取檢查及分離地針對寫入操作啟用標籤資料存取檢查。例如,系統控制暫存器(諸如SCTLR2_ELx)可指定讀取標籤資料存取檢查啟用指示nDGAR及寫入標籤資料存取檢查啟用指示nDGAW。因此,在一些實例中,讀取標籤資料存取檢查啟用指示及寫入標籤資料存取檢查啟用指示可儲存在相同的控制暫存器中。在其他實例中,讀取標籤資料存取檢查啟用指示可儲存在與儲存寫入標籤資料存取檢查啟用指示的控制暫存器不同的控制暫存器中。Tag data access check enable information can include fields in control registers. For example, referring to Figure 18, a system control register (such as SCTLR2_ELx) can specify a tag data access check enable indicator nDGA to indicate whether tag data access checks are enabled. Separate read and write controls can be supported to specify whether tag data access checks are enabled for read operations and separately enabled for write operations. For example, a system control register (such as SCTLR2_ELx) can specify a read tag data access check enable indicator nDGAR and a write tag data access check enable indicator nDGAW. Therefore, in some examples, the read tag data access check enable instruction and the write tag data access check enable instruction can be stored in the same control register. In other examples, the read tag data access check enable instruction can be stored in a different control register than the one storing the write tag data access check enable instruction.

在一些實例中,可支援分開的特權及非特權資料記憶體存取控制,用於指定是否針對特權資料記憶體存取啟用標籤資料存取檢查及分離地針對非特權資料記憶體存取啟用標籤資料存取檢查。例如,不同的暫存器,例如,系統控制暫存器的不同分庫版本(諸如上文所論述的SCTLR2_ELx),可指定標籤資料存取檢查啟用指示nDGA的不同特權/非特權版本。在一些實例中,特權資料記憶體存取標籤資料存取檢查啟用指示及非特權資料記憶體存取標籤資料存取檢查啟用指示可儲存在相同的控制暫存器中。In some implementations, separate privileged and non-privileged data memory access controls can be supported to specify whether tag data access checks are enabled for privileged data memory access and separately for non-privileged data memory access. For example, different registers, such as different library versions of the system control register (e.g., SCTLR2_ELx discussed above), can specify different privileged/non-privileged versions of the tag data access check enable directive nDGA. In some implementations, both privileged and non-privileged data memory access tag data access check enable directives can be stored in the same control register.

因此,在一些實施方案中,為了判定標籤資料存取檢查啟用資訊是否指示針對資料記憶體存取請求啟用標籤資料存取檢查,可檢查系統控制暫存器以判定標籤資料存取檢查啟用指示(諸如nDGA、nDGAR、nDGAW)是否指定針對資料記憶體存取請求是否啟用標籤資料存取檢查。Therefore, in some implementations, in order to determine whether the tag data access check enable message instructs that tag data access checks should be enabled for data memory access requests, the system control register can be checked to determine whether the tag data access check enable instruction (such as nDGA, nDGAR, nDGAW) specifies whether tag data access checks should be enabled for data memory access requests.

在一些實例中,該標籤資料存取檢查啟用資訊包含範圍資訊,該範圍資訊定義啟用該標籤資料存取檢查的至少一個位址空間範圍。因此,在一些實例中,為了判定標籤資料存取檢查啟用資訊是否指示針對資料記憶體存取請求啟用標籤資料存取檢查,可將由資料記憶體存取請求指定的位址與至少一個位址空間範圍進行比較,以判定由資料記憶體存取請求指定的位址是否係啟用標籤資料存取檢查的至少一個位址空間範圍中的位址。將理解,至少一個位址空間範圍可定義虛擬或中間實體位址空間及實體位址空間中的至少一個位址範圍。在一些實例中,該標籤資料存取檢查啟用資訊可包含讀取及寫入操作的分開的範圍資訊。在一些實例中,該標籤資料存取檢查啟用資訊可包含特權及非特權資料記憶體存取請求的分開的範圍資訊。因此,在一些實例中,標籤資料存取檢查資訊包含下列中之一或多者:用於定義針對讀取操作啟用標籤資料存取檢查的至少一個位址空間範圍的範圍資訊;用於定義針對寫入操作啟用標籤資料存取檢查的至少一個位址空間範圍的範圍資訊;用於定義針對特權資料記憶體存取請求啟用標籤資料存取檢查的至少一個位址空間範圍的範圍資訊;及用於定義針對非特權資料記憶體存取請求啟用標籤資料存取檢查的至少一個位址空間範圍的範圍資訊。In some instances, the tag data access check enable information includes range information that defines at least one address space range that enables the tag data access check. Therefore, in some instances, to determine whether the tag data access check enable information instructs that the tag data access check be enabled for a data memory access request, the address specified by the data memory access request can be compared with at least one address space range to determine whether the address specified by the data memory access request is an address within at least one address space range that enables the tag data access check. It will be understood that at least one address space range can define at least one address range within a virtual or intermediate physical address space and a physical address space. In some instances, the tag data access check enable information may include separate scope information for read and write operations. In some instances, the tag data access check enable information may include separate scope information for privileged and non-privileged data memory access requests. Therefore, in some instances, the tag data access check information includes one or more of the following: range information for defining at least one address space range for enabling tag data access check for read operations; range information for defining at least one address space range for enabling tag data access check for write operations; range information for defining at least one address space range for enabling tag data access check for privileged memory access requests; and range information for defining at least one address space range for enabling tag data access check for non-privileged memory access requests.

標籤資料存取檢查啟用資訊亦可以在對應於資料記憶體存取請求的目標位址的轉譯表條目中指定。例如,提供用以產生階段1中的中間位址或階段2中的實體位址的階段1或階段2位址映射的轉譯表條目(本文中稱為頁描述符)亦可指定標籤資料存取檢查啟用資訊。Tag data access check enable information can also be specified in the translation table entry corresponding to the target address of the data memory access request. For example, a translation table entry (referred to herein as a page descriptor) that provides a stage 1 or stage 2 address mapping to generate an intermediate address in stage 1 or a physical address in stage 2 can also specify tag data access check enable information.

在步驟3106,判定標籤定位位址判定電路系統是否在虛擬化標籤模式下操作。如本文中論述的,可提供標籤定位位址判定電路系統,其用以當在虛擬化標籤模式下操作時,基於識別給定資料項在除了實體位址空間之外的第一位址空間內的位置的資料定位位址來判定識別對應於給定資料項的分配標籤在第一位址空間內的位置的標籤定位位址。In step 3106, it is determined whether the tag location address determination circuit system is operating in virtualized tag mode. As discussed herein, a tag location address determination circuit system may be provided to determine, when operating in virtualized tag mode, the tag location address corresponding to the location of the assigned tag in the first address space based on the data location address that identifies the location of the given data item in the first address space other than the physical address space.

當標籤定位位址判定電路系統在虛擬化標籤模式下操作時,如參考圖29所論述的,加載或儲存操作可無意地指定對應於經指定用於儲存分配標籤的區域中的資料位址的位址運算元。因此,當在虛擬化標籤模式下操作時啟用標籤資料存取檢查可能有助於防止對分配標籤進行無意資料存取。When the tag location address determination circuit system operates in virtualized tag mode, as discussed with reference to Figure 29, load or store operations may unintentionally specify address operators corresponding to data addresses in the area designated for storing the assigned tag. Therefore, enabling tag data access checks when operating in virtualized tag mode may help prevent unintentional data access to the assigned tag.

在步驟3108,判定資料記憶體存取請求是否由除了經允許存取分配標籤記憶體位址區域中的分配標籤的至少一類別的資料存取指令之外的指令觸發。在一些實例中,可允許某一類別的資料存取指令存取分配標籤記憶體位址區域中的分配標籤。例如,主體標籤或非主體標籤讀取或寫入指令(上文描述)或標籤設定指令(關於圖29描述)可係經允許存取分配標籤記憶體位址區域中的分配標籤的資料存取指令類別。In step 3108, it is determined whether the data memory access request is triggered by an instruction other than at least one class of data access instructions that are permitted to access the allocation label in the allocation label memory address region. In some embodiments, a certain class of data access instructions may be permitted to access the allocation label in the allocation label memory address region. For example, a read or write instruction for a subject label or non-subject label (described above) or a label setting instruction (described with respect to Figure 29) may be a data access instruction class that is permitted to access the allocation label in the allocation label memory address region.

在步驟3110,判定記憶體存取請求是否係非特權資料記憶體存取請求。例如,可判定執行記憶體存取請求的碼是否在小於預定最低特權等級的特權等級下操作。In step 3110, it is determined whether the memory access request is a non-privileged data memory access request. For example, it can be determined whether the code executing the memory access request is operating at a privilege level lower than a predetermined minimum privilege level.

在步驟3112,可拒絕對在分配標籤記憶體位址區域中的記憶體位址處儲存的資料值的讀取或寫入存取。該步驟可對應於圖30的步驟3004。可回應於判定滿足步驟3102與步驟3104、3106、3108、及3110中的任何一或多者的組合(亦即,判定為肯定)而執行步驟3112。將理解,可省略步驟3104、3106、3108中之任一者,或者可改變次序而不改變功能性。例如,雖然圖31中顯示各步驟通往下一步驟,所有步驟3102至3110可同時執行,且結果用以判定是否在步驟3112中拒絕讀取或寫入存取。In step 3112, read or write access to the data value stored at the memory address in the allocated tag memory address region may be denied. This step may correspond to step 3004 in Figure 30. Step 3112 may be executed in response to a determination that satisfies any combination of steps 3102 and steps 3104, 3106, 3108, and 3110 (i.e., a determination of affirmation). It will be understood that any of steps 3104, 3106, and 3108 may be omitted, or their order may be changed without altering functionality. For example, although Figure 31 shows each step leading to the next step, all steps 3102 to 3110 can be executed simultaneously, and the result is used to determine whether to refuse read or write access in step 3112.

在一些實例中,步驟3112可獨立於步驟3104的判定來執行。例如,對於非特權資料記憶體存取,獨立於步驟3104處判定標籤資料存取檢查啟用資訊是否指示針對資料記憶體存取請求啟用標籤資料存取檢查,可在步驟3112拒絕讀取或寫入存取。In some instances, step 3112 can be performed independently of the determination in step 3104. For example, for non-privileged data memory access, if step 3104 determines whether the label data access check enable message instructs that label data access checks be enabled for the data memory access request, read or write access can be denied in step 3112.

在步驟3114,允許對在分配標籤記憶體位址區域中的記憶體位址處儲存的資料值的讀取或寫入存取。此步驟可對應於圖30的步驟3006。在一些實例中,若步驟3102至3110中之任一者(或在給定實施方案中實際上使用的步驟)產生「否」結果,則可執行步驟3114。In step 3114, read or write access is permitted to the data value stored at the memory address in the allocated tag memory address region. This step corresponds to step 3006 in Figure 30. In some embodiments, step 3114 may be performed if any of steps 3102 to 3110 (or the steps actually used in a given embodiment) produces a "No" result.

圖32繪示包括標籤資料存取檢查的資料位址轉譯的實例。在步驟3200,執行資料存取指令。Figure 32 illustrates an example of data address translation including a label data access check. In step 3200, a data access instruction is executed.

在步驟3202,判定目前是否啟用階段1位址轉譯。如本文中論述的,在一些實施方案中,可啟用階段1或階段2位址轉譯,或者可啟用階段1及階段2轉譯二者。In step 3202, it is determined whether stage 1 address translation is currently enabled. As discussed herein, in some implementations, stage 1 or stage 2 address translation may be enabled, or both stage 1 and stage 2 translation may be enabled.

若判定啟用階段1位址轉譯,則在步驟3204判定是否啟用虛擬標籤(表示為VMTE)。若禁用階段1位址轉譯,則方法可直接繼續進行至步驟3214。If it is determined that Stage 1 address translation is enabled, then in step 3204 it is determined whether to enable the virtual tag (represented as VMTE). If Stage 1 address translation is disabled, the method can proceed directly to step 3214.

若判定啟用虛擬標籤,則在步驟3206,判定是否啟用標籤資料存取檢查(表示為「標籤存取檢查已啟用?」)。此可基於判定標籤資料存取檢查啟用資訊指示針對資料存取啟用標籤資料存取檢查來判定,如參考圖30及圖31論述的。If it is determined that a virtual label is enabled, then in step 3206, it is determined whether label data access checks are enabled (indicated by "Label access checks are enabled?"). This can be determined based on the label data access check enabled information indicating that label data access checks are enabled for data access purposes, as discussed in Figures 30 and 31.

若判定啟用標籤資料存取檢查,則在步驟3208,判定資料存取是否對應於對經指定用於儲存分配標籤的記憶體區域的存取。例如,可判定資料存取是否指定對應於分配標籤記憶體位址區域中的記憶體位址的目標位址。If it is determined that a tag data access check is enabled, then in step 3208, it is determined whether the data access corresponds to an access to a memory region specified for storage allocation tags. For example, it can be determined whether the data access specifies a target address corresponding to a memory address in the allocation tag memory address region.

若判定資料存取對應於對經指定用於儲存分配標籤的記憶體區域的存取,則在步驟3210,標記資料存取錯誤。此可包含觸發錯誤指示。If the data access is determined to correspond to access to a memory region specified for storage allocation, then in step 3210, a data access error is flagged. This may include triggering an error indication.

若在步驟3204禁用虛擬標籤、在步驟3206禁用標籤資料存取檢查、及/或資料存取未指定對應於分配標籤記憶體位址區域中的記憶體位址的目標位址,則方法繼續進行至步驟3212。若在步驟3210標記了資料存取錯誤,則程序繼續進行至步驟3212。If virtual tags are disabled in step 3204, tag data access checks are disabled in step 3206, and/or the data access does not specify a target address corresponding to a memory address in the allocated tag memory address region, the method continues to step 3212. If a data access error is flagged in step 3210, the procedure continues to step 3212.

在步驟3212,將資料位址轉譯操作應用於階段1轉譯,以將指定為資料存取操作的目標位址的虛擬位址轉譯成中間位址空間中的對應資料中間位址。步驟3212可對應於圖24的步驟2406。In step 3212, a data address translation operation is applied to stage 1 translation to translate the virtual address designated as the target address for the data access operation into the corresponding data intermediate address in the intermediate address space. Step 3212 corresponds to step 2406 in Figure 24.

在步驟3214,判定是否啟用階段2轉譯。若啟用階段2轉譯,則在步驟3216,執行階段2位址轉譯以轉譯資料中間位址(若禁用階段1轉譯,則為資料存取的目標位址,或者在步驟2406藉由階段1轉譯獲得的位址)。接著,方法繼續進行至步驟3218。若在步驟3214禁用階段2位址轉譯,則該方法可直接繼續進行至步驟3218。In step 3214, it is determined whether stage 2 translation is enabled. If stage 2 translation is enabled, then in step 3216, stage 2 address translation is performed to translate the intermediate address of the data (if stage 1 translation is disabled, then it is the target address of the data access, or the address obtained in step 2406 through stage 1 translation). The method then proceeds to step 3218. If stage 2 address translation is disabled in step 3214, the method can directly proceed to step 3218.

在步驟3218,可使用階段2位址轉譯的結果(若啟用階段2位址轉譯)或階段1位址轉譯的結果(若禁用階段2位址轉譯)來執行資料存取操作。In step 3218, the data access operation can be performed using the result of stage 2 address translation (if stage 2 address translation is enabled) or the result of stage 1 address translation (if stage 2 address translation is disabled).

本文描述之概念可體現於用於製造體現所描述之概念的設備的電腦可讀取碼中。例如,電腦可讀取碼可在半導體設計及製造程序之一或多個階段中使用,其包括電子設計自動化(electronic design automation, EDA)階段,以製造包含體現該等概念之設備的積體電路。上述電腦可讀取碼可另外或替代地促成實現本文描述之概念之設備的定義、模型化、模擬、驗證及/或測試。The concepts described herein can be embodied in computer-readable code used to manufacture devices embodying the described concepts. For example, computer-readable code can be used in one or more stages of semiconductor design and manufacturing processes, including electronic design automation (EDA) stages, to manufacture integrated circuits containing devices embodying the concepts. The aforementioned computer-readable code can additionally or alternatively facilitate the definition, modeling, simulation, verification, and/or testing of devices implementing the concepts described herein.

例如,用於製造實現本文描述之概念的設備之電腦可讀取碼可以定義代表該等概念之硬體描述語言(HDL)的碼實施。例如,碼可定義用於定義實現概念的設備之一或多個邏輯電路的暫存器轉移層(register-transfer-level, RTL)抽象概念。碼可定義代表一或多個邏輯電路的HDL,其以Verilog、SystemVerilog、Chisel或VHDL(超高速積體電路硬體描述語言)以及諸如FIRRTL的中間表示實現設備。電腦可讀取碼可使用系統級模型化語言提供實現概念之定義,諸如SystemC及SystemVerilog或可藉由電腦解譯以促成概念的模擬、功能及/或正式驗證及測試之概念的其他行為表示。For example, computer-readable code used to manufacture devices that implement the concepts described herein can define code implementations in a hardware description language (HDL) representing those concepts. For instance, the code can define a register-transfer-level (RTL) abstraction concept used to define one or more logical circuits in the device that implements the concepts. The code can define an HDL representing one or more logical circuits, implementing the device using Verilog, SystemVerilog, Chisel, or VHDL (Very High Speed Integrated Circuit Hardware Description Language) and intermediate representations such as FIRRTL. The computer-readable code can use system-level modeling languages such as SystemC and SystemVerilog to provide definitions of the implemented concepts, or other behavioral representations of the concepts that can be computer-compiled to facilitate the simulation, functional, and/or formal verification and testing of the concepts.

另外或替代地,電腦可讀取碼可定義實現本文描述之概念的積體電路組件的低階描述,諸如一或多個接線對照表或積體電路布局定義,包括諸如GDSII之表示。積體電路組件之一或多個接線對照表或其他電腦可讀取表示可藉由施加一或多個邏輯合成程序至RTL表示以產生用於製造實現本發明之設備的定義來產生。替代地或額外地,一或多個邏輯合成程序可從電腦可讀取碼產生一位元流,該位元流被載入至一場可程式化閘陣列(FPGA)中以組態FPGA以實現所述概念。FPGA可部署用於積體電路中之製造之前的驗證及測試概念的目的,或FPGA可直接部署於產品中。Alternatively or concurrently, computer-readable code may define a low-level description of an integrated circuit component that implements the concepts described herein, such as one or more wiring lookup tables or integrated circuit layout definitions, including representations such as GDSII. One or more wiring lookup tables or other computer-readable representations of the integrated circuit component may be generated by applying one or more logic synthesis procedures to the RTL representation to produce definitions for manufacturing the apparatus implementing the invention. Alternatively or additionally, one or more logic synthesis procedures may generate a bitstream from the computer-readable code, which is loaded into a field-programmable gate array (FPGA) to configure the FPGA to implement the concepts. FPGAs can be deployed for verification and testing purposes prior to the manufacturing of integrated circuits, or they can be deployed directly into products.

電腦可讀取碼可包含用於製造設備之碼表示之混合,例如包括RTL表示、接線對照表表示、或用於半導體設計及製造程序以製造實現本發明之設備的另一電腦可讀取定義之一或多者之混合。替代地或額外地,概念可定義於以下電腦可讀取定義與電腦可讀取碼的組合:電腦可讀取定義待使用於半導體設計及製造程序中以製造設備、電腦可讀取碼定義待由所定義設備一旦經製造後執行的指令。Computer-readable code may include a mixture of code representations used for manufacturing equipment, such as including RTL representations, wiring lookup table representations, or a mixture of one or more other computer-readable definitions used in semiconductor design and manufacturing processes to manufacture equipment implementing the present invention. Alternatively or additionally, the concept may be defined as a combination of the following computer-readable definitions and computer-readable codes: a computer-readable definition to be used in semiconductor design and manufacturing processes to manufacture equipment, and computer-readable code definitions of instructions to be executed by the defined equipment once it is manufactured.

此類電腦可讀取碼可設置於任何已知暫時性電腦可讀取媒體(諸如,網路上之有線或無線傳輸碼)或非暫時性電腦可讀取媒體(諸如,半導體、磁碟或光碟)中。使用電腦可讀取碼製造的積體電路可包含組件,諸如中央處理單元、圖形處理單元、神經處理單元、數位信號處理器或單獨或共同實現概念的其他組件之一或多者。Such computer-readable codes can be set in any known transient computer-readable medium (such as wired or wireless transmission codes over a network) or non-transient computer-readable medium (such as semiconductors, magnetic disks, or optical disks). Integrated circuits made using computer-readable codes can include components such as a central processing unit, a graphics processing unit, a neural processing unit, a digital signal processor, or one or more other components that implement the concept, either individually or collectively.

圖33繪示可使用的模擬器實施方案。雖然稍早所述之實施例以用於操作支援所關注技術的特定處理硬體之設備及方法來實施本發明,但亦可能根據本文所述之實施例提供一指令執行環境,其係透過使用電腦程式實施。此類電腦程式常稱為模擬器,因為其等提供硬體架構之基於軟體的實施方案。模擬器電腦程式的種類包括仿真器、虛擬機、模型、及二進制轉譯器(包括動態二進制轉譯器)。一般而言,模擬器實施方案可在可選地運行主機作業系統3304、支援模擬器程式3302的主機處理器3306上運行。在一些配置中,在硬體與所提供的指令執行環境及/或相同的主機處理器上提供的多個相異指令執行環境之間可有多層模擬。歷史上,已需要強大的處理器以提供以合理速度執行的模擬器實施方案,但此種方法在某些情況下可係合理的,諸如當因為相容性或再使用原因而欲運行另一處理器原生的碼時。例如,模擬器實施方案可提供具有不為主機處理器硬體所支援之額外功能性的指令執行環境,或提供一般與不同的硬體架構相關聯的指令執行環境。模擬的綜述係於「Some Efficient Architecture Simulation Techniques」中給出,Robert Bedichek, Winter 1990 USENIX Conference,頁數53至63。Figure 33 illustrates a possible simulator implementation. While the previously described embodiments implement the invention using devices and methods for operating specific processing hardware supporting the technology of concern, an instruction execution environment may also be provided according to the embodiments described herein, implemented using computer programs. Such computer programs are often referred to as simulators because they provide a software-based implementation of the hardware architecture. Types of simulator computer programs include emulators, virtual machines, models, and binary transcribers (including dynamic binary transcribers). Generally, simulator implementations can run on a host operating system 3304 and a host processor 3306 supporting simulator program 3302. In some configurations, there can be multiple layers of simulation between the hardware and the provided instruction execution environment and/or multiple different instruction execution environments provided on the same host processor. Historically, powerful processors have been needed to provide simulator implementations that execute at a reasonable speed, but this approach may be justified in certain situations, such as when it is necessary to run code native to another processor for compatibility or reuse reasons. For example, simulator implementations may provide instruction execution environments with additional functionality not supported by the host processor hardware, or instruction execution environments generally associated with different hardware architectures. An overview of simulation is given in "Some Efficient Architecture Simulation Techniques," Robert Bedichek, Winter 1990 USENIX Conference, pp. 53-63.

在先前已參照特定硬體架構或特徵來描述實施例之情況下,在一模擬實施例中,可藉由合適的軟體架構或特徵提供等效功能。例如,可在模擬實施例中將特定電路系統實施為電腦程式邏輯。類似地,記憶體硬體(諸如暫存器或快取)可在模擬實施例中實施為軟體資料結構。於先前描述實施例中提及的硬體元件的一或多者存在於主機硬體(例如,主機處理器3306)上的配置中,一些模擬實施例可在合適時利用主機硬體。Where embodiments have been previously described with reference to specific hardware architectures or features, equivalent functionality can be provided in a simulated embodiment using appropriate software architectures or features. For example, a particular circuit system can be implemented as computer program logic in a simulated embodiment. Similarly, memory hardware (such as registers or caches) can be implemented as software data structures in a simulated embodiment. In configurations where one or more of the hardware elements mentioned in the previously described embodiments are present on host hardware (e.g., host processor 3306), some simulated embodiments can utilize the host hardware as appropriate.

模擬器程式3302可儲存在電腦可讀取儲存媒體(其可係非暫時性媒體)上,並提供程式介面(指令執行環境)至目標碼3300(其可包括應用程式、作業系統、及超管理器),該程式介面與藉由模擬器程式3302模型化之硬體架構的介面相同。因此,上述目標碼3300的程式指令可使用模擬器程式3302自指令執行環境內執行,使得實際上不具有上文所論述之設備2之硬體特徵的主機電腦3306可仿真此等特徵。The emulator program 3302 can be stored on a computer-readable storage medium (which may be a non-transitory medium) and provides a program interface (instruction execution environment) to the object code 3300 (which may include applications, operating systems, and a super manager), the same as the interface of the hardware architecture modeled by the emulator program 3302. Therefore, the program instructions of the aforementioned object code 3300 can be executed by the emulator program 3302 from within the instruction execution environment, enabling the host computer 3306, which does not actually possess the hardware characteristics of the device 2 discussed above, to emulate these characteristics.

因此,模擬器程式3302可具有指令解碼程式邏輯3314,其以與上述指令解碼電路系統4及執行電路系統16所提供的功能性等效的方式模擬指令的解碼及處理。指令解碼程式邏輯3314解碼目標碼3300之指令,且將此等指令映射至主機設備3306之原生指令集中的對應指令集。記憶體管理(位址轉譯)程式邏輯3308、標籤檢查程式邏輯3312及標籤資料存取檢查程式邏輯3318模擬前文描述的MMU 6、標籤檢查電路系統34、及標籤資料存取檢查電路系統32的功能性,包括位址轉譯、標籤檢查、及對虛擬/中間標籤的支援。主機記憶體映射程式邏輯3310將由目標碼請求的暫存器存取及記憶體存取操作映射成對維持在主機設備3306之主機硬體上的對應資料結構的存取,諸如藉由存取主機設備3306之暫存器或記憶體中的資料。當記憶體管理程式邏輯3308基於由目標軟體定義的轉譯表實施位址轉譯時,此等轉譯表將位址轉譯成模擬的實體位址空間,目標軟體3300理解該模擬的實體位址空間對應於記憶體系統中的實體位置,但主機記憶體映射程式邏輯3110進一步將由記憶體管理程式邏輯3308基於針對目標碼3300定義的轉移表獲得的模擬的實體位址映射至用以存取主機處理設備3306中的主機記憶體的主機虛擬位址。此等主機虛擬位址可本身使用由主機所支援之標準位址轉譯機制來轉譯成主機實體位址(將主機虛擬位址轉譯成主機實體位址係在受到模擬器程式3302控制的範圍之外)。Therefore, the emulator program 3302 may have an instruction decoding program logic 3314, which simulates instruction decoding and processing in a manner functionally equivalent to that provided by the aforementioned instruction decoding circuit system 4 and execution circuit system 16. The instruction decoding program logic 3314 decodes the instructions of the target code 3300 and maps these instructions to the corresponding instruction set in the native instruction set of the host device 3306. The memory management (address translation) logic 3308, the label checking logic 3312, and the label data access checking logic 3318 simulate the functionality of the MMU 6, the label checking circuit system 34, and the label data access checking circuit system 32 described above, including address translation, label checking, and support for virtual/intermediate labels. The host memory mapping logic 3310 maps the register access and memory access operations requested by the target code into accesses to corresponding data structures maintained on the host hardware of the host device 3306, such as accessing data in the registers or memory of the host device 3306. When memory management logic 3308 performs address translation based on translation tables defined by the target software, these translation tables translate addresses into analog physical address spaces. The target software 3300 understands that the analog physical address space corresponds to a physical location in the memory system. However, host memory mapping logic 3110 further maps the analog physical addresses obtained by memory management logic 3308 based on transfer tables defined for target code 3300 to host virtual addresses used to access host memory in host processing device 3306. These host virtual addresses can be translated into host physical addresses using the standard address translation mechanism supported by the host (the translation of host virtual addresses into host physical addresses is outside the scope controlled by the emulator program 3302).

在本申請案中,用語「經組態以...(configured to...)」係用以意指一設備的一元件具有能夠實行該經定義作業的一組態。在此上下文中,「組態(configuration)」意指硬體或軟體之互連的配置或方式。例如,該設備可具有專用硬體,其提供經定義的操作,或者一處理器或其他處理裝置可經程式化以執行該功能。「經組態以(configured to)」並不意味著設備元件需要以任何方式改變以提供所定義的作業。In this application, the term "configured to..." is used to mean that a component of a device has a configuration capable of performing the defined operation. In this context, "configuration" refers to the arrangement or manner of hardware or software interconnection. For example, the device may have dedicated hardware that provides the defined operation, or a processor or other processing device may be programmed to perform the function. "Configured to" does not mean that a device component needs to be changed in any way to provide the defined operation.

在本申請案中,以片語「中之至少一者(at least one of)」前綴的特徵清單意謂著此等特徵的任何一或多者可個別地或組合地提供。例如,「下列中之至少一者:[A]、[B]、及[C]」涵蓋下列選項中之任一者:單獨A(不具有B或C)、單獨B(不具有A或C)、單獨C(不具有A或B)、A及B的組合(不具有C)、A及C的組合(不具有B)、B及C的組合(不具有A)、或A、B、及C的組合。In this application, a list of features preceded by the phrase "at least one of" means that any one or more of these features may be provided individually or in combination. For example, "at least one of the following: [A], [B], and [C]" covers any of the following options: A alone (without B or C), B alone (without A or C), C alone (without A or B), a combination of A and B (without C), a combination of A and C (without B), a combination of B and C (without A), or a combination of A, B, and C.

雖然本文已參照附圖詳細地描述本發明的說明性實施例,應瞭解本發明不限於該等精確實施例,且所屬技術領域中具有通常知識者可於其中實行各種變化與修改,而不脫離如隨附申請專利範圍所定義的本發明的範圍。Although the illustrative embodiments of the invention have been described in detail with reference to the accompanying drawings, it should be understood that the invention is not limited to these precise embodiments, and that various changes and modifications can be made therein by those skilled in the art without departing from the scope of the invention as defined in the appended claims.

2:資料處理設備 4:指令提取/解碼電路系統 6:記憶體管理單元 8:轉譯後備緩衝器 10:標籤定位位址判定電路系統 12:表走訪電路系統 14:暫存器 16:執行電路系統 20:算術/邏輯單元 22:分支單元 28:加載/儲存單元 32:標籤資料存取檢查電路系統 34:標籤檢查電路系統 40:虛擬位址空間 42:目標虛擬位址 44:階段1轉譯表 46:中間位址空間 48:目標中間位址 50:階段2轉譯表 52:實體位址空間 54:目標實體位址 60:頁描述符 62:間接表 70:資料項 72:分配標籤 80:位址標籤 82:位址運算元 84:資料項 86:資料區域 88:記憶體位址區域 90:第一位址空間 92:第二位址空間 94:資料定位第一位址 96:階段n資料轉譯表結構 98:轉譯表條目 100:階段n標籤轉譯表結構 102:轉譯表條目 104:資料定位第二位址 106:標籤定位第二位址 108:標籤定位第一位址 110:資料定位第一位址 110’:部分 112:階段n轉譯表結構 114:標籤映射條目 116:資料映射轉譯表條目 118:標籤定位第二位址 120:資料定位第二位址 200:可轉譯區域 202:標籤表位址區域 204:可轉譯位址區域 206:可轉譯位址區域 208:標籤表位址區域 210:標籤表位址區域 220:半位元組選擇資訊 240:分配標籤記憶體位址區域 242:標籤Z 244:資料Z 800~808:步驟 1200~1222:步驟 1300~1312:步驟 1500~1516:步驟 1700~1714:步驟 1900~1912:步驟 2100~2110:步驟 2400~2408:步驟 2412~2426:步驟 2430~2450:步驟 3000~3006:步驟 3100~3114:步驟 3200~3218:步驟 3300:目標碼 3302:模擬器程式 3304:主機作業系統 3306:主機電腦 3308:記憶體管理(位址轉譯)程式邏輯 3310:主機記憶體映射程式邏輯 3312:標籤檢查程式邏輯 3314:指令解碼程式邏輯 3318:標籤資料存取檢查程式邏輯 IPMTE:標籤轉譯控制資訊;第二階段標籤轉譯控制指示符 IPA1:給定中間位址 IPA2:標籤定位中間位址 PA1:實體位址 PA2:標籤定位實體位址 VTB,VTB0,VTB1,VGB:標籤表基底位址資訊;標籤表基底位址資訊項;標籤表基底位址資訊值 VTE:標籤轉譯控制資訊;第一階段標籤轉譯模式指示符 T1SZ:區域大小指示值 T0SZ:區域大小指示值 2: Data Processing Equipment 4: Instruction Fetch/Decoder Circuit System 6: Memory Management Unit 8: Translation Backup Buffer 10: Tag Location Address Determination Circuit System 12: Table Walkthrough Circuit System 14: Register 16: Execution Circuit System 20: Arithmetic/Logic Unit 22: Branch Unit 28: Load/Store Unit 32: Tag Data Access Check Circuit System 34: Tag Check Circuit System 40: Virtual Address Space 42: Target Virtual Address 44: Stage 1 Translation Table 46: Intermediate Address Space 48: Target Intermediate Address 50: Stage 2 Translation Table 52: Physical Address Space 54: Target Physical Address 60: Page Descriptor 62: Indirect Table 70: Data Item 72: Allocation Label 80: Address Label 82: Address Operator 84: Data Item 86: Data Region 88: Memory Address Region 90: First Address Space 92: Second Address Space 94: First Address of Data Location 96: Stage n Data Translation Table Structure 98: Translation Table Entries 100: Stage n Label Translation Table Structure 102: Translation Table Entries 104: Second Address of Data Location 106: Second Address of Label Location 108: Label Location First Address 110: Data Location First Address 110': Partial 112: Stage n Translation Table Structure 114: Label Mapping Entries 116: Data Mapping Translation Table Entries 118: Label Location Second Address 120: Data Location Second Address 200: Transducible Area 202: Label Table Address Area 204: Transducible Address Area 206: Transducible Address Area 208: Label Table Address Area 210: Label Table Address Area 220: Half-Byte Selection Information 240: Allocate Label Memory Address Area 242: Label Z 244: Data Z 800~808: Steps 1200~1222: Steps 1300~1312: Steps 1500~1516: Steps 1700~1714: Steps 1900~1912: Steps 2100~2110: Steps 2400~2408: Steps 2412~2426: Steps 2430~2450: Steps 3000~3006: Steps 3100~3114: Steps 3200~3218: Steps 3300: Target Code 3302: Emulator Program 3304: Host Operating System 3306: Host Computer 3308: Memory Management (Address Translation) Program Logic 3310: Host Memory Mapping Program Logic 3312: Tag Checker Logic 3314: Instruction Decoding Program Logic 3318: Tag Data Access Checker Logic IPMTE: Tag Translation Control Information; Second-stage Tag Translation Control Indicator IPA1: Given Intermediate Address IPA2: Tag Location Intermediate Address PA1: Physical Address PA2: Tag Location Physical Address VTB,VTB0,VTB1,VGB: Tag Table Base Address Information; Tag Table Base Address Information Entries; Tag Table Base Address Information Values VTE: Label translation control information; first-stage label translation mode indicator T1SZ: Area size indicator value T0SZ: Area size indicator value

本技術的進一步態樣、特徵、及優點將由於結合附圖閱讀的以下實例描述而顯而易見,在該等附圖中: [圖1]繪示包含標籤檢查電路系統之資料處理設備的實例; [圖2]繪示二階段位址轉譯; [圖3]繪示轉譯表條目及使用間接以指定記憶體屬性資訊; [圖4]繪示標籤檢查; [圖5]繪示在分配或解除分配記憶體位址空間的區域時設定分配標籤值的實例; [圖6]及[圖7]繪示使用標籤檢查偵測的記憶體使用錯誤的實例; [圖8]繪示針對標籤檢查操作執行的步驟; [圖9]繪示實體標籤; [圖10]繪示虛擬標籤; [圖11]繪示中間位址標籤; [圖12]繪示用於控制是否回應於經標籤檢查記憶體存取指令而在架構上執行標籤定位位址轉譯的步驟; [圖13]繪示用於執行標籤定位位址轉譯的步驟; [圖14]顯示標籤定位位址轉譯操作的第一實例; [圖15]顯示用於執行根據第一實例的標籤定位位址轉譯操作的步驟; [圖16]顯示標籤定位位址轉譯操作的第二實例; [圖17]顯示用於執行根據第二實例的標籤定位位址轉譯操作的步驟; [圖18]繪示儲存用於控制分配標籤存取的位址轉譯的架構狀態資訊的控制暫存器的實例; [圖19]繪示用於選擇要應用資料位址轉譯操作亦或添加標籤位址轉譯操作來產生識別儲存給定分配標籤的記憶體系統位置的實體位址的步驟; [圖20]繪示在位址空間內的一或多個可轉譯位址區域中提供標籤表位址區域的二個實例; [圖21]繪示用於產生標籤定位位址的步驟; [圖22]繪示用於包含單一可轉譯位址區域的位址空間的標籤定位位址判定操作; [圖23]繪示用於包含二個可轉譯位址區域的位址空間的標籤定位位址判定操作; [圖24]繪示用於支援第一及第二位址轉譯模式的實例中的標籤定位位址轉譯的步驟; [圖25]至[圖28]繪示取決於在第一位址轉譯階段及第二位址轉譯階段使用第一亦或第二位址轉譯模式而採取的標籤定位位址轉譯的不同方法; [圖29]繪示標籤資料存取操作; [圖30]繪示執行標籤資料存取檢查的實例; [圖31]繪示執行標籤資料存取檢查的另一實例; [圖32]繪示包括標籤資料存取檢查的資料位址轉譯的實例;及 [圖33]繪示模擬實例。 Further features, characteristics, and advantages of this technology will become apparent from the following examples, which are read in conjunction with the accompanying figures: [Figure 1] illustrates an example of a data processing device including a label checking circuit system; [Figure 2] illustrates two-stage address translation; [Figure 3] illustrates translation table entries and the use of indirect methods to specify memory attribute information; [Figure 4] illustrates label checking; [Figure 5] illustrates an example of setting allocation label values when allocating or deallocating regions of memory address space; [Figures 6] and [7] illustrate examples of memory usage errors detected using label checking; [Figure 8] illustrates the steps performed for label checking operations; [Figure 9] Illustration of a physical label; [Figure 10] Illustration of a virtual label; [Figure 11] Illustration of an intermediate address label; [Figure 12] Illustration of the steps used to control whether to perform label location address translation on the architecture in response to a label-checked memory access instruction; [Figure 13] Illustration of the steps used to perform label location address translation; [Figure 14] Illustration of a first instance of the label location address translation operation; [Figure 15] Illustration of the steps used to perform the label location address translation operation based on the first instance; [Figure 16] Illustration of a second instance of the label location address translation operation; [Figure 17] illustrates the steps for performing a tag-based address translation operation based on the second instance; [Figure 18] illustrates an instance of a control register storing architectural state information used to control address translation for allocated tag access; [Figure 19] illustrates the steps for selecting whether to apply a data address translation operation or add a tag address translation operation to generate a physical address that identifies the memory system location storing a given allocated tag; [Figure 20] illustrates two instances providing tag table address regions in one or more translatable address regions within the address space; [Figure 21] illustrates the steps for generating a tag-based address; [Figure 22] illustrates a label location address determination operation for an address space containing a single translatable address region; [Figure 23] illustrates a label location address determination operation for an address space containing two translatable address regions; [Figure 24] illustrates the steps for label location address translation in an example supporting first and second address translation modes; [Figures 25] through [Figure 28] illustrate different methods of label location address translation depending on whether the first or second address translation mode is used in the first and second address translation stages; [Figure 29] illustrates a label data access operation; [Figure 30] illustrates an example of performing a label data access check; [Figure 31] illustrates another example of performing a tag data access check; [Figure 32] illustrates an example of data address translation including a tag data access check; and [Figure 33] illustrates a simulation example.

1300:步驟 1300: Steps

1302:步驟 1302: Step

1304:步驟 1304: Steps

1306:步驟 1306: Step

1308:步驟 1308: Step

1310:步驟 1310: Steps

1312:步驟 1312: Steps

Claims (19)

一種設備,其包含: 標籤檢查電路系統,其用以回應於一經標籤檢查記憶體存取指令而執行一標籤檢查,該經標籤檢查記憶體存取指令指定用於定義對應於與在一記憶體系統中儲存的一分配標籤相關聯的一資料項的一目標資料位址的一位址運算元,該標籤檢查包含回應於偵測到在從該記憶體系統獲得的用於該目標資料位址的該分配標籤與同該位址運算元相關聯的一位址標籤之間的一標籤失配而觸發一錯誤處置回應;及 位址轉譯電路系統,其用以根據與至少一個位址轉譯階段相關聯的位址映射資訊執行位址轉譯,該至少一個位址轉譯階段包括從一第一位址空間至一第二位址空間的一給定位址轉譯階段;其中: 當回應於指定一給定資料位址且請求使用與對應於該給定資料位址的一給定資料項相關聯的一給定分配標籤來執行一操作的一標籤存取指令而執行該給定位址轉譯階段時,該位址轉譯電路系統經組態以: 判定一第一標籤轉譯模式亦或一第二標籤轉譯模式係待用於回應於該標籤存取指令的該給定位址轉譯階段的一經選擇標籤轉譯模式; 回應於判定該經選擇標籤轉譯模式係該第一標籤轉譯模式而獲得一資料定位第二位址,該資料定位第二位址識別該給定資料項及該給定分配標籤二者在該第二位址空間內的一位置;及 回應於判定該經選擇標籤轉譯模式係該第二標籤轉譯模式而獲得一標籤定位第二位址,該標籤定位第二位址識別該給定分配標籤在該第二位址空間內的一位置,該位置與由該資料定位第二位址識別的該給定資料項在該第二位址空間中的一位置分開。 An apparatus comprising: a tag checking circuit system for responding to a tag checking memory access instruction to perform a tag checking, the tag checking memory access instruction specifying an address operator corresponding to a target data address associated with a data item stored in a memory system, the tag checking including triggering an error handling response in response to detecting a tag mismatch between the allocation tag obtained from the memory system for the target data address and an address tag associated with the address operator; and An address translation circuit system for performing address translation based on address mapping information associated with at least one address translation stage, the at least one address translation stage including a given address translation stage from a first address space to a second address space; wherein: When the given address translation stage is executed in response to a specified given data address and a request to perform an operation using a given allocation label associated with a given data item corresponding to the given data address, the address translation circuit system is configured to: Determine whether a first label translation mode or a second label translation mode is a selected label translation mode to be used in the given address translation stage in response to the label access instruction; Respond to determining that the selected label translation mode is the first label translation mode by obtaining a data location second address, the data location second address identifying a location within the second address space for both the given data item and the given allocation label; and Respond to determining that the selected label translation mode is the second label translation mode by obtaining a label location second address, the label location second address identifying a location within the second address space for the given allocation label, a location separate from a location within the second address space for the given data item identified by the data location second address. 如請求項1之設備,其中該位址轉譯電路系統經組態以支援一二階段轉譯體系,其中位址轉譯係基於從一虛擬位址空間至一中間位址空間的一第一位址轉譯階段及從該中間位址空間至一實體位址空間的一第二位址轉譯階段來執行。The device of claim 1, wherein the address translation circuit system is configured to support a one- and two-stage translation system, wherein the address translation is performed based on a first address translation stage from a virtual address space to an intermediate address space and a second address translation stage from the intermediate address space to a physical address space. 如請求項2之設備,其中該位址轉譯電路系統經組態以在該給定位址轉譯階段係該第一位址轉譯階段時支援使用該第二標籤轉譯模式,其中該第一位址空間係該虛擬位址空間,且該第二位址空間係該中間位址空間。The device of claim 2, wherein the address translation circuit system is configured to support the use of the second label translation mode when the given address translation phase is the first address translation phase, wherein the first address space is the virtual address space and the second address space is the intermediate address space. 如請求項2及3中任一項之設備,其中該位址轉譯電路系統經組態以在該給定位址轉譯階段係該第二位址轉譯階段時支援使用該第二標籤轉譯模式,其中該第一位址空間係該中間位址空間,且該第二位址空間係該實體位址空間。The device of any of requests 2 and 3, wherein the address translation circuit system is configured to support the use of the second label translation mode when the given address translation phase is the second address translation phase, wherein the first address space is the intermediate address space and the second address space is the physical address space. 如前述請求項中任一項之設備,其中該位址轉譯電路系統經組態以基於標籤轉譯控制資訊來選擇該經選擇之標籤轉譯模式,該標籤轉譯控制資訊可組態以控制哪種標籤轉譯模式係用於該給定位址轉譯階段的該經選擇標籤轉譯模式。The device as described in any of the preceding requests, wherein the address translation circuit system is configured to select the selected label translation mode based on label translation control information, the label translation control information being configurable to control which label translation mode is used for the selected label translation mode in the given address translation phase. 如請求項5之設備,其中該標籤轉譯控制資訊包含在一控制暫存器中指定的資訊。The device, as in Request 5, wherein the label translates control information into information specified in a control register. 如請求項5及6中任一項之設備,其中該標籤轉譯控制資訊包含一第一階段標籤轉譯模式指示符,該第一階段標籤轉譯模式指示符指示應使用該第一標籤轉譯模式亦或該第二標籤轉譯模式作為用於一第一位址轉譯階段的該經選擇標籤轉譯模式,對於該第一位址轉譯階段,該第一位址空間係一虛擬位址空間,且該第二位址空間係一中間位址空間。For any of the devices in requests 5 and 6, the label translation control information includes a first-stage label translation mode indicator, which indicates whether the first label translation mode or the second label translation mode should be used as the selected label translation mode for a first address translation stage, wherein the first address space is a virtual address space and the second address space is an intermediate address space. 如請求項7之設備,其中: 在該第一標籤轉譯模式下,該位址轉譯電路系統經組態以基於根據一資料位址轉譯操作而處理一輸入位址來獲得該資料定位第二位址; 在該第二標籤轉譯模式下,該位址轉譯電路系統經組態以基於根據一標籤位址轉譯操作而處理一輸入位址來獲得該標籤定位第二位址;且 當針對一主體標籤讀取/寫入指令執行該第一位址轉譯階段以請求讀取或寫入使用由該主體標籤讀取/寫入指令指定的一主體標籤目標位址識別的一或多個分配標籤時,該位址轉譯電路系統經組態以基於取決於該主體標籤目標位址將該資料位址轉譯操作應用於一輸入位址來獲得該第二位址空間中的一標籤讀取/寫入目標第二位址,即使當該第一階段標籤轉譯模式指示符指示應使用該第二標籤轉譯模式作為用於回應於該標籤存取指令的該第一位址轉譯階段的該經選擇標籤轉譯模式。 As in the device of claim 7, wherein: In the first label translation mode, the address translation circuit system is configured to obtain the second address of the data location by processing an input address based on a data address translation operation; In the second label translation mode, the address translation circuit system is configured to obtain the second address of the label location by processing an input address based on a label address translation operation; and When the first address translation stage is executed in response to a subject tag read/write instruction to request the read or write of one or more assigned tags identified using a subject tag target address specified by the subject tag read/write instruction, the address translation circuit system is configured to apply the data address translation operation to an input address based on the subject tag target address to obtain a tag read/write target second address in the second address space, even when the first-stage tag translation mode indicator indicates that the second tag translation mode should be used as the selected tag translation mode for the first address translation stage in response to the tag access instruction. 如請求項8之設備,其中在將會允許執行該標籤存取指令的至少一個特權等級中禁止執行該主體標籤讀取/寫入指令。The device, as in request item 8, prohibits the execution of the subject label read/write command at at least one privilege level that would allow the execution of the label access command. 如請求項7至9中任一項之設備,其中該標籤轉譯控制資訊包含一第二階段標籤轉譯模式指示符,該第二階段標籤轉譯模式指示符指示當該第一階段標籤轉譯模式指示符指示該經選擇標籤轉譯模式係用於該第一位址轉譯階段的該第一標籤轉譯模式時,應使用該標籤轉譯模式亦或該第二標籤轉譯模式作為用於一第二位址轉譯階段的該經選擇標籤轉譯模式,對於該第二位址轉譯階段,該第一位址空間係該中間位址空間,且該第二位址空間係一實體位址空間。For any of the claims 7 to 9, the device wherein the label translation control information includes a second-stage label translation mode indicator, the second-stage label translation mode indicator indicating that when the first-stage label translation mode indicator indicates that the selected label translation mode is used for the first address translation stage, either the first label translation mode or the second label translation mode should be used as the selected label translation mode for a second address translation stage, for the second address translation stage, the first address space is the intermediate address space, and the second address space is a physical address space. 如請求項10之設備,其中回應於判定該第一階段標籤轉譯模式指示符指示該經選擇標籤轉譯模式係用於該第一位址轉譯階段的該第二標籤轉譯模式,該位址轉譯電路系統經組態以判定應使用該第一標籤轉譯模式作為用於該第二位址轉譯階段的該經選擇標籤轉譯模式。As in the device of claim 10, wherein the response to determining that the first-stage label translation mode indicator indicates that the selected label translation mode is the second label translation mode for the first address translation stage, the address translation circuit system is configured to determine that the first label translation mode should be used as the selected label translation mode for the second address translation stage. 如前述請求項中任一項之設備,其中當回應於該標籤存取指令而執行該給定位址轉譯階段時,當該經選擇標籤轉譯模式係用於該給定位址轉譯階段的該第二標籤轉譯模式時,該位址轉譯電路系統經組態以: 基於識別該給定資料項在該第一位址空間中的一位置的一資料定位第一位址,獲得識別該給定分配標籤在該第一位址空間中的一位置的一標籤定位第一位址;及 藉由根據位址映射資訊轉譯該標籤定位第一位址來獲得該標籤定位第二位址,該位址映射資訊係基於該標籤定位第一位址從一給定階段轉譯表結構選擇的,該給定階段轉譯表結構係基於一給定轉譯表基底位址識別的。 The apparatus of any of the foregoing claims, wherein when the given address translation phase is executed in response to the tag access instruction, and when the selected tag translation mode is the second tag translation mode for the given address translation phase, the address translation circuit system is configured to: obtain a tag location first address that identifies a location of the given allocation tag in the first address space based on a data location first address that identifies a location of the given data item in the first address space; and The second address of a tag is obtained by translating the first address of the tag location according to address mapping information selected from a given stage translation table structure based on the first address of the tag location. This given stage translation table structure is based on a given base address of the translation table. 如請求項12之設備,其中當回應於該標籤存取指令而執行該給定位址轉譯階段時,當該經選擇標籤轉譯模式係用於該給定位址轉譯階段的該第一標籤轉譯模式時,該位址轉譯電路系統經組態以: 藉由根據位址映射資訊轉譯該資料定位第一位址來獲得該資料定位第二位址,該位址映射資訊係基於該資料定位第一位址從該給定階段轉譯表結構選擇的,該給定階段轉譯表結構係基於該給定轉譯表基底位址識別的。 As in the device of claim 12, when the given address translation phase is executed in response to the tag access instruction, and when the selected tag translation mode is the first tag translation mode for the given address translation phase, the address translation circuit system is configured to: obtain the second address of the data location by translating the first address of the data location according to address mapping information selected from the given phase translation table structure based on the first address of the data location, the given phase translation table structure being based on the given translation table base address identification. 如請求項12及13中任一項之設備,其中在該第二標籤轉譯模式下,該位址轉譯電路系統經組態以基於以下來獲得該標籤定位第一位址: 一標籤表基底位址,其指示在該第一位址空間內指定用於儲存分配標籤的一標籤表區域的一位置;及 一標籤表偏移,其衍生自該資料定位第一位址。 The apparatus of any of claims 12 and 13, wherein, in the second tag translation mode, the address translation circuit system is configured to obtain the first address of the tag location based on: a tag table base address indicating a location within the first address space that specifies a tag table region for storing allocated tags; and a tag table offset derived from the first address of the data location. 如請求項1至14中任一項之設備,其中當回應於該標籤存取指令而執行該給定位址轉譯階段時,該位址轉譯電路系統經組態以: 回應於判定該經選擇標籤轉譯模式係該第一標籤轉譯模式,藉由基於位址映射資訊轉譯識別該給定資料項在該第一位址空間中的一位置的一資料定位第一位址來獲得該資料定位第二位址,該位址映射資訊係基於該資料定位第一位址從一資料轉譯表結構選擇的,該資料轉譯表結構係基於一資料轉譯表基底位址識別的;及 回應於判定該經選擇標籤轉譯模式係該第二標籤轉譯模式,藉由基於位址映射資訊轉譯該資料定位第一位址來獲得該標籤定位第二位址,該位址映射資訊係基於該資料定位第一位址從一標籤轉譯表結構選擇的,該標籤轉譯表結構係基於與該資料轉譯表基底位址分開的一標籤轉譯表基底位址識別的。 For any of the devices in claims 1 to 14, when the given address translation phase is executed in response to the tag access instruction, the address translation circuit system is configured to: In response to determining that the selected tag translation mode is the first tag translation mode, obtain the second address of the data location by translating a first address of the data location that identifies a position of the given data item in the first address space based on address mapping information, wherein the address mapping information is selected from a data translation table structure based on the first address of the data location, and the data translation table structure is based on a data translation table base address identification; and In response to the determination that the selected label translation mode is the second label translation mode, the second address of the label location is obtained by translating the first address of the data location based on address mapping information. This address mapping information is selected from a label translation table structure based on the first address of the data location. This label translation table structure is identified based on a label translation table base address that is separate from the base address of the data translation table. 一種用於製造如前述請求項中任一項之設備的電腦可讀取碼。A computer-readable code for manufacturing equipment as described in any of the aforementioned requests. 一種方法,其包含: 判定一第一標籤轉譯模式亦或一第二標籤轉譯模式係待用於回應於一標籤存取指令而待執行的一給定位址轉譯階段的一經選擇標籤轉譯模式,該標籤存取指令指定一給定資料位址且請求使用與對應於該給定資料位址的一給定資料項相關聯的一給定分配標籤來執行一操作,該給定分配標籤包含用於回應於一經標籤檢查記憶體存取指令而待執行的一標籤檢查中的一標籤,該經標籤檢查記憶體存取指令指定用於定義一記憶體存取操作的一目標位址的一位址運算元,該標籤檢查包含回應於偵測到在從該記憶體系統獲得的用於該目標位址的該分配標籤與同該位址運算元相關聯的一位址標籤之間的一標籤失配而觸發一錯誤處置回應; 回應於判定該經選擇標籤轉譯模式係該第一標籤轉譯模式而獲得一資料定位第二位址,該資料定位第二位址識別該給定資料項及該給定分配標籤二者在該第二位址空間內的一位置;及 回應於判定該經選擇標籤轉譯模式係該第二標籤轉譯模式而獲得一標籤定位第二位址,該標籤定位第二位址識別該給定分配標籤在該第二位址空間內的一位置,該位置與由該資料定位第二位址識別的該給定資料項在該第二位址空間中的一位置分開。 A method comprising: determining whether a first label translation mode or a second label translation mode is a selected label translation mode to be executed in response to a label access instruction, wherein the label access instruction specifies a given data address and requests to perform an operation using a given allocation label associated with a given data item corresponding to the given data address, the given allocation label including information for responding to a label-checked... A tag in a tag check pending a memory access instruction is checked. The tag check specifies an address operand used to define a target address for a memory access operation. The tag check includes a response to triggering an error handling response if an error is detected between the allocation tag obtained from the memory system for the target address and the address tag associated with the address operand. The response is to determine that a data location second address is obtained by selecting the first label translation mode, the data location second address identifying a position of both the given data item and the given allocation label within the second address space; and the response is to determine that a label location second address is obtained by selecting the second label translation mode, the label location second address identifying a position of the given allocation label within the second address space, the position being separate from a position of the given data item within the second address space identified by the data location second address. 一種電腦程式,其用於控制一主機資料處理設備以提供用於目標程式碼之執行的一指令執行環境,該電腦程式包含: 標籤檢查程式邏輯,其用以回應於一經標籤檢查記憶體存取指令而執行一標籤檢查,該經標籤檢查記憶體存取指令指定用於定義對應於與在一模擬記憶體系統中儲存的一分配標籤相關聯的一資料項的一目標資料位址的一位址運算元,該標籤檢查包含回應於偵測到在從該模擬記憶體系統獲得的用於該目標資料位址的該分配標籤與同該位址運算元相關聯的一位址標籤之間的一標籤失配而觸發一錯誤處置回應;及 位址轉譯程式邏輯,其用以根據與至少一個位址轉譯階段相關聯的位址映射資訊執行位址轉譯,該至少一個位址轉譯階段包括從一第一位址空間至一第二位址空間的一給定位址轉譯階段;其中: 當回應於指定一給定資料位址且請求使用與對應於該給定資料位址的一給定資料項相關聯的一給定分配標籤來執行一操作的一標籤存取指令而執行該給定位址轉譯階段時,該位址轉譯程式邏輯經組態以: 判定一第一標籤轉譯模式亦或一第二標籤轉譯模式係待用於回應於該標籤存取指令的該給定位址轉譯階段的一經選擇標籤轉譯模式; 回應於判定該經選擇標籤轉譯模式係該第一標籤轉譯模式而獲得一資料定位第二位址,該資料定位第二位址識別該給定資料項及該給定分配標籤二者在該第二位址空間內的一位置;及 回應於判定該經選擇標籤轉譯模式係該第二標籤轉譯模式而獲得一標籤定位第二位址,該標籤定位第二位址識別該給定分配標籤在該第二位址空間內的一位置,該位置與由該資料定位第二位址識別的該給定資料項在該第二位址空間中的一位置分開。 A computer program for controlling a host data processing device to provide an instruction execution environment for executing object code, the computer program comprising: A label checking procedure logic that responds to a label checking memory access instruction that specifies an address operand corresponding to a target data address associated with an allocation tag stored in a simulated memory system. The label checking includes a response to triggering an error handling response upon detecting a label mismatch between the allocation tag obtained from the simulated memory system for the target data address and the address tag associated with the address operand; and Address translation logic is used to perform address translation based on address mapping information associated with at least one address translation stage, the at least one address translation stage including a given address translation stage from a first address space to a second address space; wherein: When the given address translation stage is executed in response to a specified given data address and a request to perform an operation using a given allocation label associated with a given data item corresponding to the given data address, the address translation logic is configured to: Determine whether a first label translation mode or a second label translation mode is a selected label translation mode to be used in the given address translation stage in response to the label access instruction; Respond to determining that the selected label translation mode is the first label translation mode by obtaining a data location second address, the data location second address identifying a location within the second address space for both the given data item and the given allocation label; and Respond to determining that the selected label translation mode is the second label translation mode by obtaining a label location second address, the label location second address identifying a location within the second address space for the given allocation label, a location separate from a location within the second address space for the given data item identified by the data location second address. 一種儲存媒體,其儲存如請求項18之電腦程式。A storage medium that stores computer programs as described in request item 18.
TW114106533A 2024-03-20 2025-02-21 Selection of tag translation mode TW202540862A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
GB2403965.3 2024-03-20
GB2403965.3A GB2639628A (en) 2024-03-20 2024-03-20 Selection of tag translation mode

Publications (1)

Publication Number Publication Date
TW202540862A true TW202540862A (en) 2025-10-16

Family

ID=90825948

Family Applications (1)

Application Number Title Priority Date Filing Date
TW114106533A TW202540862A (en) 2024-03-20 2025-02-21 Selection of tag translation mode

Country Status (3)

Country Link
GB (1) GB2639628A (en)
TW (1) TW202540862A (en)
WO (1) WO2025196398A1 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016003646A1 (en) * 2014-06-30 2016-01-07 Unisys Corporation Enterprise management for secure network communications over ipsec
US11762566B2 (en) * 2018-01-22 2023-09-19 Arm Limited Programmable mapping of guard tag storage locations
US11392492B2 (en) * 2019-12-27 2022-07-19 Intel Corporation Memory management apparatus and method for compartmentalization using linear address metadata

Also Published As

Publication number Publication date
GB202403965D0 (en) 2024-05-01
WO2025196398A1 (en) 2025-09-25
GB2639628A (en) 2025-10-01

Similar Documents

Publication Publication Date Title
CN112424758A (en) Memory protection unit using memory protection table stored in memory system
JP7744930B2 (en) Conversion table address storage circuit
CN112449698A (en) Binary search process for control tables stored in a memory system
JP7801251B2 (en) Tag checking device and method
EP3818447B1 (en) Memory access control
JP7719863B2 (en) Techniques for constraining access to memory using capabilities
TW202439129A (en) Tag protecting instruction
US20250181515A1 (en) Read-as-x property for page of memory address space
US20240202139A1 (en) Technique for constraining access to memory using capabilities
WO2025163283A1 (en) Attribute information
TW202540862A (en) Selection of tag translation mode
TW202538531A (en) Tag-locating address determination
TW202538529A (en) Data-access-to-tag check
TW202538530A (en) Tag-locating-address translation operation
TW202533061A (en) Attribute information
GB2639994A (en) Access control information
WO2025163282A1 (en) Memory access request filtering based on requester group identifier
TW202340955A (en) Technique for constraining access to memory using capabilities
JP2025538937A (en) Region identifier based on instruction fetch address
TW202540837A (en) Isolated address region assignment updating instruction