git: 2777a32588e1 - main - iommu: disable dma by default

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Tue, 13 Aug 2024 20:03:07 UTC
The branch main has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=2777a32588e11514a9c7a24cd2915f6d5537cd22

commit 2777a32588e11514a9c7a24cd2915f6d5537cd22
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2024-08-13 19:51:34 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2024-08-13 20:00:47 +0000

    iommu: disable dma by default
    
    APIC ID 255 and above require x2APIC and DMAR interrupt remapping.
    FreeBSD is starting to be tested on high core count Intel systems that
    meet this criteria.  We're going to enable DMAR by default to support
    this, so default hw.iommu.dma to 0 to avoid a significant performance
    regression.
    
    Reviewed by:    kib, jhb
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D42435
---
 sys/dev/iommu/busdma_iommu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/iommu/busdma_iommu.c b/sys/dev/iommu/busdma_iommu.c
index d870e2af3984..3d554249ba3f 100644
--- a/sys/dev/iommu/busdma_iommu.c
+++ b/sys/dev/iommu/busdma_iommu.c
@@ -963,7 +963,7 @@ iommu_init_busdma(struct iommu_unit *unit)
 {
 	int error;
 
-	unit->dma_enabled = 1;
+	unit->dma_enabled = 0;
 	error = TUNABLE_INT_FETCH("hw.iommu.dma", &unit->dma_enabled);
 	if (error == 0) /* compatibility */
 		TUNABLE_INT_FETCH("hw.dmar.dma", &unit->dma_enabled);