From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380799; b=FJv0xJ6SpN46+zzO+vAUDcrLsFSzN/2yEweOLWcQy+aXV2UBkosJsln1hyWbKkGZvvLY mW8uV/PXvJmPYBSuG+18prFHcHEiOpzjN/og3OTFsyWbB1nmtKJ8NcxqCf0BBMLzpFhHX zliPhUqB1HOYTOl5GbjgywcbTJa43Sf19624tjApkOGgjsoihQ+b6iYQsJTmaOWJxd6WT 1OKzhhLRuRdVNBvxpkSU83habNZBmgjeEMeA/4mKUqrren0Sv85nEhD3F+XliZ+Dpkh3j H8warmOd3lmSf5PGDFSiHc5mvHAW6vTMprQluGNaOYZdmJnH7/WgDA0ytv5PxPOYNPQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380799; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=m/uynXJwoBKs3r9gV0oNfuPk1iGMqIxMsdv/fNGo3E0=; b=KQLOQWDdY2Nnqh4wlE66fw6tV1IkOc54gcHjndCTUavFKnlMBIDqksO3oc4xtTLK7jTX rZu4Ht45hesMXipdwGs1+fBjxA8nypHO/JYoJcToPtkgFQy74t7KWOwjYL0S/OInPa9aU oqnTuv6SnblSLEPHxeRJWHUoU3sp1N3MlyT/nac+LHzQauTp4zPWEcIdqCGCNxmTy9Evo M0ia+Ij3sQWQT41FFYGp18l+wy3QX9RZKa7ye+T62b8xpBTgt3S4jjldh8iJpNqgkSgJR POTUTYl9yP5PdJMLm0ZGtPq6NOMKQjSo0cYbzJKqpU9zQEZCcz9aFs+eJkaTfQ2O/tQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=BL2bYtsD; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9C623606A32C; Fri, 4 Dec 2026 10:39:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=BL2bYtsD Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1017E1F000C2; Fri, 4 Dec 2026 10:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380799; bh=m/uynXJwoBKs3r9gV0oNfuPk1iGMqIxMsdv/fNGo3E0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=BL2bYtsDVIz3CgMbKSIs/rTSuofta3XqsyF0aWOZ+2sEcsRm7DnVbkgzZrYUMPYPV s2l9pc4yJOtcWj0sbeybxZOgRZlSPU2ms9MN5Ob+BFUBNs6BqSjDg0IjzfKhTxe6sL t6EJXH0Pi5YcHOq9Ys0h848YJZyREGKgglmboZYM= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christian Loehle , "Mario Limonciello (AMD)" , "Rafael J. Wysocki" Subject: [PATCH 7.3 428/742] ACPI: CPPC: Reject EPP registers narrower than 8 bits Date: Fri, 4 Dec 2026 19:04:52 +0900 Message-ID: <20261204100646.478274015@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christian Loehle commit 7aca8e31a8fbf2ceffb487cec67ae300b95fa8b1 upstream. The EPP interfaces use an 8-bit preference, but ACPI permits narrower fields. With a 4- or 6-bit SystemMemory field, writing 128 succeeds but stores zero, requesting maximum performance instead. Reject a present EPP register narrower than eight bits during _CPC probe. Use the existing error path to release previously acquired resources and leave the CPU's CPPC descriptor unpublished. Keep absent EPP entries and registers at least eight bits wide on their existing paths. Fail the whole probe instead of disabling only EPP. This also makes amd-pstate's acpi_cpc_valid() check reject the platform before registering its MSR or shared-memory driver. No affected hardware is known or expected and the specification is expected to no longer permit these in the future [1]. Fixes: 922607a2b462 ("cpufreq: CPPC: Add support for autonomous selection") Link: https://github.com/tianocore/edk2/issues/10838 [1] Signed-off-by: Christian Loehle Reviewed-by: Mario Limonciello (AMD) Cc: All applicable [ rjw: Changelog tweak ] Link: https://patch.msgid.link/20261113130411.1433174-1-christian.loehle@arm.com Signed-off-by: Rafael J. Wysocki Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/cppc_acpi.c | 9 +++++++++ 1 file changed, 9 insertions(+) --- a/drivers/acpi/cppc_acpi.c +++ b/drivers/acpi/cppc_acpi.c @@ -888,6 +888,15 @@ int acpi_cppc_processor_probe(struct acp gas_t = (struct cpc_reg *) cpc_obj->buffer.pointer; + /* EPP interfaces require the full 0-255 preference range. */ + if (i - 2 == ENERGY_PERF && gas_t->bit_width < 8 && + !IS_NULL_REG(gas_t)) { + pr_debug("CPU%d: EPP register width %u is not supported\n", + pr->id, gas_t->bit_width); + ret = -EOPNOTSUPP; + goto out_free; + } + /* * The PCC Subspace index is encoded inside * the CPC table entries. The same PCC index