# US 2023/0056039 A1 · An apparatus and method for controlling access to a set of memory mapped control registers

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0056039 A1
- Document ID: US20230056039A1
- Status: Published application
- Kind: A1
- Application number: 17/759,426
- Filed: 2020-12-21
- Published: 2023-02-23
- Earliest claimed: 2020-01-30
- Assignees: Arm Limited
- Applicants: Arm Limited
- Inventors: Thomas Christopher GROCUTT
- Web page: https://patentgrep.com/patent/US20230056039A1

## CPC

- G06F 3/0622: {in relation to access}
- G06F 12/1441: {for a range}
- G06F 3/0637: {Permissions}
- G06F 3/0673: {Single storage device}
- G06F 9/30043: {LOAD or STORE instructions; Clear instruction}
- G06F 9/30072: {to perform conditional operations, e.g. using predicates or guards}
- G06F 9/30101: {Special purpose registers}
- G06F 9/30116: {Shadow registers, e.g. coupled registers, not forming part of the register space}
- G06F 12/1466: {Key-lock mechanism}
- G06F 12/1483: {using an access-table, e.g. matrix or list}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A technique for controlling access to a set of memory mapped control registers. The apparatus has processing circuitry for executing program code to perform data processing operations, and a set of memory mapped control registers for storing control information used to control operation of the processing circuitry. Further, a lockdown register used to store a lockdown value. The processing circuitry is arranged to execute store instructions to perform write operations to a memory address space . Thethe processing circuitry is arranged to prevent a write operation being performed to change the control information in the memory mapped control registers . This significantly reduces the prospect of an attacker seeking to exploit a software vulnerability to change the control information in the memory mapped control registers.

## Claims

### Claim 1

An apparatus comprising:
processing circuitry to execute program code to perform data processing operations;
a set of memory mapped control registers to store control information used to control operation of the processing circuitry when executing the program code; and
a lockdown register to store a lockdown value;
wherein:
the processing circuitry is arranged to execute store instructions in order to perform write operations to a memory address space, the store instructions being of multiple types; and
the processing circuitry is arranged, when the lockdown value is set, to prevent a write operation being performed to change the control information in the memory mapped control registers unless that write operation occurs due to execution of a store instruction from a first subset of the multiple types of store instructions.

### Claim 2 (depends on 1)

The apparatus as claimed in claim 1, wherein the processing circuitry is arranged, when the lockdown value is clear, to allow a second subset of the multiple types of store instructions in addition to the first subset to be used to perform write operations to change the control information in the memory mapped control registers, wherein the second subset is non-overlapping with the first subset.

### Claim 3 (depends on 2)

The apparatus as claimed in claim 2, wherein, when the lockdown value is set, the processing circuitry is arranged to raise a fault exception when a store instruction from said second subset of the multiple types of store instructions attempts to perform a write operation to the set of memory mapped control registers.

### Claim 4 (depends on 1)

The apparatus as claimed in claim 1, wherein:
the processing circuitry is further arranged, when the lockdown value is set, to only allow the control information in the memory mapped control registers to be read when that read occurs due to execution of a load instruction from a first subset of multiple types of load instructions, and to prevent the control information in the memory mapped control registers being read when that read occurs due to execution of a load instruction from a second subset of the multiple types of load instructions non-overlapping with the first subset.

### Claim 5 (depends on 4)

The apparatus as claimed in claim 4, wherein, when the lockdown value is set, the processing circuitry is arranged to raise a fault exception when a load instruction from the second subset of the multiple types of load instructions attempts to perform a read operation to the set of memory mapped control registers.

### Claim 6 (depends on 1)

The apparatus as claimed in claim 1, wherein the first subset of the multiple types of store instructions comprises a control register specific store instruction, wherein the processing circuitry is arranged, when executing the control register specific store instruction, to ignore the lockdown value when determining whether to allow the associated write operation to the memory mapped control registers to be performed.

### Claim 7 (depends on 6)

The apparatus as claimed in claim 6, wherein the processing circuitry is arranged, when executing the control register specific store instruction, to raise a fault exception when a memory address identified by the control register specific store instruction lies outside a memory address range associated with the set of memory mapped control registers.

### Claim 8 (depends on 7)

The apparatus as claimed in claim 7, wherein the memory address is identified in dependence on a value stored in a register specified by the control register specific store instruction and an immediate value specified by the control register specific store instruction.

### Claim 9 (depends on 4)

The apparatus as claimed in claim 4, wherein:
the first subset of the multiple types of load instructions comprises a control register specific load instruction, wherein the processing circuitry is arranged, when executing the control register specific load instruction, to ignore the lockdown value when determining whether to allow the associated read operation to the memory mapped control registers to be performed; and
the processing circuitry is arranged, when executing the control register specific load instruction, to raise a fault exception when a memory address identified by the control register specific load instruction lies outside a memory address range associated with the set of memory mapped control registers.

### Claim 10 (depends on 6)

