[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230516122159.3834044-1-dengqiao.joey@bytedance.com>
Date: Tue, 16 May 2023 20:21:59 +0800
From: "dengqiao.joey" <dengqiao.joey@...edance.com>
To: seanjc@...gle.com, pbonzini@...hat.com
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org,
"dengqiao.joey" <dengqiao.joey@...edance.com>
Subject: [PATCH] KVM: SVM: Update destination when updating pi irte
Destination of irte will be cleard by IOMMU driver when updating irte.
It will only be set correctly in vcpu_load. IOMMU will deliver the
doorbell message to the wrong physical cpu before vcpu_load is executed.
That means vcpu can not recognize interrupt delivery during the time of
non-root mode.
Signed-off-by: dengqiao.joey <dengqiao.joey@...edance.com>
---
arch/x86/kvm/svm/avic.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/svm/avic.c b/arch/x86/kvm/svm/avic.c
index cfc8ab773025..16fe41429123 100644
--- a/arch/x86/kvm/svm/avic.c
+++ b/arch/x86/kvm/svm/avic.c
@@ -933,8 +933,11 @@ int avic_pi_update_irte(struct kvm *kvm, unsigned int host_irq,
* we can reference to them directly when we update vcpu
* scheduling information in IOMMU irte.
*/
- if (!ret && pi.is_guest_mode)
+ if (!ret && pi.is_guest_mode) {
+ amd_iommu_update_ga(kvm_cpu_get_apicid(svm->vcpu.cpu),
+ true, pi.ir_data);
svm_ir_list_add(svm, &pi);
+ }
} else {
/* Use legacy mode in IRTE */
struct amd_iommu_pi_data pi;
--
2.11.0
Powered by blists - more mailing lists