# US 10,503,932 B2 · Secure mode state data access tracking

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

- Number: US 10,503,932 B2
- Document ID: US10503932B2
- Status: Granted
- Kind: B2
- Application number: 15/739,825
- Filed: 2016-05-26
- Published: 2018-12-27
- Granted: 2019-12-10
- Earliest claimed: 2015-07-15
- Assignees: Arm Limited
- Applicants: ARM Limited
- Inventors: Thomas Christopher Grocutt; Simon John Craske
- Web page: https://patentgrep.com/patent/US10503932B2

## CPC

- G06F 21/74: operating in dual or compartmented mode, i.e. at least one secure mode
- G06F 9/44521: {Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading}
- G06F 12/1416: {by checking the object accessibility, e.g. type of access defined by the memory independently of subject rights (G06F12/1458 takes precedence)}
- G06F 21/52: during program execution, e.g. stack integrity {; Preventing unwanted data erasure; Buffer overflow}
- G06F 2221/2105: Dual mode as a secondary aspect
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A data processing apparatus is provided which uses flag circuitry (174) to set an access tracking flag (SFPA) to a first value when the processing circuitry (154) enters a secure mode in association with a function call and to switch the access tracking flag to a second value upon detection of a first access of at least one type to predetermined state data, such as floating point register data, by processing circuitry operating in the secure mode in association with that function call. This access tracking flag may then be used in association with a lazy-protection program instruction (VLSTM) and a lazy-load program instruction (VLLDM) to control whether or not push operations of the state data and restore operations of the state data are performed in order to prevent access in the non-secure mode to that state data.

## Claims

### Claim 1

Apparatus for processing data comprising:
processing circuitry to operate in a first security mode and in a second security mode; and
flag circuitry to provide an access tracking flag having a first value when the processing circuitry enters the first security mode in association with a function call, wherein the processing circuitry is configured to switch said access tracking flag to a second value upon detection of a first access of at least one type to predetermined state data by the processing circuitry when operating in said first security mode in association with said function call.

### Claim 2 (depends on 1)

Apparatus as claimed in claim 1, wherein said flag circuitry is configured to one of:
set said access tracking flag to said first value upon entry to said first security mode and to change said access tracking flag from said first value to said second value upon detecting said first access independent of whether said processing circuitry is operating in said first security mode or in said second security mode;
set said access tracking flag to said first value upon entry to said first security mode and to change said access tracking flag to said second value upon detecting said first access and that said processing circuitry is operating in said first security mode; and
set said access tracking flag to said first value upon entry to said second security mode and to change said access tracking flag to said second value upon detecting said first access and that said processing circuitry is operating in said first security mode.

### Claim 3 (depends on 1)

Apparatus as claimed in claim 1, wherein said flag circuitry is responsive to a further function call that switches said processing circuitry from operating in said first security mode to operating in said second security mode to save a current value of said access tracking flag to an access tracking flag data store.

### Claim 4 (depends on 3)

Apparatus as claimed in claim 3, wherein said flag circuitry is responsive to a function return from said further function call that switches said processing circuitry from operating in said second security mode to operating in said first security mode to restore said access tracking flag to said current value from said access tracking flag data store.

### Claim 5 (depends on 3)

Apparatus as claimed in claim 3, wherein said access tracking flag data store is a stack memory.

### Claim 6 (depends on 1)

Apparatus as claimed in claim 1, comprising
secure state protection circuitry to trigger a protection response in respect of said predetermined state data when at least:
said processing circuitry is operating in said second security mode;
said access tracking flag had said second value when operating in said first security mode before switching to said second security mode in association with a function call; and
said processing circuitry attempts to access said predetermined state data, wherein
said protection response comprises clearing a first subset of said predetermined state data.

### Claim 7 (depends on 6)

Apparatus as claimed in claim 6, wherein protection response comprises saving a second subset of said predetermined state data to a state data store.

### Claim 8 (depends on 6)

Apparatus as claimed in claim 6, wherein said processing circuitry is responsive to execution of a lazy-protection program instruction to prepare said state protection circuitry to perform said protection response should said processing circuitry attempt to access said first subset of said predetermined state data when one of:
said access tracking flag has said second value; and
said lazy-protection program instruction is executed.

### Claim 9 (depends on 6)

Apparatus as claimed in claim 6, wherein said protection response comprises setting a protection flag to a value indicative of triggering of said protection response.