The apparatus as claimed in claim 6, wherein:
the lockdown register is provided within the set of memory mapped control registers, and the processing circuitry is arranged to change the lockdown value in the lockdown register by execution of an instance of the control register specific store instruction with a specified memory address that maps to the lockdown register.

### Claim 11 (depends on 10)

The apparatus as claimed in claim 10, wherein the processing circuitry is controllable by software to perform a sequence of accesses to the memory mapped control registers by executing the control register specific store instruction to clear the lockdown value, executing one or more standard access instructions to access the memory mapped control registers, and then executing a store instruction to set the lockdown value.

### Claim 12 (depends on 11)

The apparatus as claimed in claim 11, wherein the one or more standard access instructions comprise at least one store multiple instruction or load multiple instruction.

### Claim 13 (depends on 1)

The apparatus as claimed in claim 1, wherein the control information stored in the memory mapped control registers comprises at least control information used to control which regions of the memory address space are accessible to trusted program code and untrusted program code.

### Claim 14 (depends on 13)

The apparatus as claimed in claim 13, wherein the processing circuitry is arranged to allow the trusted program code to update the lockdown value in the lockdown storage, and is arranged to use the lockdown value to control performance of write operations to the memory mapped control registers by both the untrusted program code and the trusted program code.

### Claim 15 (depends on 13)

The apparatus as claimed in claim 13, wherein the processing circuitry is arranged to allow the trusted program code to update the lockdown value in the lockdown storage, and is arranged to use the lockdown value to control performance of write operations to the memory mapped control registers by the trusted program code, and to ignore the lockdown value when determining whether to allow a write operation to the memory mapped control registers by untrusted program code.

### Claim 16 (depends on 14)

The apparatus as claimed in claim 14, wherein:
the processing circuitry is arranged to execute the program code in one of a plurality of states comprising at least an unprivileged state and a privileged state, the trusted program code is program code executed by the processing circuitry in the privileged state and the untrusted program code is program code executed by the processing circuitry in the unprivileged state.

### Claim 17 (depends on 14)

The apparatus as claimed in claim 14, wherein:
the processing circuitry is arranged to execute the program code in one of a plurality of security domains comprising at least a secure domain and a less secure domain, the trusted program code is program code executed by the processing circuitry in the secure domain and the untrusted program code is program code executed by the processing circuitry in the less secure domain.

### Claim 18 (depends on 17)

The apparatus as claimed in claim 17, wherein:
in each of the security domains the processing circuitry is arranged to execute the program code in one of a plurality of states comprising at least the unprivileged state and the privileged state; and
the lockdown register is arranged to provide a lockdown value for each security domain.

### Claim 19 (depends on 1)

The apparatus as claimed in claim 1, wherein:
the processing circuitry is arranged to perform a lockdown value management process in association with an exception, the lockdown value management process comprising:
on occurrence of an exception, saving the lockdown value currently stored in the lockdown register, and setting the lockdown value in the lockdown register prior to triggering execution of an exception handling routine to process the exception; and
on return from the exception handing routine, restoring the lockdown value in the lockdown register to the saved lockdown value.

### Claim 20 (depends on 19)

The apparatus as claimed in claim 19, further comprising:
an autolock register to store an autolock value;
wherein the processing circuitry is arranged to perform the setting of the lockdown value in association with the lockdown value management process on the occurrence of an exception, only when the autolock value is set.

### Claim 21 (depends on 19)

The apparatus as claimed in claim 19, wherein during the lockdown value management process the lockdown value currently stored in the lockdown register is saved as a field within a link register.

### Claim 22

A method of controlling access to a set of memory mapped control registers within an apparatus, comprising:
executing program code on processing circuitry to perform data processing operations;
storing, within the set of memory mapped control registers, control information used to control operation of the processing circuitry when executing the program code; storing within a lockdown register a lockdown value;
executing store instructions on the processing circuitry in order to perform write operations to a memory address space, the store instructions being of multiple types; and
when the lockdown value is set, preventing a write operation being performed to change the control information in the memory mapped control registers unless that write operation occurs due to execution by the processing circuitry of a store instruction from a first subset of the multiple types of store instructions.

### Claim 23

A computer program for controlling a host data processing apparatus to provide an instruction execution environment, comprising:
processing program logic to execute program code to perform data processing operations; and
control program logic to maintain a set of memory mapped control data structures to store control information used to control operation of the processing program logic when executing the program code, and to maintain a lockdown data structure to store a lockdown value;
wherein:
the processing program logic is arranged to execute store instructions in order to perform write operations to a memory address space, the store instructions being of multiple types; and
the processing program logic is arranged, when the lockdown value is set, to prevent a write operation being performed to change the control information in the memory mapped control data structures unless that write operation occurs due to execution of a store instruction from a first subset of the multiple types of store instructions.

### Claim 24 (depends on 23)

A computer-readable storage medium storing the computer program of claim 23.
