diff options
author | Sean Christopherson <seanjc@google.com> | 2025-01-18 03:34:53 +0300 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2025-02-12 19:53:59 +0300 |
commit | cd5a0c2f0faeb4a3fab3b78f6693a2d55ee51efa (patch) | |
tree | 7d87a24c6bfe70e0cff7e76a2327e61d3f7d1fe6 /tools/perf/scripts/python/flamegraph.py | |
parent | 0b6db0dc43eefb4f89181546785c3609fd276524 (diff) | |
download | linux-cd5a0c2f0faeb4a3fab3b78f6693a2d55ee51efa.tar.xz |
KVM: selftests: Manage CPUID array in Hyper-V CPUID test's core helper
Allocate, get, and free the CPUID array in the Hyper-V CPUID test in the
test's core helper, instead of copy+pasting code at each call site. In
addition to deduplicating a small amount of code, restricting visibility
of the array to a single invocation of the core test prevents "leaking" an
array across test cases. Passing in @vcpu to the helper will also allow
pivoting on VM-scoped information without needing to pass more booleans,
e.g. to conditionally assert on features that require an in-kernel APIC.
To avoid use-after-free bugs due to overzealous and careless developers,
opportunstically add a comment to explain that the system-scoped helper
caches the Hyper-V CPUID entries, i.e. that the caller is not responsible
for freeing the memory.
Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Link: https://lore.kernel.org/r/20250118003454.2619573-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python/flamegraph.py')
0 files changed, 0 insertions, 0 deletions