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=1796382295; b=o9Xw77FIV9VFt/74khWuvZYM79nybAtVwflvn6ChpHkO2qvxvlpmIK7vebA095XNO8Rp q/M50LZIyjbEjgc7Kdq4NzyrN21gy5Sdd9cX1+9clZVMjtw5GFU/tqcq3rdAF34nXs8jD yB2pF+eRH8NC5zXkb3PY1Yp0E+8Mqb3jGwpN2bTU9YWWj7uaUKP6yRgFolC9lBrImMrEv bsK/lLNMQNlwMdd5suKA4u9wa/jg3sh69/BfHjQU8DN7gWYo3a4JiB/ELSqbpg1xM+zmJ cNK4Wn1pKlHHMkPybENjDv2yDFirGbUdc9bek04Xqbd0QKWe8CikBzt7z01gYRIwrtg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796382295; 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=81nmMqvhFHvoqhL0ylaWzwVpqYpfMvAwrWTWYoYlEA4=; b=pnWN8Fk36FS0281BLbah95Z4ItuckozflkIMRqi6wu6sqrOMkESO8FiJTgHQ3fghuVrr QvLQJ9FVG9zskO88k2WOQAPJoLLIg0FaQFoZ91fCFaSs0VOm/CGaWYXtx30GPIk2qWNUQ xY8JclGavG8/Q4h2wKOu/tRVmyzj0ZD+ti/iFFdDbgEG3DcGrah5C/ALP3gRvnQknBTTm 3DtsXBP1YWuW2YHI3KNNHihPs5yXRU6CGT47pm3+ExomK5CGon1irePaWJobb0VumDgU+ VPNWAdIVcGa0/vEu+JbItOTismiuWI0NW88wjcs/K7nDs61cUG/fBniRtUS54G+7aMg== 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=iK1dmVTO; 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 43E46606A330; Fri, 4 Dec 2026 11:04:55 +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=iK1dmVTO Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2A971F000CE; Fri, 4 Dec 2026 11:04:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796382295; bh=81nmMqvhFHvoqhL0ylaWzwVpqYpfMvAwrWTWYoYlEA4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iK1dmVTOfcEXjvagL1JSeB5i7xH1xlLIpHoR4bKWetJun2SzWsGVSBBGvC0vT6s8I iX9bVtFvm+S0AV+irlMm/UMJBSuHJ72OSOMsfZc33Up4z59w6/EMlS60Rz5IlC6FvR Zwdp+RM6I1TNoRg1KSQWGP4IgDwvMTzjH6T7fFXc= 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 6.18 391/703] ACPI: CPPC: Reject EPP registers narrower than 8 bits Date: Fri, 4 Dec 2026 19:04:50 +0900 Message-ID: <20261204100638.238443451@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100627.522266145@linuxfoundation.org> References: <20261204100627.522266145@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 6.18-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 @@ -809,6 +809,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