From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: Maciej Wieczor-Retman <m.wieczorretman@pm.me>,
hansg@kernel.org, ilpo.jarvinen@linux.intel.com
Cc: linux-kernel@vger.kernel.org,
platform-driver-x86@vger.kernel.org, dedekind1@gmail.com,
artem.bityutskiy@linux.intel.com
Subject: Re: [PATCH v2 0/2] platform/x86/intel-uncore-freq: Expose instance ID in the sysfs
Date: Tue, 07 Apr 2026 10:45:58 -0700 [thread overview]
Message-ID: <e96c61877730f624e8ab9793c17f485538dde545.camel@linux.intel.com> (raw)
In-Reply-To: <cover.1775159775.git.m.wieczorretman@pm.me>
On Thu, 2026-04-02 at 19:59 +0000, Maciej Wieczor-Retman wrote:
> --- Motivation
>
> This patchset is about exporting instance ID, a value used to
> uniquely
> identify MMIO blocks in TPMI devices. Userspace tools like "pepc" [1]
> can use it for direct MMIO reads or writes. It's faster than the
> alternative legacy approach which is interacting with MSRs.
This statement is not required. MSR is not an option. This allows PEPC
like tools to do some platform specific turning which is not supported
via uncore sysfs.
Thanks,
Srinivas
>
> Currently exported information allows doing this on non-partitioned
> systems, but partitioned systems require additional steps to map MMIO
> blocks.
>
> [1] https://github.com/intel/pepc
>
> --- Background
>
> * TPMI MMIO organization
> For each TPMI device a direct register access is possible through
> MMIO
> mapped blocks, where:
> - Each block belongs to a different power domain.
> - Each power domain is exposed in sysfs via a domain_id attribute.
> - Power domain scope is per-die (either IO dies or compute dies).
> - Compute die blocks are ordered first, before IO die blocks in
> MMIO space.
>
> * Domain ID mapping
> For compute dies, the mapping is architectural through a CPUID leaf
> or
> via MSR 0x54:
> - Compute die IDs directly correspond to CPU die IDs
> - CPU die ID can be obtained from MSR 0x54 or recent CPUID leaves
> - Example: domain_id equal to 1 applies to all CPUs with die ID 1
>
> * IO die mapping
> For IO dies, the relationship is generation/platform specific. It's
> generally not recommended to assume any specific IO organization but
> uncore sysfs provides an attribute to differentiate die types.
>
> * Partitioning
> In partitioned systems multiple TPMI devices exist per package.
> However
> CPUs are still enumerated package-wide and so die IDs (domain_id) are
> unique per-package. For example a single partition (single TPMI
> device)
> Granite Rapids might order its dies in the following way:
>
> +---------------------+-----------+
> > Die type and number | Domain ID |
> +---------------------+-----------+
> > Compute die 0 | 0 |
> > Compute die 1 | 1 |
> > IO die 0 | 2 |
> > IO die 1 | 3 |
> +---------------------+-----------+
>
> While a two partition system may be numbered in this way:
>
> +---------------------+-------------+-------------+
> > Die type and number | Domain ID |
> > local in single +-------------+-------------+
> > partition scope | Partition 0 | Partition 1 |
> +---------------------+-------------+-------------+
> > Compute die 0 | 0 | 2 |
> > Compute die 1 | 1 | 3 |
> > IO die 0 | 4 | 6 |
> > IO die 1 | 5 | 7 |
> +---------------------+-------------+-------------+
>
> The cd_mask value from the TPMI bus info register can show using a
> bitmap which compute dies belong to which partition.
>
> * Instance ID
> Partition ID is not an architectural value, meaning there is no CPUID
> or
> MSR to map a CPU to a partition number. Therefore to allow mapping
> CPUs
> to compute dies as well as mapping TPMI registers in MMIO mapped
> space
> two numbers need to be exported:
> - domain_id
> - Whether the system is partitioned or not it still allows
> mapping CPUs to compute die IDs.
> - instance_id
> - A per-partition (and hence per-device) physical index to
> still
> allow mapping MMIO blocks to both compute and IO dies. On
> partitioned systems mapping IO dies would be very
> difficult
> since they are only indexed after all the compute dies are
> numbered.
>
> As one can see, on non-partitioned systems the instance ID and domain
> ID
> have the same value. It's only on partitioned systems that both
> values
> are needed to keep all mapping functionality. To better show the
> relationship this is how values on a partitioned system can look:
>
> +---------------------+-------------+-------------+-------------+----
> ---------+
> > Die type and number | Domain ID | Instance
> > ID |
> > local in single +-------------+-------------+-------------+----
> > ---------+
> > partition scope | Partition 0 | Partition 1 | Partition 0 |
> > Partition 1 |
> +---------------------+-------------+-------------+-------------+----
> ---------+
> > Compute die 0 | 0 | 2 | 0
> > | 0 |
> > Compute die 1 | 1 | 3 | 1
> > | 1 |
> > IO die 0 | 4 | 6 | 2
> > | 2 |
> > IO die 1 | 5 | 7 | 3
> > | 3 |
> +---------------------+-------------+-------------+-------------+----
> ---------+
>
> Maciej Wieczor-Retman (2):
> platform/x86/intel-uncore-freq: Rename instance_id
> platform/x86/intel-uncore-freq: Expose instance ID in the sysfs
>
> .../pm/intel_uncore_frequency_scaling.rst | 7 +++++++
> .../uncore-frequency/uncore-frequency-common.c | 16 +++++++++++++-
> --
> .../uncore-frequency/uncore-frequency-common.h | 8 ++++++--
> .../uncore-frequency/uncore-frequency-tpmi.c | 15
> ++++++++++++++-
> 4 files changed, 40 insertions(+), 6 deletions(-)
next prev parent reply other threads:[~2026-04-07 17:46 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-02 19:59 Maciej Wieczor-Retman
2026-04-02 19:59 ` [PATCH v2 1/2] platform/x86/intel-uncore-freq: Rename instance_id Maciej Wieczor-Retman
2026-04-07 17:49 ` srinivas pandruvada
2026-04-02 19:59 ` [PATCH v2 2/2] platform/x86/intel-uncore-freq: Expose instance ID in the sysfs Maciej Wieczor-Retman
2026-04-07 18:03 ` srinivas pandruvada
2026-04-07 18:19 ` Maciej Wieczor-Retman
2026-04-07 20:37 ` srinivas pandruvada
2026-04-07 21:32 ` Maciej Wieczor-Retman
2026-04-07 17:45 ` srinivas pandruvada [this message]
2026-04-07 18:13 ` [PATCH v2 0/2] " Maciej Wieczor-Retman
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=e96c61877730f624e8ab9793c17f485538dde545.camel@linux.intel.com \
--to=srinivas.pandruvada@linux.intel.com \
--cc=artem.bityutskiy@linux.intel.com \
--cc=dedekind1@gmail.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.wieczorretman@pm.me \
--cc=platform-driver-x86@vger.kernel.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
Powered by JetHome