Skip to content

Commit 12cbed9

Browse files
gregkhopsiff
authored andcommitted
Revert "iommu/amd: Skip enabling command/event buffers for kdump"
This reverts commit 44a764aec64b3f3235b9cbac2525222f69685418 which is commit 9be15fb upstream. This causes problems in older kernel trees as SNP host kdump is not supported in them, so drop it from the stable branches. Reported-by: Ashish Kalra <ashish.kalra@amd.com> Link: https://lore.kernel.org/r/dacdff7f-0606-4ed5-b056-2de564404d51@amd.com Cc: Vasant Hegde <vasant.hegde@amd.com> Cc: Sairaj Kodilkar <sarunkod@amd.com> Cc: Joerg Roedel <joerg.roedel@amd.com> Cc: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit bb4511b55fd37d77f4d2db4f8afcbd3e4c09b157) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 0a986fd commit 12cbed9

1 file changed

Lines changed: 9 additions & 19 deletions

File tree

drivers/iommu/amd/init.c

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -840,16 +840,11 @@ static void iommu_enable_command_buffer(struct amd_iommu *iommu)
840840

841841
BUG_ON(iommu->cmd_buf == NULL);
842842

843-
if (!is_kdump_kernel()) {
844-
/*
845-
* Command buffer is re-used for kdump kernel and setting
846-
* of MMIO register is not required.
847-
*/
848-
entry = iommu_virt_to_phys(iommu->cmd_buf);
849-
entry |= MMIO_CMD_SIZE_512;
850-
memcpy_toio(iommu->mmio_base + MMIO_CMD_BUF_OFFSET,
851-
&entry, sizeof(entry));
852-
}
843+
entry = iommu_virt_to_phys(iommu->cmd_buf);
844+
entry |= MMIO_CMD_SIZE_512;
845+
846+
memcpy_toio(iommu->mmio_base + MMIO_CMD_BUF_OFFSET,
847+
&entry, sizeof(entry));
853848

854849
amd_iommu_reset_cmd_buffer(iommu);
855850
}
@@ -898,15 +893,10 @@ static void iommu_enable_event_buffer(struct amd_iommu *iommu)
898893

899894
BUG_ON(iommu->evt_buf == NULL);
900895

901-
if (!is_kdump_kernel()) {
902-
/*
903-
* Event buffer is re-used for kdump kernel and setting
904-
* of MMIO register is not required.
905-
*/
906-
entry = iommu_virt_to_phys(iommu->evt_buf) | EVT_LEN_MASK;
907-
memcpy_toio(iommu->mmio_base + MMIO_EVT_BUF_OFFSET,
908-
&entry, sizeof(entry));
909-
}
896+
entry = iommu_virt_to_phys(iommu->evt_buf) | EVT_LEN_MASK;
897+
898+
memcpy_toio(iommu->mmio_base + MMIO_EVT_BUF_OFFSET,
899+
&entry, sizeof(entry));
910900

911901
/* set head and tail to zero manually */
912902
writel(0x00, iommu->mmio_base + MMIO_EVT_HEAD_OFFSET);

0 commit comments

Comments
 (0)