[edk2-devel] [PATCH 2/2] OvmfPkg/AmdSev: Disable PcdFirstTimeWakeUpAPsBySipti

Roth, Michael via groups.io posted 2 patches 2 years, 5 months ago
[edk2-devel] [PATCH 2/2] OvmfPkg/AmdSev: Disable PcdFirstTimeWakeUpAPsBySipti
Posted by Roth, Michael via groups.io 2 years, 5 months ago
PcdFirstTimeWakeUpAPsBySipi was recently introduced to indicate when
the full INIT-SIPI-SIPI sequence can be skipped for AP bringup. It is
true by default, but needs to be disabled for QEMU/OVMF where early INIT
is not simulated. Commit 1d76560146 ("OvmfPkg: Disable
PcdFirstTimeWakeUpAPsBySipi.") added changes to disable it
by default for OvmfPkg, but a similar change was not made for the
AmdSev package. This breaks booting of SEV and SNP guests.

Fix this defaulting PcdFirstTimeWakeUpAPsBySipi to false for AmdSev
package, as was previously done for OvmfPkg variants.

Fixes: eaffa1d7ff ("UefiCpuPkg:Wake up APs after power-up or RESET through SIPI.")
Cc: YuanhaoXie <yuanhao.xie@intel.com>
Cc: Tom Lendacky <Thomas.Lendacky@amd.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Rahul Kumar <rahul1.kumar@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Min Xu <min.m.xu@intel.com>
Signed-off-by: Michael Roth <michael.roth@amd.com>
---
 OvmfPkg/AmdSev/AmdSevX64.dsc | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
index f43300a95e..cf058f6a05 100644
--- a/OvmfPkg/AmdSev/AmdSevX64.dsc
+++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
@@ -469,6 +469,14 @@
   gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand|TRUE

   gUefiOvmfPkgTokenSpaceGuid.PcdBootRestrictToFirmware|TRUE

 

+  #

+  # INIT is now triggered before BIOS by ucode/hardware. In the OVMF

+  # environment, QEMU lacks a simulation for the INIT process.

+  # To address this, PcdFirstTimeWakeUpAPsBySipi set to FALSE to

+  # broadcast INIT-SIPI-SIPI for the first time.

+  #

+  gUefiCpuPkgTokenSpaceGuid.PcdFirstTimeWakeUpAPsBySipi|FALSE

+

 ################################################################################

 #

 # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform

-- 
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107807): https://edk2.groups.io/g/devel/message/107807
Mute This Topic: https://groups.io/mt/100787520/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 2/2] OvmfPkg/AmdSev: Disable PcdFirstTimeWakeUpAPsBySipti
Posted by Gerd Hoffmann 2 years, 5 months ago
On Wed, Aug 16, 2023 at 03:11:46PM -0500, Michael Roth wrote:
> PcdFirstTimeWakeUpAPsBySipi was recently introduced to indicate when
> the full INIT-SIPI-SIPI sequence can be skipped for AP bringup. It is
> true by default, but needs to be disabled for QEMU/OVMF where early INIT
> is not simulated. Commit 1d76560146 ("OvmfPkg: Disable
> PcdFirstTimeWakeUpAPsBySipi.") added changes to disable it
> by default for OvmfPkg, but a similar change was not made for the
> AmdSev package. This breaks booting of SEV and SNP guests.
> 
> Fix this defaulting PcdFirstTimeWakeUpAPsBySipi to false for AmdSev
> package, as was previously done for OvmfPkg variants.

Yuanhao Xie has sent a patch for IntelTdx, Microvm and Xen, so we can
take this as-is.

Acked-by: Gerd Hoffmann <kraxel@redhat.com>

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107944): https://edk2.groups.io/g/devel/message/107944
Mute This Topic: https://groups.io/mt/100787520/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 2/2] OvmfPkg/AmdSev: Disable PcdFirstTimeWakeUpAPsBySipti
Posted by Gerd Hoffmann 2 years, 5 months ago
On Wed, Aug 16, 2023 at 03:11:46PM -0500, Michael Roth wrote:
> PcdFirstTimeWakeUpAPsBySipi was recently introduced to indicate when
> the full INIT-SIPI-SIPI sequence can be skipped for AP bringup. It is
> true by default, but needs to be disabled for QEMU/OVMF where early INIT
> is not simulated. Commit 1d76560146 ("OvmfPkg: Disable
> PcdFirstTimeWakeUpAPsBySipi.") added changes to disable it
> by default for OvmfPkg, but a similar change was not made for the
> AmdSev package. This breaks booting of SEV and SNP guests.
> 
> Fix this defaulting PcdFirstTimeWakeUpAPsBySipi to false for AmdSev
> package, as was previously done for OvmfPkg variants.

I suspect all ovmf builds need that, including AmdSev, IntelTdx,
Microvm variants.  Xen probably too.  Not sure about Bhyve.

So, a step into the right direction but not complete ...

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107918): https://edk2.groups.io/g/devel/message/107918
Mute This Topic: https://groups.io/mt/100787520/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 2/2] OvmfPkg/AmdSev: Disable PcdFirstTimeWakeUpAPsBySipti
Posted by Ard Biesheuvel 2 years, 5 months ago
On Wed, 16 Aug 2023 at 22:13, Michael Roth <michael.roth@amd.com> wrote:
>
> PcdFirstTimeWakeUpAPsBySipi was recently introduced to indicate when
> the full INIT-SIPI-SIPI sequence can be skipped for AP bringup. It is
> true by default, but needs to be disabled for QEMU/OVMF where early INIT
> is not simulated. Commit 1d76560146 ("OvmfPkg: Disable
> PcdFirstTimeWakeUpAPsBySipi.") added changes to disable it
> by default for OvmfPkg, but a similar change was not made for the
> AmdSev package. This breaks booting of SEV and SNP guests.
>
> Fix this defaulting PcdFirstTimeWakeUpAPsBySipi to false for AmdSev
> package, as was previously done for OvmfPkg variants.
>
> Fixes: eaffa1d7ff ("UefiCpuPkg:Wake up APs after power-up or RESET through SIPI.")
> Cc: YuanhaoXie <yuanhao.xie@intel.com>
> Cc: Tom Lendacky <Thomas.Lendacky@amd.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Rahul Kumar <rahul1.kumar@intel.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Erdem Aktas <erdemaktas@google.com>
> Cc: James Bottomley <jejb@linux.ibm.com>
> Cc: Min Xu <min.m.xu@intel.com>
> Signed-off-by: Michael Roth <michael.roth@amd.com>

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>

Apologies for the oversight. This should be included in the upcoming stable tag.


> ---
>  OvmfPkg/AmdSev/AmdSevX64.dsc | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc
> index f43300a95e..cf058f6a05 100644
> --- a/OvmfPkg/AmdSev/AmdSevX64.dsc
> +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc
> @@ -469,6 +469,14 @@
>    gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand|TRUE
>    gUefiOvmfPkgTokenSpaceGuid.PcdBootRestrictToFirmware|TRUE
>
> +  #
> +  # INIT is now triggered before BIOS by ucode/hardware. In the OVMF
> +  # environment, QEMU lacks a simulation for the INIT process.
> +  # To address this, PcdFirstTimeWakeUpAPsBySipi set to FALSE to
> +  # broadcast INIT-SIPI-SIPI for the first time.
> +  #
> +  gUefiCpuPkgTokenSpaceGuid.PcdFirstTimeWakeUpAPsBySipi|FALSE
> +
>  ################################################################################
>  #
>  # Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform
> --
> 2.25.1
>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107808): https://edk2.groups.io/g/devel/message/107808
Mute This Topic: https://groups.io/mt/100787520/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 2/2] OvmfPkg/AmdSev: Disable PcdFirstTimeWakeUpAPsBySipti
Posted by Gerd Hoffmann 2 years, 5 months ago
On Wed, Aug 16, 2023 at 10:22:30PM +0200, Ard Biesheuvel wrote:
> On Wed, 16 Aug 2023 at 22:13, Michael Roth <michael.roth@amd.com> wrote:
> >
> > PcdFirstTimeWakeUpAPsBySipi was recently introduced to indicate when
> > the full INIT-SIPI-SIPI sequence can be skipped for AP bringup. It is
> > true by default, but needs to be disabled for QEMU/OVMF where early INIT
> > is not simulated. Commit 1d76560146 ("OvmfPkg: Disable
> > PcdFirstTimeWakeUpAPsBySipi.") added changes to disable it
> > by default for OvmfPkg, but a similar change was not made for the
> > AmdSev package. This breaks booting of SEV and SNP guests.
> >
> > Fix this defaulting PcdFirstTimeWakeUpAPsBySipi to false for AmdSev
> > package, as was previously done for OvmfPkg variants.
> >
> > Fixes: eaffa1d7ff ("UefiCpuPkg:Wake up APs after power-up or RESET through SIPI.")
> > Cc: YuanhaoXie <yuanhao.xie@intel.com>
> > Cc: Tom Lendacky <Thomas.Lendacky@amd.com>
> > Cc: Eric Dong <eric.dong@intel.com>
> > Cc: Ray Ni <ray.ni@intel.com>
> > Cc: Rahul Kumar <rahul1.kumar@intel.com>
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Jordan Justen <jordan.l.justen@intel.com>
> > Cc: Erdem Aktas <erdemaktas@google.com>
> > Cc: James Bottomley <jejb@linux.ibm.com>
> > Cc: Min Xu <min.m.xu@intel.com>
> > Signed-off-by: Michael Roth <michael.roth@amd.com>
> 
> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
> 
> Apologies for the oversight. This should be included in the upcoming stable tag.

Including into the stable tag didn't work out, but can we merge it now
please?

thanks,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108282): https://edk2.groups.io/g/devel/message/108282
Mute This Topic: https://groups.io/mt/100787520/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-