KR20250100654A - Region identifier based on instruction fetch address - Google Patents
Region identifier based on instruction fetch address Download PDFInfo
- Publication number
- KR20250100654A KR20250100654A KR1020257014671A KR20257014671A KR20250100654A KR 20250100654 A KR20250100654 A KR 20250100654A KR 1020257014671 A KR1020257014671 A KR 1020257014671A KR 20257014671 A KR20257014671 A KR 20257014671A KR 20250100654 A KR20250100654 A KR 20250100654A
- Authority
- KR
- South Korea
- Prior art keywords
- identifier
- address
- memory
- request
- instruction
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/14—Protection against unauthorised use of memory or access to memory
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/14—Protection against unauthorised use of memory or access to memory
- G06F12/1416—Protection 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/1425—Protection 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/1441—Protection 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
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/10—Address translation
- G06F12/1009—Address translation using page tables, e.g. page table structures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/062—Securing storage systems
- G06F3/0622—Securing storage systems in relation to access
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0655—Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
- G06F3/0659—Command handling arrangements, e.g. command buffers, queues, command scheduling
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1016—Performance improvement
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1052—Security improvement
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)
- Human Computer Interaction (AREA)
- Storage Device Security (AREA)
- Executing Machine-Instructions (AREA)
Abstract
장치(100)로서, 명령어 페치 어드레스와 연관된 명령어를 페치하기 위해 명령어 페치 어드레스에 응답하는 명령어 페치 회로부(105), 명령어가 타겟 메모리 어드레스를 지정하는 요청을 포함하고, 타겟 메모리 어드레스를 지정하는 요청이 허용되는 경우, 타겟 메모리 어드레스에 따라 달라지는 동작을 수행하도록 명령어에 응답하는 처리 회로부(125), 및 메모리 보안 회로부(135)를 포함하며, 명령어가 타겟 메모리 어드레스를 지정하는 요청을 포함하는 경우, 메모리 보안 회로부는: 명령어 페치 어드레스의 미리 결정된 슬라이스에 기초하여, 현재 영역 식별자를 결정하고; 현재 영역 식별자에 기초하여, 현재 영역 식별자와 연관된 명령어에 응답하여 발행된 요청에 대한 권한 정보를 식별하고; 권한 정보에 기초하여, 요청이 금지되는지 여부를 결정하고; 요청이 금지된다는 결정에 응답하여, 요청이 금지된다는 것을 나타내는 응답을 처리 회로부에 발행하도록 구성된다.A device (100) comprising: an instruction fetch circuit (105) responsive to an instruction fetch address to fetch an instruction associated with the instruction fetch address; a processing circuit (125) responsive to the instruction to perform an operation that varies depending on the target memory address, if the instruction includes a request specifying a target memory address and the request specifying the target memory address is permitted; and a memory security circuit (135), wherein if the instruction includes the request specifying the target memory address, the memory security circuit is configured to: determine a current region identifier based on a predetermined slice of the instruction fetch address; identify, based on the current region identifier, authorization information for a request issued in response to an instruction associated with the current region identifier; determine, based on the authorization information, whether the request is prohibited; and in response to a determination that the request is prohibited, issue a response to the processing circuit indicating that the request is prohibited.
Description
본 기술은 데이터 처리(data processing)의 분야에 관한 것이다.This technology relates to the field of data processing.
데이터 처리 시스템에서, 메모리 내의 데이터 또는 명령어에 액세스하는 것을 포함하는 명령어가 실행될 수 있다. 예를 들어, 일부 명령어는 메모리 내의 위치에 판독 또는 기록하기 위한 요청을 포함할 수 있는 반면, 다른 명령어는 메모리 내의 위치에 저장된 명령어를 실행하기 위한 요청을 포함할 수 있다. 이러한 액세스에 대한 권한을 정의할 수 있는 것이 유용할 수 있다.In a data processing system, instructions may be executed that include accessing data or instructions within memory. For example, some instructions may include requests to read or write to locations within memory, while other instructions may include requests to execute instructions stored at locations within memory. It may be useful to be able to define permissions for such access.
본 기술의 제1 예에서 볼 때, 다음이 제공된다. 장치로서:In a first example of the present technology, the following is provided: As a device:
명령어 페치 어드레스와 연관된 명령어를 페치하기 위해 상기 명령어 페치 어드레스에 응답하는 명령어 페치 회로부;An instruction fetch circuit responsive to an instruction fetch address for fetching an instruction associated with the instruction fetch address;
상기 명령어가 타겟 메모리 어드레스를 지정하는 요청을 포함하고, 상기 타겟 메모리 어드레스를 지정하는 상기 요청이 허용되는 경우, 상기 타겟 메모리 어드레스에 따라 달라지는 동작을 수행하도록 상기 명령어에 응답하는 처리 회로부; 및A processing circuitry that responds to the command to perform an operation that depends on the target memory address, if the command includes a request specifying a target memory address, and the request specifying the target memory address is permitted; and
메모리 보안 회로부를 포함하며, 상기 명령어가 상기 타겟 메모리 어드레스를 지정하는 상기 요청을 포함하는 경우, 상기 메모리 보안 회로부는:A memory security circuit comprising:
상기 명령어 페치 어드레스의 미리 결정된 슬라이스에 기초하여, 현재 영역 식별자를 결정하고;Based on a predetermined slice of the above instruction fetch address, determine the current region identifier;
상기 현재 영역 식별자에 기초하여, 상기 현재 영역 식별자와 연관된 명령어에 응답하여 발행된 요청에 대한 권한 정보를 식별하고;Based on the current realm identifier, identify authorization information for a request issued in response to a command associated with the current realm identifier;
상기 권한 정보에 기초하여, 상기 요청이 금지되는지 여부를 결정하고;Based on the above authority information, determine whether the request is prohibited;
상기 요청이 금지된다는 결정에 응답하여, 상기 요청이 금지된다는 것을 나타내는 응답을 상기 처리 회로부에 발행하도록 구성된다.In response to a determination that the request is prohibited, the processing circuitry is configured to issue a response indicating that the request is prohibited.
다른 예에서 볼 때, 다음이 제공된다. 방법으로서:As another example, the following is provided: As a method:
명령어 페치 어드레스에 응답하여, 상기 명령어 페치 어드레스와 연관된 명령어를 페치하는 단계; 및In response to the instruction fetch address, a step of fetching an instruction associated with the instruction fetch address; and
상기 명령어가 타겟 메모리 어드레스를 지정하는 요청을 포함하는 경우:If the above command includes a request specifying a target memory address:
상기 명령어에 응답하여, 상기 타겟 메모리 어드레스를 지정하는 상기 요청이 허용되는 경우, 상기 타겟 메모리 어드레스에 따라 달라지는 동작을 수행하는 단계; 및In response to the above command, if the request specifying the target memory address is allowed, performing an operation that varies depending on the target memory address; and
상기 명령어 페치 어드레스의 미리 결정된 슬라이스에 기초하여, 현재 영역 식별자를 결정하는 단계;A step of determining a current region identifier based on a predetermined slice of the above instruction fetch address;
상기 현재 영역 식별자에 기초하여, 상기 현재 영역 식별자와 연관된 명령어에 응답하여 발행된 요청에 대한 권한 정보를 식별하는 단계;A step of identifying authorization information for a request issued in response to a command associated with the current area identifier, based on the current area identifier;
상기 권한 정보에 기초하여, 상기 요청이 금지되는지 여부를 결정하는 단계; 및A step of determining whether the request is prohibited based on the above authority information; and
상기 요청이 금지된다는 결정에 응답하여, 상기 요청이 금지된다는 것을 나타내는 응답을 발행하는 단계를 포함한다.In response to a determination that the request is prohibited, the method comprises the step of issuing a response indicating that the request is prohibited.
다른 예에서 볼 때, 다음이 제공된다. 컴퓨터 프로그램으로서, 컴퓨터에서 실행될 때, 상기 컴퓨터가:In another example, the following is provided: A computer program, which, when run on a computer, causes the computer to:
명령어 페치 어드레스와 연관된 명령어를 페치하기 위해 상기 명령어 페치 어드레스에 응답하는 명령어 페치 프로그램 로직;Instruction fetch program logic responsive to an instruction fetch address to fetch an instruction associated with the instruction fetch address;
상기 명령어가 타겟 메모리 어드레스를 지정하는 요청을 포함하고, 상기 타겟 메모리 어드레스를 지정하는 상기 요청이 허용되는 경우, 상기 타겟 메모리 위치를 나타내는 요청을 수행하도록 상기 명령어에 응답하는 처리 프로그램 로직; 및A processing program logic responsive to the command to perform a request indicating the target memory location, if the command includes a request specifying a target memory address, and the request specifying the target memory address is allowed; and
메모리 보안 프로그램 로직을 제공하도록 하며, 상기 명령어가 상기 타겟 메모리 어드레스를 지정하는 상기 요청을 포함하는 경우, 상기 메모리 보안 프로그램 로직은:Provides memory security program logic, wherein when the command includes the request specifying the target memory address, the memory security program logic:
상기 명령어 페치 어드레스의 미리 결정된 슬라이스에 기초하여, 현재 영역 식별자를 결정하고;Based on a predetermined slice of the above instruction fetch address, determine the current region identifier;
상기 현재 영역 식별자에 기초하여, 상기 현재 영역 식별자와 연관된 명령어에 응답하여 발행된 요청에 대한 권한 정보를 식별하고;Based on the current realm identifier, identify authorization information for a request issued in response to a command associated with the current realm identifier;
상기 권한 정보에 기초하여, 상기 요청이 금지되는지 여부를 결정하고;Based on the above authority information, determine whether the request is prohibited;
상기 요청이 금지된다는 결정에 응답하여, 상기 요청이 금지된다는 것을 나타내는 응답을 상기 처리 프로그램 로직에 발행하도록 구성된다.In response to a determination that the request is prohibited, the processing program logic is configured to issue a response indicating that the request is prohibited.
다른 예에서 볼 때, 전술된 컴퓨터 프로그램을 저장하기 위한 컴퓨터 판독 가능 저장 매체가 제공된다. 컴퓨터 판독 가능 저장 매체는 일시적 저장 매체 또는 비일시적 저장 매체일 수 있다.In another example, a computer-readable storage medium is provided for storing the aforementioned computer program. The computer-readable storage medium may be a transitory storage medium or a non-transitory storage medium.
본 기술의 추가의 양태, 피처 및 이점은 첨부 도면과 관련하여 읽어야 할 예의 하기의 설명으로부터 명백해질 것이며, 첨부 도면에서:
도 1은 데이터 처리 장치를 개략적으로 도시하고;
도 2a 및 도 2b는 특정 어드레스 공간에 대해 정의된 권한의 예를 도시한다.
도 3a 및 도 3b는 상이한 코드 영역에서의 명령어가 어떻게 실행될 수 있는지의 예를 도시한다.
도 4 내지 도 6은 명령어 페치 어드레스에 기초하여 공간 영역 식별자(SRegionID)를 결정하는 다양한 예를 도시한다.
도 7은 권한 테이블에서 판독, 기록 및 실행 권한을 정의하는 방법의 예를 도시한다.
도 8은 하나 이상의 권한 테이블을 식별하고 액세스하는 데 사용될 수 있는 회로부의 예를 도시한다.
도 9는 메모리 액세스 요청이 발행되는 것에 응답하여 수행될 수 있는 방법의 예를 도시하는 흐름도이다.
도 10은 데이터 처리 장치가 일부 분기(branch) 명령어의 실행에 어떻게 반응할 수 있는지에 대한 예를 도시하는 흐름도이다.
도 11은 사용될 수 있는 시뮬레이터 구현예를 도시한다.Additional aspects, features and advantages of the present technology will become apparent from the following description, which should be read in connection with the accompanying drawings, in which:
Figure 1 schematically illustrates a data processing device;
Figures 2a and 2b illustrate examples of permissions defined for specific address spaces.
Figures 3a and 3b illustrate examples of how instructions in different code regions can be executed.
Figures 4 to 6 illustrate various examples of determining a space region identifier (SRegionID) based on an instruction fetch address.
Figure 7 illustrates an example of how to define read, write, and execute permissions in a permission table.
Figure 8 illustrates an example of circuitry that can be used to identify and access one or more authorization tables.
FIG. 9 is a flowchart illustrating an example of a method that may be performed in response to a memory access request being issued.
Figure 10 is a flow diagram illustrating an example of how a data processing unit may react to the execution of some branch instructions.
Figure 11 illustrates an example simulator implementation that may be used.
첨부된 도면을 참조하여 예시적인 구현예를 논의하기 전에, 다음과 같은 예시적인 구현예 및 관련 이점에 대한 설명이 제공된다.Before discussing exemplary implementations with reference to the attached drawings, a description of the following exemplary implementations and associated advantages is provided.
일 예시적인 구성에 따르면, 명령어 페치 어드레스와 연관된 명령어를 페치하기 위해 명령어 페치 어드레스에 응답하여 명령어 페치 회로부를 포함하는 장치가 제공된다. 예를 들어, 명령어 페치 회로부는 명령어 페치 어드레스(예를 들어, 가상 어드레스 또는 물리적 어드레스일 수 있음)에 의해 표시된 메모리 위치로부터 명령어를 페치할 수 있다. 특정 예에서, 명령어 페치 어드레스는 명령어와 연관된 프로그램 카운터(PC) 어드레스일 수 있다.According to one exemplary configuration, a device is provided that includes instruction fetch circuitry responsive to an instruction fetch address to fetch an instruction associated with the instruction fetch address. For example, the instruction fetch circuitry may fetch an instruction from a memory location indicated by the instruction fetch address (which may be, for example, a virtual address or a physical address). In a particular example, the instruction fetch address may be a program counter (PC) address associated with the instruction.
장치는 또한, 명령어가 타겟 메모리 어드레스를 지정하는 요청을 포함하고, 타겟 메모리 어드레스를 지정하는 요청이 허용되는 경우, 타겟 메모리 어드레스에 따라 달라지는 동작을 수행하도록 명령어에 응답하는 처리 회로부를 포함한다. 예를 들어, 타겟 메모리 요청을 지정하는 로드 또는 저장 명령어는 타겟 메모리 어드레스와 연관된 타겟 메모리 위치에 판독 또는 기록하기 위한 요청을 포함할 수 있는 반면, 타겟 메모리 어드레스를 지정하는 분기 명령어(일부 예에서, 함수 호출 또는 함수 반환 명령어일 수 있음)는 타겟 메모리 위치에 저장된 명령어로 분기하기 위한 실행에 대한 요청을 포함할 수 있다. 그러나, (로드, 저장 및 분기 명령어 이외의) 다른 유형의 명령어도 이러한 요청을 또한 포함할 수 있음을 이해해야 한다.The device also includes processing circuitry that, if the instruction includes a request specifying a target memory address, performs an action that depends on the target memory address, if the request specifying the target memory address is permitted. For example, a load or store instruction specifying a target memory request may include a request to read from or write to a target memory location associated with the target memory address, while a branch instruction (which may in some examples be a function call or function return instruction) specifying a target memory address may include a request for execution to branch to an instruction stored at the target memory location. However, it should be understood that other types of instructions (other than load, store and branch instructions) may also include such requests.
이러한 데이터/명령어에 액세스하는 것이 허용되지 않는 프로세스 내의 코드 영역에 의해 발행되는 판독 및 기록 액세스로부터 메모리에 저장된 데이터 및 명령어를 보호하고, 코드의 특정 영역으로 실행을 분기하는 것을 방지하기 위한 메커니즘을 제공하는 것이 유용할 수 있다. 이렇게 하는 한 가지 방법은 타겟 메모리 어드레스에 따라 달라지는 권한을 정의하는 것이며, 이러한 권한은 페이지 테이블과 같은 테이블에서 정의할 수 있다. 그러나 이러한 권한은 요청의 소스를 고려하지 않으며, 이 권한은 어떤 프로세스나 프로세스의 일부가 메모리 내의 어떤 위치에 액세스/분기하도록 허용되는지를 정의하지 않는다. 따라서, 페이지 테이블에서의 권한이 업데이트되지 않는 한, 모든 명령어는 주어진 메모리 페이지에 대해 동일한 액세스 권한을 갖는다. 이러한 권한을 업데이트하는 것은 상당한 레이턴시를 초래할 수 있는데, 이는 메모리에 대한 액세스를 필요로 하기 때문이며, 따라서 이러한 업데이트는 프로세스 사이에서만 수행될 수 있고, 이 경우, 임의의 하나의 프로세스(또는 애플리케이션) 내에서 해당 애플리케이션의 모든 코드는 전형적으로 임의의 주어진 메모리 위치로부터 데이터/명령어를 판독/기록/실행하는 동일한 특권을 갖는다.It may be useful to provide mechanisms to protect data and instructions stored in memory from read and write accesses issued by code regions within a process that are not permitted to access such data/instructions, and to prevent branching of execution to specific regions of code. One way to do this is to define permissions that vary based on the target memory address, which can be defined in tables such as page tables. However, these permissions do not take into account the source of the request, and they do not define which process or part of a process is permitted to access/branch to which location in memory. Thus, unless the permissions in the page table are updated, all instructions have the same access rights to a given memory page. Updating these permissions can incur significant latency, since it requires access to memory, and thus such updates can only be performed between processes, in which case, within any one process (or application), all code in that application typically has the same privilege to read/write/execute data/instructions from any given memory location.
또 다른 접근법은 특정 권한을 취소하거나 수정하는 CPU 레지스터의 프로그래밍에 따라 특정 권한을 동적으로 취소할 수 있는 "권한 오버레이" 또는 "권한 키" 메커니즘을 추가로 포함하는 것일 수 있다. 예를 들어, 권한이 페이지 테이블에 정의된 경우(예를 들어), 페이지 테이블 엔트리에 "오버레이 인덱스"의 다수의 비트가 존재할 수 있다. 따라서 메모리의 각각의 페이지는 "키"로 주석 처리되고, 권한을 감산(subtract)할 수 있는 프로그래밍 가능한 "오버레이 해석(overlay interpretation)" 레지스터가 있다. 예를 들어, 오버레이 해석 레지스터는 "인덱스 2를 갖는 페이지로부터 기록 액세스 제거" 또는 "인덱스 3을 기록 가능에서 실행 가능으로 토글(toggle)"과 같은 변경을 표시할 수 있다.Another approach might be to additionally include a "privilege overlay" or "privilege key" mechanism that can dynamically revoke certain privileges based on the programming of CPU registers that revoke or modify certain privileges. For example, if privileges are defined in a page table (e.g.), there might be a number of bits in the "overlay index" of the page table entry. Thus, each page of memory would be annotated with a "key", and there would be a programmable "overlay interpretation" register that could subtract privileges. For example, the overlay interpretation register might indicate a change such as "remove write access from page with
그러나, 이러한 접근법도 단지 권한에 대한 시간적인 뷰만을 제공한다: 위에서 정의된 접근법 중 어느 것도 액세스 요청의 소스(예를 들어, 요청을 포함하는 명령어)를 고려하지 않으며, 이는 권한은 오로지 "구성 레지스터에 마지막으로 기록된 것이 무엇인가?"에 의해서만 결정되고, "지금 어떤 코드가 실행되고 있는가?"에 의해서가 아니기 때문이다. 그 결과, 권한이 레지스터의 현재 값 및 페이지 테이블 엔트리에 현재 저장된 것으로부터 도출되기 때문에, 제어 흐름 무결성의 손실은 (예를 들어) 메모리의 다른 부분의 무결성 손실을 초래할 수 있다(예를 들어, 오버레이 해석 레지스터나 페이지 테이블 엔트리가 업데이트되는 것 없이, 예상치 못한 위치로의 실행 분기로 인해, 해당 위치에 도달하는 프로그램 흐름의 예상 경로에는 오버레이 해석 레지스터나 페이지 테이블 엔트리에에 대한 업데이트가 수반되어야 함).However, these approaches also provide only a temporal view of permission: none of the approaches defined above considers the source of an access request (i.e., the instruction containing the request), because permission is determined solely by "what was last written to the configuration registers?", not by "what code is currently executing?". As a result, since permission is derived from the current values of registers and what is currently stored in page table entries, a loss of control flow integrity may (for example) lead to a loss of integrity of other parts of memory (e.g., a branch of execution to an unexpected location without updating the overlay interpreter registers or page table entries, where the expected path of program flow to reach that location must involve updates to the overlay interpreter registers or page table entries).
이러한 문제를 해결하기 위해, 본 기술은 단지 코드-시간적(예를 들어, 요청이 발행된 때에 따라 달라짐)이기보다는 코드-공간적(예를 들어, 메모리 액세스 요청의 소스에 따라 달라짐)인 권한이 정의되는 메커니즘을 제공한다.To address these issues, the present technique provides a mechanism by which permissions are defined code-space (e.g., depending on the source of a memory access request) rather than merely code-temporally (e.g., depending on when the request was issued).
특히, 본 기술의 장치는, 명령어가 타겟 메모리 어드레스를 지정하는 요청을 포함하는 경우, 명령어 페치 어드레스의 미리 결정된 슬라이스에 기초하여 현재 영역 식별자(또한 "RegionID"로 지칭됨)를 결정하기 위한 메모리 보안 회로부를 포함한다. 따라서, RegionID는 요청의 타겟(예를 들어, 타겟 메모리 어드레스 - 특정 RegionID에 대한 권한이 메모리 액세스의 타겟에 따라 달라질 수 있다는 것이 인식될 것임)에만 의존하기 보다는, 요청의 소스(예를 들어, 명령어)에 따라 달라진다. 메모리 보안 회로부는, 현재 영역 식별자에 기초하여, 현재 영역 식별자와 연관된 명령어에 응답하여 발행된 요청에 대한 권한 정보를 식별하고, 권한 정보에 기초하여, 요청이 금지되는지 여부를 결정하도록 구성된다. 메모리 보안 회로부는 또한, 요청이 금지된다는 결정에 응답하여, 요청이 금지된다는 것을 나타내는 응답을 처리 회로부에 발행하도록 구성된다.In particular, the device of the present technology includes memory security circuitry for determining a current region identifier (also referred to as "RegionID") based on a predetermined slice of an instruction fetch address, when the instruction includes a request specifying a target memory address. Thus, the RegionID depends on the source of the request (e.g., the instruction) rather than solely on the target of the request (e.g., the target memory address - it will be appreciated that permissions for a particular RegionID may vary depending on the target of the memory access). The memory security circuitry is configured to identify, based on the current region identifier, permissions information for a request issued in response to an instruction associated with the current region identifier, and to determine, based on the permissions information, whether the request is forbidden. The memory security circuitry is further configured to issue, in response to a determination that the request is forbidden, a response to the processing circuitry indicating that the request is forbidden.
RegionID는 타겟 메모리 어드레스에 의해 식별된 메모리 위치에 액세스/분기하도록 요청된 명령에 대한 명령어 페치 어드레스에 기초하여 결정된다(그리고 선택적으로 또한 다른 요인에 따라 달라질 수 있음). 따라서, 권한 정보가 RegionID에 기초하여 조회되기 때문에, 메모리 보안 회로부는 요청의 소스에 기초하여 요청이 금지되는지 여부를 결정한다. 이로 인해 메모리 보안 회로부가 요청이 발행되는 프로세스/애플리케이션 내의 특정 위치에 따라 달라지는 세분화된 권한을 강제할 수 있고, 제어 흐름 무결성의 손실이 있더라도 코드 영역의 무결성을 유지할 수 있다. 또한, 명령어 페치 어드레스의 슬라이스에 기초하여 RegionID를 결정하는 것은 RegionID를 결정하기 위한 간단하고, 저비용 메커니즘을 제공하며, 이는 예를 들어, 명령어 페치 어드레스에 기초하여 고가의/고-레이턴시 테이블 조회를 구현할 필요성을 회피할 수 있다. 권한 정보가 요청이 허용됨을 나타내는 경우, 액세스 요청은, 예를 들어, 장치에 의해 수행된 임의의 다른 검사를 통과하지 못하면, 궁극적으로 여전히 거부될 수 있다는 점에 유의한다.The RegionID is determined based on the instruction fetch address for the instruction requested to access/branch to the memory location identified by the target memory address (and optionally also based on other factors). Thus, since the authorization information is looked up based on the RegionID, the memory security circuitry determines whether the request is prohibited based on the source of the request. This allows the memory security circuitry to enforce fine-grained authorization that varies based on the specific location within the process/application where the request is issued, and to maintain the integrity of code regions even if there is a loss of control flow integrity. Furthermore, determining the RegionID based on a slice of the instruction fetch address provides a simple, low-cost mechanism for determining the RegionID, which may avoid the need to implement expensive/high-latency table lookups based on the instruction fetch address, for example. Note that even if the authorization information indicates that the request is permitted, the access request may still ultimately be denied, for example, if it fails any other checks performed by the device.
본 기술은 또한, 예를 들어, 단일 프로세스 또는 애플리케이션의 상이한 부분일 수 있는 상이한 명령어에 대한 상이한 권한을 정의하기 위한 메커니즘을 제공한다(예를 들어, 권한이 요청의 타겟이나 권한 세트를 업데이트하기 위해 업데이트되어야 하는 구성 레지스터의 값에만 기초하는 것이 아니라, 요청의 소스에 따라 달라질 수 있기 때문임). 따라서, 본 기술은, 예를 들어, 소프트웨어의 핵심 보안 컴포넌트를 강화하기 위한, 애플리케이션 및 운영 체제(OS) 커널에서 유용할 수 있다. OS 커널에서, 이 메커니즘은, 예를 들어, 다른 커널 컴포넌트에 의한 우발적 또는 악의적 변조에 대해 커널 메모리 관리 코드 및 구조를 강화시키는 데 사용될 수 있다. 또한 이러한 컴포넌트를 개별 프로세스로 위임하는 데 따른 성능 오버헤드 없이 커널 드라이버를 샌드박스하는 데 사용할 수 있다. 애플리케이션 내에서도 동일한 이점이 적용된다: 예를 들어, 메모리 할당 라이브러리 코드/구조, 및/또는 동적 링커 코드/구조를 애플리케이션의 나머지 부분에 의한 변조로부터 보호한다. 신뢰할 수 없는 입력을 처리하기 위한 샌드박스 환경이나 JIT(Just-In-Time) 환경을 포함하는 애플리케이션에도 이점을 제공할 수 있다.The present technology also provides a mechanism for defining different privileges for different instructions, which may be, for example, different parts of a single process or application (e.g., because privileges may vary based on the source of the request, rather than solely on the target of the request or the value of a configuration register that must be updated to update the permission set). Thus, the present technology may be useful in applications and operating system (OS) kernels, for example, for hardening core security components of software. In an OS kernel, this mechanism may be used, for example, to harden kernel memory management code and structures against accidental or malicious tampering by other kernel components. It may also be used to sandbox kernel drivers without the performance overhead of delegating such components to a separate process. The same benefits apply within applications: for example, protecting memory allocation library code/structures, and/or dynamic linker code/structures from tampering by the rest of the application. It may also provide benefits to applications that include a sandboxed environment or a Just-In-Time (JIT) environment for handling untrusted input.
일부 예에서, 메모리 보안 회로부는, 타겟 메모리 어드레스와 연관된 페이지 테이블 엔트리로부터 도출된 페이지 테이블 액세스 권한 정보에 기초하여, 요청이 금지되는지 여부를 결정하도록 구성된다. 이러한 예에서, 메모리 보안 회로부는, 권한 정보 및 페이지 테이블 권한 정보 중 적어도 하나에 기초하여 요청이 금지된다는 결정에 응답하여, 요청이 금지된다는 것을 나타내는 응답을 발행하도록 구성된다.In some examples, the memory security circuitry is configured to determine whether the request is forbidden based on page table access permission information derived from a page table entry associated with the target memory address. In such examples, the memory security circuitry is configured to, in response to a determination that the request is forbidden based on at least one of the permission information and the page table permission information, issue a response indicating that the request is forbidden.
요청의 소스에 기초하여 권한을 정의하는 것이 위에서 제시된 이유로 유리하지만, 이러한 권한이 요청에 의해 명시된 타겟 메모리 어드레스에 따라 달라지는 페이지 테이블에 정의된 페이지 테이블 액세스 권한 이외에도 제공되는 경우, 본 기술은 특히 효과적일 수 있다. 이러한 예에서, RegionID와 관련하여 정의된 권한이 타겟 메모리 어드레스에 대한 페이지 테이블 엔트리에 기초하여 정의된 권한과 상이한 경우, 메모리 보안 회로부는 (예를 들어, 권한의 세트 중 하나 또는 둘 모두가 요청이 금지된다는 것을 나타내는 경우, 요청이 금지된다는 것을 나타내는 응답을 발행함으로써) 더 제한적인 권한을 올바른 것으로 처리하도록 구성된다.While defining permissions based on the source of a request is advantageous for the reasons presented above, the technique can be particularly effective if such permissions are provided in addition to page table access permissions defined in page tables that depend on the target memory address specified by the request. In such an example, if the permissions defined with respect to a RegionID are different from the permissions defined based on the page table entry for the target memory address, the memory security circuitry is configured to treat the more restrictive permissions as correct (e.g., by issuing a response indicating that the request is forbidden if one or both of the sets of permissions indicate that the request is forbidden).
일부 예에서, 메모리 보안 회로부는, 명령어 페치 어드레스의 미리 결정된 슬라이스에 기초하여, 명령어를 저장하는 메모리의 영역에 해당하는 소스 영역 식별자를 결정하고, 소스 영역 식별자에 대한 의존에 따라 현재 영역 식별자를 결정하도록 구성된다.In some examples, the memory security circuitry is configured to determine a source region identifier corresponding to a region of memory storing an instruction based on a predetermined slice of an instruction fetch address, and to determine a current region identifier based on dependency on the source region identifier.
위에서 설명된 바와 같이, 현재 영역 식별자는 명령어 페치 어드레스에 따라 달라진다. 이 예에서, 이 의존성은 소스 영역 식별자(공간 영역 식별자(SRegionID)라고도 지칭됨)로 표현되며, 이는 명령어를 저장하는 메모리의 영역(따라서 명령어 페치 어드레스를 포함하는 어드레스 공간의 영역)에 해당한다.As explained above, the current region identifier depends on the instruction fetch address. In this example, this dependency is expressed by the source region identifier (also called the space region identifier (SRegionID)), which corresponds to the region of memory that stores the instruction (and thus the region of the address space that contains the instruction fetch address).
일부 예에서, 처리 회로부는 현재 소스 영역 식별자를 결정하고 현재 소스 영역 식별자를 목적지 레지스터에 저장하기 위해 목적지 레지스터를 식별하는 반환-공간-식별자 명령어에 응답한다.In some examples, the processing circuitry responds to a return-space-identifier instruction that determines the current source region identifier and identifies a destination register to store the current source region identifier in the destination register.
이는 예를 들어, 공유 라이브러리가 호출된(분기된) 코드 영역을 식별할 수 있는 메커니즘을 제공한다. 반환-공간-식별자 명령어는 전용 명령어일 수 있거나, 기존 명령어에 대한 수정일 수 있다는 점에 유의한다 - 예를 들어, 현재 소스 영역 식별자는 시스템 레지스터 필드에 저장될 수 있고, 반환-공간-식별자 명령어는 시스템 레지스터의 해당 필드를 판독하기 위한 명령어일 수 있다.This provides a mechanism by which, for example, a shared library can identify the code region from which it was called (branched). Note that the return-space-identifier instruction may be a dedicated instruction, or a modification of an existing instruction - for example, the current source region identifier may be stored in a system register field, and the return-space-identifier instruction may be an instruction to read that field in a system register.
일부 예에서, 장치는, 현재 시간 식별자를 저장하기 위한 레지스터를 포함하되, 메모리 보안 회로부는 소스 영역 식별자 및 현재 시간 식별자에 따라 달라지는 현재 영역 식별자를 결정하도록 구성되고, 현재 시간 식별자는 명령어 페치 어드레스와 무관하게 조회된다. 이러한 예에서, 처리 회로부는, 현재 시간 식별자를 미리 결정된 값으로 설정하기 위해, 이전 명령어와 연관된 소스 영역 식별자와 상이한 주어진 소스 영역 식별자를 갖는 명령어를 검출하는 것에 응답한다.In some examples, the device includes a register for storing a current time identifier, wherein the memory security circuitry is configured to determine a current region identifier that varies based on a source region identifier and a current time identifier, wherein the current time identifier is looked up independently of an instruction fetch address. In such examples, the processing circuitry is responsive to detecting an instruction having a given source region identifier that is different from a source region identifier associated with a previous instruction to set the current time identifier to a predetermined value.
공간 컴포넌트(예를 들어, 소스 영역 식별자) 외에도, 이 예에서 현재 영역 식별자는 또한 (예를 들어, 현재 시간 영역 식별자, TRegionID에 기초하여) 시간 컴포넌트를 가지며, 이 식별자는 소스 영역 식별자에서의 변화에 응답하여 미리 결정된 값(예를 들어, 이것은 0일 수 있음)으로 강제 설정된다. 이 접근법은 제어 흐름 무결성의 손실에 대한 추가적인 보안을 제공하는데, 이는 코드의 상이한 영역으로의 분기가 임시 영역 식별자를 (예를 들어) 권한의 미리 결정된 세트와 연관될 수 있는 미리 결정된 값으로 강제하기 때문이다.In addition to a spatial component (e.g., a source region identifier), in this example the current region identifier also has a temporal component (e.g., based on the current temporal region identifier, TRegionID), which is forced to a predetermined value (e.g., it may be 0) in response to a change in the source region identifier. This approach provides additional security against loss of control flow integrity, since branching to different regions of the code forces the temporary region identifier to a predetermined value, which may be associated with a predetermined set of permissions (e.g., a set of permissions).
일부 예에서, 장치는, 명령어 페치 어드레스의 미리 결정된 슬라이스를 나타내는 슬라이스 식별 정보를 저장하기 위한 구성 레지스터를 포함한다.In some examples, the device includes a configuration register for storing slice identification information indicating a predetermined slice of an instruction fetch address.
미리 결정된 슬라이스로서 사용되는 명령어 페치 어드레스의 비트는, 일부 예에서, 하드와이어링될 수 있다(예를 들어, 소프트웨어로 구성가능하지 않음). 그러나, 이 예에서, 미리 결정된 슬라이스는 구성 레지스터에 저장된 슬라이스 식별 정보에 의해 식별된다. 이 구성 레지스터는 소프트웨어에서 액세스할 수 있게 하여 슬라이스 식별 정보를 소프트웨어로 구성할 수 있게 한다.The bits of the instruction fetch address used as the predetermined slice may, in some instances, be hardwired (e.g., not software configurable). However, in this example, the predetermined slice is identified by slice identification information stored in a configuration register. This configuration register is accessible to software, allowing the slice identification information to be configured by software.
슬라이스 식별 정보가 표현되는 방식은 특별히 제한되지 않는다. 예를 들어, 미리 결정된 슬라이스로서 사용될 명령어 페치 어드레스의 제1 및 마지막 비트 위치(즉, 최상위 및 최하위 비트 위치)의 표시로서 표현될 수 있다(예를 들어, 명령어 페치 어드레스의 비트(44:38)가 사용될 것이라면, 슬라이스 식별 정보는 비트 위치(44 및 38)를 식별할 수 있다). 대안적으로, 구성 레지스터는 슬라이스의 제1 또는 마지막 비트 위치 중 어느 하나 및 슬라이스 내의 비트의 수의 표시를 저장할 수 있다(예를 들어, 비트(44:38)가 사용되는 예에서, 비트 위치(44) 또는 비트 위치(38) 중 어느 하나가 식별될 수 있고, 슬라이스 내의 비트의 수가 7로 표시될 수 있다).The way in which the slice identification information is represented is not particularly limited. For example, it may be represented as an indication of the first and last bit positions (i.e., the most significant and least significant bit positions) of the instruction fetch address to be used as the predetermined slice (e.g., if bits (44:38) of the instruction fetch address are to be used, the slice identification information may identify bit positions (44 and 38)). Alternatively, the configuration register may store an indication of either the first or last bit positions of the slice and the number of bits in the slice (e.g., in an example in which bits (44:38) are used, either bit position (44) or bit position (38) may be identified and the number of bits in the slice may be represented as 7).
일부 예에서, 메모리 보안 회로부는 소스 영역 식별자가 디폴트 소스 영역 식별자라는 것을 결정하기 위해 명령어 페치 어드레스의 추가 슬라이스가 미리 결정된 값 이외의 값을 갖는다는 결정에 응답한다.In some examples, the memory security circuitry responds to a determination that an additional slice of the instruction fetch address has a value other than a predetermined value to determine that the source region identifier is a default source region identifier.
명령어 페치 어드레스의 추가 슬라이스를 식별하고, 이를 사용하여 소스 영역 식별자에 대한 추가 정보를 제공하는 것이 유용할 수 있다. 예를 들어, 이 추가 슬라이스가 특정 값(또는 일부 미리 결정된 값 이외의 값)을 유지하면, 디폴트 소스 영역 식별자가 사용될 것으로 결정될 수 있다. 이는 어떤 메모리의 영역이 어떤 소스 영역 식별자와 연관되는지에 추가적인 유연성을 제공한다. 예를 들어, 이 접근법은 어드레스 공간의 특정 더 큰 영역에 대해서만 영역 식별이 일어나도록 요구하여, (예를 들어) 애플리케이션이 다수의 영역이 그로부터 분할된 "주변(ambient)" 어드레스 공간(예를 들어, 디폴트 소스 영역 식별자가 0인)에서 동작할 수 있게 하는데 사용될 수 있다. 이렇게 하면 프로세스/애플리케이션 내에서 샌드박싱을 위한 어드레스 공간의 작은 영역 세트를 선택할 수 있지만, 어드레스 공간의 대부분은 애플리케이션에서 임의의 신뢰도가 낮은 컴포넌트를 위한 것이다. 이 주변 어드레스 공간을 제공하기 위해 마스크로서 추가 슬라이스를 사용하는 것은, 그것이 마이크로아키텍처의 프론트-엔드에서 적용될 수 있는 간단한 마스크이기 때문에, 작은 하드웨어 비용만을 가지며, 이는 장치의 나머지(예를 들어, CPU 파이프라인)가 소스 영역 식별자를 사전에 통지받을 수 있다는 것을 의미한다.It may be useful to identify an additional slice of the instruction fetch address, and use this to provide additional information about the source region identifier. For example, if this additional slice holds a particular value (or a value other than some predetermined value), it may be determined that the default source region identifier will be used. This provides additional flexibility in which regions of memory are associated with which source region identifiers. For example, this approach could be used to require that region identification only occur for certain larger regions of the address space, allowing (for example) an application to operate in an "ambient" address space from which multiple regions are partitioned (for example, having a default source region identifier of 0). This allows a small set of regions of the address space to be selected for sandboxing within the process/application, but the bulk of the address space is reserved for arbitrary, less-trusted components in the application. Using an additional slice as a mask to provide this peripheral address space has only a small hardware cost, since it is a simple mask that can be applied in the front-end of the microarchitecture, meaning that the rest of the device (e.g. the CPU pipeline) can be informed of the source region identifier in advance.
위의 예에서, 명령어의 미리 결정된 슬라이스가 소스 영역 식별자를 결정하기 위해 사용되는 방식은 특별히 제한되지 않는다. 그러나, 특정 예에서, 미리 결정된 슬라이스는 소스 영역 식별자로서 직접 사용될 수 있다. 이는, 예를 들어, 미리 결정된 슬라이스가 (예를 들어, 미리 결정된 슬라이스에 일부 함수를 적용함으로써, 또는 미리 결정된 슬라이스를 사용하여 소스 영역 식별자를 결정하기 위해 저장 구조를 조회함으로써) 식별자를 간접적으로 결정하는 데 사용되는 대안적인 접근법보다 덜 복잡한 회로부를 필요로 하는 접근법을 제공한다. 그러나, 미리 결정된 슬라이스를 소스 영역 식별자로 직접 사용하는 것의 단점은 어떤 영역 또는 메모리를 어떤 소스 영역 식별자에 할당할지에 대한 유연성이 떨어진다는 것일 수 있다.In the above examples, the manner in which a predetermined slice of an instruction is used to determine a source region identifier is not particularly restricted. However, in certain instances, the predetermined slice may be used directly as a source region identifier. This provides an approach that requires less complex circuitry than, for example, alternative approaches in which the predetermined slice is used to indirectly determine the identifier (e.g., by applying some function to the predetermined slice, or by querying a storage structure to determine the source region identifier using the predetermined slice). However, a disadvantage of directly using a predetermined slice as a source region identifier may be that it provides less flexibility in which region or memory is assigned to which source region identifier.
일부 예에서, 명령어 페치 어드레스는 가상 어드레스를 포함하고, 명령어 페치 회로부는 명령어 페치 어드레스의 주어진 부분에 대한 의존에 따라 명령어를 페치하도록 구성되고, 명령어 페치 어드레스의 주어진 부분은 명령어가 저장되는 메모리 내의 위치를 나타내고, 여기서 명령어 페치 어드레스의 주어진 부분 및 명령어 페치 어드레스의 미리 결정된 슬라이스는 적어도 하나의 비트만큼 중첩한다.In some examples, the instruction fetch address includes a virtual address, the instruction fetch circuitry is configured to fetch an instruction depending on a given portion of the instruction fetch address, the given portion of the instruction fetch address indicating a location in memory where the instruction is stored, and wherein the given portion of the instruction fetch address and the predetermined slice of the instruction fetch address overlap by at least one bit.
일부 아키텍처에서, 프로세스는 가상 어드레스를 사용하여 메모리 내의 위치를 참조할 수 있으며, 이는 메모리 내의 위치를 식별하는 물리적 어드레스로 변환될 수 있다. 이는, 예를 들어, 각각이 물리적 어드레스 공간에 대한 고유한 매핑을 갖는 다수의 상이한 가상 어드레스 공간이 정의될 수 있게 한다. 예를 들어, 상이한 프로세스는 상이한 가상 어드레스 공간을 가질 수 있다.In some architectures, a process can use a virtual address to refer to a location in memory, which can be translated into a physical address that identifies the location in memory. This allows, for example, multiple different virtual address spaces to be defined, each with its own unique mapping to a physical address space. For example, different processes can have different virtual address spaces.
이는 다수의 상이한 가상 어드레스가 동일한 물리적 어드레스 상에 매핑되는 상황으로 이어질 수 있다 - 예를 들어, 상이한 가상 어드레스 공간을 갖는 다수의 상이한 프로세스가 코드의 공유 라이브러리 내의 주어진 명령어에 액세스하려고 하는 경우, 각각은 상이한 가상 어드레스를 사용하여 해당 명령어를 참조할 수 있다. 이를 앨리어싱(aliasing)이라고 한다. 그러나, 앨리어싱은 장치의 성능에 영향을 줄 수 있다 - 예를 들어, 변환 색인 버퍼(translation lookaside buffer) 또는 명령어 캐시의 엔트리는 가상 어드레스에 의해 인덱싱되고/되거나 태깅될 수 있으며, 이는 각각의 앨리어싱 가상 어드레스가 상이한 엔트리에 매핑됨을 의미한다. 이는 동일한 명령/변환의 다수의 사본이 캐시/TLB의 별도의 엔트리에 저장되고, 그렇지 않으면 다른 명령어를 저장하는 데 사용될 수 있는 공간을 차지하게 될 수 있다.This can lead to a situation where multiple different virtual addresses are mapped onto the same physical address - for example, if multiple different processes with different virtual address spaces want to access a given instruction within a shared library of code, each may use a different virtual address to reference that instruction. This is called aliasing. However, aliasing can impact the performance of the device - for example, entries in the translation lookaside buffer or instruction cache may be indexed and/or tagged by virtual address, meaning that each aliased virtual address maps to a different entry. This can result in multiple copies of the same instruction/translation being stored in separate entries in the cache/TLB, taking up space that could otherwise be used to store other instructions.
앨리어싱을 허용하지 않음으로써 - 예를 들어, 명령어 페치 어드레스의 주어진 부분이 특정 물리적 어드레스에 각각의 가상 어드레스 매핑에 대해 동일하도록 요구함으로써, 이러한 문제를 해결할 수 있다. 그러나, 주어진 부분에서, 앨리어싱 가상 어드레스의 특정 인스턴스가 어느 프로세스/코드의 섹션으로부터 기원하는지를 나타내는 일부 정보를 유지하는 것이 유용할 수 있다. 이를 해결하기 위해, 본 기술의 발명자는 주어진 부분의 하나 이상의 비트(해당 물리적 어드레스를 식별하는 데 사용됨)가 미리 결정된 슬라이스의 하나 이상의 비트(소스 영역 식별자를 결정하는 데 사용됨)와 중첩하게 하는 것을 제안한다. 이러한 비트는, 예를 들어, 앨리어싱 가상 어드레스에 대해 상이할 수 있는 반면, 주어진 부분의 다른 비트는 동일하게 유지된다. 이는, 캐시와 같은 구조가 중첩 비트를 제외한 주어진 부분에 기초하여 조회될 수 있게 하여, 주어진 물리적 어드레스로부터의 명령어의 오직 하나의 사본이 캐시에 저장되는 한편, 앨리어싱 어드레스를 구별하기 위한 정보를 그대로 유지할 수 있다.This problem can be addressed by disallowing aliasing - for example, by requiring that a given portion of an instruction fetch address be the same for each virtual address mapping to a particular physical address. However, it may be useful to maintain some information in a given portion that indicates which process/section of code a particular instance of an aliasing virtual address originates from. To address this, the inventors of the present technology propose that one or more bits of a given portion (used to identify the corresponding physical address) overlap one or more bits of a predetermined slice (used to determine the source region identifier). These bits may be different for the aliasing virtual address, for example, while the other bits of the given portion remain the same. This allows a cache-like structure to be looked up based on a given portion excluding the overlapping bits, so that only one copy of an instruction from a given physical address is stored in the cache, while still maintaining the information to distinguish the aliasing address.
일부 예에서, 메모리 보안 회로부는 다음 중 적어도 하나를 식별하는 권한 정보에 기초하여 요청이 금지되는지 여부를 결정하도록 구성된다:In some examples, the memory security circuitry is configured to determine whether a request is forbidden based on privilege information that identifies at least one of the following:
ㆍ 판독 액세스 권한;ㆍ Read access rights;
ㆍ 기록 액세스 권한;ㆍ Record access rights;
ㆍ 분기 수행을 위한 권한; 및ㆍ Authority to perform branching; and
ㆍ 반환 어드레스를 저장하지 않고 분기를 수행하기 위한 권한.ㆍ Permission to perform a branch without storing the return address.
따라서, 액세스 권한 정보는 판독, 기록 및 실행 명령어의 임의의 조합을 표시할 수 있고, 분기가 함수 호출로서 수행될 필요가 있을 때(반환 어드레스를 저장)를 추가로 표시할 수 있다.Thus, the access permission information can indicate any combination of read, write and execute instructions, and can additionally indicate when a branch needs to be performed as a function call (saving the return address).
일부 예에서, 메모리 보안 회로부는, 타겟 메모리 어드레스에 기초하여, 목적지 영역 식별자를 결정하도록 구성된다. 이러한 예에서, 메모리 보안 회로부는, 현재 영역 식별자 및 목적지 영역 식별자에 기초하여, 메모리 내의 권한 테이블을 조회하는 테이블 액세스 회로부를 포함하고, 권한 테이블은 권한 정보를 정의한다. 또한, 이러한 예에서, 테이블 액세스 회로부는 상이한 권한 정보가 상이한 목적지 영역 식별자와 현재 영역 식별자의 상이한 조합에 대해 정의되는 권한 테이블의 적어도 하나의 인코딩을 지원하도록 구성된다.In some examples, the memory security circuitry is configured to determine a destination region identifier based on a target memory address. In these examples, the memory security circuitry includes table access circuitry that queries a privilege table within the memory based on the current region identifier and the destination region identifier, the privilege table defining privilege information. Furthermore, in these examples, the table access circuitry is configured to support at least one encoding of the privilege table in which different privilege information is defined for different combinations of different destination region identifiers and current region identifiers.
이 예에서, 권한 테이블은, 현재 영역 식별자(명령어 페치 어드레스에 대한 의존에 따라 결정됨) 및 목적지 영역 식별자(타겟 메모리 어드레스에 대한 의존에 따라 결정됨) 둘 모두에 기초하여 조회된다는 점에서, 2차원 테이블인 것으로 간주될 수 있다. 이는 권한 정보가 현재 영역 식별자와 타겟 영역 식별자의 다수의 상이한 조합에 대해 정의되게 하여, 현재 실행 중인 코드 부분이 요청의 타겟 메모리 어드레스에 의해 표시된 특정 메모리 위치에 액세스/분기하도록 허용되는지를 결정할 수 있다. 이는 코드의 특정 영역이 메모리의 특정 영역에 대해 액세스가 허용되거나 거부되도록 할 수 있게 한다.In this example, the permission table can be considered a two-dimensional table in that it is queried based on both the current region identifier (which is determined based on the instruction fetch address) and the destination region identifier (which is determined based on the target memory address). This allows permission information to be defined for a number of different combinations of the current region identifier and the target region identifier, to determine whether the currently executing piece of code is allowed to access/branch to a particular memory location indicated by the target memory address of the request. This allows for certain sections of code to be allowed or denied access to certain sections of memory.
일부 예에서, 메모리 보안 회로부는 메모리 내에서 권한 정보를 정의하는 권한 테이블에 액세스하기 위한 테이블 액세스 회로부를 포함하고, 장치는 메모리 내의 권한 테이블의 위치를 나타내는 어드레스 정보를 저장하기 위한 테이블 식별 레지스터를 포함한다.In some examples, the memory security circuitry includes table access circuitry for accessing a permission table defining permission information within the memory, and the device includes a table identification register for storing address information indicating a location of the permission table within the memory.
예를 들어, 어드레스 정보는 메모리 내의 테이블의 기본 어드레스일 수 있다. 테이블 액세스 회로부는 메모리에서 테이블 위치를 찾기 위해 어드레스 정보를 사용한다.For example, the address information may be the base address of a table in memory. The table access circuitry uses the address information to locate the table in memory.
일부 예에서, 장치는 복수의 특권 레벨 중 하나에서 동작하도록 배열되고, 장치는 복수의 레지스터를 포함하고, 각각은 메모리 내의 해당 권한 테이블의 위치를 나타내는 어드레스 정보를 저장하도록 구성된다. 이러한 예에서, 장치는 또한, 현재의 특권 레벨에 기초하여, 복수의 레지스터 중 하나를 권한 테이블 식별 레지스터로서 선택하는 레지스터 선택 회로부를 포함한다.In some examples, the device is arranged to operate at one of a plurality of privilege levels, and the device includes a plurality of registers, each of which is configured to store address information indicating a location of a corresponding privilege table in memory. In such examples, the device also includes a register selection circuit that selects one of the plurality of registers as a privilege table identification register based on a current privilege level.
이 예에서, 각 특권 레벨에 대해 별도의 권한 테이블을 정의할 수 있다. 예를 들어, 커널에 대한 하나의 레지스터와 사용자 공간에 대한 하나의 레지스터가 있을 수 있다. 이는 예를 들어, 장치가 낮은 특권 레벨에서 동작하고 있을 때 더 제한적인 권한을 정의할 수 있게 한다.In this example, a separate permission table can be defined for each privilege level. For example, there could be one register for the kernel and one for user space. This allows, for example, more restrictive permissions to be defined when the device is operating at a lower privilege level.
일부 예에서, 메모리 보안 회로부는 메모리 내에서 권한 정보를 정의하는 권한 테이블에 액세스하기 위한 테이블 액세스 회로부를 포함하고, 장치는 현재 영역 식별자에 대한 권한 테이블에서 정의된 권한 정보를 나타내는 권한의 현재 세트를 저장하는 레지스터를 포함하고, 테이블 액세스 회로부는 새로운 영역 식별자에 기초하여, 식별자에 대한 권한 테이블 및 레지스터에 저장될 권한의 업데이트된 세트를 조회하기 위해 현재 영역 식별자가 새로운 영역 식별자로 변경되었다는 결정에 응답한다.In some examples, the memory security circuitry includes table access circuitry for accessing a privilege table defining privilege information within the memory, the device includes a register storing a current set of privileges representing privilege information defined in the privilege table for a current region identifier, and the table access circuitry is responsive to a determination that the current region identifier has changed to a new region identifier to query the privilege table and the register for the identifier, based on the new region identifier, for an updated set of privileges to be stored.
따라서, 현재 영역 식별자와 연관된 권한 정보는, 이 예에서, 감소된 레이턴시로 액세스될 수 있도록 레지스터에 로딩될 수 있다. 그 후, 현재 영역 식별자가 변경될 때마다, 레지스터에서의 권한 정보는 새로운 영역 식별자와 연관된 업데이트된 권한 세트로 대체될 수 있다.Therefore, the permission information associated with the current realm identifier can be loaded into a register so that it can be accessed with reduced latency, in this example. Then, whenever the current realm identifier changes, the permission information in the register can be replaced with the updated permission set associated with the new realm identifier.
레지스터의 포맷은 특별히 제한되지 않지만, 레지스터는 예를 들어, 복수의 타겟 영역 식별자 각각에 대한 필드를 포함할 수 있고, 각각의 필드는 해당 권한 정보(예를 들어, 판독 비트, 기록 비트 및 실행 비트와 같은 각각의 권한을 표시하기 위한 비트)를 저장할 수 있다.The format of the register is not particularly limited, but the register may include, for example, a field for each of a plurality of target region identifiers, and each field may store corresponding permission information (e.g., bits for indicating respective permissions, such as a read bit, a write bit, and an execute bit).
일부 예에서, 메모리 보안 회로부는 메모리 내에서 권한 정보를 정의하는 권한 테이블에 액세스하기 위한 테이블 액세스 회로부를 포함하고, 장치는 권한 테이블에서 정의된 권한의 서브세트를 저장하기 위한 캐시를 포함한다. 이러한 예에서, 장치는 각각 컨텍스트 식별자와 연관된 복수의 컨텍스트 중 하나에서 동작하도록 구성되고, 캐시는 각각 해당 컨텍스트 식별자와 연관된 복수의 엔트리를 포함한다.In some examples, the memory security circuitry includes table access circuitry for accessing a privilege table defining privilege information within the memory, and the device includes a cache for storing a subset of the privileges defined in the privilege table. In these examples, the device is configured to operate in one of a plurality of contexts, each of which is associated with a context identifier, and the cache includes a plurality of entries, each of which is associated with a corresponding context identifier.
따라서, 이 예에서, 일부 권한 정보는 캐싱될 수 있어서, 권한 정보에 대한 향후 액세스가 감소된 레이턴시로 수행될 수 있고, 따라서 성능을 개선한다. 또한, 각각의 엔트리를 컨텍스트 식별자(예를 들어, 이것은 가상 머신 식별자(VMID) 및 어드레스 공간 식별자(ASID)의 조합일 수 있음)와 연결하면, 컨텍스트 전환 시 캐시를 플러시할 필요가 없으므로 캐싱된 데이터가 나중에도 액세스를 위해 여전히 이용가능할 수 있기 때문에 성능을 향상시킨다.Thus, in this example, some of the entitlement information may be cached, so that future accesses to the entitlement information can be performed with reduced latency, thus improving performance. Additionally, associating each entry with a context identifier (for example, this could be a combination of a virtual machine identifier (VMID) and an address space identifier (ASID)) improves performance, since the cache does not need to be flushed on context switch, and cached data may still be available for later access.
일부 예에서, 장치는 복수의 현재 영역 식별자 각각에 대해, 해당 현재 영역 식별자에 대한 권한 정보를 나타내는 권한의 세트를 저장하는 레지스터를 포함하는 복수의 레지스터를 포함한다.In some examples, the device includes a plurality of registers, each register storing, for each of a plurality of current realm identifiers, a set of permissions representing permissions information for that current realm identifier.
이러한 레지스터는 메모리 내의 권한 테이블 대신 또는 이에 추가로 제공될 수 있다. 추가적인 레지스터를 추가하는 것은 장치에 의해 차지하는 회로 면적을 증가시킬 수 있지만, 그러한 레지스터는 감소된 레이턴시로 액세스 가능할 수 있기 때문에 유리할 수 있다(따라서 장치의 성능이 개선되게 한다).These registers may be provided in place of, or in addition to, the permission table in memory. Adding additional registers may increase the circuit area occupied by the device, but may be advantageous because such registers may be accessed with reduced latency (thus improving the performance of the device).
위의 예와 같이, 레지스터의 포맷은 특별히 제한되지 않지만, 레지스터 각각은, 예를 들어, 복수의 타겟 영역 식별자 각각에 대한 필드를 포함할 수 있고, 각각의 필드는 해당 액세스 권한 정보를 저장한다.As in the example above, the format of the register is not particularly limited, but each register may include, for example, a field for each of a plurality of target area identifiers, each field storing corresponding access permission information.
위에서 논의된 기술은 위에서 설명된 명령어 페치 회로부, 처리 회로부 및 메모리 보안 회로부를 구현하는 회로 하드웨어를 갖는 하드웨어 장치에서 구현될 수 있다. 그러나 다른 예에서 동일한 기술은 타겟 코드로부터 명령어를 실행하기 위한 명령어 실행 환경을 제공하기 위해 호스트 데이터 처리 장치를 제어하기 위해 제공될 수 있는 컴퓨터 프로그램(예를 들어, 아키텍처 시뮬레이터 또는 모델)에서 구현될 수 있다. 이러한 명령어는, 일부 특정 예에서, 반환-공간-식별자 명령어, 시간 식별자 업데이트 명령어, 분기-및-변경-시간-식별자 명령어, 및 분기-및-유지-시간-식별자 명령어 중 임의의 것을 포함할 수 있다.The techniques discussed above may be implemented in a hardware device having circuit hardware implementing the instruction fetch circuitry, processing circuitry, and memory security circuitry described above. However, in another example, the same techniques may be implemented in a computer program (e.g., an architecture simulator or model) that may be provided to control a host data processing device to provide an instruction execution environment for executing instructions from target code. Such instructions may, in some specific examples, include any of a return-space-identifier instruction, a time-identifier update instruction, a branch-and-change-time-identifier instruction, and a branch-and-maintain-time-identifier instruction.
컴퓨터 프로그램은, 타겟 코드의 명령어를 페치하는 명령어 페치 프로그램 로직과, 해당 명령어에 응답하여 데이터 처리를 수행하도록 호스트 데이터 처리 장치를 제어하는 처리 프로그램 로직을 포함할 수 있다. 따라서, 명령어 페치 프로그램 로직은 위에서 설명한 바와 같이 하드웨어 장치의 명령어 페치 회로부의 기능을 에뮬레이션하고, 처리 프로그램 로직은 처리 회로부를 에뮬레이션한다.The computer program may include instruction fetch program logic for fetching instructions of target code, and processing program logic for controlling a host data processing device to perform data processing in response to the instructions. Accordingly, the instruction fetch program logic emulates the function of the instruction fetch circuitry of the hardware device as described above, and the processing program logic emulates the processing circuitry.
또한, 일부 예에서 위에서 설명한 레지스터의 일부 또는 전부가 에뮬레이션될 수 있으며, 특히, 프로그램은 프로그램에 의해 시뮬레이션되는 명령어 세트 아키텍처의 아키텍처 레지스터를 표현(에뮬레이팅)하는 (호스트 장치의 메모리 또는 아키텍처 레지스터 내의) 데이터 구조를 유지하는 레지스터 유지보수 프로그램 로직을 포함할 수 있다. 에뮬레이션된 레지스터는 위의 일부 예에서 설명된 복수의 레지스터 중 임의의 레지스터를 포함할 수 있다.Additionally, in some examples, some or all of the registers described above may be emulated, and in particular, the program may include register maintenance program logic that maintains data structures (either within memory of the host device or within architectural registers) that represent (emulate) architectural registers of the instruction set architecture being simulated by the program. The emulated registers may include any of the plurality of registers described in some examples above.
따라서 이러한 시뮬레이터 컴퓨터 프로그램은, 시뮬레이터 프로그램을 실행하는 호스트 컴퓨터에 이러한 피처를 제공하는 실제 하드웨어가 없을 수 있더라도, 시뮬레이터 컴퓨터 프로그램에서 실행되는 타겟 코드에, 타겟 명령어 세트를 직접 실행할 수 있는 실제 하드웨어 장치에 의해 제공되는 것과 유사한 명령어 실행 환경을 제공할 수 있다. 이는 실제로 해당 아키텍처를 지원하지 않는 호스트 플랫폼에서 하나의 명령어 세트 아키텍처에 대해 기록된 코드를 실행하는 데 유용할 수 있다. 또한, 시뮬레이터는 소프트웨어 개발이 새로운 아키텍처를 지원하는 하드웨어 디바이스의 개발과 병렬로 수행되는 동안 명령어 세트 아키텍처의 새로운 버전에 대한 소프트웨어를 개발하는 동안 유용할 수 있다. 이를 통해 시뮬레이터에서 소프트웨어가 개발되고 테스트될 수 있으므로 새로운 아키텍처를 지원하는 하드웨어 디바이스가 이용가능하기 전에 소프트웨어 개발을 시작할 수 있다.Thus, such a simulator computer program can provide, to the target code running on the simulator computer program, an instruction execution environment similar to that provided by an actual hardware device capable of directly executing the target instruction set, even if the host computer running the simulator computer program may not have the actual hardware providing such features. This can be useful for executing code written for one instruction set architecture on a host platform that does not actually support that architecture. Additionally, the simulator can be useful during the development of software for a new version of an instruction set architecture, while the software development is being done in parallel with the development of a hardware device supporting the new architecture. This allows software development to begin before the hardware device supporting the new architecture is available, since the software can be developed and tested on the simulator.
이제 도면을 참조하여 특정 실시예가 설명될 것이다.Specific embodiments will now be described with reference to the drawings.
도 1은 본 기술의 예가 구현될 수 있는 데이터 처리 장치(100)를 개략적으로 도시한다. 도면에 도시된 바와 같이, 데이터 처리 장치(100)는 (선택적으로 하나 이상의 캐시를 통해) 메모리로부터 명령어를 페치하기 위한 명령어 페치 회로부(105)를 포함한다. 페치 회로부(105)는 명령어 페치 어드레스에 의해 식별된 메모리 위치(예를 들어, 이들은 명령어가 저장되는 메모리 내의 위치를 정의하는 메모리 어드레스일 수 있음) 또는 하나 이상의 개재 캐시(도시되지 않음)로부터 명령어를 페치한다. 도 1의 예에서, 명령어 페치 회로부(105)에 의해 페치될 다음 명령어의 명령어 페치 어드레스는 이 예에서 제공된 레지스터(115)의 세트 중 하나인 프로그램 카운터(PC) 레지스터(110)에서 저장된다. PC 레지스터(110)는 페치될 다음 명령어를 식별하고, 따라서 명령어가 페치될 때마다 증분된다(따라서, 명령어는 프로그램 순서로 다음 명령어를 가리킨다). 레지스터 파일(115)은 또한, 이 예에서, 시간 영역 식별자(TRegionID)를 저장하는 시간 영역 식별자 레지스터(130)를 포함하는 다른 레지스터를 포함한다. 이것은 아래에서 더 상세히 개시될 것이다.FIG. 1 schematically illustrates a data processing device (100) in which an example of the present technology may be implemented. As depicted in the drawing, the data processing device (100) includes instruction fetch circuitry (105) for fetching instructions from memory (optionally via one or more caches). The fetch circuitry (105) fetches instructions from a memory location identified by an instruction fetch address (e.g., these may be memory addresses defining locations within memory where instructions are stored) or from one or more intervening caches (not shown). In the example of FIG. 1, the instruction fetch address of the next instruction to be fetched by the instruction fetch circuitry (105) is stored in a program counter (PC) register (110), which is one of a set of registers (115) provided in this example. The PC register (110) identifies the next instruction to be fetched, and is thus incremented each time an instruction is fetched (so that the instruction points to the next instruction in program order). The register file (115) also includes another register, which in this example includes a time domain identifier register (130) that stores a time domain identifier (TRegionID). This will be described in more detail below.
명령어 페치 회로부(105)는 명령어를 디코딩하고, 디코딩된 명령어를 실행하기 위해 처리 회로부(125)를 제어하기 위한 제어 신호를 처리 회로부(125)에 발행하는 명령어 디코드 회로부(120)에 명령어를 제공한다. 처리 회로부(125)는 레지스터(115)에 저장된 데이터를 참조하여 디코딩된 명령어를 실행한다(예를 들어, 처리 회로부는 레지스터로부터 데이터 처리 동작에 대한 피연산자를 판독하고 데이터 처리 동작의 결과를 레지스터에 저장할 수 있다).The instruction fetch circuit (105) decodes the instruction and provides the instruction to the instruction decode circuit (120), which issues a control signal to the processing circuit (125) to control the processing circuit (125) to execute the decoded instruction. The processing circuit (125) executes the decoded instruction by referring to data stored in the register (115) (for example, the processing circuit can read an operand for a data processing operation from the register and store a result of the data processing operation in the register).
처리 회로부(125)는 또한, 일부 명령어에 응답하여, 메모리에 저장된 데이터 또는 명령어에 액세스하기 위한 메모리 액세스 요청을 발행한다. 예를 들어, 처리 회로부(125)는 메모리로부터 레지스터로 데이터를 로드하거나 레지스터로부터 메모리로 데이터를 저장하기 위해 메모리 제어기(미도시)에 메모리 액세스 요청을 발행할 수 있다. 처리 회로부(125)는 또한, 분기 명령어와 같은 제어 흐름 명령어에 응답하여, 명령어 페치 회로부(105)에 의해 페치될 명령어의 흐름을 변경하기 위해 PC 레지스터(110)에 저장된 값을 업데이트할 수 있다.The processing circuitry (125) may also, in response to some instructions, issue a memory access request to access data or instructions stored in memory. For example, the processing circuitry (125) may issue a memory access request to a memory controller (not shown) to load data from memory to a register or to store data from a register to memory. The processing circuitry (125) may also, in response to a control flow instruction, such as a branch instruction, update a value stored in the PC register (110) to change the flow of instructions to be fetched by the instruction fetch circuitry (105).
이 예에서 데이터 처리 장치는 또한 메모리 보안 회로부(135)를 포함하며, 이는 아래에서 더 상세히 설명될 것이다.In this example, the data processing device also includes memory security circuitry (135), which will be described in more detail below.
많은 현대 하드웨어 및 소프트웨어 아키텍처에서, 메모리의 특정 영역으로/으로부터 데이터를 로딩하거나 저장하기 위한 판독 및 기록 권한과 메모리의 특정 영역으로부터 명령어를 페치하기 위한 실행 권한은 운영 체제에 의해 프로그래밍되고 메모리에 저장된 페이지 테이블(예를 들어, 멀티-레벨 페이지 테이블)에 설명된 권한에 의해 제어된다. 예를 들어, 메모리 제어기 또는 메모리 관리 유닛(데이터를 로딩/저장하기 위한 요청 및 명령어를 페치하기 위한 요청을 포함하는 메모리 액세스 요청에 응답하여 메모리에 대한 액세스를 제어함)은 페이지 테이블에 액세스하고 특정 액세스 요청에 대한 권한을 식별하기 위한 페이지 테이블 워크 회로부를 포함할 수 있다. 특히, 페이지 테이블은 관련 권한을 식별하기 위해 액세스 요청의 타겟 메모리 어드레스(예를 들어, 액세스될 데이터 또는 명령어의 어드레스)에 기초하여 조회된다. 따라서, 이러한 액세스 권한은 액세스 요청이 발행된 명령어에 기초하는 것이 아니라 액세스 요청의 타겟을 기반으로 하여 정의된다.In many modern hardware and software architectures, read and write permissions to load or store data to/from specific regions of memory, and execution permissions to fetch instructions from specific regions of memory, are controlled by permissions described in page tables (e.g., multi-level page tables) programmed by the operating system and stored in memory. For example, a memory controller or memory management unit (which controls access to memory in response to memory access requests, including requests to load/store data and requests to fetch instructions) may include page table walk circuitry to access a page table and identify permissions for a specific access request. In particular, the page table is queried based on the target memory address of the access request (e.g., the address of the data or instruction to be accessed) to identify the associated permissions. Thus, these access permissions are defined based on the target of the access request, not on the instruction with which the access request is issued.
어느 하나의 프로세스(또는 애플리케이션) 내에서, 해당 애플리케이션의 모든 코드는, 전형적인 데이터 처리 장치에서, 어드레스 공간의 임의의 메모리를 판독/기록/실행할 동등한 특권을 갖는다 - 예를 들어, 주어진 프로세스 내의 상이한 명령어는 전형적으로 동일한 권한을 갖는다. 위에서 설명된 바와 같이, 일부 아키텍처는 특정 권한이 취소되거나 수정되게 하는 CPU 레지스터의 프로그래밍에 따라 특정 권한을 동적으로 취소할 수 있는 "권한 오버레이" 또는 "권한 키" 메커니즘을 추가로 포함한다 - 예를 들어, 페이지 테이블 엔트리는 이러한 오버레이 비트/키로 주석을 달 수 있고, CPU 레지스터의 프로그래밍은 (예를 들어) 특정 키 값과 연관된 임의의 페이지에 대해 주어진 권한이 취소되어야 한다는 것을 나타낼 수 있다(예를 들어, "권한 키 2에 대한 판독 액세스를 취소한다"). 이를 통해 페이지 테이블에 정의된 액세스 권한을 수정할 수 있지만, 권한에 대한 시간적인 뷰만 제공한다. 본 기술의 발명자는 이것이, 예를 들어 제어 흐름 무결성의 손실이 있는 경우(예를 들어 제어 흐름이 예기치 않은 코드 영역으로 분기되도록 허용되는 경우)에 잠재적인 문제를 야기할 수 있다는 것을 인지했다.Within a process (or application), all code in that application, in a typical data processing device, has equal privileges to read/write/execute any memory in the address space - for example, different instructions within a given process typically have the same privileges. As described above, some architectures additionally include a "privilege overlay" or "privilege key" mechanism that allows certain privileges to be dynamically revoked based on the programming of CPU registers that cause certain privileges to be revoked or modified - for example, page table entries may be annotated with such overlay bits/keys, and the programming of CPU registers may indicate that a given privilege should be revoked for any page associated with a particular key value (e.g., "revoke read access to privilege key 2"). This allows for modification of access privileges defined in the page table, but only provides a temporal view of the privileges. The inventors of the present technology have recognized that this can cause potential problems, for example, in cases where there is a loss of control flow integrity (e.g., control flow is allowed to branch to an unexpected region of code).
도 2 내지 도 3은 이 문제가 어떻게 발생할 수 있는지를 설명하는 데 도움이 된다. 특히, 도 2a 및 도 2b는 특정 어드레스 공간(200)에 대해 정의할 수 있는 권한의 예를 도시한다. 도시된 바와 같이, 코드의 상이한 부분("코드 1", "코드 2", "코드 3") 및 상이한 데이터("데이터 A", "데이터 B")는 어드레스 공간의 상이한 영역에 저장될 수 있다. 이러한 상이한 영역 각각은 상이한 판독/기록 액세스 권한을 가질 수 있으며, 이는 추가로 임의의 특정 시점에서 실행 중인 코드에 따라 달라질 수 있다. 예를 들어, 도 2a에 도시된 바와 같이, 코드 영역 1(코드 1)로부터 페치된 명령어는 데이터 영역 A(데이터 A)에 대한 판독(R) 및 기록(W) 액세스(예를 들어, 데이터를 로드하고 저장하기 위한 권한)를 가질 수 있지만, 데이터 영역 B(데이터 B)에 저장된 데이터에는 액세스할 수 없다. 한편, 코드 영역 3(코드 3)은 데이터 영역 A에 대한 판독 전용(RO) 액세스 및 데이터 영역 B에 대한 판독 및 기록 액세스를 가질 수 있다.Figures 2 and 3 are helpful in explaining how this issue may arise. In particular, Figures 2a and 2b illustrate examples of permissions that may be defined for a particular address space (200). As illustrated, different portions of code (“
유사하게, 도 2b에 도시된 바와 같이, 각각의 코드 영역은 상이한 실행 액세스 권한을 가질 수 있다(예를 들어, 주어진 코드 부분으로부터의 명령어가 상이한 코드 부분에서의 명령어로 분기하도록 허용되는지 여부를 정의함). 예를 들어, 이 예에서, 코드 영역 1로부터의 명령어는, 코드 영역 2 및 코드 영역 4(코드 4)에서의 명령어로 분기되는 것이 허용되는 반면, 코드 영역 3으로부터의 명령어는 코드 영역 2에서의 명령어로 분기되는 것이 허용되지만 코드 영역 4에서의 명령어로는 분기되지 않는다.Similarly, as illustrated in FIG. 2b, each code region may have different execution access permissions (e.g., defining whether instructions from a given code portion are allowed to branch to instructions in different code portions). For example, in this example, instructions from
위에 정의된 권한 오버레이 메커니즘이 예를 들어, 하나의 코드 영역으로부터 스위칭할 때 오버레이 해석 레지스터의 콘텐츠를 변경함으로써 이러한 권한을 수행하는 데 사용될 수 있다는 것을 예상할 수 있다. 그러나, 이 메커니즘은 도 3a 및 3b를 참조하여 아래에서 설명될 것과 같이, 제어 흐름 무결성의 손실이 있는 경우에 효과가 떨어진다.It can be expected that the privilege overlay mechanism defined above could be used to exercise such privileges, for example by changing the contents of the overlay interpretation register when switching from one code region to another. However, this mechanism is less effective in cases where there is a loss of control flow integrity, as will be described below with reference to Figures 3a and 3b.
도 3a 및 도 3b는 상이한 코드 영역으로부터의 명령어가 어떻게 실행될 수 있는지의 예를 도시한다. 도 3a는 예상되는 명령어 흐름의 예를 도시한다. 도시된 바와 같이, 코드 영역 3에서 코드 영역 1로 전환하기 전에, 구성 레지스터를 업데이트하기 위한 명령어가 실행되어, 오버레이 비트와 조합하여 페이지 테이블에 의해 정의된 액세스 권한이 업데이트된다. 이 업데이트에 후속하여, 코드 영역 1로부터의 명령어(명령어 C)가 실행되어, 처리 회로부가 영역 B에서 데이터를 판독하기 위한 액세스 요청을 발행하게 한다. 그러나, 오버레이 비트 및 페이지 테이블에서의 권한과 조합된 구성 레지스터는 데이터 영역 B에 대한 판독 액세스가 금지되고, 따라서 액세스 요청이 거부된다는 것을 나타낸다.Figures 3a and 3b illustrate examples of how instructions from different code regions may be executed. Figure 3a illustrates an example of the expected instruction flow. As illustrated, prior to transitioning from
그러나, 도 3b는 제어 흐름 무결성의 손실이 어떻게 데이터 무결성의 손실로 이어질 수 있는지를 도시한다. 예를 들어, 도 3b는 코드 영역 3으로부터의 명령어가 코드 영역 1에 대한 명령어로 예기치 않게 분기되는 경우 발생할 수 있는 상황을 도시한다. 이 경우, 명령어 A는 구성 레지스터가 업데이트되지 않고 명령어 C로 분기된다. 즉, 명령어 C가 실행될 때, 구성 레지스터가 페이지 테이블과 조합하여 정의된 권한이 코드 영역 3에 대한 권한과 동일하게 유지된다. 코드 영역 3으로부터의 명령어는 데이터 영역 A에 대한 판독 및 기록 액세스 양자 모두에 대해 허용되므로, 데이터 영역 B에 대한 판독 액세스도 허용된다. 따라서, 제어 흐름 무결성의 손실로 인해, 데이터 영역 B에 저장된 데이터의 무결성 또는 기밀성이 손실될 수 있다. 즉, 데이터 영역 B에 저장된 데이터의 무결성/기밀성은 유지되는 제어 흐름 무결성에 따라 달라진다.However, Fig. 3b illustrates how a loss of control flow integrity can lead to a loss of data integrity. For example, Fig. 3b illustrates a situation that can occur when an instruction from
본 기술은 이러한 문제를 해결하기 위한 메커니즘을 제공한다. 특히, 본 기술은 특정 메모리 위치(판독, 기록 또는 실행 액세스 여부)에 대한 액세스를 요청하는 명령어의 명령어 페치 어드레스에 따라 달라지는 소스 영역 식별자(공간 영역 식별자, SRegionID로도 지칭됨)를 정의한다. 이를 통해 액세스 권한 정보가 단지 액세스 요청의 목적지 및/또는 액세스 요청의 타이밍에만 의존하지 않고, 액세스 요청의 소스에 대한 의존에 따라 정의되게 한다.The present technique provides a mechanism to address these issues. In particular, the technique defines a source region identifier (also referred to as a space region identifier, SRegionID) that depends on the instruction fetch address of the instruction requesting access to a particular memory location (whether a read, write or execute access). This allows access permission information to be defined based on the source of the access request, rather than just on the destination of the access request and/or the timing of the access request.
예를 들어, 도 4는 (PC 레지스터로부터 획득될 수 있는) 명령어 페치 어드레스에 기초하여 공간 영역 식별자(SRegionID)가 어떻게 결정될 수 있는지를 도시한다. 공간 영역 식별자는 처리 회로부에 의해 발행된 메모리 액세스 요청에 응답하여 메모리 보안 회로부(135)에 의해 결정될 수 있다.For example, FIG. 4 illustrates how a space region identifier (SRegionID) may be determined based on an instruction fetch address (which may be obtained from the PC register). The space region identifier may be determined by the memory security circuitry (135) in response to a memory access request issued by the processing circuitry.
도 4에서, 64-비트 명령어 페치 어드레스가 도시되어 있지만, 이는 단지 예시일 뿐이라는 것을 이해할 것이다 - 명령어 페치 어드레스는 구현에 따라 크기가 달라질 수 있지만, 도 4에 도시된 예는 64-비트 이상의 어드레스 폭과 같은 더 큰 어드레스 폭을 이용하는 아키텍처에 더 적합할 수 있다. 공간 영역 식별자는 명령어 페치 어드레스의 선택된 부분에 기초하여 결정되며, 메모리 보안 회로부(135)의 일부 상태(예를 들어, 레지스터)(400)는 명령어 페치 어드레스의 어느 비트가 사용될지를 나타낸다 - 예를 들어, 메모리 보안 회로부의 상태(400)는 사용될 부분의 제1 및 마지막 비트 위치, 또는 제1/마지막 비트 위치 및 부분의 크기를 나타낼 수 있다. 대안적인 예에서, 사용될 명령어 페치 어드레스의 부분은 구성 레지스터에서 프로그래밍 가능하기보다는 하드와이어링될 수 있다.In FIG. 4, a 64-bit instruction fetch address is shown, but it will be appreciated that this is merely an example - the instruction fetch address may vary in size depending on the implementation, but the example shown in FIG. 4 may be better suited to architectures utilizing larger address widths, such as greater than 64 bits. The space region identifier is determined based on a selected portion of the instruction fetch address, and some state (e.g., a register) (400) of the memory security circuitry (135) indicates which bits of the instruction fetch address are to be used - for example, the state (400) of the memory security circuitry may indicate the first and last bit positions of the portion to be used, or the first/last bit positions and the size of the portion. In an alternative example, the portion of the instruction fetch address to be used may be hardwired rather than programmable in a configuration register.
도 4는 64-비트 PC의 전형적인 포맷의 예를 "A"에서 도시한다. 도면은 또한 공간 영역 식별자로서 또는 이를 도출하기 위해 사용될 명령어 페치 어드레스의 부분의 3개의 예(B, C, D)를 도시한다. 모든 4개의 예에서, 명령어 페치 어드레스는 다수의 표준/태그 비트, 및 명령이 저장되는 메모리의 위치를 정의하는 유용한 VA(가상 어드레스) 비트를 포함한다. 예(B, C 및 D)는 각각 공간 영역 식별자를 도출하는 데 사용될 부분(SRegionID)을 포함한다. 이 예는 공간 영역 식별자를 결정하기 위해 사용되는 가상 명령어 페치 어드레스를 도시하지만, 이는 물리적 어드레스가 대신 사용될 수 있음을 유의해야 한다.Figure 4 illustrates an example of a typical format for a 64-bit PC at "A". The figure also illustrates three examples (B, C, and D) of portions of an instruction fetch address that would be used as or to derive a space region identifier. In all four examples, the instruction fetch address includes a number of standard/tag bits, and useful VA (virtual address) bits that define the location in memory where the instruction is stored. Examples (B, C, and D) each include a portion (SRegionID) that would be used to derive the space region identifier. It should be noted that while these examples illustrate a virtual instruction fetch address that would be used to determine a space region identifier, a physical address could be used instead.
제1 예(A)는 전형적인 명령어 페치 어드레스의 예를 도시한다. 표준/태그 비트는 명령어 페치 어드레스의 비트 위치(63:49)를 차지하고, 나머지 비트(48:0)는 모두 유용한 VA 비트이다.Example 1 (A) illustrates an example of a typical instruction fetch address. The standard/tag bits occupy bit positions (63:49) of the instruction fetch address, and the remaining bits (48:0) are all useful VA bits.
제2 예(B)에서, 동일한 비트(63:49)가 표준/태그 비트로서 사용되지만, 비트(44:38)는 공간 영역 식별자를 도출하는 데 사용된다. 이 예에서, 추가 상수는 추가 정보를 제공할 수 있는 비트 위치(48:45)에서 정의된다 - 예를 들어, 메모리 보안 회로부는, 상수가 특정 값을 가질 때, 디폴트 공간 영역 식별자가 사용되어야 하는지를 결정하도록 배열될 수 있다. 이렇게 하면 유용한 VA 비트를 정의하는 비트(37:0)가 남는다.In the second example (B), the same bits (63:49) are used as the standard/tag bits, but bits (44:38) are used to derive the space area identifier. In this example, an additional constant is defined at bit positions (48:45) that can provide additional information - for example, the memory security circuitry could be arranged to determine whether the default space area identifier should be used when the constant has a particular value. This leaves bits (37:0) to define useful VA bits.
제3 예(C)에서, 동일한 비트(63:49)가 표준/태그 비트로서 다시 사용되지만, 비트(48:45)는 공간 영역 식별자를 도출하는 데 사용된다. 이렇게 하면 유용한 VA 비트를 정의하는 비트(44:0)가 남는다.In the third example (C), the same bits (63:49) are reused as standard/tag bits, but bits (48:45) are used to derive the spatial domain identifier. This leaves bits (44:0) to define useful VA bits.
제4 예(D)에서, 비트 위치(63:55)는 공간 영역 식별자를 도출하는데 사용되며, 표준/태그 비트의 수는 비트 위치(54:49)를 차지하도록 감소된다. 이렇게 하면 유용한 VA 비트를 정의하는 비트(48:0)가 남는다.In Example 4 (D), bit positions (63:55) are used to derive the spatial domain identifier, and the number of standard/tag bits is reduced to occupy bit positions (54:49). This leaves bits (48:0) to define useful VA bits.
모든 예(B) 내지 예(D)에서, 명령어 페치 어드레스의 비트의 선택은 공간 영역 식별자를 결정하는 데 사용되어, 공간 영역 식별자는 메모리 액세스 요청의 목적지(예를 들어, 액세스될 데이터 또는 명령어의 타겟 어드레스)가 아닌, 메모리 액세스 요청의 소스(예를 들어, 메모리 액세스 요청을 발행시킨 명령어의 명령어 페치 어드레스에 따라 다름)에 따라 달라진다. 선택된 비트가 공간 영역 식별자를 결정하기 위해 사용되는 방식은 특별히 제한되지 않는다. 일부 예에서, 선택된 비트는 공간 영역 식별자로서 직접 사용될 수 있는 반면, 다른 예에서, 선택된 비트는 일부 다른 방식으로 메모리 보안 회로부에 의해 공간 영역 식별자로 매핑될 수 있다.In all examples (B) through (D), selection of bits of the instruction fetch address is used to determine a spatial region identifier, such that the spatial region identifier depends on the source of the memory access request (e.g., the instruction fetch address of the instruction that issued the memory access request) rather than on the destination of the memory access request (e.g., the target address of the data or instruction to be accessed). The manner in which the selected bits are used to determine the spatial region identifier is not particularly limited. In some examples, the selected bits may be used directly as spatial region identifiers, while in other examples, the selected bits may be mapped to spatial region identifiers by the memory security circuitry in some other manner.
일부 예에서, SRegionID 부분 및 유용한 VA 비트는 다수의 비트만큼 중첩될 수 있다(예를 들어, 다수의 비트가 SRegionID를 결정하고 명령어가 저장되는 메모리 내의 위치를 결정하기 위해 둘 다 사용됨). 전술한 바와 같이, 이는 소프트웨어가 앨리어싱 가상 어드레스 사이에서 모든 다른 VA 비트를 일정하게 유지해야 하는 상황에서, 앨리어싱 가상 어드레스 사이를 구별하기 위한 메커니즘을 제공할 수 있다. 또한, 일부 예에서, 유용한 VA 비트는 SRegionID 비트의 전부를 포함할 수 있다.In some instances, the SRegionID portion and the useful VA bits may overlap by a number of bits (e.g., multiple bits are used both to determine the SRegionID and to determine the location in memory where the instruction is stored). As noted above, this may provide a mechanism for distinguishing between aliased virtual addresses in situations where software must keep all other VA bits constant between aliased virtual addresses. Furthermore, in some instances, the useful VA bits may include all of the SRegionID bits.
일부 예에서, 아키텍처는 명령어 페치 어드레스에 기초하여 SRegionID를 결정하기 위한 다수의 기술을 지원할 수 있다. 예를 들어, 도 4에 도시된 접근법 중 2개 이상이 지원될 수 있다 - 예를 들어, PC 비트 레지스터(400)는 SRegionID 슬라이스로 처리될 비트가 프로그래밍 가능하도록 구성 가능할 수 있다.In some examples, the architecture may support multiple techniques for determining the SRegionID based on the instruction fetch address. For example, more than one of the approaches illustrated in FIG. 4 may be supported - for example, the PC bit register (400) may be configurable to program which bits are to be addressed by the SRegionID slice.
또한, 아키텍처에 의해, SRegionID를 결정하기 위해 명령어 페치 어드레스의 슬라이스의 사용을 지원하는 것 이외에 추가적인 메커니즘이 지원될 수 있다. 이는 아키텍처를 사용하는 칩 설계자에게 추가적인 유연성을 제공할 수 있다. 예를 들어, 도 5는 공간 영역 식별자를 결정하기 위한 다른 접근법을 도시한다. 특히, 도 5에 도시된 바와 같은 메모리 보안 회로부(135)는 어드레스 공간의 상이한 영역(예를 들어, 가상 또는 물리적)을 영역 식별자에 매핑하는 레지스터의 세트(500)를 포함한다. 도 5에 도시된 특정 예에서, 레지스터의 쌍이 복수의 공간 영역 식별자 각각에 제공되며, 이 쌍은 메모리 내의 해당 영역의 기본 어드레스를 식별하는 기본 어드레스 레지스터(505) 및 메모리 내의 해당 영역의 크기를 식별하는 크기 레지스터(510)를 포함한다. 이 예에서, 메모리 보안 회로부는 명령어 페치 어드레스의 전부 또는 일부를 레지스터에 의해 표시된 기본 어드레스 및 크기와 비교하여, 명령어 페치 어드레스가 어느 영역에 속하는지를 결정하도록 배열된다. 공간 영역 식별자는 그 다음에 해당 영역에 해당하는 식별자이다.Additionally, additional mechanisms may be supported by the architecture in addition to supporting the use of slices of instruction fetch addresses to determine SRegionIDs. This may provide additional flexibility to chip designers using the architecture. For example, FIG. 5 illustrates another approach to determining a spatial region identifier. In particular, the memory security circuitry (135) illustrated in FIG. 5 includes a set of registers (500) that map different regions (e.g., virtual or physical) of the address space to region identifiers. In the particular example illustrated in FIG. 5, a pair of registers is provided for each of a plurality of spatial region identifiers, the pair including a base address register (505) that identifies a base address of the corresponding region within memory, and a size register (510) that identifies a size of the corresponding region within memory. In this example, the memory security circuitry is arranged to compare all or part of the instruction fetch address to the base address and size indicated by the registers to determine which region the instruction fetch address belongs to. The spatial region identifier is then an identifier corresponding to the corresponding region.
각각의 영역의 크기는, 예를 들어, 해당 영역의 메모리의 바이트 수, 메모리 영역의 페이지의 수, 영역 식별의 일부로서 마스킹 아웃할 기본 어드레스의 비트 수, 또는 메모리의 영역의 엔드 어드레스로서 표시될 수 있다는 점에 유의한다.Note that the size of each region may be expressed as, for example, the number of bytes of memory in that region, the number of pages in the memory region, the number of bits in the base address to mask out as part of region identification, or the end address of the region of memory.
도 6은 아키텍처에서 지원될 수 있는 다른 추가적인 메커니즘을 도시한다. 이 예에서, 메모리 보안 회로부(135)는 테이블 액세스 회로부(SRegionID 테이블 액세스 회로부, 공간 영역 식별자 테이블 액세스 회로부, 또는 소스 영역 식별자 테이블 액세스 회로부로도 지칭됨)(600)를 포함한다. SRegionID 테이블 액세스 회로부는 메모리 액세스 요청이 발행되게 한 명령어의 명령어 페치 어드레스에 기초하여, 메모리(605) 내의 테이블을 조회하기 위한 메모리 액세스 요청에 응답한다. 테이블(610)은 명령어 페치 어드레스에 대한 공간 영역 식별자의 매핑을 정의한다.FIG. 6 illustrates another additional mechanism that may be supported in the architecture. In this example, the memory security circuitry (135) includes table access circuitry (also referred to as SRegionID table access circuitry, spatial region identifier table access circuitry, or source region identifier table access circuitry) (600). The SRegionID table access circuitry responds to a memory access request to query a table in memory (605) based on the instruction fetch address of the instruction that caused the memory access request to be issued. The table (610) defines a mapping of spatial region identifiers to instruction fetch addresses.
메모리 내의 테이블이 공간 영역 식별자에 대한 명령어 페치 어드레스의 매핑을 정의하는데 사용될 때, 도 6에 도시된 예에서와 같이, 메모리 보안 회로부는 또한 메모리 내의 테이블로부터 데이터를 캐싱하기 위한 하나 이상의 캐시를 포함할 수 있다.When a table in memory is used to define the mapping of instruction fetch addresses to space region identifiers, as in the example illustrated in FIG. 6, the memory security circuitry may also include one or more caches for caching data from the table in memory.
따라서, 공간 영역 식별자는 메모리 액세스의 소스에 따라 달라지므로, 소스 영역 식별자로도 지칭될 수 있다. 이어서, 공간 영역 식별자에 따라 달라지는 (그리고 선택적으로 또한 메모리 액세스의 타겟 어드레스에 따라 달라질 수 있는) 메모리 액세스 권한의 세트(예를 들어, 판독/기록 권한)가 정의될 수 있다. 이러한 권한은 페이지 테이블에 정의된 권한 외에도 정의될 수 있다.Therefore, since the space region identifier varies depending on the source of the memory access, it may also be referred to as a source region identifier. Then, a set of memory access permissions (e.g., read/write permissions) may be defined that vary depending on the space region identifier (and optionally may also vary depending on the target address of the memory access). These permissions may be defined in addition to the permissions defined in the page table.
또한, 위의 논의의 대부분은 메모리 액세스(예를 들어, 메모리로부터/로의 데이터 또는 명령어의 로드 및 저장)에 대해 정의된 권한에 초점을 맞추지만, 실행 권한은 또한 공간 영역 식별자에 대한 의존에 따라 정의될 수 있다 - 예를 들어, 분기 명령어의 공간 영역 식별자는 분기가 허용되는지 여부를 결정하는 데 사용될 수 있다.Also, while most of the above discussion focuses on permissions defined for memory accesses (e.g., loading and storing data or instructions from/to memory), execution permissions can also be defined based on their dependence on space-area identifiers - for example, the space-area identifier of a branch instruction could be used to determine whether the branch is permitted.
액세스 권한은 또한, 도 1에 도시된 시간 식별자 레지스터(130)에 저장될 수 있는 시간 영역 식별자(TRegionID)에 따라 달라질 수 있다. 이 레지스터는 소프트웨어 액세스 가능할 수 있으며, 이 경우 시간 영역 식별자는 처리 회로부에 의해 실행되는 명령어에 의해 업데이트될 수 있다. 특정 예에서, 공간 영역 식별자(SRegionID) 및 시간 영역 식별자(TRegionID)의 연결인 영역 식별자(RegionID)가 정의된다.Access rights may also depend on a time region identifier (TRegionID) that may be stored in a time identifier register (130) as illustrated in FIG. 1. This register may be software accessible, in which case the time region identifier may be updated by instructions executed by the processing circuitry. In a specific example, a region identifier (RegionID) is defined, which is a concatenation of a space region identifier (SRegionID) and a time region identifier (TRegionID).
도 7은 영역 식별자에 기초하여 판독, 기록 및 실행 권한을 정의하는 방법의 예를 도시한다. 이러한 특정 예에서, 주어진 메모리 액세스 요청 또는 분기 요청에 대한 액세스 권한은 현재 영역 식별자(예를 들어, 요청 명령어의 공간 영역 식별자 및 현재 시간 영역 식별자의 연결) 및 타겟 영역 식별자(예를 들어, 타겟 어드레스의 공간 영역 식별자 및 현재 시간 식별자의 연결)의 다수의 조합 각각에 대해 정의된다. 따라서, 도 7에 도시된 테이블은 현재 영역 식별자와 타겟 영역 식별자 모두에 의해 조회되기 때문에 2차원(2D) 테이블이라고 간주될 수 있다.Figure 7 illustrates an example of a method for defining read, write, and execute permissions based on region identifiers. In this particular example, access permissions for a given memory access request or branch request are defined for each of a plurality of combinations of a current region identifier (e.g., a concatenation of a spatial region identifier of the requesting instruction and a current time region identifier) and a target region identifier (e.g., a concatenation of a spatial region identifier of the target address and a current time identifier). Therefore, the table illustrated in Figure 7 may be considered a two-dimensional (2D) table since it is queried by both the current region identifier and the target region identifier.
테이블에서, "RW"는 판독 및 기록 액세스가 허용됨을 나타내고, "RO"는 판독 액세스가 허용되지만 기록 액세스가 허용되지 않음을 나타내고, "X"는 분기가 허용됨을 나타내고, "XL"은 함수 호출(반환 어드레스가 저장된 분기, 예를 들어, 링크 레지스터에)은 허용되지만 다른 종류의 분기는 허용되지 않음을 나타낸다. 대시 "-"는 액세스가 허용되지 않음을 나타낸다.In the table, "RW" indicates that read and write accesses are allowed, "RO" indicates that read accesses are allowed but write accesses are not allowed, "X" indicates that branches are allowed, and "XL" indicates that function calls (branches where the return address is stored, e.g., in the link register) are allowed but other kinds of branches are not allowed. A dash "-" indicates that no access is allowed.
테이블(예를 들어, 권한 테이블로 지칭될 수 있음)은 메모리에 저장될 수 있다. 테이블은 단일 테이블일 수도 있고, 예를 들어 멀티 레벨 테이블일 수도 있다. 일부 예에서, 분기 및 함수 호출 권한("X" 및 "XL")은 별도의 테이블 또는 비트맵에서 정의될 수 있고, 권한 테이블은 판독 및 기록 권한만을 정의한다.A table (which may be referred to as a permission table, for example) may be stored in memory. The table may be a single table, or it may be a multi-level table, for example. In some examples, branch and function call permissions ("X" and "XL") may be defined in separate tables or bitmaps, and the permission table defines only read and write permissions.
도 8은 도 7에 도시된 것과 같은 하나 이상의 권한 테이블을 식별하고 액세스하는 데 사용될 수 있는 회로부의 예를 도시한다. 이 예에서, 메모리 보안 회로부(135)는 메모리(605) 내의 권한 테이블(805)에 액세스하기 위한 권한 테이블 액세스 회로부(800)를 포함한다. 권한 테이블의 기본 어드레스는 레지스터의 세트(810)에서 정의된다. 이 특정 예에서, 데이터 처리 장치는 3개의 특권 레벨 중 어느 하나에서 동작할 수 있고, 각 특권 레벨에 대해 테이블이 정의된 것으로 가정한다. 따라서, 레지스터(815)는 각각의 테이블의 기본 어드레스를 메모리에 저장하기 위해 제공되고, 권한 테이블 액세스 회로부는 해당 레지스터에 저장된 기본 어드레스에 기초하여 권한 테이블에 액세스한다. 이 예에서의 메모리 보안 회로부는 또한, 권한 테이블의 콘텐츠의 서브세트를 캐싱하도록 배열된 하나 이상의 권한 테이블 캐시(820)를 포함한다. 권한 테이블 캐시의 엔트리는 가상 머신 식별자(VMID) 및 어드레스 공간 식별자(ASID)에 의해 태깅될 수 있어서, 컨텍스트 전환 시마다 캐시를 플러시할 필요가 없다. 대안적으로, 캐시는 일부 대안적인 컨텍스트 식별자에 의해 태깅될 수 있다.FIG. 8 illustrates an example of circuitry that may be used to identify and access one or more privilege tables, such as those illustrated in FIG. 7. In this example, the memory security circuitry (135) includes privilege table access circuitry (800) for accessing a privilege table (805) within the memory (605). The base address of the privilege table is defined in a set of registers (810). In this particular example, it is assumed that the data processing device can operate at any one of three privilege levels, and that a table is defined for each privilege level. Accordingly, registers (815) are provided to store the base address of each table in memory, and the privilege table access circuitry accesses the privilege table based on the base address stored in the registers. The memory security circuitry in this example also includes one or more privilege table caches (820) arranged to cache a subset of the contents of the privilege table. Entries in the privilege table cache may be tagged by a virtual machine identifier (VMID) and an address space identifier (ASID), so that the cache does not need to be flushed on each context switch. Alternatively, the cache can be tagged by some alternative context identifier.
도 8에 도시된 예에서, 메모리 보안 회로부(135)에 존재할 수 있는 회로부 중 일부만이 도시된다. 이 예에서의 메모리 보안 회로부는 또한 다른 도면에 도시된 SRegionID 테이블 액세스 회로부(600), SRegionID 레지스터(500) 또는 PC 비트 레지스터와 같은 회로부를 포함할 수 있음을 이해해야 한다. 또한, 이 예에서는 데이터 처리 장치가 다수의 상이한 특권 레벨에서 동작할 수 있다고 가정하지만, 이는 필수적인 것은 아니다.In the example illustrated in FIG. 8, only some of the circuitry that may be present in the memory security circuitry (135) is illustrated. It should be appreciated that the memory security circuitry in this example may also include circuitry such as the SRegionID table access circuitry (600), the SRegionID register (500), or the PC bit register illustrated in other drawings. Additionally, while this example assumes that the data processing device can operate at a number of different privilege levels, this is not required.
도 9는 메모리 액세스 요청이 발행되는 것에 응답하여 데이터 처리 장치에 의해 수행될 수 있는 방법의 예를 도시하는 흐름도이다. 유사한 방법이 또한 분기 명령어의 실행에 응답하여 수행될 수 있다는 점에 유의한다.FIG. 9 is a flow diagram illustrating an example of a method that may be performed by a data processing device in response to a memory access request being issued. Note that a similar method may also be performed in response to the execution of a branch instruction.
도면에 도시된 바와 같이, 본 방법은 TRegionID 레지스터로부터 현재 시간 영역 식별자를 판독하는 단계(900), 및 실행으로 인해 메모리 액세스 요청이 발행된 명령어의 명령어 페치 어드레스에 기초하여 현재 공간 영역 식별자(SRegionID)를 결정하는 단계(905)를 포함한다. 방법은 또한 메모리 액세스 요청의 타겟 어드레스에 기초하여 타겟 공간 영역 식별자(즉, 액세스 요청의 타겟에 해당하는 공간 영역 식별자)를 결정하는 단계(910)를 포함한다. 현재 시간 영역 식별자 및 현재 공간 식별자를 결정한 후, 방법은 현재 공간 및 시간 영역 식별자(예를 들어, RegionID는 위에서 설명된 바와 같이 SRegionID 및 TRegionID의 연결일 수 있음)에 기초하여 현재 영역 식별자(RegionID)를 결정하는 단계(915)를 포함한다. 또한, 방법은 타겟 공간 영역 식별자 및 현재 시간 영역 식별자에 기초하여 타겟 영역 식별자(RegionID)를 결정하는 단계(920)를 포함한다. 현재 및 타겟 영역 식별자를 결정한 후, 방법은 이들 2개의 식별자에 기초하여 권한 테이블을 조회하는 단계(925)를 포함한다 - 예를 들어, 이것은 도 7에 도시된 것과 같은 테이블에서의 조회일 수 있다.As illustrated in the drawing, the method includes a step (900) of reading a current time region identifier from a TRegionID register, and a step (905) of determining a current space region identifier (SRegionID) based on an instruction fetch address of an instruction whose execution has issued a memory access request. The method also includes a step (910) of determining a target space region identifier (i.e., a space region identifier corresponding to a target of the access request) based on a target address of the memory access request. After determining the current time region identifier and the current space identifier, the method includes a step (915) of determining a current region identifier (RegionID) based on the current space and time region identifiers (e.g., RegionID can be a concatenation of SRegionID and TRegionID as described above). The method also includes a step (920) of determining a target region identifier (RegionID) based on the target space region identifier and the current time region identifier. After determining the current and target area identifiers, the method includes a step (925) of querying a privilege table based on these two identifiers - for example, this may be a query in a table such as that illustrated in FIG. 7.
도 10은 이 경우 데이터 처리 장치가 분기 명령어의 실행에 어떻게 반응할 수 있는지에 대한 예를 도시하는 또 다른 흐름도이다. 특히, 일부 예에서, 데이터 처리 장치는, 분기 명령어의 실행으로 인해 공간 영역 식별자(SRegionID)가 변경되는 경우(예를 들어, 분기 명령어가 하나의 공간 영역 식별자와 연관되고 분기 명령어의 타겟이 상이한 공간 영역 식별자와 연관되는 경우), 시간 영역 식별자를 제로(또는 일부 다른 디폴트 값)로 설정하도록 배열될 수 있다. 이는 제어 흐름 무결성을 유지하는 데 도움이 된다.FIG. 10 is another flowchart illustrating an example of how the data processing unit may react to the execution of a branch instruction in this case. In particular, in some examples, the data processing unit may be arranged to set the time region identifier (SRegionID) to zero (or some other default value) if the execution of the branch instruction causes the space region identifier (SRegionID) to change (e.g., if the branch instruction is associated with one space region identifier and the target of the branch instruction is associated with a different space region identifier). This helps maintain control flow integrity.
특히, 도 10에 도시된 방법은 분기 명령어가 실행되는지 여부를 결정하는 단계(1000)를 포함한다. 분기 명령어가 실행되었된 것으로 결정되면, 방법은 분기 명령어의 실행이 공간 영역 식별자를 변경하게 했는지 여부를 결정하는 단계(1005)를 포함한다. 이러한 경우라고 결정되면, 시간 영역 식별자는 0으로 설정된다(1010).In particular, the method illustrated in FIG. 10 includes a step (1000) of determining whether a branch instruction is executed. If it is determined that the branch instruction has been executed, the method includes a step (1005) of determining whether execution of the branch instruction caused a change in a spatial domain identifier. If it is determined that this is the case, the temporal domain identifier is set to 0 (1010).
도 11은 사용될 수 있는 시뮬레이터 구현예를 도시한다. 전술된 실시예는 관심이 있는 기술을 지원하는 특정 처리 하드웨어를 작동시키기 위한 장치 및 방법과 관련하여 본 발명을 구현하지만, 본 명세서에서 설명되는 실시예에 따라 컴퓨터 프로그램의 사용을 통해 구현되는 명령어 실행 환경을 제공하는 것이 또한 가능하다. 이러한 컴퓨터 프로그램은 대개, 하드웨어 아키텍처의 소프트웨어 기반 구현을 제공하는 한, 시뮬레이터로 지칭된다. 다양한 시뮬레이터 컴퓨터 프로그램은 에뮬레이터, 가상 기계, 모델, 및 동적 이진 변환기를 포함하는 이진 변환기를 포함한다. 전형적으로, 시뮬레이터 구현은 호스트 프로세서(1330) 상에서 실행될 수 있으며, 선택적으로 호스트 운영 체제(1320)를 실행하여, 시뮬레이터 프로그램(1310)을 지원할 수 있다. 몇몇 배열에서, 하드웨어와 제공된 명령어 실행 환경 사이에 다수의 시뮬레이션 계층이 있을 수 있고/있거나, 동일한 호스트 프로세서 상에 제공된 다수의 별개의 명령어 실행 환경이 있을 수 있다. 역사적으로, 합리적인 속도로 실행되는 시뮬레이터 구현을 제공하기 위해 강력한 프로세서가 필요하였지만, 그러한 접근법은 특정 상황에서, 예컨대 호환성 또는 재사용 이유 때문에 다른 프로세서에 고유한 코드를 실행하려는 요구가 있을 때, 정당화될 수 있다. 예를 들어, 시뮬레이터 구현은 호스트 프로세서 하드웨어에 의해 지원되지 않는 추가적인 기능을 갖는 명령어 실행 환경을 제공하거나, 상이한 하드웨어 아키텍처와 전형적으로 연관되는 명령어 실행 환경을 제공할 수 있다. 시뮬레이션의 개요가 문헌[“Some Efficient Architecture Simulation Techniques”, Robert Bedichek, Winter 1990 USENIX Conference, Pages 53 - 63]에서 주어진다.FIG. 11 illustrates an example simulator implementation that may be used. While the embodiments described above implement the invention in terms of devices and methods for operating specific processing hardware supporting the technology of interest, it is also possible to provide an instruction execution environment implemented through the use of a computer program in accordance with the embodiments described herein. Such computer programs are typically referred to as simulators insofar as they provide a software-based implementation of the hardware architecture. Various simulator computer programs include emulators, virtual machines, models, and binary translators including dynamic binary translators. Typically, the simulator implementation may be executed on a host processor (1330), optionally executing a host operating system (1320) to support the simulator program (1310). In some arrangements, there may be multiple simulation layers between the hardware and the instruction execution environment provided, and/or there may be multiple separate instruction execution environments provided on the same host processor. Historically, a powerful processor has been required to provide a simulator implementation that runs at reasonable speed, but such an approach may be justified in certain circumstances, such as when there is a need to execute code native to another processor for compatibility or reuse reasons. For example, a simulator implementation may provide an instruction execution environment with additional features not supported by the host processor hardware, or may provide an instruction execution environment that is typically associated with a different hardware architecture. An overview of simulation is given in the literature [“Some Efficient Architecture Simulation Techniques”, Robert Bedichek, Winter 1990 USENIX Conference, Pages 53 - 63].
실시예가 특정 하드웨어 구성 또는 피처를 참조하여 앞서 설명된 범위 내에서, 시뮬레이션된 실시예에서, 동등한 기능성이 적합한 소프트웨어 구성 또는 피처에 의해 제공될 수 있다. 예를 들어, 특정 회로부는 시뮬레이션된 실시예에 컴퓨터 프로그램 로직으로서 구현될 수 있다. 도 11에 도시된 예에서, 명령어 페치 프로그램 로직(1340)이 제공되며, 이는 이전 예의 명령어 페치 회로부와 동일한 기능을 제공한다. 또한, 위에 설명된 처리 회로부와 동일한 기능을 제공하는 처리 프로그램 로직(1350)이 제공되고, 위의 예에서 메모리 보안 회로부의 기능을 제공하는 메모리 보안 프로그램 로직(1360)이 제공된다. 유사하게, 메모리 하드웨어, 예컨대 레지스터 또는 캐시는 시뮬레이션된 실시예에서 소프트웨어 데이터 구조로서 구현될 수 있다. 전술된 실시예에서 언급된 하드웨어 요소 중 하나 이상의 하드웨어 요소가 호스트 하드웨어(예를 들어, 호스트 프로세서(1330)) 상에 존재하는 배열에서, 몇몇 시뮬레이션된 실시예는, 적합한 경우, 호스트 하드웨어를 사용할 수 있다.While the embodiments have been described above with reference to specific hardware configurations or features, in the simulated embodiments, equivalent functionality may be provided by suitable software configurations or features. For example, certain circuitry may be implemented as computer program logic in the simulated embodiments. In the example illustrated in FIG. 11 , instruction fetch program logic (1340) is provided, which provides the same functionality as the instruction fetch circuitry of the previous example. In addition, processing program logic (1350) is provided, which provides the same functionality as the processing circuitry described above, and memory security program logic (1360) is provided, which provides the functionality of the memory security circuitry of the above example. Similarly, memory hardware, such as registers or caches, may be implemented as software data structures in the simulated embodiments. In an arrangement where one or more of the hardware elements mentioned in the embodiments described above reside on host hardware (e.g., host processor (1330)), some simulated embodiments may utilize the host hardware, where appropriate.
시뮬레이터 프로그램(1310)은 컴퓨터 판독 가능 저장 매체(이는 비일시적 매체일 수 있음)에 저장될 수 있고, 타겟 코드(1300)(이는 애플리케이션, 운영 체제 및 하이퍼바이저를 포함할 수 있음)에 프로그램 인터페이스(명령어 실행 환경)를 제공하는데, 이는 시뮬레이터 프로그램(1310)에 의해 모델링되는 하드웨어 아키텍처의 인터페이스와 동일하다. 따라서, 메모리 액세스 요청이 발행되어야 하는 명령어, 분기 명령어, 함수 호출 명령어 및 위에서 설명한 함수 반환 명령어를 포함하는 타겟 코드(1300)의 프로그램 명령어는 시뮬레이터 프로그램(1310)을 사용하여 명령어 실행 환경 내에서 실행될 수 있으므로, 위에서 논의된 장치(100)의 하드웨어 피처를 실제로 갖지 않는 호스트 컴퓨터(1330)가 이러한 피처를 에뮬레이션할 수 있다.The simulator program (1310) can be stored in a computer-readable storage medium (which can be a non-transitory medium) and provides a program interface (instruction execution environment) to the target code (1300) (which can include an application, an operating system, and a hypervisor), which is identical to the interface of the hardware architecture modeled by the simulator program (1310). Accordingly, program instructions of the target code (1300), including instructions that require memory access requests to be issued, branch instructions, function call instructions, and function return instructions described above, can be executed within the instruction execution environment using the simulator program (1310), so that a host computer (1330) that does not actually have the hardware features of the device (100) discussed above can emulate such features.
본 출원에서, "...하도록 구성된"이라는 말은 장치의 요소가, 정의된 동작을 수행할 수 있는 구성을 갖는다는 것을 의미하기 위해 사용된다. 이러한 맥락에서, "구성"은 하드웨어 또는 소프트웨어의 상호연결의 배열 또는 방식을 의미한다. 예를 들어, 장치는 정의된 동작을 제공하는 전용 하드웨어를 가질 수 있거나, 프로세서 또는 다른 처리 디바이스는 기능을 수행하도록 프로그래밍될 수 있다. "~하도록 구성된"은, 장치 요소가, 정의된 동작을 제공하기 위해 임의의 방식으로 변경될 필요가 있음을 암시하지는 않는다.In this application, the term "configured to..." is used to mean that an element of a device has a configuration that enables it to perform the defined operation. In this context, "configuration" means an arrangement or manner of interconnection of hardware or software. For example, a 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 imply that the element of the device needs to be modified in any way to provide the defined operation.
또한, 본 출원에서 "… 중 적어도 하나를 포함하는"이라는 말은 다음 옵션 중 어느 하나 또는 다음 옵션의 임의의 조합이 포함된다는 것을 의미하는 데 사용된다. 예를 들어, "A; B 및 C 중 적어도 하나"는 A 또는 B 또는 C, 또는 A, B 및 C(예를 들어, A 및 B 또는 A 및 C 또는 B 및 C)의 임의의 조합을 의미하도록 의도된다.Additionally, the phrase "comprising at least one of" in this application is used to mean including any one of the following options or any combination of the following options. For example, "at least one of A; B, and C" is intended to mean A or B or C, or any combination of A, B, and C (e.g., A and B, or A and C, or B and C).
본 발명의 예시적인 실시예가 첨부 도면을 참조하여 본 명세서에서 상세히 설명되었지만, 본 발명은 그러한 정확한 실시예로 제한되지 않으며, 첨부된 청구범위에 의해 정의된 바와 같은 본 발명의 범주를 벗어남이 없이 다양한 변경 및 수정이 당업자에 의해 이루어질 수 있다는 것이 이해되어야 한다.Although exemplary embodiments of the present invention have been described in detail herein with reference to the accompanying drawings, it should be understood that the present invention is not limited to such precise embodiments, and that various changes and modifications may be made by those skilled in the art without departing from the scope of the present invention as defined by the appended claims.
Claims (18)
명령어 페치 어드레스와 연관된 명령어를 페치하기 위해 상기 명령어 페치 어드레스에 응답하는 명령어 페치 회로부;
상기 명령어가 타겟 메모리 어드레스를 지정하는 요청을 포함하고, 상기 타겟 메모리 어드레스를 지정하는 상기 요청이 허용되는 경우, 상기 타겟 메모리 어드레스에 따라 달라지는 동작을 수행하도록 상기 명령어에 응답하는 처리 회로부; 및
메모리 보안 회로부를 포함하며, 상기 명령어가 상기 타겟 메모리 어드레스를 지정하는 상기 요청을 포함하는 경우, 상기 메모리 보안 회로부는:
상기 명령어 페치 어드레스의 미리 결정된 슬라이스에 기초하여, 현재 영역 식별자를 결정하고;
상기 현재 영역 식별자에 기초하여, 상기 현재 영역 식별자와 연관된 명령어에 응답하여 발행된 요청에 대한 권한 정보를 식별하고;
상기 권한 정보에 기초하여, 상기 요청이 금지되는지 여부를 결정하고;
상기 요청이 금지된다는 결정에 응답하여, 상기 요청이 금지된다는 것을 나타내는 응답을 상기 처리 회로부에 발행하도록 구성되는, 장치.As a device
An instruction fetch circuit responsive to an instruction fetch address for fetching an instruction associated with the instruction fetch address;
A processing circuitry that responds to the command to perform an operation that depends on the target memory address, if the command includes a request specifying a target memory address, and the request specifying the target memory address is permitted; and
A memory security circuit comprising:
Based on a predetermined slice of the above instruction fetch address, determine the current region identifier;
Based on the current realm identifier, identify authorization information for a request issued in response to a command associated with the current realm identifier;
Based on the above authority information, determine whether the request is prohibited;
A device configured to, in response to a determination that said request is prohibited, issue a response to said processing circuitry indicating that said request is prohibited.
상기 메모리 보안 회로부는:
상기 타겟 메모리 어드레스와 연관된 페이지 테이블 엔트리로부터 도출된 페이지 테이블 액세스 권한 정보에 기초하여, 상기 요청이 금지되는지 여부를 결정하고;
상기 권한 정보 및 상기 페이지 테이블 권한 정보 중 적어도 하나에 기초하여 요청이 금지된다는 결정에 응답하여, 상기 요청이 금지된다는 것을 나타내는 상기 응답을 발행하도록 구성되는, 장치.In the first paragraph,
The above memory security circuitry:
Based on page table access permission information derived from the page table entry associated with the target memory address, determine whether the request is prohibited;
A device configured to issue a response indicating that the request is prohibited in response to a determination that the request is prohibited based on at least one of the above permission information and the page table permission information.
상기 메모리 보안 회로부는, 상기 명령어 페치 어드레스의 상기 미리 결정된 슬라이스에 기초하여, 상기 명령어를 저장하는 메모리의 영역에 해당하는 소스 영역 식별자를 결정하고, 상기 소스 영역 식별자에 대한 의존에 따라 상기 현재 영역 식별자를 결정하도록 구성되는, 장치.In paragraph 1 or 2,
A device wherein the memory security circuitry is configured to determine a source region identifier corresponding to a region of memory storing the instruction based on the predetermined slice of the instruction fetch address, and to determine the current region identifier based on dependence on the source region identifier.
상기 처리 회로부는 현재 소스 영역 식별자를 결정하고 상기 현재 소스 영역 식별자를 목적지 레지스터에 저장하기 위해 상기 목적지 레지스터를 식별하는 반환-공간-식별자 명령어에 응답하는, 장치.In the third paragraph,
A device wherein the processing circuitry responds to a return-space-identifier instruction that determines a current source region identifier and identifies a destination register to store the current source region identifier in the destination register.
현재 시간 식별자를 저장하기 위한 레지스터를 포함하되,
상기 메모리 보안 회로부는 상기 소스 영역 식별자 및 상기 현재 시간 식별자에 따라 달라지는 상기 현재 영역 식별자를 결정하도록 구성되고, 상기 현재 시간 식별자는 상기 명령어 페치 어드레스와 무관하게 조회되고;
상기 처리 회로부는 상기 현재 시간 식별자를 미리 결정된 값으로 설정하기 위해, 이전 명령어와 연관된 소스 영역 식별자와 상이한 주어진 소스 영역 식별자를 갖는 명령어를 검출하는 것에 응답하는, 장치.In clause 3 or 4,
Including a register for storing the current time identifier,
The memory security circuitry is configured to determine the current region identifier, which varies depending on the source region identifier and the current time identifier, wherein the current time identifier is looked up independently of the instruction fetch address;
A device wherein the processing circuitry is responsive to detecting a command having a given source region identifier that is different from the source region identifier associated with a previous command, to set the current time identifier to a predetermined value.
상기 명령어 페치 어드레스의 상기 미리 결정된 슬라이스를 나타내는 슬라이스 식별 정보를 저장하기 위한 구성 레지스터를 포함하는, 장치.In any one of claims 1 to 5,
A device comprising a configuration register for storing slice identification information representing the predetermined slice of the instruction fetch address.
상기 메모리 보안 회로부는 상기 소스 영역 식별자가 디폴트 소스 영역 식별자라는 것을 결정하기 위해 상기 명령어 페치 어드레스의 추가 슬라이스가 미리 결정된 값 이외의 값을 갖는다는 결정에 응답하는, 장치.In any one of claims 1 to 6,
A device wherein the memory security circuitry is responsive to a determination that an additional slice of the instruction fetch address has a value other than a predetermined value to determine that the source region identifier is a default source region identifier.
상기 명령어 페치 어드레스는 가상 어드레스를 포함하고;
상기 명령어 페치 회로부는 상기 명령어 페치 어드레스의 주어진 부분에 대한 의존에 따라 상기 명령어를 페치하도록 구성되며, 상기 명령어 페치 어드레스의 상기 주어진 부분은 상기 명령어가 저장되는 메모리 내의 위치를 나타내고;
상기 명령어 페치 어드레스의 상기 주어진 부분 및 상기 명령어 페치 어드레스의 상기 미리 결정된 슬라이스는 적어도 하나의 비트만큼 중첩되는, 장치.In any one of claims 1 to 7,
The above instruction fetch address contains a virtual address;
The above instruction fetch circuitry is configured to fetch the instruction depending on a given portion of the instruction fetch address, wherein the given portion of the instruction fetch address represents a location within memory where the instruction is stored;
A device wherein the given portion of the instruction fetch address and the predetermined slice of the instruction fetch address overlap by at least one bit.
상기 메모리 보안 회로부는:
판독 액세스 권한;
기록 액세스 권한;
분기 수행을 위한 권한; 및
반환 어드레스를 저장하지 않고 분기를 수행하기 위한 권한 중 적어도 하나를 식별하는 상기 권한 정보에 기초하여 상기 요청이 금지되는지 여부를 결정하도록 구성되는, 장치.In any one of claims 1 to 8,
The above memory security circuitry:
Read access rights;
Records access rights;
Authority to perform branching; and
A device configured to determine whether the request is prohibited based on said permission information identifying at least one of the permissions for performing a branch without storing a return address.
상기 메모리 보안 회로부는, 상기 타겟 메모리 어드레스에 기초하여, 목적지 영역 식별자를 결정하도록 구성되고;
상기 메모리 보안 회로부는, 상기 현재 영역 식별자 및 상기 목적지 영역 식별자에 기초하여, 메모리 내의 권한 테이블을 조회하는 테이블 액세스 회로부를 포함하며, 상기 권한 테이블은 상기 권한 정보를 정의하고;
상기 테이블 액세스 회로부는, 상이한 권한 정보가 상이한 목적지 영역 식별자와 상기 현재 영역 식별자의 상이한 조합에 대해 정의되는 상기 권한 테이블의 적어도 하나의 인코딩을 지원하도록 구성되는, 장치.In any one of claims 1 to 9,
The above memory security circuitry is configured to determine a destination area identifier based on the target memory address;
The above memory security circuitry includes a table access circuitry that looks up a permission table in the memory based on the current area identifier and the destination area identifier, the permission table defining the permission information;
A device wherein the table access circuitry is configured to support at least one encoding of the authority table in which different authority information is defined for different combinations of different destination area identifiers and the current area identifier.
상기 메모리 보안 회로부는 메모리 내에서, 상기 권한 정보를 정의하는 권한 테이블에 액세스하기 위한 테이블 액세스 회로부를 포함하고;
상기 장치는 메모리 내의 상기 권한 테이블의 위치를 나타내는 어드레스 정보를 저장하기 위한 테이블 식별 레지스터를 포함하는, 장치.In any one of claims 1 to 10,
The above memory security circuitry includes a table access circuitry for accessing a permission table defining the permission information within the memory;
A device, wherein the device includes a table identification register for storing address information indicating the location of the permission table within the memory.
상기 장치는 복수의 특권 레벨 중 하나에서 동작하도록 배열되고;
상기 장치는:
복수의 레지스터(각각은 메모리에서 해당하는 권한 테이블의 위치를 나타내는 어드레스 정보를 저장하도록 구성됨); 및
현재의 특권 레벨에 기초하여, 상기 복수의 레지스터 중 하나를 상기 권한 테이블 식별 레지스터로서 선택하는 레지스터 선택 회로부를 포함하는, 장치.In Article 11,
The device is arranged to operate at one of a plurality of privilege levels;
The above device:
A plurality of registers (each configured to store address information indicating the location of a corresponding permission table in memory); and
A device comprising a register selection circuit for selecting one of the plurality of registers as the privilege table identification register based on a current privilege level.
상기 메모리 보안 회로부는 메모리 내에서, 상기 권한 정보를 정의하는 권한 테이블에 액세스하기 위한 테이블 액세스 회로부를 포함하고;
상기 장치는 상기 현재 영역 식별자에 대한 상기 권한 테이블에 정의된 상기 권한 정보를 나타내는 현재 권한의 세트를 저장하는 레지스터를 포함하고;
상기 테이블 액세스 회로부는 상기 현재 영역 식별자가 새로운 영역 식별자에 기초하여, 상기 레지스터에 저장될 업데이트된 권한의 세트를 식별하기 위한 상기 권한 테이블을 조회하기 위해 상기 새로운 영역 식별자로 변경되었다는 결정에 응답하는, 장치.In any one of claims 1 to 12,
The above memory security circuitry includes a table access circuitry for accessing a permission table defining the permission information within the memory;
The device comprises a register storing a set of current permissions representing the permission information defined in the permission table for the current area identifier;
The device wherein the table access circuitry is responsive to a determination that the current domain identifier has changed to the new domain identifier to query the permissions table to identify an updated set of permissions to be stored in the register based on the new domain identifier.
상기 메모리 보안 회로부는 메모리 내에서, 상기 권한 정보를 정의하는 권한 테이블에 액세스하기 위한 테이블 액세스 회로부를 포함하고;
상기 장치는 상기 권한 테이블에 정의된 상기 권한의 서브세트를 저장하기 위한 캐시를 포함하고;
상기 장치는 각각 컨텍스트 식별자와 연관된 복수의 컨텍스트 중 하나에서 동작하도록 구성되고;
상기 캐시는 각각 해당 컨텍스트 식별자와 연관된 복수의 엔트리를 포함하는, 장치.In any one of claims 1 to 13,
The above memory security circuitry includes a table access circuitry for accessing a permission table defining the permission information within the memory;
The device comprises a cache for storing a subset of the permissions defined in the permission table;
The device is configured to operate in one of a plurality of contexts, each of which is associated with a context identifier;
A device wherein the cache comprises a plurality of entries, each of which is associated with a respective context identifier.
복수의 현재 영역 식별자 각각에 대해, 해당 현재 영역 식별자에 대한 권한 정보를 나타내는 권한의 세트를 저장하는 레지스터를 포함하는 복수의 레지스터를 포함하는, 장치.In any one of claims 1 to 14,
A device comprising a plurality of registers, each register storing, for each of a plurality of current zone identifiers, a set of permissions representing permissions information for that current zone identifier.
명령어 페치 어드레스에 응답하여, 상기 명령어 페치 어드레스와 연관된 명령어를 페치하는 단계; 및
상기 명령어가 타겟 메모리 어드레스를 지정하는 요청을 포함하는 경우:
상기 명령어에 응답하여, 상기 타겟 메모리 어드레스를 지정하는 상기 요청이 허용되는 경우, 상기 타겟 메모리 어드레스에 따라 달라지는 동작을 수행하는 단계;
상기 명령어 페치 어드레스의 미리 결정된 슬라이스에 기초하여, 현재 영역 식별자를 결정하는 단계;
상기 현재 영역 식별자에 기초하여, 상기 현재 영역 식별자와 연관된 명령어에 응답하여 발행된 요청에 대한 권한 정보를 식별하는 단계;
상기 권한 정보에 기초하여, 상기 요청이 금지되는지 여부를 결정하는 단계; 및
상기 요청이 금지된다는 결정에 응답하여, 상기 요청이 금지된다는 것을 나타내는 응답을 발행하는 단계를 포함하는, 방법.As a method,
In response to the instruction fetch address, a step of fetching an instruction associated with the instruction fetch address; and
If the above command includes a request specifying a target memory address:
In response to the above command, if the request specifying the target memory address is allowed, performing an operation that depends on the target memory address;
A step of determining a current region identifier based on a predetermined slice of the above instruction fetch address;
A step of identifying authorization information for a request issued in response to a command associated with the current area identifier, based on the current area identifier;
A step of determining whether the request is prohibited based on the above authority information; and
A method comprising: in response to a determination that the request is prohibited, issuing a response indicating that the request is prohibited.
명령어 페치 어드레스와 연관된 명령어를 페치하기 위해 상기 명령어 페치 어드레스에 응답하는 명령어 페치 프로그램 로직;
상기 명령어가 타겟 메모리 어드레스를 지정하는 요청을 포함하고, 상기 타겟 메모리 어드레스를 지정하는 상기 요청이 허용되는 경우, 상기 타겟 메모리 어드레스에 따라 달라지는 동작을 수행하도록 상기 명령어에 응답하는 처리 프로그램 로직; 및
메모리 보안 프로그램 로직을 제공하도록 하며, 상기 명령어가 상기 타겟 메모리 어드레스를 지정하는 상기 요청을 포함하는 경우, 상기 메모리 보안 프로그램 로직은:
상기 명령어 페치 어드레스의 미리 결정된 슬라이스에 기초하여, 현재 영역 식별자를 결정하고;
상기 현재 영역 식별자에 기초하여, 상기 현재 영역 식별자와 연관된 명령어에 응답하여 발행된 요청에 대한 권한 정보를 식별하고;
상기 권한 정보에 기초하여, 상기 요청이 금지되는지 여부를 결정하고;
상기 요청이 금지된다는 결정에 응답하여, 상기 요청이 금지된다는 것을 나타내는 응답을 상기 처리 프로그램 로직에 발행하도록 구성되는, 컴퓨터 프로그램.As a computer program, when run on a computer, said computer:
Instruction fetch program logic responsive to an instruction fetch address to fetch an instruction associated with the instruction fetch address;
A processing program logic that responds to the command to perform an operation that depends on the target memory address, if the command includes a request specifying a target memory address, and the request specifying the target memory address is allowed; and
Provides memory security program logic, wherein when the command includes the request specifying the target memory address, the memory security program logic:
Based on a predetermined slice of the above instruction fetch address, determine the current region identifier;
Based on the current realm identifier, identify authorization information for a request issued in response to a command associated with the current realm identifier;
Based on the above authority information, determine whether the request is prohibited;
A computer program configured to, in response to a determination that said request is prohibited, issue a response to said processing program logic indicating that said request is prohibited.
Applications Claiming Priority (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| GB2216292.9A GB2623986B (en) | 2022-11-02 | 2022-11-02 | Region identifier based on instruction fetch address |
| GB2216292.9 | 2022-11-02 | ||
| PCT/GB2023/052503 WO2024094956A1 (en) | 2022-11-02 | 2023-09-27 | Region identifier based on instruction fetch address |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| KR20250100654A true KR20250100654A (en) | 2025-07-03 |
Family
ID=84369814
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| KR1020257014671A Pending KR20250100654A (en) | 2022-11-02 | 2023-09-27 | Region identifier based on instruction fetch address |
Country Status (7)
| Country | Link |
|---|---|
| EP (1) | EP4612585A1 (en) |
| KR (1) | KR20250100654A (en) |
| CN (1) | CN120077368A (en) |
| GB (1) | GB2623986B (en) |
| IL (1) | IL320127A (en) |
| TW (1) | TW202420076A (en) |
| WO (1) | WO2024094956A1 (en) |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7111145B1 (en) * | 2003-03-25 | 2006-09-19 | Vmware, Inc. | TLB miss fault handler and method for accessing multiple page tables |
| GB2569358B (en) * | 2017-12-15 | 2020-01-29 | Advanced Risc Mach Ltd | Code realms |
| GB2570474B (en) * | 2018-01-26 | 2020-04-15 | Advanced Risc Mach Ltd | Region fusing |
| GB2578135B (en) * | 2018-10-18 | 2020-10-21 | Advanced Risc Mach Ltd | Range checking instruction |
-
2022
- 2022-11-02 GB GB2216292.9A patent/GB2623986B/en active Active
-
2023
- 2023-09-27 EP EP23783938.6A patent/EP4612585A1/en active Pending
- 2023-09-27 WO PCT/GB2023/052503 patent/WO2024094956A1/en not_active Ceased
- 2023-09-27 IL IL320127A patent/IL320127A/en unknown
- 2023-09-27 KR KR1020257014671A patent/KR20250100654A/en active Pending
- 2023-09-27 CN CN202380073702.XA patent/CN120077368A/en active Pending
- 2023-10-12 TW TW112138906A patent/TW202420076A/en unknown
Also Published As
| Publication number | Publication date |
|---|---|
| GB202216292D0 (en) | 2022-12-14 |
| WO2024094956A1 (en) | 2024-05-10 |
| CN120077368A (en) | 2025-05-30 |
| TW202420076A (en) | 2024-05-16 |
| GB2623986B (en) | 2024-10-30 |
| IL320127A (en) | 2025-06-01 |
| EP4612585A1 (en) | 2025-09-10 |
| GB2623986A (en) | 2024-05-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7359837B2 (en) | Memory protection unit that uses memory protection tables stored within the memory system | |
| KR20210070974A (en) | range check command | |
| JP7397057B2 (en) | Binary search procedure for control tables stored in a memory system | |
| JP7425786B2 (en) | memory access control | |
| KR102847990B1 (en) | Control protection tag checking during memory access | |
| JP2022505011A (en) | Devices and methods for controlling memory access | |
| JP2024545406A (en) | Two-Stage Address Translation | |
| JP2023526811A (en) | Tag check device and method | |
| US12373611B2 (en) | Key capability storage | |
| JP7349437B2 (en) | Controlling protection tag checking on memory accesses | |
| JP7719863B2 (en) | Techniques for constraining access to memory using capabilities | |
| KR20240004738A (en) | Techniques for restricting access to memory using capabilities | |
| KR20250100654A (en) | Region identifier based on instruction fetch address | |
| US20240193101A1 (en) | Technique for constraining access to memory using capabilities | |
| TW202340955A (en) | Technique for constraining access to memory using capabilities | |
| GB2627542A (en) | Address-dependent check |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PA0105 | International application |
Patent event date: 20250502 Patent event code: PA01051R01D Comment text: International Patent Application |
|
| A201 | Request for examination | ||
| PA0201 | Request for examination |
Patent event code: PA02012R01D Patent event date: 20250620 Comment text: Request for Examination of Application |
|
| PG1501 | Laying open of application |