mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Lendacky, Thomas" <Thomas.Lendacky@amd.com>
To: "Hao Feng" <fenghao@hygon.cn>, "Hook, Gary" <Gary.Hook@amd.com>,
	"'Herbert Xu '" <herbert@gondor.apana.org.au>,
	"' David S. Miller '" <davem@davemloft.net>,
	"Natarajan, Janakarajan" <Janakarajan.Natarajan@amd.com>,
	"'Joerg Roedel '" <joro@8bytes.org>,
	"'Paolo Bonzini '" <pbonzini@redhat.com>,
	"' Radim Krčmář '" <rkrcmar@redhat.com>,
	"'Thomas Gleixner '" <tglx@linutronix.de>,
	"'Ingo Molnar '" <mingo@redhat.com>,
	"'Borislav Petkov '" <bp@alien8.de>,
	"' H. Peter Anvin '" <hpa@zytor.com>
Cc: 'Zhaohui Du ' <duzhaohui@hygon.cn>,
	'Zhiwei Ying ' <yingzhiwei@hygon.cn>, 'Wen Pu ' <puwen@hygon.cn>,
	"x86@kernel.org" <x86@kernel.org>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Relph, Richard" <Richard.Relph@amd.com>
Subject: Re: [PATCH 0/6] Add Hygon SEV support
Date: Mon, 15 Apr 2019 15:32:17 +0000	[thread overview]
Message-ID: <e3decaf3-481c-d1b7-945c-0bc257122220@amd.com> (raw)
In-Reply-To: <1555329868-17895-1-git-send-email-fenghao@hygon.cn>

On 4/15/19 7:04 AM, Hao Feng wrote:
> Hygon SEV follows AMD SEV work flow, but uses China national standard
> cryptographic algorithms SM2/SM3/SM4 instead of (RSA, ECDSA,
> ECDH)/SHA/AES. Reuse most AMD SEV code path to support Hygon SEV,
> also adds 3 new commands(GM_PUBKEY_GEN, GM_GET_DIGEST,
> GM_VERIFY_DIGEST) to support SM2 key exchange protocol.
> 
> SM2 is based on ECC(Elliptic Curve Cryptography), and uses a special
> curve. It can be used in digital signature, key exchange and
> asymmetric cryptography. For key exchange, SM2 is similar to ECDH, but
> involves new random key, meaning the two sides need to exchange extra
> random public key besides their public key, that's why additional APIs
> are needed to support Hygon SEV.
> SM3 is a hash algorithm, similar to SHA-256.
> SM4 is a block cipher algorithm, similar to AES-128.
> 
> 1. GM_PUBKEY_GEN
> ----------------
> The command is used to get SM2 random public key from SEV firmware to
> compute share key.
> 
> Parameters:
> * GM_KEY_ID_PADDR (in) - Address of key ID for the random public key.
> * GM_KEY_ID_LEN (in) - Length of key ID.
> * GM_PUBKEY_PADDR (in) - Address of the random public key.
> * GM_PUBKEY_LEN (in,out) - Length of the random public key.
> 
> 2. GM_GET_DIGEST
> ----------------
> The command is used to get key digest from SEV firmware during SM2 key
> exchange, guest owner can check the digest to see if the key
> negotiation is successful or not.
> 
> Parameters:
> * HANDLE (in) - Guest handle
> * DIGEST_PADDR (in) - Address of the key digest
> * DIGEST_LEN (in, out) - Length of the key digest
> 
> 3. GM_VERIFY_DIGEST
> -------------------
> The command is used to send guest owner's key digest to SEV firmware
> during SM2 key exchange, firmware can check the digest to see if the
> negotiation is successful or not.
> 
> Parameters:
> * HANDLE (in) - Guest handle
> * DIGEST_PADDR (in) - Address of the key digest
> * DIGEST_LEN (in) - Length of the key digest
> 
> Already tested successfully on Hygon DhyanaPlus processor, also tested
> successfully on AMD EPYC processor, results show no side effect on
> current AMD SEV implementation.

You can't just randomly add commands to the SEV API.  You will need to
work with the SEV API specification owner to be sure there are not any
conflicts or other issues with what you are trying to do. Please work
with Richard Relph (Richard.Relph@amd.com) on this.

For now, NAK on all of this.

Thanks,
Tom

> 
> Hao Feng (6):
>   crypto: ccp: Add Hygon Dhyana support
>   crypto: ccp: Define Hygon SEV commands
>   crypto: ccp: Implement SEV_GM_PUBKEY_GEN ioctl command
>   KVM: Define Hygon SEV commands
>   KVM: SVM: Add support for KVM_SEV_GM_GET_DIGEST command
>   KVM: SVM: Add KVM_SEV_GM_VERIFY_DIGEST command
> 
>  arch/x86/kvm/svm.c           | 119 +++++++++++++++++++++++++++++++++++++++++++
>  drivers/crypto/ccp/psp-dev.c |  86 +++++++++++++++++++++++++++++++
>  drivers/crypto/ccp/sp-pci.c  |   2 +
>  include/linux/psp-sev.h      |  49 ++++++++++++++++++
>  include/uapi/linux/kvm.h     |  14 +++++
>  include/uapi/linux/psp-sev.h |  17 +++++++
>  6 files changed, 287 insertions(+)
> 

  parent reply	other threads:[~2019-04-15 15:32 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-15 12:04 Hao Feng
2019-04-15 12:04 ` [PATCH 1/6] crypto: ccp: Add Hygon Dhyana support Hao Feng
2019-04-15 12:04 ` [PATCH 2/6] crypto: ccp: Define Hygon SEV commands Hao Feng
2019-04-15 12:04 ` [PATCH 3/6] crypto: ccp: Implement SEV_GM_PUBKEY_GEN ioctl command Hao Feng
2019-04-15 12:04 ` [PATCH 4/6] KVM: Define Hygon SEV commands Hao Feng
2019-04-15 12:04 ` [PATCH 5/6] KVM: SVM: Add support for KVM_SEV_GM_GET_DIGEST command Hao Feng
2019-04-15 15:09   ` Borislav Petkov
     [not found]     ` <896956377bf441c3bfd911716418ce7e@hygon.cn>
2019-04-16  8:15       ` Borislav Petkov
2019-04-16 11:47         ` Hao Feng
2019-04-15 12:04 ` [PATCH 6/6] KVM: SVM: Add support for KVM_SEV_GM_VERIFY_DIGEST command Hao Feng
2019-04-15 15:32 ` Lendacky, Thomas [this message]
2019-04-15 15:37 ` [PATCH 0/6] Add Hygon SEV support Paolo Bonzini
2019-04-15 15:51   ` Pascal Van Leeuwen
2019-04-15 16:04     ` Paolo Bonzini
2019-04-16  6:58       ` Pascal Van Leeuwen
2019-04-16  8:09         ` Paolo Bonzini
2019-04-16  9:08           ` Pascal Van Leeuwen
2019-04-16 10:28           ` Hao Feng

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=e3decaf3-481c-d1b7-945c-0bc257122220@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=Gary.Hook@amd.com \
    --cc=Janakarajan.Natarajan@amd.com \
    --cc=Richard.Relph@amd.com \
    --cc=bp@alien8.de \
    --cc=davem@davemloft.net \
    --cc=duzhaohui@hygon.cn \
    --cc=fenghao@hygon.cn \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=puwen@hygon.cn \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=yingzhiwei@hygon.cn \
    /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®