]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
iommu/amd: Add kernel parameters to limit V1 page-sizes
authorJoerg Roedel <jroedel@suse.de>
Thu, 5 Sep 2024 07:22:40 +0000 (09:22 +0200)
committerJoerg Roedel <jroedel@suse.de>
Tue, 10 Sep 2024 09:48:57 +0000 (11:48 +0200)
commitf0295913c4b4f377c454e06f50c1a04f2f80d9df
treeef3a288f6f08cdcc87dc87a515b59637774265a2
parent2910a7fa1be090fc7637cef0b2e70bcd15bf5469
iommu/amd: Add kernel parameters to limit V1 page-sizes

Add two new kernel command line parameters to limit the page-sizes
used for v1 page-tables:

nohugepages     - Limits page-sizes to 4KiB

v2_pgsizes_only - Limits page-sizes to 4Kib/2Mib/1GiB; The
                  same as the sizes used with v2 page-tables

This is needed for multiple scenarios. When assigning devices to
SEV-SNP guests the IOMMU page-sizes need to match the sizes in the RMP
table, otherwise the device will not be able to access all shared
memory.

Also, some ATS devices do not work properly with arbitrary IO
page-sizes as supported by AMD-Vi, so limiting the sizes used by the
driver is a suitable workaround.

All-in-all, these parameters are only workarounds until the IOMMU core
and related APIs gather the ability to negotiate the page-sizes in a
better way.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Reviewed-by: Vasant Hegde <vasant.hegde@amd.com>
Link: https://lore.kernel.org/r/20240905072240.253313-1-joro@8bytes.org
Documentation/admin-guide/kernel-parameters.txt
drivers/iommu/amd/amd_iommu.h
drivers/iommu/amd/amd_iommu_types.h
drivers/iommu/amd/init.c
drivers/iommu/amd/io_pgtable.c