SEV-SNP (KVM): support guest-created APs so the launch measurement does not depend on the vCPU count

オープン
#9,091 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
12/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust, wasm
領域
cloud

調査の方向性

Start with the vCPU creation path in CpuManager and the IGVM loader's handling of SnpVpContext and complete_isolated_import, since the proposal turns on whether APs can be created after launch finish. Confirm how KVM SNP vCPUs behave when added after KVM_SEV_SNP_LAUNCH_FINISH. Done means a documented design plus an opt-in ap_creation=guest path that keeps the default unchanged.

索引モデルが issue の本文から書いたものです。

説明

Problem

With --platform sev_snp=on and --igvm, every vCPU listed in --cpus boot=N exists before
KVM_SEV_SNP_LAUNCH_FINISH. The IGVM loader sets each vCPU's state from the SnpVpContext with the
matching vp_index, and KVM encrypts and measures the VMSA of every existing vCPU at launch finish.
So the launch digest includes one VMSA per vCPU, and an image has to be built and measured once per
vCPU count. A vCPU without a matching SnpVpContext keeps a default state that is still measured and
started, and the guest triple-faults (seen booting boot=2 with an IGVM that has one VMSA).

For attestation-based deployments this means one expected measurement per vCPU count, and anything
derived from the measurement (sealing keys via SNP_GET_DERIVED_KEY) changes when a VM is resized.

Proposal

SEV-SNP supports guest-created AP state (the guest issues the AP Creation NAE event with a VMSA it
built and validated in its own private memory). Linux guests already use it. Supporting it in the VMM:

  1. Create only the BSP (vp_index 0) before KVM_SEV_SNP_LAUNCH_FINISH, so only its VMSA is measured.
  2. Create the remaining boot - 1 vCPUs after launch finish, so their state comes only from the
    guest's AP Creation request and the host never supplies it.
  3. Opt-in, e.g. --platform sev_snp=on,ap_creation=guest (or automatic when the IGVM contains only a
    vp_index 0 context), keeping today's behaviour as the default.

Security

Unchanged: the host still cannot set or read any vCPU's state. It chooses how many vCPUs to offer,
which only affects performance.

Questions

  • Does the vCPU creation order in CpuManager / the IGVM loader allow creating APs after
    complete_isolated_import, or does this need a separate path?
  • Does KVM support adding SNP vCPUs after KVM_SEV_SNP_LAUNCH_FINISH and keep them unrunnable
    until the guest's AP Creation request, or does that need KVM work as well?
  • Any concerns with MSHV, which is not covered by this request?

Happy to test on Genoa and Turin hosts (KVM, 0c0d8a6f + patches).

主要言語
Rust
スター
6.3k
フォーク
786
平均マージ
1日 3時間
マージ済み PR(30日)
195

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cloud-hypervisor/cloud-hypervisor のほかの issue

cloud-hypervisor/cloud-hypervisor の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。