enum StandardCpuidFunction {
VendorAndLargestStdFunc,
FamilyModelStepping,
+ CacheAndTLB,
+ SerialNumber,
+ CacheParams,
+ MonitorMwait,
+ ThermalPowerMgmt,
+ ExtendedFeatures,
NumStandardCpuidFuncs
};
result = CpuidResult(0x00020f51, 0x00000805,
0xe7dbfbff, 0x04000209);
break;
+ case ExtendedFeatures:
+ result = CpuidResult(0x00000000, 0x01800000,
+ 0x00000000, 0x00000000);
+ break;
default:
warn("x86 cpuid family 0x0000: unimplemented function %u",
funcNum);
0x3: Inst::STMXCSR(Md);
0x4: xsave();
0x5: xrstor();
- 0x6: Inst::UD2();
- 0x7: clflush();
+ 0x6: decode LEGACY_DECODEVAL {
+ 0x0: Inst::UD2();
+ 0x1: Inst::CLWB(Mb);
+ default: Inst::UD2();
+ }
+ 0x7: decode LEGACY_DECODEVAL {
+ 0x0: Inst::CLFLUSH(Mb);
+ 0x1: Inst::CLFLUSHOPT(Mb);
+ default: Inst::CLFLUSH(Mb);
+ }
}
}
0x7: Inst::IMUL(Gv,Ev);
ld t0, seg, riprel, disp, dataSize=1, prefetch=True
};
+def macroop CLFLUSH_M
+{
+ clflushopt t0, seg, sib, disp, dataSize=1
+ mfence
+};
+
+def macroop CLFLUSH_P
+{
+ rdip t7
+ clflushopt t0, seg, riprel, disp, dataSize=1
+ mfence
+};
+
+def macroop CLFLUSHOPT_M
+{
+ clflushopt t0, seg, sib, disp, dataSize=1
+};
+
+def macroop CLFLUSHOPT_P
+{
+ rdip t7
+ clflushopt t0, seg, riprel, disp, dataSize=1
+};
+
+def macroop CLWB_M
+{
+ clwb t1, seg, sib, disp, dataSize=1
+};
+
+def macroop CLWB_P
+{
+ rdip t7
+ clwb t1, seg, riprel, disp, dataSize=1
+};
+
'''
#let {{
# "GenFault ${new UnimpInstFault}"
# class PREFETCHW(Inst):
# "GenFault ${new UnimpInstFault}"
-# class CLFLUSH(Inst):
-# "GenFault ${new UnimpInstFault}"
#}};
''')
defineMicroStoreOp('Cda', 'Mem = 0;', mem_flags="Request::NO_ACCESS")
+ defineMicroStoreOp('Clflushopt', 'Mem = 0;',
+ mem_flags="Request::CLEAN | Request::INVALIDATE" +
+ " | Request::DST_POC")
+ defineMicroStoreOp('Clwb', 'Mem = 0;',
+ mem_flags="Request::CLEAN | Request::DST_POC")
def defineMicroStoreSplitOp(mnemonic, code,
completeCode="", mem_flags="0"):