[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251107010218.GC1708009@nvidia.com>
Date: Thu, 6 Nov 2025 21:02:18 -0400
From: Jason Gunthorpe <jgg@...dia.com>
To: Wei Wang <wei.w.wang@...mail.com>
Cc: alex@...zbot.org, suravee.suthikulpanit@....com,
thomas.lendacky@....com, joro@...tes.org, kevin.tian@...el.com,
linux-kernel@...r.kernel.org, iommu@...ts.linux.dev
Subject: Re: [PATCH v2 1/2] iommu/amd: Add IOMMU_PROT_IE flag for memory
encryption
On Mon, Nov 03, 2025 at 10:00:33PM +0800, Wei Wang wrote:
> Introduce the IOMMU_PROT_IE flag to allow callers of iommu_v1_map_pages()
> to explicitly request memory encryption for specific mappings.
>
> With SME enabled, the C-bit (encryption bit) in IOMMU page table entries
> is now set only when IOMMU_PROT_IE is specified. This provides
> fine-grained control over which IOVAs are encrypted through the IOMMU
> page tables.
>
> Current PCIe devices and switches do not interpret the C-bit, so applying
> it to MMIO mappings would break PCIe peer‑to‑peer communication. Update
> the implementation to restrict C-bit usage to non‑MMIO backed IOVAs.
>
> Fixes: 2543a786aa25 ("iommu/amd: Allow the AMD IOMMU to work with memory encryption")
> Suggested-by: Jason Gunthorpe <jgg@...dia.com>
> Signed-off-by: Wei Wang <wei.w.wang@...mail.com>
> ---
> drivers/iommu/amd/amd_iommu_types.h | 3 ++-
> drivers/iommu/amd/io_pgtable.c | 7 +++++--
> drivers/iommu/amd/iommu.c | 2 ++
> 3 files changed, 9 insertions(+), 3 deletions(-)
Since Joerg took the iommupt patches this will need to be rebased on
his tree, I think it will be simpler..
Jason
Powered by blists - more mailing lists