If an SEV-ES guest requests termination, exit to userspace with KVM_EXIT_SYSTEM_EVENT and a dedicated SEV_TERM type instead of -EINVAL so that userspace can take appropriate action. See AMD's GHCB spec section '4.1.13 Termination Request' for more details. Suggested-by: Sean Christopherson <seanjc@google.com> Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Cc: kvm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Peter Gonda <pgonda@google.com>
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -444,8 +444,11 @@ struct kvm_run { · 443 unmodified lines | ||
| 444 | 444 | #define KVM_SYSTEM_EVENT_SHUTDOWN 1 |
| 445 | 445 | #define KVM_SYSTEM_EVENT_RESET 2 |
| 446 | 446 | #define KVM_SYSTEM_EVENT_CRASH 3 |
| 447 | +#define KVM_SYSTEM_EVENT_SEV_TERM 4 | |
| 448 | +#define KVM_SYSTEM_EVENT_NDATA_VALID (1u << 31) | |
| 447 | 449 | __u32 type; |
| 448 | − __u64 flags; | |
| 450 | + __u32 ndata; | |
| 451 | + __u64 data[16]; | |
| 449 | 452 | } system_event; |
| 450 | 453 | /* KVM_EXIT_S390_STSI */ |
| 451 | 454 | struct { |