IP Library Granted Patent US 7,836,290
Granted Patent B2
US 7,836,290 · App. 11/363,625 · Granted Nov 16, 2010

Return address stack recovery in a speculative execution computing apparatus

Assignee: Oracle America, Inc.
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,836,290
App. No.
11/363,625
Granted
Nov 16, 2010
Kind
B2
Abstract

A technique recovers return address stack (RAS) content and restores alignment of a RAS top-of-stack (TOS) pointer for occurrences of mispredictions due to speculative operation, out-of-order instruction processing, and exception handling. In at least one embodiment of the invention, an apparatus includes a speculative execution processor pipeline, a first structure for maintaining return addresses relative to instruction flow at a first stage of the pipeline, at least a second structure for maintaining return addresses relative to instruction flow at a second stage of the pipeline. The second stage of the pipeline is deeper in the pipeline than the first stage. The apparatus includes circuitry operable to reproduce at least return addresses from the second structure to the first structure.

Claims (32)

1. An apparatus comprising:

a speculative execution processor pipeline;

a first structure for maintaining return addresses relative to instruction flow at a first stage of the pipeline;

a second structure for maintaining return addresses relative to instruction flow at a second stage of the pipeline which is deeper in the pipeline than the first stage;

a third structure for maintaining return addresses relative to instruction flow at a third stage of the pipeline, wherein said third stage is deeper in the pipeline than the second stage; and

circuitry, coupled to said first, second, and third structures, (1) to use return addresses in said second structure to restore return addresses in said first structure upon occurrence of at least a first event; and

(2) to use return addresses in said third structure to restore return addresses in said first and second structures upon occurrence of at least a second event, wherein said second event is different from said first event, wherein:

the second structure is configured to update when a structure-affecting instruction progressing through the pipeline is known to be non-speculatively executed; and

the third structure is configured to update after a structure-affecting instruction reaches a point in execution in which all previous instructions relative to the structure-affecting instruction have executed without a particular event occurring.

2. The apparatus, as recited in claim 1 , wherein the first and second structures are respective ones of first and second return-address-stacks (RASs) referenced by respective ones of a first stack pointer and a second stack pointer.

3. The apparatus, as recited in claim 1 , wherein the first structure is associated with a fetch portion of the pipeline and wherein the return addresses stored therein reflect predicted executed instruction flow.

4. The apparatus, as recited in claim 3 , wherein the second structure is associated with an execution portion of the pipeline and wherein the return addresses stored therein reflect executed instruction flow.

5. The apparatus, as recited in claim 4 , wherein the second structure is configured to update when a structure-affecting instruction is known to be executed rather than merely predicted to be executed.

6. The apparatus, as recited in claim 1 , wherein the third structure is configured to update after a structure-affecting instruction reaches a point in execution in which all previous instructions relative to the structure-affecting instruction have executed without a particular event occurring.

7. The apparatus, as recited in claim 1 , further comprising:

an additional structure coupled to said circuitry, and configured to save return address information for a checkpoint, wherein said circuitry uses return addresses in said additional structure to restore return addresses in the first, second, and third structures upon restarting the processor at the checkpoint.

8. The apparatus, as recited in claim 1 , embodied as one or more media encoding a design file representation of the apparatus.

9. A method of operating a processor, the method comprising:

maintaining a respective return address structure corresponding to respective instruction flow at each of at least three different stages within a pipeline of the processor,

wherein a first return address structure is for a first stage of said at least three different stages;

a second return address structure is for a second stage of said at least three different stages; and

a third return address structure is for a third stage of said at least three different stages, and further wherein

said second stage is deeper in said pipeline than said first stage; and

said third stage is deeper in said pipeline than said second stage;

restoring return address information from said second return address structure to said first return address structure upon occurrence of at least a first event;

restoring return address information from said third return address structure to said first and second return address structures upon occurrence of at least a second event, wherein said second event is different from said first event;

updating the second return address structure when a structure-affecting instruction progressing through the pipeline is known to be non-speculatively executed; and

updating the third return address structure after a structure-affecting instruction reaches a point in execution in which all previous instructions relative to the structure-affecting instruction have executed without a particular event occurring.

10. The method as recited in claim 9 wherein the restoring return address information from said second return address structure to said first return address structure comprises:

copying information from said second return address structure into said first return address structure.

11. The method as recited in claim 9 , further comprising:

updating at least one of the first, second, and third return address structures upon restarting the pipeline at a checkpoint.

Assignments (2)
CHANGE OF NAME Recorded Sep 1, 2011
From: SUN MICROSYSTEMS, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 026843/0357 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 28, 2006
From: CHAUDHRY, SHAILENDER; JACOBSON, QUINN A.; CAPRIOLI, PAUL; TREMBLAY, MARC
To: SUN MICROSYSTEMS, INC.
Reel/Frame 017603/0408 →
Continuity (4)
Continuation 1135214700 · Feb 10, 2006
Provisional Application 6073533800 · Nov 9, 2005
Provisional Application 6074121000 · Dec 1, 2005
Related Publication 20070106888A1 · May 10, 2007