]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19
authorVasant Hegde <vasant.hegde@amd.com>
Mon, 20 Apr 2026 08:42:03 +0000 (08:42 +0000)
committerJoerg Roedel <joerg.roedel@amd.com>
Mon, 27 Apr 2026 11:49:16 +0000 (13:49 +0200)
commit58c0ac6125d89bf6ec65a521eaeb52a0e8e20a9f
tree5d84ddd63bd54046884a0a1b7b358da126258cb6
parent254f49634ee16a731174d2ae34bc50bd5f45e731
iommu/amd: Use maximum Event log buffer size when SNP is enabled on Family 0x19

Due to CVE-2023-20585, the Event log buffer must use the maximum supported
size (512K) on Milan/Genoa (Family 0x19) systems when SNP is enabled,
to mitigate a potential security vulnerability. All other systems continue to
use the default Event log buffer size (8K).

Apply the errata fix by making the following changes:

* Introduce new global variable (amd_iommu_evtlog_size) to have event log
  buffer size. Adjust variable size for family 0x19.

* Since 'iommu_snp_enable()' must be called after the core IOMMU subsystem
  is initialized, it cannot be moved to the early init stage. The SNP errata
  must also be applied after the 'iommu_snp_enable()' check. Therefore,
  'alloc_event_buffer()' and 'iommu_enable_event_buffer()' are now called
  in the IOMMU_ENABLED state, after the errata is applied.

* Adjust alloc_event_buffer() and iommu_enable_event_buffer() to handle
  all IOMMU instances.

* Also rename EVT_* macros to make it more readable.

Link: https://www.amd.com/en/resources/product-security/bulletin/amd-sb-3016.html
Cc: Borislav Petkov <bp@alien8.de>
Cc: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
Cc: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Vasant Hegde <vasant.hegde@amd.com>
Tested-by: Dheeraj Kumar Srivastava <dheerajkumar.srivastava@amd.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
drivers/iommu/amd/amd_iommu.h
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/init.c
drivers/iommu/amd/iommu.c