Re: [PATCH v5 08/34] KVM: SVM: Prevent debugging under SEV-ES

From: Paolo Bonzini
Date: Mon Dec 14 2020 - 10:38:22 EST


On 10/12/20 18:09, Tom Lendacky wrote:
+static inline bool sev_guest(struct kvm *kvm)
+{
+#ifdef CONFIG_KVM_AMD_SEV
+ struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;
+
+ return sev->active;
+#else
+ return false;
+#endif
+}
+
+static inline bool sev_es_guest(struct kvm *kvm)
+{
+#ifdef CONFIG_KVM_AMD_SEV
+ struct kvm_sev_info *sev = &to_kvm_svm(kvm)->sev_info;
+
+ return sev_guest(kvm) && sev->es_active;
+#else
+ return false;
+#endif
+}
+

This code movement could have been done before.

Paolo