]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/CpuCommonFeaturesLib/MonitorMwait.c
UefiCpuPkg/CpuCommonFeaturesLib: Register MSR base on scope Info.
[mirror_edk2.git] / UefiCpuPkg / Library / CpuCommonFeaturesLib / MonitorMwait.c
index 1d43bd128afe8a31b6c157e73325facda02fac88..530748bf46bb5a75df5a59096980f70a2ef4e31e 100644 (file)
@@ -67,6 +67,21 @@ MonitorMwaitInitialize (
   IN BOOLEAN                           State\r
   )\r
 {\r
+  //\r
+  // The scope of the MSR_IA32_MISC_ENABLE is core for below processor type, only program\r
+  // MSR_IA32_MISC_ENABLE for thread 0 in each core.\r
+  //\r
+  if (IS_CORE2_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||\r
+      IS_ATOM_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||\r
+      IS_GOLDMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||\r
+      IS_SILVERMONT_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||\r
+      IS_PENTIUM_4_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel) ||\r
+      IS_CORE_PROCESSOR (CpuInfo->DisplayFamily, CpuInfo->DisplayModel)) {\r
+    if (CpuInfo->ProcessorInfo.Location.Thread != 0) {\r
+      return RETURN_SUCCESS;\r
+    }\r
+  }\r
+\r
   CPU_REGISTER_TABLE_WRITE_FIELD (\r
     ProcessorNumber,\r
     Msr,\r