# US 2010/0169894 A1 · Registering a user-handler in hardware for transactional memory event handling

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

- Number: US 2010/0169894 A1
- Document ID: US20100169894A1
- Status: Published application
- Kind: A1
- Application number: 12/346,518
- Filed: 2008-12-30
- Published: 2010-07-01
- Earliest claimed: 2008-12-30
- Assignees: Intel Corporation
- Inventors: Gad Sheaffer; Shlomo Raikin; Vadim Bassin
- Web page: https://patentgrep.com/patent/US20100169894A1

## CPC

- G06F 9/466: {Transaction processing}
- G06F 9/528: {by using speculative mechanisms}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method and apparatus for registering a user-handler in hardware for transactional memory is herein described. A user-accessible register is to hold a reference to a transactional handler. An event register may also be provided to specify handler events, which may be done utilizing user-level software, privileged software, or by hardware. When an event is detected execution vectors to the transaction handler based on the reference to the transactional handler held in the user-accessible register. The transactional handler handles the event and then execution returns to normal flow.

## Claims

### Claim 1

An apparatus comprising:
a storage element, which is to be modifiable by non-privileged software, to hold a reference to a transactional handler; and
execution resources coupled to the storage element to execute a transaction and to vector execution from the transaction to the transactional handler based on the reference to the transactional handler to be held in the storage element in response to a handler event.

### Claim 2 (depends on 1)

The apparatus of claim 1, wherein the storage element includes a register, and wherein the reference to the transactional handler includes a virtual address.

### Claim 3 (depends on 2)

The apparatus of claim 2, wherein execution resources to vector execution from the transaction to the transactional handler comprises the execution resources to perform a jump type of operation with a target address associated with the virtual address and the offset.

### Claim 4 (depends on 1)

The apparatus of claim 1, wherein the non-privileged software includes transactional runtime code.

### Claim 5 (depends on 1)

The apparatus of claim 1, wherein the handler event includes an asynchronous handler event.

### Claim 6 (depends on 1)

The apparatus of claim 1, wherein the handler event includes a synchronous handler event.

### Claim 7 (depends on 1)

The apparatus of claim 1, wherein the handler event includes an event selected from a group consisting of a lack of attribute information, a loss of attribute information, an execution of an instruction that is illegal within a transaction's scope, an access to a non-checkpointed register, a loss of monitored data, a loss of buffered data, an access to a memory type forbidden in the scope of a transaction, an exception, and a system call.

### Claim 8 (depends on 1)

The apparatus of claim 1, further comprising a second storage element, which is also to be modifiable by the non-privileged software, to specify a plurality of handler events including the handler event.

### Claim 9 (depends on 8)

The apparatus of claim 8, wherein the second storage element to specify a plurality of handler events comprises: the second storage element to hold a bit vector with each bit of the bit vector corresponding to one of the plurality of handler events, and wherein a bit corresponding to the handler event is to be set by the non-privileged software to enable the execution resources to vector execution to the transactional handler in response to the handler event.

### Claim 10 (depends on 8)

The apparatus of claim 8, further comprising a third storage element, which is to be readable by the non-privileged software, wherein the third storage element is to hold a status value to specify the handler event responsive to the execution resources vectoring execution from the transaction handler based on the reference to the transactional handler in response to the handler event.

### Claim 11 (depends on 10)

The apparatus of claim 10, further comprising a fourth storage element to be updated with a reference to a current instruction pointer before execution resources vector execution from the transaction to the transactional handler.

### Claim 12 (depends on 11)

The apparatus of claim 11, wherein in response to the transactional handler handling the handler event the execution resources are to execute a jump-type instruction with the current instruction pointer as the target to return execution to the transaction.

### Claim 13

A processor comprising:
a register capable of being updated by non-privileged level software to hold a reference to an address of a transactional handler; and
execution logic to transfer a control flow to the transaction handler without intervention of privileged level software in response to a handler event during execution of a transaction based on the reference to the address of the transactional handler.

### Claim 14 (depends on 13)

The processor of claim 13, wherein the address of the transactional handler is a starting address of the transactional handler, and wherein the reference to the address of the transactional handler includes a virtual address.

### Claim 15 (depends on 13)

The processor of claim 13, wherein the execution logic to transfer the control flow to the transaction handler without intervention of privileged level software in response to a handler event during execution of a transaction based on the reference to the address of the transactional handler comprises execution logic to execute a first jump-type operation utilizing the address of the transaction handler from the reference to the address of the transactional handler held in the register as a target address.

### Claim 16 (depends on 15)

The processor of claim 15, further comprising a return register, wherein the before the execution logic executes the jump-type operation utilizing the address of the transaction handler from the reference to the address of the transactional handler held in the register as the target address, the return register is to be updated with a reference to an instruction pointer address at a current point immediately before the execution logic executes the first jump type operation.

### Claim 17 (depends on 16)

The processor of claim 16, wherein the execution logic is further to execute the transaction handler to handle the handler event in response to executing the first jump-type operation, and wherein after execution logic executes the transaction handler to handle the handler event the execution logic is to execute a second jump-type operation utilizing the instruction pointer address from the reference to the instruction pointer address held in the return register to return to the current point immediately before the execution logic executes the first jump type operation.

