IP Library › Granted Patent US 10,866,805
Granted Patent B2
US 10,866,805 · App. 16/208,701 · Granted Dec 15, 2020

Speculation barrier instruction

Inventors: Richard Roy Grisenthwaite (Cambridge, GB); Giacomo Gabrielli (Cambridge, GB); Matthew James Horsnell (Cambridge, GB)
Assignee: Arm Limited
G06F9/30087G06F9/30058G06F9/3834G06F9/3842G06F12/0875G06F12/1491G06F21/71G06F2212/1052
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 10,866,805
App. No.
16/208,701
Granted
Dec 15, 2020
Kind
B2
Abstract

An apparatus comprises processing circuitry to perform data processing and instruction decoding circuitry to decode instructions to control the processing circuitry to perform the data processing. The instruction decoding circuitry is responsive to a speculation barrier instruction to control the processing circuitry to prevent a subsequent operation, appearing in program order after the speculation barrier instruction, that has an address dependency on an earlier instruction preceding the speculation barrier instruction in the program order, from speculatively influencing allocations of entries in a cache. This provides protection against speculative cache-timing side-channel attacks.

Claims (53)

1. An apparatus comprising:

processing circuitry to perform data processing; and

instruction decoding circuitry to decode instructions to control the processing circuitry to perform the data processing;

in which:

the instruction decoding circuitry is responsive to a speculation barrier instruction to control the processing circuitry to prevent a subsequent operation, appearing in program order after the speculation barrier instruction, that has an address dependency on an earlier instruction preceding the speculation barrier instruction in the program order, from speculatively influencing allocations of entries in a cache, and

the processing circuitry is configured to permit speculative execution of conditional instructions following the speculation barrier instruction unless they use results of a data value prediction or condition code prediction of the earlier instruction when the earlier instruction has not yet been architecturally resolved.

2. The apparatus according to claim 1 , in which said subsequent operation is one of a load instruction and a store instruction.

3. The apparatus according to claim 1 , in which said earlier instruction is a load instruction.

4. The apparatus according to claim 1 , in which said cache is one of:

a data cache;

an instruction cache; and

a branch prediction cache.

5. The apparatus according to claim 1 , in which the processing circuitry is configured to prevent said subsequent operation from speculatively influencing allocations of entries in the cache while permitting speculative execution of said subsequent operation.

6. The apparatus according to claim 1 , in which the processing circuitry is configured to prevent said subsequent operation from speculatively influencing allocations of entries in the cache by preventing speculative execution of said subsequent operation, until the speculation barrier instruction completes.

7. The apparatus according to claim 1 , in which in response to the speculation barrier instruction, the instruction decoding circuitry is configured to control the processing circuitry to prevent the subsequent instruction being speculatively executed using at least one of:

the data value prediction for the earlier instruction;

the condition code prediction for the earlier instruction when the earlier instruction is an instruction other than a conditional branch instruction; and

when the earlier instruction is a vector instruction dependent on predicate information indicative of which data elements of a vector value are active elements, a prediction of said predicate information.

8. The apparatus according to claim 1 , in which the processing circuitry is configured to permit speculative control of control flow of instructions following the speculation barrier instruction based on a prediction associated with an architecturally unresolved earlier instruction preceding the speculation barrier instruction.

9. The apparatus according to claim 1 , in which in response to a store-speculation barrier instruction, the instruction decoding circuitry is configured to prevent an earlier store instruction preceding the store-speculation barrier instruction in the program order being bypassed by speculative execution of a subsequent load instruction following the store-speculation barrier instruction in the program order which specifies the same address as the earlier store instruction.

10. The apparatus according to claim 9 , in which in response to the store-speculation barrier instruction, the instruction decoding circuitry is configured to prevent an earlier load instruction preceding the store-speculation barrier instruction in the program order speculatively loading data resulting from a subsequent store instruction following the store-speculation barrier instruction in the program order which specifies the same address as the earlier load instruction.

11. The apparatus according to claim 9 , in which for a first variant of the store-speculation barrier instruction, the subsequent load instruction specifies the same virtual address as the earlier store instruction.

12. The apparatus according to claim 9 , in which for a second variant of the store-speculation barrier instruction, the subsequent load instruction specifies the same physical address as the earlier store instruction.

