# US 11,119,925 B2 · Apparatus and method for managing capability metadata

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

- Number: US 11,119,925 B2
- Document ID: US11119925B2
- Status: Granted
- Kind: B2
- Application number: 16/609,298
- Filed: 2018-04-19
- Published: 2020-06-18
- Granted: 2021-09-14
- Earliest claimed: 2017-05-02
- Assignees: Arm Limited
- Applicants: Arm Limited
- Inventors: Stuart David Biles; Graeme Peter Barnes
- Web page: https://patentgrep.com/patent/US11119925B2

## CPC

- G06F 12/0815: Cache consistency protocols
- G06F 12/1425: {the protection being physical, e.g. cell, word, block}
- G06F 9/3816: {Instruction alignment, e.g. cache line crossing}
- G06F 9/467: {Transactional memory (G06F9/528 takes precedence)}
- G06F 12/0811: with multilevel cache hierarchies
- G06F 12/0875: with dedicated cache, e.g. instruction or stack
- G06F 12/0897: with two or more cache hierarchy levels (with multilevel cache hierarchies G06F12/0811)
- G06F 12/1441: {for a range}
- G06F 16/907: Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Apparatus comprising cache storage and a method of operating such a cache storage are provided. Data blocks in the cache storage have capability metadata stored in association therewith identifying whether the data block specifies a capability or a data value. At least one type of capability is a bounded pointer. Responsive to a write to a data block in the cache storage a capability metadata modification marker is set in association with the data block, indicative of whether the capability metadata associated with the data block has changed since the data block was stored in the cache storage. This supports the security of the system, such that modification of the use of a data block from a data value to a capability cannot take place unless intended. Efficiencies may also result when capability metadata is stored separately from other data in memory, as fewer accesses to memory can be made.

## Claims

### Claim 1

An apparatus comprising:
cache storage to store data blocks, each data block having capability metadata stored in association therewith identifying whether each said data block specifies a capability or a data value, wherein at least one type of capability is a bounded pointer; and
cache control circuitry responsive to a write to a data block stored in the cache storage to set a capability metadata modification marker in association with the data block, wherein a value of the capability metadata modification marker is indicative of whether the capability metadata associated with the data block has changed since the data block was stored in the cache storage.

### Claim 2 (depends on 1)

The apparatus as claimed in claim 1, wherein the capability metadata modification marker set in association with the data block corresponds to a plurality of data blocks comprising said data block.

### Claim 3 (depends on 2)

The apparatus as claimed in claim 2, wherein the capability metadata modification marker set in association with the data block is a single bit for each cache line in the cache storage.

### Claim 4 (depends on 1)

The apparatus as claimed in claim 1, wherein the capability metadata modification marker set in association with the data block has a one-to-one correspondence with said data block.

### Claim 5 (depends on 1)

The apparatus as claimed in claim 1, further comprising:
a memory controller responsive to a received write transaction for a specified data block and associated capability metadata from the cache storage to a further storage level to suppress a write transaction with respect to the associated capability metadata and the further storage level, when the value of the capability metadata modification marker is indicative that the capability metadata has not changed since the specified data block was stored in the cache storage.

### Claim 6 (depends on 5)

The apparatus as claimed in claim 5, wherein the further storage level is memory storage.

### Claim 7 (depends on 5)

The apparatus as claimed in claim 5, wherein the further storage level is a further cache storage level.

### Claim 8 (depends on 6)

The apparatus as claimed in claim 6, wherein the write transaction is a read-modify-write transaction with respect to the associated capability metadata in the memory storage.

### Claim 9 (depends on 5)

The apparatus as claimed in claim 5, further comprising capability metadata cache storage to store capability metadata at a higher memory hierarchy level than the cache storage, and wherein the memory controller is responsive to a memory access transaction for at least one data block to return required capability metadata associated with the at least one data block,
and wherein the memory controller is responsive to the memory access transaction for the at least one data block, when the required capability metadata is not stored in the capability metadata cache storage, to initiate eviction of currently stored capability metadata from the capability metadata cache storage and retrieval of the required capability metadata into the capability metadata cache storage, unless the value of the capability metadata modification marker associated with the at least one data block is indicative that the required capability metadata has not changed since the at least one data block was stored in the cache storage.

### Claim 10 (depends on 9)

The apparatus as claimed in claim 9, wherein each bit stored in the capability metadata cache storage is indicative of whether any of a plurality of bits of capability metadata are set or not.

### Claim 11 (depends on 10)

The apparatus as claimed in claim 10, wherein the capability metadata cache storage comprises at least two hierarchical levels of storage, and each bit stored in a higher hierarchical level is indicative of whether any of a plurality of bits in a next lower hierarchical level are set or not.

### Claim 12 (depends on 1)

