Thread (41 messages) 41 messages, 2 authors, 2017-06-28

Re: [PATCH v8 RESEND 27/38] iommu/amd: Allow the AMD IOMMU to work with memory encryption

From: Tom Lendacky <thomas.lendacky@amd.com>
Date: 2017-06-28 14:06:16
Also in: kexec, kvm, linux-efi, linux-iommu, linux-mm, lkml

On 6/28/2017 4:36 AM, Joerg Roedel wrote:
Hi Tom,
Hi Joerg,
On Tue, Jun 27, 2017 at 10:12:30AM -0500, Tom Lendacky wrote:
quoted
---
  drivers/iommu/amd_iommu.c       |   30 ++++++++++++++++--------------
  drivers/iommu/amd_iommu_init.c  |   34 ++++++++++++++++++++++++++++------
  drivers/iommu/amd_iommu_proto.h |   10 ++++++++++
  drivers/iommu/amd_iommu_types.h |    2 +-
  4 files changed, 55 insertions(+), 21 deletions(-)
Looks like a straightforward change. Just one nit below.
quoted
+static bool amd_iommu_supports_sme(void)
+{
+	if (!sme_active() || (boot_cpu_data.x86 != 0x17))
+		return true;
+
+	/* For Fam17h, a specific level of support is required */
+	if (boot_cpu_data.microcode >= 0x08001205)
+		return true;
+
+	if ((boot_cpu_data.microcode >= 0x08001126) &&
+	    (boot_cpu_data.microcode <= 0x080011ff))
+		return true;
+
+	pr_notice("AMD-Vi: IOMMU not currently supported when SME is active\n");
+
+	return false;
+}
The name of the function is misleading. It checks whether the IOMMU can
be enabled when SME is active. But the name suggests that it checks
whether the iommu hardware supports SME.

How about renaming it to amd_iommu_sme_check()?
Can do.

Thanks,
Tom
With that change the patch is:

	Acked-by: Joerg Roedel [off-list ref]
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help