<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/x86/kernel/acpi/cppc.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-03-06T19:01:25Z</updated>
<entry>
<title>cpufreq/amd-pstate: Replace all AMD_CPPC_* macros with masks</title>
<updated>2025-03-06T19:01:25Z</updated>
<author>
<name>Mario Limonciello</name>
</author>
<published>2024-12-08T04:38:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b4cc466b973590114b4bf49025d362ad9618a23e'/>
<id>urn:sha1:b4cc466b973590114b4bf49025d362ad9618a23e</id>
<content type='text'>
Bitfield masks are easier to follow and less error prone.

Reviewed-by: Dhananjay Ugwekar &lt;dhananjay.ugwekar@amd.com&gt;
Reviewed-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'x86_cpu_for_v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2024-11-19T20:27:19Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2024-11-19T20:27:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d8d78a90e7fca1ce7c90fa791400b287bc5b42a1'/>
<id>urn:sha1:d8d78a90e7fca1ce7c90fa791400b287bc5b42a1</id>
<content type='text'>
Pull x86 cpuid updates from Borislav Petkov:

 - Add a feature flag which denotes AMD CPUs supporting workload
   classification with the purpose of using such hints when making
   scheduling decisions

 - Determine the boost enumerator for each AMD core based on its type:
   efficiency or performance, in the cppc driver

 - Add the type of a CPU to the topology CPU descriptor with the goal of
   supporting and making decisions based on the type of the respective
   core

 - Add a feature flag to denote AMD cores which have heterogeneous
   topology and enable SD_ASYM_PACKING for those

 - Check microcode revisions before disabling PCID on Intel

 - Cleanups and fixlets

* tag 'x86_cpu_for_v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/cpu: Remove redundant CONFIG_NUMA guard around numa_add_cpu()
  x86/cpu: Fix FAM5_QUARK_X1000 to use X86_MATCH_VFM()
  x86/cpu: Fix formatting of cpuid_bits[] in scattered.c
  x86/cpufeatures: Add X86_FEATURE_AMD_WORKLOAD_CLASS feature bit
  x86/amd: Use heterogeneous core topology for identifying boost numerator
  x86/cpu: Add CPU type to struct cpuinfo_topology
  x86/cpu: Enable SD_ASYM_PACKING for PKG domain on AMD
  x86/cpufeatures: Add X86_FEATURE_AMD_HETEROGENEOUS_CORES
  x86/cpufeatures: Rename X86_FEATURE_FAST_CPPC to have AMD prefix
  x86/mm: Don't disable PCID when INVLPG has been fixed by microcode
</content>
</entry>
<entry>
<title>ACPI: processor: Move arch_init_invariance_cppc() call later</title>
<updated>2024-11-06T20:31:36Z</updated>
<author>
<name>Mario Limonciello</name>
</author>
<published>2024-11-04T22:28:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b79276dcac9124a79c8cf7cc8fbdd3d4c3c9a7c7'/>
<id>urn:sha1:b79276dcac9124a79c8cf7cc8fbdd3d4c3c9a7c7</id>
<content type='text'>
arch_init_invariance_cppc() is called at the end of
acpi_cppc_processor_probe() in order to configure frequency invariance
based upon the values from _CPC.

This however doesn't work on AMD CPPC shared memory designs that have
AMD preferred cores enabled because _CPC needs to be analyzed from all
cores to judge if preferred cores are enabled.

This issue manifests to users as a warning since commit 21fb59ab4b97
("ACPI: CPPC: Adjust debug messages in amd_set_max_freq_ratio() to warn"):
```
Could not retrieve highest performance (-19)
```