### Claim 18 (depends on 13)

The processor of claim 13, wherein the handler event includes an asynchronous event selected from a group consisting of a lack of attribute information, a loss of attribute information, and a loss of buffered data.

### Claim 19 (depends on 13)

The processor of claim 13, wherein the handler event includes a synchronous event selected from a group consisting of an execution of an illegal instruction within a scope of the transaction, an access operation to a non-checkpointed register, an illegal memory type, an exception, and a system call.

### Claim 20 (depends on 13)

The processor of claim 13, wherein non-privileged level software includes software selected from a group consisting of operating system software, kernel software, and virtual machine monitor (VMM) software.

### Claim 21

An apparatus comprising:
a storage element capable of being updated by user-level software to specify a plurality of transactional handler events; and
execution logic to vector execution from a transaction to a transactional handler in response to detecting a transactional handler event of the plurality of transactional handler events.

### Claim 22 (depends on 21)

The apparatus of claim 21, wherein the execution resources to vector execution from the transaction to the transactional handler to be performed without Operating System (OS) intervention.

### Claim 23 (depends on 22)

The apparatus of claim 22, wherein the non-privileged software is selected from a group consisting of transactional runtime software, application code including the transaction, and virtual machine code.

### Claim 24 (depends on 21)

The apparatus of claim 21, wherein a first transactional handler event of the plurality of events includes an asynchronous handler event, and wherein a second transactional handler event of the plurality of events includes a synchronous handler event.

### Claim 25 (depends on 21)

The apparatus of claim 21, wherein a first transactional handler event of the plurality of events includes an asynchronous handler event, and wherein a second transactional handler event of the plurality of events includes a synchronous handler event.

### Claim 26 (depends on 21)

The apparatus of claim 21, wherein the plurality of handler events are each individually selected from a group consisting of a lack of attribute information, a loss of attribute information, an execution of an instruction that is illegal within a transaction's scope, an access to a non-checkpointed register, and a loss of monitored data.

### Claim 27

A system comprising:
a processor including a user-addressable register to hold a reference to a transactional handler, a second register, and execution logic coupled to the first and the second register, wherein in response to a handler event during execution of a transaction, the execution logic is to update the second register with a reference to a current instruction location within the transaction, direct control flow to the transactional handler based on the reference to the transactional handler held in the user-addressable register to handle the handler event, and direct control flow back to the current instruction location based on the reference to the current instruction location held in the second register after execution of the transaction handler to handle the handler event; and
an input/output (I/O) device coupled to the processor.

### Claim 28 (depends on 27)

The system of claim 27, wherein the reference to the transactional handler includes a virtual address and an offset, when translated to a physical address, to reference a starting physical address of the transactional handler.

### Claim 29 (depends on 28)

The system of claim 28, wherein user-code including the transaction, when executed, is to load the user-addressable register with the virtual address and the offset before execution of the transaction.

### Claim 30 (depends on 27)

The system of claim 27, wherein the reference to the current instruction location within the transaction includes a reference to an instruction pointer address associated with the current instruction location, and wherein the execution logic to direct control flow back to the current instruction location based on the reference to instruction pointer address held in the second register comprises the execution logic to execute a return jump operation with the instruction pointer address as a return target address.

### Claim 31 (depends on 30)

The system of claim 30, wherein the execution logic to direct control flow to the transactional handler based on the reference to the transactional handler held in the user-addressable register to handle the handler event comprises the execution logic to execute a jump operation with a target address associated with the reference to the transactional handler held in the user-addressable register as a target address.

### Claim 32

A method comprising:
registering a transactional handler with non-privileged level software in hardware of a processor;
detecting a handler event during execution of a transaction with the processor;
directing a control flow from execution of the transaction to execution of the transactional handler in hardware without intervention of privileged-level software; and
returning the control flow to execution of the transaction without intervention of the privileged level software after handling the handler event with the transactional handler.

### Claim 33 (depends on 32)

The method of claim 32, wherein registering a transactional handler with non-privileged level software in hardware of a processor comprises loading a first register with a representation of an address associated with the transactional handler.

### Claim 34 (depends on 33)

The method of claim 33, further comprising storing an instruction pointer address in a second register before directing a control flow from execution of the transaction to execution of the transactional handler.

### Claim 35 (depends on 34)

The method of claim 34, wherein directing a control flow from execution of the transaction to execution of the transactional handler in hardware without intervention of privileged-level software comprises jumping execution to the address associated with the transactional handler without intervention of the privileged level software for execution of the transactional handler.

### Claim 36 (depends on 35)

The method of claim 35, wherein returning the control flow to execution of the transaction without intervention of the privileged level software after handling the handler event with the transactional handler comprises jumping execution to the instruction pointer address stored in the second register without intervention of the privileged level software after handling the handler event with the transactional handler.

### Claim 37 (depends on 34)

The method of claim 34, further comprising specifying the handler event with the non-privileged level software in a third register before detecting the handler event.

### Claim 38 (depends on 37)

The method of claim 37, further comprising update a fourth register to hold a representation of the handler event before directing the control flow from execution of the transaction to execution of the transactional hardware in response to detecting the handler event.
