linux-doc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Baolu Lu <baolu.lu@linux.intel.com>
To: Joerg Roedel <joro@8bytes.org>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	Will Deacon <will@kernel.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Vasant Hegde <vasant.hegde@amd.com>
Cc: baolu.lu@linux.intel.com, Jason Gunthorpe <jgg@nvidia.com>,
	linux-doc@vger.kernel.org, iommu@lists.linux.dev,
	linux-kernel@vger.kernel.org, Joerg Roedel <jroedel@suse.de>
Subject: Re: [PATCH] iommu/amd: Add kernel parameters to limit V1 page-sizes
Date: Thu, 5 Sep 2024 15:31:08 +0800	[thread overview]
Message-ID: <45a3ae40-6e59-43b4-ae57-d159bd2b54df@linux.intel.com> (raw)
In-Reply-To: <20240905072240.253313-1-joro@8bytes.org>

On 2024/9/5 15:22, Joerg Roedel wrote:
> From: Joerg Roedel<jroedel@suse.de>
> 
> 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>
> ---
>   Documentation/admin-guide/kernel-parameters.txt | 17 +++++++++++------
>   drivers/iommu/amd/amd_iommu.h                   |  1 +
>   drivers/iommu/amd/amd_iommu_types.h             |  4 ++++
>   drivers/iommu/amd/init.c                        |  8 ++++++++
>   drivers/iommu/amd/io_pgtable.c                  |  2 +-
>   5 files changed, 25 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
> index 09126bb8cc9f..6d6630aec46c 100644
> --- a/Documentation/admin-guide/kernel-parameters.txt
> +++ b/Documentation/admin-guide/kernel-parameters.txt
> @@ -333,12 +333,17 @@
>   					  allowed anymore to lift isolation
>   					  requirements as needed. This option
>   					  does not override iommu=pt
> -			force_enable - Force enable the IOMMU on platforms known
> -				       to be buggy with IOMMU enabled. Use this
> -				       option with care.
> -			pgtbl_v1     - Use v1 page table for DMA-API (Default).
> -			pgtbl_v2     - Use v2 page table for DMA-API.
> -			irtcachedis  - Disable Interrupt Remapping Table (IRT) caching.
> +			force_enable    - Force enable the IOMMU on platforms known
> +				          to be buggy with IOMMU enabled. Use this
> +				          option with care.
> +			pgtbl_v1        - Use v1 page table for DMA-API (Default).
> +			pgtbl_v2        - Use v2 page table for DMA-API.
> +			irtcachedis     - Disable Interrupt Remapping Table (IRT) caching.
> +			nohugepages     - Limit page-sizes used for v1 page-tables
> +				          to 4 KiB.

Intel iommu driver has a similar option 'intel_iommu=sp_off'

	sp_off [Default Off]
		By default, super page will be supported if Intel IOMMU
		has the capability. With this option, super page will
		not be supported.

Is it possible to consolidate these two into a single
"iommu.nohugepages=1"?

> +			v2_pgsizes_only - Limit page-sizes used for v1 page-tables
> +				          to 4KiB/2Mib/1GiB.
> +
>   
>   	amd_iommu_dump=	[HW,X86-64]
>   			Enable AMD IOMMU driver option to dump the ACPI table

Thanks,
baolu

  reply	other threads:[~2024-09-05  7:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05  7:22 [PATCH] iommu/amd: Add kernel parameters to limit V1 page-sizes Joerg Roedel
2024-09-05  7:31 ` Baolu Lu [this message]
2024-09-05  7:34   ` Joerg Roedel
2024-09-05  8:09     ` Baolu Lu
2024-09-05 12:05     ` Jason Gunthorpe
2024-09-05 15:13       ` Joerg Roedel
2024-09-05 17:52         ` Jason Gunthorpe
2024-09-09 15:39           ` Jason Gunthorpe
2024-09-09 14:50 ` Vasant Hegde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45a3ae40-6e59-43b4-ae57-d159bd2b54df@linux.intel.com \
    --to=baolu.lu@linux.intel.com \
    --cc=iommu@lists.linux.dev \
    --cc=jgg@nvidia.com \
    --cc=joro@8bytes.org \
    --cc=jroedel@suse.de \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=suravee.suthikulpanit@amd.com \
    --cc=vasant.hegde@amd.com \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).