[edk2] [RFC PATCH v1 3/5] OvmfPkg/PlatformPei: Initialize SEV support

Brijesh Singh posted 5 patches 7 years, 8 months ago
There is a newer version of this series
[edk2] [RFC PATCH v1 3/5] OvmfPkg/PlatformPei: Initialize SEV support
Posted by Brijesh Singh 7 years, 8 months ago
Initialize Secure Encrypted Virtualization (SEV) support.

Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
---
 OvmfPkg/PlatformPei/Platform.c      |    6 ++++++
 OvmfPkg/PlatformPei/PlatformPei.inf |    1 +
 2 files changed, 7 insertions(+)

diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
index 0be8672..a948037 100644
--- a/OvmfPkg/PlatformPei/Platform.c
+++ b/OvmfPkg/PlatformPei/Platform.c
@@ -33,6 +33,7 @@
 #include <Library/PeiServicesLib.h>
 #include <Library/QemuFwCfgLib.h>
 #include <Library/ResourcePublicationLib.h>
+#include <Library/MemcryptSevLib.h>
 #include <Guid/MemoryTypeInformation.h>
 #include <Ppi/MasterBootMode.h>
 #include <IndustryStandard/Pci22.h>
@@ -669,5 +670,10 @@ InitializePlatform (
   MiscInitialization ();
   InstallFeatureControlCallback ();
 
+  //
+  // Initialize SEV support
+  //
+  MemcryptSevInitialize ();
+
   return EFI_SUCCESS;
 }
diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf
index fbaed31..f85b208 100644
--- a/OvmfPkg/PlatformPei/PlatformPei.inf
+++ b/OvmfPkg/PlatformPei/PlatformPei.inf
@@ -60,6 +60,7 @@
   QemuFwCfgLib
   MtrrLib
   PcdLib
+  MemcryptSevLib
 
 [Pcd]
   gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [RFC PATCH v1 3/5] OvmfPkg/PlatformPei: Initialize SEV support
Posted by Laszlo Ersek 7 years, 8 months ago
On 03/07/17 00:27, Brijesh Singh wrote:
> Initialize Secure Encrypted Virtualization (SEV) support.
> 
> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
> ---
>  OvmfPkg/PlatformPei/Platform.c      |    6 ++++++
>  OvmfPkg/PlatformPei/PlatformPei.inf |    1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c
> index 0be8672..a948037 100644
> --- a/OvmfPkg/PlatformPei/Platform.c
> +++ b/OvmfPkg/PlatformPei/Platform.c
> @@ -33,6 +33,7 @@
>  #include <Library/PeiServicesLib.h>
>  #include <Library/QemuFwCfgLib.h>
>  #include <Library/ResourcePublicationLib.h>
> +#include <Library/MemcryptSevLib.h>
>  #include <Guid/MemoryTypeInformation.h>
>  #include <Ppi/MasterBootMode.h>
>  #include <IndustryStandard/Pci22.h>
> @@ -669,5 +670,10 @@ InitializePlatform (
>    MiscInitialization ();
>    InstallFeatureControlCallback ();
>  
> +  //
> +  // Initialize SEV support
> +  //
> +  MemcryptSevInitialize ();
> +

This will be called on both the normal boot path and the S3 resume boot
path. (Similarly to InstallFeatureControlCallback() above.) IIRC, you
did modify S3Resume2Pei to consider the PCD (and at that time we
discussed that setting the PCD here, in PlatformPei, would be
sufficiently early even for S3 resume). Thus, can you please confirm (in
the commit message) whether this works with S3 resume?

>    return EFI_SUCCESS;
>  }
> diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/PlatformPei.inf
> index fbaed31..f85b208 100644
> --- a/OvmfPkg/PlatformPei/PlatformPei.inf
> +++ b/OvmfPkg/PlatformPei/PlatformPei.inf
> @@ -60,6 +60,7 @@
>    QemuFwCfgLib
>    MtrrLib
>    PcdLib
> +  MemcryptSevLib

As noted before, I suggest to replace this new libclass (introduction
and dependency) simply with a new file here.

Thanks!
Laszlo

>  
>  [Pcd]
>    gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase
> 

_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
Re: [edk2] [RFC PATCH v1 3/5] OvmfPkg/PlatformPei: Initialize SEV support
Posted by Brijesh Singh 7 years, 8 months ago
On Tue, Mar 7, 2017 at 11:08 AM, Laszlo Ersek <lersek@redhat.com> wrote:

> On 03/07/17 00:27, Brijesh Singh wrote:
> > Initialize Secure Encrypted Virtualization (SEV) support.
> >
> > Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
> > ---
> >  OvmfPkg/PlatformPei/Platform.c      |    6 ++++++
> >  OvmfPkg/PlatformPei/PlatformPei.inf |    1 +
> >  2 files changed, 7 insertions(+)
> >
> > diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/
> Platform.c
> > index 0be8672..a948037 100644
> > --- a/OvmfPkg/PlatformPei/Platform.c
> > +++ b/OvmfPkg/PlatformPei/Platform.c
> > @@ -33,6 +33,7 @@
> >  #include <Library/PeiServicesLib.h>
> >  #include <Library/QemuFwCfgLib.h>
> >  #include <Library/ResourcePublicationLib.h>
> > +#include <Library/MemcryptSevLib.h>
> >  #include <Guid/MemoryTypeInformation.h>
> >  #include <Ppi/MasterBootMode.h>
> >  #include <IndustryStandard/Pci22.h>
> > @@ -669,5 +670,10 @@ InitializePlatform (
> >    MiscInitialization ();
> >    InstallFeatureControlCallback ();
> >
> > +  //
> > +  // Initialize SEV support
> > +  //
> > +  MemcryptSevInitialize ();
> > +
>
> This will be called on both the normal boot path and the S3 resume boot
> path. (Similarly to InstallFeatureControlCallback() above.) IIRC, you
> did modify S3Resume2Pei to consider the PCD (and at that time we
> discussed that setting the PCD here, in PlatformPei, would be
> sufficiently early even for S3 resume). Thus, can you please confirm (in
> the commit message) whether this works with S3 resume?
>
>
I have not tested te S3 resume funcationlity, should have mentioned in my
TODO list. I will test it before next rfc and update the commit messages
accordingly.


> >    return EFI_SUCCESS;
> >  }
> > diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/
> PlatformPei.inf
> > index fbaed31..f85b208 100644
> > --- a/OvmfPkg/PlatformPei/PlatformPei.inf
> > +++ b/OvmfPkg/PlatformPei/PlatformPei.inf
> > @@ -60,6 +60,7 @@
> >    QemuFwCfgLib
> >    MtrrLib
> >    PcdLib
> > +  MemcryptSevLib
>
> As noted before, I suggest to replace this new libclass (introduction
> and dependency) simply with a new file here.
>
>
Sure I will remove the dependency and create a new file in PlatformPei.



> Thanks!
> Laszlo
>
> >
> >  [Pcd]
> >    gUefiOvmfPkgTokenSpaceGuid.PcdOvmfPeiMemFvBase
> >
>
>


-- 
Confusion is always the most honest response.
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel