Re: [PATCH] iommu/amd: Do not reallocate GA log buffers on resume
From: Vasant Hegde
Date: Tue Aug 25 2026 - 08:26:03 EST
On 8/25/2026 3:58 PM, Vasant Hegde wrote:
>
>
> On 8/19/2026 8:53 AM, Karl Mehltretter wrote:
>>
>> 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.
Just to be clear, I have a patch to remove all these checks in iommu_init_ga_log
and re-arrange a code bit. But its slightly bigger change and backporting to
stable becomes difficult.
Hence I'd say lets apply this patch. I will send my patches on top of this patch.
-Vasant