mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joao Martins <joao.m.martins@oracle.com>
To: "dengqiao.joey" <dengqiao.joey@bytedance.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	seanjc@google.com, pbonzini@redhat.com
Subject: Re: [PATCH] KVM: SVM: Update destination when updating pi irte
Date: Wed, 17 May 2023 16:32:26 +0100	[thread overview]
Message-ID: <3d05fcf1-dad3-826e-03e9-599ced7524b4@oracle.com> (raw)
In-Reply-To: <20230517120458.3761311-1-dengqiao.joey@bytedance.com>

On 17/05/2023 13:04, dengqiao.joey wrote:
> This seems to be a different issue. Joao's patch tries to fix the issue
> that IRTE is not changed. The problem I encountered is that IRTE does
> get changed, thus the destination field is also cleared by
> amd_iommu_activate_guest_mode(). 

Whether the amd_iommu_activate_guest_mode() clears the destination field or not
doesn't change the situation I think. So I don't think that is the problem
you're having. amd_iommu_activate_guest_mode() will always make IRTEs with
isRun=0. Which means your VF interrupts get injected via GALog events and the
DestID is meaningless there :/ Even if you leave the old affinity there with
isRun=1 bit it's still wrong as by the time you run the vcpu, the wrong affinity
will be used by the VF. More fundamentally I am not sure that on IRTE routing
updates in the VM that you can look on vcpu->cpu the way you are using it could
be potentially invalid when vcpus are blocked/preempted. You're changing IRTEs
in the whole VM in pi_update_irte()

My changes essentially handle the fact where IRTEs will be always updated with
the right GATag set in the IRTE ... and then when the vCPU migrates, wakes or
block+unblocks it will change IRTE[DestID] with the new pcpu (which the vcpu is
running on) via amd_iommu_update_ga(). So there's a good chance my changes fixes
your affinity issue.

	Joao

  reply	other threads:[~2023-05-17 15:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-16 12:21 dengqiao.joey
2023-05-16 15:54 ` Sean Christopherson
2023-05-17 12:04   ` dengqiao.joey
2023-05-17 15:32     ` Joao Martins [this message]
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=3d05fcf1-dad3-826e-03e9-599ced7524b4@oracle.com \
    --to=joao.m.martins@oracle.com \
    --cc=dengqiao.joey@bytedance.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®