tools/testing/selftests/kvm/s390/sync_regs_test.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/kvm/s390/sync_regs_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/kvm/s390/sync_regs_test.c- Extension
.c- Size
- 6309 bytes
- Lines
- 239
- 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
fcntl.hstdio.hstdlib.hstring.hsys/ioctl.htest_util.hkvm_util.hdiag318_test_handler.hkselftest.h
Detected Declarations
struct testdeffunction Copyrightfunction compare_regsfunction compare_sregsfunction test_read_invalidfunction test_set_invalidfunction test_req_and_verify_all_valid_regsfunction test_set_and_verify_various_reg_valuesfunction test_clear_kvm_dirty_regs_bitsfunction main
Annotated Snippet
struct testdef {
const char *name;
void (*test)(struct kvm_vcpu *vcpu);
} testlist[] = {
{ "read invalid", test_read_invalid },
{ "set invalid", test_set_invalid },
{ "request+verify all valid regs", test_req_and_verify_all_valid_regs },
{ "set+verify various regs", test_set_and_verify_various_reg_values },
{ "clear kvm_dirty_regs bits", test_clear_kvm_dirty_regs_bits },
};
int main(int argc, char *argv[])
{
struct kvm_vcpu *vcpu;
struct kvm_vm *vm;
int idx;
TEST_REQUIRE(kvm_has_cap(KVM_CAP_SYNC_REGS));
ksft_print_header();
ksft_set_plan(ARRAY_SIZE(testlist));
/* Create VM */
vm = vm_create_with_one_vcpu(&vcpu, guest_code);
for (idx = 0; idx < ARRAY_SIZE(testlist); idx++) {
testlist[idx].test(vcpu);
ksft_test_result_pass("%s\n", testlist[idx].name);
}
kvm_vm_free(vm);
ksft_finished(); /* Print results and exit() accordingly */
}
Annotation
- Immediate include surface: `fcntl.h`, `stdio.h`, `stdlib.h`, `string.h`, `sys/ioctl.h`, `test_util.h`, `kvm_util.h`, `diag318_test_handler.h`.
- Detected declarations: `struct testdef`, `function Copyright`, `function compare_regs`, `function compare_sregs`, `function test_read_invalid`, `function test_set_invalid`, `function test_req_and_verify_all_valid_regs`, `function test_set_and_verify_various_reg_values`, `function test_clear_kvm_dirty_regs_bits`, `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.