The apparatus as claimed in claim 1, wherein the cache storage is capable of storing the data blocks in cache lines, and the capability metadata modification marker set by the cache control circuitry in association with the data block is one of plural bits for each cache line in the cache storage, and wherein each bit of the plural bits for each cache line is indicative of whether the capability metadata for a respective portion of said cache line has changed since the respective portion of said cache line was stored in the cache storage.

### Claim 13 (depends on 12)

The apparatus as claimed in claim 12, wherein the cache control circuitry is responsive to the write to the data block stored in the cache storage to store a data modification marker in association with a data block portion, wherein a value of the data modification marker is indicative of whether the data block portion has been written to since the data block was stored in the cache storage, and
wherein the respective portion of said cache line corresponding to the capability metadata modification marker is at least as large as the data block portion.

### Claim 14 (depends on 1)

The apparatus as claimed in claim 1, further comprising:
a memory controller responsive to a received write transaction for a specified data block and associated capability metadata from the cache storage to a further storage level, when the capability metadata stored in association with the specified data block is indicative that it is a data value and the value of the capability metadata modification marker is indicative that the capability metadata stored in association with the specified data block has not changed since the specified data block was stored in the cache storage, to issue a memory write transaction to cause the capability metadata stored in memory actively to be set to indicate that the specified data block is a data value.

### Claim 15 (depends on 1)

The apparatus as claimed in claim 1, further comprising:
a memory controller responsive to a received write transaction for a specified data block and associated capability metadata from the cache storage to a further storage level, when the capability metadata stored in association with the specified data block is indicative that it is a data value, and when the memory controller has received a signal indicating that another agent has performed a write action to at least one of the specified data block and the associated capability metadata in memory since the specified data block was stored in the cache storage, to issue a memory write transaction to cause the capability metadata stored in memory actively to be set to indicate that the specified data block is a data value.

### Claim 16 (depends on 1)

The apparatus as claimed in claim 1, wherein the apparatus is responsive to transfer of the data block into or out of the cache storage, and when the value of the capability metadata modification marker indicates that the capability metadata associated with the data block has changed, to cause the data block to be treated as modified.

### Claim 17 (depends on 1)

The apparatus as claimed in claim 1, wherein the apparatus is responsive to transfer of the data block into or out of the cache storage, and when a data modification marker is not transferred,
to cause the data block and capability metadata modification marker to be treated as clean when the transfer is to a lower cache layer,
to cause the data block and capability metadata modification marker to be treated as modified when the transfer is not to a lower cache layer.

### Claim 18 (depends on 1)

The apparatus as claimed in claim 1, wherein the apparatus is responsive to transfer of the data block into or out of the cache storage, and when the capability metadata modification marker is not transferred,
to cause the value of the capability metadata modification marker to be inferred from a data modification marker.

### Claim 19 (depends on 1)

The apparatus as claimed in claim 1, wherein the apparatus is responsive to transfer of the data block into or out of the cache storage, and when the capability metadata is not transferred:
when a data modification marker and the capability metadata modification marker both indicate unmodified, to cause a target of the transfer to treat the capability metadata as identifying the data block as specifying a data value;
when the data modification marker and the capability metadata modification marker both indicate modified, to cause the target of the transfer to treat the capability metadata as identifying the data block as specifying a data value; and
when the data modification marker indicates modified and the capability metadata modification marker indicates unmodified, to cause the target of the transfer to treat a local copy of the capability metadata modification marker as valid.

### Claim 20 (depends on 1)

The apparatus as claimed in claim 1, wherein the apparatus is responsive to transfer of the data block into or out of the cache storage, and when the capability metadata is transferred:
when a data modification marker and the capability metadata modification marker both indicate unmodified or when the data modification marker and the capability metadata modification marker both indicate modified, to cause a target of the transfer to treat the capability metadata as valid; and
when the data modification marker indicates modified and the capability metadata modification marker indicates unmodified, to cause the target of the transfer to perform one of:
not modifying a local copy of the capability metadata;
updating the local copy of the capability metadata; or
reporting an error if the local copy of the capability metadata differs to the transferred capability metadata.

### Claim 21 (depends on 1)

A non-transitory, computer-readable storage medium storing a virtual machine computer program comprising program instructions to control a host data processing apparatus to provide an instruction execution environment corresponding to the apparatus according to claim 1.

### Claim 22

A method of operating cache storage comprising the steps of:
storing data blocks in the cache storage;
storing capability metadata in association with each data block identifying whether each said data block specifies a capability or a data value, wherein at least one type of capability is a bounded pointer; and
in response to a write to a data block stored in the cache storage, setting a capability metadata modification marker in association with the data block, wherein a value of the capability metadata modification marker is indicative of whether the capability metadata associated with the data block has changed since the data block was stored in the cache storage.
