public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "Xu, Min M" <min.m.xu@intel.com>,
	"devel@edk2.groups.io" <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
Date: Sun, 12 Jun 2022 13:33:30 +0000	[thread overview]
Message-ID: <MW4PR11MB58729C266FEC9C288DC864CD8CA89@MW4PR11MB5872.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220612112434.1829-2-min.m.xu@intel.com>

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


  reply	other threads:[~2022-06-12 13:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2022-06-16  8:51     ` Yao, Jiewen
2022-06-12 13:33 ` [PATCH 1/2] OvmfPkg: Use PcdOvmfWorkAreaBase instead of PcdSevEsWorkAreaBase Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MW4PR11MB58729C266FEC9C288DC864CD8CA89@MW4PR11MB5872.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox