diff mbox

[edk2,v2,4/5] OvmfPkg: include UefiCpuPkg/CpuMpPei

Message ID 1468369086-5616-5-git-send-email-lersek@redhat.com
State New
Headers show

Commit Message

Laszlo Ersek July 13, 2016, 12:18 a.m. UTC
In the next patch we're going to put EFI_PEI_MP_SERVICES_PPI to use.

CpuMpPei uses the following PCDs from gUefiCpuPkgTokenSpaceGuid, beyond
those already used by CpuDxe:

- PcdCpuMicrocodePatchAddress and PcdCpuMicrocodePatchRegionSize: these
  control whether CpuMpPei performs microcode update. If the region size
  is zero, then the microcode update is skipped. UefiCpuPkg.dec sets the
  region size to zero by default, which is appropriate for OVMF.

- PcdCpuApLoopMode and PcdCpuApTargetCstate: the former controls how
  CpuMpPei puts the APs to sleep: 1 -- HLT, 2 -- MWAIT, 3 -- busy wait
  (with PAUSE). The latter PCD is only relevant if the former PCD is 2
  (MWAIT). In order to be consistent with SeaBIOS and with CpuDxe itself,
  we choose HLT. That's the default set by UefiCpuPkg.dec.

Furthermore, although CpuMpPei could consume SecPeiCpuExceptionHandlerLib
technically, it is supposed to consume PeiCpuExceptionHandlerLib. See:

- http://thread.gmane.org/gmane.comp.bios.edk2.devel/12703

- git commit a81abf161666 ("UefiCpuPkg/ExceptionLib: Import
  PeiCpuExceptionHandlerLib module"), part of the series linked above.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>

Reviewed-by: Jeff Fan <jeff.fan@intel.com>

---
 OvmfPkg/OvmfPkgIa32.dsc    | 5 +++++
 OvmfPkg/OvmfPkgIa32X64.dsc | 5 +++++
 OvmfPkg/OvmfPkgX64.dsc     | 5 +++++
 OvmfPkg/OvmfPkgIa32.fdf    | 1 +
 OvmfPkg/OvmfPkgIa32X64.fdf | 1 +
 OvmfPkg/OvmfPkgX64.fdf     | 1 +
 6 files changed, 18 insertions(+)

-- 
1.8.3.1


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Comments

Laszlo Ersek July 13, 2016, 6:47 a.m. UTC | #1
On 07/13/16 02:40, Fan, Jeff wrote:
> Laszlo,

> 

> Even I have r-b this patch before, I have one comment now. :-)

> 

> It's better to move PeiCpuExceptionHandlerLib instance from CpuMpPei to

> 

>  [LibraryClasses.common.PEIM]

>   + CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf

> 

> It's more generic and consist with other CpuExceptionHandlerLib instance.


Thanks, I'll spin v3 with this change, and post it sometime later today.

Cheers
Laszlo

> -----Original Message-----

> From: Laszlo Ersek [mailto:lersek@redhat.com] 

> Sent: Wednesday, July 13, 2016 8:18 AM

> To: edk2-devel-01

> Cc: Fan, Jeff; Justen, Jordan L; Kinney, Michael D

> Subject: [PATCH v2 4/5] OvmfPkg: include UefiCpuPkg/CpuMpPei

> 

> In the next patch we're going to put EFI_PEI_MP_SERVICES_PPI to use.

> 

> CpuMpPei uses the following PCDs from gUefiCpuPkgTokenSpaceGuid, beyond those already used by CpuDxe:

> 

> - PcdCpuMicrocodePatchAddress and PcdCpuMicrocodePatchRegionSize: these

>   control whether CpuMpPei performs microcode update. If the region size

>   is zero, then the microcode update is skipped. UefiCpuPkg.dec sets the

>   region size to zero by default, which is appropriate for OVMF.

> 

> - PcdCpuApLoopMode and PcdCpuApTargetCstate: the former controls how

>   CpuMpPei puts the APs to sleep: 1 -- HLT, 2 -- MWAIT, 3 -- busy wait

>   (with PAUSE). The latter PCD is only relevant if the former PCD is 2

>   (MWAIT). In order to be consistent with SeaBIOS and with CpuDxe itself,

>   we choose HLT. That's the default set by UefiCpuPkg.dec.

> 

> Furthermore, although CpuMpPei could consume SecPeiCpuExceptionHandlerLib technically, it is supposed to consume PeiCpuExceptionHandlerLib. See:

> 

> - http://thread.gmane.org/gmane.comp.bios.edk2.devel/12703

> 

> - git commit a81abf161666 ("UefiCpuPkg/ExceptionLib: Import

>   PeiCpuExceptionHandlerLib module"), part of the series linked above.

> 

> Cc: Jeff Fan <jeff.fan@intel.com>

> Cc: Jordan Justen <jordan.l.justen@intel.com>

> Cc: Michael Kinney <michael.d.kinney@intel.com>

> Contributed-under: TianoCore Contribution Agreement 1.0

> Signed-off-by: Laszlo Ersek <lersek@redhat.com>

> Reviewed-by: Jeff Fan <jeff.fan@intel.com>

> ---

>  OvmfPkg/OvmfPkgIa32.dsc    | 5 +++++

>  OvmfPkg/OvmfPkgIa32X64.dsc | 5 +++++

>  OvmfPkg/OvmfPkgX64.dsc     | 5 +++++

>  OvmfPkg/OvmfPkgIa32.fdf    | 1 +

>  OvmfPkg/OvmfPkgIa32X64.fdf | 1 +

>  OvmfPkg/OvmfPkgX64.fdf     | 1 +

>  6 files changed, 18 insertions(+)

> 

> diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 6d074641bede..611505e5d188 100644

> --- a/OvmfPkg/OvmfPkgIa32.dsc

> +++ b/OvmfPkg/OvmfPkgIa32.dsc

> @@ -519,6 +519,11 @@ [Components]

>        PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf

>    }

>  !endif

> +  UefiCpuPkg/CpuMpPei/CpuMpPei.inf {

> +    <LibraryClasses>

> +      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf

> +      

> + CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCp

> + uExceptionHandlerLib.inf

> +  }

>  

>    #

>    # DXE Phase modules

> diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index 25fcb38aaf84..92b373dfe3ee 100644

> --- a/OvmfPkg/OvmfPkgIa32X64.dsc

> +++ b/OvmfPkg/OvmfPkgIa32X64.dsc

> @@ -527,6 +527,11 @@ [Components.IA32]

>        PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf

>    }

>  !endif

> +  UefiCpuPkg/CpuMpPei/CpuMpPei.inf {

> +    <LibraryClasses>

> +      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf

> +      

> + CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCp

> + uExceptionHandlerLib.inf

> +  }

>  

>  [Components.X64]

>    #

> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index cb7ccf79618d..255ac79e3e34 100644

> --- a/OvmfPkg/OvmfPkgX64.dsc

> +++ b/OvmfPkg/OvmfPkgX64.dsc

> @@ -526,6 +526,11 @@ [Components]

>        PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf

>    }

>  !endif

> +  UefiCpuPkg/CpuMpPei/CpuMpPei.inf {

> +    <LibraryClasses>

> +      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf

> +      

> + CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCp

> + uExceptionHandlerLib.inf

> +  }

>  

>    #

>    # DXE Phase modules

> diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index be3ba417f938..684484fc422d 100644

> --- a/OvmfPkg/OvmfPkgIa32.fdf

> +++ b/OvmfPkg/OvmfPkgIa32.fdf

> @@ -161,6 +161,7 @@ [FV.PEIFV]

>  !if $(SMM_REQUIRE) == TRUE

>  INF  OvmfPkg/SmmAccess/SmmAccessPei.inf

>  !endif

> +INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf

>  

>  ################################################################################

>  

> diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 38f23605d2d4..a13cc0a3ed5b 100644

> --- a/OvmfPkg/OvmfPkgIa32X64.fdf

> +++ b/OvmfPkg/OvmfPkgIa32X64.fdf

> @@ -161,6 +161,7 @@ [FV.PEIFV]

>  !if $(SMM_REQUIRE) == TRUE

>  INF  OvmfPkg/SmmAccess/SmmAccessPei.inf

>  !endif

> +INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf

>  

>  ################################################################################

>  

> diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 7d06a62001fd..a64836073a21 100644

> --- a/OvmfPkg/OvmfPkgX64.fdf

> +++ b/OvmfPkg/OvmfPkgX64.fdf

> @@ -161,6 +161,7 @@ [FV.PEIFV]

>  !if $(SMM_REQUIRE) == TRUE

>  INF  OvmfPkg/SmmAccess/SmmAccessPei.inf

>  !endif

> +INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf

>  

>  ################################################################################

>  

> --

> 1.8.3.1

> 

> 


_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
diff mbox

Patch

diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc
index 6d074641bede..611505e5d188 100644
--- a/OvmfPkg/OvmfPkgIa32.dsc
+++ b/OvmfPkg/OvmfPkgIa32.dsc
@@ -519,6 +519,11 @@  [Components]
       PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
   }
 !endif
+  UefiCpuPkg/CpuMpPei/CpuMpPei.inf {
+    <LibraryClasses>
+      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
+      CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
+  }
 
   #
   # DXE Phase modules
diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc
index 25fcb38aaf84..92b373dfe3ee 100644
--- a/OvmfPkg/OvmfPkgIa32X64.dsc
+++ b/OvmfPkg/OvmfPkgIa32X64.dsc
@@ -527,6 +527,11 @@  [Components.IA32]
       PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
   }
 !endif
+  UefiCpuPkg/CpuMpPei/CpuMpPei.inf {
+    <LibraryClasses>
+      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
+      CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
+  }
 
 [Components.X64]
   #
diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index cb7ccf79618d..255ac79e3e34 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -526,6 +526,11 @@  [Components]
       PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
   }
 !endif
+  UefiCpuPkg/CpuMpPei/CpuMpPei.inf {
+    <LibraryClasses>
+      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
+      CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.inf
+  }
 
   #
   # DXE Phase modules
diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf
index be3ba417f938..684484fc422d 100644
--- a/OvmfPkg/OvmfPkgIa32.fdf
+++ b/OvmfPkg/OvmfPkgIa32.fdf
@@ -161,6 +161,7 @@  [FV.PEIFV]
 !if $(SMM_REQUIRE) == TRUE
 INF  OvmfPkg/SmmAccess/SmmAccessPei.inf
 !endif
+INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
 ################################################################################
 
diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf
index 38f23605d2d4..a13cc0a3ed5b 100644
--- a/OvmfPkg/OvmfPkgIa32X64.fdf
+++ b/OvmfPkg/OvmfPkgIa32X64.fdf
@@ -161,6 +161,7 @@  [FV.PEIFV]
 !if $(SMM_REQUIRE) == TRUE
 INF  OvmfPkg/SmmAccess/SmmAccessPei.inf
 !endif
+INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
 ################################################################################
 
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index 7d06a62001fd..a64836073a21 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -161,6 +161,7 @@  [FV.PEIFV]
 !if $(SMM_REQUIRE) == TRUE
 INF  OvmfPkg/SmmAccess/SmmAccessPei.inf
 !endif
+INF  UefiCpuPkg/CpuMpPei/CpuMpPei.inf
 
 ################################################################################