tools/testing/selftests/kvm/x86/xen_vmcall_test.c
Source file repositories/reference/linux-study-clean/tools/testing/selftests/kvm/x86/xen_vmcall_test.c
File Facts
- System
- Linux kernel
- Corpus path
tools/testing/selftests/kvm/x86/xen_vmcall_test.c- Extension
.c- Size
- 4009 bytes
- Lines
- 144
- 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
test_util.hkvm_util.hprocessor.hhyperv.h
Detected Declarations
function guest_codefunction main
Annotated Snippet
if (run->exit_reason == KVM_EXIT_XEN) {
TEST_ASSERT_EQ(run->xen.type, KVM_EXIT_XEN_HCALL);
TEST_ASSERT_EQ(run->xen.u.hcall.cpl, 0);
TEST_ASSERT_EQ(run->xen.u.hcall.longmode, 1);
TEST_ASSERT_EQ(run->xen.u.hcall.input, INPUTVALUE);
TEST_ASSERT_EQ(run->xen.u.hcall.params[0], ARGVALUE(1));
TEST_ASSERT_EQ(run->xen.u.hcall.params[1], ARGVALUE(2));
TEST_ASSERT_EQ(run->xen.u.hcall.params[2], ARGVALUE(3));
TEST_ASSERT_EQ(run->xen.u.hcall.params[3], ARGVALUE(4));
TEST_ASSERT_EQ(run->xen.u.hcall.params[4], ARGVALUE(5));
TEST_ASSERT_EQ(run->xen.u.hcall.params[5], ARGVALUE(6));
run->xen.u.hcall.result = RETVALUE;
continue;
}
TEST_ASSERT_KVM_EXIT_REASON(vcpu, KVM_EXIT_IO);
switch (get_ucall(vcpu, &uc)) {
case UCALL_ABORT:
REPORT_GUEST_ASSERT(uc);
/* NOT REACHED */
case UCALL_SYNC:
break;
case UCALL_DONE:
goto done;
default:
TEST_FAIL("Unknown ucall 0x%lx.", uc.cmd);
}
}
done:
kvm_vm_free(vm);
return 0;
}
Annotation
- Immediate include surface: `test_util.h`, `kvm_util.h`, `processor.h`, `hyperv.h`.
- Detected declarations: `function 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.