13. An apparatus comprising:

processing circuitry to perform data processing; and

instruction decoding circuitry to decode instructions to control the processing circuitry to perform the data processing;

in which:

the instruction decoding circuitry is responsive to a speculation barrier instruction to control the processing circuitry to prevent a subsequent operation, appearing in program order after the speculation barrier instruction, that has an address dependency on an earlier instruction preceding the speculation barrier instruction in the program order, from speculatively influencing allocations of entries in a cache, and

until the speculation barrier instruction completes:

when a load, store, data, or instruction preload operation appears in the program order after the speculation barrier instruction, and the load, store, data, or instruction preload operation has an address dependency on a result of a conditional select instruction, where:

the conditional select instruction has a register data dependency on a load that has been executed speculatively for one of its input registers, and

the conditional select instruction does not have a register dependency on the load that has been executed speculatively for its other input register, and

the condition for the conditional select instruction is such that the input that is not dependent on the load that has been executed speculatively is selected if the load that has been executed speculatively is not architecturally executed,

then the processing circuitry is configured to prevent the load, store, data, or instruction preload operation influencing allocations of entries in the cache in a way that can be used to determine any part of a value of a speculatively loaded value from the load that has been executed speculatively by an evaluation of which entries in the cache have been allocated or evicted.

14. An apparatus comprising:

processing circuitry to perform data processing; and

instruction decoding circuitry to decode instructions to control the processing circuitry to perform the data processing:

in which:

the instruction decoding circuitry is responsive to a speculation barrier instruction to control the processing circuitry to prevent a subsequent operation, appearing in program order after the speculation barrier instruction, that has an address dependency on an earlier instruction preceding the speculation barrier instruction in the program order, from speculatively influencing allocations of entries in a cache, and

until the speculation barrier instruction completes:

when a load, store, data, or instruction preload operation appears in the program order after the speculation barrier instruction, and the load, store, data, or instruction preload operation has an address dependency on a result of a conditional move instruction, where:

the conditional move instruction does not have a register dependency on a load that has been executed speculatively for its input register, and

the condition for the conditional move instruction is such that the condition passes if the load that has been executed speculatively is not architecturally executed,

then the processing circuitry is configured to prevent the load, store, data, or instruction preload operation influencing allocations of entries in the cache in a way that can be used to determine any part of a value of a speculatively loaded value from the load that has been executed speculatively by an evaluation of which entries in the cache have been allocated or evicted.

15. A non-transitory, computer-readable storage medium storing a computer program, which when executed by one or more hardware processors, control a host processing apparatus to provide an instruction execution environment for executing instructions of target program code, the computer program comprising:

instruction decoding program logic to decode instructions of the target program code to control processing program logic to perform data processing;

in which:

the instruction decoding program logic is responsive to a speculation barrier instruction to prevent a subsequent operation, appearing in program order after the speculation barrier instruction, that has an address dependency on an earlier instruction preceding the speculation barrier instruction in the program order, from speculatively influencing allocations of entries in a cache, and

the instruction execution environment is configured to permit speculative execution of conditional instructions following the speculation barrier instruction unless they use results of a data value prediction or condition code prediction of the earlier instruction when the earlier instruction has not yet been architecturally resolved.

16. A data processing method comprising:

decoding a speculation barrier instruction;

in response to decoding of the speculation barrier instruction, controlling processing circuitry to prevent a subsequent operation, appearing in program order after the speculation barrier instruction, that has an address dependency on an earlier instruction preceding the speculation barrier instruction in the program order, from speculatively influencing allocations of entries in a cache; and

the processing circuitry permitting speculative execution of conditional instructions following the speculation barrier instruction unless they use results of a data value prediction or condition code prediction of the earlier instruction when the earlier instruction has not yet been architecturally resolved.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 4, 2018
From: GRISENTHWAITE, RICHARD ROY; GABRIELLI, GIACOMO; HORSNELL, MATTHEW JAMES
To: ARM LIMITED
Reel/Frame 047714/0912 →
Continuity (2)
Provisional Application 62613280 · Jan 3, 2018
Related Publication 20190205140A1 · Jul 4, 2019
Cited By (3)
US 12,450,068 US 12,578,965 US 12,657,030