From nobody Wed Sep 11 08:44:32 2024 X-Original-To: dev-commits-src-all@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 4X3Yz46YqQz5W7k4; Wed, 11 Sep 2024 08:44:32 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4X3Yz45b9Lz41Qv; Wed, 11 Sep 2024 08:44:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1726044272; 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=WMQUXSVVORzo230/yt1SEtx1AkUa/3tdDQxNf0k5dBQ=; b=hinnW+tQnE7tn3kdCi72XOdXifu/aVo7clryBNKE92WmjKFif+7FWfRmJ+ItyQiC1AUMrL RpycFKXSJ+8buno6L087v8LKh8A2Y8p+4sc17/Oppvk6qefBg3CHYo0wsXXBRzVBSXsQbt 8voQQ9Rc94UdRzCuWJKgwGUvUXmkEu+1TmHYU5jsEIROq8yvmX2UkpFGy98vPQdOqYqgHQ x7y3QzM3cf9lYH+jNtxFdaquGD9PN+z8sfbt+xpabB8id+rvGRcx9JERQbIPyYdcqkuqsc A9WvipUwqb3VEa4dSMV5jzvxPCoYdkvE9jbLsiNI6piLpG2mOfV8ppJggiLyAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1726044272; a=rsa-sha256; cv=none; b=VIGN0yovBYOJINm1OeY32aCFA07l8WitJrG3tj5EsalseJq43dfDOm5KBKSkgGO6fAmdLi NVvha6fmtHbamSHEGWpa8TKVS19mDYNwfh7znQaHPncj3QJ4hV7jn5D9Db9xV2K/gRzOek G7aXXnjEw1+d7JKJ6HlyP76gknnzGmMro7y6uR9XXXQci7JzvZR9ZjazP4VwlYYYfES60e Mt2+MGdrwZfLEQZvFURsFmp0MVVnPQ/4/QKB0NHJLRZPUOdbgiV2moFrCZZnU12TrH/bUb sXv48EhEyuyNgPRD1NSipZY0Zj0Z+cCX7korHLBCjWJbq1tLNO1XHafi54jL3Q== 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=1726044272; 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=WMQUXSVVORzo230/yt1SEtx1AkUa/3tdDQxNf0k5dBQ=; b=NW6w9VxBGlho+uVXEogubSTPf0PRy9MazUG9o9Z/ILFcadEl5HVjUF8lezT+NrMfVfCifp ADHtb/zowZ8L4Af6EzeJgl8Wa1xA3uUGyP6DpTjSgthrK9LalYZQVpEWM1Q53J5ivntvZN pSTjXSAfl1qd1QYYcVN+8p2FAlv/Ytq9u5eD2ncbO/cA80EwG7n5OO89ikRu56Pk6czc3p 55eOldNzBwF2LyCeDAMt/3cJWffPDp0wCc1EnLZa5r/k+OwL3cWFnhMa/cLXLR0TKThpc5 I41Bhl3Cv/Ha/zAZ6O6Mk11drmR9G2WJ3KgdrvAy53DOvWdQIOVDV3hXX3DMrQ== 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 4X3Yz45CGWzP9k; Wed, 11 Sep 2024 08:44:32 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48B8iWJa007881; Wed, 11 Sep 2024 08:44:32 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48B8iWtT007878; Wed, 11 Sep 2024 08:44:32 GMT (envelope-from git) Date: Wed, 11 Sep 2024 08:44:32 GMT Message-Id: <202409110844.48B8iWtT007878@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: f279f9ec2923 - stable/14 - DMAR: move hw.iommu.dmar.{tbl_pagecnt,batch_coalesce} sysctls up one level List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: f279f9ec29236d8517d2800f6d109a37d73c3143 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f279f9ec29236d8517d2800f6d109a37d73c3143 commit f279f9ec29236d8517d2800f6d109a37d73c3143 Author: Konstantin Belousov AuthorDate: 2024-08-23 21:10:14 +0000 Commit: Konstantin Belousov CommitDate: 2024-09-11 08:44:00 +0000 DMAR: move hw.iommu.dmar.{tbl_pagecnt,batch_coalesce} sysctls up one level (cherry picked from commit 0386b2451592ec04e4cff826b698f978a45ab3e4) --- sys/x86/iommu/intel_ctx.c | 2 +- sys/x86/iommu/intel_dmar.h | 3 ++- sys/x86/iommu/intel_utils.c | 4 ---- sys/x86/iommu/iommu_utils.c | 9 +++++++-- sys/x86/iommu/x86_iommu.h | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sys/x86/iommu/intel_ctx.c b/sys/x86/iommu/intel_ctx.c index 814a5a8c7105..9d2d607d11a6 100644 --- a/sys/x86/iommu/intel_ctx.c +++ b/sys/x86/iommu/intel_ctx.c @@ -878,7 +878,7 @@ dmar_domain_unload_emit_wait(struct dmar_domain *domain, if (TAILQ_NEXT(entry, dmamap_link) == NULL) return (true); - return (domain->batch_no++ % dmar_batch_coalesce == 0); + return (domain->batch_no++ % iommu_qi_batch_coalesce == 0); } void diff --git a/sys/x86/iommu/intel_dmar.h b/sys/x86/iommu/intel_dmar.h index c1e6c8f06f64..188e40dec36c 100644 --- a/sys/x86/iommu/intel_dmar.h +++ b/sys/x86/iommu/intel_dmar.h @@ -166,6 +166,8 @@ struct dmar_unit { #define DMAR_BARRIER_RMRR 0 #define DMAR_BARRIER_USEQ 1 +SYSCTL_DECL(_hw_iommu_dmar); + struct dmar_unit *dmar_find(device_t dev, bool verbose); struct dmar_unit *dmar_find_hpet(device_t dev, uint16_t *rid); struct dmar_unit *dmar_find_ioapic(u_int apic_id, uint16_t *rid); @@ -265,7 +267,6 @@ int dmar_map_ioapic_intr(u_int ioapic_id, u_int cpu, u_int vector, bool edge, int dmar_unmap_ioapic_intr(u_int ioapic_id, u_int *cookie); extern int haw; -extern int dmar_batch_coalesce; extern int dmar_rmrr_enable; static inline uint32_t diff --git a/sys/x86/iommu/intel_utils.c b/sys/x86/iommu/intel_utils.c index 7e15299c1bd3..1746bcdae8ed 100644 --- a/sys/x86/iommu/intel_utils.c +++ b/sys/x86/iommu/intel_utils.c @@ -508,7 +508,6 @@ dmar_barrier_exit(struct dmar_unit *dmar, u_int barrier_id) DMAR_UNLOCK(dmar); } -int dmar_batch_coalesce = 100; struct timespec dmar_hw_timeout = { .tv_sec = 0, .tv_nsec = 1000000 @@ -547,9 +546,6 @@ dmar_timeout_sysctl(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_INT(_hw_iommu_dmar, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, - &dmar_batch_coalesce, 0, - "Number of qi batches between interrupt"); SYSCTL_PROC(_hw_iommu_dmar, OID_AUTO, timeout, CTLTYPE_U64 | CTLFLAG_RW | CTLFLAG_MPSAFE, 0, 0, dmar_timeout_sysctl, "QU", diff --git a/sys/x86/iommu/iommu_utils.c b/sys/x86/iommu/iommu_utils.c index 645c7e15740a..5d22c6584ab7 100644 --- a/sys/x86/iommu/iommu_utils.c +++ b/sys/x86/iommu/iommu_utils.c @@ -181,9 +181,14 @@ int iommu_tbl_pagecnt; SYSCTL_NODE(_hw_iommu, OID_AUTO, dmar, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, ""); -SYSCTL_INT(_hw_iommu_dmar, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, +SYSCTL_INT(_hw_iommu, OID_AUTO, tbl_pagecnt, CTLFLAG_RD, &iommu_tbl_pagecnt, 0, - "Count of pages used for DMAR pagetables"); + "Count of pages used for IOMMU pagetables"); + +int iommu_qi_batch_coalesce = 100; +SYSCTL_INT(_hw_iommu, OID_AUTO, batch_coalesce, CTLFLAG_RWTUN, + &iommu_qi_batch_coalesce, 0, + "Number of qi batches between interrupt"); static struct x86_iommu *x86_iommu; diff --git a/sys/x86/iommu/x86_iommu.h b/sys/x86/iommu/x86_iommu.h index b2caed550e35..210ce82c8f6d 100644 --- a/sys/x86/iommu/x86_iommu.h +++ b/sys/x86/iommu/x86_iommu.h @@ -55,9 +55,9 @@ void iommu_unmap_pgtbl(struct sf_buf *sf); extern iommu_haddr_t iommu_high; extern int iommu_tbl_pagecnt; +extern int iommu_qi_batch_coalesce; SYSCTL_DECL(_hw_iommu); -SYSCTL_DECL(_hw_iommu_dmar); struct x86_unit_common;