tools/testing/selftests/kvm/x86/nested_tsc_scaling_test.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/kvm/x86/nested_tsc_scaling_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/kvm/x86/nested_tsc_scaling_test.c- Extension
.c- Size
- 6363 bytes
- Lines
- 245
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
time.hkvm_util.hvmx.hsvm_util.hkselftest.h
Detected Declarations
function compare_tsc_freqfunction check_tsc_freqfunction l2_guest_codefunction l1_svm_codefunction l1_vmx_codefunction l1_guest_codefunction main
Annotated Snippet
switch (get_ucall(vcpu, &uc)) {
case UCALL_ABORT:
REPORT_GUEST_ASSERT(uc);
case UCALL_SYNC:
switch (uc.args[0]) {
case USLEEP:
sleep(uc.args[1]);
break;
case UCHECK_L1:
l1_tsc_freq = uc.args[1];
printf("L1's TSC frequency is around: %"PRIu64
"\n", l1_tsc_freq);
compare_tsc_freq(l1_tsc_freq,
l0_tsc_freq / l1_scale_factor);
break;
case UCHECK_L2:
l2_tsc_freq = uc.args[1];
printf("L2's TSC frequency is around: %"PRIu64
"\n", l2_tsc_freq);
compare_tsc_freq(l2_tsc_freq,
l1_tsc_freq * L2_SCALE_FACTOR);
break;
}
break;
case UCALL_DONE:
goto done;
default:
TEST_FAIL("Unknown ucall %lu", uc.cmd);
}
}
done:
kvm_vm_free(vm);
return 0;
}
Annotation
- Immediate include surface: `time.h`, `kvm_util.h`, `vmx.h`, `svm_util.h`, `kselftest.h`.
- Detected declarations: `function compare_tsc_freq`, `function check_tsc_freq`, `function l2_guest_code`, `function l1_svm_code`, `function l1_vmx_code`, `function l1_guest_code`, `function main`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.