From nobody Wed Jun 26 09:25:33 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4W8GWx4mDYz5PQqs; Wed, 26 Jun 2024 09:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4W8GWx4DlWz4KXY; Wed, 26 Jun 2024 09:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719393933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a375PhxMthj3Ncyfbog2KGPl8gvbOiEFMYzFMIsbVkk=; b=qsVhabKvt2vajjkULZzhxdEBudXwHTpwHMM39J2qmG6jh8uK6lvT1O6hwfxidQr7qATzfj YPs0TWhKi6gYcrDTC8kYxQ2qCpn/BLuK1SWO6jNqbHUY5AK6PyIbTNKkc8Q1Ax95+aZpMa IUcKury0TRHNzfxl63LNCz6DKa9S1Zzerc9Hk24AsUHNhScR/A67b1JXGXN5wIxeyUb9Nw 0YEopNHXwMvczH6HkWrmVndlRFbSdU/1xVVSJZc+mtLoH4/LhWOb6jYcpwUPmAs803x9hY iJXmOArQIhzqi7Exzn8iqghOjfOmyy+h6SuM4aQ8Iz99k7Juph+WB4YugszbzQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1719393933; a=rsa-sha256; cv=none; b=iBCTi32F2Y45Rclo8xgkz8qTQFYexpbVfZkWh3EKZTqf+QtyRcLHoiVRCDTOCsbyUislk0 xBkV5LYCju1z4KbqU/Hh310WIKxshobOpE0f0RkGdWsEp703mbPrRqkXAYrTsDz22OvhhG VRb1R+/krYgYmzgQeM9iFeWCTJNkZvdXgSbN1MJdvzA2pmfojitnxqbPW1dEACzkkO89Pj 7D6dXuW7btFnIKNsaUbDzLRF/IVRQ2pNZ5t5ftkSt1u7c6j6kfmiKFG1Y5JtTLjTcVG4DL i+qJKYf9cxFQQ4/hQyBrkS2Ea/V6CFDQJtCUf3T2JMjrUpP8Nr61F730RfdNRw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1719393933; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=a375PhxMthj3Ncyfbog2KGPl8gvbOiEFMYzFMIsbVkk=; b=vmz4jTW7ijm78Ff0t01fYV0eanRGRFtlICw27IpBtOLqQz1MUl47DVw1CPaZE8BgSRZJJF gm3GZS/0+4cuUD15eTTokrMvSiZK96Al77/Fyi4cIxSOAiAKjBxSRmr5dvgLokuuOPeS7Q kvoAMjkyI0/xBe3lW/9gAMs8eWBFfp8Fa52hHnzEt/sY7N8iUbFncmkMv+z44+PXLFBgv8 0dVf1LJFI3b87TiJJuzNQrWq+XFsAxSV+o7eKQp2fYHe0VT5omnVjoFPLjjTbpOMHsgK7r gCRAAILmIKI0caLSuXaa97NeM7/dc4eA0bGiWvLUNCaQFi60T1SQN/BbRAR37w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4W8GWx3r2czg7h; Wed, 26 Jun 2024 09:25:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 45Q9PXFZ026675; Wed, 26 Jun 2024 09:25:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 45Q9PX3G026672; Wed, 26 Jun 2024 09:25:33 GMT (envelope-from git) Date: Wed, 26 Jun 2024 09:25:33 GMT Message-Id: <202406260925.45Q9PX3G026672@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 8502c68d29a8 - main - x86_iommu: use roundup_pow_of_two List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8502c68d29a82556a3afd9325321153f80c1daaa Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=8502c68d29a82556a3afd9325321153f80c1daaa commit 8502c68d29a82556a3afd9325321153f80c1daaa Author: Doug Moore AuthorDate: 2024-06-26 09:23:54 +0000 Commit: Doug Moore 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) ?