# US 2024/0004659 A1 · Reducing instrumentation code bloat and performance overheads using a runtime call instruction

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

- Number: US 2024/0004659 A1
- Document ID: US20240004659A1
- Status: Published application
- Kind: A1
- Application number: 17/853,087
- Filed: 2022-06-29
- Published: 2024-01-04
- Earliest claimed: 2022-06-29
- Assignees: Intel Corporation
- Applicants: Intel Corporation
- Inventors: Michael LeMay; Dan Baum; Joseph Cihula; Joao Batista Correa Gomes Moreira; Anjo Lucas Vahldiek-Oberwagner; Scott Constable; Andreas Kleen; Konrad Lai; Henrique de Medeiros Kawakami; David M. Durham
- Web page: https://patentgrep.com/patent/US20240004659A1

## CPC

- G06F 9/30054: {Unconditional branch instructions}
- G06F 9/3016: {Decoding the operand specifier, e.g. specifier format}
- G06F 9/30101: {Special purpose registers}
- G06F 9/323: {for indirect branch instructions}
- G06F 9/3861: {Recovery, e.g. branch miss-prediction, exception handling (error detection or correction G06F11/00)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques for an instruction for a Runtime Call operation are described. An example apparatus comprises decoder circuitry to decode a single instruction, the single instruction to include a field for an identifier of an opcode, the opcode to indicate execution circuitry is to execute a no operation when a runtime call destination equals a predetermined value; and execute an indirect call with the runtime call destination as a destination address when the runtime call destination does not equal the predetermined value. Other examples are described and claimed.

## Claims

### Claim 1

An apparatus comprising:
decoder circuitry to decode a runtime call instruction, the runtime call instruction to include a field for an opcode, the opcode to indicate execution circuitry is to perform a runtime call operation; and
execution circuitry to execute the runtime call instruction according to the opcode to perform the runtime call operation to:
execute a “no operation” when a runtime call destination equals a predetermined value; and
execute an indirect call with the runtime call destination as a destination address when the runtime call destination does not equal the predetermined value.

### Claim 2 (depends on 1)

The apparatus of claim 1, comprising a predetermined register to store the runtime call destination.

### Claim 3 (depends on 1)

The apparatus of claim 1, comprising the apparatus to execute instructions of an instrumentation handler starting at the destination address.

### Claim 4 (depends on 3)

The apparatus of claim 3, the execution circuitry to perform the runtime call operation at a same privilege level as an application when the runtime call instruction is invoked from the instrumentation handler in user mode.

### Claim 5 (depends on 1)

The apparatus of claim 1, comprising the apparatus to execute instructions of a memory check handler starting at the destination address.

### Claim 6 (depends on 1)

The apparatus of claim 1, the execution circuitry to disable instrumentation when the runtime call destination equals the predetermined value.

### Claim 7 (depends on 1)

The apparatus of claim 1, wherein the predetermined value is zero.

### Claim 8 (depends on 1)

The apparatus of claim 1, wherein the predetermined value is a known invalid memory address.

### Claim 9 (depends on 1)

The apparatus of claim 1, comprising the execution circuitry to execute the runtime call instruction according to the opcode to perform the runtime call operation to set a runtime return destination to an address of a next instruction after the runtime call instruction and set an instruction pointer to the runtime call destination when the runtime call destination does not equal the predetermined value.

### Claim 10 (depends on 9)

The apparatus of claim 9, comprising the decoder circuitry to decode a runtime return instruction, the runtime return instruction to include a field for an opcode, the opcode to indicate execution circuitry is to perform a runtime return operation; and
execution circuitry to execute the runtime return instruction according to the opcode to perform the runtime return operation to generate an exception when a runtime call destination equals a predetermined value; and set an instruction pointer to the runtime return destination and set the runtime return destination to the predetermined value when the runtime return destination does not equal the predetermined value.

### Claim 11 (depends on 1)

The apparatus of claim 1, comprising a pair of registers to store a corresponding pair of destination addresses, wherein a first register of the pair is for a user mode and a second register of the pair is for a supervisor mode.

### Claim 12 (depends on 1)

The apparatus of claim 1, comprising the execution circuitry to execute the runtime call instruction according to the opcode to perform the runtime call operation to
generate a random value when the runtime call destination does not equal the predetermined value;
set a runtime return destination to an address of a next instruction after the runtime call instruction and set an instruction pointer to the runtime call destination when the random value is less than a range of the random value multiplied by a desired probability of executing a plurality of runtime call instructions; and
execute “a no operation” when the random value is not less than the range.

### Claim 13 (depends on 1)

The apparatus of claim 1, wherein the runtime call instruction to include a field for an immediate operand, the immediate operand to indicate a selected register to store the destination address.

### Claim 14 (depends on 1)

The apparatus of claim 1, wherein the runtime call instruction to include a field for an immediate operand, the immediate operand to indicate a selected register to store the destination address, the apparatus to execute instructions of a corresponding instrumentation handler starting at the destination address indicated by the selected register.

### Claim 15

A method, comprising:
fetching an instruction having fields for an opcode, the opcode indicating a runtime call operation;
decoding the instruction according to the opcode;
scheduling execution of the instruction; and
executing the decoded instruction to
execute a “no operation” when a runtime call destination equals a predetermined value; and
execute an indirect call with the runtime call destination as a destination address when the runtime call destination does not equal the predetermined value.

### Claim 16 (depends on 15)

The method of claim 15, comprising storing the runtime call destination in a predetermined register.

### Claim 17 (depends on 15)

The method of claim 15, comprising executing instructions of an instrumentation handler starting at the destination address.

### Claim 18 (depends on 17)

The method of claim 17, comprising executing the instruction at a same privilege level as an application when the runtime call instruction is invoked from the instrumentation handler in user mode.

### Claim 19 (depends on 15)

The method of claim 15, comprising executing instructions of a memory check handler starting at the destination address.

### Claim 20 (depends on 15)

The method of claim 15, comprising disabling instrumentation when the runtime call destination equals the predetermined value.

### Claim 21 (depends on 15)

The method of claim 15, wherein the predetermined value is zero.

### Claim 22 (depends on 15)

The method of claim 15, wherein the predetermined value is a known invalid memory address.

### Claim 23 (depends on 15)

The method of claim 15, comprising performing the runtime call operation to set a runtime return destination to an address of a next instruction after the instruction and set an instruction pointer to the runtime call destination when the runtime call destination does not equal the predetermined value.

### Claim 24 (depends on 23)

The method of claim 23, comprising fetching and decoding a runtime return instruction, the runtime return instruction to include a field for an opcode, the opcode to indicate execution circuitry is to perform a runtime return operation; and executing the runtime return instruction according to the opcode to perform the runtime return operation to generate an exception when a runtime call destination equals a predetermined value; and set an instruction pointer to the runtime return destination and set the runtime return destination to the predetermined value when the runtime return destination does not equal the predetermined value.

### Claim 25

A system, comprising:
a memory to store a runtime call instruction; and
a processor coupled to the memory, the processor to execute the runtime call instruction to execute a “no operation” when a runtime call destination equals a predetermined value; and
execute an indirect call with the runtime call destination as a destination address when the runtime call destination does not equal the predetermined value.

### Claim 26 (depends on 25)

The system of claim 25, comprising a predetermined register to store the runtime call destination.

### Claim 27 (depends on 25)

The system of claim 25, comprising the processor to execute instructions of an instrumentation handler starting at the destination address in the memory.

### Claim 28 (depends on 27)

The system of claim 27, the processor to execute the runtime call instruction at a same privilege level as an application when the runtime call instruction is invoked from the instrumentation handler in user mode.

### Claim 29 (depends on 25)

The system of claim 25, comprising the processor to execute instructions of a memory check handler starting at the destination address in the memory.

### Claim 30 (depends on 25)

The system of claim 25, the processor to disable instrumentation when the runtime call destination equals the predetermined value.
