From: Hou Wenlong <houwenlong.hwl@antgroup.com>
To: Sean Christopherson <seanjc@google.com>
Cc: Joerg Roedel <joro@8bytes.org>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] iommu/amd: Ensure GA log notifier callbacks finish running before module unload
Date: Thu, 18 Sep 2025 21:03:20 +0800 [thread overview]
Message-ID: <20250918130320.GA119526@k08j02272.eu95sqa> (raw)
In-Reply-To: <20250315031048.2374109-1-seanjc@google.com>
On Fri, Mar 14, 2025 at 08:10:48PM -0700, Sean Christopherson wrote:
> Synchronize RCU when unregistering KVM's GA log notifier to ensure all
> in-flight interrupt handlers complete before KVM-the module is unloaded.
>
> Signed-off-by: Sean Christopherson <seanjc@google.com>
> ---
> drivers/iommu/amd/iommu.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c
> index b48a72bd7b23..b314523d9194 100644
> --- a/drivers/iommu/amd/iommu.c
> +++ b/drivers/iommu/amd/iommu.c
> @@ -982,6 +982,14 @@ int amd_iommu_register_ga_log_notifier(int (*notifier)(u32))
> {
> iommu_ga_log_notifier = notifier;
>
> + /*
> + * Ensure all in-flight IRQ handlers run to completion before returning
> + * to the caller, e.g. to ensure module code isn't unloaded while it's
> + * being executed in the IRQ handler.
> + */
> + if (!notifier)
> + synchronize_rcu();
> +
> return 0;
> }
> EXPORT_SYMBOL(amd_iommu_register_ga_log_notifier);
>
> base-commit: ea9bd29a9c0d757b3384ae3e633e6bbaddf00725
> --
> 2.49.0.rc1.451.g8f38331e32-goog
>
>
Hi Sean,
Sorry to bother you. I'm reworking the hardware_setup() path in our
internal multi-KVM, but I didn't see any usage of
'amd_iommu_register_ga_log_notifier(NULL)' in the KVM code for now. Has
it not been committed?
Thanks!
next prev parent reply other threads:[~2025-09-18 13:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-15 3:10 Sean Christopherson
2025-04-28 11:40 ` Joerg Roedel
2025-09-18 13:03 ` Hou Wenlong [this message]
2025-10-07 17:54 ` Sean Christopherson
2025-10-27 11:13 ` Joerg Roedel
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=20250918130320.GA119526@k08j02272.eu95sqa \
--to=houwenlong.hwl@antgroup.com \
--cc=iommu@lists.linux.dev \
--cc=joro@8bytes.org \
--cc=linux-kernel@vger.kernel.org \
--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®