public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 1/2] OvmfPkg: Use PcdOvmfWorkAreaBase instead of PcdSevEsWorkAreaBase
@ 2022-06-12 11:24 Min Xu
  2022-06-12 11:24 ` [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is not Tdx guest Min Xu
  2022-06-12 13:33 ` [PATCH 1/2] OvmfPkg: Use PcdOvmfWorkAreaBase instead of PcdSevEsWorkAreaBase Yao, Jiewen
  0 siblings, 2 replies; 5+ messages in thread
From: Min Xu @ 2022-06-12 11:24 UTC (permalink / raw)
  To: devel
  Cc: Min M Xu, Erdem Aktas, Gerd Hoffmann, James Bottomley, Jiewen Yao,
	Tom Lendacky

From: Min M Xu <min.m.xu@intel.com>

It is an typo error that HobList pointer should be stored at
PcdOvmfWorkAreaBase, not PcdSevEsWorkAreaBase.

Cc: Erdem Aktas <erdemaktas@google.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
---
 .../IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c  | 4 ++--
 .../PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c
index 1b41a3983c99..ecd271c0bdff 100644
--- a/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c
+++ b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c
@@ -27,7 +27,7 @@ PrePeiGetHobList (
 {
   TDX_WORK_AREA  *TdxWorkArea;
 
-  TdxWorkArea = (TDX_WORK_AREA *)(UINTN)FixedPcdGet32 (PcdSevEsWorkAreaBase);
+  TdxWorkArea = (TDX_WORK_AREA *)(UINTN)FixedPcdGet32 (PcdOvmfWorkAreaBase);
   ASSERT (TdxWorkArea != NULL);
   ASSERT (TdxWorkArea->SecTdxWorkArea.HobList != 0);
 
@@ -48,7 +48,7 @@ PrePeiSetHobList (
 {
   TDX_WORK_AREA  *TdxWorkArea;
 
-  TdxWorkArea = (TDX_WORK_AREA *)(UINTN)FixedPcdGet32 (PcdSevEsWorkAreaBase);
+  TdxWorkArea = (TDX_WORK_AREA *)(UINTN)FixedPcdGet32 (PcdOvmfWorkAreaBase);
   ASSERT (TdxWorkArea != NULL);
 
   TdxWorkArea->SecTdxWorkArea.HobList = (UINTN)HobList;
diff --git a/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf
index 2667f841cea2..fe7ee23fdc8a 100644
--- a/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf
+++ b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf
@@ -23,7 +23,7 @@
   UefiCpuPkg/UefiCpuPkg.dec
 
 [Pcd]
-  gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase
+  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
 
 [LibraryClasses]
   PcdLib
-- 
2.29.2.windows.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is not Tdx guest
  2022-06-12 11:24 [PATCH 1/2] OvmfPkg: Use PcdOvmfWorkAreaBase instead of PcdSevEsWorkAreaBase Min Xu
@ 2022-06-12 11:24 ` Min Xu
  2022-06-12 13:33   ` Yao, Jiewen
  2022-06-12 13:33 ` [PATCH 1/2] OvmfPkg: Use PcdOvmfWorkAreaBase instead of PcdSevEsWorkAreaBase Yao, Jiewen
  1 sibling, 1 reply; 5+ messages in thread
From: Min Xu @ 2022-06-12 11:24 UTC (permalink / raw)
  To: devel; +Cc: Min M Xu, Gerd Hoffmann, Jiewen Yao, Jian J Wang

From: Min M Xu <min.m.xu@intel.com>

HashLibTdx is designed for the Tdx guest. So if is not a Tdx guest,
return EFI_UNSUPPORTED in RegisterHashInterfaceLib.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Jian J Wang <jian.j.wang@intel.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
---
 SecurityPkg/Library/HashLibTdx/HashLibTdx.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/SecurityPkg/Library/HashLibTdx/HashLibTdx.c b/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
index 75d96ee64b44..3cebbc70d3ec 100644
--- a/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
+++ b/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
@@ -186,7 +186,13 @@ RegisterHashInterfaceLib (
   IN HASH_INTERFACE  *HashInterface
   )
 {
-  ASSERT (TdIsEnabled ());
+  //
+  // HashLibTdx is designed for Tdx guest. So if it is not Tdx guest,
+  // return EFI_UNSUPPORTED.
+  //
+  if (!TdIsEnabled ()) {
+    return EFI_UNSUPPORTED;
+  }
 
   //
   // Only SHA384 is allowed.
-- 
2.29.2.windows.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] OvmfPkg: Use PcdOvmfWorkAreaBase instead of PcdSevEsWorkAreaBase
  2022-06-12 11:24 [PATCH 1/2] OvmfPkg: Use PcdOvmfWorkAreaBase instead of PcdSevEsWorkAreaBase Min Xu
  2022-06-12 11:24 ` [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is not Tdx guest Min Xu
@ 2022-06-12 13:33 ` Yao, Jiewen
  1 sibling, 0 replies; 5+ messages in thread
From: Yao, Jiewen @ 2022-06-12 13:33 UTC (permalink / raw)
  To: Xu, Min M, devel@edk2.groups.io
  Cc: Aktas, Erdem, Gerd Hoffmann, James Bottomley, Tom Lendacky

Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>

> -----Original Message-----
> From: Xu, Min M <min.m.xu@intel.com>
> Sent: Sunday, June 12, 2022 7:25 PM
> To: devel@edk2.groups.io
> Cc: Xu, Min M <min.m.xu@intel.com>; Aktas, Erdem
> <erdemaktas@google.com>; Gerd Hoffmann <kraxel@redhat.com>; James
> Bottomley <jejb@linux.ibm.com>; Yao, Jiewen <jiewen.yao@intel.com>; Tom
> Lendacky <thomas.lendacky@amd.com>
> Subject: [PATCH 1/2] OvmfPkg: Use PcdOvmfWorkAreaBase instead of
> PcdSevEsWorkAreaBase
> 
> From: Min M Xu <min.m.xu@intel.com>
> 
> It is an typo error that HobList pointer should be stored at
> PcdOvmfWorkAreaBase, not PcdSevEsWorkAreaBase.
> 
> Cc: Erdem Aktas <erdemaktas@google.com>
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: James Bottomley <jejb@linux.ibm.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Tom Lendacky <thomas.lendacky@amd.com>
> Signed-off-by: Min Xu <min.m.xu@intel.com>
> ---
>  .../IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c  | 4 ++--
>  .../PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf   | 2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c
> b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c
> index 1b41a3983c99..ecd271c0bdff 100644
> --- a/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c
> +++ b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointer.c
> @@ -27,7 +27,7 @@ PrePeiGetHobList (
>  {
>    TDX_WORK_AREA  *TdxWorkArea;
> 
> -  TdxWorkArea = (TDX_WORK_AREA *)(UINTN)FixedPcdGet32
> (PcdSevEsWorkAreaBase);
> +  TdxWorkArea = (TDX_WORK_AREA *)(UINTN)FixedPcdGet32
> (PcdOvmfWorkAreaBase);
>    ASSERT (TdxWorkArea != NULL);
>    ASSERT (TdxWorkArea->SecTdxWorkArea.HobList != 0);
> 
> @@ -48,7 +48,7 @@ PrePeiSetHobList (
>  {
>    TDX_WORK_AREA  *TdxWorkArea;
> 
> -  TdxWorkArea = (TDX_WORK_AREA *)(UINTN)FixedPcdGet32
> (PcdSevEsWorkAreaBase);
> +  TdxWorkArea = (TDX_WORK_AREA *)(UINTN)FixedPcdGet32
> (PcdOvmfWorkAreaBase);
>    ASSERT (TdxWorkArea != NULL);
> 
>    TdxWorkArea->SecTdxWorkArea.HobList = (UINTN)HobList;
> diff --git
> a/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf
> b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf
> index 2667f841cea2..fe7ee23fdc8a 100644
> ---
> a/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf
> +++
> b/OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiHobListPointerLibTdx.inf
> @@ -23,7 +23,7 @@
>    UefiCpuPkg/UefiCpuPkg.dec
> 
>  [Pcd]
> -  gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase
> +  gUefiOvmfPkgTokenSpaceGuid.PcdOvmfWorkAreaBase
> 
>  [LibraryClasses]
>    PcdLib
> --
> 2.29.2.windows.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is not Tdx guest
  2022-06-12 11:24 ` [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is not Tdx guest Min Xu
@ 2022-06-12 13:33   ` Yao, Jiewen
  2022-06-16  8:51     ` Yao, Jiewen
  0 siblings, 1 reply; 5+ messages in thread
From: Yao, Jiewen @ 2022-06-12 13:33 UTC (permalink / raw)
  To: Xu, Min M, devel@edk2.groups.io; +Cc: Gerd Hoffmann, Wang, Jian J

Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>

> -----Original Message-----
> From: Xu, Min M <min.m.xu@intel.com>
> Sent: Sunday, June 12, 2022 7:25 PM
> To: devel@edk2.groups.io
> Cc: Xu, Min M <min.m.xu@intel.com>; Gerd Hoffmann <kraxel@redhat.com>;
> Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>
> Subject: [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is
> not Tdx guest
> 
> From: Min M Xu <min.m.xu@intel.com>
> 
> HashLibTdx is designed for the Tdx guest. So if is not a Tdx guest,
> return EFI_UNSUPPORTED in RegisterHashInterfaceLib.
> 
> Cc: Gerd Hoffmann <kraxel@redhat.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Signed-off-by: Min Xu <min.m.xu@intel.com>
> ---
>  SecurityPkg/Library/HashLibTdx/HashLibTdx.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
> b/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
> index 75d96ee64b44..3cebbc70d3ec 100644
> --- a/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
> +++ b/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
> @@ -186,7 +186,13 @@ RegisterHashInterfaceLib (
>    IN HASH_INTERFACE  *HashInterface
>    )
>  {
> -  ASSERT (TdIsEnabled ());
> +  //
> +  // HashLibTdx is designed for Tdx guest. So if it is not Tdx guest,
> +  // return EFI_UNSUPPORTED.
> +  //
> +  if (!TdIsEnabled ()) {
> +    return EFI_UNSUPPORTED;
> +  }
> 
>    //
>    // Only SHA384 is allowed.
> --
> 2.29.2.windows.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is not Tdx guest
  2022-06-12 13:33   ` Yao, Jiewen
@ 2022-06-16  8:51     ` Yao, Jiewen
  0 siblings, 0 replies; 5+ messages in thread
From: Yao, Jiewen @ 2022-06-16  8:51 UTC (permalink / raw)
  To: Xu, Min M, devel@edk2.groups.io; +Cc: Gerd Hoffmann, Wang, Jian J

Both are merged. https://github.com/tianocore/edk2/pull/2981

> -----Original Message-----
> From: Yao, Jiewen
> Sent: Sunday, June 12, 2022 9:34 PM
> To: Xu, Min M <min.m.xu@intel.com>; devel@edk2.groups.io
> Cc: Gerd Hoffmann <kraxel@redhat.com>; Wang, Jian J <jian.j.wang@intel.com>
> Subject: RE: [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if
> it is not Tdx guest
> 
> Reviewed-by: Jiewen Yao <Jiewen.yao@intel.com>
> 
> > -----Original Message-----
> > From: Xu, Min M <min.m.xu@intel.com>
> > Sent: Sunday, June 12, 2022 7:25 PM
> > To: devel@edk2.groups.io
> > Cc: Xu, Min M <min.m.xu@intel.com>; Gerd Hoffmann <kraxel@redhat.com>;
> > Yao, Jiewen <jiewen.yao@intel.com>; Wang, Jian J <jian.j.wang@intel.com>
> > Subject: [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it
> is
> > not Tdx guest
> >
> > From: Min M Xu <min.m.xu@intel.com>
> >
> > HashLibTdx is designed for the Tdx guest. So if is not a Tdx guest,
> > return EFI_UNSUPPORTED in RegisterHashInterfaceLib.
> >
> > Cc: Gerd Hoffmann <kraxel@redhat.com>
> > Cc: Jiewen Yao <jiewen.yao@intel.com>
> > Cc: Jian J Wang <jian.j.wang@intel.com>
> > Signed-off-by: Min Xu <min.m.xu@intel.com>
> > ---
> >  SecurityPkg/Library/HashLibTdx/HashLibTdx.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
> > b/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
> > index 75d96ee64b44..3cebbc70d3ec 100644
> > --- a/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
> > +++ b/SecurityPkg/Library/HashLibTdx/HashLibTdx.c
> > @@ -186,7 +186,13 @@ RegisterHashInterfaceLib (
> >    IN HASH_INTERFACE  *HashInterface
> >    )
> >  {
> > -  ASSERT (TdIsEnabled ());
> > +  //
> > +  // HashLibTdx is designed for Tdx guest. So if it is not Tdx guest,
> > +  // return EFI_UNSUPPORTED.
> > +  //
> > +  if (!TdIsEnabled ()) {
> > +    return EFI_UNSUPPORTED;
> > +  }
> >
> >    //
> >    // Only SHA384 is allowed.
> > --
> > 2.29.2.windows.2


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-16  8:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-12 11:24 [PATCH 1/2] OvmfPkg: Use PcdOvmfWorkAreaBase instead of PcdSevEsWorkAreaBase Min Xu
2022-06-12 11:24 ` [PATCH 2/2] SecurityPkg/HashLibTdx: Return EFI_UNSUPPORTED if it is not Tdx guest Min Xu
2022-06-12 13:33   ` Yao, Jiewen
2022-06-16  8:51     ` Yao, Jiewen
2022-06-12 13:33 ` [PATCH 1/2] OvmfPkg: Use PcdOvmfWorkAreaBase instead of PcdSevEsWorkAreaBase Yao, Jiewen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox