* [PATCH v2] KVM: SVM: Do not activate AVIC for SEV-enabled guest
@ 2022-04-08 13:37 Suravee Suthikulpanit
2022-04-08 16:50 ` Paolo Bonzini
2022-04-08 17:02 ` Paolo Bonzini
0 siblings, 2 replies; 3+ messages in thread
From: Suravee Suthikulpanit @ 2022-04-08 13:37 UTC (permalink / raw)
To: linux-kernel, kvm
Cc: pbonzini, mlevitsk, seanjc, jon.grimm, brijesh.singh,
thomas.lendacky, Suravee Suthikulpanit
Since current AVIC implementation cannot support encrypted memory,
inhibit AVIC for SEV-enabled guest.
Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
---
arch/x86/include/asm/kvm_host.h | 1 +
arch/x86/kvm/svm/avic.c | 3 ++-
arch/x86/kvm/svm/sev.c | 2 ++
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
index d23e80a56eb8..ee5b0589d2b3 100644
--- a/arch/x86/include/asm/kvm_host.h
+++ b/arch/x86/include/asm/kvm_host.h
@@ -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 {
diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c
index a1cf9c31273b..421619540ff9 100644
--- a/arch/x86/kvm/svm/avic.c
+++ b/arch/x86/kvm/svm/avic.c
@@ -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);
}
diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c
index 75fa6dd268f0..6524409f8e07 100644
--- a/arch/x86/kvm/svm/sev.c
+++ b/arch/x86/kvm/svm/sev.c
@@ -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:
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] KVM: SVM: Do not activate AVIC for SEV-enabled guest
2022-04-08 13:37 [PATCH v2] KVM: SVM: Do not activate AVIC for SEV-enabled guest Suravee Suthikulpanit
@ 2022-04-08 16:50 ` Paolo Bonzini
2022-04-08 17:02 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-04-08 16:50 UTC (permalink / raw)
To: Suravee Suthikulpanit
Cc: linux-kernel, kvm, pbonzini, mlevitsk, seanjc, jon.grimm,
brijesh.singh, thomas.lendacky
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] KVM: SVM: Do not activate AVIC for SEV-enabled guest
2022-04-08 13:37 [PATCH v2] KVM: SVM: Do not activate AVIC for SEV-enabled guest Suravee Suthikulpanit
2022-04-08 16:50 ` Paolo Bonzini
@ 2022-04-08 17:02 ` Paolo Bonzini
1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2022-04-08 17:02 UTC (permalink / raw)
To: Suravee Suthikulpanit
Cc: linux-kernel, kvm, pbonzini, mlevitsk, seanjc, jon.grimm,
brijesh.singh, thomas.lendacky
Queued, thanks.
Paolo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-08 17:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-08 13:37 [PATCH v2] KVM: SVM: Do not activate AVIC for SEV-enabled guest Suravee Suthikulpanit
2022-04-08 16:50 ` Paolo Bonzini
2022-04-08 17:02 ` Paolo Bonzini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).