Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Jun 2024 09:25:33 GMT
From:      Doug Moore <dougm@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 8502c68d29a8 - main - x86_iommu: use roundup_pow_of_two
Message-ID:  <202406260925.45Q9PX3G026672@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dougm:

URL: https://cgit.FreeBSD.org/src/commit/?id=8502c68d29a82556a3afd9325321153f80c1daaa

commit 8502c68d29a82556a3afd9325321153f80c1daaa
Author:     Doug Moore <dougm@FreeBSD.org>
AuthorDate: 2024-06-26 09:23:54 +0000
Commit:     Doug Moore <dougm@FreeBSD.org>
CommitDate: 2024-06-26 09:23:54 +0000

    x86_iommu: use roundup_pow_of_two
    
    Drop a private implementation of roundup_pow_of_two and use the global
    one instead.
    
    Reviewed by:    kib
    Differential Revision:  https://reviews.freebsd.org/D45739
---
 sys/x86/iommu/intel_intrmap.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/sys/x86/iommu/intel_intrmap.c b/sys/x86/iommu/intel_intrmap.c
index 66238b46c25e..22fd51bc8be9 100644
--- a/sys/x86/iommu/intel_intrmap.c
+++ b/sys/x86/iommu/intel_intrmap.c
@@ -315,13 +315,6 @@ dmar_ir_free_irte(struct dmar_unit *unit, u_int cookie)
 	return (0);
 }
 
-static u_int
-clp2(u_int v)
-{
-
-	return (powerof2(v) ? v : 1 << fls(v));
-}
-
 int
 dmar_init_irt(struct dmar_unit *unit)
 {
@@ -339,7 +332,7 @@ dmar_init_irt(struct dmar_unit *unit)
 	     "QI disabled, disabling interrupt remapping\n");
 		return (0);
 	}
-	unit->irte_cnt = clp2(num_io_irqs);
+	unit->irte_cnt = roundup_pow_of_two(num_io_irqs);
 	unit->irt = kmem_alloc_contig(unit->irte_cnt * sizeof(dmar_irte_t),
 	    M_ZERO | M_WAITOK, 0, iommu_high, PAGE_SIZE, 0,
 	    DMAR_IS_COHERENT(unit) ?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202406260925.45Q9PX3G026672>