Skip to content

Commit 5abf6dc

Browse files
committed
SEV: disable SEV-ES DebugSwap by default
The DebugSwap feature of SEV-ES provides a way for confidential guests to use data breakpoints. However, because the status of the DebugSwap feature is recorded in the VMSA, enabling it by default invalidates the attestation signatures. In 6.10 we will introduce a new API to create SEV VMs that will allow enabling DebugSwap based on what the user tells KVM to do. Contextually, we will change the legacy KVM_SEV_ES_INIT API to never enable DebugSwap. For compatibility with kernels that pre-date the introduction of DebugSwap, as well as with those where KVM_SEV_ES_INIT will never enable it, do not enable the feature by default. If anybody wants to use it, for now they can enable the sev_es_debug_swap_enabled module parameter, but this will result in a warning. Fixes: d1f85fb ("KVM: SEV: Enable data breakpoints in SEV-ES") Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 39fee31 commit 5abf6dc

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

arch/x86/kvm/svm/sev.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static bool sev_es_enabled = true;
5757
module_param_named(sev_es, sev_es_enabled, bool, 0444);
5858

5959
/* enable/disable SEV-ES DebugSwap support */
60-
static bool sev_es_debug_swap_enabled = true;
60+
static bool sev_es_debug_swap_enabled = false;
6161
module_param_named(debug_swap, sev_es_debug_swap_enabled, bool, 0444);
6262
#else
6363
#define sev_enabled false
@@ -612,8 +612,11 @@ static int sev_es_sync_vmsa(struct vcpu_svm *svm)
612612
save->xss = svm->vcpu.arch.ia32_xss;
613613
save->dr6 = svm->vcpu.arch.dr6;
614614

615-
if (sev_es_debug_swap_enabled)
615+
if (sev_es_debug_swap_enabled) {
616616
save->sev_features |= SVM_SEV_FEAT_DEBUG_SWAP;
617+
pr_warn_once("Enabling DebugSwap with KVM_SEV_ES_INIT. "
618+
"This will not work starting with Linux 6.10\n");
619+
}
617620

618621
pr_debug("Virtual Machine Save Area (VMSA):\n");
619622
print_hex_dump_debug("", DUMP_PREFIX_NONE, 16, 1, save, sizeof(*save), false);

0 commit comments

Comments
 (0)