### Claim 10 (depends on 9)

Apparatus as claimed in claim 9, wherein said protection flag is one of:
a dedicated protection flag; and
said access tracking flag.

### Claim 11 (depends on 8)

Apparatus as claimed in claim 8, wherein said execution of said lazy-protection program instruction triggers said protection response.

### Claim 12 (depends on 7)

Apparatus as claimed in claim 7, wherein said processing circuitry is responsive to execution of a lazy-load program instruction to load said second subset of said predetermined state data from said state data store when:
said processing circuitry is operating in said first security mode; and
said protection flag has said value indicative of triggering of said protection response.

### Claim 13 (depends on 12)

Apparatus as claimed in claim 12, wherein said load of said second subset of said predetermined state data is further dependent upon said access tracking flag having said second value.

### Claim 14 (depends on 8)

Apparatus as claimed in claim 8, wherein said processing circuitry is responsive to execution of said lazy-load program instruction to clear said preparing of said secure state protection circuitry when:
said processing circuitry is operating in said first security mode; and
said protection flag has a value other than indicative of triggering of said protection response.

### Claim 15 (depends on 9)

Apparatus as claimed in claim 9, wherein said processing circuitry is responsive to execution of a lazy-unprotect program instruction to disable said protection response when:
said processing circuitry is operating in said first security mode; and
said protection flag has a value other than indicative of triggering of said protection response.

### Claim 16 (depends on 1)

Apparatus as claimed in claim 1, comprising a floating point register file storing floating point values, wherein said predetermined state data includes said floating point values.

### Claim 17 (depends on 16)

Apparatus as claimed in claim 16, wherein said access by said processing circuitry to said floating point values comprises execution of a floating point instruction.

### Claim 18 (depends on 16)

Apparatus as claimed in claim 16, wherein floating point configuration data specifies one or more parameters associated with performing floating point processing operations by said processing circuitry and upon executing said floating point instruction in said secure state when said access tracking flag has said first value said floating point configuration data is set to default floating point configuration data.

### Claim 19 (depends on 7)

Apparatus as claimed in claim 7, wherein said state data store comprises a stack memory.

### Claim 20 (depends on 7)

Apparatus as claimed in claim 7, wherein said state protection circuitry is prepared to perform said saving by allocating a storage area within said stack memory to store said second subset of said predetermined state data and providing a pointer address for said storage area to said state protection circuitry.

### Claim 21 (depends on 20)

Apparatus as claimed in claim 20, wherein said lazy-protection program instruction has a parameter specifying what state data of said apparatus comprises said first subset of said predetermined state data.

### Claim 22 (depends on 12)

Apparatus as claimed in claim 12, wherein processing circuitry is responsive to execution of said lazy-load program instruction to deallocate said storage area within said stack memory when one of:
said lazy-load program instruction loads said predetermined state data from said stack memory;
said lazy-load program instruction clears said preparing of said state protection circuitry; and
said lazy-load program instruction is executed.

### Claim 23 (depends on 12)

Apparatus as claimed in claim 12, wherein said lazy-load program instruction has a parameter specifying what state data of said apparatus comprises said second subset of said predetermined state data.

### Claim 24 (depends on 1)

Apparatus as claimed in claim 1, wherein said first security mode is more secure than said second security mode.

### Claim 25

A method of processing data comprising:
performing processing in one of a first security mode and in a second security mode;
providing an access tracking flag having a first value when processing circuitry enters said first security mode in association with a function call; and
switching the access tracking flag to a second value upon detection of a first access of at least one type to predetermined state data by the processing circuitry when operating in said first security mode in association with said function call.

### Claim 26 (depends on 1)

A computer program stored on a non-transitory, computer program storage medium to control operation of an apparatus as claimed in claim 1, said computer program including a lazy-protection program instruction executable when operating in said first security mode to prepare state protection circuitry to perform a protection response in respect of said predetermined state data should said processing circuitry attempt to access a first subset of said predetermined state data when operating in said second security mode.

### Claim 27 (depends on 12)

A computer program stored on a non-transitory, computer program storage medium to control operation of an apparatus as claimed in claim 12, said computer program including said computer program including a lazy-load program instruction executable to control said processing circuitry to load said second subset of said predetermined state data from said state data store when:
said processing circuitry is operating in said first security mode; and
said protection flag has said value indicative of triggering of said protection response.
