summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc
diff options
context:
space:
mode:
authorMatt Fleming <mfleming@cloudflare.com>2026-10-13 13:19:44 +0100
committerJoerg Roedel <joerg.roedel@amd.com>2026-10-14 15:46:34 +0200
commitbae0d3760661ac77148944e88aafef698cf7b2bf (patch)
treefafdb123ddce750e7400b65a74784b73ea95c6bd /rust/kernel/alloc
parent05d62be400f3ae0f6856f6910a1281e67cbaabcf (diff)
downloadlwn-bae0d3760661ac77148944e88aafef698cf7b2bf.tar.gz
lwn-bae0d3760661ac77148944e88aafef698cf7b2bf.zip
iommu/amd: Don't allocate kdump device table from DMA32
Booting a kdump kernel with crashkernel=X,high crashkernel=0,low on an AMD system fails the per-segment device table allocation because there is no memory below 4G: swapper/0: page allocation failure: order:9, mode:0x40104(GFP_DMA32|__GFP_ZERO|__GFP_COMP) iommu_alloc_pages_node_sz+0x7f/0x150 alloc_pci_segment+0x4bd/0x650 iommu_go_to_state+0x213d/0x34e0 amd_iommu_prepare+0x39/0xa0 irq_remapping_prepare+0x83/0xd0 enable_IR_x2apic+0x61/0x370 On our E810 systems, the kdump kernel booted but ice MSI-X interrupts never fired and the TX queues timed out. Commit b336781b82cc ("iommu/amd: Allocate memory below 4G for dev table if translation pre-enabled") allocated device tables below 4G. At the time, the kdump kernel programmed a copy of the old table into the base register with the IOMMU still enabled. The 64-bit register is updated as two 32-bit halves, so the running IOMMU could see a half-written, invalid table pointer. Keeping both tables below 4G leaves the upper half zero throughout the update, so the pointer stays valid. Since commit 38e5f33ee359 ("iommu/amd: Reuse device table for kdump") the kdump kernel reuses the previous kernel's table without writing the base register, so its newly allocated table is discarded when reuse succeeds. If reuse fails, the previous patch programs the new table only after disabling the IOMMU. Either way, the kdump kernel's table doesn't need to be below 4G. The previous kernel still allocates its table from DMA32, so the kdump kernel's check that the old table is below 4G still works. Drop GFP_DMA32 for kdump kernels only. Cc: stable@vger.kernel.org # 6.18.x Reviewed-by: Ashish Kalra <ashish.kalra@amd.com> Reviewed-by: Ankit Soni <Ankit.Soni@amd.com> Signed-off-by: Matt Fleming <mfleming@cloudflare.com> Reviewed-by: Vasant Hegde <vasant.hegde@amd.com> Signed-off-by: Matt Fleming <mfleming@cloudflare.com> Reviewed-by: Ashish Kalra <ashish.kalra@amd.com> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'rust/kernel/alloc')
0 files changed, 0 insertions, 0 deletions