Questions tagged [speculative-execution]
46 questions
31
votes
3 answers
Why do we need 'seq' or 'pseq' with 'par' in Haskell?
I'm trying to understand why we need all parts of the standard sample code:
a `par` b `pseq` a+b
Why won't the following be sufficient?
a `par` b `par` a+b
The above expression seems very descriptive: Try to evaluate both a and b in parallel, and…

kirakun
- 2,770
- 1
- 25
- 41
22
votes
3 answers
difference between speculation and prediction
In computer architecture,
what is difference between (branch) prediction and speculation??
These seems very similar, but i think there is a subtle distinction between them.

enc
- 3,345
- 4
- 21
- 22
16
votes
2 answers
Out-of-order execution vs. speculative execution
I have read the wikipedia page about out-of-order execution and speculative exectution.
What I fail to understant though are the similarities and differences. It seems to me that speculative execution uses out-of-order execution when it has not…

Name
- 399
- 2
- 13
14
votes
1 answer
Why flush the pipeline for Memory Order Violation caused by other logical processors?
The Memory Order Machine Clear performance event is described by the vTune documentation as:
The memory ordering (MO) machine clear happens when a snoop request from another processor matches a source for a data operation in the pipeline. In this…

Margaret Bloom
- 41,768
- 5
- 78
- 124
12
votes
1 answer
What exactly happens when a skylake CPU mispredicts a branch?
I'm trying to understand in detail what happens to instructions in the various stages of the skylake CPU pipeline when a branch is mis-predicted, and how quickly instructions from the correct branch destination can start executing.
So lets label…

Steve Linton
- 349
- 4
- 12
11
votes
1 answer
Will Speculative Execution Follow Into an Expensive Operation?
If I understand branching correctly (x86), the processor will sometimes speculatively take a code path and perform the instructions and 'cancel' the results of the wrong path. What if the operation in the wrong codepath is very expensive, like a…

user1043761
- 696
- 6
- 22
10
votes
1 answer
ARM prefetch workaround
I have a situation where some of the address space is sensitive in that you read it you crash as there is nobody there to respond to that address.
pop {r3,pc}
bx r0
0: e8bd8008 pop {r3, pc}
4: e12fff10 bx r0
8: bd08 …

old_timer
- 69,149
- 8
- 89
- 168
9
votes
1 answer
Why not just predict both branches?
CPU's use branch prediction to speed up code, but only if the first branch is actually taken.
Why not simply take both branches? That is, assume both branches will be hit, cache both sides, and the take the proper one when necessary. The cache does…

AbstractDissonance
- 1
- 2
- 16
- 31
8
votes
1 answer
Can a speculatively executed CPU branch contain opcodes that access RAM?
As I understand, when a CPU speculatively executes a piece of code, it "backs up" the register state before switching to the speculative branch, so that if the prediction turns out wrong (rendering the branch useless) -- the register state would be…

golosovsky
- 638
- 1
- 6
- 19
8
votes
3 answers
What are the differences between Meltdown and Spectre?
What are the key differences between recently discovered hardware vulnerabilities Meltdown and Spectre? I know that they both rely on speculative execution, but how does they differ from each other?

Dragonight
- 1,033
- 2
- 10
- 20
8
votes
2 answers
Haskell speculative parallel execution
I am thinking about exploiting parallelism for one problem I am trying to solve. The problem is roughly this: given input (sequence of points) find a best output (biggest triangle composed from these points, longest line etc.). There are 3 different…

ondra
- 9,122
- 1
- 25
- 34
7
votes
1 answer
Has Hardware Lock Elision gone forever due to Spectre Mitigation?
Is this correct that Hardware Lock Elision is disabled for all current CPUs due to Spectre mitigation, and any attempt to have a mutex using HLE intrinsics/instructions would result in usual mutex?
Is this likely that there will not be anything like…

Alex Guteniev
- 12,039
- 2
- 34
- 79
7
votes
1 answer
What are the microarchitectural details behind MSBDS (Fallout)?
CVE-2018-12126 has been assigned to MSBDS (Microarchitectural StoreBuffer Data Sampling), a vulnerability of Intel's processors belonging to the newly created MDS (Microarchitectural Data Sampling) class.
I'm trying to get the microarchitectural…

Margaret Bloom
- 41,768
- 5
- 78
- 124
7
votes
2 answers
Hadoop multiple outputs with speculative execution
I have a task which writes avro output in multiple directories organized by few fields of the input records.
For example :
Process records of countries across years
and write in a directory structure of country/year…

rakesh99
- 1,234
- 19
- 34
6
votes
2 answers
What happens with nested branches and speculative execution?
Alright, so I know that if a particular conditional branch has a condition that takes time to compute (memory access, for instance), the CPU assumes a condition result and speculatively executes along that path. However, what would happen if, along…

C. Pinto
- 83
- 4