SEV: disable SEV-ES DebugSwap by default
authorPaolo Bonzini <pbonzini@redhat.com>
Sat, 9 Mar 2024 16:24:58 +0000 (11:24 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 9 Mar 2024 16:42:25 +0000 (11:42 -0500)
commit5abf6dceb066f2b02b225fd561440c98a8062681
tree2faf5ac77ceb45ff0b156d4b8880423ff32db34f
parent39fee313fdd489480eb2c453535ab73672c39a27
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: d1f85fbe836e ("KVM: SEV: Enable data breakpoints in SEV-ES")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/svm/sev.c