audk/UefiCpuPkg/Library/CpuCommonFeaturesLib
Dong, Eric 9c90d39b60 UefiCpuPkg/CpuCommonFeaturesLib: Use new macros.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2040

Below code is current implementation:
  if (MsrRegister[ProcessorNumber].Bits.Lock == 0) {
    CPU_REGISTER_TABLE_WRITE_FIELD (
      ProcessorNumber,
      Msr,
      MSR_IA32_FEATURE_CONTROL,
      MSR_IA32_FEATURE_CONTROL_REGISTER,
      Bits.Lock,
      1
    );
  }

1. In first normal boot, the Bits.Lock is 0, 1 will be added
   into the register table and then will set to the MSR.
2. Trig warm reboot, MSR value preserves. After normal boot phase,
   the Bits.Lock is 1, so it will not be added into the register
   table during the warm reboot phase.
3. Trig S3 then resume, the Bits.Lock change to 0 and Bits.Lock is
   not added in register table, so it's still 0 after resume. This
   is not an expect behavior. The expect value is the value should
   always 1 after booting or resuming from S3.

The root cause for this issue is
1. driver bases on current value to insert the "set value action" to
   the register table.
2. Some MSRs may reserve their value during warm reboot.

The solution for this issue is using new added macros for the MSRs which
preserve value during warm reboot.

Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
2019-08-21 02:44:50 +08:00
..
Aesni.c UefiCpuPkg CpuCommonFeaturesLib: Remove CPU generation check 2019-05-18 13:55:50 +08:00
C1e.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
ClockModulation.c UefiCpuPkg CpuCommFeaturesLib: Reduce to set MSR_IA32_CLOCK_MODULATION 2019-06-06 18:52:35 +08:00
CpuCommonFeatures.h UefiCpuPkg/CpuCommonFeaturesLib: Use new macros. 2019-08-21 02:44:50 +08:00
CpuCommonFeaturesLib.c UefiCpuPkg/CpuCommonFeaturesLib: Use new macros. 2019-08-21 02:44:50 +08:00
CpuCommonFeaturesLib.inf UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
CpuCommonFeaturesLib.uni UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
Eist.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
ExecuteDisable.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
FastStrings.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
FeatureControl.c UefiCpuPkg/CpuCommonFeaturesLib: Use new macros. 2019-08-21 02:44:50 +08:00
LimitCpuIdMaxval.c UefiCpuPkg: Remove double \r 2019-05-13 08:45:22 +08:00
MachineCheck.c UefiCpuPkg/CpuCommonFeaturesLib: Use new macros. 2019-08-21 02:44:50 +08:00
MonitorMwait.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
PendingBreak.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00
Ppin.c UefiCpuPkg CpuCommonFeaturesLib: Enhance Ppin code 2019-07-16 16:03:51 +08:00
ProcTrace.c UefiCpuPkg CpuCommFeaturesLib: Fix GP fault issue about ProcTrace 2019-06-06 18:51:45 +08:00
X2Apic.c UefiCpuPkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:28 -07:00