mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Elliott Mitchell <ehem+xen@m5p.com>
To: David Thomson <dt@linux-mail.net>
Cc: jgross@suse.com, boris.ostrovsky@oracle.com, olekstysh@gmail.com,
	tglx@linutronix.de, jbeulich@suse.com,
	xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] xen/acpi-processor: fix _CST detection using undersized evaluation buffer
Date: Mon, 16 Mar 2026 13:03:37 -0700	[thread overview]
Message-ID: <abhiGd_AOyR45ZyN@mattapan.m5p.com> (raw)
In-Reply-To: <20260224093707.19679-1-dt@linux-mail.net>

On Tue, Feb 24, 2026 at 09:37:11AM +0000, David Thomson wrote:
> 
> On a system with dom0_max_vcpus=2 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 <dt@linux-mail.net>

Tested-by: Elliott Mitchell <ehem+xen@m5p.com>

The window of opportunity happened and I confirmed it fixed the issue for
me.  I don't know whether this already got in though.

> -	status = 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);

I had traced the problem to this spot a while back, but I didn't know
what an appropriate change was.  Since I had a workaround this wasn't
urgent.  I do know this effects many others, I don't know how urgent this
bug is for everyone else.


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg@m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445



      parent reply	other threads:[~2026-03-16 20:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24  9:37 David Thomson
2026-02-24  9:39 ` Jan Beulich
2026-03-16 20:03 ` Elliott Mitchell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abhiGd_AOyR45ZyN@mattapan.m5p.com \
    --to=ehem+xen@m5p.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=dt@linux-mail.net \
    --cc=jbeulich@suse.com \
    --cc=jgross@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olekstysh@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®