52 questions
0
votes
0
answers
72
views
Can the OoO scheduler squash pending instructions (issued by earlier validations) based on predictable behavior?
In the idiom:
while (exp == V.loadRelaxed()) { // allows the early issuing of any n-loads that'd fit within the speculative window.
if (V.weakRMWRelease(exp, set)) return true; // ^^ (upward ...
0
votes
0
answers
92
views
How does a failed spinlock CAS affect out-of-order speculation and RMW reordering on weak memory architectures?
I’m trying to understand how speculative execution interacts with weak memory models (ARM/Power) in the context of a spinlock implemented with a plain CAS. Example:
// Spinlock acquisition attempt
if (...
0
votes
0
answers
51
views
How does the ROB track instructions from multiple logical threads in a core?
If a core supports simultaneous multithreading (SMT) and executes multiple logical threads, how does the Reorder Buffer (ROB) differentiate which instruction belongs to which logical thread?
...
1
vote
0
answers
134
views
What is Memory Ordering Nuke in Intel CPUs?
I found this term in https://rcs.uwaterloo.ca/~ali/cs854-f23/papers/topdown.pdf
For example, incorrect data speculation
generated Memory Ordering Nukes [7] - a subset of Machine
Clears.
What is it ...
5
votes
0
answers
116
views
Does the SERIALIZE instruction prevent speculative execution?
Recently came across the SERIALIZE instruction.
Serializes instruction execution. Before the next instruction is
fetched and executed, the SERIALIZE instruction ensures that all
modifications to ...
3
votes
1
answer
252
views
Can speculative execution of modern CPUs cross loop iterations?
Consider below loop (https://godbolt.org/z/z4Wz1aanK) that has no loop-carried dependence. Will modern CPU speculatively execute next iteration with previous one? if true, is loop expansion still ...
1
vote
1
answer
583
views
Measure the number of executed instructions including *speculative*
I'd like to measure the number of instructions executed in my program including speculative instructions that didn't retire.
I know that linux perf can easily report the retired instruction count with:...
0
votes
1
answer
539
views
How debuggers deal with out-of-order execution and branch prediction
I know that modern CPUs do OoO execution and got advanced branch predictors that may fail, how does the debugger deal with that? So, if the cpu fails in predicting a branch how does the debugger know ...
5
votes
1
answer
230
views
Emulate attribute "unpredictable"
There are [[likely]] and [[unlikely]] attributes in modern C++. There are corresponding __builtin_expect(x, 1) and __builtin_expect(x, 0) builtins in G++ and clang++. But also there are ...
0
votes
0
answers
35
views
EPT violations through speculative execution [duplicate]
Can speculative execution cause an Extended Page Table (EPT) violation on x86 processors?
Assume I want to access a structure that has different Guest Physical Address (GPA) to Host Physical Address (...
1
vote
0
answers
171
views
Speculative execution and malloc
After reading about Spectre & Meltdown vulnerabilities, I learned about speculative execution.
Given the following simple C++ program:
#include <stdlib.h>
void mallocBranch(int i) {
if (...
1
vote
0
answers
157
views
Spark: While using Speculation property, application is failing randomly with Failed to CREATE_FILE
I have enabled speculative property in my algorithm. With the property, when i executed the Job, Out of 10 times, 8 times the Job completed without any issue and it completed fast as well. But 2 times ...
1
vote
1
answer
631
views
How are writes managed in Spark with speculation enabled?
Let's say I have a Spark 2.x application, which has speculation enabled (spark.speculation=true), which writes data to a specific location on HDFS.
Now if the task (which writes data to HDFS) takes ...
14
votes
1
answer
4k
views
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 (...
0
votes
0
answers
372
views
Branch Misprediction Recovery in RISC-V
I'm now trying to implement pipeline CPU based on RV32I ISA.
My CPU has renaming algorithm for data hazards and branches prediction for control hazards.
This is my example code for renaming ...
9
votes
1
answer
1k
views
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?
...
3
votes
0
answers
177
views
What is the use case for `Interlocked.SpeculationBarrier` in C#?
There is a new function Interlocked.SpeculationBarrier since .net framework 4.8. I have been curious and looking for more information about this but couldn't really find out why this is included or ...
0
votes
1
answer
58
views
Are there any security risks, from server side prefetching of database data?
I'm coding a web app at present that uses an Implicit Grant flow for the browser to obtain an ID token that is attached to all subsequent requests to the backend api.
On my backend, whenever a ...
3
votes
1
answer
752
views
Is there a limit to new tasks for Spark speculation?
Let's say I run a job in Spark with speculation = true.
If a task (let's say T1) takes a long time, Spark would launch a copy of task T1, say, T2 on another executor, without killing off T1.
Now, if ...
6
votes
2
answers
2k
views
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 ...
2
votes
1
answer
102
views
Are there CPU doing speculative execution that virtualize memory locations?
Consider the classical reuse of a register after an expensive computation, in pseudo assembly:
r2 = cos(r1)
*(r3) = r2
r2 = r5 + r6
*(r4) = r2
To be able to use the arithmetic units fully, the ...
0
votes
1
answer
233
views
Is it possible that speculative execution on intel CPU causing EXC_BAD_INSTRUCTION (SIGILL)
I have a hypothesis that speculative execution on Intel Nehalem (1 gen) causing a crash. Is it possible or I completely wrong? If this is possible what can I do to prevent this? Maybe disable ...
0
votes
0
answers
120
views
Arm Cortex-A8 program flow prediction
I am examining ARM-Cortex A8 flow prediction abilities, in order to done this i implemented below code:
char SecretDispatcher[256 * 512];
int counter = 0;
//evicting SecretDispatcher from cache
...
...
4
votes
0
answers
118
views
What is the microarchitectural root cause of ZombieLoad?
My interpretation is that, on a TLB miss, the PMH walks the page table and performs stuffed loads into the load buffer; if it encounters accessed or dirty bits that need to be set it communicates an ...
7
votes
1
answer
670
views
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) ...
16
votes
1
answer
2k
views
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 ...
4
votes
1
answer
175
views
Why is this specpoline not working on Kaby lake?
I'm trying to create a specpoline (cfr. Henry Wong) on my Kabe lake 7600U, I'm running CentOS 7.
The full testing repository is available on GitHub.
My version of the specpoline is as follow (cfr. ...
15
votes
1
answer
4k
views
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 ...
0
votes
1
answer
266
views
Is there any case where the Bimodal will be better than Not take?
Considering these two methods:
Dynamic Bimodal:
Where we have 4 stages, 2 stages for each (taken or not taken), and alternating every time the algorithm predicts wrong, changing from taken<->not ...
10
votes
1
answer
2k
views
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 ...
19
votes
2
answers
12k
views
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 ...
3
votes
2
answers
378
views
Does a processor perform speculative execution on a function pointer table?
If one has a function pointer table, and the index is provided as a volatile variable, will the generated code be considered branchless, and this avoid speculative execution, or will the processor ...
0
votes
0
answers
212
views
Speculative execution for reducers in Hadoop not triggered
I have set the following flags so that speculative execution gets triggered for my MR jobs. There is some bad hardware causing jobs to run very long (8-9 hours instead of regular 1.5 - 3 hours) and ...
9
votes
3
answers
6k
views
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?
3
votes
1
answer
731
views
Why CPU speculative execution does not cause OOB program crash?
The questions stems from reading the Spectre attack paper. If I understand it correctly the attack stems from the possibility of CPU heuristics speculatively executing (the wrong) branch of code.
...
11
votes
1
answer
3k
views
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}
...
1
vote
2
answers
10k
views
Speculative execution Mapreduce/Spark
I know Hadoop/Spark framework will detect failed or slow machines and execute the same tasks on different machine. How will (On what basis) framework identifies the
slow running machines. Is there ...
6
votes
1
answer
1k
views
Can instruction order happen cross function call?
Suppose I have pseudo C code like below:
int x = 0;
int y = 0;
int __attribute__ ((noinline)) func1(void)
{
int prev = x; (1)
x |= FLAG; (2)
return prev; (3)
}
int main(void)
{
...
11
votes
1
answer
805
views
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 ...
7
votes
2
answers
751
views
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 ...
1
vote
1
answer
124
views
Undefined CPU instructions without execution cause bugs?
Now I try to dispatch codes dynamically, for example, SSE, AVX and so on.
In a binary file, all codes which will be dispatched at the time of execution are bundled.
I worry that undefined CPU ...
5
votes
4
answers
16k
views
Differences between MapReduce and Yarn
I was searching about hadoop and mapreduce with respect to straggler problems and the papers in this problem
but yesterday I found that there is hadoop 2 with Yarn ,,
unfortunately no paper is talking ...
2
votes
1
answer
64
views
Name for programming pattern used by Mathematica
Since Mathematica 7.0, there is ParallelTry function [1] that evaluates multiple functions in parallel, returning the first result received. This is similar to parallelizing a search on a disjoint ...
14
votes
1
answer
1k
views
Can branch prediction crash my program?
Going trough chapter 3 of this book called Computer Systems Architecture: A programmer's perspective, it is stated that an implementation like
testl %eax, %eax
cmovne (%eax), %edx
is invalid because ...
-1
votes
2
answers
313
views
Hadoop speculative execution testing
I am working on Hadoop for my master thesis, Hadoop 1.1.2.
I am studying a new algorithm for speculative task and so in this first step i m trying to apply some changes in the code.
Sadly, also ...
2
votes
2
answers
2k
views
How can I turn off hadoop speculative execution from Java
After reading Hadoop speculative task execution I am trying to turn off speculative execution using the new Java api, but it has no effect.
This is my Main class:
public class Main {
public ...
12
votes
3
answers
1k
views
Can branch prediction cause illegal instruction?
In the following pseudo-code:
if (rdtscp supported by hardware) {
Invoke "rdtscp" instruction
} else {
Invoke "rdtsc" instruction
}
Let's say the CPU does not support the rdtscp instruction ...
1
vote
2
answers
2k
views
Hadoop Reducer: How can I output to multiple directories using speculative execution?
I have a reducer that needs to output results to different directories so that we can later use the output as input to Hive as a partitioned table. (Hive creates partitions based on folder name). In ...
2
votes
1
answer
485
views
How can I prevent Firefox from speculative load of a javascript file?
I have some javascript code in the HEAD that sets a cookie. Later at the bottom of the page I load another javascript file. This file is served by a dynamic back-end page that uses the cookie to ...
23
votes
3
answers
17k
views
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.