[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YjDDUUeZ/dvUZoDN@infradead.org>
Date: Tue, 15 Mar 2022 09:48:17 -0700
From: Christoph Hellwig <hch@...radead.org>
To: Mario Limonciello <mario.limonciello@....com>
Cc: Joerg Roedel <joro@...tes.org>,
Suravee Suthikulpanit <suravee.suthikulpanit@....com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Will Deacon <will@...nel.org>,
Andreas Noever <andreas.noever@...il.com>,
Michael Jamet <michael.jamet@...el.com>,
Yehezkel Bernat <YehezkelShB@...il.com>,
"open list:AMD IOMMU (AMD-VI)" <iommu@...ts.linux-foundation.org>,
open list <linux-kernel@...r.kernel.org>,
"open list:THUNDERBOLT DRIVER" <linux-usb@...r.kernel.org>
Subject: Re: [PATCH 2/2] thunderbolt: Use pre-boot DMA protection on AMD
systems
On Tue, Mar 15, 2022 at 11:24:55AM -0500, Mario Limonciello wrote:
> - * handled natively using IOMMU. It is enabled when IOMMU is
> - * enabled and ACPI DMAR table has DMAR_PLATFORM_OPT_IN set.
> + * handled natively using IOMMU. It is enabled when the IOMMU is
> + * enabled and either:
> + * ACPI DMAR table has DMAR_PLATFORM_OPT_IN set
> + * or
> + * ACPI IVRS table has DMA_REMAP bitset
> */
> return sprintf(buf, "%d\n",
> - iommu_present(&pci_bus_type) && dmar_platform_optin());
> + iommu_present(&pci_bus_type) &&
> + (dmar_platform_optin() || amd_ivrs_remap_support()));
Yikes. No, the thunderbot code does not have any business poking into
either dmar_platform_optin or amd_ivrs_remap_support. This needs
a proper abstration from the IOMMU code.
Powered by blists - more mailing lists