However the warning isn't the cause of this, it was actually
commit 279f838a61f9 ("x86/amd: Detect preferred cores in
amd_get_boost_ratio_numerator()") which exposed the issue.

To fix this problem, change arch_init_invariance_cppc() into a new weak
symbol that is called at the end of acpi_processor_driver_init().
Each architecture that supports it can declare the symbol to override
the weak one.

Define it for x86, in arch/x86/kernel/acpi/cppc.c, and for all of the
architectures using the generic arch_topology.c code.

Fixes: 279f838a61f9 ("x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator()")
Reported-by: Ivan Shapovalov &lt;intelfx@intelfx.name&gt;
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219431
Tested-by: Oleksandr Natalenko &lt;oleksandr@natalenko.name&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Link: https://patch.msgid.link/20241104222855.3959267-1-superm1@kernel.org
[ rjw: Changelog edit ]
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>x86/amd: Use heterogeneous core topology for identifying boost numerator</title>
<updated>2024-10-25T18:51:17Z</updated>
<author>
<name>Mario Limonciello</name>
</author>
<published>2024-10-25T17:14:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3eef25ab0d89cb1e55699a4d242c5afe17dbbd07'/>
<id>urn:sha1:3eef25ab0d89cb1e55699a4d242c5afe17dbbd07</id>
<content type='text'>
AMD heterogeneous designs include two types of cores:

 * Performance
 * Efficiency

Each core type has different highest performance values configured by the
platform.  Drivers such as amd_pstate need to identify the type of core to
correctly set an appropriate boost numerator to calculate the maximum
frequency.

X86_FEATURE_AMD_HETEROGENEOUS_CORES is used to identify whether the SoC
supports heterogeneous core type by reading CPUID leaf Fn_0x80000026.

On performance cores the scaling factor of 196 is used.  On efficiency cores
the scaling factor is the value reported as the highest perf.  Efficiency
cores have the same preferred core rankings.

Suggested-by: Perry Yuan &lt;perry.yuan@amd.com&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
Signed-off-by: Borislav Petkov (AMD) &lt;bp@alien8.de&gt;
Link: https://lore.kernel.org/r/20241025171459.1093-6-mario.limonciello@amd.com
</content>
</entry>
<entry>
<title>cpufreq: amd-pstate: Merge amd_pstate_highest_perf_set() into amd_get_boost_ratio_numerator()</title>
<updated>2024-09-11T15:23:23Z</updated>
<author>
<name>Mario Limonciello</name>
</author>
<published>2024-08-26T21:13:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ad4caad58d91d3293880f8074f7ad125490ce636'/>
<id>urn:sha1:ad4caad58d91d3293880f8074f7ad125490ce636</id>
<content type='text'>
The special case in amd_pstate_highest_perf_set() is the value used
for calculating the boost numerator.  Merge this into
amd_get_boost_ratio_numerator() and then use that to calculate boost
ratio.

This allows dropping more special casing of the highest perf value.

Reviewed-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
</content>
</entry>
<entry>
<title>x86/amd: Detect preferred cores in amd_get_boost_ratio_numerator()</title>
<updated>2024-09-11T15:23:23Z</updated>
<author>
<name>Mario Limonciello</name>
</author>
<published>2024-08-26T21:13:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=279f838a61f96cbfeb1f9ba060e4a452e6e041d0'/>
<id>urn:sha1:279f838a61f96cbfeb1f9ba060e4a452e6e041d0</id>
<content type='text'>
AMD systems that support preferred cores will use "166" as their
numerator for max frequency calculations instead of "255".

Add a function for detecting preferred cores by looking at the
highest perf value on all cores.

If preferred cores are enabled return 166 and if disabled the
value in the highest perf register. As the function will be called
multiple times, cache the values for the boost numerator and if
preferred cores will be enabled in global variables.

Reviewed-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
</content>
</entry>
<entry>
<title>x86/amd: Move amd_get_highest_perf() out of amd-pstate</title>
<updated>2024-09-11T15:23:23Z</updated>
<author>
<name>Mario Limonciello</name>
</author>
<published>2024-08-26T21:13:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2819bfef6483c66c55064ca678f2630a1a09f3f9'/>
<id>urn:sha1:2819bfef6483c66c55064ca678f2630a1a09f3f9</id>
<content type='text'>
amd_pstate_get_highest_perf() is a helper used to get the highest perf
value on AMD systems.  It's used in amd-pstate as part of preferred
core handling, but applicable for acpi-cpufreq as well.

Move it out to cppc handling code as amd_get_highest_perf().

Reviewed-by: Perry Yuan &lt;perry.yuan@amd.com&gt;
Reviewed-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
</content>
</entry>
<entry>
<title>ACPI: CPPC: Adjust debug messages in amd_set_max_freq_ratio() to warn</title>
<updated>2024-09-11T15:23:22Z</updated>
<author>
<name>Mario Limonciello</name>
</author>
<published>2024-08-26T21:13:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=21fb59ab4b9767085f4fe1edbdbe3177fbb9ec97'/>
<id>urn:sha1:21fb59ab4b9767085f4fe1edbdbe3177fbb9ec97</id>
<content type='text'>
If the boost ratio isn't calculated properly for the system for any
reason this can cause other problems that are non-obvious.

Raise all messages to warn instead.

Suggested-by: Perry Yuan &lt;Perry.Yuan@amd.com&gt;
Reviewed-by: Perry Yuan &lt;perry.yuan@amd.com&gt;
Reviewed-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
</content>
</entry>
<entry>
<title>ACPI: CPPC: Drop check for non zero perf ratio</title>
<updated>2024-09-11T15:23:22Z</updated>
<author>
<name>Mario Limonciello</name>
</author>
<published>2024-08-27T18:50:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3355ac2541052154b6ca0b1263be5bf49dfa0158'/>
<id>urn:sha1:3355ac2541052154b6ca0b1263be5bf49dfa0158</id>
<content type='text'>
perf_ratio is a u64 and SCHED_CAPACITY_SCALE is a large number.
Shifting by one will never have a zero value.

Drop the check.

Suggested-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Reviewed-by: Gautham R. Shenoy &lt;gautham.sheoy@amd.com&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
</content>
</entry>
<entry>
<title>x86/amd: Rename amd_get_highest_perf() to amd_get_boost_ratio_numerator()</title>
<updated>2024-09-11T15:23:22Z</updated>
<author>
<name>Mario Limonciello</name>
</author>
<published>2024-08-26T21:13:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c09e3b445a1a647a5b57ea6afd23e846225dd8f'/>
<id>urn:sha1:6c09e3b445a1a647a5b57ea6afd23e846225dd8f</id>
<content type='text'>
The function name is ambiguous because it returns an intermediate value
for calculating maximum frequency rather than the CPPC 'Highest Perf'
register.

Rename the function to clarify its use and allow the function to return
errors. Adjust the consumer in acpi-cpufreq to catch errors.

Reviewed-by: Gautham R. Shenoy &lt;gautham.shenoy@amd.com&gt;
Signed-off-by: Mario Limonciello &lt;mario.limonciello@amd.com&gt;
</content>
</entry>
</feed>
