-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Syzos: some L2 exits #6472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ramosian-glider
merged 4 commits into
google:master
from
ramosian-glider:syzos-nv-instr
Nov 21, 2025
Merged
Syzos: some L2 exits #6472
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f28aa8a
executor: sys/linux/test: basic CPUID handling in L2
ramosian-glider 35fd579
executor: sys/linux/test: handle RDTSC in L2
ramosian-glider dae84be
executor: x86: factor out common code in rdmsr()/wrmsr()
ramosian-glider 7c8a615
executor: sys/linux/test: handle RDTSCP in L2
ramosian-glider File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # | ||
| # requires: arch=amd64 -threaded | ||
| # | ||
| r0 = openat$kvm(0, &AUTO='/dev/kvm\x00', 0x0, 0x0) | ||
| r1 = ioctl$KVM_CREATE_VM(r0, AUTO, 0x0) | ||
| r2 = syz_kvm_setup_syzos_vm$x86(r1, &(0x7f0000c00000/0x400000)=nil) | ||
|
|
||
| # Create a nested VM that performs CPUID (0f a2) and HLT (f4). | ||
| # | ||
| r3 = syz_kvm_add_vcpu$x86(r2, &AUTO={0x0, &AUTO=[@enable_nested={AUTO, AUTO, 0x0}, @nested_create_vm={AUTO, AUTO, 0x0}, @nested_load_code={AUTO, AUTO, {0x0, "0fa2f4"}}, @nested_vmlaunch={AUTO, AUTO, 0x0}, @nested_vmresume={AUTO, AUTO, 0x0}], AUTO}) | ||
| r4 = ioctl$KVM_GET_VCPU_MMAP_SIZE(r0, AUTO) | ||
| r5 = mmap$KVM_VCPU(&(0x7f0000009000/0x1000)=nil, r4, 0x3, 0x1, r3, 0x0) | ||
|
|
||
| # L2 VM executes CPUID. Exit reason is mapped to 0xe2e20003. | ||
| # | ||
| ioctl$KVM_RUN(r3, AUTO, 0x0) | ||
| syz_kvm_assert_syzos_uexit$x86(r5, 0xe2e20003) | ||
|
|
||
| # L1 resumes L2, which executes HLT. Exit reason is mapped to 0xe2e20001. | ||
| # | ||
| ioctl$KVM_RUN(r3, AUTO, 0x0) | ||
| syz_kvm_assert_syzos_uexit$x86(r5, 0xe2e20001) | ||
|
|
||
| # guest_main should finish with guest_uexit(-1). | ||
| # | ||
| ioctl$KVM_RUN(r3, AUTO, 0x0) | ||
| syz_kvm_assert_syzos_uexit$x86(r5, 0xffffffff) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # | ||
| # requires: arch=amd64 -threaded | ||
| # | ||
| r0 = openat$kvm(0, &AUTO='/dev/kvm\x00', 0x0, 0x0) | ||
| r1 = ioctl$KVM_CREATE_VM(r0, AUTO, 0x0) | ||
| r2 = syz_kvm_setup_syzos_vm$x86(r1, &(0x7f0000c00000/0x400000)=nil) | ||
|
|
||
| # Create a nested VM that performs RDTSC (0f 31) and HLT (f4). | ||
| # | ||
| r3 = syz_kvm_add_vcpu$x86(r2, &AUTO={0x0, &AUTO=[@enable_nested={AUTO, AUTO, 0x0}, @nested_create_vm={AUTO, AUTO, 0x0}, @nested_load_code={AUTO, AUTO, {0x0, "0f31f4"}}, @nested_vmlaunch={AUTO, AUTO, 0x0}, @nested_vmresume={AUTO, AUTO, 0x0}], AUTO}) | ||
| r4 = ioctl$KVM_GET_VCPU_MMAP_SIZE(r0, AUTO) | ||
| r5 = mmap$KVM_VCPU(&(0x7f0000009000/0x1000)=nil, r4, 0x3, 0x1, r3, 0x0) | ||
|
|
||
| # L2 VM executes CPUID. Exit reason is mapped to 0xe2e20004. | ||
| # | ||
| ioctl$KVM_RUN(r3, AUTO, 0x0) | ||
| syz_kvm_assert_syzos_uexit$x86(r5, 0xe2e20004) | ||
|
|
||
| # L1 resumes L2, which executes HLT. Exit reason is mapped to 0xe2e20001. | ||
| # | ||
| ioctl$KVM_RUN(r3, AUTO, 0x0) | ||
| syz_kvm_assert_syzos_uexit$x86(r5, 0xe2e20001) | ||
|
|
||
| # guest_main should finish with guest_uexit(-1). | ||
| # | ||
| ioctl$KVM_RUN(r3, AUTO, 0x0) | ||
| syz_kvm_assert_syzos_uexit$x86(r5, 0xffffffff) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # | ||
| # requires: arch=amd64 -threaded | ||
| # | ||
| r0 = openat$kvm(0, &AUTO='/dev/kvm\x00', 0x0, 0x0) | ||
| r1 = ioctl$KVM_CREATE_VM(r0, AUTO, 0x0) | ||
| r2 = syz_kvm_setup_syzos_vm$x86(r1, &(0x7f0000c00000/0x400000)=nil) | ||
|
|
||
| # Create a nested VM that performs RDTSCP (0f 01 f9) and HLT (f4). | ||
| # | ||
| r3 = syz_kvm_add_vcpu$x86(r2, &AUTO={0x0, &AUTO=[@enable_nested={AUTO, AUTO, 0x0}, @nested_create_vm={AUTO, AUTO, 0x0}, @nested_load_code={AUTO, AUTO, {0x0, "0f01f9f4"}}, @nested_vmlaunch={AUTO, AUTO, 0x0}, @nested_vmresume={AUTO, AUTO, 0x0}], AUTO}) | ||
| r4 = ioctl$KVM_GET_VCPU_MMAP_SIZE(r0, AUTO) | ||
| r5 = mmap$KVM_VCPU(&(0x7f0000009000/0x1000)=nil, r4, 0x3, 0x1, r3, 0x0) | ||
|
|
||
| # L2 VM executes CPUID. Exit reason is mapped to 0xe2e20005. | ||
| # | ||
| ioctl$KVM_RUN(r3, AUTO, 0x0) | ||
| syz_kvm_assert_syzos_uexit$x86(r5, 0xe2e20005) | ||
|
|
||
| # L1 resumes L2, which executes HLT. Exit reason is mapped to 0xe2e20001. | ||
| # | ||
| ioctl$KVM_RUN(r3, AUTO, 0x0) | ||
| syz_kvm_assert_syzos_uexit$x86(r5, 0xe2e20001) | ||
|
|
||
| # guest_main should finish with guest_uexit(-1). | ||
| # | ||
| ioctl$KVM_RUN(r3, AUTO, 0x0) | ||
| syz_kvm_assert_syzos_uexit$x86(r5, 0xffffffff) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.