linux-coco.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] kvm: sev: Add SNP guest request throttling
@ 2025-05-15 22:03 Dionna Glaze
  2025-05-15 22:03 ` [PATCH v5 1/2] kvm: sev: Add SEV-SNP " Dionna Glaze
  2025-05-15 22:04 ` [PATCH v5 2/2] kvm: sev: If ccp is busy, report busy to guest Dionna Glaze
  0 siblings, 2 replies; 8+ messages in thread
From: Dionna Glaze @ 2025-05-15 22:03 UTC (permalink / raw)
  To: kvm; +Cc: linux-kernel, linux-coco, Dionna Glaze

The GHCB specification recommends that SNP guest requests should be
rate limited. Add a command to permit the VMM to set the rate limit
on a per-VM scale.

The AMD-SP is a global resource that must be shared across VMs, so
its time should be multiplexed across VMs fairly. It is the
responsibility of the VMM to ensure all SEV-SNP VMs have a rate limit
set such that the collective set of VMs on the machine have a rate of
access that does not exceed the device's capacity.

The sev-guest device already respects the SNP_GUEST_VMM_ERR_BUSY
result code, so utilize that result to cause the guest to retry after
waiting momentarily.

Changes since v4:
  * Fixed build failure caused by rebase.
  * Added ratelimit.h include.
  * Added rate bounds checking to stay within ratelimit types.
Changes since v3:
  * Rebased on master, changed module parameter to mem_enc_ioctl
    command. Changed commit descriptions. Much time has passed.
Changes since v2:
  * Rebased on v7, changed "we" wording to passive voice.
Changes since v1:
  * Added missing Ccs to patches.

Dionna Glaze (2):
  kvm: sev: Add SEV-SNP guest request throttling
  kvm: sev: If ccp is busy, report busy to guest

 .../virt/kvm/x86/amd-memory-encryption.rst    | 23 +++++++++++
 arch/x86/include/uapi/asm/kvm.h               |  7 ++++
 arch/x86/kvm/svm/sev.c                        | 38 +++++++++++++++++++
 arch/x86/kvm/svm/svm.h                        |  3 ++
 4 files changed, 71 insertions(+)

-- 
2.49.0.1101.gccaa498523-goog


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

end of thread, other threads:[~2025-05-28 18:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-15 22:03 [PATCH v5 0/2] kvm: sev: Add SNP guest request throttling Dionna Glaze
2025-05-15 22:03 ` [PATCH v5 1/2] kvm: sev: Add SEV-SNP " Dionna Glaze
2025-05-15 22:40   ` Sean Christopherson
2025-05-15 22:49     ` Dionna Amalie Glaze
2025-05-17  0:37     ` Dionna Amalie Glaze
2025-05-21 18:19       ` Sean Christopherson
2025-05-28 18:25         ` Dionna Amalie Glaze
2025-05-15 22:04 ` [PATCH v5 2/2] kvm: sev: If ccp is busy, report busy to guest Dionna Glaze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).