From: Joerg Roedel <joro@8bytes.org> To: iommu@lists.linux-foundation.org Cc: Joerg Roedel <joro@8bytes.org>, jroedel@suse.de, Tom Lendacky <thomas.lendacky@amd.com>, Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>, Alexander.Deucher@amd.com, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] iommu/amd: Do not force direct mapping when SME is active Date: Mon, 24 Aug 2020 12:54:14 +0200 [thread overview] Message-ID: <20200824105415.21000-2-joro@8bytes.org> (raw) In-Reply-To: <20200824105415.21000-1-joro@8bytes.org> From: Joerg Roedel <jroedel@suse.de> Do not force devices supporting IOMMUv2 to be direct mapped when memory encryption is active. This might cause them to be unusable because their DMA mask does not include the encryption bit. Signed-off-by: Joerg Roedel <jroedel@suse.de> --- drivers/iommu/amd/iommu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index ba9f3dbc5b94..77e4268e41cf 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2659,7 +2659,12 @@ static int amd_iommu_def_domain_type(struct device *dev) if (!dev_data) return 0; - if (dev_data->iommu_v2) + /* + * Do not identity map IOMMUv2 capable devices when memory encryption is + * active, because some of those devices (AMD GPUs) don't have the + * encryption bit in their DMA-mask and require remapping. + */ + if (!mem_encrypt_active() && dev_data->iommu_v2) return IOMMU_DOMAIN_IDENTITY; return 0; -- 2.28.0
WARNING: multiple messages have this Message-ID (diff)
From: Joerg Roedel <joro@8bytes.org> To: iommu@lists.linux-foundation.org Cc: Tom Lendacky <thomas.lendacky@amd.com>, jroedel@suse.de, linux-kernel@vger.kernel.org, Alexander.Deucher@amd.com Subject: [PATCH 1/2] iommu/amd: Do not force direct mapping when SME is active Date: Mon, 24 Aug 2020 12:54:14 +0200 [thread overview] Message-ID: <20200824105415.21000-2-joro@8bytes.org> (raw) In-Reply-To: <20200824105415.21000-1-joro@8bytes.org> From: Joerg Roedel <jroedel@suse.de> Do not force devices supporting IOMMUv2 to be direct mapped when memory encryption is active. This might cause them to be unusable because their DMA mask does not include the encryption bit. Signed-off-by: Joerg Roedel <jroedel@suse.de> --- drivers/iommu/amd/iommu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c index ba9f3dbc5b94..77e4268e41cf 100644 --- a/drivers/iommu/amd/iommu.c +++ b/drivers/iommu/amd/iommu.c @@ -2659,7 +2659,12 @@ static int amd_iommu_def_domain_type(struct device *dev) if (!dev_data) return 0; - if (dev_data->iommu_v2) + /* + * Do not identity map IOMMUv2 capable devices when memory encryption is + * active, because some of those devices (AMD GPUs) don't have the + * encryption bit in their DMA-mask and require remapping. + */ + if (!mem_encrypt_active() && dev_data->iommu_v2) return IOMMU_DOMAIN_IDENTITY; return 0; -- 2.28.0 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu
next prev parent reply other threads:[~2020-08-24 10:55 UTC|newest] Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-08-24 10:54 [PATCH 0/2] iommu/amd: Fix IOMMUv2 devices when SME is active Joerg Roedel 2020-08-24 10:54 ` Joerg Roedel 2020-08-24 10:54 ` Joerg Roedel [this message] 2020-08-24 10:54 ` [PATCH 1/2] iommu/amd: Do not force direct mapping " Joerg Roedel 2020-08-26 14:23 ` Deucher, Alexander 2020-08-26 14:23 ` Deucher, Alexander 2020-08-24 10:54 ` [PATCH 2/2] iommu/amd: Do not use IOMMUv2 functionality " Joerg Roedel 2020-08-24 10:54 ` Joerg Roedel 2020-08-26 14:20 ` Deucher, Alexander 2020-08-26 14:20 ` Deucher, Alexander 2020-08-26 14:14 ` [PATCH 0/2] iommu/amd: Fix IOMMUv2 devices " Deucher, Alexander 2020-08-26 15:22 ` Felix Kuehling 2020-08-26 15:22 ` Felix Kuehling 2020-08-26 15:25 ` Deucher, Alexander 2020-08-26 15:25 ` Deucher, Alexander 2020-08-28 13:46 ` jroedel 2020-08-28 13:46 ` jroedel 2020-08-28 13:54 ` Felix Kuehling 2020-08-28 13:54 ` Felix Kuehling 2020-08-28 15:11 ` Deucher, Alexander 2020-08-28 15:11 ` Deucher, Alexander 2020-08-28 15:29 ` jroedel 2020-08-28 15:29 ` jroedel 2020-08-28 15:47 ` Deucher, Alexander 2020-08-28 15:47 ` Deucher, Alexander 2020-09-04 10:05 ` Joerg Roedel 2020-09-04 10:05 ` Joerg Roedel 2020-09-06 16:08 ` Deucher, Alexander 2020-09-06 16:08 ` Deucher, Alexander 2020-09-07 10:44 ` Joerg Roedel 2020-09-07 10:44 ` Joerg Roedel 2020-09-07 11:10 ` Christian König 2020-09-07 11:10 ` Christian König 2020-09-08 3:38 ` Felix Kuehling 2020-09-08 3:38 ` Felix Kuehling 2020-08-28 15:27 ` jroedel 2020-08-28 15:27 ` jroedel
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=20200824105415.21000-2-joro@8bytes.org \ --to=joro@8bytes.org \ --cc=Alexander.Deucher@amd.com \ --cc=iommu@lists.linux-foundation.org \ --cc=jroedel@suse.de \ --cc=linux-kernel@vger.kernel.org \ --cc=suravee.suthikulpanit@amd.com \ --cc=thomas.lendacky@amd.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.