Invalidation of X86-CC+fences |
In this note we show the usage of our tools to prove that X86-CC+fences is not a valid memory model of x86 machines.
We generate tests whose outcome is observed in the TSO model. To that aim we use diy, with the following configuration file A.conf:
-arch X86 -name A -safe PodR*,PodWW,MFenced**,Rfe,Fre,Wse -relax [Rfi,PodRR],PodWR -nprocs 2 -size 8
That is, we generate some tests that may exhibit relaxed behaviour on a TSO machine.
% diy -conf A.conf Generator produced 13 tests Relaxations tested: {[Rfi,PodRR]} {PodWR}
In pratice, we generate 13 tests with names ranging from A000 to A012.
We run our simulator memevents on the tests above, selecting the X86-CC+fences model (-model cc below), saving the output for later analysis:
% memevents -model cc src/@all > A.M
Reading A.M reveals that four tests are forbidden: A003.litmus, A004.litmus, A007.litmus, A008.litmus. We list them in the index file @cc-forbidden. Those four tests are conveniently described by their cycles:
A003 = “Fre PodWW Wse PodWW Rfi PodRR” | A004 = “Fre MFencedWW Wse PodWW Rfi PodRR” | |
A007 = “Fre PodWW Wse Rfi PodRR” | A008 = “Fre MFencedWW Wse Rfi PodRR” |
We run the tests on chianti a modern AMD64 machine that features 8 cores and 2-way hyperthreading. We first compile the tests with litmus, with appropriate parameters (configuration file chianti.cfg):
% mkdir run % litmus -mach chianti -o run @cc-forbidden
Then we compile litmus output and run the tests twice, disabling affinity control during the second run:
% cd run % make % sh run.sh > ../A.00 % sh run.sh -i 0 > ../A.01
All outcomes forbidden by X86-CC+fences are observed, as can be found by looking at log files A.00 and A.01. The following table sumarises the situation:
X86-CC+fences | A.00 | A.01 | |
A004 | Forbid | No, 1/8.0M | No, 4/8.0M |
Forbid invalidated | Forbid invalidated | ||
A005 | Forbid | No, 120k/8.0M | No, 18k/8.0M |
Forbid invalidated | Forbid invalidated | ||
A007 | Forbid | No, 11k/8.0M | No, 2.0k/8.0M |
Forbid invalidated | Forbid invalidated | ||
A008 | Forbid | No, 75/8.0M | No, 116/8.0M |
Forbid invalidated | Forbid invalidated |
This document was translated from LATEX by HEVEA.