[edk2-devel] [PATCH 3/3] UefiCpuPkg: Disable MTC packet by default

Ni, Ray ray.ni at intel.com
Tue Apr 25 06:14:18 UTC 2023


Why do you need to explicitly disable MTC bit?

> -----Original Message-----
> From: devel at edk2.groups.io <devel at edk2.groups.io> On Behalf Of duntan
> Sent: Tuesday, April 25, 2023 1:48 PM
> To: devel at edk2.groups.io
> Cc: Dong, Eric <eric.dong at intel.com>; Ni, Ray <ray.ni at intel.com>; Kumar,
> Rahul R <rahul.r.kumar at intel.com>; Gerd Hoffmann <kraxel at redhat.com>;
> Chen, Xiao X <xiao.x.chen at intel.com>
> Subject: [edk2-devel] [PATCH 3/3] UefiCpuPkg: Disable MTC packet by
> default
> 
> MTC packet is not needed and disable MTC packet by default.
> 
> Bugzila: https://bugzilla.tianocore.org/show_bug.cgi?id=4423
> Signed-off-by: Dun Tan <dun.tan at intel.com>
> Cc: Eric Dong <eric.dong at intel.com>
> Cc: Ray Ni <ray.ni at intel.com>
> Cc: Rahul Kumar <rahul1.kumar at intel.com>
> Cc: Gerd Hoffmann <kraxel at redhat.com>
> Cc: Xiao X Chen <xiao.x.chen at intel.com>
> ---
>  UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
> b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
> index 1a101b7288..3f109bf29c 100644
> --- a/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
> +++ b/UefiCpuPkg/Library/CpuCommonFeaturesLib/ProcTrace.c
> @@ -538,6 +538,14 @@ ProcTraceInitialize (
>      CtrlReg.Bits.TSCEn = 0;
>    }
> 
> +  //
> +  // MTC packet is not needed. Turn it off by default.
> +  //
> +  if (Ebx.Bits.Mtc == 1) {
> +    CtrlReg.Bits.MTCEn   = 0;
> +    CtrlReg.Bits.MTCFreq = 0;
> +  }
> +
>    CPU_REGISTER_TABLE_WRITE64 (
>      ProcessorNumber,
>      Msr,
> --
> 2.39.1.windows.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103516): https://edk2.groups.io/g/devel/message/103516
Mute This Topic: https://groups.io/mt/98487623/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3943202/1813853/130120423/xyzzy [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list