On Fri, 21 Nov 2025 14:08:13 +0100, gregkh@linuxfoundation.org wrote:
6.6-stable review patch. If anyone has any objections, please let me know.
The remaining 3 prerequisite patches in [1] should probably also be integrated, otherwise it may cause the capture kernel to fail to run properly:
[ 8.336262][ T0] AMD-Vi: Completion-Wait loop timed out [ 8.457132][ T0] AMD-Vi: Completion-Wait loop timed out [ 8.578015][ T0] AMD-Vi: Completion-Wait loop timed out [ 8.601978][ T0] Kernel panic - not syncing: timer doesn't work through Interrupt-remapped IO-APIC [ 8.612329][ T0] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.6.119-s #1 [ 8.620057][ T0] Hardware name: Tencent AC222/TC2-SLMB-A, BIOS 1.17.00 08/26/2025 [ 8.628759][ T0] Call Trace: [ 8.632297][ T0] <TASK> [ 8.635445][ T0] dump_stack_lvl+0x32/0x50 [ 8.640354][ T0] panic+0x156/0x310 [ 8.644579][ T0] panic_if_irq_remap+0x19/0x20 [ 8.649875][ T0] setup_IO_APIC+0x7cb/0x8e0 [ 8.654878][ T0] ? _raw_spin_unlock_irqrestore+0xb/0x20 [ 8.661146][ T0] ? ioapic_read_entry+0x39/0x50 [ 8.666539][ T0] ? clear_IO_APIC_pin+0xbb/0x130 [ 8.672025][ T0] apic_intr_mode_init+0x62/0x110 [ 8.677511][ T0] x86_late_time_init+0x20/0x40 [ 8.682804][ T0] start_kernel+0x3e4/0x6d0 [ 8.687707][ T0] x86_64_start_reservations+0x14/0x30 [ 8.693679][ T0] x86_64_start_kernel+0x92/0xa0 [ 8.699057][ T0] secondary_startup_64_no_verify+0x18f/0x19b [ 8.705715][ T0] </TASK> [ 8.708966][ T0] Rebooting in 10 seconds..
[1] https://lore.kernel.org/all/cover.1756157913.git.ashish.kalra@amd.com/
thanks, Jinliang Zheng :)
From: Ashish Kalra ashish.kalra@amd.com
[ Upstream commit 9be15fbfc6c5c89c22cf6e209f66ea43ee0e58bb ]
After a panic if SNP is enabled in the previous kernel then the kdump kernel boots with IOMMU SNP enforcement still enabled.
IOMMU command buffers and event buffer registers remain locked and exclusive to the previous kernel. Attempts to enable command and event buffers in the kdump kernel will fail, as hardware ignores writes to the locked MMIO registers as per AMD IOMMU spec Section 2.12.2.1.
Skip enabling command buffers and event buffers for kdump boot as they are already enabled in the previous kernel.
Reviewed-by: Vasant Hegde vasant.hegde@amd.com Tested-by: Sairaj Kodilkar sarunkod@amd.com Signed-off-by: Ashish Kalra ashish.kalra@amd.com Link: https://lore.kernel.org/r/576445eb4f168b467b0fc789079b650ca7c5b037.175615791... Signed-off-by: Joerg Roedel joerg.roedel@amd.com Signed-off-by: Sasha Levin sashal@kernel.org
drivers/iommu/amd/init.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/drivers/iommu/amd/init.c b/drivers/iommu/amd/init.c index 431cea41df2af..1897619209f14 100644 --- a/drivers/iommu/amd/init.c +++ b/drivers/iommu/amd/init.c @@ -840,11 +840,16 @@ static void iommu_enable_command_buffer(struct amd_iommu *iommu) BUG_ON(iommu->cmd_buf == NULL);
- entry = iommu_virt_to_phys(iommu->cmd_buf);
- entry |= MMIO_CMD_SIZE_512;
- memcpy_toio(iommu->mmio_base + MMIO_CMD_BUF_OFFSET,
&entry, sizeof(entry));
- if (!is_kdump_kernel()) {
/** Command buffer is re-used for kdump kernel and setting* of MMIO register is not required.*/entry = iommu_virt_to_phys(iommu->cmd_buf);entry |= MMIO_CMD_SIZE_512;memcpy_toio(iommu->mmio_base + MMIO_CMD_BUF_OFFSET,&entry, sizeof(entry));- }
amd_iommu_reset_cmd_buffer(iommu); } @@ -893,10 +898,15 @@ static void iommu_enable_event_buffer(struct amd_iommu *iommu) BUG_ON(iommu->evt_buf == NULL);
- entry = iommu_virt_to_phys(iommu->evt_buf) | EVT_LEN_MASK;
- memcpy_toio(iommu->mmio_base + MMIO_EVT_BUF_OFFSET,
&entry, sizeof(entry));
- if (!is_kdump_kernel()) {
/** Event buffer is re-used for kdump kernel and setting* of MMIO register is not required.*/entry = iommu_virt_to_phys(iommu->evt_buf) | EVT_LEN_MASK;memcpy_toio(iommu->mmio_base + MMIO_EVT_BUF_OFFSET,&entry, sizeof(entry));- }
/* set head and tail to zero manually */ writel(0x00, iommu->mmio_base + MMIO_EVT_HEAD_OFFSET); -- 2.51.0