[edk2-devel] [PATCH 3/4] OvmfPkg: Add CpuPageTableLib required by MpInitLib.

2022-12-19 Thread Yuanhao Xie
Add CpuPageTableLib required by MpInitLib in OvmfPkg.

Signed-off-by: Yuanhao Xie 
---
 OvmfPkg/AmdSev/AmdSevX64.dsc | 3 ++-
 OvmfPkg/CloudHv/CloudHvX64.dsc   | 1 +
 OvmfPkg/IntelTdx/IntelTdxX64.dsc | 4 +++-
 OvmfPkg/Microvm/MicrovmX64.dsc   | 3 ++-
 OvmfPkg/OvmfPkgIa32X64.dsc   | 1 +
 OvmfPkg/OvmfPkgX64.dsc   | 2 ++
 OvmfPkg/OvmfXen.dsc  | 3 ++-
 7 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index e0b04d6734..b92c6154b2 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -3,7 +3,7 @@
 #  virtual machine remote attestation and secret injection
 #
 #  Copyright (c) 2020 James Bottomley, IBM Corporation.
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -352,6 +352,7 @@
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
 !endif
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   
QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc
index 4fe7cb5f1b..4d7107fd19 100644
--- a/OvmfPkg/CloudHv/CloudHvX64.dsc
+++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
@@ -403,6 +403,7 @@
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
 !endif
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.inf
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
index 3458926515..ea538fd783 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform
 #
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #  Copyright (c) Microsoft Corporation.
 #
@@ -313,6 +313,7 @@
   
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
   LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.inf
