[LTP] high_freq_hwp_cap_cppc.c: new test
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Tue Jun 9 14:42:52 CEST 2026
Hi Piotr,
On Tue, Jun 9 2026, Piotr Kubaj wrote:
> high_freq_hwp_cap_cppc.c: new test
> +#include "tst_test.h"
> +#include "tst_safe_prw.h"
> +#include "lapi/cpuid.h"
lapi/cpuid.h contains #error on non-x86 architectures and
__cpuid_count uses x86 inline assembly, so this file will not
compile on ARM, s390x, etc.
Ground rule 6 requires architecture-specific tests to still compile
everywhere. The existing ptrace07.c shows the correct pattern:
wrap the entire file body in
#if defined(__i386__) || defined(__x86_64__) with a
TST_TEST_TCONF("test requires x86") in the #else branch.
> + for (int i = 0; i < nproc; i++)
> + tst_res(TINFO, "cpu%d: %s", i, mismatch[i] ? "MISMATCH" : "OK");
Offline CPUs are skipped during the comparison loop but the
summary still prints "OK" for them (mismatch[i] is zero from
memset). This is misleading -- "OK" implies the values matched
when no check was performed. Consider skipping offline CPUs here
too, or printing "OFFLINE" instead.
> +/*\
> + * Verify for all online logical CPUs that their highest performance value are
> + * the same for HWP Capability MSR 0x771 and CPPC sysfs file.
The test sets .needs_root = 1 but the doc comment does not explain
why root is required. Per the LTP guidelines, the reason should be
stated (reading /dev/cpu/N/msr needs CAP_SYS_RAWIO / root).
Verdict: Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list