Re: [PATCH] iommu/amd: Do not reallocate GA log buffers on resume

From: Vasant Hegde

Date: Tue Aug 25 2026 - 06:28:45 EST




On 8/19/2026 8:53 AM, Karl Mehltretter wrote:
> [You don't often get email from kmehltretter@xxxxxxxxx. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
>
> Commit c5e1a1eb9279 ("iommu/amd: Simplify and Consolidate Virtual APIC
> (AVIC) Enablement") moved the GA log allocation from iommu_init_pci()
> to enable_iommus_vapic(), which is called on every resume.
>
> iommu_init_ga_log() assigns iommu->ga_log and iommu->ga_log_tail
> unconditionally. Each resume therefore replaces the boot-time pointers
> and leaks both old allocations. The function also uses GFP_KERNEL from a
> syscore resume callback, where interrupts are disabled and the non-boot
> CPUs are offline.
>
> Return early if both buffers are already allocated. Clear the pointers
> in free_ga_log() so a partial allocation failure cannot leave ga_log
> dangling.
>
> Fixes: c5e1a1eb9279 ("iommu/amd: Simplify and Consolidate Virtual APIC (AVIC) Enablement")
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>

Reviewed-by: Vasant Hegde <vasant.hegde@xxxxxxx>

@Joerg, I think we should pick this for -rc.

-Vasant