@@ -577,6 +578,7 @@
 
   UefiCpuPkg/CpuDxe/CpuDxe.inf {
 
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   #
   # Directly use DxeMpInitLib. It depends on DxeMpInitLibMpDepLib which
   # checks the Protocol of gEfiMpInitLibMpDepProtocolGuid.
diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index 93d4cf3da2..b04c8e6936 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform
 #
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #  Copyright (c) Microsoft Corporation.
 #
@@ -402,6 +402,7 @@
   PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
   PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   
PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index aca292ce83..894ce1867d 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -414,6 +414,7 @@
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
 !endif
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|Uef

Re: [edk2-devel] [PATCH 3/4] OvmfPkg: Add CpuPageTableLib required by MpInitLib.

2022-12-18 Thread Yao, Jiewen
Acked-by: Jiewen Yao 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Ni, Ray
> Sent: Monday, December 19, 2022 11:23 AM
> To: devel@edk2.groups.io; Xie, Yuanhao 
> Subject: Re: [edk2-devel] [PATCH 3/4] OvmfPkg: Add CpuPageTableLib
> required by MpInitLib.
> 
> Reviewed-by: Ray Ni 
> 
> > -Original Message-
> > From: devel@edk2.groups.io  On Behalf Of
> Yuanhao Xie
> > Sent: Monday, December 19, 2022 5:43 AM
> > To: devel@edk2.groups.io
> > Subject: [edk2-devel] [PATCH 3/4] OvmfPkg: Add CpuPageTableLib required
> by MpInitLib.
> >
> > Add CpuPageTableLib required by MpInitLib in OvmfPkg.
> >
> > Signed-off-by: Yuanhao Xie 
> > ---
> >  OvmfPkg/AmdSev/AmdSevX64.dsc | 3 ++-
> >  OvmfPkg/CloudHv/CloudHvX64.dsc   | 1 +
> >  OvmfPkg/IntelTdx/IntelTdxX64.dsc | 4 +++-
> >  OvmfPkg/Microvm/MicrovmX64.dsc   | 3 ++-
> >  OvmfPkg/OvmfPkgIa32X64.dsc   | 1 +
> >  OvmfPkg/OvmfPkgX64.dsc   | 2 ++
> >  OvmfPkg/OvmfXen.dsc  | 3 ++-
> >  7 files changed, 13 insertions(+), 4 deletions(-)
> >
> > diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc
> b/OvmfPkg/AmdSev/AmdSevX64.dsc
> > index e0b04d6734..b92c6154b2 100644
> > --- a/OvmfPkg/AmdSev/AmdSevX64.dsc
> > +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
> > @@ -3,7 +3,7 @@
> >  #  virtual machine remote attestation and secret injection
> >  #
> >  #  Copyright (c) 2020 James Bottomley, IBM Corporation.
> > -#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
> > +#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
> >  #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> >  #
> >  #  SPDX-License-Identifier: BSD-2-Clause-Patent
> > @@ -352,6 +352,7 @@
> >
> DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentL
> ib.inf
> >  !endif
> >PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
> > +
> CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
> >MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> >
> QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibF
> wCfg.inf
> >
> QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQ
> emuLoadImageLib.inf
> > diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc
> b/OvmfPkg/CloudHv/CloudHvX64.dsc
> > index 4fe7cb5f1b..4d7107fd19 100644
> > --- a/OvmfPkg/CloudHv/CloudHvX64.dsc
> > +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
> > @@ -403,6 +403,7 @@
> >
> DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentL
> ib.inf
> >  !endif
> >PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
> > +
> CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
> >MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> >
> QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibF
> wCfg.inf
> >
> QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoa
> dImageLib.inf
> > diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> > index 3458926515..ea538fd783 100644
> > --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> > +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> > @@ -1,7 +1,7 @@
> >  ## @file
> >  #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform
> >  #
> > -#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
> > +#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
> >  #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> >  #  Copyright (c) Microsoft Corporation.
> >  #
> > @@ -313,6 +313,7 @@
> >
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeC
> puExceptionHandlerLib.inf
> >LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf
> >PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
> > +
> CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
> >MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
> >
> QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibF
> wCfg.inf
> >
> QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoa
> dImageLib.inf
> > @@ -577,6 +578,7 @@
> >
> >UefiCpuPkg/CpuDxe/CpuDxe.inf {
> >  
> > +
> CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
> >#
> ># Directly use DxeMpInitLib. It depends on DxeMpInitLibMpDepLib
> which
> ># checks the Protocol of gEfiMpInitLibMpDepProtocolGuid.
> >

Re: [edk2-devel] [PATCH 3/4] OvmfPkg: Add CpuPageTableLib required by MpInitLib.

2022-12-18 Thread Ni, Ray
Reviewed-by: Ray Ni 

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of Yuanhao Xie
> Sent: Monday, December 19, 2022 5:43 AM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH 3/4] OvmfPkg: Add CpuPageTableLib required by 
> MpInitLib.
> 
> Add CpuPageTableLib required by MpInitLib in OvmfPkg.
> 
> Signed-off-by: Yuanhao Xie 
> ---
>  OvmfPkg/AmdSev/AmdSevX64.dsc | 3 ++-
>  OvmfPkg/CloudHv/CloudHvX64.dsc   | 1 +
>  OvmfPkg/IntelTdx/IntelTdxX64.dsc | 4 +++-
>  OvmfPkg/Microvm/MicrovmX64.dsc   | 3 ++-
>  OvmfPkg/OvmfPkgIa32X64.dsc   | 1 +
>  OvmfPkg/OvmfPkgX64.dsc   | 2 ++
>  OvmfPkg/OvmfXen.dsc  | 3 ++-
>  7 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
> index e0b04d6734..b92c6154b2 100644
> --- a/OvmfPkg/AmdSev/AmdSevX64.dsc
> +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
> @@ -3,7 +3,7 @@
>  #  virtual machine remote attestation and secret injection
>  #
>  #  Copyright (c) 2020 James Bottomley, IBM Corporation.
> -#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
>  #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
>  #
>  #  SPDX-License-Identifier: BSD-2-Clause-Patent
> @@ -352,6 +352,7 @@
>DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
>  !endif
>PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
> +  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
>MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
>QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
>
> QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
> diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc
> index 4fe7cb5f1b..4d7107fd19 100644
> --- a/OvmfPkg/CloudHv/CloudHvX64.dsc
> +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
> @@ -403,6 +403,7 @@
>DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
>  !endif
>PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
> +  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
>MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
>QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
>
> QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.inf
> diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc 
> b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> index 3458926515..ea538fd783 100644
> --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> @@ -1,7 +1,7 @@
>  ## @file
>  #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform
>  #
> -#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
>  #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
>  #  Copyright (c) Microsoft Corporation.
>  #
> @@ -313,6 +313,7 @@
>
> CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
>LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf
>PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
> +  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
>MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
>QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
>
> QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.inf
> @@ -577,6 +578,7 @@
> 
>UefiCpuPkg/CpuDxe/CpuDxe.inf {
>  
> +  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
>#
># Directly use DxeMpInitLib. It depends on DxeMpInitLibMpDepLib which
># checks the Protocol of gEfiMpInitLibMpDepProtocolGuid.
> diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
> index 93d4cf3da2..b04c8e6936 100644
> --- a/OvmfPkg/Microvm/MicrovmX64.dsc
> +++ b/OvmfPkg/Microvm/MicrovmX64.dsc
> @@ -1,7 +1,7 @@
>  ## @file
>  #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform
>  #
> -#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
> +#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
>  #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
>  #  Copyright (c) Microsoft Corporation.
>  #
> @@ -402,6 +402,7 @@
>PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
>PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
>
> PciExpressLib|OvmfPkg/Li

[edk2-devel] [PATCH 3/4] OvmfPkg: Add CpuPageTableLib required by MpInitLib.

2022-12-18 Thread Yuanhao Xie
Add CpuPageTableLib required by MpInitLib in OvmfPkg.

Signed-off-by: Yuanhao Xie 
---
 OvmfPkg/AmdSev/AmdSevX64.dsc | 3 ++-
 OvmfPkg/CloudHv/CloudHvX64.dsc   | 1 +
 OvmfPkg/IntelTdx/IntelTdxX64.dsc | 4 +++-
 OvmfPkg/Microvm/MicrovmX64.dsc   | 3 ++-
 OvmfPkg/OvmfPkgIa32X64.dsc   | 1 +
 OvmfPkg/OvmfPkgX64.dsc   | 2 ++
 OvmfPkg/OvmfXen.dsc  | 3 ++-
 7 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index e0b04d6734..b92c6154b2 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -3,7 +3,7 @@
 #  virtual machine remote attestation and secret injection
 #
 #  Copyright (c) 2020 James Bottomley, IBM Corporation.
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #
 #  SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -352,6 +352,7 @@
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
 !endif
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   
QemuLoadImageLib|OvmfPkg/Library/GenericQemuLoadImageLib/GenericQemuLoadImageLib.inf
diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc
index 4fe7cb5f1b..4d7107fd19 100644
--- a/OvmfPkg/CloudHv/CloudHvX64.dsc
+++ b/OvmfPkg/CloudHv/CloudHvX64.dsc
@@ -403,6 +403,7 @@
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
 !endif
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.inf
diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
index 3458926515..ea538fd783 100644
--- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
+++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform
 #
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #  Copyright (c) Microsoft Corporation.
 #
@@ -313,6 +313,7 @@
   
CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf
   LockBoxLib|OvmfPkg/Library/LockBoxLib/LockBoxDxeLib.inf
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.inf
@@ -577,6 +578,7 @@
 
   UefiCpuPkg/CpuDxe/CpuDxe.inf {
 
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   #
   # Directly use DxeMpInitLib. It depends on DxeMpInitLibMpDepLib which
   # checks the Protocol of gEfiMpInitLibMpDepProtocolGuid.
diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc
index 93d4cf3da2..b04c8e6936 100644
--- a/OvmfPkg/Microvm/MicrovmX64.dsc
+++ b/OvmfPkg/Microvm/MicrovmX64.dsc
@@ -1,7 +1,7 @@
 ## @file
 #  EFI/Framework Open Virtual Machine Firmware (OVMF) platform
 #
-#  Copyright (c) 2006 - 2021, Intel Corporation. All rights reserved.
+#  Copyright (c) 2006 - 2022, Intel Corporation. All rights reserved.
 #  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
 #  Copyright (c) Microsoft Corporation.
 #
@@ -402,6 +402,7 @@
   PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
   PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf
   
PciExpressLib|OvmfPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf
   QemuFwCfgS3Lib|OvmfPkg/Library/QemuFwCfgS3Lib/DxeQemuFwCfgS3LibFwCfg.inf
   QemuLoadImageLib|OvmfPkg/Library/X86QemuLoadImageLib/X86QemuLoadImageLib.inf
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index aca292ce83..894ce1867d 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -414,6 +414,7 @@
   DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf
 !endif
   PciLib|OvmfPkg/Library/DxePciLibI440FxQ35/DxePciLibI440FxQ35.inf
+  CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf
   MpInitLib|Uef