]> git.baikalelectronics.ru Git - kernel.git/commitdiff
KVM: SVM: Do not activate AVIC for SEV-enabled guest
authorSuravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Fri, 8 Apr 2022 13:37:10 +0000 (08:37 -0500)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 11 Apr 2022 17:28:56 +0000 (13:28 -0400)
Since current AVIC implementation cannot support encrypted memory,
inhibit AVIC for SEV-enabled guest.

Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Message-Id: <20220408133710.54275-1-suravee.suthikulpanit@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/avic.c
arch/x86/kvm/svm/sev.c

index 0d37ba442de344eeb4cfd0ccf742105646600be3..92843fcdc1cfa30b34480884ed653ddb7ce6e3a2 100644 (file)
@@ -1052,6 +1052,7 @@ enum kvm_apicv_inhibit {
        APICV_INHIBIT_REASON_X2APIC,
        APICV_INHIBIT_REASON_BLOCKIRQ,
        APICV_INHIBIT_REASON_ABSENT,
+       APICV_INHIBIT_REASON_SEV,
 };
 
 struct kvm_arch {
index a1cf9c31273b7c9176ea0f243a91d3725b28d4f3..421619540ff9d972ee7a441d7404f61fd5e957ba 100644 (file)
@@ -837,7 +837,8 @@ bool avic_check_apicv_inhibit_reasons(enum kvm_apicv_inhibit reason)
                          BIT(APICV_INHIBIT_REASON_IRQWIN) |
                          BIT(APICV_INHIBIT_REASON_PIT_REINJ) |
                          BIT(APICV_INHIBIT_REASON_X2APIC) |
-                         BIT(APICV_INHIBIT_REASON_BLOCKIRQ);
+                         BIT(APICV_INHIBIT_REASON_BLOCKIRQ) |
+                         BIT(APICV_INHIBIT_REASON_SEV);
 
        return supported & BIT(reason);
 }
index c2fe89ecdb2dd860881ffee07df46c663082f8cf..537aaddc852fc420b62bef0c4785bfb7c7b86eec 100644 (file)
@@ -260,6 +260,8 @@ static int sev_guest_init(struct kvm *kvm, struct kvm_sev_cmd *argp)
        INIT_LIST_HEAD(&sev->regions_list);
        INIT_LIST_HEAD(&sev->mirror_vms);
 
+       kvm_set_apicv_inhibit(kvm, APICV_INHIBIT_REASON_SEV);
+
        return 0;
 
 e_free: