The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH 0/4] Support SEV firmware hotloading
@ 2024-10-29 18:39 Dionna Glaze
  2024-10-29 18:39 ` [PATCH 1/4] kvm: svm: Fix gctx page leak on invalid inputs Dionna Glaze
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Dionna Glaze @ 2024-10-29 18:39 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Dionna Glaze, Sean Christopherson, Paolo Bonzini, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, Ashish Kalra,
	Tom Lendacky, John Allen, Herbert Xu, David S. Miller,
	Michael Roth, Luis Chamberlain, Russ Weight, Danilo Krummrich,
	Greg Kroah-Hartman, Rafael J. Wysocki, Tianfei zhang

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


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

end of thread, other threads:[~2024-10-31 15:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-29 18:39 [PATCH 0/4] Support SEV firmware hotloading Dionna Glaze
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

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