From: Dionna Glaze <dionnaglaze@google.com>
To: linux-kernel@vger.kernel.org, x86@kernel.org
Cc: Dionna Glaze <dionnaglaze@google.com>,
Sean Christopherson <seanjc@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Ashish Kalra <ashish.kalra@amd.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
John Allen <john.allen@amd.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Michael Roth <michael.roth@amd.com>,
Luis Chamberlain <mcgrof@kernel.org>,
Russ Weight <russ.weight@linux.dev>,
Danilo Krummrich <dakr@redhat.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Tianfei zhang <tianfei.zhang@intel.com>
Subject: [PATCH 0/4] Support SEV firmware hotloading
Date: Tue, 29 Oct 2024 18:39:00 +0000 [thread overview]
Message-ID: <20241029183907.3536683-1-dionnaglaze@google.com> (raw)
The SEV-SNP API specifies a command for hotloading the SEV firmware.
when no SEV or SEV-ES guests are running. The firmware hotloading
support is dependent on the firmware_upload API for better ease-of-use,
and to not necessarily require SEV firmware hotloading support when
building the ccp driver.
For safety, there are steps the kernel should take before allowing a
firmware to be committed:
1. Writeback invalidate all.
2. Data fabric flush.
3. All GCTX pages must be updated successfully with SNP_GUEST_STATUS
The snp_context_create function had the possibility to leak GCTX pages,
so the first patch fixes that bug in KVM.
The ccp driver must continue to be unloadable, so the second patch in
this series fixes a cyclic refcount bug in firmware_loader.
The third patch adds SEV_CMD_DOWNLOAD_FIRMWARE_EX support with the
required safety conditions and adds a new argument to the platform
initialization arguments to delay legacy platform initialization.
The command allows for firmware to be committed at the time of download,
but due to the safety requirements, its better to leave that to a follow-up
SNP_COMMIT command.
The fourth patch uses the new platform initialization argument when the
vm_type is not legacy SEV/SEV-ES.
The bulk of this series is in the changes to ccp in the third patch.
The KVM_EXIT for requesting certificates on extended guest request is
not part of this patch series. Any such support must be designed with
races between SNP_COMMIT and servicing extended guest requests such that
the REPORTED_TCB in an attestation_report always correctly corresponds
to the certificates returned by the extended guest request handler.
CC: Sean Christopherson <seanjc@google.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Ingo Molnar <mingo@redhat.com>
CC: Borislav Petkov <bp@alien8.de>
CC: Dave Hansen <dave.hansen@linux.intel.com>
CC: Ashish Kalra <ashish.kalra@amd.com>
CC: Tom Lendacky <thomas.lendacky@amd.com>
CC: John Allen <john.allen@amd.com>
CC: Herbert Xu <herbert@gondor.apana.org.au>
CC: "David S. Miller" <davem@davemloft.net>
CC: Michael Roth <michael.roth@amd.com>
CC: Luis Chamberlain <mcgrof@kernel.org>
CC: Russ Weight <russ.weight@linux.dev>
CC: Danilo Krummrich <dakr@redhat.com>
CC: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
CC: "Rafael J. Wysocki" <rafael@kernel.org>
CC: Tianfei zhang <tianfei.zhang@intel.com>
Dionna Glaze (4):
kvm: svm: Fix gctx page leak on invalid inputs
firmware_loader: Move module refcounts to allow unloading
crypto: ccp: Add SNP firmware hotload support
KVM: SVM: Delay legacy platform initialization on SNP
arch/x86/kvm/svm/sev.c | 10 +-
drivers/base/firmware_loader/sysfs_upload.c | 28 +-
drivers/crypto/ccp/Kconfig | 2 +
drivers/crypto/ccp/sev-dev.c | 398 +++++++++++++++++++-
drivers/crypto/ccp/sev-dev.h | 14 +
include/linux/psp-sev.h | 28 ++
include/uapi/linux/psp-sev.h | 5 +
7 files changed, 464 insertions(+), 21 deletions(-)
--
2.47.0.163.g1226f6d8fa-goog
next reply other threads:[~2024-10-29 18:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-29 18:39 Dionna Glaze [this message]
2024-10-29 18:39 ` [PATCH 1/4] kvm: svm: Fix gctx page leak on invalid inputs Dionna Glaze
2024-10-29 18:39 ` [PATCH 2/4] firmware_loader: Move module refcounts to allow unloading Dionna Glaze
2024-10-30 0:14 ` Greg Kroah-Hartman
2024-10-31 15:53 ` Russ Weight
2024-10-29 18:39 ` [PATCH 3/4] crypto: ccp: Add SNP firmware hotload support Dionna Glaze
2024-10-31 10:43 ` Kalra, Ashish
2024-10-29 18:39 ` [PATCH 4/4] KVM: SVM: Delay legacy platform initialization on SNP Dionna Glaze
2024-10-31 8:17 ` Kalra, Ashish
2024-10-31 8:00 ` [PATCH 2/4] firmware_loader: Move module refcounts to allow unloading Ashish Kalra
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=20241029183907.3536683-1-dionnaglaze@google.com \
--to=dionnaglaze@google.com \
--cc=ashish.kalra@amd.com \
--cc=bp@alien8.de \
--cc=dakr@redhat.com \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=gregkh@linuxfoundation.org \
--cc=herbert@gondor.apana.org.au \
--cc=john.allen@amd.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=michael.roth@amd.com \
--cc=mingo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=rafael@kernel.org \
--cc=russ.weight@linux.dev \
--cc=seanjc@google.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=tianfei.zhang@intel.com \
--cc=x86@kernel.org \
/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®