Commit 94c721ea authored by Sean Christopherson's avatar Sean Christopherson Committed by Joerg Roedel
Browse files

iommu/amd: Ensure GA log notifier callbacks finish running before module unload



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: default avatarSean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20250315031048.2374109-1-seanjc@google.com


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 8ffd015d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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);