From nobody Thu Jun 25 01:58:25 2026 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 4gm25g0J5Tz6hDst for ; Thu, 25 Jun 2026 01:58:31 +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 "YR1" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gm25f5RLcz3n0Q for ; Thu, 25 Jun 2026 01:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1782352710; 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=pdyZP3Ulj3NJHaDy0wtksB/KrNJ7sVYZsjzx7KCAr/g=; b=AsAzMF1S6uUzBwSJdKQ0Qxh3eEYVSZy+gy/vrAfgzblUvA8xqkJXd/FWzJsaYp9ooqdrLD 2H2DGeoySM3prLoyAwBue1jcSt1eNhIIhSB60v2PwBCbIMVHXW5g8zpmvr66iKIFZkVf/f Jl1EbJfb/0Wk7Kgj/Xoo7HpbsDK4xDrwSFZf/i2BBxh24XOfBFbO06lDeP2KmUabq9W1Tv B55cKUcyzlL9zSNlvnH8zuJx79kC0iPuGXrV3oe7YYX47U0bTg78imfvJm6GqsgTbImxzW /n8LabNRpKfLWJbhByvCUpD3ZLEBDslmvEiBD6rNHa0YUYC7nFeqD0wDbJnqXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1782352710; a=rsa-sha256; cv=none; b=sWdVSIlW6feA1kt+qwJTh3Yw+ig1XegrDnihpHhX7oqUc1pko1faz0GdPysqQfmM99+hzQ jub9qq0QgI7ozpIVSnPHxKr6+BOQynrIwFsuwj1Ljis8y0LD4ocSIsSel/wGvsDRyTcN9Y NUq64ZmRUe4ycxXfBgi0Y2iQ1vGVbYncKrEkDyvIIdv0+BlLD1g+gSYXCMsX/m/sMS3QU/ /blOtC2UJ5R88XYWqlcdvsZbwTUtqcYwwtvmTexL9F3vAgqOjKEgcio/Eh1i/5r0aBoKGi GvSH3NplkiQn/IEbyYHiC6of678zBsQQYxwXCQZfmXr9Z4afxZ4NFOvVanH4gg== 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=1782352710; 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=pdyZP3Ulj3NJHaDy0wtksB/KrNJ7sVYZsjzx7KCAr/g=; b=dqZM+kTUcCp+K1rKWGuhzqyosbRUrmDwPz12X1gfPMFv+/C1f3txULVJgBNFzCs1PSfQ/+ fqzf9H+52UYnUdqgm+jZwScUpAXGE95k/7URjCILpyFWKGLiwcd6p8JnVD2PWKANGNtVY4 sykPj+JBHyvgc627VGLg2oIW5MWEue8kz1PlyZujuYdmXC4vxukiNLB4gnIgbYqYsgPVce oUYdT3P/weHmq1alTOQByQ+6w/zuYaiKFV55pM6/grPPk/kYAfgXZPePDzFRFXH9lfCiS/ pJjJwaticDdZUiHxBrJGQ/3+aLMuGIAVvMa9YAcBEUpUAUD42ufE8ddpAMuZnA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gm25f3pjKzmgp for ; Thu, 25 Jun 2026 01:58:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 42a44 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 25 Jun 2026 01:58:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Olivier Certner Subject: git: f6cb220172b1 - main - hwpstate_intel(4): Fix error tests 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olce X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f6cb220172b14b435364b3e2e61e9465ec11afcb Auto-Submitted: auto-generated Date: Thu, 25 Jun 2026 01:58:25 +0000 Message-Id: <6a3c8b41.42a44.1b9e6089@gitrepo.freebsd.org> The branch main has been updated by olce: URL: https://cgit.FreeBSD.org/src/commit/?id=f6cb220172b14b435364b3e2e61e9465ec11afcb commit f6cb220172b14b435364b3e2e61e9465ec11afcb Author: Olivier Certner AuthorDate: 2026-06-25 01:54:28 +0000 Commit: Olivier Certner CommitDate: 2026-06-25 01:58:09 +0000 hwpstate_intel(4): Fix error tests How I failed to notice this during the review will remain a mistery. Fixes: 29b8220b179b ("hwpstate_intel: Use ipi instead of thread_lock + sched_bind") Event: Halifax Hackathon 202606 Location: jrm@'s bathroom Sponsored by: The FreeBSD Foundation --- sys/x86/cpufreq/hwpstate_intel.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/sys/x86/cpufreq/hwpstate_intel.c b/sys/x86/cpufreq/hwpstate_intel.c index 352e44f84c4e..a903ae1521a6 100644 --- a/sys/x86/cpufreq/hwpstate_intel.c +++ b/sys/x86/cpufreq/hwpstate_intel.c @@ -135,6 +135,12 @@ MODULE_VERSION(hwpstate_intel, 1); #define HWP_ERROR_CPPC_REQUEST_PKG (1 << 3) #define HWP_ERROR_CPPC_EPP_WRITE (1 << 4) +static inline bool +hwp_has_error(u_int res, u_int err) +{ + return ((res & err) != 0); +} + struct dump_cppc_request_cb { struct hwp_softc *sc; uint64_t enabled; @@ -195,7 +201,7 @@ intel_hwp_dump_sysctl_handler(SYSCTL_HANDLER_ARGS) sb = sbuf_new(NULL, NULL, 1024, SBUF_FIXEDLEN | SBUF_INCLUDENUL); sbuf_putc(sb, '\n'); - if (data.err | HWP_ERROR_CPPC_ENABLE) + if (hwp_has_error(data.err, HWP_ERROR_CPPC_ENABLE)) sbuf_printf(sb, "CPU%u: IA32_PM_ENABLE: " MSR_NOT_READ_MSG "\n", pc->pc_cpuid); else @@ -204,7 +210,7 @@ intel_hwp_dump_sysctl_handler(SYSCTL_HANDLER_ARGS) if (data.enabled == 0) goto out; - if (data.err | HWP_ERROR_CPPC_CAPS) { + if (hwp_has_error(data.err, HWP_ERROR_CPPC_CAPS)) { sbuf_printf(sb, "IA32_HWP_CAPABILITIES: " MSR_NOT_READ_MSG "\n"); } else { @@ -227,9 +233,9 @@ intel_hwp_dump_sysctl_handler(SYSCTL_HANDLER_ARGS) sbuf_printf(sb, "\t%s: %03u\n", name, \ (unsigned)(data.request_pkg >> offset) & 0xff); \ } while (0) - if (data.err | HWP_ERROR_CPPC_REQUEST) { + if (hwp_has_error(data.err, HWP_ERROR_CPPC_REQUEST)) { sbuf_printf(sb, "IA32_HWP_REQUEST: " MSR_NOT_READ_MSG "\n"); - } else if (data.err | HWP_ERROR_CPPC_REQUEST_PKG) { + } else if (hwp_has_error(data.err, HWP_ERROR_CPPC_REQUEST_PKG)) { sbuf_printf(sb, "IA32_HWP_REQUEST_PKG: " MSR_NOT_READ_MSG "\n"); } else { pkg_print(IA32_HWP_REQUEST_EPP_VALID, @@ -505,30 +511,30 @@ set_autonomous_hwp(struct hwp_softc *sc) return (ENXIO); set_autonomous_hwp_send_one(sc, &data); - if (data.flag | HWP_ERROR_CPPC_ENABLE) { + if (hwp_has_error(data.flag, HWP_ERROR_CPPC_ENABLE)) { device_printf(dev, "Failed to enable HWP for cpu%d (%d)\n", pc->pc_cpuid, EFAULT); goto out; } - if (data.flag | HWP_ERROR_CPPC_REQUEST) { + if (hwp_has_error(data.flag, HWP_ERROR_CPPC_REQUEST)) { device_printf(dev, "Failed to read HWP request MSR for cpu%d (%d)\n", pc->pc_cpuid, EFAULT); goto out; } - if (data.flag | HWP_ERROR_CPPC_CAPS) { + if (hwp_has_error(data.flag, HWP_ERROR_CPPC_CAPS)) { device_printf(dev, "Failed to read HWP capabilities MSR for cpu%d (%d)\n", pc->pc_cpuid, EFAULT); goto out; } - if (data.flag | HWP_ERROR_CPPC_REQUEST_WRITE) { + if (hwp_has_error(data.flag, HWP_ERROR_CPPC_REQUEST_WRITE)) { device_printf(dev, "Failed to setup%s autonomous HWP for cpu%d\n", sc->hwp_pkg_ctrl_en ? " PKG" : "", pc->pc_cpuid); goto out; } - if (data.flag | HWP_ERROR_CPPC_REQUEST_PKG) + if (hwp_has_error(data.flag, HWP_ERROR_CPPC_REQUEST_PKG)) device_printf(dev, "Failed to set autonomous HWP for package\n"); @@ -700,26 +706,26 @@ intel_hwpstate_resume(device_t dev) return (ENXIO); hwpstate_resume_send_one(sc, &data); - if (data.flag | HWP_ERROR_CPPC_ENABLE) { + if (hwp_has_error(data.flag, HWP_ERROR_CPPC_ENABLE)) { device_printf(dev, "Failed to enable HWP for cpu%d after suspend (%d)\n", pc->pc_cpuid, EFAULT); goto out; } - if (data.flag | HWP_ERROR_CPPC_REQUEST_WRITE) { + if (hwp_has_error(data.flag, HWP_ERROR_CPPC_REQUEST_WRITE)) { device_printf(dev, "Failed to set%s autonomous HWP for cpu%d after suspend\n", sc->hwp_pkg_ctrl_en ? " PKG" : "", pc->pc_cpuid); goto out; } - if (data.flag | HWP_ERROR_CPPC_REQUEST_PKG) { + if (hwp_has_error(data.flag, HWP_ERROR_CPPC_REQUEST_PKG)) { device_printf(dev, "Failed to set autonomous HWP for package after " "suspend\n"); goto out; } - if (data.flag | HWP_ERROR_CPPC_EPP_WRITE) { + if (hwp_has_error(data.flag, HWP_ERROR_CPPC_EPP_WRITE)) { device_printf(dev, "Failed to set energy perf bias for cpu%d after " "suspend\n",