# US 2017/0286322 A1 · Memory access protection apparatus and methods

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

- Number: US 2017/0286322 A1
- Document ID: US20170286322A1
- Status: Published application
- Kind: A1
- Application number: 15/271,102
- Filed: 2016-09-20
- Published: 2017-10-05
- Earliest claimed: 2016-03-31
- Assignees: Apple Inc.
- Applicants: Apple Inc.
- Inventors: Saurabh Garg; Karan Sanghi; Vladislav Petkov; Haining Zhang
- Web page: https://patentgrep.com/patent/US20170286322A1

## CPC

- G06F 12/1441: {for a range}
- G06F 12/1081: for peripheral access to main memory, e.g. direct memory access [DMA]
- G06F 2212/1052: Security improvement
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Methods and apparatus for registering and handling access violations of host memory. In one embodiment, a peripheral processor receives one or more window registers defining an extent of address space accessible from a host processor; responsive to an attempt to access an extent of address space outside of the extent of accessible address space, generates an error message; stores the error message within a violation register; and resumes operation of the peripheral processor upon clearance of the stored error message.

## Claims

### Claim 1

A method for registering access violations of host memory, comprising:
receiving one or more window registers defining an extent of address space within the host memory that is accessible by a peripheral processor from a host processor;
responsive to an attempt to access an extent of address space outside of the extent of accessible address space, generating an error message by the peripheral processor;
storing the error message within a violation register; and
preventing access of the host memory by the peripheral processor until the host processor has cleared the error message.

### Claim 2 (depends on 1)

The method of claim 1, wherein the generation of the error message comprises:
generating a memory address for the extent of address space outside of the extent of accessible address space;
generating a source for the attempt to access the extent of address space outside of the extent of accessible address space; and
generating a violation type for the attempt to access the extent of address space outside of the extent of accessible address space.

### Claim 3 (depends on 2)

The method of claim 2, wherein the generation of the violation type comprises determining whether an access violation comprises a write violation or a read violation.

### Claim 4 (depends on 2)

The method of claim 2, wherein the generation of the source comprises determining one of a direct memory access (DMA) unit or a central processing unit (CPU) as the source of an illegal access attempt.

### Claim 5 (depends on 2)

The method of claim 2, wherein the generation of the memory address comprises:
determining whether a start address for the memory address falls outside the extent of accessible address space; and
determining whether an end address for the memory address falls outside the extent of accessible address space.

### Claim 6 (depends on 1)

The method of claim 1, wherein the prevention of access to the host memory comprises:
generating a nullified packet by the peripheral processor; and
transmitting the nullified packet to the host processor.

### Claim 7 (depends on 6)

The method of claim 6, wherein the generation of the nullified packet by the peripheral processor further comprises generating an inverted data link layer cyclic redundancy check (LCRC) value for the nullified packet.

### Claim 8

A computing device comprising a memory mapped system, the computing device comprising:
a host processing device comprising a host CPU and a host memory management unit (MMU);
a peripheral processing device comprising a peripheral CPU, a peripheral MMU, peripheral memory and a peripheral direct memory access (DMA) unit; and
a host memory accessible by both the host processing device and the peripheral processing device;
wherein the peripheral processing device further comprises logic configured to:
receive one or more window registers defining an extent of address space within the host memory that is accessible by the peripheral processing device from the host processing device;
generate an error message responsive to an attempt to access an extent of address space outside of the extent of accessible address space;
store the error message within a violation register located within the peripheral memory; and
prevent access of the host memory by the peripheral processing device until the host processing device has cleared the error message.

### Claim 9 (depends on 8)

The computing device of claim 8, wherein the host processing device is further configured to:
define the one or more window registers containing the extent of address space within the host memory that is accessible by the peripheral processing device; and
transmit the one or more window registers to the peripheral processing device.

### Claim 10 (depends on 9)

The computing device of claim 9, wherein the one or more window registers is defined by the host processing device during a boot process for the memory mapped system.

### Claim 11 (depends on 9)

The computing device of claim 9, wherein each of the one or more window registers comprises both a base address and a window length, the base address and the window length configured to define an address space within the host memory that are to be accessible by the peripheral processing device.

### Claim 12 (depends on 8)

The computing device of claim 8, wherein the memory mapped system further comprises a window configuration register, the window configuration register configured to be read and/or written by the host processing device and the peripheral processing device.

### Claim 13 (depends on 12)

The computing device of claim 12, wherein the window configuration register further comprises an available window field and the peripheral processing device is further configured to write a value into the available window field; and
wherein the host processing device is further configured to read the value in the available window field, the read value being utilized by the host processing device in order to determine whether the host processing device should write a value to a windows enabled field of the window configuration register.

### Claim 14 (depends on 13)

The computing device of claim 13, wherein the host processing device is further configured to write a default value to the windows enabled field of the window configuration register, the default value being indicative of a legacy peripheral processing device that is incompatible with support of the one or more window registers.

### Claim 15 (depends on 12)

The computing device of claim 12, wherein the host processing device is further configured to write to one or more locking bits of the window configuration register, the one or more locking bits configured to prevent the update of any fields located within the one or more window registers.

### Claim 16

A peripheral processing device configured to register access violations of host memory within a memory mapped system, the peripheral processing device comprising:
a peripheral CPU, a peripheral MMU, peripheral memory and a peripheral direct memory access (DMA) unit and further comprising logic configured to:
receive one or more window registers defining an extent of address space within the host memory that is accessible by the peripheral processing device from a host processor;
generate an error message responsive to an attempt to access an extent of address space outside of the extent of accessible address space;
store the error message within a violation register; and
prevent access of the host memory by the peripheral processing device until the host processor has cleared the error message.

### Claim 17 (depends on 16)

The peripheral processing device of claim 16, wherein the prevention of access to the host memory comprises the generation of a nullified packet by the peripheral processing device and transmission of the nullified packet to the host processor.

### Claim 18 (depends on 17)

The peripheral processing device of claim 17, wherein the generation of the nullified packet by the peripheral processing device further comprises generation of an inverted data link layer cyclic redundancy check (LCRC) value for the nullified packet.

### Claim 19 (depends on 16)

The peripheral processing device of claim 16, wherein the generation of the error message comprises:
a generation of a memory address for the extent of address space outside of the extent of accessible address space;
a generation of a source for the attempt to access the extent of address space outside of the extent of accessible address space; and
a generation of a violation type for the attempt to access the extent of address space outside of the extent of accessible address space.

### Claim 20 (depends on 19)

The peripheral processing device of claim 19, wherein the generation of the source comprises a determination of one of the peripheral DMA or the peripheral CPU as the source of an illegal access attempt.
