From: Sean Christopherson <seanjc@google.com>
To: Sairaj Kodilkar <sarunkod@amd.com>
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>,
"H. Peter Anvin" <hpa@zytor.com>,
"Joerg Roedel (AMD)" <joro@8bytes.org>,
"Paul E. McKenney" <paulmck@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Dapeng Mi <dapeng1.mi@linux.intel.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Eric Biggers <ebiggers@kernel.org>,
Feng Tang <feng.tang@linux.alibaba.com>,
Ingo Molnar <mingo@redhat.com>, Jakub Kicinski <kuba@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Li RongQing <lirongqing@baidu.com>,
Marco Elver <elver@google.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Randy Dunlap <rdunlap@infradead.org>,
Robin Murphy <robin.murphy@arm.com>,
Shuah Khan <skhan@linuxfoundation.org>,
Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
Thomas Gleixner <tglx@kernel.org>,
Vasant Hegde <vasant.hegde@amd.com>,
Will Deacon <will@kernel.org>,
iommu@lists.linux.dev, kvm@vger.kernel.org,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
x86@kernel.org
Subject: Re: [RFC PATCH v3 3/6] iommu/amd: KVM: SVM: Add explicit vCPU running state to IOMMU interface
Date: Mon, 10 Aug 2026 17:34:05 -0700 [thread overview]
Message-ID: <anpt_cMpS1-ua-jX@google.com> (raw)
In-Reply-To: <20260713105033.15405-4-sarunkod@amd.com>
On Mon, Jul 13, 2026, Sairaj Kodilkar wrote:
> @@ -1008,6 +1010,7 @@ static void avic_update_iommu_vcpu_affinity(struct kvm_vcpu *vcpu, int apicid,
> enum avic_vcpu_action action)
> {
> bool wakeup_intr = (action & AVIC_START_BLOCKING);
> + bool is_running = apicid >= 0;
> struct vcpu_svm *svm = to_svm(vcpu);
> struct kvm_kernel_irqfd *irqfd;
>
> @@ -1024,9 +1027,10 @@ static void avic_update_iommu_vcpu_affinity(struct kvm_vcpu *vcpu, int apicid,
> void *data = irqfd->irq_bypass_data;
>
> if (!(action & AVIC_TOGGLE_ON_OFF))
> - WARN_ON_ONCE(amd_iommu_update_ga(data, apicid, wakeup_intr));
> - else if (apicid >= 0)
> - WARN_ON_ONCE(amd_iommu_activate_guest_mode(data, apicid, wakeup_intr));
> + WARN_ON_ONCE(amd_iommu_update_ga(data, apicid, wakeup_intr, is_running));
> + else if (is_running)
> + WARN_ON_ONCE(amd_iommu_activate_guest_mode(data, apicid, wakeup_intr,
> + is_running));
Pass is_running here is rather weird. Given that this is the only call site
that originates outside of the IOMMU driver, what if the exported
amd_iommu_activate_guest_mode() is a wrapper to an internal API and hardcodes
is_running=true? Then the internal path via irq_set_vcpu_affinity() can pass
an actual variable.
next prev parent reply other threads:[~2026-08-11 0:34 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-13 10:50 [RFC PATCH v3 0/6] Add support for AMD IOMMU GAPPI Sairaj Kodilkar
2026-07-13 10:50 ` [RFC PATCH v3 1/6] iommu/amd: KVM: SVM: Rename cpu to apicid in IOMMU interface Sairaj Kodilkar
2026-07-13 10:50 ` [RFC PATCH v3 2/6] iommu/amd: KVM: SVM: Rename ga_log_intr to wakeup_intr " Sairaj Kodilkar
2026-07-13 10:50 ` [RFC PATCH v3 3/6] iommu/amd: KVM: SVM: Add explicit vCPU running state to " Sairaj Kodilkar
2026-07-13 11:08 ` sashiko-bot
2026-08-10 5:06 ` Sairaj Kodilkar
2026-08-11 0:34 ` Sean Christopherson [this message]
2026-07-13 10:50 ` [RFC PATCH v3 4/6] iommu/amd: Program guest-mode IRTEs for GAPPI wakeup when IRTE[IsRun] = 0 Sairaj Kodilkar
2026-07-13 11:07 ` sashiko-bot
2026-08-10 5:14 ` Sairaj Kodilkar
2026-07-13 10:50 ` [RFC PATCH v3 5/6] KVM: SVM: Add support for AMD IOMMU Guest APIC Physical Processor Interrupt (GAPPI) Sairaj Kodilkar
2026-07-13 11:11 ` sashiko-bot
2026-07-13 12:56 ` Sairaj Kodilkar
2026-08-11 0:40 ` Sean Christopherson
2026-08-10 5:54 ` Sairaj Kodilkar
2026-08-11 0:43 ` Sean Christopherson
2026-07-13 10:50 ` [RFC PATCH v3 6/6] iommu/amd: Provide kernel command line option to enable GAPPI Sairaj Kodilkar
2026-07-13 11:11 ` sashiko-bot
2026-08-10 6:12 ` Sairaj Kodilkar
2026-08-10 9:21 ` [RFC PATCH v3 0/6] Add support for AMD IOMMU GAPPI Sairaj Kodilkar
2026-08-11 0:48 ` Sean Christopherson
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=anpt_cMpS1-ua-jX@google.com \
--to=seanjc@google.com \
--cc=akpm@linux-foundation.org \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dapeng1.mi@linux.intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=ebiggers@kernel.org \
--cc=elver@google.com \
--cc=feng.tang@linux.alibaba.com \
--cc=hpa@zytor.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=kuba@kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lirongqing@baidu.com \
--cc=mingo@redhat.com \
--cc=paulmck@kernel.org \
--cc=pbonzini@redhat.com \
--cc=rdunlap@infradead.org \
--cc=robin.murphy@arm.com \
--cc=sarunkod@amd.com \
--cc=skhan@linuxfoundation.org \
--cc=suravee.suthikulpanit@amd.com \
--cc=tglx@kernel.org \
--cc=vasant.hegde@amd.com \
--cc=will@kernel.org \
--cc=x86@kernel.org \
/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.