All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: "dengqiao.joey" <dengqiao.joey@bytedance.com>
Cc: pbonzini@redhat.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: SVM: Update destination when updating pi irte
Date: Tue, 16 May 2023 08:54:36 -0700	[thread overview]
Message-ID: <ZGOnPMTEKqRq89jt@google.com> (raw)
In-Reply-To: <20230516122159.3834044-1-dengqiao.joey@bytedance.com>

On Tue, May 16, 2023, dengqiao.joey wrote:
> 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.

I suspect this is actually a bug in amd_iommu_activate_guest_mode().  Does the
below fix the issue?  If so, can you give a Tested-by and/or Reviewed-by on the
posted patch[*]?

diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
index 5a505ba5467e..fbe77ee2d26c 100644
--- a/drivers/iommu/amd/iommu.c
+++ b/drivers/iommu/amd/iommu.c
@@ -3484,8 +3484,7 @@ int amd_iommu_activate_guest_mode(void *data)
 	struct irte_ga *entry = (struct irte_ga *) ir_data->entry;
 	u64 valid;
 
-	if (!AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) ||
-	    !entry || entry->lo.fields_vapic.guest_mode)
+	if (!AMD_IOMMU_GUEST_IR_VAPIC(amd_iommu_guest_ir) || !entry)
 		return 0;
 
 	valid = entry->lo.fields_vapic.valid;

[*] https://lore.kernel.org/all/20230419201154.83880-2-joao.m.martins@oracle.com

  reply	other threads:[~2023-05-16 15:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 12:21 [PATCH] KVM: SVM: Update destination when updating pi irte dengqiao.joey
2023-05-16 15:54 ` Sean Christopherson [this message]
2023-05-17 12:04   ` dengqiao.joey
2023-05-17 15:32     ` Joao Martins
2023-05-18  3:58       ` dengqiao.joey
2023-05-18  8:19         ` Maxim Levitsky
2023-05-18  9:02           ` Joao Martins
2023-06-29 22:35             ` Sean Christopherson
2023-07-14 13:05               ` Joao Martins
2023-07-19 15:57                 ` Sean Christopherson
2023-07-21 18:44                   ` Alejandro Jimenez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZGOnPMTEKqRq89jt@google.com \
    --to=seanjc@google.com \
    --cc=dengqiao.joey@bytedance.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.