tools/testing/selftests/kvm/x86/nested_dirty_log_test.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/kvm/x86/nested_dirty_log_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/kvm/x86/nested_dirty_log_test.c- Extension
.c- Size
- 8496 bytes
- Lines
- 294
- 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
stdio.hstdlib.hlinux/bitmap.hlinux/bitops.htest_util.hkvm_util.hprocessor.hsvm_util.hvmx.h
Detected Declarations
function Copyrightfunction l2_guest_code_tdp_enabledfunction l2_guest_code_tdp_disabledfunction l1_vmx_codefunction l1_svm_codefunction l1_guest_codefunction test_handle_ucall_syncfunction test_dirty_logfunction faultsfunction main
Annotated Snippet
switch (get_ucall(vcpu, &uc)) {
case UCALL_ABORT:
REPORT_GUEST_ASSERT(uc);
/* NOT REACHED */
case UCALL_SYNC:
test_handle_ucall_sync(vm, uc.args[1], bmap);
break;
case UCALL_DONE:
done = true;
break;
default:
TEST_FAIL("Unknown ucall %lu", uc.cmd);
}
}
}
int main(int argc, char *argv[])
{
TEST_REQUIRE(kvm_cpu_has(X86_FEATURE_VMX) || kvm_cpu_has(X86_FEATURE_SVM));
test_dirty_log(/*nested_tdp=*/false);
if (kvm_cpu_has_tdp())
test_dirty_log(/*nested_tdp=*/true);
return 0;
}
Annotation
- Immediate include surface: `stdio.h`, `stdlib.h`, `linux/bitmap.h`, `linux/bitops.h`, `test_util.h`, `kvm_util.h`, `processor.h`, `svm_util.h`.
- Detected declarations: `function Copyright`, `function l2_guest_code_tdp_enabled`, `function l2_guest_code_tdp_disabled`, `function l1_vmx_code`, `function l1_svm_code`, `function l1_guest_code`, `function test_handle_ucall_sync`, `function test_dirty_log`, `function faults`, `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.