From: Elliott Mitchell <ehem+xen@m5p.com>
To: Penny Zheng <Penny.Zheng@amd.com>
Cc: jbeulich@suse.com, Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
Ray Huang <Ray.Huang@amd.com>,
Jason Andryuk <jason.andryuk@amd.com>,
xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org,
Roger Pau Monne <roger.pau@citrix.com>
Subject: Re: [PATCH v3 1/5] xen/acpi: upload power and performance related data from a PVH dom0
Date: Tue, 25 Mar 2025 14:11:51 -0700 [thread overview]
Message-ID: <Z-McF__J_QVvwnxe@mattapan.m5p.com> (raw)
In-Reply-To: <20250306110824.1506699-2-Penny.Zheng@amd.com>
On Thu, Mar 06, 2025 at 07:08:20PM +0800, Penny Zheng wrote:
> From: Roger Pau Monne <roger.pau@citrix.com>
>
> When running as a PVH dom0 the ACPI MADT is crafted by Xen in order to
> report the correct numbers of vCPUs that dom0 has, so the host MADT is
> not provided to dom0. This creates issues when parsing the power and
> performance related data from ACPI dynamic tables, as the ACPI
> Processor UIDs found on the dynamic code are likely to not match the
> ones crafted by Xen in the dom0 MADT.
>
> Xen would rely on Linux having filled at least the power and
> performance related data of the vCPUs on the system, and would clone
> that information in order to setup the remaining pCPUs on the system
> if dom0 vCPUs < pCPUs. However when running as PVH dom0 it's likely
> that none of dom0 CPUs will have the power and performance data
> filled, and hence the Xen ACPI Processor driver needs to fetch that
> information by itself.
>
> In order to do so correctly, introduce a new helper to fetch the _CST
> data without taking into account the system capabilities from the
> CPUID output, as the capabilities reported to dom0 in CPUID might be
> different from the ones on the host.
>
> Note that the newly introduced code will only fetch the _CST, _PSS,
> _PPC and _PCT from a single CPU, and clone that information for all the
> other Processors. This won't work on an heterogeneous system with
> Processors having different power and performance related data between
> them.
I'm unsure whether the above description is inaccurate versus what I've
seen being a distinct issue.
This also effects PV domain 0 and isn't limited to AMD processors. In
particular if domain 0 is PV, C-states will only be uploaded for
processors which domain 0 has a corresponding vCPU.
xen-acpi-processor uploads C/P-states in two passes. The first pass
being for processors which domain 0 has a vCPU. The second pass being
for all physical processors. In a PV domain 0, xen-acpi-processor is
unable to upload C-states during the second pass.
Snippet from pass 1:
xen_acpi_processor: ACPI CPU0 - C-states uploaded.
xen_acpi_processor: C1: ACPI HLT 1 uS
xen_acpi_processor: C2: ACPI IOPORT 0x414 18 uS
xen_acpi_processor: C3: ACPI IOPORT 0x415 350 uS
xen_acpi_processor: ACPI CPU0 - P-states uploaded.
xen_acpi_processor: *P0: 4500 MHz, 5625 mW, 0 uS
xen_acpi_processor: P1: 3000 MHz, 2550 mW, 0 uS
xen_acpi_processor: ACPI CPU2 - C-states uploaded.
xen_acpi_processor: C1: ACPI HLT 1 uS
xen_acpi_processor: C2: ACPI IOPORT 0x414 18 uS
xen_acpi_processor: C3: ACPI IOPORT 0x415 350 uS
xen_acpi_processor: ACPI CPU2 - P-states uploaded.
xen_acpi_processor: *P0: 4500 MHz, 5625 mW, 0 uS
xen_acpi_processor: P1: 3000 MHz, 2550 mW, 0 uS
Intermediate:
xen_acpi_processor: ACPI CPU0 w/ PBLK:0x0
xen_acpi_processor: ACPI CPU0 w/ PST:coord_type = 254 domain = 0
xen_acpi_processor: ACPI CPU1 w/ PBLK:0x0
xen_acpi_processor: ACPI CPU1 w/ PST:coord_type = 254 domain = 0
xen_acpi_processor: ACPI CPU2 w/ PBLK:0x0
xen_acpi_processor: ACPI CPU2 w/ PST:coord_type = 254 domain = 1
xen_acpi_processor: ACPI CPU3 w/ PBLK:0x0
xen_acpi_processor: ACPI CPU3 w/ PST:coord_type = 254 domain = 1
Snippet from pass 2:
xen_acpi_processor: ACPI CPU1 - P-states uploaded.
xen_acpi_processor: *P0: 4500 MHz, 5625 mW, 0 uS
xen_acpi_processor: P1: 3000 MHz, 2550 mW, 0 uS
xen_acpi_processor: ACPI CPU3 - P-states uploaded.
xen_acpi_processor: *P0: 4500 MHz, 5625 mW, 0 uS
xen_acpi_processor: P1: 3000 MHz, 2550 mW, 0 uS
Come to think of it, I've been wondering about the mapping between Xen
CPU numbers and ACPI CPU numbers...
--
(\___(\___(\______ --=> 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
next prev parent reply other threads:[~2025-03-25 21:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-06 11:08 [PATCH v3 0/5] xen/acpi: introduce cppc performance hypercall Penny Zheng
2025-03-06 11:08 ` [PATCH v3 1/5] xen/acpi: upload power and performance related data from a PVH dom0 Penny Zheng
2025-03-25 16:17 ` Jan Beulich
2025-03-25 16:49 ` Jason Andryuk
2025-03-25 21:11 ` Elliott Mitchell [this message]
2025-03-06 11:08 ` [PATCH v3 2/5] xen: introduces XEN_PM_PSD sub-hypercall for solely delivery of _PSD info Penny Zheng
2025-03-06 11:08 ` [PATCH v3 3/5] acpi/cppc: extract _cpc entry parsing logic Penny Zheng
2025-03-06 11:08 ` [PATCH v3 4/5] xen/cppc: get xen-required cppc perf caps data Penny Zheng
2025-03-06 11:08 ` [PATCH v3 5/5] xen/cppc: introduce cppc data upload sub-hypercall Penny Zheng
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=Z-McF__J_QVvwnxe@mattapan.m5p.com \
--to=ehem+xen@m5p.com \
--cc=Penny.Zheng@amd.com \
--cc=Ray.Huang@amd.com \
--cc=jason.andryuk@amd.com \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleksandr_tyshchenko@epam.com \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--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®