mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Mario Limonciello <mario.limonciello@amd.com>,
	John Allen <john.allen@amd.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S . Miller" <davem@davemloft.net>
Cc: open list <linux-kernel@vger.kernel.org>,
	"open list:AMD CRYPTOGRAPHIC COPROCESSOR (CCP) DRIVER" 
	<linux-crypto@vger.kernel.org>,
	Kerneis Gabriel <Gabriel.Kerneis@ssi.gouv.fr>,
	Richard Hughes <hughsient@gmail.com>
Subject: Re: [PATCH v2 4/4] crypto: ccp: When TSME and SME both detected notify user
Date: Thu, 31 Mar 2022 15:12:21 -0500	[thread overview]
Message-ID: <f0a1cb5b-091e-a94b-f767-533f75d0296e@amd.com> (raw)
In-Reply-To: <20220329164117.1449-5-mario.limonciello@amd.com>

On 3/29/22 11:41, Mario Limonciello wrote:
> CC_ATTR_HOST_MEM_ENCRYPT is used to relay that memory encryption has been
> activated by the kernel.
> 
> As it's technically possible to enable both SME and TSME at the same time,
> detect this scenario and notify the user that enabling TSME and SME at the
> same time is unnecessary.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> v1->v2:
>   * Reword notice about TSME/SME
>   * Use cc_platform_has instead
> ---
>   drivers/crypto/ccp/psp-dev.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/crypto/ccp/psp-dev.c b/drivers/crypto/ccp/psp-dev.c
> index 3f47b2d81e3c..38cffc1de4ab 100644
> --- a/drivers/crypto/ccp/psp-dev.c
> +++ b/drivers/crypto/ccp/psp-dev.c
> @@ -74,6 +74,13 @@ static unsigned int psp_get_capability(struct psp_device *psp)
>   	}
>   	psp->capability = val;
>   
> +

Extra blank line.

> +	/* Detect TSME / SME both enabled */

"Detect if TSME and SME are both enabled"

Thanks,
Tom

> +	if (psp->capability & PSP_CAPABILITY_PSP_SECURITY_REPORTING &&
> +	    psp->capability & (PSP_SECURITY_TSME_STATUS << PSP_CAPABILITY_PSP_SECURITY_OFFSET) &&
> +	    cc_platform_has(CC_ATTR_HOST_MEM_ENCRYPT))
> +		dev_notice(psp->dev, "psp: Both TSME and SME are active, SME is unnecessary when TSME is active.\n");
> +
>   	return 0;
>   }
>   

      reply	other threads:[~2022-03-31 20:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 16:41 [PATCH v2 0/4] Export PSP security attributes Mario Limonciello
2022-03-29 16:41 ` [PATCH v2 1/4] crypto: ccp: cache capability into psp device Mario Limonciello
2022-03-31 20:02   ` Tom Lendacky
2022-03-29 16:41 ` [PATCH v2 2/4] crypto: ccp: Export PSP security bits to userspace Mario Limonciello
2022-03-31 20:03   ` Tom Lendacky
2022-03-29 16:41 ` [PATCH v2 3/4] crypto: ccp: Allow PSP driver to load without SEV/TEE support Mario Limonciello
2022-03-31 20:10   ` Tom Lendacky
2022-03-29 16:41 ` [PATCH v2 4/4] crypto: ccp: When TSME and SME both detected notify user Mario Limonciello
2022-03-31 20:12   ` Tom Lendacky [this message]

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-all 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=f0a1cb5b-091e-a94b-f767-533f75d0296e@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=Gabriel.Kerneis@ssi.gouv.fr \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=hughsient@gmail.com \
    --cc=john.allen@amd.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    /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

all inboxes | Powered by JetHome®