Browse Source

Deny effective RTM support if CPUID bit RTM_ALWAYS_ABORT is set.

Rika Ichinose 1 year ago
parent
commit
0bc1d8d446
2 changed files with 2 additions and 2 deletions
  1. 1 1
      rtl/i386/cpu.pp
  2. 1 1
      rtl/x86_64/cpu.pp

+ 1 - 1
rtl/i386/cpu.pp

@@ -316,7 +316,7 @@ type
                   _AVX512VLSupport:=(cpuid7.ebx and $80000000)<>0;
                   _AVX512VLSupport:=(cpuid7.ebx and $80000000)<>0;
                   _BMI1Support:=(cpuid7.ebx and $8)<>0;
                   _BMI1Support:=(cpuid7.ebx and $8)<>0;
                   _BMI2Support:=(cpuid7.ebx and $100)<>0;
                   _BMI2Support:=(cpuid7.ebx and $100)<>0;
-                  _RTMSupport:=((cpuid7.ebx and $800)<>0);
+                  _RTMSupport:=((cpuid7.ebx and $800)<>0) and (cpuid7.edx and (1 shl 11)=0 {RTM_ALWAYS_ABORT});
                 end;
                 end;
            end;
            end;
       end;
       end;

+ 1 - 1
rtl/x86_64/cpu.pp

@@ -299,7 +299,7 @@ type
             _AVX512BITALGSupport:=(cpuid7.ecx and $00001000)<>0;
             _AVX512BITALGSupport:=(cpuid7.ecx and $00001000)<>0;
             _BMI1Support:=(cpuid7.ebx and $8)<>0;
             _BMI1Support:=(cpuid7.ebx and $8)<>0;
             _BMI2Support:=(cpuid7.ebx and $100)<>0;
             _BMI2Support:=(cpuid7.ebx and $100)<>0;
-            _RTMSupport:=(cpuid7.ebx and $800)<>0;
+            _RTMSupport:=((cpuid7.ebx and $800)<>0) and (cpuid7.edx and (1 shl 11)=0 {RTM_ALWAYS_ABORT});
           end;
           end;
       end;
       end;