From nobody Tue Mar 3 03:06:20 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=linux-mail.net ARC-Seal: i=1; a=rsa-sha256; t=1771925858; cv=none; d=zohomail.com; s=zohoarc; b=R4fQkqVYOiv8gvNgmMWT37olUPvHVJJ5EwsxElPShxkVaDVyteLxmuiLYs8NT6KyPhkrN3PcXLS6nBCSanMZE/NAY+AmhJ8o+UtHdKiVvcyb4vV/6nCBelDNShnps0C1pH9KCGpYgjqyyKA90NAwvreA85AGRs9o7pGd76rXMnQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771925858; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=r2rda/g/vi5GF2WIAeDs3b+9hmolyVwJOyarSdmFE8g=; b=A626AAINYrg8f2TRSe4FjqrhvECrsOZZRX1idz2wPqRQJN3Ydtvo1hKOcRyOCeSdzeOS+5F1O0PZkAELAEf6QufZRorg2s0iy0XDrkljD2VWiZhWp+Q2Uo5JF8RoADh/JmZbtUJbm1So1lc+jiLaKmxnni4sQ+Zq22y7EtLBce4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1771925857902976.357753743957; Tue, 24 Feb 2026 01:37:37 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1239639.1541034 (Exim 4.92) (envelope-from ) id 1vuor6-0003GZ-6w; Tue, 24 Feb 2026 09:37:24 +0000 Received: by outflank-mailman (output) from mailman id 1239639.1541034; Tue, 24 Feb 2026 09:37:24 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vuor6-0003GS-3E; Tue, 24 Feb 2026 09:37:24 +0000 Received: by outflank-mailman (input) for mailman id 1239639; Tue, 24 Feb 2026 09:37:22 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vuor4-00032q-1l for xen-devel@lists.xenproject.org; Tue, 24 Feb 2026 09:37:22 +0000 Received: from mail-4398.protonmail.ch (mail-4398.protonmail.ch [185.70.43.98]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 68488617-1164-11f1-9ccf-f158ae23cfc8; Tue, 24 Feb 2026 10:37:17 +0100 (CET) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 68488617-1164-11f1-9ccf-f158ae23cfc8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-mail.net; s=protonmail; t=1771925836; x=1772185036; bh=r2rda/g/vi5GF2WIAeDs3b+9hmolyVwJOyarSdmFE8g=; h=Date:To:From:Cc:Subject:Message-ID:Feedback-ID:From:To:Cc:Date: Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=PdbCfxjgi4SN+YiE7S7My63gVIe+v7WfKxKYiVcHAJn1xeEhgc51bgJw5IKRv+Bw1 lDQbJDgT0bVu/pleb1j+Shb53j22elBWGu31j2wz5WZL530qDOHK+RQp6BMB1i8K4C YbRoMzpzRiTMPGu2DFXOLccv0Nld/ILIuVIBJ7pNlzzQKfR1rMjuAng5wAlofSTUP8 3TljrwVbQa0vurfh2Kkrg/9d9RzTb1t9EfhEUSWSEYFTV7pqdOS/IJiMt9Dywu8MFm IJF52z60NgxooMKNSUoQaY0VUWOt7/EAfJsrxrFQGy6R0KB79/JqCs3z+r+IaVK1xE XAHCtI8O4pv4g== Date: Tue, 24 Feb 2026 09:37:11 +0000 To: jgross@suse.com From: David Thomson Cc: boris.ostrovsky@oracle.com, olekstysh@gmail.com, tglx@linutronix.de, jbeulich@suse.com, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, David Thomson Subject: [PATCH v2] xen/acpi-processor: fix _CST detection using undersized evaluation buffer Message-ID: <20260224093707.19679-1-dt@linux-mail.net> Feedback-ID: 176297775:user:proton X-Pm-Message-ID: 6d863196dc75b80c244bf456ca669156f4bdc168 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @linux-mail.net) X-ZM-MESSAGEID: 1771925859475158500 Content-Type: text/plain; charset="utf-8" read_acpi_id() attempts to evaluate _CST using a stack buffer of sizeof(union acpi_object) (48 bytes), but _CST returns a nested Package of sub-Packages (one per C-state, each containing a register descriptor, type, latency, and power) requiring hundreds of bytes. The evaluation always fails with AE_BUFFER_OVERFLOW. On modern systems using FFH/MWAIT entry (where pblk is zero), this causes the function to return before setting the acpi_id_cst_present bit. In check_acpi_ids(), flags.power is then zero for all Phase 2 CPUs (physical CPUs beyond dom0's vCPU count), so push_cxx_to_hypervisor() is never called for them. On a system with dom0_max_vcpus=3D2 and 8 physical CPUs, only PCPUs 0-1 receive C-state data. PCPUs 2-7 are stuck in C0/C1 idle, unable to enter C2/C3. This costs measurable wall power (4W observed on an Intel Core Ultra 7 265K with Xen 4.20). The function never uses the _CST return value -- it only needs to know whether _CST exists. Replace the broken acpi_evaluate_object() call with acpi_has_method(), which correctly detects _CST presence using acpi_get_handle() without any buffer allocation. This brings C-state detection to parity with the P-state path, which already works correctly for Phase 2 CPUs. Fixes: 59a568029181 ("xen/acpi-processor: C and P-state driver that uploads= said data to hypervisor.") Signed-off-by: David Thomson Reviewed-by: Jan Beulich --- Changes in v2: - Check pblk first to avoid unnecessary acpi_has_method() call when pblk is zero (Jan Beulich) drivers/xen/xen-acpi-processor.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-proces= sor.c index 2967039..67a4afc 100644 --- a/drivers/xen/xen-acpi-processor.c +++ b/drivers/xen/xen-acpi-processor.c @@ -379,11 +379,8 @@ read_acpi_id(acpi_handle handle, u32 lvl, void *contex= t, void **rv) acpi_psd[acpi_id].domain); } - status =3D acpi_evaluate_object(handle, "_CST", NULL, &buffer); - if (ACPI_FAILURE(status)) { - if (!pblk) - return AE_OK; - } + if (!pblk && !acpi_has_method(handle, "_CST")) + return AE_OK; /* .. and it has a C-state */ __set_bit(acpi_id, acpi_id_cst_present); -- 2.34.1